mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 15:59:13 +02:00
LCL: TUpDown: override directly instead of indirect via events
git-svn-id: trunk@46772 -
This commit is contained in:
parent
1a30c3ba70
commit
5ebadd515f
@ -21,11 +21,11 @@ Type
|
|||||||
FUpDown : TCustomUpDown;
|
FUpDown : TCustomUpDown;
|
||||||
FButtonType : TUDBtnType;
|
FButtonType : TUDBtnType;
|
||||||
protected
|
protected
|
||||||
procedure ButtonMouseDown(Sender: TObject; Button: TMouseButton;
|
procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer
|
||||||
Shift: TShiftState; X, Y: Integer);
|
); override;
|
||||||
procedure ButtonMouseUp(Sender: TObject; Button: TMouseButton;
|
procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
||||||
Shift: TShiftState; X, Y: Integer);
|
override;
|
||||||
procedure DoubleClick(Sender: TObject);
|
procedure DblClick; override;
|
||||||
public
|
public
|
||||||
constructor CreateWithParams(UpDown : TCustomUpDown;
|
constructor CreateWithParams(UpDown : TCustomUpDown;
|
||||||
ButtonType : TUDBtnType);
|
ButtonType : TUDBtnType);
|
||||||
@ -34,8 +34,8 @@ Type
|
|||||||
procedure Paint; override;
|
procedure Paint; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TUpDownButton.ButtonMouseDown(Sender: TObject; Button: TMouseButton;
|
procedure TUpDownButton.MouseDown(Button: TMouseButton; Shift: TShiftState; X,
|
||||||
Shift: TShiftState; X, Y: Integer);
|
Y: Integer);
|
||||||
begin
|
begin
|
||||||
if Button = mbLeft then begin
|
if Button = mbLeft then begin
|
||||||
With FUpDown do begin
|
With FUpDown do begin
|
||||||
@ -54,8 +54,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TUpDownButton.ButtonMouseUp(Sender: TObject; Button: TMouseButton;
|
procedure TUpDownButton.MouseUp(Button: TMouseButton; Shift: TShiftState; X,
|
||||||
Shift: TShiftState; X, Y: Integer);
|
Y: Integer);
|
||||||
begin
|
begin
|
||||||
With FUpDown do
|
With FUpDown do
|
||||||
If Assigned(BTimer) then begin
|
If Assigned(BTimer) then begin
|
||||||
@ -66,7 +66,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TUpDownButton.DoubleClick(Sender: TObject);
|
procedure TUpDownButton.DblClick;
|
||||||
begin
|
begin
|
||||||
Click;
|
Click;
|
||||||
end;
|
end;
|
||||||
@ -121,9 +121,6 @@ begin
|
|||||||
|
|
||||||
Parent := FUpDown;
|
Parent := FUpDown;
|
||||||
ControlStyle := ControlStyle + [csNoFocus, csNoDesignSelectable];
|
ControlStyle := ControlStyle + [csNoFocus, csNoDesignSelectable];
|
||||||
OnMouseDown := @ButtonMouseDown;
|
|
||||||
OnMouseUp := @ButtonMouseUp;
|
|
||||||
OnDblClick := @DoubleClick;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TUpDownButton.Paint;
|
procedure TUpDownButton.Paint;
|
||||||
|
Loading…
Reference in New Issue
Block a user