Rewrite handling cell value changes in wxOSX/Cocoa wxDVC.

Instead of using a chain of dynamic_cast<>s to find the right type of the
value, construct a wxVariant corresponding to the type of the object we
receive in NSOutlineView:setObjectValue:forTableColumn:byItem and pass it to a
wxDataViewRenderer virtual function.

This fixes assert and allows to edit icon text items under OS X.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62436 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-10-17 01:04:26 +00:00
parent 8e59cbe40c
commit 0599fe19d9
2 changed files with 67 additions and 39 deletions

View File

@@ -82,6 +82,14 @@ public:
void SetNativeData(wxDataViewRendererNativeData* newNativeDataPtr);
#if wxOSX_USE_COCOA
// called when a value was edited by user
virtual void OSXOnCellChanged(const wxVariant& value,
const wxDataViewItem& item,
unsigned col);
#endif // Cocoa
private:
//
// variables
@@ -272,6 +280,13 @@ public:
//
virtual bool MacRender();
#if wxOSX_USE_COCOA
// called when a value was edited by user
virtual void OSXOnCellChanged(const wxVariant& value,
const wxDataViewItem& item,
unsigned col);
#endif // Cocoa
protected:
private:
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewIconTextRenderer)