ExCtrls: TCustomFloatSISpinEditEx: in Lazarus >= 2.1 override KeyAllowed instead of EditKeyPress.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7624 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
parent
38282db2af
commit
53e90e5a82
@ -173,14 +173,21 @@ type
|
|||||||
TSIPrefix = (Yotta,Zetta,Exa,Peta,Tera,Giga,Mega,kilo,kiloUC,One,
|
TSIPrefix = (Yotta,Zetta,Exa,Peta,Tera,Giga,Mega,kilo,kiloUC,One,
|
||||||
milli,micro,microU,microalt,nano,pico,femto,atto,zepto,yocto);
|
milli,micro,microU,microalt,nano,pico,femto,atto,zepto,yocto);
|
||||||
|
|
||||||
|
{ TCustomFloatSISpinEditEx }
|
||||||
|
|
||||||
TCustomFloatSISpinEditEx = class(TCustomFloatSpinEditEx)
|
TCustomFloatSISpinEditEx = class(TCustomFloatSpinEditEx)
|
||||||
private
|
private
|
||||||
function EndsWithSIPrefix(var S: String; out APrefix: TSIPrefix): Boolean;
|
function EndsWithSIPrefix(var S: String; out APrefix: TSIPrefix): Boolean;
|
||||||
protected
|
protected
|
||||||
|
{$IF LCL_FullVersion < 2010000}
|
||||||
procedure EditKeyPress(var Key: char); override;
|
procedure EditKeyPress(var Key: char); override;
|
||||||
|
{$endif}
|
||||||
function TextIsNumber(const S: String; out ANumber: Double): Boolean; override;
|
function TextIsNumber(const S: String; out ANumber: Double): Boolean; override;
|
||||||
public
|
public
|
||||||
function ValueToStr(const AValue: Double): String; override;
|
function ValueToStr(const AValue: Double): String; override;
|
||||||
|
{$IF LCL_FullVersion >= 2010000}
|
||||||
|
function KeyAllowed(Key: Char): Boolean; override;
|
||||||
|
{$endif}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TFloatSISpinEditEx = class(TCustomFloatSISpinEditEx)
|
TFloatSISpinEditEx = class(TCustomFloatSISpinEditEx)
|
||||||
@ -534,11 +541,12 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
{$IF LCL_FullVersion < 2010000}
|
||||||
procedure TCustomFloatSISpinEditEx.EditKeyPress(var Key: char);
|
procedure TCustomFloatSISpinEditEx.EditKeyPress(var Key: char);
|
||||||
begin
|
begin
|
||||||
if Assigned(OnKeyPress) then OnKeyPress(Self, Key);
|
if Assigned(OnKeyPress) then OnKeyPress(Self, Key);
|
||||||
end;
|
end;
|
||||||
|
{$endif}
|
||||||
|
|
||||||
function TCustomFloatSISpinEditEx.TextIsNumber(const S: String; out ANumber: Double): Boolean;
|
function TCustomFloatSISpinEditEx.TextIsNumber(const S: String; out ANumber: Double): Boolean;
|
||||||
var
|
var
|
||||||
@ -583,5 +591,12 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{$IF LCL_FullVersion >= 2010000}
|
||||||
|
function TCustomFloatSISpinEditEx.KeyAllowed(Key: Char): Boolean;
|
||||||
|
begin
|
||||||
|
Result := True;
|
||||||
|
end;
|
||||||
|
{$endif}
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user