mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-19 08:48:19 +02:00
LCL: Change button color when enabling/disabling TUpDown. Patch from Anton, issue #18913
git-svn-id: trunk@30472 -
This commit is contained in:
parent
580a85d184
commit
a5e1656dfb
@ -1439,6 +1439,7 @@ type
|
|||||||
procedure AssociateKeyDown(Sender: TObject; var Key: Word; ShiftState : TShiftState);
|
procedure AssociateKeyDown(Sender: TObject; var Key: Word; ShiftState : TShiftState);
|
||||||
procedure OnAssociateChangeBounds(Sender: TObject);
|
procedure OnAssociateChangeBounds(Sender: TObject);
|
||||||
procedure DoOnResize; override;
|
procedure DoOnResize; override;
|
||||||
|
procedure SetEnabled(Value: Boolean); override;
|
||||||
class function GetControlClassDefaultSize: TSize; override;
|
class function GetControlClassDefaultSize: TSize; override;
|
||||||
function CanChange: Boolean; virtual;
|
function CanChange: Boolean; virtual;
|
||||||
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
|
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
|
||||||
|
@ -131,7 +131,10 @@ var
|
|||||||
begin
|
begin
|
||||||
Inherited Paint;
|
Inherited Paint;
|
||||||
|
|
||||||
Canvas.Pen.Color := clBtnText;//Not perfect, but it works
|
if Enabled then
|
||||||
|
Canvas.Pen.Color := clBtnText //Not perfect, but it works
|
||||||
|
else
|
||||||
|
Canvas.Pen.Color := clGrayText;
|
||||||
|
|
||||||
ah := height div 2;
|
ah := height div 2;
|
||||||
aw := width div 2;
|
aw := width div 2;
|
||||||
@ -393,6 +396,13 @@ begin
|
|||||||
UpdateOrientation;
|
UpdateOrientation;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomUpDown.SetEnabled(Value: Boolean);
|
||||||
|
begin
|
||||||
|
MinBtn.Enabled := Value;
|
||||||
|
MaxBtn.Enabled := Value;
|
||||||
|
inherited SetEnabled(Value);
|
||||||
|
end;
|
||||||
|
|
||||||
class function TCustomUpDown.GetControlClassDefaultSize: TSize;
|
class function TCustomUpDown.GetControlClassDefaultSize: TSize;
|
||||||
begin
|
begin
|
||||||
Result.CX := 17;
|
Result.CX := 17;
|
||||||
|
Loading…
Reference in New Issue
Block a user