Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

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

 
 
Herramientas Buscar en Tema Desplegado
  #4  
Antiguo 30-08-2011
ramonibk ramonibk is offline
Miembro
 
Registrado: may 2004
Posts: 193
Poder: 23
ramonibk Va por buen camino
<<<<<<<<<< RESUELTO >>>>>>>>>>>>

Al final he optado por lo mas sencillo, he tirado todo abajo y he empezado de cero paso a paso.

Os dejo el código del OnDrawCell por si a alguno le viene bien o se le ocurre algún arreglo mas.

Código Delphi [-]
procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
  Rect: TRect; State: TGridDrawState);
Var
 i : Integer;
begin
  for i:= 0 to ListaFechas.Count-1 do
    with StringGrid1 do
       begin
         If ARow <> 0 Then
           Begin
// Decodifico la fecha que tomo de la lista.         
             DecodeDate(StrToDate(ListaFechas[i]),nYear,nMonth,nDay);
// Comparo la fecha decodificada con las que hay en el calendario.
             If ( StringGrid1.Cells[ACol,ARow]= IntToStr(nDay) ) And (wMes=nMonth) Then
                begin
                  Canvas.Brush.Color:= clRed;
                  Canvas.Font.Color:= clWhite;
                End;
           End;
         If ACol = 6 Then // Los domingos los pintamos en rojo
           Begin
             Canvas.font.Color := clRed;
             Canvas.Font.Style := [fsBold];
           End;
         If gdFixed in State then // Fila superior Dias de la semana en azul
           begin
             Canvas.Brush.Color := clNavy;
             Canvas.Font.Color := clWhite;
             Canvas.Font.Style := [fsBold];
           end;
        Canvas.FillRect(Rect);
        Canvas.TextRect(Rect, Rect.Left + (Rect.Right - Rect.Left - Canvas.TextWidth(Cells[ACol,ARow]) + 1)
                                      div 2, Rect.Top + 2, Cells[ACol,ARow]);
       End;
End;

Última edición por ramonibk fecha: 30-08-2011 a las 10:47:30.
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

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Pintar celdas StringGrid cacu OOP 4 24-10-2007 17:22:21
Marcar varias celdas en un grid. Trisckel Varios 0 02-11-2006 17:46:31
StringGrid + celdas Makiley Varios 4 01-02-2006 13:01:15
combinar celdas de StringGrid VRO Varios 2 21-04-2005 08:02:16
Combinar Celdas Stringgrid MITOPE Varios 0 21-04-2004 07:03:27


La franja horaria es GMT +2. Ahora son las 18:14:57.


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