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." );
wxDataViewColumn* col(static_cast<wxDataViewColumn*>([[tableColumn identifier] pointer]));
wxDataViewColumn* col(static_cast<wxDataViewColumn*>([(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<wxDataViewColumn*>([[tableColumn identifier] pointer]));
wxDataViewColumn* col(static_cast<wxDataViewColumn*>([(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<wxDataViewColumn*>([[tableColumn identifier] pointer]));
wxDataViewColumn* const col(static_cast<wxDataViewColumn*>([(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<wxDataViewColumn*>(
[[tableColumn identifier] pointer]
)
);
wxDataViewColumn* const dvCol(static_cast<wxDataViewColumn*>([(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<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();
@ -1829,7 +1825,7 @@ outlineView:(NSOutlineView*)outlineView
wxDataViewColumn* const col =
static_cast<wxDataViewColumn*>(
[[[[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<wxDataViewColumn*>(
[[[[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<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
@ -2328,7 +2324,7 @@ wxDataViewColumn* wxCocoaDataViewControl::GetSortingColumn() const
for (UInt32 i=0; i<noOfColumns; ++i)
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;
}
@ -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<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]);
}
else

View File

@ -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<wxMacDataViewDataBrowserListViewControlPointer>(m_peer));
int NoOfChildren;
@ -750,7 +752,6 @@ void wxDataViewCtrl::OnMouse(wxMouseEvent& event)
}
}
SetCursor( *wxSTANDARD_CURSOR );
#endif
}