You've already forked lazarus-ccr
RxFPC: in RxCurrEdit add property EditFormat
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5804 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -45,6 +45,7 @@ type
|
||||
|
||||
TCustomNumEdit = class(TCustomMaskEdit)
|
||||
private
|
||||
FEditFormat: string;
|
||||
FFocusedDisplay: boolean;
|
||||
FBeepOnError: Boolean;
|
||||
FCheckOnExit: Boolean;
|
||||
@ -65,6 +66,7 @@ type
|
||||
procedure SetBeepOnError(const AValue: Boolean);
|
||||
procedure SetDecimalPlaces(const AValue: Cardinal);
|
||||
procedure SetDisplayFormat(const AValue: string);
|
||||
procedure SetEditFormat(AValue: string);
|
||||
// procedure SetFormatOnEditing(const AValue: Boolean);
|
||||
procedure SetMaxValue(const AValue: Extended);
|
||||
procedure SetMinValue(const AValue: Extended);
|
||||
@ -108,6 +110,7 @@ type
|
||||
property DecimalPlaces: Cardinal read FDecimalPlaces write SetDecimalPlaces
|
||||
default 2;
|
||||
property DisplayFormat: string read FDisplayFormat write SetDisplayFormat;
|
||||
property EditFormat: string read FEditFormat write SetEditFormat;
|
||||
property MaxValue: Extended read FMaxValue write SetMaxValue;
|
||||
property MinValue: Extended read FMinValue write SetMinValue;
|
||||
// property FormatOnEditing: Boolean read FFormatOnEditing write SetFormatOnEditing default False;
|
||||
@ -141,11 +144,11 @@ type
|
||||
property Color;
|
||||
property DecimalPlaces;
|
||||
property DisplayFormat;
|
||||
property EditFormat;
|
||||
property DragCursor;
|
||||
property DragMode;
|
||||
property Enabled;
|
||||
property Font;
|
||||
// property FormatOnEditing;
|
||||
property HideSelection;
|
||||
property Anchors;
|
||||
property BiDiMode;
|
||||
@ -293,8 +296,13 @@ function TCustomNumEdit.GetText: string;
|
||||
begin
|
||||
if (FValue = 0) and FZeroEmpty then
|
||||
Result:=''
|
||||
else
|
||||
begin
|
||||
if FEditFormat <> '' then
|
||||
Result := FormatFloat(FEditFormat, FValue)
|
||||
else
|
||||
Result := FloatToStr(FValue);
|
||||
end;
|
||||
end;
|
||||
|
||||
function TCustomNumEdit.GetValue: Extended;
|
||||
@ -336,6 +344,13 @@ begin
|
||||
DataChanged;
|
||||
end;
|
||||
|
||||
procedure TCustomNumEdit.SetEditFormat(AValue: string);
|
||||
begin
|
||||
if FEditFormat=AValue then Exit;
|
||||
FEditFormat:=AValue;
|
||||
DataChanged;
|
||||
end;
|
||||
|
||||
{
|
||||
procedure TCustomNumEdit.SetFormatOnEditing(const AValue: Boolean);
|
||||
begin
|
||||
|
Reference in New Issue
Block a user