FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to Load two form

 
Post new topic   Reply to topic     Forum Index -> flowerd
View previous topic :: View next topic  
Author Message
yidabu



Joined: 21 Apr 2007
Posts: 87

PostPosted: Tue Mar 25, 2008 5:17 pm    Post subject: How to Load two form Reply with quote

I've written a small program for myself with flowerd, HTMLayout, DFL, It's beautiful, small size, and fast.

thanks, bobef!

the question is, if I have a about form, use loadHTML too, the program crashed, is it possible to use loadHTML in two forms ?
_________________
D yuyan
Back to top
View user's profile Send private message
bobef



Joined: 05 Jun 2005
Posts: 269

PostPosted: Thu Mar 27, 2008 6:22 am    Post subject: Reply with quote

Hmm... I think it should work if you make a new HLayout object with the new HWND, but I've never tested this case. Please give me a note if you make it work.

Otherwise you could probably make a popup window with HElement.showAsPopupAt .
Back to top
View user's profile Send private message
yidabu



Joined: 21 Apr 2007
Posts: 87

PostPosted: Thu Mar 27, 2008 7:02 pm    Post subject: Reply with quote

thanks, works fine now.
_________________
D yuyan
Back to top
View user's profile Send private message
simhau



Joined: 06 Feb 2007
Posts: 55

PostPosted: Tue Apr 15, 2008 4:11 am    Post subject: Reply with quote

I dont get it Sad

Code:
class layout2 : HLayout
{
  this(void* handle, char[] media="screen")
  {
    super( handle, media );
    loadHTML("test2.htm");
  }
}

class form : HLayoutForm
{
  this()
  {
    super();
    loadHTML("test.htm");
    new layout2(handle); // Should this pop up a new form?
  }
}
Back to top
View user's profile Send private message
bobef



Joined: 05 Jun 2005
Posts: 269

PostPosted: Tue Apr 15, 2008 5:18 am    Post subject: Reply with quote

No, you should have two forms, loading different document in each of them. Something like that (pseudo code):

Code:
class form : HLayoutForm
{
  this()
  {
    super();
    loadHTML("test.htm");
  }
}

class form2 : HLayoutForm
{
  this()
  {
    super();
    loadHTML("test2.htm");
  }
}
Back to top
View user's profile Send private message
simhau



Joined: 06 Feb 2007
Posts: 55

PostPosted: Tue Apr 15, 2008 5:46 am    Post subject: Reply with quote

But if I create a second form with new Form() I get an exception: "One SyncExec instance per GUI thread!"
Back to top
View user's profile Send private message
bobef



Joined: 05 Jun 2005
Posts: 269

PostPosted: Tue Apr 15, 2008 9:43 am    Post subject: Reply with quote

Hmmm.. Never thought about that. I should fix it. In the mean time you can edit flowerd.dlf, find your constructor and comment synCtor();. Thats in case you are not using the asyncExec function,but I guess you are not, because I haven't mentioned it anywhere. But I should it is very useful (for multithreaded apps). You guys should take a look at flowerd.syncexec. It provides some timer functions and asynchronous execution and they are mixed in in the form class...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> flowerd All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group