I know I am missing something obvious but I hope someone can enlighten
me..... I am using the drawitem function of the virtual listbox to draw
various lines, but I can't seem to get it to scroll horizontally. Is there
a quick directive to get it to scroll??
As far as I can see, it doesn't have a onscroll event handler and I can't
seem to find a .canvas handle to be able to tie it with a different starting
column if that is how you do it.....
Any help would be greatly appreciated.
Here is a snippet of my draw item routine that might show my stupidity....
. . .
WII : SELECTTITLISTRECORD; // PROGRAM CONTENT ITEM
procedure DrawIt(St : AnsiString; Center : Boolean);
var
L : Integer;
begin
L := Length(St);
if L = 255 then Dec(L); // 255 width of old box parameters from orph
3
if (L > 0) and (L < 255) then begin
if St[L+1] <> #0 then St[L+1] := #0;
if Center then begin
IF (Index = WELL.ITEMINDEX) THEN begin
WELL.Canvas.Brush.Color := WELL.SelectColor.BackColor;
WELL.Canvas.Font.Color := WELL.SelectColor.TextColor;
end;
SetTextAlign(WELL.Canvas.Handle, TA_CENTER);
ExtTextOut(WELL.Canvas.Handle, (Rect.Left + Rect.Right) div 2,
Rect.Top + 2, ETO_CLIPPED,
@Rect, @St[1], Length(St), nil);
end
else
begin
IF (Index = WELL.ITEMINDEX) THEN begin
WELL.Canvas.Brush.Color := WELL.SelectColor.BackColor;
WELL.Canvas.Font.Color := WELL.SelectColor.TextColor;
end;
SetTextAlign(WELL.Canvas.Handle, TA_LEFT);
ExtTextOut(WELL.Canvas.Handle, Rect.Left + 2, Rect.Top + 2,
ETO_CLIPPED,
@Rect, @St[1], Length(St), nil);
end;
end;
end;
begin
CASE WELLFLAG OF
1 : begin // DAILY SPOTS PLANS 1-19
. . .
WCO := CODATA.DAYSPOTS.Items[Index]; // MOLLY - CHANGES
IN DISPLAY WELL ITEMS
OSHOWORD := IntToStr(WCO.SDAYORDER) + '-';
OSHOWFLT := IntToStr(WCO.SDAYFLIGHT);
OSHOWACCT := IntToStr(WCO.SDAYACCT);
. . .
// SET THE PAINT PARMS
WELL.Canvas.Pen.Style := psSolid;
WELL.Canvas.Pen.Color := clGray;
WELL.Canvas.Brush.Color := FPEAK.GSKY;
WELL.Canvas.Font.Style := [];
WELL.Canvas.Font.Size := 8;
WELL.Canvas.Font.Color := clBlack;
// BEGIN THE PAINTING A FIELD AT A TIME help.....
Rect.Left := 0;
Rect.Right := Rect.Left + 28;
DrawIt(OSHOWORD, FALSE);
Rect.Left := Rect.Right;
Rect.Right := Rect.Left + 10;
DrawIt(OSHOWFLT, FALSE);
. . .
Thanks for your help!!
Brad Hillyard