diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2010-05-31 10:27:51 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2010-05-31 10:27:51 +0200 |
commit | 93b69c0bc710d88e7156cb894544d0cc961c529c (patch) | |
tree | 774bb10edd51936a878f4e92a7c03405fb8335dd /src | |
parent | 0604893269537fed3e48ccfb57d69be92a4a4057 (diff) | |
download | fpGUI-93b69c0bc710d88e7156cb894544d0cc961c529c.tar.xz |
Scrollbar: replaced magic numbers with a constant.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/fpg_scrollbar.pas | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gui/fpg_scrollbar.pas b/src/gui/fpg_scrollbar.pas index 4f3562e4..08a0b2a3 100644 --- a/src/gui/fpg_scrollbar.pas +++ b/src/gui/fpg_scrollbar.pas @@ -98,6 +98,9 @@ type implementation +const + cMinSliderLength = 20; + { TfpgScrollBar } constructor TfpgScrollBar.Create(AOwner: TComponent); @@ -113,7 +116,7 @@ begin SliderSize := 0.5; FOnScroll := nil; FSliderPos := 0; - FSliderLength := 10; + FSliderLength := cMinSliderLength; FScrollStep := 1; FPageSize := 5; FLargeChange := 0; @@ -346,8 +349,8 @@ begin FSliderLength := Trunc(area * SliderSize); //FSliderLength := Trunc((width/area) * (fmax /area )); - if FSliderLength < 20 then - FSliderLength := 20; + if FSliderLength < cMinSliderLength then + FSliderLength := cMinSliderLength; if FSliderLength > area then FSliderLength := area; area := area - FSliderLength; |