Discussion:
Troubles with wxWidgets 3.0.0 wxTreeListCtrl
Michael Uman
2014-02-28 19:43:12 UTC
Permalink
Hello,

This is my first post to the user group... So I hope I can get some
answers...

First of all I would like to thank all the developers for wxWidgets. We
have been using wxWidgets at Sigma since I joined in 2003. We use the
library for our Debugger and have been pleased with it's ease of porting
between Windows and Linux. I build our project for both Windows 7 and
Ubuntu Linux and support other Linux distros (CentOS, Debian)...

But I have been running into issues with the wx3_0_0 wxTreeListCtrl. Before
I upgraded our app to use wx3_0_0 we relied on wx2_8_12 and used a
third-party treelist control. Unfortunately that tree list control doesn't
work in the wx3 environment, and I ported our code to work with the
included wxTreeListCtrl which comes with wx3...

But two things bother me:

1) On the Linux port the scroll-wheel doesn't scroll the tree list... I can
only scroll with the mousewheel when the mouse is over the scroll-bar. On
the Windows 7 port the scroll wheel works when it is rolled over the entire
tree control area. Is there some way to make the Linux tree control scroll
with the scroll-wheel?

2) The 3rd party tree control we used previously included a member called
*ExpandAll()* but not such member exists in the wx3 tree control. So I
thought I would write some recursive code which would iterate through all
the siblings of the item, expanding each one in the process.... But this
did not work for me. I am currently 'whipping together' an example app
which will demonstrate what I am doing. I hope to be able to attach it to a
follow up on this thread.

Does anyone know anything about what I am asking? If so I would greatly
appreciate your assistance. I hope to be able to contribute something some
day to wxWidgets.

Thank you,
Michael Uman
Sr. Software Engineer
Sigma Designs, Inc.
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Carl Godkin
2014-02-28 20:29:57 UTC
Permalink
The wxCode wxTreeListCtrl is not the same as the wx 3.0 wxTreeListCtrl as
you've found.

I have stuck with the wxCode version of wxTreeListCtrl because the built-in
one lacks some features as you've found.

To continue using the wxCode version, I originally built wx 3.0 with

#define wxUSE_TREELISTCTRL 0 // wxTreeListCtrl

on Windows and " --disable-treelist" on Linux but I discovered just the
other day that
the latest wxCode version of wxTreeListCtrl actually puts wxTreeListCtrl
into the "wxcode"
namespace now so you won't have the conflict any longer. (Thanks, wxcode
maintainer!)

As the built-in wxTreeListCtrl matures, I will periodically consider using
the built-in version instead.

I hope that helps,

carl
Post by Michael Uman
Hello,
This is my first post to the user group... So I hope I can get some
answers...
First of all I would like to thank all the developers for wxWidgets. We
have been using wxWidgets at Sigma since I joined in 2003. We use the
library for our Debugger and have been pleased with it's ease of porting
between Windows and Linux. I build our project for both Windows 7 and
Ubuntu Linux and support other Linux distros (CentOS, Debian)...
But I have been running into issues with the wx3_0_0 wxTreeListCtrl.
Before I upgraded our app to use wx3_0_0 we relied on wx2_8_12 and used a
third-party treelist control. Unfortunately that tree list control doesn't
work in the wx3 environment, and I ported our code to work with the
included wxTreeListCtrl which comes with wx3...
1) On the Linux port the scroll-wheel doesn't scroll the tree list... I
can only scroll with the mousewheel when the mouse is over the scroll-bar.
On the Windows 7 port the scroll wheel works when it is rolled over the
entire tree control area. Is there some way to make the Linux tree control
scroll with the scroll-wheel?
2) The 3rd party tree control we used previously included a member called
*ExpandAll()* but not such member exists in the wx3 tree control. So I
thought I would write some recursive code which would iterate through all
the siblings of the item, expanding each one in the process.... But this
did not work for me. I am currently 'whipping together' an example app
which will demonstrate what I am doing. I hope to be able to attach it to a
follow up on this thread.
Does anyone know anything about what I am asking? If so I would greatly
appreciate your assistance. I hope to be able to contribute something some
day to wxWidgets.
Thank you,
Michael Uman
Sr. Software Engineer
Sigma Designs, Inc.
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
or visit http://groups.google.com/group/wx-users
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Michael Uman
2014-02-28 22:50:57 UTC
Permalink
CGodkin,

