From 58cad7e7d50a430b47b1e6da98c610f2a58e4fd5 Mon Sep 17 00:00:00 2001 From: "Jean-Marc.Levecque" Date: Sat, 6 Dec 2014 15:20:31 +0000 Subject: Allow grids autoheight setting --- src/gui/fpg_grid.pas | 1 + 1 file changed, 1 insertion(+) (limited to 'src/gui/fpg_grid.pas') diff --git a/src/gui/fpg_grid.pas b/src/gui/fpg_grid.pas index 3f8b52fb..86ffb555 100644 --- a/src/gui/fpg_grid.pas +++ b/src/gui/fpg_grid.pas @@ -136,6 +136,7 @@ type published property Align; property AlternateBGColor; + property AutoHeight; property BackgroundColor; property BorderStyle; // property ColResizing; -- cgit v1.2.3-70-g09d2 From a48cf325aedffd6eb0a28e9c1df6ff31c56fd796 Mon Sep 17 00:00:00 2001 From: "Jean-Marc.Levecque" Date: Sat, 6 Dec 2014 15:25:37 +0000 Subject: Allow grids scrollbarpage setting --- src/gui/fpg_basegrid.pas | 15 +++++++++++++++ src/gui/fpg_grid.pas | 1 + 2 files changed, 16 insertions(+) (limited to 'src/gui/fpg_grid.pas') diff --git a/src/gui/fpg_basegrid.pas b/src/gui/fpg_basegrid.pas index 314cdc68..ce5665df 100644 --- a/src/gui/fpg_basegrid.pas +++ b/src/gui/fpg_basegrid.pas @@ -99,6 +99,8 @@ type procedure SetHeaderStyle(const AValue: TfpgGridHeaderStyle); procedure SetRowSelect(const AValue: boolean); procedure SetScrollBarStyle(const AValue: TfpgScrollStyle); + function GetScrollBarPage: integer; + procedure SetScrollBarPage(const AValue: integer); procedure VScrollBarMove(Sender: TObject; position: integer); procedure SetDefaultColWidth(const AValue: integer); procedure SetDefaultRowHeight(const AValue: integer); @@ -163,6 +165,7 @@ type property ShowGrid: boolean read FShowGrid write SetShowGrid default True; 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 HeaderHeight: integer read FHeaderHeight write SetHeaderHeight; property TotalColumnWidth: integer read GetTotalColumnWidth; // property ColResizing: boolean read FColResizing write FColResizing; @@ -312,6 +315,18 @@ begin FScrollBarStyle := AValue; end; +function TfpgBaseGrid.GetScrollBarPage: integer; +begin + Result:= FVScrollBar.PageSize; +end; + +procedure TfpgBaseGrid.SetScrollBarPage(const AValue: integer); +begin + if AValue= FVScrollBar.PageSize then + Exit; //==> + FVScrollBar.PageSize:= AValue; +end; + procedure TfpgBaseGrid.VScrollBarMove(Sender: TObject; position: integer); begin if FFirstRow <> position then diff --git a/src/gui/fpg_grid.pas b/src/gui/fpg_grid.pas index 86ffb555..12257f56 100644 --- a/src/gui/fpg_grid.pas +++ b/src/gui/fpg_grid.pas @@ -159,6 +159,7 @@ type property RowCount; property RowSelect; property ScrollBarStyle; + property ScrollBarPage; property ShowGrid; property ShowHeader; property ShowHint; -- cgit v1.2.3-70-g09d2 From 78d25c5f23eb6ce2bfe146e78c6a0fc9f89e400d Mon Sep 17 00:00:00 2001 From: "Jean-Marc.Levecque" Date: Sat, 6 Dec 2014 15:36:30 +0000 Subject: Allow grids scrollbarwidth setting --- src/gui/fpg_basegrid.pas | 22 ++++++++++++++++++++-- src/gui/fpg_grid.pas | 1 + 2 files changed, 21 insertions(+), 2 deletions(-) (limited to 'src/gui/fpg_grid.pas') 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 diff --git a/src/gui/fpg_grid.pas b/src/gui/fpg_grid.pas index 12257f56..1f7e0f54 100644 --- a/src/gui/fpg_grid.pas +++ b/src/gui/fpg_grid.pas @@ -160,6 +160,7 @@ type property RowSelect; property ScrollBarStyle; property ScrollBarPage; + property ScrollBarWidth; property ShowGrid; property ShowHeader; property ShowHint; -- cgit v1.2.3-70-g09d2