Commit 7a666ba1 authored by Jesus's avatar Jesus
Browse files

LCL: Fix unbound dblookupcombobox autocomplete, based on fix from melwinek issue #34298

git-svn-id: trunk@59666 -
parent 758c0090
......@@ -43,7 +43,7 @@ end;
function TDBLookupComboBox.DoEdit: boolean;
begin
if (FDataLink.DataSource=nil) or (DataField='') then begin
if IsUnbound then begin
if DetectedEvents and DBCBEVENT_SELECT <>0 then begin
UpdateData(self);
DoOnSelect;
......@@ -55,6 +55,11 @@ begin
Result := inherited DoEdit;
end;
function TDBLookupComboBox.IsUnbound: boolean;
begin
result := (FDataLink.DataSource=nil) or (DataField='');
end;
procedure TDBLookupComboBox.ActiveChange(Sender: TObject);
begin
if FDataLink.Active then
......@@ -93,7 +98,7 @@ end;
procedure TDBLookupComboBox.UTF8KeyPress(var UTF8Key: TUTF8Char);
begin
if not FDataLink.CanModify then
if (not IsUnbound) and (not FDataLink.CanModify) then
UTF8Key := '';
inherited UTF8KeyPress(UTF8Key);
end;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment