From 9534c0039b9d708c7c0ab961f74c1b14f3bfec4c Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Fri, 16 May 2008 12:49:35 +0000 Subject: [PATCH] [ 1965257 ] wxMac implementation of wxDataViewColumn::SetResizeable() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53605 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/dataview.cpp | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/src/mac/carbon/dataview.cpp b/src/mac/carbon/dataview.cpp index 99b593cdb9..0dda1609bc 100644 --- a/src/mac/carbon/dataview.cpp +++ b/src/mac/carbon/dataview.cpp @@ -867,8 +867,39 @@ void wxDataViewColumn::SetReorderable(bool reorderable) } /* if */ } /* wxDataViewColumn::SetReorderable(bool) */ -void wxDataViewColumn::SetResizeable(bool WXUNUSED(resizeable)) +void wxDataViewColumn::SetResizeable(bool resizeable) { + // first set the internal flag of the column: + if (resizeable) + this->m_flags |= wxDATAVIEW_COL_RESIZABLE; + else + this->m_flags &= ~wxDATAVIEW_COL_RESIZABLE; + // if the column is associated with a control change also immediately the flags of the control: + wxDataViewCtrl* dataViewCtrlPtr(this->GetOwner()); // variable definition and initialization + + if (dataViewCtrlPtr != NULL) + { + // variable definition and initialization: + wxMacDataViewDataBrowserListViewControlPointer macDataViewListCtrlPtr(dynamic_cast(dataViewCtrlPtr->GetPeer())); + + if (macDataViewListCtrlPtr != NULL) + { + // variable definition and initialization: + DataBrowserListViewHeaderDesc headerDescription; + + verify_noerr(macDataViewListCtrlPtr->GetHeaderDesc(this->GetPropertyID(),&headerDescription)); + if (resizeable) { + headerDescription.minimumWidth = 0; + headerDescription.maximumWidth = 30000; + } + else { + headerDescription.minimumWidth = this->m_width; + headerDescription.maximumWidth = this->m_width; + } + verify_noerr(macDataViewListCtrlPtr->SetHeaderDesc(this->GetPropertyID(),&headerDescription)); + macDataViewListCtrlPtr->SetSortProperty(this->GetPropertyID()); + } /* if */ + } /* if */ } /* wxDataViewColumn::SetResizeable(bool) */ void wxDataViewColumn::SetSortable(bool sortable) -- 2.45.2