From: [email protected] [mailto:[email protected]] On Behalf Of Paul McNett Sent: Friday, May 21, 2010 3:31 PM To: Dabo Users list Subject: Re: [dabo-users]Open a new form within the application frame (not as new window)
On 5/20/10 10:20 PM, Martinecz Miklós wrote: > From: [email protected] [mailto:[email protected]] On > Behalf Of Paul McNett > Sent: Thursday, May 20, 2010 11:18 PM > To: Dabo Users list > Subject: Re: [dabo-users]Open a new form within the application frame (not > as new window) > > On 5/20/10 2:03 PM, Ed Leafe wrote: >> On May 20, 2010, at 4:41 PM, Paul McNett wrote: >> >>> On 5/20/10 10:36 AM, Ed Leafe wrote: >>>> On May 20, 2010, at 1:06 PM, Martinecz Miklós wrote: >>>> >>>>> This time I have no error message and the child opens but not in the > place >>>>> of the main form as I would expect. (I placed the 'dabo.MDI = True' > just >>>>> under the 'import Dabo' line in the main.py file.) >>>> >>>> It should open up as a "window within a window". In other words, > your main form should be a big blank window, with your child forms > completely enclosed within that main form. >>> >>> The main form needs to descend from dabo.ui.dFormMain, and not > dabo.ui.dForm. Could >>> this be the issue? >> >> >> I doubt it, as I already specified that. > > You specified to have self.Application.MainForm as the parent. However, > self.Application.MainForm doesn't necessarily descend from dFormMain, which > is why I thought I'd mention it. > > Paul > > **** > > Hi, > > The confusion can arise due to my misunderstanding. > I have two forms, say, firstForm and secondForm. > Both are created in the CD. > > The firstForm is given as main form in the Main.py like this: > app.MainFormClass = "firstFrom.cdxml". 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) Since self and self.Application.MainForm are, in this case, the same object. Note that you shouldn't be using hard-coded absolute pathing, but let's not discuss that part right now, just be aware that you are going to want to change that some time in the future. > Possible problem can be also, that the firstFrom is not empty but contains > editboxes and controlls. May be I should create an empty 'frame' window and > call my forms within that frame. I think that someone has been successful creating controls on the MDI Parent, but in general I don't think it works very well. The MDI parent should be basically an empty frame with menu bar and status bar. Paul ******** Hi Paul, I have tried to apply the MDI feature with an empty from, that is, using this empty form as a main form and open child form within this window. The child form still appears out of frames of the main form. Actually, introducing a new empty window in the structure did not change the final result. One thing I may do wrong. When I wrote before: *** The firstForm is given as main form in the Main.py like this: app.MainFormClass = "firstFrom.cdxml". *** you made a note as follows: *** The form defined by firstForm.cdxml needs to derive from dabo.ui.dFormMain, and not dabo.ui.dForm. *** Did you mean that my way is not the correct one? Should I change something here? I mean: isn't it enough to write ***app.MainFormClass = "firstFrom.cdxml*** ? Should I 'derive' the firstForm from dFormMain in another way? If the above way is not correct, I don't know how to implement your suggestion into practice. 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/!~!UENERkVCMDkAAQACAAAAAAAAAAAAAAAAABgAAAAAAAAACkGPannGP0urGxVyyklpm8KAAAAQAAAAvoa7GEE3HEOZpkc/[email protected]
