lcl: move interface initialization of TCustomEdit from CreateWnd to InitializeWnd. Consistent with other controls and allows interfaces to check is handle is being created

git-svn-id: trunk@36754 -
This commit is contained in:
blikblum 2012-04-13 17:29:27 +00:00
parent 1cef794417
commit ce12dfae54
2 changed files with 15 additions and 15 deletions

View File

@ -26,20 +26,6 @@ begin
PreferredWidth:=0;
end;
procedure TCustomEdit.CreateWnd;
begin
inherited CreateWnd;
TWSCustomEditClass(WidgetSetClass).SetCharCase(Self, FCharCase);
TWSCustomEditClass(WidgetSetClass).SetEchoMode(Self, FEchoMode);
TWSCustomEditClass(WidgetSetClass).SetMaxLength(Self, FMaxLength);
TWSCustomEditClass(WidgetSetClass).SetPasswordChar(Self, FPasswordChar);
TWSCustomEditClass(WidgetSetClass).SetReadOnly(Self, FReadOnly);
TWSCustomEditClass(WidgetSetClass).SetAlignment(Self, FAlignment);
TWSCustomEditClass(WidgetSetClass).SetCaretPos(Self, fCaretPos);
TWSCustomEditClass(WidgetSetClass).SetSelStart(Self, FSelStart);
TWSCustomEditClass(WidgetSetClass).SetSelLength(Self, FSelLength);
end;
procedure TCustomEdit.CreateParams(var Params: TCreateParams);
const
AlignmentStyle: array[TAlignment] of DWord = (
@ -56,6 +42,20 @@ begin
Params.Style := Params.Style or ES_NOHIDESEL;
end;
procedure TCustomEdit.InitializeWnd;
begin
inherited InitializeWnd;
TWSCustomEditClass(WidgetSetClass).SetCharCase(Self, FCharCase);
TWSCustomEditClass(WidgetSetClass).SetEchoMode(Self, FEchoMode);
TWSCustomEditClass(WidgetSetClass).SetMaxLength(Self, FMaxLength);
TWSCustomEditClass(WidgetSetClass).SetPasswordChar(Self, FPasswordChar);
TWSCustomEditClass(WidgetSetClass).SetReadOnly(Self, FReadOnly);
TWSCustomEditClass(WidgetSetClass).SetAlignment(Self, FAlignment);
TWSCustomEditClass(WidgetSetClass).SetCaretPos(Self, fCaretPos);
TWSCustomEditClass(WidgetSetClass).SetSelStart(Self, FSelStart);
TWSCustomEditClass(WidgetSetClass).SetSelLength(Self, FSelLength);
end;
{------------------------------------------------------------------------------
Method: TCustomEdit.Create
Params: none

View File

@ -716,8 +716,8 @@ type
class procedure WSRegisterClass; override;
procedure CalculatePreferredSize(var PreferredWidth, PreferredHeight: integer;
WithThemeSpace: Boolean); override;
procedure CreateWnd; override;
procedure CreateParams(var Params: TCreateParams); override;
procedure InitializeWnd; override;
procedure TextChanged; override;
procedure Change; virtual;
procedure DoEnter; override;