summaryrefslogtreecommitdiff
path: root/uidesigner
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graemeg@gmail.com>2014-05-07 23:58:09 +0100
committerGraeme Geldenhuys <graemeg@gmail.com>2014-05-07 23:58:09 +0100
commitb99c701731bc248cd6c9b81f17547a5fee9a36e3 (patch)
tree8204b99f6b8dd41abe2c09b69d55ea7c2af42462 /uidesigner
parentd1aba12f6704c71f0a84cc6ae7ab2963ade7b408 (diff)
downloadfpGUI-b99c701731bc248cd6c9b81f17547a5fee9a36e3.tar.xz
uidesigner: Preview menu now populated with real themes.
Diffstat (limited to 'uidesigner')
-rw-r--r--uidesigner/newformdesigner.pas28
1 files changed, 22 insertions, 6 deletions
diff --git a/uidesigner/newformdesigner.pas b/uidesigner/newformdesigner.pas
index 341019de..31b9431d 100644
--- a/uidesigner/newformdesigner.pas
+++ b/uidesigner/newformdesigner.pas
@@ -1,7 +1,7 @@
{
fpGUI - Free Pascal GUI Toolkit
- Copyright (C) 2006 - 2013 See the file AUTHORS.txt, included in this
+ Copyright (C) 2006 - 2014 See the file AUTHORS.txt, included in this
distribution, for details of the copyright.
See the file COPYING.modifiedLGPL, included in this distribution,
@@ -62,6 +62,7 @@ type
procedure miHelpAboutGUI(Sender: TObject);
procedure miMRUClick(Sender: TObject; const FileName: string);
procedure SetupCaptions;
+ procedure BuildThemePreviewMenu;
public
{@VFD_HEAD_BEGIN: frmMain}
MainMenu: TfpgMenuBar;
@@ -178,6 +179,7 @@ uses
fpg_iniutils,
fpg_dialogs,
fpg_constants,
+ fpg_stylemanager,
vfdmain,
vfd_constants;
@@ -463,11 +465,6 @@ begin
begin
Name := 'previewmenu';
SetPosition(324, 36, 120, 20);
- AddMenuItem('with Windows 9x', '', nil).Enabled := False;
- AddMenuItem('with Windows XP', '', nil).Enabled := False;
- AddMenuItem('with OpenSoft', '', nil).Enabled := False;
- AddMenuItem('with Motif', '', nil).Enabled := False;
- AddMenuItem('with OpenLook', '', nil).Enabled := False;
end;
{@VFD_BODY_END: frmMain}
@@ -500,6 +497,8 @@ begin
end;
end;
+ BuildThemePreviewMenu;
+
chlPalette.Items.Sort;
MainMenu.AddMenuItem('&File', nil).SubMenu := filemenu;
MainMenu.AddMenuItem('&Settings', nil).SubMenu := setmenu;
@@ -964,6 +963,23 @@ begin
btnOpen.Hint := rsOpenFormFile;
end;
+procedure TfrmMain.BuildThemePreviewMenu;
+var
+ sl: TStringList;
+ i: integer;
+begin
+ sl := TStringList.Create;
+ fpgStyleManager.AssignStyleTypes(sl);
+ sl.Sort;
+ for i := 0 to sl.Count-1 do
+ begin
+ if sl[i] = 'auto' then
+ continue;
+ previewmenu.AddMenuItem(sl[i], '', nil).Enabled := False;
+ end;
+ sl.Free;
+end;
+
constructor TfrmMain.Create(AOwner: TComponent);
begin
inherited Create(AOwner);