Forum > CustomDrawn

TCDListView properties

<< < (2/3) > >>

PatBayford:
Sorry Bart - not intending to use any of the Delphi codebase, just looking for pointers as to where, and how, to implement the gridline routines.
As it happens, perusal of the CustomDrawn code suggests it may not be possible - I just stumbled across this :-

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TCDControl.DrawToCanvas(ACanvas: TCanvas);var  lSize: TSize;  lControlId: TCDControlID;begin  PrepareCurrentDrawer();  lSize := Size(Width, Height);  lControlId := GetControlId();  PrepareControlState;  PrepareControlStateEx;  FDrawer.DrawControl(ACanvas, Point(0, 0), lSize, lControlId, FState, FStateEx);end; The reference here to lControlId, which will be cidListView, suggests that the drawing behaviour is, indeed, embedded in the Drawer routines of the widgetset. Will have to have a poke about in there to see if the possibility exists to draw the grid lines.

Mike.Cornflake:

--- Quote ---The reference here to lControlId, which will be cidListView, suggests that the drawing behaviour is, indeed, embedded in the Drawer routines of the widgetset
--- End quote ---

I still don't think so (ignoring items like @howardpc's open question here about Pen Style psDash being implemented on GTK2 or not)

Following TCDControlID through, it's just a list of different objects to draw.  For list views, this gets you to procedure TCDDrawerCommon.DrawListView in customdrawn_common.pas.  There you will see only ReportStyle is supported, and the subsequent procedure "DrawReportListView" is just paint on canvas style code.  That'd be where you add support for grid lines :-)

Mike.Cornflake:
When searching through Lazarus and fpc source code "Find in Files" is my goto tool of choice.

PatBayford:
Thanks for the hint Mike.Cornflake - I had not got that far through the TCDDrawer code!! Will check it out thoroughly - the point being that there is little point implementing the code if it only going to get overwritten by the existing code - I've made this mistake before!!

Mike.Cornflake:
Apologies.  I see now where you're coming from.  I was thinking in terms of producing a Patch for the custom-drawn control, you were thinking in terms of drawing the grid-lines in your own code as if it was owner-drawn.  You are correct, any painting you do in your own project will be overwritten by the custom-drawn control.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version