
Guidelines Example 001.                      Guidelines Tech Support  26jan94

This example is released to demonstrate one or more techniques. No warranties 
expressed or implied. (c) JBA 1994 - adapted from code by Greg Jones [JBA].


              Multiple Child Windows under Guidelines              
              ---------------------------------------


The accompanying file, CHILDX.GUI is a simple example of a way to construct 
multiple modeless child windows within a frame, giving a similar appearance 
to an MDI application. It is compatible with Guidelines V2.0G and later.

There are only really three JOT rountines behind this, the Frame Create() and
Size() methods do the work, and the "Arrange" menu click event handler which 
simply calls the Size() method.

The JOT code is shown below:



VOID Frame1.Create ()
    ; Load the child windows
    Child1.Load (NullWindow)
    Child2.Load (NullWindow)
    Child3.Load (NullWindow)
    
    ; Set their parent to Frame1 so they are clipped to it
    Child1.Parent = Frame1
    Child2.Parent = Frame1
    Child3.Parent = Frame1
    
    ; Activate them
    Child2.Activate ()
    Child3.Activate ()
    Child1.Activate () ; activated last so it has active title.
    
    ; Cause them to be resized
    Frame1.Size ()
end



VOID Frame1.Size ()
    LONG x, y, cx, cy
    
    Frame1.GetClientRect (x, y, cx, cy)
    
    ; Child 1 takes up the top half of the client
    if Child1
    then
        Child1.XPos   = 0
        Child1.YPos   = cy / 2
        Child1.Height = cy / 2
        Child1.Width  = cx
    endif
    
    ; Child 2 takes up the left half of the bottom half of the client
    if Child2
    then
        Child2.XPos   = 0
        Child2.YPos   = 0
        Child2.Height = cy / 2
        Child2.Width  = cx / 2
    endif
    
    ; Child 3 takes up the right half of the bottom half of the client
    if Child3
    then
        Child3.XPos   = cx / 2
        Child3.YPos   = 0
        Child3.Height = cy / 2
        Child3.Width  = cx / 2
    endif
end


VOID Frame1.MenuItem4.Click ()
    Frame1.Size()
end





Please address any questions regarding either this sample, or the Guidelines 
product in general to:

    Jon Wright - Guidelines Tech Support
    CompuServe 100316,3353
    Internet   100316.3353@compuserve.com

Preferably these should be posted in Section 1 of the OS2AVEN forum, although 
direct email is accepted.
