mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-07-22 08:46:37 +02:00
LCL: DbLookupCombobox: do not initialize lookup on datachange.
git-svn-id: trunk@58967 -
This commit is contained in:
parent
e4164ae839
commit
721c734e03
@ -860,6 +860,7 @@ Type
|
||||
procedure SetLookupCache(const Value: boolean);
|
||||
procedure SetNullValueKey(const AValue: TShortCut);
|
||||
procedure UpdateLookup;
|
||||
procedure UpdateItemIndex;
|
||||
protected
|
||||
procedure InitializeWnd; override;
|
||||
procedure DestroyWnd; override;
|
||||
|
@ -63,7 +63,7 @@ end;
|
||||
|
||||
procedure TDBLookupComboBox.DataChange(Sender: TObject);
|
||||
begin
|
||||
UpdateLookup;
|
||||
UpdateItemIndex;
|
||||
end;
|
||||
|
||||
procedure TDBLookupComboBox.DoOnSelect;
|
||||
@ -187,16 +187,21 @@ begin
|
||||
end;
|
||||
|
||||
procedure TDBLookupComboBox.UpdateLookup;
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
if ([csLoading, csDestroying] * ComponentState) = [] then
|
||||
begin
|
||||
FLookup.Initialize(FDataLink, Items);
|
||||
i := FLookup.GetKeyIndex;
|
||||
ItemIndex := i;
|
||||
if i = -1 then
|
||||
Text := '';
|
||||
UpdateItemIndex;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TDBLookupComboBox.UpdateItemIndex;
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
i := FLookup.GetKeyIndex;
|
||||
ItemIndex := i;
|
||||
if i = -1 then
|
||||
Text := '';
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user