Of course, we can implement for all of them the Auto Complete engine but I think that it could be rather complicated. If Pierre thinks that it is simple to do it, then it will be the best thing.
But if it is not, then we can live with a simple search view like this one:
...which will do a simple case INsensitive(!!!) search on the grids, line by line till it will found something.
The untested, unoptimized pseudo-code will be something like:
Code: Select all
function DoSearch(aFromRow: integer; myText: string; myGrid: TGrid): boolean;
begin
Result:=False;
for y:=aFromRow to myGrid.RowCount-1 do
begin
for x:=0 to myGrid.ColCount-1 do
if Pos(UpperCase(myText), UpperCase(myGrid.Cells[x,y]))>0 then //found!!
begin
Result:=True;
Break; //out from cycle!
end;
if Result then
begin
myGrid.Cells[x,y].Selected:=True;
Break; //out from y cycle also!
end;
end;
if not Result then
ShowMessage('Text not found!');
end;
This could be very easy a shared code and view among many lists in our program: list of Toolbar buttons, list of the Shortcuts, Auto-Correct list aso.