summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2011-05-04 00:01:16 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2011-05-04 00:01:16 +0200
commit1399b49682e7ef99777e5ced4cf84e9e6aefeddd (patch)
tree75313cbfc54133e91c85df8ba63ac6b2433ce31d
parent90694e1e34974839c1fcdd880ace33757fd47a2d (diff)
downloadfpGUI-1399b49682e7ef99777e5ced4cf84e9e6aefeddd.tar.xz
Introduced the usage of fpgStyle.GetButtonShift.
Custom styles can now define there own button shift values and the TfpgButton will adhere to them.
-rw-r--r--src/gui/fpg_button.pas14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gui/fpg_button.pas b/src/gui/fpg_button.pas
index 05f54e20..e16e12f3 100644
--- a/src/gui/fpg_button.pas
+++ b/src/gui/fpg_button.pas
@@ -520,7 +520,7 @@ procedure TfpgBaseButton.HandlePaint;
var
tx, ty, ix, iy: integer;
r: TfpgRect;
- pofs: integer;
+ offset: TPoint;
lBtnFlags: TFButtonFlags;
clr: TfpgColor;
img: TfpgImage;
@@ -582,20 +582,20 @@ begin
Canvas.SetFont(Font);
if FDown then
- pofs := 1
+ offset := fpgStyle.GetButtonShift
else
- pofs := 0;
+ offset := Point(0, 0);
CalculatePositions (ix, iy, tx, ty);
if FShowImage and Assigned(FImage) then
begin
if Enabled then
- Canvas.DrawImage(ix + pofs, iy + pofs, FImage)
+ Canvas.DrawImage(ix+offset.x, iy+offset.y, FImage)
else
begin
img := FImage.CreateDisabledImage;
- Canvas.DrawImage(ix + pofs, iy + pofs, img);
+ Canvas.DrawImage(ix+offset.x, iy+offset.y, img);
img.Free;
end;
@@ -616,7 +616,7 @@ begin
r.Width -= ix;
end;
if FDown then
- OffsetRect(r, pofs, pofs);
+ OffsetRect(r, offset.x, offset.y);
lTextFlags := [txtHCenter, txtVCenter{, txtWrap}];
if not Enabled then
@@ -624,7 +624,7 @@ begin
Canvas.DrawText(r, Text, lTextFlags);
end
else
- fpgStyle.DrawString(Canvas, tx+pofs, ty+pofs, Text, Enabled);
+ fpgStyle.DrawString(Canvas, tx+offset.x, ty+offset.y, Text, Enabled);
end;
procedure TfpgBaseButton.DoPush;