MDI Form Project 
Author Message
 MDI Form Project

I'm trying to create an MDI form and am having problems.  The top
level form frmMain (ShowWindow = 2) has a button bar at the bottom and
that's all.  I'd like to have another form, frmStatus, pop up
immediately as a child window to frmMain, but I'm onclear on where to
put the DO FORM code to create this form.  The help file says not to
place it in the Init event, so I'm wonder where the best place to put
it is.  Also, different events in the main form will cause other child
windows to pop-up.  What's the best method for keeping track of open
windows and whatnot?  I'm looking for anything pointing me in the
right direction, as this is the first MDI project I've attempted.

Thanks!



Fri, 02 Sep 2005 08:16:33 GMT  
 MDI Form Project


Quote:
> I'm trying to create an MDI form and am having problems.  The top
> level form frmMain (ShowWindow = 2) has a button bar at the bottom and
> that's all.  I'd like to have another form, frmStatus, pop up
> immediately as a child window to frmMain, but I'm onclear on where to
> put the DO FORM code to create this form.  The help file says not to
> place it in the Init event, so I'm wonder where the best place to put
> it is.

Do you have a "main.prg" in your project?
If so, you could Do both forms there, with the AsTopLevel form
first and the InTopLevel following, right before the Read Events.
Or alternatively...

Quote:
>  Also, different events in the main form will cause other child
> windows to pop-up.  What's the best method for keeping track of open
> windows and whatnot?  I'm looking for anything pointing me in the
> right direction, as this is the first MDI project I've attempted.

.. use a "form manager" - for example a custom method of your
main form, say "CallStatusForm()"
If you'd issue Thisform.CallStatusForm() from somewhere, the
method might use a custom property
    Thisform.AddProperty('frmStatus')  && or create it at design time
to either issue Do Form with its Name clause as long as the child
form does not exist yet:
    if vartype(Thisform.frmStatus) <> 'O'
        do form frmStatus.scx name Thisform.frmStatus
&& or show the form if it's already there:
    else
        Thisform.frmStatus.Show()
    endif

If you'd do it the second way, your "main.prg" could look like
    do form frmmain.scx name oMainform
    oMainform.CallStatusForm()
    read events

Of course CallStatusForm() could be more general "CallForm()"
and determine the desired child form by evaluating a parameter

hth
-Stefan



Fri, 02 Sep 2005 18:36:47 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. MDI forms

2. Creating An MDI Form

3. MDI form

4. Dynamic menus, Systems menus and MDI forms

5. MDI forms - how arrange windows

6. Creating A Toolbar In MDI Form Please Help!

7. ToolBar in MDI form

8. Print preview using MDI forms

9. MDI Child forms in an SDI Parent

10. MDI app and Form classes

11. VB Style of MDI Forms

12. MDI Forms

 

 
Powered by phpBB® Forum Software