Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > OOP
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Coloboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #3  
Antiguo 31-12-2007
[egostar] egostar is offline
Registrado
 
Registrado: feb 2006
Posts: 6.572
Poder: 27
egostar Va camino a la fama
Hola Dec

Este es el código

Código Delphi [-]
 
unit RegEditor_D10;
 
interface
 
uses Windows, Forms, Controls, Classes, DesignIntf, DesignEditors, Dialogs,
     RegEditor, USubKey;
 
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;
 
procedure Register;
 
implementation
 
procedure Register;
begin
  RegisterPropertyEditor(TypeInfo(String),TRegEditor,'Key',TKeyProperty);
  RegisterPropertyEditor(TypeInfo(String),TRegEditor,'SubKey',TSubKeyProperty);
  RegisterComponents('Samples', [TRegEditor]);
end;
 
function TKeyProperty.GetAttributes : TPropertyAttributes;
begin
  Result:=[paValueList];
end;
 
Procedure TKeyProperty.GetValues(Proc : TGetStrProc);
begin
  Proc('HKEY_CLASSES_ROOT');
  Proc('HKEY_CURRENT_USER');
  Proc('KEY_LOCAL_MACHINE');
  Proc('HKEY_USERS');
  Proc('HKEY_CURRENT_CONFIG');
end;
 
function TKeyProperty.GetValue : string;
begin
  Result:= GetStrValue;
end;
 
procedure TKeyProperty.SetValue(const Value: string);
begin
  SetStrValue(Value);
  designer.Modified;
end;
 
function TSubKeyProperty.GetAttributes : TPropertyAttributes;
begin
  Result:=[paDialog];
end;
 
function TSubKeyProperty.GetValue : string;
begin
  Result:= GetStrValue;
end;
 
procedure TSubKeyProperty.Edit;
begin
  frmSubKey := TfrmSubKey.Create(Application);
  try
    frmSubKey.Caption := 'Selecciona SubKey';
    // Aqui quiero pasar el valor de la Key a la forma frmSubKey
    frmSubKey.ShowModal;
    if frmSubKey.ModalResult = mrOK then begin
       SetStrValue(frmSubKey.stSubKey.Caption);
       designer.Modified;
    end;
  finally
    frmSubKey.Free;
  end;
end;
 
end.

Gracias

Salud OS
__________________
"La forma de empezar es dejar de hablar y empezar a hacerlo." - Walt Disney
Responder Con Cita
 


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
pasar un tipo de datos (array of record) entre aplicaciones mauqu Varios 4 26-10-2007 20:04:31
¿Cómo averiguar el tamaño de un tipo de dato? taote SQL 11 16-05-2007 20:45:51
Paso de Array entre Clases juangiron OOP 13 02-05-2007 12:01:07
Como pasar datos entre dos formas modales creadas dinamicamente Tauro78 Varios 6 24-02-2007 15:03:39
como pasar dato de un formulario a otro ??? chelejuan Varios 5 15-11-2004 09:25:44


La franja horaria es GMT +2. Ahora son las 07:53:56.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi