Simplify changing window styles in wxMSW code

Add wxMSWWinStyleUpdater and wxMSWWinExStyleUpdater helper classes which
allow writing code changing GWL_STYLE and GWL_EXSTYLE bits,
respectively, in a shorter and more clear way.

There should be no real changes in behaviour.
This commit is contained in:
Vadim Zeitlin
2017-12-09 23:47:05 +01:00
parent 588ae3744c
commit 17105cfd07
17 changed files with 206 additions and 131 deletions

View File

@@ -978,19 +978,9 @@ inline bool wxStyleHasBorder(long style)
wxSUNKEN_BORDER | wxDOUBLE_BORDER)) != 0;
}
inline long wxGetWindowExStyle(const wxWindowMSW *win)
{
return ::GetWindowLong(GetHwndOf(win), GWL_EXSTYLE);
}
inline bool wxHasWindowExStyle(const wxWindowMSW *win, long style)
{
return (wxGetWindowExStyle(win) & style) != 0;
}
inline long wxSetWindowExStyle(const wxWindowMSW *win, long style)
{
return ::SetWindowLong(GetHwndOf(win), GWL_EXSTYLE, style);
return (::GetWindowLong(GetHwndOf(win), GWL_EXSTYLE) & style) != 0;
}
// Common helper of wxUpdate{,Edit}LayoutDirection() below: sets or clears the