View previous topic :: View next topic |
Author |
Message |
yidabu
Joined: 21 Apr 2007 Posts: 87
|
Posted: Tue Mar 25, 2008 5:17 pm Post subject: How to Load two form |
|
|
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 |
|
|
bobef
Joined: 05 Jun 2005 Posts: 269
|
Posted: Thu Mar 27, 2008 6:22 am Post subject: |
|
|
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 |
|
|
yidabu
Joined: 21 Apr 2007 Posts: 87
|
Posted: Thu Mar 27, 2008 7:02 pm Post subject: |
|
|
thanks, works fine now. _________________ D yuyan |
|
Back to top |
|
|
simhau
Joined: 06 Feb 2007 Posts: 55
|
Posted: Tue Apr 15, 2008 4:11 am Post subject: |
|
|
I dont get it
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 |
|
|
bobef
Joined: 05 Jun 2005 Posts: 269
|
Posted: Tue Apr 15, 2008 5:18 am Post subject: |
|
|
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 |
|
|
simhau
Joined: 06 Feb 2007 Posts: 55
|
Posted: Tue Apr 15, 2008 5:46 am Post subject: |
|
|
But if I create a second form with new Form() I get an exception: "One SyncExec instance per GUI thread!" |
|
Back to top |
|
|
bobef
Joined: 05 Jun 2005 Posts: 269
|
Posted: Tue Apr 15, 2008 9:43 am Post subject: |
|
|
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 |
|
|
|