On Wednesday 27 April 2016 17:22:52 Krzysztof wrote:
>
> Should I use all events or pickup one? This code seems to work but
> size is not correct (looks like 1/3 of expected width):
>
Pickup one. I gave you a wrong instruction for code, see below.

> procedure TGenericListWidget.DrawTitle(const sender: tcol;
>   const canvas: tcanvas; var cellinfo: cellinfoty);
> var r: PMusicTag;
> begin
>   with cellinfo,cell do begin
>     r := FPlaylist[row];
>     if calcautocellsize then
>       autocellsize.cx:= textrect(canvas, r^.Title).cx;
>     drawtext(canvas,r^.Title,innerrect,[tf_ycentered,tf_ellipseright]);
>   end;
> end;
>
"
procedure tmainfo.drawcellexe(const sender: tcol; const canvas: tcanvas;
               var cellinfo: cellinfoty);
var
 i1: int32;
begin
 with cellinfo,cell do begin
  if calcautocellsize then begin
   i1:= textrect(canvas, TheText).cx + rect.cx - innerrect.cx;
//or faster for simple text layouts:
// i1:= canvas.getstringwidth(TheText) + rect.cx - innerrect.cx;

   if i1 > autocellsize.cx then begin
    autocellsize.cx:= i1;
   end;
  end
  else begin
   drawtext(canvas,TheText,innerrect,[tf_ycentered,tf_ellipseright]);
  end;
 end;
end;
"
Please call tcol.invalidatemaxsize() when your data changes, it is now public, 
git master 971bf8eee8b8cebc9e5b4c3e00d58f940bcdd72b.

Martin

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
mseide-msegui-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

Reply via email to