Martin,
I want to use TSynAutoComplete, but I don't get it...
I have two Dbf tables ("Tables" and "Fields") containing information about tables and fields in my project.
Then I have TSynEdit and TSynSQLSyn highlighter and also TSynAutoComplete.
I populate AutoCompleteList with following code, in order to get list
of table.field items:
procedure TFormMain.UpdateAutocompleteList;
var
vBookmark1:TBookmark;
vBookmark2:TBookmark;
begin
vBookmark1:=Tables.GetBookmark;
vBookmark2:=Fields.GetBookmark;
try
Tables.DisableControls;
Fields.DisableControls;
Tables.First;
SynAutoComplete1.AutoCompleteList.Text:='';
while not Tables.EOF do begin
Fields.First;
while not Fields.EOF do begin
SynAutoComplete1.AutoCompleteList.Append(Tables.FieldByName('TABLENAME').AsString+'.'+Fields.FieldByName('FIELDNAME').AsString);
Fields.Next;
end;
Tables.Next;
end;
finally
Tables.GotoBookmark(vBookmark1);
Tables.FreeBookmark(vBookmark1);
Fields.GotoBookmark(vBookmark2);
Fields.FreeBookmark(vBookmark2);
Tables.EnableControls;
Fields.EnableControls;
end;
end;
I hoped it will enable auto-completion when you, for example type "ordrs." that it will be able to see a pop-up list of all possible fields, like "ordrs.ordr, ordrs.cmpnt, etc.".
How to enable autocompletion in this way? What have I missunderstood?
Basically, I want to do what all DBMS usually do - when you type a table identifier and dot, it gives you list of all fields belonging to the table...