diff options
author | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-08-15 22:46:28 +0000 |
---|---|---|
committer | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-08-15 22:46:28 +0000 |
commit | ba207d0e5ca65ab32a5435143aaa24d57f19d89a (patch) | |
tree | db7bd727bbbc5d1b1ebae8b653421adb176a29ad /src | |
parent | 056bebf239841b80a09d5e574cc54f15060f0176 (diff) | |
download | fpGUI-ba207d0e5ca65ab32a5435143aaa24d57f19d89a.tar.xz |
* Fixed bug in Horz and Vert scrollbars where they didn't follow
position while scrolling with the mouse wheel.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/gui_basegrid.pas | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/gui/gui_basegrid.pas b/src/gui/gui_basegrid.pas index 7d31022d..338cd1f0 100644 --- a/src/gui/gui_basegrid.pas +++ b/src/gui/gui_basegrid.pas @@ -352,8 +352,23 @@ begin for i := 1 to ColumnCount do cw := cw + ColumnWidth[i]; - FHScrollBar.Visible := cw > vw; - FVScrollBar.Visible := (RowCount > VisibleLines); + // This needs improving while resizing + if cw > vw then + FHScrollBar.Visible := True + else + begin + FHScrollBar.Visible := False; + FFirstCol := 1; + end; + + // This needs improving while resizing + if (RowCount > VisibleLines) then + FVScrollBar.Visible := True + else + begin + FVScrollBar.Visible := False; + FFirstRow := 1; + end; if FVScrollBar.Visible then begin @@ -365,6 +380,7 @@ begin FVScrollBar.SliderSize := 0; FVScrollBar.Max := RowCount-VisibleLines+1; FVScrollBar.Position := FFirstRow; + FVScrollBar.RepaintSlider; end; if FHScrollBar.Visible then @@ -373,7 +389,8 @@ begin FHScrollBar.Min := 1; FHScrollBar.SliderSize := 0.2; FHScrollBar.Max := ColumnCount; - FHScrollBar.Position := FFocusCol; + FHScrollBar.Position := FFirstCol; + FHScrollBar.RepaintSlider; end; FHScrollBar.Top := Height -FHScrollBar.Height - 2; @@ -661,7 +678,7 @@ begin inc(FFirstRow, abs(delta)) else // scroll up dec(FFirstRow, abs(delta)); - + // apply limits if FFirstRow > RowCount - VisibleLines + 1 then FFirstRow := RowCount - VisibleLines + 1; |