X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/84006e65e80116a91514523b9d15344d4bbcbf4a..897b24cf5ca5ca41734c79f7092104921e0c8cae:/include/wx/event.h diff --git a/include/wx/event.h b/include/wx/event.h index 939e8fce1e..54ac43c70d 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -504,14 +504,6 @@ private: }; #endif -#ifdef __VISUALC__ - // 'this' : used in base member initializer list (for m_commandString) - #if _MSC_VER > 1100 - #pragma warning(push) - #endif - #pragma warning(disable:4355) -#endif - class WXDLLIMPEXP_CORE wxCommandEvent : public wxEvent { public: @@ -574,10 +566,6 @@ private: DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxCommandEvent) }; -#if defined(__VISUALC__) && (_MSC_VER > 1100) - #pragma warning(pop) -#endif - #if WXWIN_COMPATIBILITY_2_4 inline void wxCommandEventStringHelper::operator=(const wxString &str) { @@ -947,11 +935,22 @@ public: wxKeyEvent(wxEventType keyType = wxEVT_NULL); wxKeyEvent(const wxKeyEvent& evt); + // can be used check if the key event has exactly the given modifiers: + // "GetModifiers() = wxMOD_CONTROL" is easier to write than "ControlDown() + // && !MetaDown() && !AltDown() && !ShiftDown()" + int GetModifiers() const + { + return (m_controlDown ? wxMOD_CONTROL : 0) | + (m_shiftDown ? wxMOD_SHIFT : 0) | + (m_metaDown ? wxMOD_META : 0) | + (m_altDown ? wxMOD_ALT : 0); + } + // Find state of shift/control keys bool ControlDown() const { return m_controlDown; } + bool ShiftDown() const { return m_shiftDown; } bool MetaDown() const { return m_metaDown; } bool AltDown() const { return m_altDown; } - bool ShiftDown() const { return m_shiftDown; } // "Cmd" is a pseudo key which is Control for PC and Unix platforms but // Apple ("Command") key under Macs: it makes often sense to use it instead @@ -1041,10 +1040,13 @@ public: long m_keyCode; + // TODO: replace those with a single m_modifiers bitmask of wxMOD_XXX? bool m_controlDown; bool m_shiftDown; bool m_altDown; bool m_metaDown; + + // FIXME: what is this for? relation to m_rawXXX? bool m_scanCode; #if wxUSE_UNICODE @@ -2901,7 +2903,7 @@ extern WXDLLIMPEXP_BASE wxList *wxPendingEvents; // Find a window with the focus, that is also a descendant of the given window. // This is used to determine the window to initially send commands to. -wxWindow* wxFindFocusDescendant(wxWindow* ancestor); +WXDLLIMPEXP_CORE wxWindow* wxFindFocusDescendant(wxWindow* ancestor); #endif // wxUSE_GUI