mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 11:39:29 +02:00
lcl: move Lookup initialization from InitializeWnd to Loaded. Just update Items address in InitializeWnd. This allows KeyValue work between Loaded and handle creation
git-svn-id: trunk@34724 -
This commit is contained in:
parent
5010a42914
commit
7ebde037c3
@ -160,6 +160,7 @@ Type
|
||||
function GetKeyValue(ValueIndex: Integer): Variant;
|
||||
function GetKeyIndex: Integer;
|
||||
function GetKeyIndex(const AKeyValue: Variant): Integer;
|
||||
property ControlItems: TStrings read FControlItems write FControlItems;
|
||||
property LookupCache: boolean read FLookupCache write SetLookupCache;
|
||||
// properties to be published by owner control
|
||||
// these are not used where data control Field is dbLookup
|
||||
@ -441,6 +442,7 @@ Type
|
||||
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;
|
||||
@ -762,6 +764,7 @@ Type
|
||||
procedure CloseUp; override;
|
||||
procedure InitializeWnd; override;
|
||||
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
|
||||
procedure Loaded; override;
|
||||
procedure UpdateData(Sender: TObject); override;
|
||||
procedure DataChange(Sender: TObject); override;
|
||||
procedure Select; override;
|
||||
|
@ -79,10 +79,17 @@ begin
|
||||
inherited KeyDown(Key, Shift);
|
||||
end;
|
||||
|
||||
procedure TDBLookupComboBox.Loaded;
|
||||
begin
|
||||
inherited Loaded;
|
||||
UpdateLookup;
|
||||
end;
|
||||
|
||||
procedure TDBLookupComboBox.InitializeWnd;
|
||||
begin
|
||||
inherited InitializeWnd;
|
||||
UpdateLookup;
|
||||
//after handle allocation Items address changes
|
||||
FLookup.ControlItems := Items;
|
||||
end;
|
||||
|
||||
function TDBLookupComboBox.GetKeyField: string;
|
||||
|
@ -62,7 +62,8 @@ end;
|
||||
procedure TDBLookupListBox.InitializeWnd;
|
||||
begin
|
||||
inherited InitializeWnd;
|
||||
UpdateLookup;
|
||||
//after handle allocation Items address changes
|
||||
FLookup.ControlItems := Items;
|
||||
end;
|
||||
|
||||
procedure TDBLookupListBox.KeyDown(var Key: Word; Shift: TShiftState);
|
||||
@ -77,6 +78,12 @@ begin
|
||||
inherited KeyDown(Key, Shift);
|
||||
end;
|
||||
|
||||
procedure TDBLookupListBox.Loaded;
|
||||
begin
|
||||
inherited Loaded;
|
||||
UpdateLookup;
|
||||
end;
|
||||
|
||||
function TDBLookupListBox.GetKeyField: string;
|
||||
begin
|
||||
Result := FLookup.KeyField;
|
||||
|
Loading…
Reference in New Issue
Block a user