diff options
Diffstat (limited to 'prototypes')
-rw-r--r-- | prototypes/mdi/project1.lpr | 95 |
1 files changed, 52 insertions, 43 deletions
diff --git a/prototypes/mdi/project1.lpr b/prototypes/mdi/project1.lpr index fdde8f0d..ea7cd3ca 100644 --- a/prototypes/mdi/project1.lpr +++ b/prototypes/mdi/project1.lpr @@ -15,13 +15,14 @@ type TMainForm = class(TfpgForm) private {@VFD_HEAD_BEGIN: MainForm} - MainBar: TfpgMenuBar; - MDIWorkArea: TfpgMDIWorkArea; - Bevel1: TfpgBevel; - pmChildren: TfpgPopupMenu; - {@VFD_HEAD_END: MainForm} + MainBar: TfpgMenuBar; + MDIWorkArea: TfpgMDIWorkArea; + Bevel1: TfpgBevel; + pmChildren: TfpgPopupMenu; + {@VFD_HEAD_END: MainForm} procedure NewFormClicked(Sender: TObject); procedure miQuitClicked(Sender: TObject); + procedure miCascadeChildWindows(Sender: TObject); public procedure AfterCreate; override; end; @@ -43,52 +44,60 @@ begin Close; end; +procedure TMainForm.miCascadeChildWindows(Sender: TObject); +begin + MDIWorkArea.CascadeWindows; +end; + procedure TMainForm.AfterCreate; begin {%region 'Auto-generated GUI code' -fold} {@VFD_BODY_BEGIN: MainForm} - Name := 'MainForm'; - SetPosition(351, 159, 555, 321); - WindowTitle := 'fpGUI''s MDI Demo'; - Hint := ''; - - MainBar := TfpgMenuBar.Create(self); - with MainBar do - begin - Name := 'MainBar'; - SetPosition(0, 0, 555, 24); - Anchors := [anLeft,anRight,anTop]; - end; + Name := 'MainForm'; + SetPosition(351, 159, 555, 360); + WindowTitle := 'fpGUI''s MDI Demo'; + Hint := ''; + + MainBar := TfpgMenuBar.Create(self); + with MainBar do + begin + Name := 'MainBar'; + SetPosition(0, 0, 555, 24); + Anchors := [anLeft,anRight,anTop]; + end; - MDIWorkArea := TfpgMDIWorkArea.Create(self); - with MDIWorkArea do - begin - Name := 'MDIWorkArea'; - SetPosition(3, 32, 548, 264); - Anchors := [anLeft,anRight,anTop,anBottom]; - end; + MDIWorkArea := TfpgMDIWorkArea.Create(self); + with MDIWorkArea do + begin + Name := 'MDIWorkArea'; + SetPosition(3, 32, 548, 303); + Anchors := [anLeft,anRight,anTop,anBottom]; + end; - Bevel1 := TfpgBevel.Create(self); - with Bevel1 do - begin - Name := 'Bevel1'; - SetPosition(0, 300, 555, 20); - Anchors := [anLeft,anRight,anBottom]; - Hint := ''; - Style := bsLowered; - end; + Bevel1 := TfpgBevel.Create(self); + with Bevel1 do + begin + Name := 'Bevel1'; + SetPosition(0, 339, 555, 20); + Anchors := [anLeft,anRight,anBottom]; + Hint := ''; + Style := bsLowered; + end; - pmChildren := TfpgPopupMenu.Create(self); - with pmChildren do - begin - Name := 'pmChildren'; - SetPosition(336, 88, 120, 20); - AddMenuItem('Add child', '', @NewFormClicked); - AddMenuItem('-', '', nil); - AddMenuItem('Quit', '', @miQuitClicked); - end; + pmChildren := TfpgPopupMenu.Create(self); + with pmChildren do + begin + Name := 'pmChildren'; + SetPosition(336, 88, 120, 20); + AddMenuItem('Add child', '', @NewFormClicked); + AddSeparator; + AddMenuItem('Cascade', '', @miCascadeChildWindows); + AddMenuItem('Tile', '', nil).Enabled := False; + AddSeparator; + AddMenuItem('Quit', '', @miQuitClicked); + end; - {@VFD_BODY_END: MainForm} + {@VFD_BODY_END: MainForm} {%endregion} MainBar.AddMenuItem('Children', nil).SubMenu := pmChildren; end; |