mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-12 05:30:56 +01:00
T(Float)SpinEditEx: Add property Orientation for horizontal arrangement of spin buttons.
This commit is contained in:
parent
61618c1b9f
commit
117df60bf4
@ -323,6 +323,11 @@ begin
|
|||||||
Result := FNullValue;
|
Result := FNullValue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TSpinEditExBase.GetOrientation: TUDOrientation;
|
||||||
|
begin
|
||||||
|
Result := UpDown.Orientation;
|
||||||
|
end;
|
||||||
|
|
||||||
function TSpinEditExBase.GetUpDown: TUpDown;
|
function TSpinEditExBase.GetUpDown: TUpDown;
|
||||||
begin
|
begin
|
||||||
Result := TUpDown(Buddy);
|
Result := TUpDown(Buddy);
|
||||||
@ -335,6 +340,20 @@ begin
|
|||||||
UpdateControl;
|
UpdateControl;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TSpinEditExBase.SetOrientation(AValue: TUDOrientation);
|
||||||
|
var
|
||||||
|
w: Integer;
|
||||||
|
begin
|
||||||
|
if GetOrientation = AValue then
|
||||||
|
exit;
|
||||||
|
w := UpDown.Width;
|
||||||
|
UpDown.Orientation := AValue;
|
||||||
|
case GetOrientation of
|
||||||
|
udVertical: UpDown.Width := w div 2;
|
||||||
|
udHorizontal: UpDown.Width := w * 2;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
constructor TSpinEditExBase.Create(TheOwner: TComponent);
|
constructor TSpinEditExBase.Create(TheOwner: TComponent);
|
||||||
begin
|
begin
|
||||||
inherited Create(TheOwner);
|
inherited Create(TheOwner);
|
||||||
|
|||||||
@ -112,6 +112,7 @@ type
|
|||||||
FMustSetModifiedToTrueInOnChange: Boolean;
|
FMustSetModifiedToTrueInOnChange: Boolean;
|
||||||
FNullValue: T;
|
FNullValue: T;
|
||||||
FNullValueBehaviour: TNullValueBehaviour;
|
FNullValueBehaviour: TNullValueBehaviour;
|
||||||
|
FOrientation: TUDOrientation;
|
||||||
FValue: T;
|
FValue: T;
|
||||||
FUpdatePending: Boolean;
|
FUpdatePending: Boolean;
|
||||||
FSettingValue: Boolean;
|
FSettingValue: Boolean;
|
||||||
@ -119,6 +120,7 @@ type
|
|||||||
procedure SetMinRepeatValue(AValue: Byte);
|
procedure SetMinRepeatValue(AValue: Byte);
|
||||||
procedure SpinUpDown(Up: Boolean);
|
procedure SpinUpDown(Up: Boolean);
|
||||||
function GetNullValue: T;
|
function GetNullValue: T;
|
||||||
|
function GetOrientation: TUDOrientation;
|
||||||
function GetUpDown: TUpDown;
|
function GetUpDown: TUpDown;
|
||||||
function GetValue: T;
|
function GetValue: T;
|
||||||
function IncrementStored: Boolean;
|
function IncrementStored: Boolean;
|
||||||
@ -126,6 +128,7 @@ type
|
|||||||
function IsOutOfLimits(AValue: T): Boolean;
|
function IsOutOfLimits(AValue: T): Boolean;
|
||||||
function MaxValueStored: Boolean;
|
function MaxValueStored: Boolean;
|
||||||
function MinValueStored: Boolean;
|
function MinValueStored: Boolean;
|
||||||
|
procedure SetOrientation(AValue: TUDOrientation);
|
||||||
procedure UpdateControl;
|
procedure UpdateControl;
|
||||||
procedure UpDownChangingEx(Sender: TObject; var {%H-}AllowChange: Boolean;
|
procedure UpDownChangingEx(Sender: TObject; var {%H-}AllowChange: Boolean;
|
||||||
{%H-}NewValue: SmallInt; Direction: TUpDownDirection);
|
{%H-}NewValue: SmallInt; Direction: TUpDownDirection);
|
||||||
@ -161,6 +164,7 @@ type
|
|||||||
property UpDown: TUpDown read GetUpDown;
|
property UpDown: TUpDown read GetUpDown;
|
||||||
property UpDownVisible: Boolean read GetBuddyVisible write SetBuddyVisible default True;
|
property UpDownVisible: Boolean read GetBuddyVisible write SetBuddyVisible default True;
|
||||||
property MinRepeatValue: Byte read FMinRepeatValue write SetMinRepeatValue default DefMinRepeatValue;
|
property MinRepeatValue: Byte read FMinRepeatValue write SetMinRepeatValue default DefMinRepeatValue;
|
||||||
|
property Orientation: TUDOrientation read GetOrientation write SetOrientation default udVertical;
|
||||||
public
|
public
|
||||||
constructor Create(TheOwner: TComponent); override;
|
constructor Create(TheOwner: TComponent); override;
|
||||||
function GetLimitedValue(const AValue: T): T; virtual;
|
function GetLimitedValue(const AValue: T): T; virtual;
|
||||||
@ -301,6 +305,7 @@ type
|
|||||||
property MinRepeatValue;
|
property MinRepeatValue;
|
||||||
property NullValue;
|
property NullValue;
|
||||||
property NullValueBehaviour;
|
property NullValueBehaviour;
|
||||||
|
property Orientation;
|
||||||
property Spacing;
|
property Spacing;
|
||||||
property UpDownVisible;
|
property UpDownVisible;
|
||||||
property Value;
|
property Value;
|
||||||
@ -406,6 +411,7 @@ type
|
|||||||
property MinRepeatValue;
|
property MinRepeatValue;
|
||||||
property NullValue;
|
property NullValue;
|
||||||
property NullValueBehaviour;
|
property NullValueBehaviour;
|
||||||
|
property Orientation;
|
||||||
property Spacing;
|
property Spacing;
|
||||||
property ThousandSeparator;
|
property ThousandSeparator;
|
||||||
property UpDownVisible;
|
property UpDownVisible;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user