OS X: Implement support wxCOL_REORDERABLE

wxDataViewCtrl were always reorderable in wxOSX, regardless of the
presence of wxCOL_REORDERABLE. Fix in the code to respect per-column
flag in a somewhat hacky, but recommended by Apple, way of making this
setting, which is normally global for the entire control, apply to
individual columns.
This commit is contained in:
Václav Slavík
2016-10-06 17:33:49 +02:00
parent 71aa152af2
commit dec97dfa65

View File

@@ -1697,6 +1697,15 @@ outlineView:(NSOutlineView*)outlineView
}
}
-(void) outlineView:(NSOutlineView *)outlineView mouseDownInHeaderOfTableColumn:(NSTableColumn *)tableColumn
{
// Implements per-column reordering in NSTableView per Apple's Q&A:
// https://developer.apple.com/library/content/qa/qa1503/_index.html
wxDataViewColumn* const
col([static_cast<wxDVCNSTableColumn*>(tableColumn) getColumnPointer]);
[outlineView setAllowsColumnReordering:col->IsReorderable()];
}
-(BOOL) outlineView:(NSOutlineView*)outlineView shouldCollapseItem:(id)item
{
wxUnusedVar(outlineView);