Subject | Is there an active search in TIB_LookupCombo ? |
---|---|
Author | precisa@uai.com.br |
Post date | 2001-02-07T16:15:22Z |
Hi,
I've made a routine to show the current active search to the user,
because I don't want him to put the search bar in search state to
know what is the current search. To achieve this I made a recursive
routine that get all TWinControls and check if it's a Ibo control,
then I've inspected the SearchBuffer to know if the control has a
search active. The is that I did not find a way to know if
TIB_LookupCombo has a active search, and unlike the others controls
it doesn't have SearchBuffer property.
Thanks in advance and sorry my english.
Geraldo Lopes de Souza
The routine I've make looks like this :
function IBOFilter(Control : TWinControl) : String;
var
S : String;
procedure AddToS(FieldName : String; SearchBuffer : String);
begin
S := S + Format('%s:%s ',[FieldName, SearchBuffer]);
end;
procedure RecursiveLoop(Control : TWinControl);
var
I : Integer;
begin
for I := 0 to Control.ControlCount -1 do begin
if Control.Controls[I] is TIB_CustomEdit then begin
if (Control.Controls[I] as TIB_CustomEdit).SearchBuffer
<> ''
then AddToS((Control.Controls[I] as
TIB_CustomEdit).Field.DisplayName,
(Control.Controls[I] as
TIB_CustomEdit).SearchBuffer);
end;
if Control.Controls[I] is TWinControl
then if (Control.Controls[I] as TWinControl).ControlCount > 0
then RecursiveLoop(TWinControl(Control.Controls[I]));
end;
end;
begin
S := '';
RecursiveLoop(Control);
Result := S;
end;
I've made a routine to show the current active search to the user,
because I don't want him to put the search bar in search state to
know what is the current search. To achieve this I made a recursive
routine that get all TWinControls and check if it's a Ibo control,
then I've inspected the SearchBuffer to know if the control has a
search active. The is that I did not find a way to know if
TIB_LookupCombo has a active search, and unlike the others controls
it doesn't have SearchBuffer property.
Thanks in advance and sorry my english.
Geraldo Lopes de Souza
The routine I've make looks like this :
function IBOFilter(Control : TWinControl) : String;
var
S : String;
procedure AddToS(FieldName : String; SearchBuffer : String);
begin
S := S + Format('%s:%s ',[FieldName, SearchBuffer]);
end;
procedure RecursiveLoop(Control : TWinControl);
var
I : Integer;
begin
for I := 0 to Control.ControlCount -1 do begin
if Control.Controls[I] is TIB_CustomEdit then begin
if (Control.Controls[I] as TIB_CustomEdit).SearchBuffer
<> ''
then AddToS((Control.Controls[I] as
TIB_CustomEdit).Field.DisplayName,
(Control.Controls[I] as
TIB_CustomEdit).SearchBuffer);
end;
if Control.Controls[I] is TWinControl
then if (Control.Controls[I] as TWinControl).ControlCount > 0
then RecursiveLoop(TWinControl(Control.Controls[I]));
end;
end;
begin
S := '';
RecursiveLoop(Control);
Result := S;
end;