Resize col to fill entire client area if only 1 col.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50453 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
68ca12fef6
commit
9c150d5f5c
@ -1559,6 +1559,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxDataViewTreeCtrl,wxDataViewCtrl)
|
|||||||
BEGIN_EVENT_TABLE(wxDataViewTreeCtrl,wxDataViewCtrl)
|
BEGIN_EVENT_TABLE(wxDataViewTreeCtrl,wxDataViewCtrl)
|
||||||
EVT_DATAVIEW_ITEM_EXPANDED(-1, wxDataViewTreeCtrl::OnExpanded)
|
EVT_DATAVIEW_ITEM_EXPANDED(-1, wxDataViewTreeCtrl::OnExpanded)
|
||||||
EVT_DATAVIEW_ITEM_COLLAPSED(-1, wxDataViewTreeCtrl::OnCollapsed)
|
EVT_DATAVIEW_ITEM_COLLAPSED(-1, wxDataViewTreeCtrl::OnCollapsed)
|
||||||
|
EVT_SIZE( wxDataViewTreeCtrl::OnSize )
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
wxDataViewTreeCtrl::wxDataViewTreeCtrl()
|
wxDataViewTreeCtrl::wxDataViewTreeCtrl()
|
||||||
@ -1575,7 +1576,13 @@ wxDataViewTreeCtrl::wxDataViewTreeCtrl( wxWindow *parent, wxWindowID id,
|
|||||||
wxDataViewTreeStore *store = new wxDataViewTreeStore;
|
wxDataViewTreeStore *store = new wxDataViewTreeStore;
|
||||||
AssociateModel( store );
|
AssociateModel( store );
|
||||||
store->DecRef();
|
store->DecRef();
|
||||||
AppendIconTextColumn( "", 0, wxDATAVIEW_CELL_INERT, 200 );
|
|
||||||
|
wxDataViewColumn *col = AppendIconTextColumn( "", 0, wxDATAVIEW_CELL_INERT, 40 );
|
||||||
|
|
||||||
|
#if !defined(__WXGTK20__)
|
||||||
|
wxSize cient_size = GetClientSize();
|
||||||
|
col->SetWidth( size.x );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
wxDataViewTreeCtrl::~wxDataViewTreeCtrl()
|
wxDataViewTreeCtrl::~wxDataViewTreeCtrl()
|
||||||
@ -1670,7 +1677,6 @@ wxDataViewItem wxDataViewTreeCtrl::InsertContainer( const wxDataViewItem& parent
|
|||||||
return GetStore()->InsertContainer( parent, previous, text, icon, expanded, data );
|
return GetStore()->InsertContainer( parent, previous, text, icon, expanded, data );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void wxDataViewTreeCtrl::OnExpanded( wxDataViewEvent &event )
|
void wxDataViewTreeCtrl::OnExpanded( wxDataViewEvent &event )
|
||||||
{
|
{
|
||||||
if (m_imageList) return;
|
if (m_imageList) return;
|
||||||
@ -1696,6 +1702,9 @@ void wxDataViewTreeCtrl::OnCollapsed( wxDataViewEvent &event )
|
|||||||
void wxDataViewTreeCtrl::OnSize( wxSizeEvent &WXUNUSED(event) )
|
void wxDataViewTreeCtrl::OnSize( wxSizeEvent &WXUNUSED(event) )
|
||||||
{
|
{
|
||||||
#if !defined(__WXGTK20__)
|
#if !defined(__WXGTK20__)
|
||||||
|
wxSize size = GetClientSize();
|
||||||
|
wxDataViewColumn *col = GetColumn( 0 );
|
||||||
|
col->SetWidth( size.x );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user