Listbox Subclass Q

Things can get worse if I change the test to API2. Changed the class to descend from DesktopListbox instead of Listbox, Now it doesn’t fire even once as before.

Edit: Not really. The IDE removed my instance from the Window. Need to insert it again…

Remade it. Same behavior.

create container control with a listbox.
add user definition ueCellTextPaint to listbox

in the listbox CellTextPaint definition add the code: ueCellTextPaint

whenever CellTextPaint is called it will call your user event ueCelltextPaint.

use this container control in a window, and call it lets say ‘lbGroups’.
in this container control now you can select the user definition ueCelltextPaint and put some code in it.

hope it makes more sense now …
I mean by userEvent = user definition

I think we need a FB Case. I can’t find any explanation for such behavior on 2021 R3.

add user definition ueCellTextPaint to listbox

in the listbox CellTextPaint definition add the code: ueCellTextPaint

whenever CellTextPaint is called it will call your user event ueCelltextPaint.

Thats clear, and thats why it makes no sense.
if I call the parents ueCelltextPaint in CellTextPaint, there is no point having the class.
I may as well just put my special code there.

What I need to happen is
Class CellTextPaint event happens, and MAY require return true
Then Listbox normal event fires, and returns true if the class did.
We are now having two conversations, however, so Im dropping my class idea.

Seems working. And the bug is really at DebugLog ?

Everything fine, except DebugLog failing.

Instance definition:

Class definition:

Edit; Even DebugLog is working, it’s just hiding the contents. If you click at the scrollbar, it shows.

Now the only thing to care is how to process the overridden class CellTextPaint event, prior or post the bubbled up event.

Process and bubble up:

DoAnything()
Return RaiseEvent CellTextPaint(g, row, column, x, y)

or bubble up, and abort if signaled to:

If RaiseEvent CellTextPaint(g, row, column, x, y) Then Return True
DoAnything()
1 Like

In order for this event handler to be called, the cell itself must have been given a value, even if it is blank

https://documentation.xojo.com/api/deprecated/listbox.html#listbox-celltextpaint

Just a note, may still be a bug since there is content we know.

It was, I preset it with content in the properties inspector, and proven it was ok when I painted them in different colors. I was induced to error by the debug window that has hidden my DebugLog tests only presenting ONE line instead of a list of them. If you follow and read with detail all the posts I made here you will understand what occurred.