For experts (I think) : Sub properties in the property editor
Hello,
I need to make sub properties in the property editor.
I mean, I got three String properties a, b, c that are
depending of the topic. That's why I want to display them as
color, height and pitch in the Font property.
// I've made a class for my properties :
type
Tabc= class(TComponent)
private
fA, fB, fC : String;
published
property A : string Read fB Write fB;
property B : string Read fB Write fB;
property C : string Read fC Write fC;
end;
// I Have made a property editor for this class:
type TabcEditor = class (TClassProperty)
published
procedure Edit; override;
function GetAttributes: TPropertyAttributes; override;
procedure GetProperties(Proc: TGetPropEditProc); override;
end;
// The component I want to add the properties to :
type
TRadioGroup1 = class(TRadioGroup)
private
fabc : Tabc;
published
Property Topic : tabc Read fabc Write fabc;
end;
procedure Register;
implementation
// registration of the new component and the property editor
procedure Register;
begin
RegisterComponents('Exemples', [TRadioGroup1]);
RegisterPropertyEditor(TypeInfo(Tabc), nil, '', TabcEditor);
end;
// Overriden Function defining that there are subproperies
Function TabcEditor.GetAttributes : TPropertyAttributes;
Begin
Result := [paSubProperties, paDialog];
End;
// Overriden procedure for catching the user click on the "..." button
Procedure TabcEditor.Edit;
Begin
Showmessage('dialog button clicked');
If dialogEditor.Showmodal then // A dialog containing three edittext named
ta, tb, tc
Begin
//..................???????????????? What should I put Here ?
End;
End;
// Overriden procedure for catching the user dblclick on the Topic
procedure TabcEditor.GetProperties(Proc: TGetPropEditProc);
Begin
proc(); //..................???????????????? What should I put Betwin
the comas ?
showmessage('Get propertied');
End;
The question are in the code. But may be I'm in the wrong way...
Hope you'll know...
Thanks
Julien
jdevill...@wanadoo.fr
Answer By email too please