Thank you for your suggestions...

I have made some headway in the expanding/collapsing of the tree. I will
post the relevant code as another post in this thread below...

Thanks,
Michael Uman
Post by Carl Godkin
The wxCode wxTreeListCtrl is not the same as the wx 3.0 wxTreeListCtrl as
you've found.
I have stuck with the wxCode version of wxTreeListCtrl because the
built-in one lacks some features as you've found.
To continue using the wxCode version, I originally built wx 3.0 with
#define wxUSE_TREELISTCTRL 0 // wxTreeListCtrl
on Windows and " --disable-treelist" on Linux but I discovered just the
other day that
the latest wxCode version of wxTreeListCtrl actually puts wxTreeListCtrl
into the "wxcode"
namespace now so you won't have the conflict any longer. (Thanks, wxcode
maintainer!)
As the built-in wxTreeListCtrl matures, I will periodically consider using
the built-in version instead.
I hope that helps,
carl
Post by Michael Uman
Hello,
This is my first post to the user group... So I hope I can get some
answers...
First of all I would like to thank all the developers for wxWidgets. We
have been using wxWidgets at Sigma since I joined in 2003. We use the
library for our Debugger and have been pleased with it's ease of porting
between Windows and Linux. I build our project for both Windows 7 and
Ubuntu Linux and support other Linux distros (CentOS, Debian)...
But I have been running into issues with the wx3_0_0 wxTreeListCtrl.
Before I upgraded our app to use wx3_0_0 we relied on wx2_8_12 and used a
third-party treelist control. Unfortunately that tree list control doesn't
work in the wx3 environment, and I ported our code to work with the
included wxTreeListCtrl which comes with wx3...
1) On the Linux port the scroll-wheel doesn't scroll the tree list... I
can only scroll with the mousewheel when the mouse is over the scroll-bar.
On the Windows 7 port the scroll wheel works when it is rolled over the
entire tree control area. Is there some way to make the Linux tree control
scroll with the scroll-wheel?
2) The 3rd party tree control we used previously included a member called
*ExpandAll()* but not such member exists in the wx3 tree control. So I
thought I would write some recursive code which would iterate through all
the siblings of the item, expanding each one in the process.... But this
did not work for me. I am currently 'whipping together' an example app
which will demonstrate what I am doing. I hope to be able to attach it to a
follow up on this thread.
Does anyone know anything about what I am asking? If so I would greatly
appreciate your assistance. I hope to be able to contribute something some
day to wxWidgets.
Thank you,
Michael Uman
Sr. Software Engineer
Sigma Designs, Inc.
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
or visit http://groups.google.com/group/wx-users
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Vadim Zeitlin
2014-02-28 22:41:27 UTC
Permalink
On Fri, 28 Feb 2014 11:43:12 -0800 (PST) Michael Uman wrote:

MU> 1) On the Linux port the scroll-wheel doesn't scroll the tree list...

This was an unfortunate bug in 3.0.0 which will be corrected in the
upcoming 3.0.1, it's not actually wxTreeListCtrl-specific.

MU> 2) The 3rd party tree control we used previously included a member called
MU> *ExpandAll()* but not such member exists in the wx3 tree control. So I
MU> thought I would write some recursive code which would iterate through all
MU> the siblings of the item, expanding each one in the process.... But this
MU> did not work for me. I am currently 'whipping together' an example app
MU> which will demonstrate what I am doing. I hope to be able to attach it to a
MU> follow up on this thread.

It would indeed be nice to have ExpandAllChildren(item) and ExpandAll()
(which would, of course, be just ExpandAllChildren(GetRootItem())) in this
class for consistency with wxTreeCtrl. And perhaps we could add them to
wxDataViewCtrl itself too...

