Return the real column width from wxOSX wxDataViewColumn::GetWidth().
Code used to return the last programmatically set width value instead of the real column width which could have been changed by user if the column was resizeable, fix this by returning the current NSTableColumn:width value. Closes #11397. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62516 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -258,6 +258,7 @@ NSTableColumn* CreateNativeColumn(const wxDataViewColumn *column)
|
||||
);
|
||||
|
||||
// setting the size related parameters:
|
||||
const int width = column->GetWidthVariable();
|
||||
if (column->IsResizeable())
|
||||
{
|
||||
[nativeColumn setResizingMask:NSTableColumnUserResizingMask];
|
||||
@@ -267,10 +268,10 @@ NSTableColumn* CreateNativeColumn(const wxDataViewColumn *column)
|
||||
else
|
||||
{
|
||||
[nativeColumn setResizingMask:NSTableColumnNoResizing];
|
||||
[nativeColumn setMinWidth:column->GetWidth()];
|
||||
[nativeColumn setMaxWidth:column->GetWidth()];
|
||||
[nativeColumn setMinWidth:width];
|
||||
[nativeColumn setMaxWidth:width];
|
||||
}
|
||||
[nativeColumn setWidth:column->GetWidth()];
|
||||
[nativeColumn setWidth:width];
|
||||
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
|
||||
// setting the visibility:
|
||||
@@ -2773,6 +2774,11 @@ wxDataViewColumn::~wxDataViewColumn()
|
||||
delete m_NativeDataPtr;
|
||||
}
|
||||
|
||||
int wxDataViewColumn::GetWidth() const
|
||||
{
|
||||
return [m_NativeDataPtr->GetNativeColumnPtr() width];
|
||||
}
|
||||
|
||||
bool wxDataViewColumn::IsSortKey() const
|
||||
{
|
||||
NSTableColumn *nsCol = GetNativeData()->GetNativeColumnPtr();
|
||||
|
Reference in New Issue
Block a user