| Home | Previous Lesson: Resizing the Controls Automatically Next Lesson: Displaying About Window |
PowerBuilder allows you to arrange sheets in four different ways: cascade, tile, horizontal tile or layer. The script to do this is just one single line, so write the following script to the clicked event, for each option under the Window menu item:
// Object: Window/Vertical in m_sheet_menu
// Event: Clicked
ParentWindow.ArrangeSheets( Tile!)
// Object: Window/Horizontal in m_sheet_menu
// Event: Clicked
ParentWindow.ArrangeSheets( TileHorizontal!)
// Object: Window/Layer in m_sheet_menu
// Event: Clicked
ParentWindow.ArrangeSheets( Layer!)
// Object: Window/Cascade in m_sheet_menu
// Event: Clicked
ParentWindow.ArrangeSheets( Cascade!)
Notice that the argument for ArrangeSheet() function is Cascade!, and for OpenSheet() function it is Cascaded!. The same is true for Layer!, Layered! for OpenSheet(). This can be confusing!
All four parameters only affect the sheets that are currently open and active. To arrange minimized icons, you could add a new menu item, say 'Arrange Icons', and use the same code with the argument Icons!.
We've now seen how to open and close instances of w_product_master window and how to arrange sheets in the MDI frame. To test this functionality, open multiple instances of w_product_master and select the options from the menu and see if they work or not.
| Home | Previous Lesson: Resizing the Controls Automatically Next Lesson: Displaying About Window |