From: [email protected] [mailto:[email protected]] On
Behalf Of Paul McNett
Sent: Friday, May 21, 2010 5:01 PM
To: Dabo Users list
Subject: Re: [dabo-users] Open a new form within the application frame(not
as new window)

On 5/21/10 7:19 AM, John wrote:
> On Friday 21 May 2010 06:31:19 am Paul McNett wrote:
>> The form defined by firstForm.cdxml needs to derive from
dabo.ui.dFormMain,
>> and not dabo.ui.dForm.
>>
>>> I put the following code in the afterInitAll of the firstForm:
>>>        frm=dabo.ui.createForm("c:\Projects\UTerv\ui\secondForm.cdxml",
>>> ...self.Application.MainForm)
>>>        frm.show()
>>
>> It would be equivalent to say:
>>
>> frm = dabo.ui.createForm("c:\Projects\UTerv\ui\secondForm.cdxml", self)
>
> Paul now I'm confused.  As I read this thread the poster has added
> "MDI = True" to the first form or calling form.  It is my understanding
that
> adding MDI will force the first form to derive from "dabo.ui.dFormMain".
> Maybe this has not been done?

Setting dabo.settings.MDI to True changes dForm to derive from
wx.MDIChildFrame and 
dFormMain to derive from wx.MDIParentFrame. That is all it does. It *does
not* make 
Application.MainForm derive from dFormMain.

For MDI to work in Dabo, you need to satisfy all these things:

+ dabo.settings.MDI = True

+ parent form needs to derive from dabo.ui.dFormMain

+ child forms need to derive from dabo.ui.dForm

It actually isn't required for Application.MainForm to refer to the
dFormMain 
instance, but I can't see why it wouldn't in all normal cases.

> Therefore, the posters code to start the second form is correct in my
mind.
> Am I wrong?

It was fine. I was just pointing out that 'self' and
'self.Application.MainForm' are 
the same object in this case.

> It could be that the issue is - he has added objects/controls to the first
> form. I would think it could cause issues.

I don't think adding objects to dFormMain in an MDI context would work very
well.

> Added thought - the ClassDesigner does not provide an easy way to set the
MDI
> property.  Maybe the opening screen could provide a "MDI Form" or some
such
> description.

All that is needed, beyond making the child frames instantiate in a
dFormMain 
instance, is to set dabo.settings.MDI = True, before the forms instantiate.

This would likely go in the bootstrap code (the main .py file) before the
application 
was even instantiated:

import dabo
dabo.settings.MDI = True

app = dabo.dApp(...)
...


Not sure how to make that a class designer setting, since the class designer
edits 
individual classes, not applications as a whole.

Paul

****************

Hi Paul and John,

Thanks for discussing this topic.
I will make some more trial based on the information in your posts, and let
you know what are the results.

Best regards,
Miklós


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: 
http://leafe.com/archives/byMID/!~!uenerkvcmdkaaqacaaaaaaaaaaaaaaaaabgaaaaaaaaackgpanngp0urgxvyyklpm8kaaaaqaaaadncsf9+kg0+g99vc1go9hgeaa...@upcmail.hu

Reply via email to