lcl: update cancel and default form controls on button handle creation (fixes bug #0013310)

git-svn-id: trunk@20254 -
This commit is contained in:
paul 2009-05-27 00:40:55 +00:00
parent fef147777a
commit 663367c26a
2 changed files with 9 additions and 3 deletions

View File

@ -50,7 +50,7 @@ begin
inherited CreateWnd;
//this is done in TWinControl
//SetText(Caption);//To ensure shortcut is set
WSSetDefault;
UpdateDefaultCancel;
end;
procedure TCustomButton.ControlKeyDown(var Key: Word; Shift: TShiftState);
@ -290,11 +290,16 @@ begin
end;
procedure TCustomButton.Loaded;
var
Form: TCustomForm;
begin
inherited Loaded;
UpdateDefaultCancel;
end;
procedure TCustomButton.UpdateDefaultCancel;
var
Form: TCustomForm;
begin
Form := GetParentForm(Self);
if Form <> nil then
begin

View File

@ -1087,6 +1087,7 @@ type
procedure WSSetText(const AText: String); override;
procedure TextChanged; override;
procedure Loaded; override;
procedure UpdateDefaultCancel;
public
constructor Create(TheOwner: TComponent); override;
procedure ExecuteDefaultAction; override;