AFAICS implementing this should be pretty straightforward, see
wxTreeCtrlBase::ExpandAllChildren() implementation in
src/common/treebase.cpp. If you can make it work, please don't hesitate to
submit it as a patch (see http://trac.wxwidgets.org/wiki/HowToSubmitPatches
if you hadn't this before).

Good luck!
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
Michael Uman
2014-02-28 22:53:42 UTC
Permalink
Post by Vadim Zeitlin
MU> 1) On the Linux port the scroll-wheel doesn't scroll the tree list...
This was an unfortunate bug in 3.0.0 which will be corrected in the
upcoming 3.0.1, it's not actually wxTreeListCtrl-specific.
MU> 2) The 3rd party tree control we used previously included a member called
MU> *ExpandAll()* but not such member exists in the wx3 tree control. So I
MU> thought I would write some recursive code which would iterate through all
MU> the siblings of the item, expanding each one in the process.... But this
MU> did not work for me. I am currently 'whipping together' an example app
MU> which will demonstrate what I am doing. I hope to be able to attach it to a
MU> follow up on this thread.
It would indeed be nice to have ExpandAllChildren(item) and ExpandAll()
(which would, of course, be just ExpandAllChildren(GetRootItem())) in this
class for consistency with wxTreeCtrl. And perhaps we could add them to
wxDataViewCtrl itself too...
AFAICS implementing this should be pretty straightforward, see
wxTreeCtrlBase::ExpandAllChildren() implementation in
src/common/treebase.cpp. If you can make it work, please don't hesitate to
submit it as a patch (see
http://trac.wxwidgets.org/wiki/HowToSubmitPatches
if you hadn't this before).
Good luck!
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
Vadim,

Thank you for your reply. The scroll wheel support would be very helpful.
Most of my users are using the Windows port so they will not be affected
but I prefer to use the Linux port and think that the scroll wheel should
scroll the tree control. I look forward to this feature in the future.

Regarding the Expand/Collapse all... In my test-bench application I was
able to determine that the order of expanding items is relevant. I now
expand the parent BEFORE expanding the children and the tree appears to
expand everything properly. I use a recursive function to iterate through
all the children nodes and used to expand all children first before
expanding the parent.

Thank you,
Michael Uman
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Michael Uman
2014-03-03 21:46:51 UTC
Permalink
Hello,

Ok ... I have resolved the issue related to expand/contract tree list
items... But I discovered another difference between the two ports.

1) On Linux just collapsing a parent item automatically collapses all
children, whereas on Window I must explcitly collapse each child. This
results in a noticeable difference of how expanding/collapsing nodes works
between platforms. I would prefer if both ports worked the same...

2) I also would like to have the scroll-wheel working on the Linux port. Is
this something which will be available on the 3.0 branch soon? I do have a
copy of the git repository and if the change is already in the repo I would
like to test the new feature...

Vadim, is there any advice you can lend me?

Thanks,
Michael Uman
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Vadim Zeitlin
2014-03-04 14:10:12 UTC
Permalink
On Mon, 3 Mar 2014 13:46:51 -0800 (PST) Michael Uman wrote:

MU> Ok ... I have resolved the issue related to expand/contract tree list
MU> items...

Have you considered contributing your CollapseAllChildren() implementation?

MU> But I discovered another difference between the two ports.
MU>
MU> 1) On Linux just collapsing a parent item automatically collapses all
MU> children, whereas on Window I must explcitly collapse each child. This
MU> results in a noticeable difference of how expanding/collapsing nodes works
MU> between platforms. I would prefer if both ports worked the same...

I don't actually see any reason to impose the same UI on the users of
different platforms. Behaviour under GTK must be native (as we're using the
native control and don't override this anywhere AFAICS). Behaviour under
MSW seems consistent with the behaviour of the native controls there too, I
think (even if we don't use one actually).

MU> 2) I also would like to have the scroll-wheel working on the Linux port. Is
MU> this something which will be available on the 3.0 branch soon? I do have a
MU> copy of the git repository and if the change is already in the repo I would
MU> like to test the new feature...
MU>
MU> Vadim, is there any advice you can lend me?

Of course you should test with the latest sources from 3.0 branch. The fix
is there (and since quite some time).

Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
Michael Uman
2014-03-07 02:29:42 UTC
Permalink
Hello,

For reference I have uploaded a project which demonstrates the tree control
behavior.

I used Code::Blocks as my primary IDE on Linux... I also use wxFormBuilder
to generate the layouts for the dialogs and windows in my application.

The attached project includes all C::B and FormBuilder files along with a
'handy' Makefile which can be used to compile the monkey_bars application.

By default the makefile uses the 'wx-config' which is in the path,
otherwise define the symbol WX_CONFIG before running make...

For example:

WX_CONFIG=/opt/wx/3.0.0/bin/wx-config make

This example is capable of loading a tree layout from an XML file... Use
the 'Tree' menu, item 'Load nodes' to load the example 'tree.xml' which
contains a layout of a tree with a depth of three subitems.

I hope that someone finds this example useful.

Thank you,
Michael Uman
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Loading...