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 12-09-2007
Avatar de José Luis Garcí
[José Luis Garcí] José Luis Garcí is offline
Miembro Premium
 
Registrado: may 2003
Ubicación: Las Palmas de G.C.
Posts: 1.372
Poder: 25
José Luis Garcí Va camino a la fama
Gracias por la informacion Maeyanes, lo he intentado, pero sigo sin saber por que falla, es mas ahorame da un error de Access Violation al probar la demo, pongo el código completo del componente, para saber si me echan una mano.

Código Delphi [-]
unit UCCDShadow;

interface

uses
  Windows, Messages, SysUtils, Controls, ComCtrls,Classes, Forms, QGraphics, Graphics;

type
  TCCDShadow = class(TComponent)
  private
    { Private declarations }
  FDeph : Integer;
  FColor: Tcolor;
  ParentForm: TForm;
  protected
  { Protected declarations }
    procedure ShadowDraw;
    procedure Setdeph(value : Integer);
    procedure Setcolor(Value: TColor);
    //procedure Loaded; virtual;
    procedure Notification(AComponent: TComponent; Operation: TOperation); override;
     
  public
    { Public declarations }
    constructor Create(aOwner: TComponent); override;
    destructor Destroy(); override;
  published
    { Published declarations }
    property Deph: Integer read FDeph write SetDeph default 3;
    property Color: Tcolor read FColor write SetColor default clAqua;
  end;

procedure Register;

implementation

procedure Register;
begin
  RegisterComponents('CLub Delphi', [TCCDShadow]);
end;
constructor TCCDShadow.Create(aOwner: TComponent);
begin
    inherited Create(aOwner);
    ParentForm:=TForm(AOwner);
    Fcolor:=clAqua;
    Fdeph:=3;
    ShadowDraw;
end;

destructor TCCDShadow.Destroy();
begin
   inherited Destroy();
end;

Procedure TCCDShadow.SetColor(value : TColor);
begin
  if (FColor <> value) then FColor:= value;
  ShadowDraw;
end;

procedure TCCDShadow.SetDeph(value : Integer);
begin
  if (Fdeph <> value) then FDeph:= value;
  ShadowDraw;
end;

procedure TCCDShadow.ShadowDraw;
var
I: Integer;
rect: TRect;
old: TColor;
Component : TComponent;
begin
      ParentForm.Repaint;
      for I:= 0 to ParentForm.ControlCount -1 do
      begin
        with ParentForm do
        begin
          Component:=Components[i];
          if Component is TControl then
          begin
             rect := Controls[i].BoundsRect;
             canvas.fillrect(rect);
             rect.Left := rect.Left + FDeph;
             rect.Top := rect.Top + FDeph;
             rect.Right := rect.Right + FDeph;
         rect.Bottom := rect.Bottom + FDeph;
             old := Canvas.brush.color;
             canvas.brush.Color :=  Fcolor;
             canvas.fillrect(rect);

             canvas.brush.Color := old;
             Controls[i].Repaint
          end;
        end;
      end;
end;
procedure TCCDShadow.Notification(AComponent: TComponent; Operation: TOperation);
begin
  inherited Notification(AComponent,Operation);
  if (Operation = opinsert) and (AComponent is TCCDShadow) then  ShadowDraw;
  TCCDShadow(AComponent).ShadowDraw;
 end;

end.
__________________
Un saludo desde Canarias, "El abuelo Cebolleta"
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
Diseño/ejecución maestro/detalle morta71 Firebird e Interbase 2 03-05-2007 18:51:56
Diseño de reportes en tiempo de ejecución jzginez Impresión 2 17-04-2007 16:46:10
Diseño en tiempo de ejecucion Nelson Alberto Impresión 2 26-01-2006 09:34:12
Paquetes de diseño y ejecución sur-se OOP 4 15-11-2004 17:34:27
Obtener Todo El Registro De Una Tabla Aunque Aunque Este Agrupado Por 2 Campos agova SQL 6 11-08-2004 15:48:14


La franja horaria es GMT +2. Ahora son las 05:59:28.


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