diff options
author | Graeme Geldenhuys <graemeg@gmail.com> | 2014-03-29 16:05:33 +0000 |
---|---|---|
committer | Graeme Geldenhuys <graemeg@gmail.com> | 2014-03-29 16:05:33 +0000 |
commit | 026c9d369c3cd7834649486a261987ecdba04006 (patch) | |
tree | 0c58f9107126e1f7b46e04ed66413913608ec9e3 /src/corelib | |
parent | 2e26a7101afdb9bce8a29a83c2c6d8cf15b7f4ec (diff) | |
download | fpGUI-026c9d369c3cd7834649486a261987ecdba04006.tar.xz |
style: new style methods for checkbox customisation
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/fpg_main.pas | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/corelib/fpg_main.pas b/src/corelib/fpg_main.pas index 0fada05a..bd22b15a 100644 --- a/src/corelib/fpg_main.pas +++ b/src/corelib/fpg_main.pas @@ -221,6 +221,9 @@ type function GetSeparatorSize: integer; virtual; { Editbox } procedure DrawEditBox(ACanvas: TfpgCanvas; const r: TfpgRect; const IsEnabled: Boolean; const IsReadOnly: Boolean; const ABackgroundColor: TfpgColor); virtual; + { Checkbox } + function GetCheckBoxSize: integer; virtual; + procedure DrawCheckbox(ACanvas: TfpgCanvas; x, y: TfpgCoord; ix, iy: TfpgCoord); virtual; end; @@ -2450,6 +2453,21 @@ begin ACanvas.FillRectangle(r); end; +function TfpgStyle.GetCheckBoxSize: integer; +begin + Result := 13; // 13x13 - it is always a rectangle +end; + +procedure TfpgStyle.DrawCheckbox(ACanvas: TfpgCanvas; x, y: TfpgCoord; ix, iy: TfpgCoord); +var + img: TfpgImage; + size: integer; +begin + img := fpgImages.GetImage('sys.checkboxes'); // Do NOT localize - return value is a reference only + size := GetCheckBoxSize; + ACanvas.DrawImagePart(x, y, img, ix, iy, size, size); +end; + { TfpgCaret } |