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
This commit is contained in:
parent
53524ca073
commit
17792930dc
@ -680,6 +680,10 @@ OSStatus wxMacDataViewDataBrowserListViewControl::DataBrowserGetSetItemDataProc(
|
|||||||
wxCHECK_MSG(dataViewCtrlPtr->GetModel() != NULL,errDataBrowserNotConfigured,_("Pointer to model not set correctly."));
|
wxCHECK_MSG(dataViewCtrlPtr->GetModel() != NULL,errDataBrowserNotConfigured,_("Pointer to model not set correctly."));
|
||||||
dataViewColumnPtr = dataViewCtrlPtr->GetColumnPtr(propertyID);
|
dataViewColumnPtr = dataViewCtrlPtr->GetColumnPtr(propertyID);
|
||||||
wxCHECK_MSG((dataViewColumnPtr != NULL) && (dataViewColumnPtr->GetRenderer() != NULL),errDataBrowserNotConfigured,_("There is no column or renderer for the specified column index."));
|
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())
|
switch (dataViewColumnPtr->GetRenderer()->GetPropertyType())
|
||||||
{
|
{
|
||||||
case kDataBrowserCheckboxType:
|
case kDataBrowserCheckboxType:
|
||||||
@ -695,14 +699,26 @@ OSStatus wxMacDataViewDataBrowserListViewControl::DataBrowserGetSetItemDataProc(
|
|||||||
// variable definition and initialization:
|
// variable definition and initialization:
|
||||||
wxVariant modifiedData(true);
|
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 */
|
} /* if */
|
||||||
else if (buttonValue == kThemeButtonOff)
|
else if (buttonValue == kThemeButtonOff)
|
||||||
{
|
{
|
||||||
// variable definition and initialization:
|
// variable definition and initialization:
|
||||||
wxVariant modifiedData(false);
|
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 */
|
} /* if */
|
||||||
else
|
else
|
||||||
return errDataBrowserInvalidPropertyData;
|
return errDataBrowserInvalidPropertyData;
|
||||||
@ -726,8 +742,11 @@ OSStatus wxMacDataViewDataBrowserListViewControl::DataBrowserGetSetItemDataProc(
|
|||||||
#endif
|
#endif
|
||||||
wxVariant modifiedData(modifiedString.AsString());
|
wxVariant modifiedData(modifiedString.AsString());
|
||||||
|
|
||||||
if (dataViewCtrlPtr->GetModel()->SetValue(modifiedData,wxDataViewItem(reinterpret_cast<void*>(itemID)),dataViewColumnPtr->GetModelColumn()))
|
if (dataViewCtrlPtr->GetModel()->SetValue(modifiedData, dvItem, col))
|
||||||
|
{
|
||||||
|
dataViewCtrlPtr->GetModel()->ValueChanged(dvItem, col);
|
||||||
return noErr;
|
return noErr;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
return errDataBrowserNotConfigured;
|
return errDataBrowserNotConfigured;
|
||||||
} /* if */
|
} /* if */
|
||||||
|
Loading…
Reference in New Issue
Block a user