diff options
author | Graeme Geldenhuys <graemeg@gmail.com> | 2014-10-17 00:06:38 +0100 |
---|---|---|
committer | Graeme Geldenhuys <graemeg@gmail.com> | 2014-10-17 00:06:38 +0100 |
commit | 7f1e8fd139e8c79b9d917a67d4418d0eeba8f0d5 (patch) | |
tree | 5684bb3f86401b968b0858c906682cd361e81c2d /uidesigner/newformdesigner.pas | |
parent | 8ceffe4943bab8641d6f804b79df4d1f79a41e88 (diff) | |
download | fpGUI-7f1e8fd139e8c79b9d917a67d4418d0eeba8f0d5.tar.xz |
uidesigner: Now has an experimental "visual grid" on designer form.
This grid can be toggled on or off. Because it is experimental and still
a ongoing feature, there are currently some limitations:
- Grid toggle status is not saved between sessions
- Grid color is not yet configurable
- Grid size can only be between 1-10
Diffstat (limited to 'uidesigner/newformdesigner.pas')
-rw-r--r-- | uidesigner/newformdesigner.pas | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/uidesigner/newformdesigner.pas b/uidesigner/newformdesigner.pas index 31b9431d..29962b93 100644 --- a/uidesigner/newformdesigner.pas +++ b/uidesigner/newformdesigner.pas @@ -63,6 +63,7 @@ type procedure miMRUClick(Sender: TObject; const FileName: string); procedure SetupCaptions; procedure BuildThemePreviewMenu; + procedure ToggleDesignerGrid(Sender: TObject); public {@VFD_HEAD_BEGIN: frmMain} MainMenu: TfpgMenuBar; @@ -77,6 +78,7 @@ type miOpenRecentMenu: TfpgPopupMenu; helpmenu: TfpgPopupMenu; previewmenu: TfpgPopupMenu; + btnGrid: TfpgButton; {@VFD_HEAD_END: frmMain} mru: TfpgMRU; constructor Create(AOwner: TComponent); override; @@ -218,7 +220,6 @@ begin WindowTitle := 'Product Information...'; Hint := ''; WindowPosition := wpScreenCenter; - Sizeable := False; OnShow := @FormShow; lblAppName := TfpgLabel.Create(self); @@ -467,6 +468,25 @@ begin SetPosition(324, 36, 120, 20); end; + btnGrid := TfpgButton.Create(self); + with btnGrid do + begin + Name := 'btnGrid'; + SetPosition(103, 28, 25, 24); + Text := ''; + AllowAllUp := True; + FontDesc := '#Label1'; + GroupIndex := 1; + Hint := 'Toggle designer grid'; + ImageMargin := -1; + ImageName := 'vfd.grid'; + ImageSpacing := 0; + TabOrder := 13; + Focusable := False; + AllowDown := True; + OnClick := @ToggleDesignerGrid; + end; + {@VFD_BODY_END: frmMain} {%endregion} @@ -980,9 +1000,18 @@ begin sl.Free; end; +procedure TfrmMain.ToggleDesignerGrid(Sender: TObject); +begin + maindsgn.ShowGrid := btnGrid.Down; +end; + constructor TfrmMain.Create(AOwner: TComponent); begin inherited Create(AOwner); + fpgImages.AddMaskedBMP( + 'vfd.grid', @vfd_grid, + sizeof(vfd_grid), 0, 0); + OnShow := @FormShow; end; |