Controling size and position for CustomTreeCtrl item windows

Hi All,

Greg Mennenga wrote:
> Hello,
>
> I'm a relatively new user to wxPython, and have recently run into a
> layout snag. Simply, I cannot seem to use sizers or any other dynamic
> method of controlling the position and size of CustomTreeCtrl item
> windows (created either on init with the wnd keyword or with SetWindow).

CustomTreeCtrl is great huh! Although I am not sure if it can do this
feature for you.

If it can't (I am sure Andrea will chime in with the answer), you may
want to look at TreeListCtrl in the demo. With this you have a tree and
a column to the right of it which will align all your text associated
with each node. You can then make these editable (see ListCtrl_edit in
the demo). This may work for you if you just want editable text
associated with each node.

PS - A suggestion for CustomTreeCtrl. It would be REALLY cool if you can
get some object that worked like a wxSizer. For example right now if I
want a node to have two buttons, I have to create a panel, insert the
two buttons, and give the node that panel. I guess really all you would
have to do is use a Sizer to layout the windows for each tree node (if
you aren't already), and then allow easy access to that sizer!

There are other few minor changes to CustomTreeCtrl I still have to
consider, issues raised few weeks ago like:

- Fixing the behavior of SetWindow (as mentioned by Greg in the other thread);
- Adding SetItemWindow/GetItemWindow;
- Adding the method GetPrevSibling (not sure if I remember correctly
the method name right now, but I have a patch for it at home);
- Something else is in the wish list, at home :smiley:

It looks like I got write access to SVN (thanks Robin!), so I will
concentrate as soon as I can on these issues. I am sorry I have been
quite away in this month, but it's complicated to keep pace at work
when everybody else is on holiday :frowning:

Anyway, Greg, you might also take a look at HyperTreeList on my webpage:

http://xoomer.alice.it/infinity77/main/freeware.html#hypertreelist

I am not sure it will do what you ask, and it probably is still a bit
buggy (as no one, as far as I know, has ever tested it except myself).
But I will keep your suggestions in my mind while updating the source
code for CustomTreeCtrl.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

ยทยทยท

On 8/8/07, Mike Rooney wrote:

Hi All,

<snip>
<snap>

It looks like I got write access to SVN (thanks Robin!), so I will
concentrate as soon as I can on these issues. I am sorry I have been
quite away in this month, but it's complicated to keep pace at work
when everybody else is on holiday :frowning:

Ok, I have implemented a couple of new things and applied a patch to
CustomTreeCtrl. I was able to commit my changes to SVN, but I am
positively sure I wasn't able to commit the changes on both 2.8 and
head revision :frowning: . Robin, help! :smiley: :smiley:
By the way, the changes are:

1) Added method SetItemWindow() and DeleteItemWindow();
2) Applied patch 1747287 to implement the GetPrevVisible() method in
CustomTreeCtrl;
3) Corrected the SortChildren() method: now it uses the cmp() function
instead of the wrong equality comparison previously implemented;
4) Implemented the GetMaxWidth() method, which returns the maximum
width of the items (useful to assess the exact width in which
CustomTreeCtrl can fit).

I attach a patch to this email, if anyone is interested in it... I
would be glad to know if there are problems with the modifications I
made.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/