Refactor grid editors unit: Implement a base class with all stuff which was implemented redundant previously and let all other editors descend from this class. Saves ~300 lines of code and makes implementing new editors easier.

Additionally this implements tabbing through edited fields for all grid editors. And it fixes issue #1266, issue #1267, issue #1253, issue #1178, issue #1155, issue #825 and issue #566 .
This commit is contained in:
Ansgar Becker
2009-07-20 23:07:28 +00:00
parent 21b60479f6
commit 886f67cb62
4 changed files with 464 additions and 869 deletions

View File

@ -327,20 +327,22 @@ end;
procedure TfrmRoutineEditor.listParametersCreateEditor(Sender: TBaseVirtualTree;
Node: PVirtualNode; Column: TColumnIndex; out EditLink: IVTEditLink);
var
VT: TVirtualStringTree;
EnumEditor: TEnumEditorLink;
i: Integer;
begin
VT := Sender as TVirtualStringTree;
if Column = 1 then
EditLink := TStringEditLink.Create
else if Column = 2 then begin
EnumEditor := TEnumEditorLink.Create;
EnumEditor := TEnumEditorLink.Create(VT);
EnumEditor.AllowCustomText := True;
EnumEditor.ValueList := TWideStringList.Create;
for i:=Low(Datatypes) to High(Datatypes) do
EnumEditor.ValueList.Add(Datatypes[i].Name);
EditLink := EnumEditor;
end else if Column = 3 then begin
EnumEditor := TEnumEditorLink.Create;
EnumEditor := TEnumEditorLink.Create(VT);
EnumEditor.ValueList := TWideStringList.Create;
EnumEditor.ValueList.Add('IN');
EnumEditor.ValueList.Add('OUT');