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:
@@ -38,6 +38,7 @@
|
||||
#include "wx/msw/wrapcctl.h"
|
||||
#include "wx/msw/private.h"
|
||||
#include "wx/msw/private/customdraw.h"
|
||||
#include "wx/msw/private/winstyle.h"
|
||||
|
||||
#ifndef HDM_SETBITMAPMARGIN
|
||||
#define HDM_SETBITMAPMARGIN 0x1234
|
||||
@@ -402,12 +403,8 @@ void wxHeaderCtrl::DoInsertItem(const wxHeaderColumn& col, unsigned int idx)
|
||||
}
|
||||
}
|
||||
|
||||
long controlStyle = ::GetWindowLong(GetHwnd(), GWL_STYLE);
|
||||
if ( hasResizableColumns )
|
||||
controlStyle &= ~HDS_NOSIZING;
|
||||
else
|
||||
controlStyle |= HDS_NOSIZING;
|
||||
::SetWindowLong(GetHwnd(), GWL_STYLE, controlStyle);
|
||||
wxMSWWinStyleUpdater(GetHwnd())
|
||||
.TurnOnOrOff(!hasResizableColumns, HDS_NOSIZING);
|
||||
}
|
||||
|
||||
void wxHeaderCtrl::DoSetColumnsOrder(const wxArrayInt& order)
|
||||
|
Reference in New Issue
Block a user