From f0e867e97cb81ce53c52700a31413b61bca70ce6 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 4 Dec 2011 19:23:42 +0000 Subject: [PATCH] Fix wxDataViewCtrl compilation with 10.7 SDK under OS X. Add the required casts to wxPointerObject. Closes #13661. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69928 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/osx/cocoa/dataview.mm | 24 ++++++++++-------------- src/osx/dataview_osx.cpp | 7 ++++--- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/src/osx/cocoa/dataview.mm b/src/osx/cocoa/dataview.mm index 16ce4c8fab..1df0767668 100644 --- a/src/osx/cocoa/dataview.mm +++ b/src/osx/cocoa/dataview.mm @@ -664,7 +664,7 @@ outlineView:(NSOutlineView*)outlineView wxCHECK_MSG( model, nil, "Valid model in data source does not exist." ); - wxDataViewColumn* col(static_cast([[tableColumn identifier] pointer])); + wxDataViewColumn* col(static_cast([(wxPointerObject*)[tableColumn identifier] pointer])); const unsigned colIdx = col->GetModelColumn(); wxDataViewItem dataViewItem(wxDataViewItemFromItem(item)); @@ -687,7 +687,7 @@ outlineView:(NSOutlineView*)outlineView { wxUnusedVar(outlineView); - wxDataViewColumn* col(static_cast([[tableColumn identifier] pointer])); + wxDataViewColumn* col(static_cast([(wxPointerObject*)[tableColumn identifier] pointer])); col->GetRenderer()-> OSXOnCellChanged(object, wxDataViewItemFromItem(item), col->GetModelColumn()); @@ -1624,7 +1624,7 @@ outlineView:(NSOutlineView*)outlineView // -(void) outlineView:(NSOutlineView*)outlineView mouseDownInHeaderOfTableColumn:(NSTableColumn*)tableColumn { - wxDataViewColumn* const col(static_cast([[tableColumn identifier] pointer])); + wxDataViewColumn* const col(static_cast([(wxPointerObject*)[tableColumn identifier] pointer])); wxDataViewCtrl* const dvc = implementation->GetDataViewCtrl(); @@ -1719,11 +1719,7 @@ outlineView:(NSOutlineView*)outlineView wxDataViewCtrl * const dvc = implementation->GetDataViewCtrl(); wxDataViewModel * const model = dvc->GetModel(); - wxDataViewColumn * const - dvCol(static_cast( - [[tableColumn identifier] pointer] - ) - ); + wxDataViewColumn* const dvCol(static_cast([(wxPointerObject*)[tableColumn identifier] pointer])); const unsigned colIdx = dvCol->GetModelColumn(); wxDataViewItem dvItem(wxDataViewItemFromItem(item)); @@ -1760,7 +1756,7 @@ outlineView:(NSOutlineView*)outlineView { int const newColumnPosition = [[[notification userInfo] objectForKey:@"NSNewColumn"] intValue]; - wxDataViewColumn* const col(static_cast([[[[self tableColumns] objectAtIndex:newColumnPosition] identifier] pointer])); + wxDataViewColumn* const col(static_cast([(wxPointerObject*)[[[self tableColumns] objectAtIndex:newColumnPosition] identifier] pointer])); wxDataViewCtrl* const dvc = implementation->GetDataViewCtrl(); @@ -1829,7 +1825,7 @@ outlineView:(NSOutlineView*)outlineView wxDataViewColumn* const col = static_cast( - [[[[self tableColumns] objectAtIndex:currentlyEditedColumn] identifier] pointer]); + [(wxPointerObject*)[[[self tableColumns] objectAtIndex:currentlyEditedColumn] identifier] pointer]); wxDataViewCtrl* const dvc = implementation->GetDataViewCtrl(); @@ -1867,7 +1863,7 @@ outlineView:(NSOutlineView*)outlineView { wxDataViewColumn* const col = static_cast( - [[[[self tableColumns] objectAtIndex:currentlyEditedColumn] identifier] pointer]); + [(wxPointerObject*)[[[self tableColumns] objectAtIndex:currentlyEditedColumn] identifier] pointer]); wxDataViewCtrl* const dvc = implementation->GetDataViewCtrl(); @@ -1979,7 +1975,7 @@ void wxCocoaDataViewControl::DoSetExpanderColumn(const wxDataViewColumn *columnP wxDataViewColumn* wxCocoaDataViewControl::GetColumn(unsigned int pos) const { - return static_cast([[[[m_OutlineView tableColumns] objectAtIndex:pos] identifier] pointer]); + return static_cast([(wxPointerObject*)[[[m_OutlineView tableColumns] objectAtIndex:pos] identifier] pointer]); } int wxCocoaDataViewControl::GetColumnPosition(const wxDataViewColumn *columnPtr) const @@ -2328,7 +2324,7 @@ wxDataViewColumn* wxCocoaDataViewControl::GetSortingColumn() const for (UInt32 i=0; i([[[columns objectAtIndex:i] identifier] pointer]); + return static_cast([(wxPointerObject*)[[columns objectAtIndex:i] identifier] pointer]); return NULL; } @@ -2363,7 +2359,7 @@ void wxCocoaDataViewControl::HitTest(const wxPoint& point, wxDataViewItem& item, indexRow = [m_OutlineView rowAtPoint: nativePoint]; if ((indexColumn >= 0) && (indexRow >= 0)) { - columnPtr = static_cast([[[[m_OutlineView tableColumns] objectAtIndex:indexColumn] identifier] pointer]); + columnPtr = static_cast([(wxPointerObject*)[[[m_OutlineView tableColumns] objectAtIndex:indexColumn] identifier] pointer]); item = wxDataViewItem([[m_OutlineView itemAtRow:indexRow] pointer]); } else diff --git a/src/osx/dataview_osx.cpp b/src/osx/dataview_osx.cpp index 490f6d9fd7..bc82df964a 100644 --- a/src/osx/dataview_osx.cpp +++ b/src/osx/dataview_osx.cpp @@ -20,6 +20,9 @@ #include "wx/dcclient.h" #include "wx/icon.h" #endif +#if wxOSX_USE_CARBON +#include "wx/osx/carbon/dataview.h" +#endif #include "wx/osx/core/dataview.h" #include "wx/osx/private.h" @@ -706,11 +709,10 @@ void wxDataViewCtrl::OnMouse(wxMouseEvent& event) { event.Skip(); +#if wxOSX_USE_CARBON if (GetModel() == NULL) return; -#if 0 - // Doesn't compile anymore wxMacDataViewDataBrowserListViewControlPointer MacDataViewListCtrlPtr(dynamic_cast(m_peer)); int NoOfChildren; @@ -750,7 +752,6 @@ void wxDataViewCtrl::OnMouse(wxMouseEvent& event) } } - SetCursor( *wxSTANDARD_CURSOR ); #endif }