mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-17 14:49:28 +02:00
T(Float)SpinEditEx: implement property EditorEnabled.
git-svn-id: trunk@64953 -
This commit is contained in:
parent
f5663f4a16
commit
8c6dd0ff09
@ -134,6 +134,13 @@ begin
|
||||
Utf8Key := '';
|
||||
end;
|
||||
|
||||
procedure TSpinEditExBase.SetReadOnly(AValue: Boolean);
|
||||
begin
|
||||
inherited SetReadOnly(AValue);
|
||||
if (not AValue) and (not FEditorEnabled) then
|
||||
Edit.ReadOnly := True;
|
||||
end;
|
||||
|
||||
procedure TSpinEditExBase.EditChange;
|
||||
begin
|
||||
{$ifdef debugspinex}
|
||||
@ -278,6 +285,21 @@ begin
|
||||
Result := BaseEditor;
|
||||
end;
|
||||
|
||||
procedure TSpinEditExBase.SetEditorEnabled(AValue: Boolean);
|
||||
begin
|
||||
if FEditorEnabled = AValue then Exit;
|
||||
FEditorEnabled := AValue;
|
||||
if AValue then
|
||||
begin
|
||||
if not ReadOnly then
|
||||
Edit.ReadOnly := False;
|
||||
end
|
||||
else
|
||||
begin
|
||||
Edit.ReadOnly := True;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TSpinEditExBase.SetMinRepeatValue(AValue: Byte);
|
||||
begin
|
||||
if FMinRepeatValue = AValue then Exit;
|
||||
@ -336,6 +358,7 @@ begin
|
||||
FSettingValue := False;
|
||||
FNullValueBehaviour := nvbMinValue;
|
||||
FMinRepeatValue := DefMinRepeatValue;
|
||||
FEditorEnabled := True;
|
||||
|
||||
UpDown.ControlStyle := UpDown.ControlStyle + [csNoDesignVisible];
|
||||
Edit.Alignment := taRightJustify;
|
||||
|
@ -104,6 +104,7 @@ type
|
||||
DefMinRepeatValue = 100;
|
||||
private
|
||||
FArrowKeys: Boolean;
|
||||
FEditorEnabled: Boolean;
|
||||
FIncrement: T;
|
||||
FMaxValue: T;
|
||||
FMinValue: T;
|
||||
@ -115,6 +116,7 @@ type
|
||||
FUpdatePending: Boolean;
|
||||
FSettingValue: Boolean;
|
||||
function GetEdit: TGEEdit;
|
||||
procedure SetEditorEnabled(AValue: Boolean);
|
||||
procedure SetMinRepeatValue(AValue: Byte);
|
||||
procedure SpinUpDown(Up: Boolean);
|
||||
function GetNullValue: T;
|
||||
@ -153,12 +155,14 @@ type
|
||||
procedure EditEditingDone; override;
|
||||
procedure EditKeyPress(var Key: Char); override;
|
||||
procedure EditUtf8KeyPress(var UTF8Key: TUTF8Char); override;
|
||||
procedure SetReadOnly(AValue: Boolean); override;
|
||||
|
||||
property ArrowKeys: Boolean read FArrowKeys write FArrowKeys default True;
|
||||
property Edit: TGEEdit read GetEdit;
|
||||
property UpDown: TUpDown read GetUpDown;
|
||||
property UpDownVisible: Boolean read GetBuddyVisible write SetBuddyVisible default True;
|
||||
property MinRepeatValue: Byte read FMinRepeatValue write SetMinRepeatValue default DefMinRepeatValue;
|
||||
|
||||
public
|
||||
constructor Create(TheOwner: TComponent); override;
|
||||
function GetLimitedValue(const AValue: T): T; virtual;
|
||||
@ -167,6 +171,7 @@ type
|
||||
function KeyAllowed({%H-}Key: Char): Boolean; virtual;
|
||||
function Utf8KeyAllowed({%H-}Key: TUTF8Char): Boolean; virtual;
|
||||
public
|
||||
property EditorEnabled: Boolean read FEditorEnabled write SetEditorEnabled default True;
|
||||
property Increment: T read FIncrement write SetIncrement stored IncrementStored nodefault;
|
||||
property MinValue: T read FMinValue write SetMinValue stored MinValueStored nodefault;
|
||||
property MaxValue: T read FMaxValue write SetMaxValue stored MaxValueStored nodefault;
|
||||
|
@ -168,7 +168,6 @@ type
|
||||
procedure SetParentColor(AValue: Boolean);
|
||||
procedure SetPasswordChar(AValue: char);
|
||||
procedure SetPopupMenu(AValue: TPopupMenu);
|
||||
procedure SetReadOnly(AValue: Boolean);
|
||||
procedure SetSelLength(AValue: Integer);
|
||||
procedure SetSelStart(AValue: Integer);
|
||||
procedure SetSelText(AValue: String);
|
||||
@ -201,6 +200,7 @@ type
|
||||
procedure SetBuddyHint(AValue: TTranslateString);
|
||||
procedure SetBuddyWidth(AValue: Integer);
|
||||
procedure SetBuddyVisible(AValue: Boolean);
|
||||
procedure SetReadOnly(AValue: Boolean); virtual;
|
||||
|
||||
procedure BuddyClick; virtual;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user