summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graemeg@gmail.com>2014-02-25 22:07:52 +0000
committerGraeme Geldenhuys <graemeg@gmail.com>2014-02-25 22:07:52 +0000
commitf72e8e9ca85c55208708aa065739cfc63a2fe407 (patch)
tree578dec6f1c5fba40f12668fd4d2e047b8dc75055 /src
parentda868a5dda60620ff29e23b977b75f20f6f1f24b (diff)
downloadfpGUI-f72e8e9ca85c55208708aa065739cfc63a2fe407.tar.xz
grid: introduce an overloaded GetClientRect() function.
This takes into account BorderStyle and border widths from the theme manager.
Diffstat (limited to 'src')
-rw-r--r--src/gui/fpg_basegrid.pas16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/gui/fpg_basegrid.pas b/src/gui/fpg_basegrid.pas
index 6f262331..aee679d0 100644
--- a/src/gui/fpg_basegrid.pas
+++ b/src/gui/fpg_basegrid.pas
@@ -1,7 +1,7 @@
{
fpGUI - Free Pascal GUI Toolkit
- Copyright (C) 2006 - 2013 See the file AUTHORS.txt, included in this
+ Copyright (C) 2006 - 2014 See the file AUTHORS.txt, included in this
distribution, for details of the copyright.
See the file COPYING.modifiedLGPL, included in this distribution,
@@ -179,6 +179,7 @@ type
procedure BeginUpdate;
procedure EndUpdate;
procedure MouseToCell(X, Y: Integer; var ACol, ARow: Integer);
+ function GetClientRect: TfpgRect; override;
function VisibleWidth: integer;
function VisibleHeight: integer;
end;
@@ -1628,6 +1629,19 @@ begin
end;
end;
+function TfpgBaseGrid.GetClientRect: TfpgRect;
+var
+ rect: TRect;
+begin
+ Result := inherited GetClientRect;
+ rect := fpgStyle.GetControlFrameBorders;
+ case BorderStyle of
+// ebsNone: // nothing to do
+ ebsDefault: InflateRect(Result, -rect.Left, -rect.Top); { assuming borders are even on opposite sides }
+ ebsSingle: InflateRect(Result, -1, -1);
+ end;
+end;
+
end.