On Tuesday 18 October 2016 22:11:28 Krzysztof wrote:
> Hi Martin,
>
> Long time :) . My last project was aborted (not due to MSE) so there was no
> sense to continue porting from Lazarus. But I started new one and want to
> make it on MSE from the beginning.
>
> Have questions about twidgetgrid:
>
> 1. Is it possible to make background and frame transparent? Basically only
> scrollbars should be drawed normally, row selection and maybe grid lines.
> I'm using it for tree purpose, only one column with ttreeitemedit. Tried
> set color and face.fade.color0 to clTransparent but it didn't help.
> Althought changing face.fade.color0 to any other standard color work. Just
> want to show form which is underneath. I could trick that by setting color
> same as form has.

The white background is drawn by frame.colorclient. Please set 
T*Grid.Frame.ColorClient to cl_transparent.
Warning: Grids use window scrolling in order to optimise performance. So for 
example in order to show a new row on bottom the existing screen content will 
be shifted one row up and only the new row will be painted. This is wrong 
with visible background so T*Grid.OptionsWidget ow_noscroll must be set.

> 2. I want to draw something on the right side of each tree item. Overrided
> method ttreelistedititem.drawcell and looked how it is done in descendant:
>
> procedure TRootNode.drawcell(const acanvas: tcanvas);
> var
>  po1: pcellinfoty;
>  layoutinfopo: plistitemlayoutinfoty;
> begin
>   inherited drawcell(acanvas);
>   po1:=  pcellinfoty(acanvas.drawinfopo);
>   layoutinfopo:= fowner.fintf.getlayoutinfo(po1);
>
> drawtext(acanvas,'abc',layoutinfopo^.captioninnerrect,[tf_ycentered,tf_righ
>t]); end;
>
> But it is complain about "fintf" which is not published.
"
type
 tcustomitemlist1 = class(tcustomitemlist);

procedure TRootNode.drawcell(const acanvas: tcanvas);
var
 po1: pcellinfoty;
 layoutinfopo: plistitemlayoutinfoty;
begin
  inherited drawcell(acanvas);
  po1:=  pcellinfoty(acanvas.drawinfopo);
  layoutinfopo:= tcustomitemlist1(fowner).fintf.getlayoutinfo(po1);
"
git master 8e69c962a8988798ecd1602c590026776c549cff has a "getownerintf()" 
function for convenience.
"
  layoutinfopo:= getownerintf.getlayoutinfo(po1);
"
> Is there other way 
> / function? 

Maybe overriding "drawimage()" is better.

> Also, standard caption's draw should not draw on my extra text 
> so I need to decrease right edge in descendand draw somehow. Modify `
> captioninnerrect.cx` before "inherited drawcell;" line ?
>
Override "calcitemlayout()".

Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

Reply via email to