If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
if (s.ToDouble(&n))
{
n *= 2;
CallAfter([=] {
bool ok = ChangePropertyValue(_pProp_2, n ); // This line will be executed and return true, but UI doesn't change.
// wxPropertyGrid::SetPropertyValue works
// wxPGProperty::SetValue works
// But these two doesn't emit change event
wxASSERT(ok);
});
}
The problem occurs if you make a ChangePropertyValue call from inside a EVT_PG_CHANGED event handler. I traced through the code a bit and it seems it uses a single m_inDoPropertyChanged flag to remember if the value has already been changed. This is set by the first ChangePropertyValue call and when the second ChangePropertyValue happens, the value will not be updated because this flag is still true.
if (s.ToDouble(&n))
{
n *= 2;
CallAfter([=] {
bool ok = ChangePropertyValue(_pProp_2, n ); // This line will be executed and return true, but UI doesn't change.
// wxPropertyGrid::SetPropertyValue works
// wxPGProperty::SetValue works
// But these two doesn't emit change event
wxASSERT(ok);
});
}
The problem occurs if you make a ChangePropertyValue call from inside a EVT_PG_CHANGED event handler. I traced through the code a bit and it seems it uses a single m_inDoPropertyChanged flag to remember if the value has already been changed. This is set by the first ChangePropertyValue call and when the second ChangePropertyValue happens, the value will not be updated because this flag is still true.
Yes, I think so, a little complicated.
Thank you very much.
I think I should debug it myself, but my hard disk is not so large now, the wx source code is on another machine, I must buy a large harddisk for open source