summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graemeg@gmail.com>2014-07-21 22:59:15 +0100
committerGraeme Geldenhuys <graemeg@gmail.com>2014-07-21 22:59:15 +0100
commitbf1aa3d4983f01c0943aa188963a1dc0aa801fbc (patch)
tree65ef656d1b114270a92d9c8735651fb148a0c626
parent84d9c47dee2a6c27e4c8ce467fe618591104977f (diff)
downloadfpGUI-bf1aa3d4983f01c0943aa188963a1dc0aa801fbc.tar.xz
uidesigner: added togglebox widget to the palette bar
-rw-r--r--src/gui/fpg_toggle.pas1
-rw-r--r--uidesigner/icons.inc113
-rw-r--r--uidesigner/images/toggle.bmpbin0 -> 1850 bytes
-rw-r--r--uidesigner/vfdwidgets.pas31
4 files changed, 145 insertions, 0 deletions
diff --git a/src/gui/fpg_toggle.pas b/src/gui/fpg_toggle.pas
index c58c9695..07711e3c 100644
--- a/src/gui/fpg_toggle.pas
+++ b/src/gui/fpg_toggle.pas
@@ -63,6 +63,7 @@ type
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
+ published
property UseAnimation: Boolean read FUseAnimation write FUseAnimation;
property ToggleWidth: TfpgCoord read FToggleWidth write SetToggleWidth default 45;
property CheckedCaption : TfpgString read FCheckedCaption write SetCheckedCaption;
diff --git a/uidesigner/icons.inc b/uidesigner/icons.inc
index 0e75a91f..f58ab0a0 100644
--- a/uidesigner/icons.inc
+++ b/uidesigner/icons.inc
@@ -3720,3 +3720,116 @@ const
146,119,119,146,119,119,146,119,119,146,119,119,146,119,119,255,255,
255, 0, 0);
+
+const
+ stdimg_vfd_toggle: array[0..1849] of byte = (
+ 66, 77, 58, 7, 0, 0, 0, 0, 0, 0,122, 0, 0, 0,108, 0, 0,
+ 0, 24, 0, 0, 0, 24, 0, 0, 0, 1, 0, 24, 0, 0, 0, 0, 0,
+ 192, 6, 0, 0, 19, 11, 0, 0, 19, 11, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 66, 71, 82,115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,
+ 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,
+ 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,
+ 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,
+ 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,
+ 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,
+ 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,
+ 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,
+ 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,
+ 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,
+ 146,119,119,146,119,119,146,119,119,146,119,119,146,119,119,146,119,
+ 119,146,119,119,146,119,119,146,119,119,146,119,119,146,119,119,146,
+ 119,119,146,119,119,146,119,119,146,119,119,146,119,119,146,119,119,
+ 146,119,119,146,119,119,146,119,119,146,119,119,146,119,119,255, 0,
+ 255,255, 0,255,146,119,119,200,208,212,200,208,212,200,208,212,200,
+ 208,212,200,208,212,200,208,212,200,208,212,200,208,212,200,208,212,
+ 200,208,212,200,208,212,200,208,212,200,208,212,200,208,212,200,208,
+ 212,200,208,212,200,208,212,200,208,212,200,208,212,200,208,212,146,
+ 119,119,255, 0,255,255, 0,255,146,119,119,200,208,212, 0,230, 0,
+ 0,230, 0, 0,230, 0, 0,230, 0,255,255,255,132,132,132,132,132,
+ 132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,
+ 132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,
+ 200,208,212,146,119,119,255, 0,255,255, 0,255,146,119,119,200,208,
+ 212, 0,230, 0, 0,230, 0, 0,230, 0, 0,230, 0,255,255,255,200,
+ 208,212,159,159,159, 0, 0, 0, 0, 0, 0,159,159,159,200,208,212,
+ 0, 0, 0,200,208,212,145,145,145, 0, 0, 0,200,208,212,200,208,
+ 212,132,132,132,200,208,212,146,119,119,255, 0,255,255, 0,255,146,
+ 119,119,200,208,212, 0,230, 0, 0,230, 0, 0,230, 0, 0,230, 0,
+ 255,255,255,200,208,212, 0, 0, 0,200,208,212,200,208,212, 0, 0,
+ 0,200,208,212, 0, 0, 0,132,132,132, 0, 0, 0, 0, 0, 0,200,
+ 208,212,200,208,212,132,132,132,200,208,212,146,119,119,255, 0,255,
+ 255, 0,255,146,119,119,200,208,212, 0,230, 0, 0,230, 0, 0,230,
+ 0, 0,230, 0,255,255,255,200,208,212, 0, 0, 0,200,208,212,200,
+ 208,212, 0, 0, 0,200,208,212, 0, 0, 0, 0, 0, 0,132,132,132,
+ 0, 0, 0,200,208,212,200,208,212,132,132,132,200,208,212,146,119,
+ 119,255, 0,255,255, 0,255,146,119,119,200,208,212, 0,230, 0, 0,
+ 230, 0, 0,230, 0, 0,230, 0,255,255,255,200,208,212,159,159,159,
+ 0, 0, 0, 0, 0, 0,159,159,159,200,208,212, 0, 0, 0,145,145,
+ 145,200,208,212, 0, 0, 0,200,208,212,200,208,212,132,132,132,200,
+ 208,212,146,119,119,255, 0,255,255, 0,255,146,119,119,200,208,212,
+ 0,230, 0, 0,230, 0, 0,230, 0, 0,230, 0,255,255,255,255,255,
+ 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+ 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
+ 255,255,255,200,208,212,146,119,119,255, 0,255,255, 0,255,146,119,
+ 119,200,208,212,200,208,212,200,208,212,200,208,212,200,208,212,200,
+ 208,212,200,208,212,200,208,212,200,208,212,200,208,212,200,208,212,
+ 200,208,212,200,208,212,200,208,212,200,208,212,200,208,212,200,208,
+ 212,200,208,212,200,208,212,200,208,212,146,119,119,255, 0,255,255,
+ 0,255,146,119,119,146,119,119,146,119,119,146,119,119,146,119,119,
+ 146,119,119,146,119,119,146,119,119,146,119,119,146,119,119,146,119,
+ 119,146,119,119,146,119,119,146,119,119,146,119,119,146,119,119,146,
+ 119,119,146,119,119,146,119,119,146,119,119,146,119,119,146,119,119,
+ 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,
+ 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,
+ 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,
+ 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,
+ 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,
+ 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,
+ 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,
+ 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,
+ 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,
+ 255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,
+ 255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255,255,
+ 0,255,255, 0,255,255, 0,255,255, 0,255,255, 0,255);
+
diff --git a/uidesigner/images/toggle.bmp b/uidesigner/images/toggle.bmp
new file mode 100644
index 00000000..304d0973
--- /dev/null
+++ b/uidesigner/images/toggle.bmp
Binary files differ
diff --git a/uidesigner/vfdwidgets.pas b/uidesigner/vfdwidgets.pas
index 2238e4e5..575ae40a 100644
--- a/uidesigner/vfdwidgets.pas
+++ b/uidesigner/vfdwidgets.pas
@@ -67,6 +67,7 @@ uses
fpg_ColorWheel,
fpg_splitter,
fpg_hyperlink,
+ fpg_toggle,
vfdpropeditgrid,
vfdmain;
@@ -325,6 +326,12 @@ begin
fpgImages.AddBMP(
'vfd.scrollframe', @stdimg_vfd_scrollframe,
sizeof(stdimg_vfd_scrollframe));
+
+ fpgImages.AddMaskedBMP(
+ 'vfd.toggle', @stdimg_vfd_toggle,
+ sizeof(stdimg_vfd_toggle),
+ 0, 0);
+
end;
procedure AddWidgetPosProps(wgc: TVFDWidgetClass);
@@ -985,6 +992,30 @@ begin
wc.WidgetIconName := 'vfd.hyperlink';
RegisterVFDWidget(wc);
+ // ToggleBox
+ wc := TVFDWidgetClass.Create(TfpgToggle);
+ wc.NameBase := 'Toggle';
+ wc.AddProperty('Align', TPropertyEnum, '');
+ wc.AddProperty('Checked', TPropertyBoolean, 'Boolean value');
+ wc.AddProperty('CheckedCaption', TPropertyString, 'Initial text');
+ wc.AddProperty('CheckedColor', TPropertyColor, '');
+ wc.AddProperty('CheckedTextColor', TPropertyColor, '');
+ wc.AddProperty('Enabled', TPropertyBoolean, '');
+ wc.AddProperty('FontDesc', TPropertyFontDesc, 'The font used for displaying the text');
+ wc.AddProperty('Hint', TPropertyString, 'Tooltip hint');
+ wc.AddProperty('ParentShowHint', TPropertyBoolean, '');
+ wc.AddProperty('ShowHint', TPropertyBoolean, '');
+ wc.AddProperty('TabOrder', TPropertyInteger, 'The tab order');
+ wc.AddProperty('Text', TPropertyString, 'Initial text');
+ wc.AddProperty('TextColor', TPropertyColor, '');
+ wc.AddProperty('ToggleWidth', TPropertyInteger, 'Width of toggle button');
+ wc.AddProperty('UnCheckedCaption', TPropertyString, 'Initial text');
+ wc.AddProperty('UnCheckedColor', TPropertyColor, '');
+ wc.AddProperty('UnCheckedTextColor', TPropertyColor, '');
+ wc.AddProperty('UseAnimation', TPropertyBoolean, '');
+ wc.WidgetIconName := 'vfd.toggle';
+ RegisterVFDWidget(wc);
+
// Other - do not delete!!! this should be the last...
wc := TVFDWidgetClass.Create(TOtherWidget);
wc.NameBase := 'Custom';