Ver Mensaje Individual
  #1  
Antiguo 31-12-2007
[egostar] egostar is offline
Registrado
 
Registrado: feb 2006
Posts: 6.557
Reputación: 25
egostar Va camino a la fama
Como pasar un dato entre dos clases del tipo TProperty

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;
  1. La clase TKeyProperty la asigne como [paValueList]
  2. 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.
__________________
"La forma de empezar es dejar de hablar y empezar a hacerlo." - Walt Disney
Responder Con Cita