summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorDavid Laurence Emerson <dle3ab@angelbase.com>2013-04-17 22:47:05 -0700
committerDavid Laurence Emerson <dle3ab@angelbase.com>2013-04-18 21:19:46 -0700
commitf95f261dc0a36fc387cc7295d68cafc71410b0c9 (patch)
treec933b67618e21e78c2a2b6e39a2d3b27f2b318a2 /src/gui
parentc0bbd17213034ceda7f078ac1d2adb0d5561a7d7 (diff)
downloadfpGUI-f95f261dc0a36fc387cc7295d68cafc71410b0c9.tar.xz
Grids: basegrid updateScrollbars done?
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/fpg_basegrid.pas66
1 files changed, 33 insertions, 33 deletions
diff --git a/src/gui/fpg_basegrid.pas b/src/gui/fpg_basegrid.pas
index 42e92053..c86f3bb5 100644
--- a/src/gui/fpg_basegrid.pas
+++ b/src/gui/fpg_basegrid.pas
@@ -686,32 +686,17 @@ begin
end;
end;
+ // set the scrollbar width/height space
+ if showV then
+ Dec(HWidth, FVScrollBar.Width);
if showH then
- FHScrollBar.Visible := true
- else
- begin
- FHScrollBar.Visible := false;
- if Hfits then
- begin
- FFirstCol := 0;
- FXOffset := 0;
- end;
- // if horizontal doesn't fit and no scrollbar, do not change firstcol/xoffset
- end;
+ Dec(VHeight, FHScrollBar.Height);
- if showV then
- FVScrollBar.Visible := true
- else
- begin
- FVScrollBar.Visible := false;
- if Vfits then
- FFirstRow := 0;
- // if vertical doesn't fit and no scrollbar, do not change firstrow
- end;
+ // show or hide the scrollbars
- if FVScrollBar.Visible then
+ if showV then
begin
- Dec(HWidth, FVScrollBar.Width);
+ FVScrollBar.Visible := true;
FVScrollBar.Min := 0;
if RowCount > 0 then
FVScrollBar.SliderSize := VisibleLines / RowCount
@@ -720,11 +705,21 @@ begin
FVScrollBar.Max := RowCount-VisibleLines;
FVScrollBar.Position := FFirstRow;
FVScrollBar.RepaintSlider;
+ FVScrollBar.Top := 2;
+ FVScrollBar.Left := Width - FVScrollBar.Width - 2;
+ FVScrollBar.Height := VHeight;
+ end
+ else
+ begin
+ FVScrollBar.Visible := false;
+ if Vfits then
+ FFirstRow := 0;
+ // if vertical doesn't fit and no scrollbar, do not change firstrow
end;
-
- if FHScrollBar.Visible then
+
+ if showH then
begin
- Dec(VHeight, FHScrollBar.Height);
+ FHScrollBar.Visible := true;
FHScrollBar.Min := 0;
if go_SmoothScroll in FOptions then
begin
@@ -739,16 +734,21 @@ begin
FHScrollBar.SliderSize := 1 / ColumnCount;
end;
FHScrollBar.RepaintSlider;
+ FHScrollBar.Top := Height -FHScrollBar.Height - 2;
+ FHScrollBar.Left := 2;
+ FHScrollBar.Width := HWidth;
+ end
+ else
+ begin
+ FHScrollBar.Visible := false;
+ if Hfits then
+ begin
+ FFirstCol := 0;
+ FXOffset := 0;
+ end;
+ // if horizontal doesn't fit and no scrollbar, do not change firstcol/xoffset
end;
- FHScrollBar.Top := Height -FHScrollBar.Height - 2;
- FHScrollBar.Left := 2;
- FHScrollBar.Width := HWidth;
-
- FVScrollBar.Top := 2;
- FVScrollBar.Left := Width - FVScrollBar.Width - 2;
- FVScrollBar.Height := VHeight;
-
FVScrollBar.UpdateWindowPosition;
FHScrollBar.UpdateWindowPosition;
end;