summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2009-06-23 12:29:52 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2009-06-23 12:29:52 +0200
commita50cd6cb09146a43b3efb639399e2a9543e074c8 (patch)
tree09b69945da149be70171cf4b550cdbca25aaf771
parent6d0752b6aa9ae02b582447eaa2752bea80306284 (diff)
downloadfpGUI-a50cd6cb09146a43b3efb639399e2a9543e074c8.tar.xz
Fixed the image position regarding focus rectangle
* Checkbox and RadioButton images overlap the focus rectangle when BoxLayout is right aligned.
-rw-r--r--src/gui/fpg_checkbox.pas9
-rw-r--r--src/gui/fpg_radiobutton.pas11
2 files changed, 12 insertions, 8 deletions
diff --git a/src/gui/fpg_checkbox.pas b/src/gui/fpg_checkbox.pas
index f1e4ecac..532d60be 100644
--- a/src/gui/fpg_checkbox.pas
+++ b/src/gui/fpg_checkbox.pas
@@ -183,13 +183,16 @@ begin
else
ix := (2 + (Ord(FChecked) * 2)) - Ord(FChecked);
- // paint the check (in this case a X)
+ // calc the text offset and checkbox offset
if FBoxLayout = tbLeftBox then
- tx := r.right + 8
+ begin
+ tx := r.right + 8;
+ inc(r.left, 2);
+ end
else
tx := 0;
- inc(r.left, 2);
inc(r.top, 1);
+ // paint the check (in this case a X)
img := fpgImages.GetImage('sys.checkboxes'); // Do NOT localize
Canvas.DrawImagePart(r.Left, r.Top, img, ix*13, 0, 13, 13);
diff --git a/src/gui/fpg_radiobutton.pas b/src/gui/fpg_radiobutton.pas
index 540e19bf..c0bb20da 100644
--- a/src/gui/fpg_radiobutton.pas
+++ b/src/gui/fpg_radiobutton.pas
@@ -30,8 +30,6 @@ uses
type
- { TfpgRadioButton }
-
TfpgRadioButton = class(TfpgWidget)
private
FAutoSize: boolean;
@@ -218,13 +216,16 @@ begin
else
ix := (2 + (Ord(FChecked) * 2)) - Ord(FChecked);
- // paint the radio button
+ // calc the text offset and radiobutton offset
if FBoxLayout = tbLeftBox then
- tx := r.right + 8
+ begin
+ tx := r.right + 8;
+ inc(r.left, 2);
+ end
else
tx := 0;
- inc(r.left, 2);
inc(r.top, 1);
+ // paint the radio button
img := fpgImages.GetImage('sys.radiobuttons'); // Do NOT localize
Canvas.DrawImagePart(r.Left, r.Top, img, ix*12, 0, 12, 12);