summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graemeg@gmail.com>2013-12-22 23:55:54 +0000
committerGraeme Geldenhuys <graemeg@gmail.com>2013-12-22 23:55:54 +0000
commit1631e13fc306d009b2b7c1c71129bf279d435cf3 (patch)
treefd7a2644b07d976e6bc6b781aa1b487577197e60
parented0b319d98023db81a44c11ca7543cb1b3234ab4 (diff)
downloadfpGUI-1631e13fc306d009b2b7c1c71129bf279d435cf3.tar.xz
demos: Minor improvements to the Custom Styles/Themes demo.
-rw-r--r--examples/gui/customstyles/customstyles.lpi4
-rw-r--r--examples/gui/customstyles/customstyles.lpr3
-rw-r--r--examples/gui/customstyles/frm_test.pas42
3 files changed, 40 insertions, 9 deletions
diff --git a/examples/gui/customstyles/customstyles.lpi b/examples/gui/customstyles/customstyles.lpi
index b2996aeb..50b2d740 100644
--- a/examples/gui/customstyles/customstyles.lpi
+++ b/examples/gui/customstyles/customstyles.lpi
@@ -1,4 +1,4 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="9"/>
@@ -52,7 +52,7 @@
</Units>
</ProjectOptions>
<CompilerOptions>
- <Version Value="9"/>
+ <Version Value="11"/>
<Parsing>
<SyntaxOptions>
<CStyleOperator Value="False"/>
diff --git a/examples/gui/customstyles/customstyles.lpr b/examples/gui/customstyles/customstyles.lpr
index 419e6456..16b00ac8 100644
--- a/examples/gui/customstyles/customstyles.lpr
+++ b/examples/gui/customstyles/customstyles.lpr
@@ -1,7 +1,7 @@
{
fpGUI - Free Pascal GUI Toolkit
- Copyright (C) 2006 - 2011 See the file AUTHORS.txt, included in this
+ Copyright (C) 2006 - 2013 See the file AUTHORS.txt, included in this
distribution, for details of the copyright.
See the file COPYING.modifiedLGPL, included in this distribution,
@@ -25,7 +25,6 @@
quotes.
}
-
program customstyles;
{$mode objfpc}{$H+}
diff --git a/examples/gui/customstyles/frm_test.pas b/examples/gui/customstyles/frm_test.pas
index 6eb30b35..1cefa10a 100644
--- a/examples/gui/customstyles/frm_test.pas
+++ b/examples/gui/customstyles/frm_test.pas
@@ -1,3 +1,20 @@
+{
+ fpGUI - Free Pascal GUI Toolkit
+
+ Copyright (C) 2006 - 2013 See the file AUTHORS.txt, included in this
+ distribution, for details of the copyright.
+
+ See the file COPYING.modifiedLGPL, included in this distribution,
+ for details about redistributing fpGUI.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ Description:
+ Demo form showing some widgets in different states, and how the themes
+ paint them.
+}
unit frm_test;
{$mode objfpc}{$H+}
@@ -5,8 +22,16 @@ unit frm_test;
interface
uses
- SysUtils, Classes, fpg_base, fpg_main, fpg_widget,
- fpg_form, fpg_edit, fpg_label, fpg_button, fpg_menu,
+ SysUtils,
+ Classes,
+ fpg_base,
+ fpg_main,
+ fpg_widget,
+ fpg_form,
+ fpg_edit,
+ fpg_label,
+ fpg_button,
+ fpg_menu,
fpg_memo;
type
@@ -33,6 +58,7 @@ type
Label1: TfpgLabel;
{@VFD_HEAD_END: TestForm}
procedure CloseClicked(Sender: TObject);
+ procedure HelpAboutClicked(Sender: TObject);
public
procedure AfterCreate; override;
end;
@@ -42,7 +68,8 @@ type
implementation
uses
- fpg_stylemanager;
+ fpg_stylemanager,
+ fpg_dialogs;
{@VFD_NEWFORM_IMPL}
@@ -51,6 +78,11 @@ begin
Close;
end;
+procedure TTestForm.HelpAboutClicked(Sender: TObject);
+begin
+ TfpgMessageDialog.AboutFPGui('');
+end;
+
procedure TTestForm.AfterCreate;
var
miSubMenu: TfpgMenuItem;
@@ -198,7 +230,7 @@ begin
AddMenuItem('-', '', nil);
AddMenuItem('Save && Reload', '', nil);
AddMenuItem('-', '', nil);
- AddMenuItem('&Quit', 'Ctrl+Q', nil);
+ AddMenuItem('&Quit', 'Ctrl+Q', @CloseClicked);
end;
pmEdit := TfpgPopupMenu.Create(self);
@@ -219,7 +251,7 @@ begin
begin
Name := 'pmHelp';
SetPosition(204, 196, 120, 24);
- AddMenuItem('About...', '', nil);
+ AddMenuItem('About...', '', @HelpAboutClicked);
end;
pmSubMenu1 := TfpgPopupMenu.Create(self);