Hola amigos
Sigo con el tema de creación de componentes y tengo el siguiente problema.
Tengo dos clases, una del tipo
TStringProperty y la otra del tipo
TPropertyEditor.
Código Delphi
[-]
Type
TKeyProperty = class (TStringProperty)
function GetAttributes : TPropertyAttributes; override;
procedure GetValues(Proc : TGetStrProc); override;
function GetValue : string; override;
procedure SetValue(const Value: string); override;
end;
TSubKeyProperty = class(TPropertyEditor)
function GetAttributes : TPropertyAttributes; override;
function GetValue : string; override;
procedure Edit; override;
end;
- La clase TKeyProperty la asigne como [paValueList]
- La clase TSubKeyProperty la asigne como [paDialog]
En la clase
TSubKeyProperty necesito pasar el valor que asigne en la clase
TKeyProperty a una forma que abro en el procedimiento
Edit del
TSubKeyProperty pero no se como realizar esto.
Código Delphi
[-]
procedure TSubKeyProperty.Edit;
begin
frmSubKey := TfrmSubKey.Create(Application);
try
frmSubKey.Caption := 'Selecciona SubKey';
frmSubKey.FKey := frmSubKey.ShowModal;
if frmSubKey.ModalResult = mrOK then begin
SetStrValue(frmSubKey.stSubKey.Caption);
designer.Modified;
end;
finally
frmSubKey.Free;
end;
end;
Intenté hacer esto
Código Delphi
[-]
frmSubKey.FKey := TKeyProperty.GetValue;
Pero me da el siguiente error
Cita:
[Pascal Error] RegEditor_D10.pas(73): E2076 This form of method call only allowed for class methods
|
Espero alguien me pueda ayudar.
Salud OS y gracias.