Ver Mensaje Individual
  #2  
Antiguo 07-04-2005
Avatar de Neftali [Germán.Estévez]
Neftali [Germán.Estévez] Neftali [Germán.Estévez] is offline
[becario]
 
Registrado: jul 2004
Ubicación: Barcelona - Espańa
Posts: 19.438
Reputación: 10
Neftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en bruto
Prueba con esta:

Código Delphi [-]
 var
   Str,Str2:string;
   f:byte;
   ARect:TRect;
   Ancho_Letra,Ancho_de_Antes:integer;
   _Left:Integer;
 begin
   f:=0;
   _Left:=0;
   Str:=BASIC_List.Items[Index];
   //BASIC_List.Canvas.TextRect(Rect, 0, 0, '');
 
   while f<=length (Str) do begin
       if (Str[f]<#32) or (Str[f] in [#144..#164]) then begin
             case ord(Str[f]) of
               144..164:
         begin
           Ancho_Letra:=BASIC_List.Canvas.TextWidth(Str[f]);
           Str2:=copy(Str,0,f);
           Ancho_de_Antes:=BASIC_List.Canvas.TextWidth(Str2);
           BASIC_List.Canvas.Font.Style:=[fsUnderline,fsItalic];
           ARect:=Rect;
           ARect.Left:=ARect.Left+Ancho_de_Antes+1;
           ARect.Right:=ARect.Right+Ancho_de_Antes+Ancho_Letra+1;
           BASIC_List.Canvas.TextRect(aRect, ARect.Left, aRect.Top,
           chr(ord(Str[f])-79));
               end;
               else  begin
                   //De momento nada
                end;
             end;
             inc (f);
           end
         else  begin
             Ancho_Letra:=BASIC_List.Canvas.TextWidth(Str[f]);
             Str2:=copy(Str,0,f);
             Ancho_de_Antes:=BASIC_List.Canvas.TextWidth(Str2);
             BASIC_List.Canvas.Font.Style:=[];
             ARect:=Rect;
       ARect.Left:=_Left;
 
       if (fthen begin  // ultima
               ARect.Right:=_Left+Ancho_Letra;
       end;
       
       _LEft := _LEft + Ancho_Letra;
             BASIC_List.Canvas.TextRect(aRect, ARect.Left + 1, aRect.Top, Str[f]);
             inc(f);
     end;
     end;
 
   // Cambiar cuando tiene el foco...
   if odFocused in State then begin
     BASIC_List.Canvas.Brush.Style := bsClear;
     BASIC_List.Canvas.Rectangle(Rect);
     DrawFocusRect(BASIC_List.Canvas.Handle, Rect);
   end;
 end;

De todas forma la condición (Str[f] in [#144..#164]) nunca se cumple y por lo tanto nunca va a entar en la primera parte del procedimiento.
__________________
Germán Estévez => Web/Blog
Guía de estilo, Guía alternativa
Utiliza TAG's en tus mensajes.
Contactar con el Clubdelphi

P.D: Más tiempo dedicado a la pregunta=Mejores respuestas.
Responder Con Cita