X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/debe6624c1e9d4bf3243381153d1e173c849bcd8..803bf1c5818154dbff797029441c7de0d85339d5:/src/msw/button.cpp diff --git a/src/msw/button.cpp b/src/msw/button.cpp index 13f671d53b..2d2d82f1ab 100644 --- a/src/msw/button.cpp +++ b/src/msw/button.cpp @@ -36,7 +36,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxButton, wxControl) bool wxButton::MSWCommand(WXUINT param, WXWORD id) { - if (param == BN_CLICKED) + if (param == BN_CLICKED || (param == 1)) // 1 for accelerator { wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, id); event.SetEventObject(this); @@ -106,6 +106,8 @@ void wxButton::SetSize(int x, int y, int width, int height, int sizeFlags) if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) y1 = currentY; + AdjustForParentClientOrigin(x1, y1, sizeFlags); + int actualWidth = width; int actualHeight = height; int ww, hh; @@ -147,8 +149,10 @@ void wxButton::SetDefault(void) if (parent) { - SendMessage((HWND) parent->GetHWND(), DM_SETDEFID, m_windowId, 0L); + SendMessage((HWND)parent->GetHWND(), DM_SETDEFID, m_windowId, 0L); } + + SendMessage((HWND)GetHWND(), BM_SETSTYLE, BS_DEFPUSHBUTTON, 1L); } wxString wxButton::GetLabel(void) const