diff options
author | Jean-Marc.Levecque <jmarc.levecque@bbox.fr> | 2014-12-06 15:36:30 +0000 |
---|---|---|
committer | Graeme Geldenhuys <graemeg@gmail.com> | 2014-12-06 15:36:30 +0000 |
commit | 78d25c5f23eb6ce2bfe146e78c6a0fc9f89e400d (patch) | |
tree | a2f5de099a30f09107c3dfcdf88baa99eb15d90b /src/gui/fpg_basegrid.pas | |
parent | a48cf325aedffd6eb0a28e9c1df6ff31c56fd796 (diff) | |
download | fpGUI-78d25c5f23eb6ce2bfe146e78c6a0fc9f89e400d.tar.xz |
Allow grids scrollbarwidth setting
Diffstat (limited to 'src/gui/fpg_basegrid.pas')
-rw-r--r-- | src/gui/fpg_basegrid.pas | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/gui/fpg_basegrid.pas b/src/gui/fpg_basegrid.pas index ce5665df..8c29ed5e 100644 --- a/src/gui/fpg_basegrid.pas +++ b/src/gui/fpg_basegrid.pas @@ -90,6 +90,7 @@ type FBorderStyle: TfpgEditBorderStyle; function GetFontDesc: string; function GetHeaderFontDesc: string; + function GetScrollBarWidth: Integer; function GetTotalColumnWidth: integer; function GetAdjustedBorderSizes: TRect; procedure HScrollBarMove(Sender: TObject; position: integer); @@ -101,6 +102,7 @@ type procedure SetScrollBarStyle(const AValue: TfpgScrollStyle); function GetScrollBarPage: integer; procedure SetScrollBarPage(const AValue: integer); + procedure SetScrollBarWidth(const AValue: integer); procedure VScrollBarMove(Sender: TObject; position: integer); procedure SetDefaultColWidth(const AValue: integer); procedure SetDefaultRowHeight(const AValue: integer); @@ -166,6 +168,7 @@ type property AutoHeight: boolean read FAutoHeight write SetAutoHeight default False; property ScrollBarStyle: TfpgScrollStyle read FScrollBarStyle write SetScrollBarStyle default ssAutoBoth; property ScrollBarPage: Integer read GetScrollBarPage write SetScrollBarPage; + property ScrollBarWidth: Integer read GetScrollBarWidth write SetScrollBarWidth; property HeaderHeight: integer read FHeaderHeight write SetHeaderHeight; property TotalColumnWidth: integer read GetTotalColumnWidth; // property ColResizing: boolean read FColResizing write FColResizing; @@ -232,6 +235,11 @@ begin Result := FHeaderFont.FontDesc; end; +function TfpgBaseGrid.GetScrollBarWidth: Integer; +begin + Result := FVScrollBar.Width; +end; + function TfpgBaseGrid.GetTotalColumnWidth: integer; var i: integer; @@ -327,6 +335,16 @@ begin FVScrollBar.PageSize:= AValue; end; +procedure TfpgBaseGrid.SetScrollBarWidth(const AValue: integer); +begin + if FVScrollBar.Width = AValue then + Exit; //==> + FVScrollBar.Width := AValue; + FHScrollBar.Height:= AValue; + if FAutoHeight then + Height := AdjustHeight; +end; + procedure TfpgBaseGrid.VScrollBarMove(Sender: TObject; position: integer); begin if FFirstRow <> position then @@ -577,7 +595,7 @@ begin RePaint; end; -procedure TfpgBasegrid.SetAutoHeight(const AValue: boolean); +procedure TfpgBaseGrid.SetAutoHeight(const AValue: boolean); begin if FAutoHeight= AValue then Exit; //==> @@ -648,7 +666,7 @@ begin Repaint; end; -function TfpgBasegrid.AdjustHeight: integer; +function TfpgBaseGrid.AdjustHeight: Integer; var r: TRect; begin |