summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gui/fpg_trackbar.pas14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/gui/fpg_trackbar.pas b/src/gui/fpg_trackbar.pas
index ed2aa167..ad997817 100644
--- a/src/gui/fpg_trackbar.pas
+++ b/src/gui/fpg_trackbar.pas
@@ -100,16 +100,17 @@ type
private
FScrollStep: integer;
FShowPosition: boolean;
- FSliderPos: TfpgCoord;
FSliderLength: TfpgCoord;
FSliderDragging: boolean;
FSliderDragPos: TfpgCoord;
FSliderDragStart: TfpgCoord;
FMousePosition: TPoint;
- FFont: TfpgFont;
procedure SetShowPosition(const AValue: boolean);
function GetTextWidth: TfpgCoord;
+ procedure SetSliderLength(AValue: integer);
protected
+ FFont: TfpgFont;
+ FSliderPos: TfpgCoord;
procedure HandleLMouseDown(x, y: integer; shiftstate: TShiftState); override;
procedure HandleLMouseUp(x, y: integer; shiftstate: TShiftState); override;
procedure HandleMouseMove(x, y: integer; btnstate: word; shiftstate: TShiftState); override;
@@ -131,6 +132,7 @@ type
property ScrollStep: integer read FScrollStep write FScrollStep default 1;
property ShowHint;
property ShowPosition: boolean read FShowPosition write SetShowPosition default False;
+ property SliderLength: integer read FSliderLength write SetSliderLength default 11;
property TabOrder;
property TextColor;
property OnChange;
@@ -421,6 +423,14 @@ begin
Result := 0;
end;
+procedure TfpgTrackBar.SetSliderLength(AValue: integer);
+begin
+ if FSliderLength = AValue then
+ Exit;
+ FSliderLength := AValue;
+ RePaint;
+end;
+
procedure TfpgTrackBar.HandleLMouseDown(x, y: integer; shiftstate: TShiftState);
var
tw: TfpgCoord;