Use virtual wxListView control in wxFormBuilder

Do you like to promote your wxWidgets based application or component!? Post it here and let's see what the critics have to say. Also, if you found that ONE wx component the world needs to know about, put it here for future reference.
Post Reply
beneficii
Earned some good credits
Earned some good credits
Posts: 111
Joined: Fri Nov 27, 2009 2:49 am

Use virtual wxListView control in wxFormBuilder

Post by beneficii »

wxFormBuilder, as of the latest version, has only the complicated wxListCtrl as one of the controls, but not wxListView.

Well, for this project, I needed to use a virtual list, which needs to be subclassed as DisasmListCtrl. So I went and did the subclassing in wxFormBuilder, and then when I define the class DisasmListCtrl, I do it like so:

Code: Select all

class DisasmListCtrl : public wxListView { ... };
Notice how I inherit from wxListView instead of wxListCtrl? This should not cause any issues with wxFormBuilder as wxListView is itself a subclass of wxListCtrl, so DisasmListCtrl will also be a subclass of wxListCtrl.

I was so happy when I wrote that up I thought I'd share it.

Heck! You could probably just do wxListView as the subclass for wxListCtrl in wxFormBuilder and not specify any header file and that would work just as well, because wxListView is included from the same header file as wxListCtrl (and the inheritance is already implemented)!
Post Reply