mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-24 19:59:37 +02:00
LazControls: Add property UpDownVisible to SpinEditEx controls.
git-svn-id: trunk@58322 -
This commit is contained in:
parent
ce6f326b14
commit
24756e40d1
@ -66,8 +66,6 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
procedure TSpinEditExBase.UpDownChangingEx(Sender: TObject;
|
||||
var AllowChange: Boolean; NewValue: SmallInt; Direction: TUpDownDirection);
|
||||
begin
|
||||
@ -83,14 +81,11 @@ begin
|
||||
BuddyClick;
|
||||
end;
|
||||
|
||||
|
||||
function TSpinEditExBase.GetBuddyClassType: TControlClass;
|
||||
begin
|
||||
Result := TUpDown;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
procedure TSpinEditExBase.DoEnter;
|
||||
begin
|
||||
inherited DoEnter;
|
||||
@ -259,7 +254,6 @@ begin
|
||||
Result := IsLimited and ((AValue < MinValue) or (AValue > MaxValue));
|
||||
end;
|
||||
|
||||
|
||||
function TSpinEditExBase.GetEdit: TGEEdit;
|
||||
begin
|
||||
Result := BaseEditor;
|
||||
@ -273,6 +267,13 @@ begin
|
||||
UpDown.MinRepeatInterval := FMinRepeatValue;
|
||||
end;
|
||||
|
||||
procedure TSpinEditExBase.SetUpDownVisible(AValue: Boolean);
|
||||
begin
|
||||
if FUpDownVisible=AValue then Exit;
|
||||
FUpDownVisible:=AValue;
|
||||
UpDown.Visible:=AValue;
|
||||
UpdateSpacing;
|
||||
end;
|
||||
|
||||
procedure TSpinEditExBase.SpinUpDown(Up: Boolean);
|
||||
var
|
||||
@ -317,6 +318,7 @@ begin
|
||||
inherited Create(TheOwner);
|
||||
|
||||
FArrowKeys := True;
|
||||
FUpDownVisible := True;
|
||||
FIncrement := DefIncrement;
|
||||
FMaxValue := DefMaxValue;
|
||||
FUpdatePending := True;
|
||||
|
@ -65,7 +65,7 @@
|
||||
|
||||
---------------------------------------------------------------------------- }
|
||||
|
||||
unit spinex;
|
||||
unit SpinEx;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
@ -112,9 +112,11 @@ type
|
||||
FNullValueBehaviour: TNullValueBehaviour;
|
||||
FValue: T;
|
||||
FUpdatePending: Boolean;
|
||||
FUpDownVisible: Boolean;
|
||||
FSettingValue: Boolean;
|
||||
function GetEdit: TGEEdit;
|
||||
procedure SetMinRepeatValue(AValue: Byte);
|
||||
procedure SetUpDownVisible(AValue: Boolean);
|
||||
procedure SpinUpDown(Up: Boolean);
|
||||
function GetNullValue: T;
|
||||
function GetUpDown: TUpDown;
|
||||
@ -151,6 +153,7 @@ type
|
||||
property ArrowKeys: Boolean read FArrowKeys write FArrowKeys default True;
|
||||
property Edit: TGEEdit read GetEdit;
|
||||
property UpDown: TUpDown read GetUpDown;
|
||||
property UpDownVisible: Boolean read FUpDownVisible write SetUpDownVisible;
|
||||
property MinRepeatValue: Byte read FMinRepeatValue write SetMinRepeatValue default DefMinRepeatValue;
|
||||
public
|
||||
constructor Create(TheOwner: TComponent); override;
|
||||
@ -270,6 +273,7 @@ type
|
||||
property NullValue;
|
||||
property NullValueBehaviour;
|
||||
property Spacing;
|
||||
property UpDownVisible;
|
||||
property Value;
|
||||
end;
|
||||
|
||||
@ -366,6 +370,7 @@ type
|
||||
property NullValue;
|
||||
property NullValueBehaviour;
|
||||
property Spacing;
|
||||
property UpDownVisible;
|
||||
property Value;
|
||||
end;
|
||||
|
||||
|
@ -70,7 +70,7 @@ type
|
||||
FIsReadOnly: Boolean;
|
||||
FLayout: TLeftRight;
|
||||
FSpacing: Integer;
|
||||
//Forwarded events from FButton
|
||||
//Forwarded events from FBuddy
|
||||
FOnBuddyClick: TNotifyEvent;
|
||||
//Forwarded events from FEdit
|
||||
FOnEditClick: TNotifyEvent;
|
||||
|
Loading…
Reference in New Issue
Block a user