From a9c98d7dd3a089e47a14369dcaf30a5e983079d5 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Wed, 16 Jan 2008 11:34:56 +0000 Subject: [PATCH 1/1] Sort of autoresize if only 1 column is there git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51243 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/dataview.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/mac/carbon/dataview.cpp b/src/mac/carbon/dataview.cpp index e54cc745f7..0d334b6d73 100644 --- a/src/mac/carbon/dataview.cpp +++ b/src/mac/carbon/dataview.cpp @@ -992,6 +992,8 @@ bool wxDataViewCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, ::SetDataBrowserTableViewHiliteStyle( this->m_peer->GetControlRef(), kDataBrowserTableViewFillHilite ); + ::SetDataBrowserTableViewGeometry( this->m_peer->GetControlRef(), true, false ); + return true; } /* wxDataViewCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator) */ @@ -1456,6 +1458,19 @@ void wxDataViewCtrl::OnSize(wxSizeEvent& event) dataViewCustomRendererPtr->SetDC(NULL); // reset DC because DC has changed } /* if */ } /* for */ + + wxMacDataViewDataBrowserListViewControlPointer MacDataViewListCtrlPtr(dynamic_cast(this->m_peer)); + ControlRef ref = MacDataViewListCtrlPtr->GetControlRef(); + if (NoOfColumns == 1) + { + ::SetDataBrowserHasScrollBars( ref, false, true ); + ::AutoSizeDataBrowserListViewColumns( ref ); + } + if (NoOfColumns > 1) + { + ::SetDataBrowserHasScrollBars( ref, true, true ); + } + event.Skip(); } /* wxDataViewCtrl::OnSize(wxSizeEvent&) */ -- 2.45.2