From c71b5269df66a01e30332d19015b35bd55d3787f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 19 Nov 2012 18:07:55 +0000 Subject: [PATCH] Add wxTL_NO_HEADER style to wxTreeListCtrl. Closes #14838. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72990 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 1 + include/wx/treelist.h | 3 ++- interface/wx/treelist.h | 9 +++++++++ src/generic/treelist.cpp | 10 +++++++--- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 3f18f58fce..f1dbd24a42 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -593,6 +593,7 @@ All (GUI): - Added wxEVT_COMMAND_DIRCTRL_CHANGED event (troelsk). - Added wxControl::GetSizeFromTextSize() (Manuel Martin). - Optionally allow showing tooltips for disabled ribbon buttons (wxBen). +- Add wxTL_NO_HEADER style to wxTreeListCtrl (robboto). wxGTK: diff --git a/include/wx/treelist.h b/include/wx/treelist.h index 081ecb09ca..382be23b3a 100644 --- a/include/wx/treelist.h +++ b/include/wx/treelist.h @@ -3,7 +3,7 @@ // Purpose: wxTreeListCtrl class declaration. // Author: Vadim Zeitlin // Created: 2011-08-17 -// RCS-ID: $Id: wxhead.h,v 1.12 2010-04-22 12:44:51 zeitlin Exp $ +// RCS-ID: $Id$ // Copyright: (c) 2011 Vadim Zeitlin // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// @@ -47,6 +47,7 @@ enum wxTL_CHECKBOX = 0x0002, // Show checkboxes in the first column. wxTL_3STATE = 0x0004, // Allow 3rd state in checkboxes. wxTL_USER_3STATE = 0x0008, // Allow user to set 3rd state. + wxTL_NO_HEADER = 0x0010, // Column titles not visible. wxTL_DEFAULT_STYLE = wxTL_SINGLE, wxTL_STYLE_MASK = wxTL_SINGLE | diff --git a/interface/wx/treelist.h b/interface/wx/treelist.h index 21649a5f71..f170e793f7 100644 --- a/interface/wx/treelist.h +++ b/interface/wx/treelist.h @@ -21,6 +21,15 @@ enum wxTL_CHECKBOX = 0x0002, /// Show checkboxes in the first column. wxTL_3STATE = 0x0004, /// Allow 3rd state in checkboxes. wxTL_USER_3STATE = 0x0008, /// Allow user to set 3rd state. + /** + Don't show the column headers. + + By default this control shows the column headers, using this class + allows to avoid this and show only the data. + + @since 2.9.5 + */ + wxTL_NO_HEADER = 0x0010, wxTL_DEFAULT_STYLE = wxTL_SINGLE, wxTL_STYLE_MASK = wxTL_SINGLE | diff --git a/src/generic/treelist.cpp b/src/generic/treelist.cpp index 18cb193d18..ff07cd4222 100644 --- a/src/generic/treelist.cpp +++ b/src/generic/treelist.cpp @@ -3,7 +3,7 @@ // Purpose: Generic wxTreeListCtrl implementation. // Author: Vadim Zeitlin // Created: 2011-08-19 -// RCS-ID: $Id: wxhead.cpp,v 1.11 2010-04-22 12:44:51 zeitlin Exp $ +// RCS-ID: $Id$ // Copyright: (c) 2011 Vadim Zeitlin // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// @@ -1029,10 +1029,14 @@ bool wxTreeListCtrl::Create(wxWindow* parent, } m_view = new wxDataViewCtrl; + 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(), - HasFlag(wxTL_MULTIPLE) ? wxDV_MULTIPLE - : wxDV_SINGLE) ) + styleDataView) ) { delete m_view; m_view = NULL; -- 2.47.2