]> git.saurik.com Git - wxWidgets.git/commitdiff
Call ValueChanged after SetValue so other views will be updated
authorRobin Dunn <robin@alldunn.com>
Thu, 3 Apr 2008 06:43:36 +0000 (06:43 +0000)
committerRobin Dunn <robin@alldunn.com>
Thu, 3 Apr 2008 06:43:36 +0000 (06:43 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52990 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/databrow.cpp

index a4485f8bc5a0c514014e9dc14dacbe3fa1e81e60..5118740c2900c83f00787f550b27c9fba1ba303d 100644 (file)
@@ -680,6 +680,10 @@ OSStatus wxMacDataViewDataBrowserListViewControl::DataBrowserGetSetItemDataProc(
       wxCHECK_MSG(dataViewCtrlPtr->GetModel() != NULL,errDataBrowserNotConfigured,_("Pointer to model not set correctly."));
       dataViewColumnPtr = dataViewCtrlPtr->GetColumnPtr(propertyID);
       wxCHECK_MSG((dataViewColumnPtr != NULL) && (dataViewColumnPtr->GetRenderer() != NULL),errDataBrowserNotConfigured,_("There is no column or renderer for the specified column index."));
+
+      wxDataViewItem      dvItem(reinterpret_cast<void*>(itemID));
+      unsigned int        col = dataViewColumnPtr->GetModelColumn();
+            
       switch (dataViewColumnPtr->GetRenderer()->GetPropertyType())
       {
         case kDataBrowserCheckboxType:
@@ -695,14 +699,26 @@ OSStatus wxMacDataViewDataBrowserListViewControl::DataBrowserGetSetItemDataProc(
                // variable definition and initialization:
                 wxVariant modifiedData(true);
 
-                return (dataViewCtrlPtr->GetModel()->SetValue(modifiedData,wxDataViewItem(reinterpret_cast<void*>(itemID)),dataViewColumnPtr->GetModelColumn()) ? OSStatus(noErr) : OSStatus(errDataBrowserNotConfigured));
+                if (dataViewCtrlPtr->GetModel()->SetValue(modifiedData, dvItem, col))
+                {
+                    dataViewCtrlPtr->GetModel()->ValueChanged(dvItem, col);
+                    return noErr;
+                }
+                else
+                    return errDataBrowserNotConfigured;
               } /* if */
               else if (buttonValue == kThemeButtonOff)
               {
                // variable definition and initialization:
                 wxVariant modifiedData(false);
 
-                return (dataViewCtrlPtr->GetModel()->SetValue(modifiedData,wxDataViewItem(reinterpret_cast<void*>(itemID)),dataViewColumnPtr->GetModelColumn()) ? OSStatus(noErr) : OSStatus(errDataBrowserNotConfigured));
+                if (dataViewCtrlPtr->GetModel()->SetValue(modifiedData, dvItem, col))
+                {
+                    dataViewCtrlPtr->GetModel()->ValueChanged(dvItem, col);
+                    return noErr;
+                }
+                else
+                    return errDataBrowserNotConfigured;
               } /* if */
               else
                 return errDataBrowserInvalidPropertyData;
@@ -725,9 +741,12 @@ OSStatus wxMacDataViewDataBrowserListViewControl::DataBrowserGetSetItemDataProc(
               wxMacCFStringHolder modifiedString(stringReference);
 #endif
               wxVariant           modifiedData(modifiedString.AsString());
-
-              if (dataViewCtrlPtr->GetModel()->SetValue(modifiedData,wxDataViewItem(reinterpret_cast<void*>(itemID)),dataViewColumnPtr->GetModelColumn()))
-                return noErr;
+              
+              if (dataViewCtrlPtr->GetModel()->SetValue(modifiedData, dvItem, col))
+              {
+                  dataViewCtrlPtr->GetModel()->ValueChanged(dvItem, col);
+                  return noErr;
+              }
               else
                 return errDataBrowserNotConfigured;
             } /* if */