summaryrefslogtreecommitdiff
path: root/src/corelib
diff options
context:
space:
mode:
authorgraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2007-07-26 12:50:13 +0000
committergraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2007-07-26 12:50:13 +0000
commit1c2e942655c6280bc46b7a0eedefb827a7aca0ca (patch)
tree44adef1076af8a61663e329b78a7e20013aefa1f /src/corelib
parent544f3d4974a01a1f4cd6621c112dcde84e541bbb (diff)
downloadfpGUI-1c2e942655c6280bc46b7a0eedefb827a7aca0ca.tar.xz
* Added a DrawString() method to TfpgStyle
* Changed TfpgCheckBox, TfpgRadioButton, TfpgLabel and TfpbButton to use fpgStyle.DrawString instead. * Updated the prototype test app to demo these features. * TfpgCheckBox now handle image painting correctly based on the widget state and mouse state (up, down). * Minor improvement to the look of the X in the CheckBox image.
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/fpgfx.pas14
-rw-r--r--src/corelib/stdimages.inc36
2 files changed, 32 insertions, 18 deletions
diff --git a/src/corelib/fpgfx.pas b/src/corelib/fpgfx.pas
index 434b5e40..a6a09c5c 100644
--- a/src/corelib/fpgfx.pas
+++ b/src/corelib/fpgfx.pas
@@ -156,6 +156,7 @@ type
procedure DrawButtonFace(ACanvas: TfpgCanvas; x, y, w, h: TfpgCoord; AFlags: TFButtonFlags); virtual;
procedure DrawControlFrame(ACanvas: TfpgCanvas; x, y, w, h: TfpgCoord); virtual;
procedure DrawDirectionArrow(ACanvas: TfpgCanvas; x, y, w, h: TfpgCoord; direction: integer); virtual;
+ procedure DrawString(ACanvas: TfpgCanvas; x, y: TfpgCoord; AText: string; AEnabled: boolean = True); virtual;
end;
@@ -892,6 +893,19 @@ begin
end;
end;
+procedure TfpgStyle.DrawString(ACanvas: TfpgCanvas; x, y: TfpgCoord;
+ AText: string; AEnabled: boolean);
+begin
+ if not AEnabled then
+ begin
+ ACanvas.SetTextColor(clHilite1);
+ ACanvas.DrawString(x+1, y+1, AText);
+ ACanvas.SetTextColor(clShadow1);
+ end;
+ ACanvas.DrawString(x, y, AText);
+end;
+
+
{ TfpgCaret }
procedure TfpgCaret.OnTimerTime(Sender: TObject);
diff --git a/src/corelib/stdimages.inc b/src/corelib/stdimages.inc
index a063d5b3..9eed1a08 100644
--- a/src/corelib/stdimages.inc
+++ b/src/corelib/stdimages.inc
@@ -892,13 +892,13 @@ Const
127,127,127,127,127,127,191,191,191,255,255,255, 0,127,127,127, 0,
0, 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,191,191,191,255,255,
- 255,127,127,127, 0, 0, 0,255,255,255,255,255,255, 0, 0, 0,255,
- 255,255,255,255,255,255,255,255, 0, 0, 0,255,255,255,255,255,255,
+ 255,127,127,127, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0, 0,255,
+ 255,255,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0,255,255,255,
191,191,191,255,255,255,127,127,127, 0, 0, 0,127,127,127,127,127,
127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,
127,127,127,127,127,191,191,191,255,255,255,127,127,127, 0, 0, 0,
- 127,127,127,127,127,127, 0, 0, 0,127,127,127,127,127,127,127,127,
- 127, 0, 0, 0,127,127,127,127,127,127,191,191,191,255,255,255,127,
+ 127,127,127, 52, 52, 52, 52, 52, 52,127,127,127,127,127,127,127,127,
+ 127, 52, 52, 52, 52, 52, 52,127,127,127,191,191,191,255,255,255,127,
127,127, 0, 0, 0,127,127,127,127,127,127,127,127,127,127,127,127,
127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,191,191,
191,255,255,255, 0,127,127,127, 0, 0, 0,255,255,255,255,255,255,
@@ -908,8 +908,8 @@ Const
0, 0, 0, 0, 0, 0,255,255,255,191,191,191,255,255,255,127,127,
127, 0, 0, 0,127,127,127,127,127,127,127,127,127,127,127,127,127,
127,127,127,127,127,127,127,127,127,127,127,127,127,127,191,191,191,
- 255,255,255,127,127,127, 0, 0, 0,127,127,127, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,127,127,127, 0, 0, 0, 0, 0, 0, 0, 0, 0,127,
+ 255,255,255,127,127,127, 0, 0, 0,127,127,127, 52, 52, 52, 52, 52,
+ 52, 52, 52, 52,127,127,127, 52, 52, 52, 52, 52, 52, 52, 52, 52,127,
127,127,191,191,191,255,255,255,127,127,127, 0, 0, 0,127,127,127,
127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,
127,127,127,127,127,127,127,191,191,191,255,255,255, 0,127,127,127,
@@ -920,8 +920,8 @@ Const
255,191,191,191,255,255,255,127,127,127, 0, 0, 0,127,127,127,127,
127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,
127,127,127,127,127,127,191,191,191,255,255,255,127,127,127, 0, 0,
- 0,127,127,127,127,127,127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0,127,127,127,127,127,127,191,191,191,255,255,255,
+ 0,127,127,127,127,127,127, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
+ 52, 52, 52, 52, 52,127,127,127,127,127,127,191,191,191,255,255,255,
127,127,127, 0, 0, 0,127,127,127,127,127,127,127,127,127,127,127,
127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,191,
191,191,255,255,255, 0,127,127,127, 0, 0, 0,255,255,255,255,255,
@@ -932,7 +932,7 @@ Const
127,127, 0, 0, 0,127,127,127,127,127,127,127,127,127,127,127,127,
127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,191,191,
191,255,255,255,127,127,127, 0, 0, 0,127,127,127,127,127,127,127,
- 127,127, 0, 0, 0, 0, 0, 0, 0, 0, 0,127,127,127,127,127,127,
+ 127,127, 52, 52, 52, 52, 52, 52, 52, 52, 52,127,127,127,127,127,127,
127,127,127,191,191,191,255,255,255,127,127,127, 0, 0, 0,127,127,
127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,
127,127,127,127,127,127,127,127,191,191,191,255,255,255, 0,127,127,
@@ -943,8 +943,8 @@ Const
255,255,191,191,191,255,255,255,127,127,127, 0, 0, 0,127,127,127,
127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,
127,127,127,127,127,127,127,191,191,191,255,255,255,127,127,127, 0,
- 0, 0,127,127,127,127,127,127, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,127,127,127,127,127,127,191,191,191,255,255,
+ 0, 0,127,127,127,127,127,127, 52, 52, 52, 52, 52, 52, 52, 52, 52,
+ 52, 52, 52, 52, 52, 52,127,127,127,127,127,127,191,191,191,255,255,
255,127,127,127, 0, 0, 0,127,127,127,127,127,127,127,127,127,127,
127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,
191,191,191,255,255,255, 0,127,127,127, 0, 0, 0,255,255,255,255,
@@ -954,20 +954,20 @@ Const
0, 0, 0, 0, 0, 0, 0, 0,255,255,255,191,191,191,255,255,255,
127,127,127, 0, 0, 0,127,127,127,127,127,127,127,127,127,127,127,
127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,191,
- 191,191,255,255,255,127,127,127, 0, 0, 0,127,127,127, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,127,127,127, 0, 0, 0, 0, 0, 0, 0, 0,
- 0,127,127,127,191,191,191,255,255,255,127,127,127, 0, 0, 0,127,
+ 191,191,255,255,255,127,127,127, 0, 0, 0,127,127,127, 52, 52, 52,
+ 52, 52, 52, 52, 52, 52,127,127,127, 52, 52, 52, 52, 52, 52, 52, 52,
+ 52,127,127,127,191,191,191,255,255,255,127,127,127, 0, 0, 0,127,
127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,
127,127,127,127,127,127,127,127,127,191,191,191,255,255,255, 0,127,
127,127, 0, 0, 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,191,191,
- 191,255,255,255,127,127,127, 0, 0, 0,255,255,255,255,255,255, 0,
- 0, 0,255,255,255,255,255,255,255,255,255, 0, 0, 0,255,255,255,
+ 191,255,255,255,127,127,127, 0, 0, 0,255,255,255, 0, 0, 0, 0,
+ 0, 0,255,255,255,255,255,255,255,255,255, 0, 0, 0, 0, 0, 0,
255,255,255,191,191,191,255,255,255,127,127,127, 0, 0, 0,127,127,
127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,
127,127,127,127,127,127,127,127,191,191,191,255,255,255,127,127,127,
- 0, 0, 0,127,127,127,127,127,127, 0, 0, 0,127,127,127,127,127,
- 127,127,127,127, 0, 0, 0,127,127,127,127,127,127,191,191,191,255,
+ 0, 0, 0,127,127,127, 52, 52, 52, 52, 52, 52,127,127,127,127,127,
+ 127,127,127,127, 52, 52, 52, 52, 52, 52,127,127,127,191,191,191,255,
255,255,127,127,127, 0, 0, 0,127,127,127,127,127,127,127,127,127,
127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,
127,191,191,191,255,255,255, 0,127,127,127, 0, 0, 0,255,255,255,