It looks like I've found the reason for the strange customdraw behaviour.
At the end of the primary loop (the loop at the beginning of my sample
program) I have a call to the TimedMessage public routine that confirms the
number of listviews that were created. I commented out the call and
suddenly all colouring is done correctly. I then replaced the call with a
call to the InfoDialog public routine and the behaviour is still correct.
So for some reason it looks like the TimedMessage routine
is interfering with customdraw. This also explains why always the last
listview created had this problem, as this is the point in time when the
TimedMessage was generated. This makes me believe that there may be an
explanation and possibly a solution to the problem after all. :)

Staffan


On Wed, Jan 23, 2013 at 11:57 PM, Staffan Tylen <staffan.ty...@gmail.com>wrote:

>
> Other than that, I don't see anything in the code that would cause what
>> you are seeing.  So, I'll definitely need an example program to do anything
>> more.
>>
>>
> I'm back and have tried to create a stripped version of the program that
> demonstrates the problem. But unfortunately it works like a charm, well
> what else to expect? :( So sorry to say I'me finding it difficult to prove.
>
> But coming back I'm now seeing a slight different behaviour (no changes
> made). Before I left I concluded that it was always the last listview
> created that didn't get the colouring made. And if there was only one
> listview it didn't get coloured, probably because it was the last (and
> only). (BTW with listview I mean a separate popup window with a listview
> control.) But today I'm experiencing a different behaviour. When I generate
> two listviews both get coloured OK the first time. When I repeat it the
> second listview gets half of the rows coloured, the first is still correct.
> And the third time the second gets no colour at all, but the first still
> does. And this continues subsequent times. To say the least I'm baffled.
> OK, this is nothing serious, I'll just skip using customdraw, even though I
> think it looks better.
>
> This is the sample code I used trying to emulate the problem, but as I
> said it works and doesn't behave like the original code.
>
>   rg = .RG~new
>   offset = 0
>   do 5
>      rg~create(offset)
>      offset += 10
>   end
>
> ::CLASS RG
>
> ::METHOD create
>   use arg offset
>   self~create2(offset)
>
> ::METHOD create2
>   use arg offset
>   .OR~generate(offset)
>
> ::CLASS OR SUBCLASS UserDialog INHERIT CustomDraw ResizingAdmin
> ::REQUIRES "ooDialog.cls"
>
> ::METHOD generate CLASS
>   use arg offset
>   dialog = self~new(offset)
>   dialog~popup("SHOWTOP")
>
> ::METHOD init
>   expose blue white
>   use arg offset
>   self~init:super()
>   self~customDraw
>   self~customDrawControl(100, "LISTVIEW", onCustomDraw)
>   blue  = self~RGB(240, 240, 255)
>   white = self~RGB(255, 255, 255)
>   self~create(offset, offset, 400, 300, "Title", "MINIMIZEBOX MAXIMIZEBOX")
>
> ::METHOD defineDialog
>   u = .DlgAreaU~new(self)
>   self~createListView(100, u~x, u~y, u~w, u~h, "REPORT HSCROLL VSCROLL
> HIDDEN")
>   forward class(super)
>
> ::METHOD initDialog
>   lv = self~newListView(100)
>   lv~addExtendedStyle("FULLROWSELECT INFOTIP GRIDLINES HEADERDRAGDROP")
>   self~populate(lv)
>   forward class(super)
>
> ::METHOD populate
>   use arg lv
>   data = .array~new
>   data[1] = .array~of("A","B","C","D")
>   do i = 1 to data[1]~items
>      lv~insertColumn(i - 1, data[1][i], 50, "LEFT")
>   end
>   do i = 2 to 10
>      data[i] = .array~of(1,2,3,4,5)
>   end
>   lv~prepare4nItems(data~items-1)
>   do i = 2 to data~items
>      row = ""
>      loop val over data[i]~allItems
>           row ||= '"' || val || '",'
>      end
>      interpret "lv~addRow( , , " || strip(row, "T", ",") || ")"
>   end
>   lv~show
>
> ::METHOD onCustomDraw UNGUARDED
>   expose blue white
>   use strict arg lvCDS
>   item = lvCDS~item
>   if (item // 2) == 0 then lvCDS~clrTextBk = blue
>   else lvCDS~clrTextBk = white
>   lvCDS~reply = self~CDRF_NEWFONT
>   return .TRUE
>
> The above code creates the listview windows very quickly, with the
> original code gets the input from an SQLite database so the windows pop up
> in a more irregular manner. Whether this may have anything to do with it is
> very hard to say.
>
> That's all I can come up with at this point in time. And as I said this is
> not that important...
>
> 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. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
Oorexx-users mailing list
Oorexx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-users

Reply via email to