mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 16:29:32 +02:00
EditButton: replace property ButtonAlign: TButtonAlign with Layout: TLeftRight.
git-svn-id: trunk@47419 -
This commit is contained in:
parent
5e5ef0e82a
commit
4a7125bc7e
@ -40,7 +40,6 @@ const
|
||||
type
|
||||
|
||||
|
||||
TButtonAlign = (BaLeft, BaRight);
|
||||
|
||||
{ TEbEdit }
|
||||
|
||||
@ -55,7 +54,6 @@ type
|
||||
TCustomEditButton = class(TCustomControl)
|
||||
private
|
||||
FButton: TSpeedButton;
|
||||
FButtonAlign: TButtonAlign;
|
||||
FButtonOnlyWhenFocused: Boolean;
|
||||
FDirectInput: Boolean;
|
||||
FEdit: TEbEdit;
|
||||
@ -63,6 +61,7 @@ type
|
||||
FIsReadOnly: Boolean;
|
||||
FFlat: Boolean;
|
||||
FFocusOnButtonClick: Boolean;
|
||||
FLayout: TLeftRight;
|
||||
//Forwarded events from FButton
|
||||
FOnButtonClick: TNotifyEvent;
|
||||
//Forwarded events from FEdit
|
||||
@ -155,7 +154,6 @@ type
|
||||
procedure SetAlignment(AValue: TAlignment);
|
||||
procedure SetAutoSelect(AValue: Boolean);
|
||||
procedure SetAutoSelected(AValue: Boolean);
|
||||
procedure SetButtonAlign(AValue: TButtonAlign);
|
||||
procedure SetBtnCaption(AValue: TCaption);
|
||||
procedure SetButtonCursor(AValue: TCursor);
|
||||
procedure SetButtonHint(AValue: TTranslateString);
|
||||
@ -170,6 +168,7 @@ type
|
||||
procedure SetFlat(AValue: Boolean);
|
||||
procedure SetGlyph(AValue: TBitmap);
|
||||
procedure SetHideSelection(AValue: Boolean);
|
||||
procedure SetLayout(AValue: TLeftRight);
|
||||
procedure SetMaxLength(AValue: Integer);
|
||||
procedure SetModified(AValue: Boolean);
|
||||
procedure SetNumbersOnly(AValue: Boolean);
|
||||
@ -240,7 +239,6 @@ type
|
||||
property AutoSelect: Boolean read GetAutoSelect write SetAutoSelect default True;
|
||||
property AutoSelected: Boolean read GetAutoSelected write SetAutoSelected;
|
||||
property Button: TSpeedButton read FButton;
|
||||
property ButtonAlign: TButtonAlign read FButtonAlign write SetButtonAlign default BaRight;
|
||||
property ButtonCaption: TCaption read GetBtnCaption write SetBtnCaption;
|
||||
property ButtonCursor: TCursor read GetButtonCursor write SetButtonCursor default crDefault;
|
||||
property ButtonHint: TTranslateString read GetButtonHint write SetButtonHint;
|
||||
@ -255,6 +253,7 @@ type
|
||||
property FocusOnButtonClick: Boolean read FFocusOnButtonClick write FFocusOnButtonClick default False;
|
||||
property Glyph: TBitmap read GetGlyph write SetGlyph stored IsCustomGlyph;
|
||||
property IsMasked: Boolean read GetIsMasked;
|
||||
property Layout: TLeftRight read FLayout write SetLayout default taLeftJustify;
|
||||
property NumGlyphs: Integer read GetNumGlyps write SetNumGlyphs;
|
||||
property Spacing: Integer read GetSpacing write SetSpacing default 4;
|
||||
|
||||
@ -336,7 +335,6 @@ type
|
||||
property BiDiMode;
|
||||
property BorderSpacing;
|
||||
property BorderStyle default bsNone;
|
||||
property ButtonAlign;
|
||||
property ButtonCaption;
|
||||
property ButtonCursor;
|
||||
property ButtonHint;
|
||||
@ -355,6 +353,7 @@ type
|
||||
property Glyph;
|
||||
// property HideSelection;
|
||||
property Hint;
|
||||
property Layout;
|
||||
property MaxLength;
|
||||
property NumGlyphs;
|
||||
property OnButtonClick;
|
||||
@ -460,7 +459,6 @@ type
|
||||
property OnCheckItem: TCheckItemEvent read fOnCheckItem write fOnCheckItem;
|
||||
property UseFormActivate: Boolean read fUseFormActivate write SetUseFormActivate default False;
|
||||
// TEditButton properties.
|
||||
property ButtonAlign;
|
||||
property ButtonCaption;
|
||||
property ButtonCursor;
|
||||
property ButtonHint;
|
||||
@ -483,6 +481,7 @@ type
|
||||
property DragMode;
|
||||
property Enabled;
|
||||
property Font;
|
||||
property Layout;
|
||||
property MaxLength;
|
||||
property ParentBidiMode;
|
||||
property ParentColor;
|
||||
@ -570,7 +569,6 @@ type
|
||||
property DefaultExt: String read FDefaultExt write FDefaultExt;
|
||||
property HideDirectories: Boolean read FHideDirectories write FHideDirectories;
|
||||
// TEditButton properties.
|
||||
property ButtonAlign;
|
||||
property ButtonCaption;
|
||||
property ButtonCursor;
|
||||
property ButtonHint;
|
||||
@ -595,6 +593,7 @@ type
|
||||
property DragMode;
|
||||
property Enabled;
|
||||
property Font;
|
||||
property Layout;
|
||||
property MaxLength;
|
||||
property ParentBidiMode;
|
||||
property ParentColor;
|
||||
@ -661,7 +660,6 @@ type
|
||||
property DialogTitle: String read FDialogTitle write FDialogTitle;
|
||||
property ShowHidden: Boolean read FShowHidden write FShowHidden;
|
||||
// TEditButton properties.
|
||||
property ButtonAlign;
|
||||
property ButtonCaption;
|
||||
property ButtonCursor;
|
||||
property ButtonHint;
|
||||
@ -685,6 +683,7 @@ type
|
||||
property DragMode;
|
||||
property Enabled;
|
||||
property Font;
|
||||
property Layout;
|
||||
property MaxLength;
|
||||
property ParentBidiMode;
|
||||
property ParentColor;
|
||||
@ -771,7 +770,6 @@ type
|
||||
property DefaultToday: Boolean read FDefaultToday write FDefaultToday default False;
|
||||
Property DateOrder : TDateOrder Read FDateOrder Write SetDateOrder;
|
||||
property ButtonOnlyWhenFocused;
|
||||
property ButtonAlign;
|
||||
property ButtonCaption;
|
||||
property ButtonCursor;
|
||||
property ButtonHint;
|
||||
@ -796,6 +794,7 @@ type
|
||||
property Flat;
|
||||
property FocusOnButtonClick;
|
||||
property Font;
|
||||
property Layout;
|
||||
property MaxLength;
|
||||
property OnButtonClick;
|
||||
property OnChange;
|
||||
@ -839,7 +838,7 @@ type
|
||||
TCalcEdit = class(TCustomEditButton)
|
||||
private
|
||||
FDialogTitle: String;
|
||||
FLayout: TCalculatorLayout;
|
||||
FCalculatorLayout: TCalculatorLayout;
|
||||
FOnAcceptValue: TAcceptValueEvent;
|
||||
function GetAsFloat: Double;
|
||||
function GetAsInteger: Integer;
|
||||
@ -857,13 +856,12 @@ type
|
||||
property AutoSelected;
|
||||
published
|
||||
// CalcEdit properties
|
||||
property CalculatorLayout : TCalculatorLayout read FLayout write Flayout;
|
||||
property CalculatorLayout : TCalculatorLayout read FCalculatorLayout write FCalculatorLayout;
|
||||
property AsFloat : Double read GetAsFloat write SetAsFloat;
|
||||
property AsInteger : Integer read GetAsInteger write SetAsInteger;
|
||||
property OnAcceptValue : TAcceptValueEvent read FOnAcceptValue write FOnAcceptValue;
|
||||
property DialogTitle : String read FDialogTitle write FDialogTitle stored TitleStored;
|
||||
// TEditButton properties.
|
||||
property ButtonAlign;
|
||||
property ButtonCaption;
|
||||
property ButtonCursor;
|
||||
property ButtonHint;
|
||||
@ -887,6 +885,7 @@ type
|
||||
property DragMode;
|
||||
property Enabled;
|
||||
property Font;
|
||||
property Layout;
|
||||
property MaxLength;
|
||||
property ParentBidiMode;
|
||||
property ParentColor;
|
||||
@ -1240,18 +1239,6 @@ begin
|
||||
Result := FButton.Cursor;
|
||||
end;
|
||||
|
||||
procedure TCustomEditButton.SetButtonAlign(AValue: TButtonAlign);
|
||||
begin
|
||||
if FButtonAlign = AValue then
|
||||
exit;
|
||||
FButtonAlign := AValue;
|
||||
case FButtonAlign of
|
||||
BaRight:
|
||||
FButton.Align := alRight;
|
||||
BaLeft:
|
||||
FButton.Align := alLeft;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomEditButton.SetButtonHint(AValue: TTranslateString);
|
||||
begin
|
||||
@ -1464,6 +1451,17 @@ begin
|
||||
FEdit.HideSelection := AValue;
|
||||
end;
|
||||
|
||||
procedure TCustomEditButton.SetLayout(AValue: TLeftRight);
|
||||
begin
|
||||
if (FLayout = AValue) then
|
||||
Exit;
|
||||
FLayout := AValue;
|
||||
case FLayout of
|
||||
taLeftJustify : FButton.Align := alRight;
|
||||
taRightJustify: FButton.Align := alLeft;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomEditButton.SetMaxLength(AValue: Integer);
|
||||
begin
|
||||
FEdit.MaxLength := AValue;
|
||||
@ -1749,7 +1747,7 @@ begin
|
||||
FEdit.ParentColor := False;
|
||||
FInitialColor := {$ifdef UseCLDefault}clDefault{$else}clWindow{$endif};
|
||||
BorderStyle := bsNone;
|
||||
FButtonAlign := BaRight;
|
||||
FLayout := taLeftjustify;
|
||||
FButtonOnlyWhenFocused := False;
|
||||
FDirectInput := True;
|
||||
FIsReadOnly := False;
|
||||
@ -2543,7 +2541,7 @@ var
|
||||
B : Boolean;
|
||||
begin
|
||||
D:=AsFloat;
|
||||
with CreateCalculatorForm(Self,FLayout,0) do
|
||||
with CreateCalculatorForm(Self,FCalculatorLayout,0) do
|
||||
try
|
||||
Caption:=DialogTitle;
|
||||
Value:=D;
|
||||
|
Loading…
Reference in New Issue
Block a user