home *** CD-ROM | disk | FTP | other *** search
- Save Format v1.3
- @begin Form "FormParent"
- Exported 0;
-
- @begin Object "WMDIParent"
- WSCaption 1;
- WSSizeable 1;
- WSDlgBorder 1;
- WSSysMenu 1;
- WSSystemMenu 1;
- WSMinimizeBox 1;
- WSMaximizeBox 1;
- WSGroup 1;
- WSTabStop 1;
- WSResizeBorder 1;
- WSVisible 1;
- Font "8.MS Sans Serif";
- StatusBar "StatusBarAtBottom";
- Icon "WIcon( WResourceID( ICON_01 ) )";
- FormPositionType "Centered";
- FormAbsTop "99";
- FormAbsLeft "12";
- Text "MDI";
- @begin Event "Close"
- GencodeSrcLine 168;
- FunctionName "FormParent::FormParent_Close";
- @end;
- @begin Event "Create"
- GencodeSrcLine 182;
- FunctionName "FormParent::FormParent_Create";
- @end;
- @begin Event "User"
- GencodeSrcLine 199;
- FunctionName "FormParent::FormParent_User";
- @end;
- @begin UserFunction "FormParent()"
- Compiler 1;
- GencodeSrcLine 218;
- FunctionName "FormParent::FormParent()";
- @end;
- @begin UserFunction "~FormParent()"
- Compiler 1;
- GencodeSrcLine 222;
- FunctionName "FormParent::~FormParent()";
- @end;
- @begin UserFunction "addChild( void )"
- Private 1;
- GencodeSrcLine 226;
- FunctionName "FormParent::addChild( void )";
- @end;
- @begin UserFunction "Prototype for addChild( void )"
- Private 1;
- GencodeSrcLine 96;
- FunctionName "FormParent::Prototype for addChild( void )";
- @end;
- @begin UserFunction "minimalMenu( void )"
- Private 1;
- GencodeSrcLine 260;
- FunctionName "FormParent::minimalMenu( void )";
- @end;
- @begin UserFunction "Prototype for minimalMenu( void )"
- Private 1;
- GencodeSrcLine 98;
- FunctionName "FormParent::Prototype for minimalMenu( void )";
- @end;
- @begin UserFunction "fullMenu( void )"
- Private 1;
- GencodeSrcLine 280;
- FunctionName "FormParent::fullMenu( void )";
- @end;
- @begin UserFunction "Prototype for fullMenu( void )"
- Private 1;
- GencodeSrcLine 100;
- FunctionName "FormParent::Prototype for fullMenu( void )";
- @end;
- ResID 102;
- DesignName FormParent;
- TabIndex 0;
- DesignRect 4,115,200,160;
- @end;
-
- @begin Menu
- ItemCount 1;
- DesignName "menu_1";
- IsDefault 1;
- ResID 101;
- DesignRect 175,0,19,17;
- @begin Event "InitMenu"
- GencodeSrcLine 299;
- FunctionName "FormParent::menu_1_InitMenu";
- @end;
- @begin Popup
- Name "item_File";
- Caption "&File";
- NegotiatePosition None;
- @begin Item
- Name "item_New";
- Caption "&New";
- ResID 1015;
- NegotiatePosition None;
- @begin Event "Click"
- GencodeSrcLine 360;
- FunctionName "FormParent::menu_1_item_New_Click";
- @end;
- @end;
- @begin Item
- Name "item_Close";
- Caption "&Close";
- ResID 1016;
- NegotiatePosition None;
- @begin Event "Click"
- GencodeSrcLine 340;
- FunctionName "FormParent::menu_1_item_Close_Click";
- @end;
- @end;
- Separator ;
- @begin Item
- Name "item_Exit";
- Caption "E&xit";
- ResID 1018;
- NegotiatePosition None;
- @begin Event "Click"
- GencodeSrcLine 352;
- FunctionName "FormParent::menu_1_item_Exit_Click";
- @end;
- @end;
- @end;
- @begin Popup
- Name "item_Edit";
- Caption "&Edit";
- NegotiatePosition None;
- @begin Item
- Name "item_Cut";
- Caption "Cu&t";
- ResID 1012;
- NegotiatePosition None;
- @end;
- @begin Item
- Name "item_Copy";
- Caption "&Copy";
- ResID 1013;
- NegotiatePosition None;
- @end;
- @begin Item
- Name "item_Paste";
- Caption "&Paste";
- ResID 1014;
- NegotiatePosition None;
- @end;
- @end;
- @begin Popup
- Name "item_Window";
- Caption "&Window";
- NegotiatePosition None;
- @begin Item
- Name "item_Cascade";
- Caption "&Cascade";
- ResID 1005;
- NegotiatePosition None;
- @begin Event "Click"
- GencodeSrcLine 331;
- FunctionName "FormParent::menu_1_item_Cascade_Click";
- @end;
- @end;
- @begin Item
- Name "item_TileHorizontal";
- Caption "Tile &Horizontal";
- ResID 1006;
- NegotiatePosition None;
- @begin Event "Click"
- GencodeSrcLine 386;
- FunctionName "FormParent::menu_1_item_TileHorizontal_Click";
- @end;
- @end;
- @begin Item
- Name "item_TileVertical";
- Caption "Tile &Vertical";
- ResID 1007;
- NegotiatePosition None;
- @begin Event "Click"
- GencodeSrcLine 395;
- FunctionName "FormParent::menu_1_item_TileVertical_Click";
- @end;
- @end;
- @begin Item
- Name "item_ArrangeIcons";
- Caption "&Arrange Icons";
- ResID 1008;
- NegotiatePosition None;
- @begin Event "Click"
- GencodeSrcLine 322;
- FunctionName "FormParent::menu_1_item_ArrangeIcons_Click";
- @end;
- @end;
- Separator ;
- @begin Item
- Name "item_Next";
- Caption "&Next";
- ResID 1010;
- NegotiatePosition None;
- @begin Event "Click"
- GencodeSrcLine 368;
- FunctionName "FormParent::menu_1_item_Next_Click";
- @end;
- @end;
- @begin Item
- Name "item_Previous";
- Caption "&Previous";
- ResID 1011;
- NegotiatePosition None;
- @begin Event "Click"
- GencodeSrcLine 377;
- FunctionName "FormParent::menu_1_item_Previous_Click";
- @end;
- @end;
- @end;
- @begin Popup
- Name "item_Help";
- Caption "&Help";
- NegotiatePosition None;
- @begin Item
- Name "item_About";
- Caption "&About";
- ResID 1004;
- NegotiatePosition None;
- @begin Event "Click"
- GencodeSrcLine 313;
- FunctionName "FormParent::menu_1_item_About_Click";
- @end;
- @end;
- @end;
- @end;
-
- @begin Object "WFormProxy"
- FormClass "AboutBox";
- ResID 102;
- DesignName AboutBox1;
- TabIndex 1;
- DesignRect 175,15,19,17;
- @end;
-
- @begin HPPPrefixBlock
- @begin-code HPPPrefix
-
- // Declarations added here will be included at the top of the .HPP file
- #include <formChild1.hpp>
-
- @end-code;
- GencodeSrcLine 11;
- @end;
-
- @begin CPPPrefixBlock
- @begin-code CPPPrefix
-
- // Code added here will be included at the top of the .CPP file
-
- // Include definitions for resources.
- #include "WRes.h"
-
- @end-code;
- GencodeSrcLine 10;
- @end;
-
- @begin ClassContentsBlock
- @begin-code ClassContents
-
- private:
- // add your private instance data here
- WVector<WMDIChild> _childWindowVector;
- WPopupMenu *_editMenu;
- WPopupMenu *_windowMenu;
- WMenuItem *_closeItem;
-
- @end-code;
- GencodeSrcLine 90;
- @end;
-
- @begin-code GeneratedClassContents
-
- FormParent();
- ~FormParent();
-
- @end-code;
-
- @begin-code Code "FormParent::FormParent()"
-
- @@CLASSNAME@::@CLASSNAME@()
- {
-
- }
-
- @end-code;
-
- @begin-code Code "FormParent::~FormParent()"
-
- @@CLASSNAME@::~@CLASSNAME@()
- {
-
- }
-
- @end-code;
-
- @begin-code Code "FormParent::addChild( void )"
-
- void @CLASSNAME@::addChild( void )
- {
- FormChild *formChild;
- WString caption;
- WMDIChild *currentMDIChild;
- WWindowState currentState;
- static childNumber = 1;
-
- // Choose a window state for the new child
- currentMDIChild = GetActiveChild();
- if( currentMDIChild ) {
- currentState = currentMDIChild->GetWindowState();
- }
-
- // Instantiate a new MDI child form
- formChild = new FormChild;
- formChild->Create( this );
-
- if( currentState == WWindowStateMaximized ) {
- formChild->SetWindowState( WWindowStateMaximized );
- }
-
- // append the child window vector
- _childWindowVector.Append( formChild );
-
- // Set the child window caption
- caption.Sprintf( "MDI Child %d", childNumber++ );
- formChild->SetText( caption );
-
- // If this is the first child window, switch to full menus
- if( _childWindowVector.GetCount() == 1 ) {
- fullMenu();
- }
- }
-
- @end-code;
-
- @begin-code Code "FormParent::Prototype for addChild( void )"
-
- private:
- void addChild( void );
-
- @end-code;
-
- @begin-code Code "FormParent::minimalMenu( void )"
-
- void @CLASSNAME@::minimalMenu( void )
- {
- WPopupMenu *fileMenu;
-
- // remove the edit menu
- _editMenu = menu_1->RemovePopup( menu_1_item_Edit );
-
- // remove the window menu
- _windowMenu = menu_1->RemovePopup( menu_1_item_Window );
-
- // get the file popup menu
- fileMenu = menu_1_item_File;
-
- // remove the Close menu item
- _closeItem = fileMenu->RemoveItem( menu_1_item_Close );
-
- // update the menu
- UpdateMenu();
-
- }
-
- @end-code;
-
- @begin-code Code "FormParent::Prototype for minimalMenu( void )"
-
- private:
- void minimalMenu( void );
-
- @end-code;
-
- @begin-code Code "FormParent::fullMenu( void )"
-
- void @CLASSNAME@::fullMenu( void )
- {
- WPopupMenu *fileMenu;
-
- // add the edit menu
- menu_1->AddPopup( _editMenu, 1 );
-
- // remove the window menu
- menu_1->AddPopup( _windowMenu, 2);
-
- // get the file popup menu
- fileMenu = menu_1_item_File;
-
- // add the Close menu item
- fileMenu->AddItem( _closeItem, 1 );
-
- // update the menu
- UpdateMenu();
- }
-
- @end-code;
-
- @begin-code Code "FormParent::Prototype for fullMenu( void )"
-
- private:
- void fullMenu( void );
-
- @end-code;
-
- @begin-code Code "FormParent::FormParent_Close"
-
- WBool @CLASSNAME@::FormParent_Close(
- WObject * source,
- WEventData * event )
- {
- // cleanup
- if( _editMenu ) delete _editMenu;
- if( _windowMenu ) delete _windowMenu;
- if( _closeItem ) delete _closeItem;
-
- // Delete any remaining child windows
- _childWindowVector.Clear( TRUE );
-
- return FALSE;
- }
-
- @end-code;
-
- @begin-code Code "FormParent::FormParent_Create"
-
- WBool @CLASSNAME@::FormParent_Create(
- WObject * source,
- WCreateEventData * event )
- {
- WMenuObject * windowMenu;
- WRect clientRectangle;
-
- // Set the window menu property. This tells the component library
- // where to put the list of MDI child windows.
- windowMenu = menu_1->Find( "&Window", 0, true );
- SetWindowMenu( (WMenu*)windowMenu );
-
- // Use the minimal menu
- minimalMenu();
-
- return FALSE;
- }
-
- @end-code;
-
- @begin-code Code "FormParent::FormParent_User"
-
- WBool @CLASSNAME@::FormParent_User(
- WObject * source,
- WUserEventData * event )
- {
- FormChild *child;
-
- // Child windows post a message back to us (the parent window) asking
- // to be closed.
- child = (FormChild *)event->data;
- _childWindowVector.Remove( child );
- delete child;
-
- // If we just closed the last child window, switch back to the minimial menu
- if( _childWindowVector.GetCount() == 0 ) {
- minimalMenu();
- }
-
- return FALSE;
- }
-
- @end-code;
-
- @begin-code Code "FormParent::menu_1_InitMenu"
-
- WBool @CLASSNAME@::menu_1_InitMenu(
- WObject * source,
- WMessageEventData * event )
- {
- WBool enabled;
-
- // If there are more than 2 windows, enable the Next and
- // Previous menu items.
- enabled = ( _childWindowVector.GetCount() >= 2 );
- menu_1_item_Next->SetEnabled( enabled );
- menu_1_item_Previous->SetEnabled( enabled );
-
- return FALSE;
- }
-
- @end-code;
-
- @begin-code Code "FormParent::menu_1_item_About_Click"
-
- WBool @CLASSNAME@::menu_1_item_About_Click(
- WObject * source,
- WEventData * event )
- {
- // display the about box
- AboutBox1->Create( this );
-
- return FALSE;
- }
-
- @end-code;
-
- @begin-code Code "FormParent::menu_1_item_ArrangeIcons_Click"
-
- WBool @CLASSNAME@::menu_1_item_ArrangeIcons_Click(
- WObject * source,
- WEventData * event )
- {
- // arrange all minimized MDI child window icons
- ArrangeMinimized();
-
- return FALSE;
- }
-
- @end-code;
-
- @begin-code Code "FormParent::menu_1_item_Cascade_Click"
-
- WBool @CLASSNAME@::menu_1_item_Cascade_Click(
- WObject * source,
- WEventData * event )
- {
- // cascade all MDI child windows
- Cascade( );
-
- return FALSE;
- }
-
- @end-code;
-
- @begin-code Code "FormParent::menu_1_item_Close_Click"
-
- WBool @CLASSNAME@::menu_1_item_Close_Click(
- WObject * source,
- WEventData * event )
- {
- WMDIChild *child;
-
- // Close the active MDI child
- child = GetActiveChild();
- child->Close();
-
- return FALSE;
- }
-
- @end-code;
-
- @begin-code Code "FormParent::menu_1_item_Exit_Click"
-
- WBool @CLASSNAME@::menu_1_item_Exit_Click(
- WObject * source,
- WEventData * event )
- {
- Close();
-
- return FALSE;
- }
-
- @end-code;
-
- @begin-code Code "FormParent::menu_1_item_New_Click"
-
- WBool @CLASSNAME@::menu_1_item_New_Click(
- WObject * source,
- WEventData * event )
- {
- addChild();
-
- return FALSE;
- }
-
- @end-code;
-
- @begin-code Code "FormParent::menu_1_item_Next_Click"
-
- WBool @CLASSNAME@::menu_1_item_Next_Click(
- WObject * source,
- WEventData * event )
- {
- // Activate he next MDI child form
- ActivateNext();
-
- return FALSE;
- }
-
- @end-code;
-
- @begin-code Code "FormParent::menu_1_item_Previous_Click"
-
- WBool @CLASSNAME@::menu_1_item_Previous_Click(
- WObject * source,
- WEventData * event )
- {
- // Activate the previous MDI child form
- ActivatePrevious();
-
- return FALSE;
- }
-
- @end-code;
-
- @begin-code Code "FormParent::menu_1_item_TileHorizontal_Click"
-
- WBool @CLASSNAME@::menu_1_item_TileHorizontal_Click(
- WObject * source,
- WEventData * event )
- {
- // tile horizontally all MDI child windows
- Tile( true );
-
- return FALSE;
- }
-
- @end-code;
-
- @begin-code Code "FormParent::menu_1_item_TileVertical_Click"
-
- WBool @CLASSNAME@::menu_1_item_TileVertical_Click(
- WObject * source,
- WEventData * event )
- {
- // tile vertically all MDI child windows
- Tile( false );
-
- return FALSE;
- }
-
- @end-code;
- @end;
-