changing tree ctrl for a window

BlitzMax Forums/Brucey's Modules/changing tree ctrl for a window

UNZ(Posted 2013) [#1]
Hi folks,

I try to create multiple wxTreeCtrl to store data. But only one of them should be visible.
My thought is to hide the unused trees and only show the active. Problem is that the active tree is not resized, unless you resize the window.

It seems like Refresh() and Update() do nothing...

example:



Derron(Posted 2013) [#2]
What happens if you use a parent panel for each treectrl?

Then just resize that parent panels according to your whishes (or hide them or ...).

As this would only be hacking I assume there is just something missing in the code sending out the correct event...

bye
Ron


UNZ(Posted 2013) [#3]
I found a solution.
Looks like the problem was that the sizer did not update or whatever.

Sizers have their own Show() method. And a method Layout() to apply such changes. After I hide the old ctrl and show the new ctrl both with the sizer's method everything works.

example:



Derron(Posted 2013) [#4]
Think the sizers are something like a dynamically sized panel (or "rectangle widget"). So they need to get resized to adjust their children. Maybe they do something like "auto full size / extend" for their children (think Delphi had such behaviour for some of its components).
If not, they should not care about their children. You then would have a hidden Tree but an still expanded sizer.

But glad you found a workaround (people are awaiting next release :D).


bye
Ron