+void wxWindowOS2::SetWindowStyleFlag(
+ long lFlags
+)
+{
+ long lFlagsOld = GetWindowStyleFlag();
+
+ if (lFlags == lFlagsOld)
+ return;
+
+ //
+ // Update the internal variable
+ //
+ wxWindowBase::SetWindowStyleFlag(lFlags);
+
+ //
+ // Now update the Windows style as well if needed - and if the window had
+ // been already created
+ //
+ if (!GetHwnd())
+ return;
+
+ WXDWORD dwExstyle;
+ WXDWORD dwExstyleOld;
+ long lStyle = OS2GetStyle( lFlags
+ ,&dwExstyle
+ );
+ long lStyleOld = OS2GetStyle( lFlagsOld
+ ,&dwExstyleOld
+ );
+
+ if (lStyle != lStyleOld)
+ {
+ //
+ // Some flags (e.g. WS_VISIBLE or WS_DISABLED) should not be changed by
+ // this function so instead of simply setting the style to the new
+ // value we clear the bits which were set in styleOld but are set in
+ // the new one and set the ones which were not set before
+ //
+ long lStyleReal = ::WinQueryWindowULong(GetHwnd(), QWL_STYLE);
+
+ lStyleReal &= ~lStyleOld;
+ lStyleReal |= lStyle;
+
+ ::WinSetWindowULong(GetHwnd(), QWL_STYLE, lStyleReal);
+ }
+} // end of wxWindowOS2::SetWindowStyleFlag
+
+WXDWORD wxWindowOS2::OS2GetStyle(
+ long lFlags
+, WXDWORD* pdwExstyle
+) const
+{
+ WXDWORD dwStyle = 0L;
+
+ if (lFlags & wxCLIP_CHILDREN )
+ dwStyle |= WS_CLIPCHILDREN;
+
+ if (lFlags & wxCLIP_SIBLINGS )
+ dwStyle |= WS_CLIPSIBLINGS;
+
+ return dwStyle;
+} // end of wxWindowMSW::MSWGetStyle
+