diff options
-rw-r--r-- | examples/gui/gridtest/gridtest.lpr | 11 | ||||
-rw-r--r-- | src/gui/fpg_basegrid.pas | 19 | ||||
-rw-r--r-- | src/gui/fpg_scrollbar.pas | 2 |
3 files changed, 30 insertions, 2 deletions
diff --git a/examples/gui/gridtest/gridtest.lpr b/examples/gui/gridtest/gridtest.lpr index 173806e9..4b53f260 100644 --- a/examples/gui/gridtest/gridtest.lpr +++ b/examples/gui/gridtest/gridtest.lpr @@ -17,7 +17,8 @@ uses fpg_checkbox, fpg_tab, fpg_edit, - fpg_dialogs; + fpg_dialogs, + fpg_scrollbar; type @@ -256,6 +257,14 @@ begin OnDrawCell := @StringGridDrawCell; OnDoubleClick := @StringGridDoubleClicked; OnHeaderClick := @StringGridHeaderClicked; + // Testing various scrollbar styles +// ScrollBarStyle:= ssNone; +// ScrollBarStyle:= ssHorizontal; +// ScrollBarStyle:= ssVertical; + ScrollBarStyle:= ssAutoBoth; +// ScrollBarStyle:= ssHorizVisible; +// ScrollBarStyle:= ssVertiVisible; +// ScrollBarStyle:= ssBothVisible; end; chkShowHeader := TfpgCheckBox.Create(self); diff --git a/src/gui/fpg_basegrid.pas b/src/gui/fpg_basegrid.pas index 560a7a46..5ed95ab4 100644 --- a/src/gui/fpg_basegrid.pas +++ b/src/gui/fpg_basegrid.pas @@ -815,6 +815,25 @@ begin getVisLines; end; end; + ssHorizVisible: + begin + hideScrollbar (FVScrollBar); + showH := true; + getVisLines; + end; + ssVertiVisible: + begin + hideScrollbar (FHScrollBar); + showV := true; + getVisWidth; + end; + ssBothVisible: + begin + showV := true; + showH := true; + getVisLines; + getVisWidth; + end; end; // set the scrollbar width/height space diff --git a/src/gui/fpg_scrollbar.pas b/src/gui/fpg_scrollbar.pas index 1ec78952..fbe20006 100644 --- a/src/gui/fpg_scrollbar.pas +++ b/src/gui/fpg_scrollbar.pas @@ -36,7 +36,7 @@ uses type TScrollNotifyEvent = procedure(Sender: TObject; position: integer) of object; - TfpgScrollStyle = (ssNone, ssHorizontal, ssVertical, ssAutoBoth, ssBothVisible); + TfpgScrollStyle = (ssNone, ssHorizontal, ssVertical, ssAutoBoth, ssHorizVisible, ssVertiVisible, ssBothVisible); TfpgScrollBarPart = (sbpNone, sbpUpBack, sbpPageUpBack, sbpSlider, sbpDownForward, sbpPageDownForward); |