summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graemeg@gmail.com>2010-06-11 23:46:16 +0200
committerGraeme Geldenhuys <graemeg@gmail.com>2010-06-11 23:46:16 +0200
commit21b3e2e6dbb3b643d43d5078276639b77374b671 (patch)
tree64d8eb9bfd8c52675fea1361681cf83aa193cdf6
parenta1de92ee4fc353111f9d5b1aeaca3a64273c4074 (diff)
downloadfpGUI-21b3e2e6dbb3b643d43d5078276639b77374b671.tar.xz
Scrollbar: New convenience functions added.
These functions set a new scrollbar position and fires the OnScroll event.
-rw-r--r--src/gui/fpg_scrollbar.pas24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/gui/fpg_scrollbar.pas b/src/gui/fpg_scrollbar.pas
index 12541b9c..55db9f59 100644
--- a/src/gui/fpg_scrollbar.pas
+++ b/src/gui/fpg_scrollbar.pas
@@ -87,6 +87,10 @@ type
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure RepaintSlider;
+ procedure LineUp;
+ procedure LineDown;
+ procedure PageUp;
+ procedure PageDown;
property PageSize: integer read FPageSize write FPageSize default 5;
property Position: integer read FPosition write SetSBPosition default 10;
property ScrollStep: integer read FScrollStep write FScrollStep default 1;
@@ -163,6 +167,26 @@ begin
Invalidate;// DrawSlider(True);
end;
+procedure TfpgScrollBar.LineUp;
+begin
+ Step(-1);
+end;
+
+procedure TfpgScrollBar.LineDown;
+begin
+ Step(1);
+end;
+
+procedure TfpgScrollBar.PageUp;
+begin
+ StepPage(-1);
+end;
+
+procedure TfpgScrollBar.PageDown;
+begin
+ StepPage(1);
+end;
+
procedure TfpgScrollBar.SetMax(const AValue: integer);
begin
if AValue = FMax then