X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c8b431ad4b0edd1afcd18d61314cc39e3dc0e9e9..d5cbee178f213c1bae361abca0113646bf323584:/include/wx/msw/private.h diff --git a/include/wx/msw/private.h b/include/wx/msw/private.h index 729fde3434..da4b7e83ca 100644 --- a/include/wx/msw/private.h +++ b/include/wx/msw/private.h @@ -23,9 +23,9 @@ #include "wx/log.h" -class WXDLLEXPORT wxFont; -class WXDLLEXPORT wxWindow; -class WXDLLEXPORT wxWindowBase; +class WXDLLIMPEXP_FWD_CORE wxFont; +class WXDLLIMPEXP_FWD_CORE wxWindow; +class WXDLLIMPEXP_FWD_CORE wxWindowBase; // --------------------------------------------------------------------------- // private constants @@ -311,21 +311,32 @@ HCURSOR wxBitmapToHCURSOR(const wxBitmap& bmp, int hotSpotX, int hotSpotY); #define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp)) #endif // GET_X_LPARAM -// get the current state of SHIFT/CTRL keys -inline bool wxIsShiftDown() +// get the current state of SHIFT/CTRL/ALT keys +inline bool wxIsModifierDown(int vk) { -// return (::GetKeyState(VK_SHIFT) & 0x100) != 0; - // Returns different negative values on WinME and WinNT, + // GetKeyState() returns different negative values on WinME and WinNT, // so simply test for negative value. - return ::GetKeyState(VK_SHIFT) < 0; + return ::GetKeyState(vk) < 0; +} + +inline bool wxIsShiftDown() +{ + return wxIsModifierDown(VK_SHIFT); } inline bool wxIsCtrlDown() { -// return (::GetKeyState(VK_CONTROL) & 0x100) != 0; - // Returns different negative values on WinME and WinNT, - // so simply test for negative value. - return ::GetKeyState(VK_CONTROL) < 0; + return wxIsModifierDown(VK_CONTROL); +} + +inline bool wxIsAltDown() +{ + return wxIsModifierDown(VK_MENU); +} + +inline bool wxIsAnyModifierDown() +{ + return wxIsShiftDown() || wxIsCtrlDown() || wxIsAltDown(); } // wrapper around GetWindowRect() and GetClientRect() APIs doing error checking @@ -692,7 +703,7 @@ public: { if ( IsRegistered() ) { - if ( !::UnregisterClass(m_clsname, wxhInstance) ) + if ( !::UnregisterClass(m_clsname.wx_str(), wxhInstance) ) { wxLogLastError(_T("UnregisterClass")); } @@ -824,7 +835,7 @@ enum wxWinVersion wxWinVersion_2003 = 0x0502, wxWinVersion_6 = 0x0600, - wxWinVersion_Vista = wxWinVersion_6 + wxWinVersion_Vista = wxWinVersion_6, wxWinVersion_NT6 = wxWinVersion_6 };