wxTreeMultiCtrl - Windows as Root/Node ? Topic is solved

Are you writing your own components and need help with how to set them up or have questions about the components you are deriving from ? Ask them here.
Post Reply
Stefan_troeger
Knows some wx things
Knows some wx things
Posts: 39
Joined: Tue Nov 18, 2008 2:55 pm

wxTreeMultiCtrl - Windows as Root/Node ?

Post by Stefan_troeger » Tue Mar 03, 2009 3:05 pm

Heh

I have taken a look into wxTreeMultiCtrl, it's a wonderful widget! To use it i need the functionality to add windows as roots or nodes!

I've searched the docs, but it seems that roots and nodes can only be text:

AddRoot (const wxString &caption, const wxString &name=wxEmptyString)

AppendNode (wxTreeMultiItem const &ParentItem, const wxString &caption=wxEmptyString, const wxString &name=wxEmptyString)

Is it somehow possible to get what i need? I've not looked into the source yet, but maybe it's possible to implement it when not already existing?

Hope somebody has some experience with this control!

Thanks, Stefan

Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Post by Auria » Tue Mar 03, 2009 3:26 pm

I googled this component and found this :
http://www.xs4all.nl/~jorgb/components/ ... ctrl/help/
http://www.xs4all.nl/~jorgb/components/ ... iCtrl.html

Not sure if that's where you found this component; but i do see a method called AppendWindow

Stefan_troeger
Knows some wx things
Knows some wx things
Posts: 39
Joined: Tue Nov 18, 2008 2:55 pm

Post by Stefan_troeger » Tue Mar 03, 2009 4:32 pm

Heh

Yes thats the same component! With appendWindow you can add windows to a node, but not as node! So a widow can't have a Expand/Collapse Button, only nodes and roots can be expanded, and the functions i found can just add text nodes/roots. So this function is not enough for my purposes. I need a Window node, for examle a wxPanel, that has a expand button to show / hide more other windows.

Stefan

Stefan_troeger
Knows some wx things
Knows some wx things
Posts: 39
Joined: Tue Nov 18, 2008 2:55 pm

Post by Stefan_troeger » Sun Apr 12, 2009 7:13 pm

Heh

Maybe someone is intressted in my solution! I startet with a patched version of the wxTreeMultitrl found on the official site(http://www.xs4all.nl/~jorgb/wb/MyProjec ... rrent.html), you can download it here:

http://www.xs4all.nl/~jorgb/wb/attachme ... eblanc.rar

This version has most stuff you need to add windows as node items, accept the functions to do it :) also it has all typical wxTreeCtrl events defined, but they are never procesed! Some of them are quite hard to achieve, the select events for example: a normal window "eats" all mouse events (they dont propagate), so there is no universal way to get a the mouseevents, you have to create specialized windows which forward all events!

I just implemente the events and features i need, i belive some stuff is not working anymore in my version (normal text nodes for example, i dont use them so i dont do check for special treatment in my functions, maybe it crahes when using it)

So it works, but this ctrl is quite specilized, so i dont know if anyone can use it... I attached the code!


Regards
Stefan
Attachments
wxTreeMultiCtrl.zip
(58.1 KiB) Downloaded 107 times

Post Reply