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
  #2  
Antiguo 31-03-2004
Avatar de Nuria
Nuria Nuria is offline
Miembro
 
Registrado: may 2003
Posts: 531
Poder: 24
Nuria Va por buen camino
Sólo añadir una cosilla más a lo dicho anteriormente, por si tuviera algo que ver. Este es el código que tengo en el evento OnDrawColumnCell del RxDBGrid.

Código:
procedure TfFacturas.RxDBGrid1DrawColumnCell(Sender: TObject;
  const Rect: TRect; DataCol: Integer; Column: TColumn;
  State: TGridDrawState);
const CtrlState : array[Boolean] of Integer = (DFCS_BUTTONCHECK,
                                             DFCS_BUTTONCHECK or DFCS_CHECKED);
var CheckBoxRectangle : TRect;
begin
    
     // Pintamos toda la fila de la celda booleana
     // Para hacerlo tenemos que hacer referencia al campo booleano
     if IBQ.AsBoolean then
      begin
           RxDBGrid1.Canvas.Brush.Color := clInfobk;
           RxDBGrid1.Canvas.Font.Style  := [fsBold];
           RxDBGrid1.Canvas.Font.Color  := ClBlack;
           RxDBGrid1.DefaultDrawColumnCell(Rect,Datacol,Column,State);
      end;

     // campo Check
     if Column.Field.DataType = ftBoolean then
      begin
           // Pintamos solo la celda booleana
           if Column.Field.AsBoolean then
           begin
                 RxDBGrid1.Canvas.Brush.Color := clInfobk;
                 RxDBGrid1.Canvas.Font.Style  := [fsBold];
                 RxDBGrid1.Canvas.Font.Color  := ClBlack;
                 RxDBGrid1.DefaultDrawColumnCell(Rect,Datacol,Column,State);
           end;

           RxDBGrid1.Canvas.FillRect(Rect);
           CheckBoxRectangle.Left   := Rect.Left + 2;
           CheckBoxRectangle.Right  := Rect.Right - 2;
           CheckBoxRectangle.Top    := Rect.Top + 2;
           CheckBoxRectangle.Bottom := Rect.Bottom - 2;
           DrawFrameControl(RxDBGrid1.Canvas.Handle, CheckBoxRectangle, 
DFC_BUTTON, CtrlState[Column.Field.AsBoolean]);
      end;
end;
mmmm.... , de donde he podido sacar este código...

Saludillos!
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


La franja horaria es GMT +2. Ahora son las 07:49:18.


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