mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-07-28 07:57:12 +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 SetLookupCache(const Value: boolean);
|
||||||
procedure SetNullValueKey(const AValue: TShortCut);
|
procedure SetNullValueKey(const AValue: TShortCut);
|
||||||
procedure UpdateLookup;
|
procedure UpdateLookup;
|
||||||
|
procedure UpdateItemIndex;
|
||||||
protected
|
protected
|
||||||
procedure InitializeWnd; override;
|
procedure InitializeWnd; override;
|
||||||
procedure DestroyWnd; override;
|
procedure DestroyWnd; override;
|
||||||
|
@ -63,7 +63,7 @@ end;
|
|||||||
|
|
||||||
procedure TDBLookupComboBox.DataChange(Sender: TObject);
|
procedure TDBLookupComboBox.DataChange(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
UpdateLookup;
|
UpdateItemIndex;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TDBLookupComboBox.DoOnSelect;
|
procedure TDBLookupComboBox.DoOnSelect;
|
||||||
@ -187,16 +187,21 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TDBLookupComboBox.UpdateLookup;
|
procedure TDBLookupComboBox.UpdateLookup;
|
||||||
var
|
|
||||||
i: Integer;
|
|
||||||
begin
|
begin
|
||||||
if ([csLoading, csDestroying] * ComponentState) = [] then
|
if ([csLoading, csDestroying] * ComponentState) = [] then
|
||||||
begin
|
begin
|
||||||
FLookup.Initialize(FDataLink, Items);
|
FLookup.Initialize(FDataLink, Items);
|
||||||
i := FLookup.GetKeyIndex;
|
UpdateItemIndex;
|
||||||
ItemIndex := i;
|
|
||||||
if i = -1 then
|
|
||||||
Text := '';
|
|
||||||
end;
|
end;
|
||||||
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