X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2c1e8f2ec2400f618468e72f2faf32373f53a4c9..2d956b58023a4955313a1c1531bc70a0deb0b831:/src/os2/button.cpp diff --git a/src/os2/button.cpp b/src/os2/button.cpp index 33634d0a7a..133a6f6cd5 100644 --- a/src/os2/button.cpp +++ b/src/os2/button.cpp @@ -71,14 +71,6 @@ bool wxButton::Create( // if (m_windowStyle & wxCLIP_SIBLINGS ) lStyle |= WS_CLIPSIBLINGS; - // - // If the parent is a scrolled window the controls must - // have this style or they will overlap the scrollbars - // - if (pParent) - if (pParent->IsKindOf(CLASSINFO(wxScrolledWindow)) || - pParent->IsKindOf(CLASSINFO(wxGenericScrolledWindow))) - lStyle |= WS_CLIPSIBLINGS; m_hWnd = (WXHWND)::WinCreateWindow( GetHwndOf(pParent) // Parent handle ,WC_BUTTON // A Button class window @@ -113,6 +105,7 @@ bool wxButton::Create( ,rSize.x ,rSize.y ); + delete pButtonFont; return TRUE; } // end of wxButton::Create @@ -325,7 +318,28 @@ void wxButton::MakeOwnerDrawn() lStyle |= BS_USERBUTTON; ::WinSetWindowULong(GetHwnd(), QWL_STYLE, lStyle); } -} // end of wxCButton::MakeOwnerDrawn +} // end of wxButton::MakeOwnerDrawn + +WXDWORD wxButton::OS2GetStyle( + long lStyle +, WXDWORD* pdwExstyle +) const +{ + // + // Buttons never have an external border, they draw their own one + // + WXDWORD dwStyle = wxControl::OS2GetStyle( (lStyle & ~wxBORDER_MASK) | wxBORDER_NONE + ,pdwExstyle + ); + + // + // We must use WS_CLIPSIBLINGS with the buttons or they would draw over + // each other in any resizeable dialog which has more than one button in + // the bottom + // + dwStyle |= WS_CLIPSIBLINGS; + return dwStyle; +} // end of wxButton::OS2GetStyle MRESULT wxButton::WindowProc( WXUINT uMsg @@ -369,5 +383,5 @@ MRESULT wxButton::WindowProc( ,wParam ,lParam )); -} // end of wxW indowProc +} // end of wxWindowProc