summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorgraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-03-14 10:03:55 +0000
committergraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-03-14 10:03:55 +0000
commit19e38489164dbd200277b17d3e2679a5e4549f81 (patch)
treeab0b08af8e48d0b3620e444da6b089e13186cf8a /src/gui
parent2a371d8659193d625c3d6b1df72b9bf0e2cbc489 (diff)
downloadfpGUI-19e38489164dbd200277b17d3e2679a5e4549f81.tar.xz
* Applied on the TopRow property changes from Jean-Marc's patch [ 1909562 ].
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/gui_basegrid.pas18
-rw-r--r--src/gui/gui_grid.pas1
2 files changed, 17 insertions, 2 deletions
diff --git a/src/gui/gui_basegrid.pas b/src/gui/gui_basegrid.pas
index e36587e3..d0760afd 100644
--- a/src/gui/gui_basegrid.pas
+++ b/src/gui/gui_basegrid.pas
@@ -91,6 +91,7 @@ type
procedure SetShowHeader(const AValue: boolean);
function VisibleLines: integer;
function VisibleWidth: integer;
+ procedure SetFirstRow(const AValue: integer);
protected
procedure UpdateScrollBars; virtual;
function GetHeaderText(ACol: integer): string; virtual;
@@ -129,6 +130,7 @@ type
property HeaderHeight: integer read FHeaderHeight;
// property ColResizing: boolean read FColResizing write FColResizing;
property ColumnWidth[ACol: integer]: integer read GetColumnWidth write SetColumnWidth;
+ property TopRow: integer read FFirstRow write SetFirstRow;
property OnFocusChange: TfpgFocusChangeNotify read FOnFocusChange write FOnFocusChange;
property OnRowChange: TfpgRowChangeNotify read FOnRowChange write FOnRowChange;
property OnCanSelectCell: TfpgCanSelectCellEvent read FOnCanSelectCell write FOnCanSelectCell;
@@ -169,6 +171,8 @@ procedure TfpgBaseGrid.SetFontDesc(const AValue: string);
begin
FFont.Free;
FFont := fpgGetFont(AValue);
+ if DefaultRowHeight < FFont.Height + 2 then
+ DefaultRowHeight := FFont.Height + 2;
RePaint;
end;
@@ -176,6 +180,8 @@ procedure TfpgBaseGrid.SetHeaderFontDesc(const AValue: string);
begin
FHeaderFont.Free;
FHeaderFont := fpgGetFont(AValue);
+ if FHeaderHeight < FHeaderFont.Height + 2 then
+ FHeaderHeight := FHeaderFont.Height + 2;
RePaint;
end;
@@ -332,7 +338,6 @@ begin
FollowFocus;
CheckFocusChange;
- UpdateScrollBars;
end;
procedure TfpgBaseGrid.SetFocusRow(const AValue: integer);
@@ -349,7 +354,6 @@ begin
FollowFocus;
CheckFocusChange;
- UpdateScrollBars;
end;
procedure TfpgBaseGrid.CheckFocusChange;
@@ -407,6 +411,16 @@ begin
Result := Width - FMargin*2 - sw;
end;
+procedure TfpgBaseGrid.SetFirstRow(const AValue: integer);
+begin
+ if FFirstRow = AValue then
+ Exit;
+ if AValue < (RowCount - VisibleLines + 1) then
+ FFirstRow := AValue;
+ UpdateScrollBars;
+ RePaint;
+end;
+
procedure TfpgBaseGrid.UpdateScrollBars;
var
HWidth: integer;
diff --git a/src/gui/gui_grid.pas b/src/gui/gui_grid.pas
index 1ab6c288..0f1f0999 100644
--- a/src/gui/gui_grid.pas
+++ b/src/gui/gui_grid.pas
@@ -158,6 +158,7 @@ type
property ShowGrid;
property ShowHeader;
property TabOrder;
+ property TopRow;
property OnCanSelectCell;
property OnDoubleClick;
property OnFocusChange;