+void wxButton::MakeOwnerDrawn()
+{
+ long lStyle = 0L;
+
+ lStyle = ::WinQueryWindowULong(GetHwnd(), QWL_STYLE);
+ if ((lStyle & BS_USERBUTTON) != BS_USERBUTTON)
+ {
+ //
+ // Make it so
+ //
+ lStyle |= BS_USERBUTTON;
+ ::WinSetWindowULong(GetHwnd(), QWL_STYLE, lStyle);
+ }
+} // 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 resizable dialog which has more than one button in
+ // the bottom
+ //
+ dwStyle |= WS_CLIPSIBLINGS;
+ return dwStyle;
+} // end of wxButton::OS2GetStyle
+
+MRESULT wxButton::WindowProc( WXUINT uMsg,
+ WXWPARAM wParam,
+ WXLPARAM lParam )
+{
+ //
+ // When we receive focus, we want to temporary become the default button in
+ // our parent panel so that pressing "Enter" would activate us -- and when
+ // losing it we should restore the previous default button as well
+ //
+ if (uMsg == WM_SETFOCUS)
+ {
+ if (SHORT1FROMMP(lParam) == TRUE)
+ SetTmpDefault();
+ else
+ UnsetTmpDefault();
+
+ //
+ // Let the default processign take place too
+ //
+ }
+
+ else if (uMsg == WM_BUTTON1DBLCLK)
+ {
+ //
+ // Emulate a click event to force an owner-drawn button to change its
+ // appearance - without this, it won't do it
+ //
+ (void)wxControl::OS2WindowProc( WM_BUTTON1DOWN
+ ,wParam
+ ,lParam
+ );
+
+ //
+ // And conitnue with processing the message normally as well
+ //
+ }