|
Using external editors
TCommonInspector can display the edit button in any line (see Adding the button into edit line). When the button type is btDialog, the external editor can be called by OnCallExternalEditor event. To use the extarnal editor we have to enbale to use it by OnGetEnableExternalEditor event and edit the data in OnCallEditor event. The Result of the OnCallEditor event must be set to True if the data was changed to notify the inspector component that the value must be redrawn.
var
Values: array[0..9] of string;
...
procedure TForm1.CommonInspector1GetEnableExternalEditor(Sender: TObject;
TheIndex: Integer; var Value: Boolean);
begin
Value:=TheIndex=1;
end;
function TForm1.CommonInspector1CallEditor(Sender: TObject;
TheIndex: Integer): Boolean;
begin
Values[TheIndex]:=InputBox('External editor','Value',Values[TheIndex]);
Result:=True;
end;
|