Fix setting style flags in wxListCtrl (wxMSW)
UpdateStyle() function was introduced inedccf428
to synchronize in SetWindowStyleFlag() style of the control with new style flags just stored in m_windowStyle. In9a8d75f1
, storing directly a new flags in m_windowStyle was replaced by the call to parent's SetWindowStyleFlag(). Because call to parent's SetWindowStyleFlag() updates both m_windowStyle and actual style of the control for common flags (WS_*, LVS_* flags), synchronizing the control again with UpdateStyles() is pointless (since this function does nothing in this context). Only wxSCROLL style flags need special care because wxListCtrl doesn't have these styles but the control itself may have them. In order to preserve them in the call to SetWindowStyleFlag(), we can do the trick and request the same new scroll style as the actual physical style. UpdateStyles() is useless now and can be deprecated. See #17059.
This commit is contained in:
@@ -346,8 +346,11 @@ public:
|
||||
virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) wxOVERRIDE;
|
||||
virtual bool MSWShouldPreProcessMessage(WXMSG* msg) wxOVERRIDE;
|
||||
|
||||
#if WXWIN_COMPATIBILITY_3_0
|
||||
// bring the control in sync with current m_windowStyle value
|
||||
wxDEPRECATED_MSG("useless and will be removed in the future, use SetWindowStyleFlag() instead")
|
||||
void UpdateStyle();
|
||||
#endif // WXWIN_COMPATIBILITY_3_0
|
||||
|
||||
// Event handlers
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
Reference in New Issue
Block a user