Ver Mensaje Individual
  #3  
Antiguo 05-08-2014
Avatar de ecfisa
ecfisa ecfisa is offline
Moderador
 
Registrado: dic 2005
Ubicación: Tres Arroyos, Argentina
Posts: 10.508
Reputación: 36
ecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to behold
Hola aguml.

A mi tampoco se me ocurre otro medio mas sencillo que agregar un espacio al final. Pero si me permites, yo restructuraría el código de este modo:
Código:
void __fastcall TFormRanking::StringGridRankingDrawCell(TObject *Sender, int ACol,
      int ARow, TRect &Rect, TGridDrawState State)
{
  TStringGrid *SG = static_cast<TStringGrid*>((TStringGrid*)(Sender));
  String cad = SG->Cells[ACol][ARow];
  HDC dc = StringGrid1->Canvas->Handle;
  register int Flags = (ACol == 1 ? DT_CENTER | DT_VCENTER | DT_SINGLELINE :
                        DT_RIGHT | DT_VCENTER | DT_SINGLELINE);

  cad += (ACol > 1 ? " " : "");
  if (State.Contains(gdFixed)) {
    SG->Canvas->Brush->Color = clBtnFace;
    SG->Canvas->Font->Color = clWindowText;
    SG->Canvas->FillRect(Rect);
    DrawText(dc, cad.c_str(), cad.Length(), &Rect, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
  }
  else if(State.Contains(gdSelected)) {
    SG->Canvas->Brush->Color = clAqua;
    SG->Canvas->Font->Color = clWindowText;
    SG->Canvas->FillRect(Rect);
    DrawText(dc, cad.c_str(), cad.Length(), &Rect, Flags);
  }
  else {
    if (ARow % 2 == 0){
      SG->Canvas->Brush->Color = clSilver;
      SG->Canvas->Font->Color = clWindowText;
    }
    else {
      SG->Canvas->Brush->Color = SG->Color;
      SG->Canvas->Font->Color = SG->Font->Color;
    }
    SG->Canvas->FillRect(Rect);
    DrawText(dc, cad.c_str(), cad.Length(), &Rect, Flags);
  }
}
Saludos
__________________
Daniel Didriksen

Guía de estilo - Uso de las etiquetas - La otra guía de estilo ....

Última edición por ecfisa fecha: 05-08-2014 a las 22:10:34.
Responder Con Cita