Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > OOP
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 25-07-2003
HombreSigma HombreSigma is offline
Miembro
 
Registrado: jun 2003
Ubicación: World
Posts: 114
Poder: 21
HombreSigma Va por buen camino
Error en Componente TDBGridPlus

Tengo un componente propio llamado TDBGridPlus descendiente de TDBGrid como se muestra en el código siguiente:

unit DBGridPlus;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Grids, DBGrids, DB;

type
TDBGridPlus = class(TDBGrid)
private
procedure MiDrawDataCell
(Sender: TObject; const Rect: TRect;
Field: TField; State: TGridDrawState);
public
{ Public declarations }
property InplaceEditor;
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
end;

implementation

constructor TDBGridPlus.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
Self.OnDrawDataCell:=MiDrawDataCell;
end;

procedure TDBGridPlus.MiDrawDataCell
(Sender: TObject; const Rect: TRect;
Field: TField; State: TGridDrawState);
var
Grid : TStringGrid;
Texto : String;
Rectangulo : TRect;
begin
Rectangulo:=Rect;
Grid := TStringGrid(Sender);
if Field.IsBlob
then begin
Grid.Canvas.FillRect(Rect);
Texto := Field.AsString;
DrawText( Grid.Canvas.Handle,
PChar(Texto),
StrLen(PChar(Texto)),
Rectangulo,
DT_WORDBREAK);
end;
end;

destructor TDBGridPlus.Destroy;
begin
inherited Destroy;
end;


end.

Como se ve trato de llamar cierto código nuevo dentro del evento OnDrawDataCell.

Pero no me funciona. No me interesa que el nuevo código funcione (que en este caso muestra un campo memo cualquiera y funciona) sino que se active cuando use el evento OnDrawDataCell. Pero ni siquiera se ejecuta.

Alguna sugerencia ?

Gracias por la información.
__________________
SigmaMan
Responder Con Cita
 



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


La franja horaria es GMT +2. Ahora son las 13:44:23.


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