Ver Mensaje Individual
  #4  
Antiguo 15-04-2016
Avatar de ecfisa
ecfisa ecfisa is offline
Moderador
 
Registrado: dic 2005
Ubicación: Tres Arroyos, Argentina
Posts: 10.508
Reputación: 38
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.

Por un lado la página del enlace me pedía registro para acceder y por otro no podía abrir el adjunto.

Ahora que pude abrir y ver el adjunto, usando el primer código del mismo, creo que podes hacer de este modo:
Código PHP:
// ...
void __fastcall TForm1::FormCreate(TObject *Sender)
{
  
int xymaxLen 0;

  
// hallar el texto mas largo
  
for (0MainMenu1->Items->Countx++)
  {
    
TMenuItemmi static_cast<TMenuItem*>(MainMenu1->Items->Items[x]);
    for (
0mi->County++)
      if (
mi->Items[y]->Caption.Length() > maxLen)
        
maxLen mi->Items[y]->Caption.Length();
  }

  
// agregar 5 espacios (o los que gustes) e igualar largos
  
maxLen += 5;
  for (
0MainMenu1->Items->Countx++)
  {
    
TMenuItemmi static_cast<TMenuItem*>(MainMenu1->Items->Items[x]);
    for (
0mi->County++)
      
mi->Items[y]->Caption +=  mi->Items[y]->Caption.StringOfChar(' ',
        
maxLen-mi->Items[y]->Caption.Length());
  }
}

void __fastcall TForm1::Listados1DrawItem(TObject *SenderTCanvas *ACanvas,
  
TRect &ARectbool Selected)
{
  
TRect FocusRectBorder ARect;
  
TRect FocusRectFill   ARect;
  
TRect TextRect        ARect;
  
TMenuItem *MenuItem   = ((TMenuItem*)Sender);
  
AnsiString Text MenuItem->Caption;

  if(
Text == "") return;

  
ACanvas->Brush->Color MainMenuBackground;
  
ACanvas->FillRect(ARect);

  if(
Selected)
  {
   
ACanvas->Brush->Color BorderColor;
   
ACanvas->FrameRect(FocusRectBorder);
   
FocusRectFill.Top    += 1;
   
FocusRectFill.Right  -= 1;
   
FocusRectFill.Left   += 1;
   
FocusRectFill.Bottom -= 1;
   
ACanvas->Brush->Color MainMenuHighlightColor;
   
ACanvas->FillRect(FocusRectFill);
   
ACanvas->Font->Color MainMenuHighlightTextColor;
  }
  else
    
ACanvas->Font->Color MainMenuTextColor;

  
InflateRect(&TextRect,-1,-1);
  
DrawText(ACanvas->HandleText.c_str(), Text.Length(),
    &
TextRectDT_SINGLELINE);

Resultado:


Saludos
__________________
Daniel Didriksen

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

Última edición por ecfisa fecha: 15-04-2016 a las 01:13:38. Razón: agregar comentario
Responder Con Cita