From 17792930dcd84e8bdc946481953193cf3cc8fe63 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 3 Apr 2008 06:43:36 +0000 Subject: [PATCH] Call ValueChanged after SetValue so other views will be updated git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52990 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/databrow.cpp | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/src/mac/carbon/databrow.cpp b/src/mac/carbon/databrow.cpp index a4485f8bc5..5118740c29 100644 --- a/src/mac/carbon/databrow.cpp +++ b/src/mac/carbon/databrow.cpp @@ -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(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(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(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(itemID)),dataViewColumnPtr->GetModelColumn())) - return noErr; + + if (dataViewCtrlPtr->GetModel()->SetValue(modifiedData, dvItem, col)) + { + dataViewCtrlPtr->GetModel()->ValueChanged(dvItem, col); + return noErr; + } else return errDataBrowserNotConfigured; } /* if */ -- 2.45.2