X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/de6185e212ebc37ff11ff70278e3c4f68419b097..507abc7b3af8d73e7caf05261d1f40b51775ae7a:/src/common/event.cpp diff --git a/src/common/event.cpp b/src/common/event.cpp index 9debc5b90a..a22b1b0407 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -30,23 +30,18 @@ #include "wx/list.h" #include "wx/app.h" #include "wx/utils.h" + #include "wx/stopwatch.h" #if wxUSE_GUI #include "wx/control.h" #include "wx/dc.h" #include "wx/textctrl.h" + #include "wx/validate.h" #endif // wxUSE_GUI #endif #include "wx/module.h" -#if wxUSE_GUI - #include "wx/validate.h" -#if wxUSE_STOPWATCH - #include "wx/stopwatch.h" -#endif -#endif // wxUSE_GUI - // ---------------------------------------------------------------------------- // wxWin macros // ---------------------------------------------------------------------------- @@ -92,6 +87,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxHelpEvent, wxCommandEvent) IMPLEMENT_DYNAMIC_CLASS(wxContextMenuEvent, wxCommandEvent) IMPLEMENT_DYNAMIC_CLASS(wxMouseCaptureChangedEvent, wxEvent) + IMPLEMENT_DYNAMIC_CLASS(wxClipboardTextEvent, wxCommandEvent) #endif // wxUSE_GUI #if wxUSE_BASE @@ -288,6 +284,11 @@ DEFINE_EVENT_TYPE(wxEVT_COMPARE_ITEM) DEFINE_EVENT_TYPE(wxEVT_INIT_DIALOG) DEFINE_EVENT_TYPE(wxEVT_UPDATE_UI) +// Clipboard events +DEFINE_EVENT_TYPE(wxEVT_COMMAND_TEXT_COPY) +DEFINE_EVENT_TYPE(wxEVT_COMMAND_TEXT_CUT) +DEFINE_EVENT_TYPE(wxEVT_COMMAND_TEXT_PASTE) + // Generic command events // Note: a click is a higher-level event than button down/up DEFINE_EVENT_TYPE(wxEVT_COMMAND_LEFT_CLICK) @@ -762,6 +763,23 @@ wxChildFocusEvent::wxChildFocusEvent(wxWindow *win) SetEventObject(win); } +// ---------------------------------------------------------------------------- +// wxHelpEvent +// ---------------------------------------------------------------------------- + +/* static */ +wxHelpEvent::Origin wxHelpEvent::GuessOrigin(Origin origin) +{ + if ( origin == Origin_Unknown ) + { + // assume that the event comes from the help button if it's not from + // keyboard and that pressing F1 always results in the help event + origin = wxGetKeyState(WXK_F1) ? Origin_Keyboard : Origin_HelpButton; + } + + return origin; +} + #endif // wxUSE_GUI