From dec97dfa65a1d4cb27fe166e07a4783746127327 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Va=CC=81clav=20Slavi=CC=81k?= Date: Thu, 6 Oct 2016 17:33:49 +0200 Subject: [PATCH] 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. --- src/osx/cocoa/dataview.mm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/osx/cocoa/dataview.mm b/src/osx/cocoa/dataview.mm index 427945316c..ce010ba232 100644 --- a/src/osx/cocoa/dataview.mm +++ b/src/osx/cocoa/dataview.mm @@ -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(tableColumn) getColumnPointer]); + [outlineView setAllowsColumnReordering:col->IsReorderable()]; +} + -(BOOL) outlineView:(NSOutlineView*)outlineView shouldCollapseItem:(id)item { wxUnusedVar(outlineView);