lcl: fix possible access violation by setting lookup after handle creation of lookup controls

git-svn-id: trunk@32918 -
This commit is contained in:
blikblum 2011-10-16 10:49:56 +00:00
parent 21a7f6daf5
commit c42f1fd451
3 changed files with 11 additions and 11 deletions

View File

@ -437,8 +437,8 @@ Type
protected
procedure DataChange(Sender: TObject); override;
procedure DoSelectionChange(User: Boolean); override;
procedure InitializeWnd; override;
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
procedure Loaded; override;
procedure UpdateData(Sender: TObject); override;
public
constructor Create(AOwner: TComponent); override;
@ -755,8 +755,8 @@ Type
procedure SetNullValueKey(const AValue: TShortCut);
procedure UpdateLookup;
protected
procedure InitializeWnd; override;
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
procedure Loaded; override;
procedure UpdateData(Sender: TObject); override;
procedure DataChange(Sender: TObject); override;
public

View File

@ -56,9 +56,9 @@ begin
inherited KeyDown(Key, Shift);
end;
procedure TDBLookupComboBox.Loaded;
procedure TDBLookupComboBox.InitializeWnd;
begin
inherited Loaded;
inherited InitializeWnd;
if FDataLink.Active then
UpdateLookup;
end;

View File

@ -59,6 +59,13 @@ begin
inherited DoSelectionChange(User);
end;
procedure TDBLookupListBox.InitializeWnd;
begin
inherited InitializeWnd;
if FDataLink.Active then
UpdateLookup;
end;
procedure TDBLookupListBox.KeyDown(var Key: Word; Shift: TShiftState);
begin
if FLookup.HandleNullKey(Key, Shift) then
@ -71,13 +78,6 @@ begin
inherited KeyDown(Key, Shift);
end;
procedure TDBLookupListBox.Loaded;
begin
inherited Loaded;
if FDataLink.Active then
UpdateLookup;
end;
function TDBLookupListBox.GetKeyField: string;
begin
Result := FLookup.KeyField;