diff options
author | Graeme Geldenhuys <graemeg@gmail.com> | 2013-04-12 18:05:24 +0100 |
---|---|---|
committer | Graeme Geldenhuys <graemeg@gmail.com> | 2013-04-12 18:29:05 +0100 |
commit | 93981dca15f320ffcc22de8111e1b5feea6fb03e (patch) | |
tree | 1e62de1870dc509eb84957788027b01b4aaf5c6b /prototypes | |
parent | b24d34f161a26daab6ab625535c2ea27b7c9d74e (diff) | |
download | fpGUI-93981dca15f320ffcc22de8111e1b5feea6fb03e.tar.xz |
MDI prototype: demo project now uses the Cascade Windows functionality
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; |