Frenk
The following has properties and events. no property editors. hope it helps
TfrVistaRegistro = class(TFrame)
ToolBar4: TToolBar;
btnAnterior: TBitBtn;
btnSiguiente: TBitBtn;
btnAceptar: TBitBtn;
btnCancelar: TBitBtn;
procedure btnAnteriorClick(Sender: TObject);
procedure btnSiguienteClick(Sender: TObject);
procedure btnAceptarClick(Sender: TObject);
procedure btnCancelarClick(Sender: TObject);
private
{ Private declarations }
{Propiedades}
FAnterior:Boolean;
FSiguiente:Boolean;
FAceptar:Boolean;
FCancelar:Boolean;
FEdicion:Boolean;
{Eventos}
FOnAnterior:TNotifyEvent;
FOnSiguiente:TNotifyEvent;
FOnAceptar:TNotifyEvent;
FOnCancelar:TNotifyEvent;
{Propiedades}
Procedure SetAnterior(Value:Boolean);
Procedure SetSiguiente(Value:Boolean);
Procedure SetAceptar(Value:Boolean);
Procedure SetCancelar(Value:Boolean);
Procedure SetEdicion(Value:Boolean);
public
{ Public declarations }
constructor Create(AOwner:TComponent);override;
procedure TraerAlFrente; virtual;
Published
Property mpi_Anterior:Boolean Read FAnterior write SetAnterior;
Property mpi_Siguiente:Boolean Read FSiguiente write SetSiguiente;
Property mpi_Aceptar:Boolean Read FAceptar write SetAceptar;
Property mpi_Cancelar:Boolean Read FCancelar write SetCancelar;
Property mpi_Edicion:Boolean Read FEdicion write SetEdicion;
Property mpi_OnAnterior:TNotifyEvent Read FOnAnterior write FOnAnterior;
Property mpi_OnSiguiente:TNotifyEvent Read FOnSiguiente write
FOnSiguiente;
Property mpi_OnAceptar:TNotifyEvent Read FOnAceptar write FOnAceptar;
Property mpi_OnCancelar:TNotifyEvent Read FOnCancelar write FOnCancelar;
end;
procedure Register;
implementation
{$R *.DFM}
procedure Register;
begin
RegisterComponents('MPI', [TfrVistaRegistro]);
end;
constructor TfrVistaRegistro.Create(AOwner:TComponent);
begin
Inherited;
ControlStyle:=ControlStyle + [csAcceptsControls];
mpi_Anterior:=False;
mpi_Siguiente:=False;
mpi_Edicion:=False;
end;
Procedure TfrVistaRegistro.SetAnterior(Value:Boolean);
begin
btnAnterior.Enabled:=Value;
FAnterior:=Value;
end;
Procedure TfrVistaRegistro.SetSiguiente(Value:Boolean);
begin
btnSiguiente.Enabled:=Value;
FSiguiente:=Value;
end;
Procedure TfrVistaRegistro.SetAceptar(Value:Boolean);
begin
btnAceptar.Enabled:=Value;
FAceptar:=Value;
end;
Procedure TfrVistaRegistro.SetCancelar(Value:Boolean);
begin
btnCancelar.Enabled:=Value;
FCancelar:=Value;
end;
Procedure TfrVistaRegistro.SetEdicion(Value:Boolean);
begin
if value then
begin
mpi_Cancelar:=true;
mpi_Aceptar:=true;
end
else
begin
mpi_Cancelar:=false;
mpi_Aceptar:=false;
end;
FEdicion:=Value;
end;
procedure TfrVistaRegistro.btnAnteriorClick(Sender: TObject);
begin
if Assigned(mpi_OnAnterior) then mpi_OnAnterior(Self);
end;
procedure TfrVistaRegistro.btnSiguienteClick(Sender: TObject);
begin
if Assigned(mpi_OnSiguiente) then mpi_OnSiguiente(Self);
end;
procedure TfrVistaRegistro.btnAceptarClick(Sender: TObject);
begin
if Assigned(mpi_OnAceptar) then mpi_OnAceptar(Self);
end;
procedure TfrVistaRegistro.btnCancelarClick(Sender: TObject);
begin
if Assigned(mpi_OnCancelar) then mpi_OnCancelar(Self);
end;
procedure TfrVistaRegistro.TraerAlFrente;
begin
Self.Align:=alClient;
Self.BringToFront;
end;
end..
Frenk
"Marko Perich" <marko...@yahoo.com> wrote in message
news:3c0eee0b_2@dnews...
For forms it can be done by registering it with RegisterCustomModule.
See "How can I add published properties to a TForm descendent?" on
http://www.gexperts.org/opentools for an example. I think this works for
frames too.
Sasan.