]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/carbon/dataview.cpp
no existing on iphone
[wxWidgets.git] / src / osx / carbon / dataview.cpp
index 38f94678c90de7cc61f7ead5f7abb5203681f6d9..f64e35c4307a77ea3ca9d8e91953125348e3afa5 100644 (file)
@@ -1318,8 +1318,7 @@ OSStatus wxMacDataViewDataBrowserListViewControl::DataBrowserGetSetItemDataProc(
                // variable definition and initialization:
                 wxVariant modifiedData(true);
 
-                if (dataViewCtrlPtr->GetModel()->SetValue(modifiedData, dvItem, col) &&
-                    dataViewCtrlPtr->GetModel()->ValueChanged(dvItem, col))
+                if (dataViewCtrlPtr->GetModel()->ChangeValue(modifiedData, dvItem, col))
                     return noErr;
                 else
                     return errDataBrowserInvalidPropertyData;
@@ -1329,8 +1328,7 @@ OSStatus wxMacDataViewDataBrowserListViewControl::DataBrowserGetSetItemDataProc(
                // variable definition and initialization:
                 wxVariant modifiedData(false);
 
-                if (dataViewCtrlPtr->GetModel()->SetValue(modifiedData, dvItem, col) &&
-                    dataViewCtrlPtr->GetModel()->ValueChanged(dvItem, col))
+                if (dataViewCtrlPtr->GetModel()->ChangeValue(modifiedData, dvItem, col))
                     return noErr;
                 else
                     return errDataBrowserInvalidPropertyData;
@@ -1357,8 +1355,7 @@ OSStatus wxMacDataViewDataBrowserListViewControl::DataBrowserGetSetItemDataProc(
 #endif
               wxVariant           modifiedData(modifiedString.AsString());
 
-                if (dataViewCtrlPtr->GetModel()->SetValue(modifiedData, dvItem, col) &&
-                    dataViewCtrlPtr->GetModel()->ValueChanged(dvItem, col))
+                if (dataViewCtrlPtr->GetModel()->ChangeValue(modifiedData, dvItem, col))
                     return noErr;
                 else
                     return errDataBrowserInvalidPropertyData;
@@ -1704,7 +1701,7 @@ wxMacDataViewDataBrowserListViewControl::DataBrowserDrawItemProc(DataBrowserItem
   {
       // make sure that 'Render' can draw only in the allowed area:
       dc->SetClippingRegion(content.left,content.top,content.right-content.left+1,content.bottom-content.top+1);
-      (void) (dataViewCustomRendererPtr->Render( cellrect, dc,
+      (void) (dataViewCustomRendererPtr->WXCallRender( cellrect, dc,
                                             ((state == kDataBrowserItemIsSelected) ? wxDATAVIEW_CELL_SELECTED : 0)));
       dc->DestroyClippingRegion(); // probably not necessary
   }
@@ -2286,14 +2283,11 @@ wxEllipsizeMode wxDataViewRenderer::GetEllipsizeMode() const
         return wxELLIPSIZE_NONE;
     if ( flags & kDataBrowserTruncateTextAtStart )
         return wxELLIPSIZE_START;
-    if ( flags & kDataBrowserTruncateTextMiddle )
-        return wxELLIPSIZE_MIDDLE;
     if ( flags & kDataBrowserTruncateTextAtEnd )
         return wxELLIPSIZE_END;
 
-    wxFAIL_MSG( "unknown flags" );
-
-    return wxELLIPSIZE_NONE;
+    // kDataBrowserTruncateTextMiddle == 0 so there is no need to test for it
+    return wxELLIPSIZE_MIDDLE;
 }
 
 void wxDataViewRenderer::SetNativeData(wxDataViewRendererNativeData* newNativeDataPtr)
@@ -2308,7 +2302,9 @@ IMPLEMENT_ABSTRACT_CLASS(wxDataViewRenderer,wxDataViewRendererBase)
 // wxDataViewCustomRenderer
 // ---------------------------------------------------------
 wxDataViewCustomRenderer::wxDataViewCustomRenderer(wxString const& varianttype, wxDataViewCellMode mode, int align)
-                         :wxDataViewRenderer(varianttype,mode,align), m_editorCtrlPtr(NULL), m_DCPtr(NULL)
+                         :wxDataViewCustomRendererBase(varianttype,mode,align),
+                          m_editorCtrlPtr(NULL),
+                          m_DCPtr(NULL)
 {
   SetNativeData(new wxDataViewRendererNativeData(kDataBrowserCustomType));
 }
@@ -2479,6 +2475,13 @@ wxDataViewColumn::~wxDataViewColumn()
   delete m_NativeDataPtr;
 }
 
+int wxDataViewColumn::GetWidth() const
+{
+    // FIXME: This returns the last programatically set width and will not work if
+    //        the user changes the column's width by dragging it with the mouse.
+    return m_width;
+}
+
 bool wxDataViewColumn::IsSortKey() const
 {
     wxDataViewCtrl * const dataViewCtrlPtr(GetOwner());