Page 1 of 1

wxTreeList with NO_HEADER style option

Posted: Mon Nov 19, 2012 1:48 pm
by pkullmann
Hi,

wxTreeList is using wxDataViewCtrl, which allows to not display column headers (wxDV_NO_HEADER style). Unfortunately this style is not available in wxTreeList. Also, it is not possible to simply override wxTreeList::Create, because it uses an internal class, which is not exported. So, I enhanced wxTreeList to support the new style wxTL_NO_HEADER:

Based on 2.9.4:

in include/wx/treelist.h, line 50
add

Code: Select all

wxTL_NO_HEADER      = 0x0010,
in src/generic/treelist.cpp, line 1032
replace with

Code: Select all

	long styleDataView = HasFlag(wxTL_MULTIPLE) ? wxDV_MULTIPLE
                                                : wxDV_SINGLE;
	if ( HasFlag(wxTL_NO_HEADER) )
		styleDataView |= wxDV_NO_HEADER;

	if ( !m_view->Create(this, wxID_ANY,
                        wxPoint(0, 0), GetClientSize(),
								styleDataView) )
Great, if this could be included in wxWidgets in the next version.

Peter

Re: wxTreeList with NO_HEADER style option

Posted: Mon Nov 19, 2012 3:04 pm
by DavidHart
Hi Peter,

Thank you for posting the code.
Great if this could be included in wxWidgets in the next version.
This is a user forum. If you feel this should be in wx itself, you should make a bug-report to trac, attaching a patch made against svn trunk.

Regards,

David

Re: wxTreeList with NO_HEADER style option

Posted: Tue Nov 20, 2012 10:00 am
by pkullmann
If you feel this should be in wx itself, you should make a bug-report to trac, attaching a patch made against svn trunk.
I did that in the meamtime.
The patch has been accepted and will be in 2.9.5