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
This commit is contained in:
Vadim Zeitlin 2011-12-04 19:23:42 +00:00
parent b54a0e3913
commit f0e867e97c
2 changed files with 14 additions and 17 deletions

View File

@ -664,7 +664,7 @@ outlineView:(NSOutlineView*)outlineView
wxCHECK_MSG( model, nil, "Valid model in data source does not exist." ); wxCHECK_MSG( model, nil, "Valid model in data source does not exist." );
wxDataViewColumn* col(static_cast<wxDataViewColumn*>([[tableColumn identifier] pointer])); wxDataViewColumn* col(static_cast<wxDataViewColumn*>([(wxPointerObject*)[tableColumn identifier] pointer]));
const unsigned colIdx = col->GetModelColumn(); const unsigned colIdx = col->GetModelColumn();
wxDataViewItem dataViewItem(wxDataViewItemFromItem(item)); wxDataViewItem dataViewItem(wxDataViewItemFromItem(item));
@ -687,7 +687,7 @@ outlineView:(NSOutlineView*)outlineView
{ {
wxUnusedVar(outlineView); wxUnusedVar(outlineView);
wxDataViewColumn* col(static_cast<wxDataViewColumn*>([[tableColumn identifier] pointer])); wxDataViewColumn* col(static_cast<wxDataViewColumn*>([(wxPointerObject*)[tableColumn identifier] pointer]));
col->GetRenderer()-> col->GetRenderer()->
OSXOnCellChanged(object, wxDataViewItemFromItem(item), col->GetModelColumn()); OSXOnCellChanged(object, wxDataViewItemFromItem(item), col->GetModelColumn());
@ -1624,7 +1624,7 @@ outlineView:(NSOutlineView*)outlineView
// //
-(void) outlineView:(NSOutlineView*)outlineView mouseDownInHeaderOfTableColumn:(NSTableColumn*)tableColumn -(void) outlineView:(NSOutlineView*)outlineView mouseDownInHeaderOfTableColumn:(NSTableColumn*)tableColumn
{ {
wxDataViewColumn* const col(static_cast<wxDataViewColumn*>([[tableColumn identifier] pointer])); wxDataViewColumn* const col(static_cast<wxDataViewColumn*>([(wxPointerObject*)[tableColumn identifier] pointer]));
wxDataViewCtrl* const dvc = implementation->GetDataViewCtrl(); wxDataViewCtrl* const dvc = implementation->GetDataViewCtrl();
@ -1719,11 +1719,7 @@ outlineView:(NSOutlineView*)outlineView
wxDataViewCtrl * const dvc = implementation->GetDataViewCtrl(); wxDataViewCtrl * const dvc = implementation->GetDataViewCtrl();
wxDataViewModel * const model = dvc->GetModel(); wxDataViewModel * const model = dvc->GetModel();
wxDataViewColumn * const wxDataViewColumn* const dvCol(static_cast<wxDataViewColumn*>([(wxPointerObject*)[tableColumn identifier] pointer]));
dvCol(static_cast<wxDataViewColumn*>(
[[tableColumn identifier] pointer]
)
);
const unsigned colIdx = dvCol->GetModelColumn(); const unsigned colIdx = dvCol->GetModelColumn();
wxDataViewItem dvItem(wxDataViewItemFromItem(item)); wxDataViewItem dvItem(wxDataViewItemFromItem(item));
@ -1760,7 +1756,7 @@ outlineView:(NSOutlineView*)outlineView
{ {
int const newColumnPosition = [[[notification userInfo] objectForKey:@"NSNewColumn"] intValue]; int const newColumnPosition = [[[notification userInfo] objectForKey:@"NSNewColumn"] intValue];
wxDataViewColumn* const col(static_cast<wxDataViewColumn*>([[[[self tableColumns] objectAtIndex:newColumnPosition] identifier] pointer])); wxDataViewColumn* const col(static_cast<wxDataViewColumn*>([(wxPointerObject*)[[[self tableColumns] objectAtIndex:newColumnPosition] identifier] pointer]));
wxDataViewCtrl* const dvc = implementation->GetDataViewCtrl(); wxDataViewCtrl* const dvc = implementation->GetDataViewCtrl();
@ -1829,7 +1825,7 @@ outlineView:(NSOutlineView*)outlineView
wxDataViewColumn* const col = wxDataViewColumn* const col =
static_cast<wxDataViewColumn*>( static_cast<wxDataViewColumn*>(
[[[[self tableColumns] objectAtIndex:currentlyEditedColumn] identifier] pointer]); [(wxPointerObject*)[[[self tableColumns] objectAtIndex:currentlyEditedColumn] identifier] pointer]);
wxDataViewCtrl* const dvc = implementation->GetDataViewCtrl(); wxDataViewCtrl* const dvc = implementation->GetDataViewCtrl();
@ -1867,7 +1863,7 @@ outlineView:(NSOutlineView*)outlineView
{ {
wxDataViewColumn* const col = wxDataViewColumn* const col =
static_cast<wxDataViewColumn*>( static_cast<wxDataViewColumn*>(
[[[[self tableColumns] objectAtIndex:currentlyEditedColumn] identifier] pointer]); [(wxPointerObject*)[[[self tableColumns] objectAtIndex:currentlyEditedColumn] identifier] pointer]);
wxDataViewCtrl* const dvc = implementation->GetDataViewCtrl(); wxDataViewCtrl* const dvc = implementation->GetDataViewCtrl();
@ -1979,7 +1975,7 @@ void wxCocoaDataViewControl::DoSetExpanderColumn(const wxDataViewColumn *columnP
wxDataViewColumn* wxCocoaDataViewControl::GetColumn(unsigned int pos) const wxDataViewColumn* wxCocoaDataViewControl::GetColumn(unsigned int pos) const
{ {
return static_cast<wxDataViewColumn*>([[[[m_OutlineView tableColumns] objectAtIndex:pos] identifier] pointer]); return static_cast<wxDataViewColumn*>([(wxPointerObject*)[[[m_OutlineView tableColumns] objectAtIndex:pos] identifier] pointer]);
} }
int wxCocoaDataViewControl::GetColumnPosition(const wxDataViewColumn *columnPtr) const int wxCocoaDataViewControl::GetColumnPosition(const wxDataViewColumn *columnPtr) const
@ -2328,7 +2324,7 @@ wxDataViewColumn* wxCocoaDataViewControl::GetSortingColumn() const
for (UInt32 i=0; i<noOfColumns; ++i) for (UInt32 i=0; i<noOfColumns; ++i)
if ([[columns objectAtIndex:i] sortDescriptorPrototype] != nil) if ([[columns objectAtIndex:i] sortDescriptorPrototype] != nil)
return static_cast<wxDataViewColumn*>([[[columns objectAtIndex:i] identifier] pointer]); return static_cast<wxDataViewColumn*>([(wxPointerObject*)[[columns objectAtIndex:i] identifier] pointer]);
return NULL; return NULL;
} }
@ -2363,7 +2359,7 @@ void wxCocoaDataViewControl::HitTest(const wxPoint& point, wxDataViewItem& item,
indexRow = [m_OutlineView rowAtPoint: nativePoint]; indexRow = [m_OutlineView rowAtPoint: nativePoint];
if ((indexColumn >= 0) && (indexRow >= 0)) if ((indexColumn >= 0) && (indexRow >= 0))
{ {
columnPtr = static_cast<wxDataViewColumn*>([[[[m_OutlineView tableColumns] objectAtIndex:indexColumn] identifier] pointer]); columnPtr = static_cast<wxDataViewColumn*>([(wxPointerObject*)[[[m_OutlineView tableColumns] objectAtIndex:indexColumn] identifier] pointer]);
item = wxDataViewItem([[m_OutlineView itemAtRow:indexRow] pointer]); item = wxDataViewItem([[m_OutlineView itemAtRow:indexRow] pointer]);
} }
else else

View File

@ -20,6 +20,9 @@
#include "wx/dcclient.h" #include "wx/dcclient.h"
#include "wx/icon.h" #include "wx/icon.h"
#endif #endif
#if wxOSX_USE_CARBON
#include "wx/osx/carbon/dataview.h"
#endif
#include "wx/osx/core/dataview.h" #include "wx/osx/core/dataview.h"
#include "wx/osx/private.h" #include "wx/osx/private.h"
@ -706,11 +709,10 @@ void wxDataViewCtrl::OnMouse(wxMouseEvent& event)
{ {
event.Skip(); event.Skip();
#if wxOSX_USE_CARBON
if (GetModel() == NULL) if (GetModel() == NULL)
return; return;
#if 0
// Doesn't compile anymore
wxMacDataViewDataBrowserListViewControlPointer MacDataViewListCtrlPtr(dynamic_cast<wxMacDataViewDataBrowserListViewControlPointer>(m_peer)); wxMacDataViewDataBrowserListViewControlPointer MacDataViewListCtrlPtr(dynamic_cast<wxMacDataViewDataBrowserListViewControlPointer>(m_peer));
int NoOfChildren; int NoOfChildren;
@ -750,7 +752,6 @@ void wxDataViewCtrl::OnMouse(wxMouseEvent& event)
} }
} }
SetCursor( *wxSTANDARD_CURSOR ); SetCursor( *wxSTANDARD_CURSOR );
#endif #endif
} }