mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-25 00:39:28 +02:00
Some minor extensions to TCDTrackBar
git-svn-id: trunk@35113 -
This commit is contained in:
parent
3a4a59c37b
commit
88f38a5ae9
@ -279,7 +279,7 @@ type
|
|||||||
// fields
|
// fields
|
||||||
FMax: Integer;
|
FMax: Integer;
|
||||||
FMin: Integer;
|
FMin: Integer;
|
||||||
FOnChange: TNotifyEvent;
|
FOnChange, FOnChangeByUser: TNotifyEvent;
|
||||||
FPageSize: Integer;
|
FPageSize: Integer;
|
||||||
FPosition: Integer;
|
FPosition: Integer;
|
||||||
procedure SetMax(AValue: Integer);
|
procedure SetMax(AValue: Integer);
|
||||||
@ -319,6 +319,7 @@ type
|
|||||||
property Max: Integer read FMax write SetMax;
|
property Max: Integer read FMax write SetMax;
|
||||||
property Min: Integer read FMin write SetMin;
|
property Min: Integer read FMin write SetMin;
|
||||||
property OnChange: TNotifyEvent read FOnChange write FOnChange;
|
property OnChange: TNotifyEvent read FOnChange write FOnChange;
|
||||||
|
property OnChangeByUser: TNotifyEvent read FOnChangeByUser write FOnChangeByUser;
|
||||||
property Position: Integer read FPosition write SetPosition;
|
property Position: Integer read FPosition write SetPosition;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -442,6 +443,7 @@ type
|
|||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
//procedure Paint; override;
|
//procedure Paint; override;
|
||||||
published
|
published
|
||||||
|
property Align;
|
||||||
property Color;
|
property Color;
|
||||||
property DrawStyle;
|
property DrawStyle;
|
||||||
property Enabled;
|
property Enabled;
|
||||||
@ -1942,12 +1944,20 @@ begin
|
|||||||
if FMoveByDragging then
|
if FMoveByDragging then
|
||||||
begin
|
begin
|
||||||
NewPosition := FPositionAtMouseDown + GetPositionDisplacement(FLastMouseDownPos, Point(X, Y));
|
NewPosition := FPositionAtMouseDown + GetPositionDisplacement(FLastMouseDownPos, Point(X, Y));
|
||||||
Position := NewPosition;
|
if NewPosition <> Position then
|
||||||
|
begin
|
||||||
|
Position := NewPosition;
|
||||||
|
if Assigned(FOnChangeByUser) then FOnChangeByUser(Self);
|
||||||
|
end;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
NewPosition := GetPositionFromMousePos(X, Y);
|
NewPosition := GetPositionFromMousePos(X, Y);
|
||||||
if NewPosition >= 0 then Position := NewPosition;
|
if (NewPosition >= 0) and (NewPosition <> Position) then
|
||||||
|
begin
|
||||||
|
Position := NewPosition;
|
||||||
|
if Assigned(FOnChangeByUser) then FOnChangeByUser(Self);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
inherited MouseMove(Shift, X, Y);
|
inherited MouseMove(Shift, X, Y);
|
||||||
|
Loading…
Reference in New Issue
Block a user