I've tried to implement the CustomDraw class in order to achieve colouring
of every second row in a listview report, but I'm facing what seems to be
sporadic or intermittent problems. In one case the onCustomDraw never gets
called (proved by tracing), unless more than one listview is created after
each other (see the loop below). In another case only the first portion of
the listview gets coloured, like the 10 first lines. In other cases it
seems to work fine. I suspect it has to do with multiple threads being at
work, but can't pinpoint what it is. The general implementation is as
follows (this is not a working example):

::class testcustomdraw public subclass userdialog inherit customdraw
resizingadmin
::method generate class public
use arg report
dlg = self~new(report)
dlf~popup("showtop")

::method init
use arg report
self~init:super()
self~customdraw
self~customdrawcontrol(100,'listview',oncustomdraw)
self~create(0,0,200,200,,'minimizebox maximizebox')

::method definedialog
self~createlistview(100,0,0,200,200,'report hscroll vscroll')
forward class(super)

::method initdialog
lv =newlistview(100)
lv~addextendedstyle('fullrowselect infotip gridlines headerdragdrop')
self~populatelistview(report)
forward class(super)

::method oncustomdraw unguarded
use arg lvcds
invoke clrtextbk etc.
lvcds~reply = self~cdrf_newfont
return .true

The above class is called from a loop similar to this:

loop report over reports~allitems
   .testcustomdraw~generate(report)
end

The above is a simplified picture of how the process works. I've tested
without resizingadmin but with the same results. I'm out of ideas...

Staffan
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122412
_______________________________________________
Oorexx-users mailing list
Oorexx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-users

Reply via email to