From: Vadim Zeitlin Date: Sun, 29 Jul 2007 13:16:32 +0000 (+0000) Subject: no changes, just removed unnecessary #ifdef __WIN32__ X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/c4e1d0fc473f5213a2ea68a5eaa305f0a7164094 no changes, just removed unnecessary #ifdef __WIN32__ git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47814 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/button.cpp b/src/msw/button.cpp index 95f1ba1fa6..01ebb8539b 100644 --- a/src/msw/button.cpp +++ b/src/msw/button.cpp @@ -161,16 +161,14 @@ bool wxButton::Create(wxWindow *parent, wxString label(lbl); if (label.empty() && wxIsStockID(id)) { - // On Windows, some buttons aren't supposed to have - // mnemonics, so strip them out. - - label = wxGetStockLabel(id -#if defined(__WXMSW__) || defined(__WXWINCE__) - , ( id != wxID_OK && - id != wxID_CANCEL && - id != wxID_CLOSE ) -#endif - ); + // On Windows, some buttons aren't supposed to have mnemonics + label = wxGetStockLabel + ( + id, + id == wxID_OK || id == wxID_CANCEL || id == wxID_CLOSE + ? wxSTOCK_NOFLAGS + : wxSTOCK_WITH_MNEMONIC + ); } if ( !CreateControl(parent, id, pos, size, style, validator, name) ) @@ -179,7 +177,6 @@ bool wxButton::Create(wxWindow *parent, WXDWORD exstyle; WXDWORD msStyle = MSWGetStyle(style, &exstyle); -#ifdef __WIN32__ // if the label contains several lines we must explicitly tell the button // about it or it wouldn't draw it correctly ("\n"s would just appear as // black boxes) @@ -191,7 +188,6 @@ bool wxButton::Create(wxWindow *parent, { msStyle |= BS_MULTILINE; } -#endif // __WIN32__ return MSWCreateControl(_T("BUTTON"), msStyle, pos, size, label, exstyle); } @@ -222,7 +218,6 @@ WXDWORD wxButton::MSWGetStyle(long style, WXDWORD *exstyle) const // the bottom msStyle |= WS_CLIPSIBLINGS; -#ifdef __WIN32__ // don't use "else if" here: weird as it is, but you may combine wxBU_LEFT // and wxBU_RIGHT to get BS_CENTER! if ( style & wxBU_LEFT ) @@ -238,7 +233,6 @@ WXDWORD wxButton::MSWGetStyle(long style, WXDWORD *exstyle) const if ( style & wxNO_BORDER ) msStyle |= BS_FLAT; #endif // __WXWINCE__ -#endif // __WIN32__ return msStyle; } @@ -553,8 +547,6 @@ WXLRESULT wxButton::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) // owner-drawn buttons support // ---------------------------------------------------------------------------- -#ifdef __WIN32__ - // drawing helpers static void DrawButtonText(HDC hdc, @@ -877,6 +869,4 @@ bool wxButton::MSWOnDraw(WXDRAWITEMSTRUCT *wxdis) return true; } -#endif // __WIN32__ - #endif // wxUSE_BUTTON