mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-08 11:16:12 +02:00
lcl: fix possible access violation by setting lookup after handle creation of lookup controls
git-svn-id: trunk@32918 -
This commit is contained in:
parent
21a7f6daf5
commit
c42f1fd451
@ -437,8 +437,8 @@ Type
|
|||||||
protected
|
protected
|
||||||
procedure DataChange(Sender: TObject); override;
|
procedure DataChange(Sender: TObject); override;
|
||||||
procedure DoSelectionChange(User: Boolean); override;
|
procedure DoSelectionChange(User: Boolean); override;
|
||||||
|
procedure InitializeWnd; override;
|
||||||
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
|
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
|
||||||
procedure Loaded; override;
|
|
||||||
procedure UpdateData(Sender: TObject); override;
|
procedure UpdateData(Sender: TObject); override;
|
||||||
public
|
public
|
||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
@ -755,8 +755,8 @@ Type
|
|||||||
procedure SetNullValueKey(const AValue: TShortCut);
|
procedure SetNullValueKey(const AValue: TShortCut);
|
||||||
procedure UpdateLookup;
|
procedure UpdateLookup;
|
||||||
protected
|
protected
|
||||||
|
procedure InitializeWnd; override;
|
||||||
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
|
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
|
||||||
procedure Loaded; override;
|
|
||||||
procedure UpdateData(Sender: TObject); override;
|
procedure UpdateData(Sender: TObject); override;
|
||||||
procedure DataChange(Sender: TObject); override;
|
procedure DataChange(Sender: TObject); override;
|
||||||
public
|
public
|
||||||
|
@ -56,9 +56,9 @@ begin
|
|||||||
inherited KeyDown(Key, Shift);
|
inherited KeyDown(Key, Shift);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TDBLookupComboBox.Loaded;
|
procedure TDBLookupComboBox.InitializeWnd;
|
||||||
begin
|
begin
|
||||||
inherited Loaded;
|
inherited InitializeWnd;
|
||||||
if FDataLink.Active then
|
if FDataLink.Active then
|
||||||
UpdateLookup;
|
UpdateLookup;
|
||||||
end;
|
end;
|
||||||
|
@ -59,6 +59,13 @@ begin
|
|||||||
inherited DoSelectionChange(User);
|
inherited DoSelectionChange(User);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TDBLookupListBox.InitializeWnd;
|
||||||
|
begin
|
||||||
|
inherited InitializeWnd;
|
||||||
|
if FDataLink.Active then
|
||||||
|
UpdateLookup;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TDBLookupListBox.KeyDown(var Key: Word; Shift: TShiftState);
|
procedure TDBLookupListBox.KeyDown(var Key: Word; Shift: TShiftState);
|
||||||
begin
|
begin
|
||||||
if FLookup.HandleNullKey(Key, Shift) then
|
if FLookup.HandleNullKey(Key, Shift) then
|
||||||
@ -71,13 +78,6 @@ begin
|
|||||||
inherited KeyDown(Key, Shift);
|
inherited KeyDown(Key, Shift);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TDBLookupListBox.Loaded;
|
|
||||||
begin
|
|
||||||
inherited Loaded;
|
|
||||||
if FDataLink.Active then
|
|
||||||
UpdateLookup;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TDBLookupListBox.GetKeyField: string;
|
function TDBLookupListBox.GetKeyField: string;
|
||||||
begin
|
begin
|
||||||
Result := FLookup.KeyField;
|
Result := FLookup.KeyField;
|
||||||
|
Loading…
Reference in New Issue
Block a user