Add wxDataViewModel::ChangeValue() and use it in wxDVC implementation.
ChangeValue() is a trivial wrapper calling both SetValue() and ValueChanged(). It allows to replace many calls to SetValue() immediately followed by ValueChanged() with a single function call which is significantly shorter and less error-prone (e.g. most of the existing code didn't test SetValue() return code at all). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62489 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -933,10 +933,7 @@ bool wxDataViewToggleRenderer::Activate( wxRect WXUNUSED(cell),
|
||||
wxDataViewModel *model,
|
||||
const wxDataViewItem & item, unsigned int col)
|
||||
{
|
||||
bool value = !m_toggle;
|
||||
wxVariant variant = value;
|
||||
model->SetValue( variant, item, col);
|
||||
model->ValueChanged( item, col );
|
||||
model->ChangeValue(!m_toggle, item, col);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1051,10 +1048,7 @@ END_EVENT_TABLE()
|
||||
|
||||
void wxDataViewDateRendererPopupTransient::OnCalendar( wxCalendarEvent &event )
|
||||
{
|
||||
wxDateTime date = event.GetDate();
|
||||
wxVariant value = date;
|
||||
m_model->SetValue( value, m_item, m_col );
|
||||
m_model->ValueChanged( m_item, m_col );
|
||||
m_model->ChangeValue( event.GetDate(), m_item, m_col );
|
||||
DismissAndNotify();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user