lcl: updown: add flat property.

git-svn-id: trunk@51966 -
This commit is contained in:
ondrej 2016-03-17 06:57:22 +00:00
parent 4111ab4964
commit bc17ed1345
2 changed files with 20 additions and 0 deletions

View File

@ -1851,6 +1851,7 @@ type
FWrap: Boolean;
function GetPosition: SmallInt;
procedure BTimerExec(Sender : TObject);
function GetFlat: Boolean;
procedure SetAlignButton(Value: TUDAlignButton);
procedure SetArrowKeys(Value: Boolean);
procedure SetAssociate(Value: TWinControl);
@ -1861,6 +1862,7 @@ type
procedure SetOrientation(Value: TUDOrientation);
procedure SetPosition(Value: SmallInt);
procedure SetThousands(Value: Boolean);
procedure SetFlat(Value: Boolean);
procedure SetWrap(Value: Boolean);
procedure UpdateAlignButtonPos;
procedure UpdateOrientation;
@ -1893,6 +1895,7 @@ type
property Orientation: TUDOrientation read FOrientation write SetOrientation default udVertical;
property Position: SmallInt read GetPosition write SetPosition;
property Thousands: Boolean read FThousands write SetThousands default True;
property Flat: Boolean read GetFlat write SetFlat default False;
property Wrap: Boolean read FWrap write SetWrap;
public
constructor Create(AOwner: TComponent); override;
@ -1938,6 +1941,7 @@ type
property TabOrder;
property TabStop;
property Thousands;
property Flat;
property Visible;
property Wrap;
end;

View File

@ -483,6 +483,14 @@ begin
Result := FPosition;
end;
function TCustomUpDown.GetFlat: Boolean;
begin
if FMinBtn<>nil then
Result := (FMinBtn as TSpeedButton).Flat
else
Result := False;
end;
procedure TCustomUpDown.SetMin(Value: SmallInt);
begin
if Value <> FMin then
@ -549,6 +557,14 @@ begin
FThousands := Value;
end;
procedure TCustomUpDown.SetFlat(Value: Boolean);
begin
if Flat = Value then Exit;
(FMinBtn as TSpeedButton).Flat := Value;
(FMaxBtn as TSpeedButton).Flat := Value;
end;
procedure TCustomUpDown.SetWrap(Value: Boolean);
begin
if Value <> FWrap then