+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 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
+, WXWPARAM wParam
+, WXLPARAM lParam
+)
+{
+ //
+ // When we receive focus, we want to become the default button in our
+ // parent panel
+ //
+ if (uMsg == WM_SETFOCUS)
+ {
+ SetDefault();
+
+ //
+ // 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
+ //
+ }