diff options
author | Graeme Geldenhuys <graemeg@gmail.com> | 2014-02-25 22:07:52 +0000 |
---|---|---|
committer | Graeme Geldenhuys <graemeg@gmail.com> | 2014-02-25 22:07:52 +0000 |
commit | f72e8e9ca85c55208708aa065739cfc63a2fe407 (patch) | |
tree | 578dec6f1c5fba40f12668fd4d2e047b8dc75055 | |
parent | da868a5dda60620ff29e23b977b75f20f6f1f24b (diff) | |
download | fpGUI-f72e8e9ca85c55208708aa065739cfc63a2fe407.tar.xz |
grid: introduce an overloaded GetClientRect() function.
This takes into account BorderStyle and border widths from the theme
manager.
-rw-r--r-- | src/gui/fpg_basegrid.pas | 16 |
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. |