Add mouse wheel forwarding code to FrameMain for when focus is on something that doesn't handle scroll events

Originally committed to SVN as r5782.
This commit is contained in:
Thomas Goyne 2011-10-25 19:40:57 +00:00
parent 1741ce93f6
commit 9ed1653aae
2 changed files with 6 additions and 0 deletions

View File

@ -554,6 +554,7 @@ BEGIN_EVENT_TABLE(FrameMain, wxFrame)
EVT_CLOSE(FrameMain::OnCloseWindow)
EVT_KEY_DOWN(FrameMain::OnKeyDown)
EVT_MOUSEWHEEL(FrameMain::OnMouseWheel)
#ifdef __WXMAC__
// EVT_MENU(wxID_ABOUT, FrameMain::OnAbout)
@ -686,3 +687,7 @@ void FrameMain::OnKeyDown(wxKeyEvent &event) {
if (!hotkey::check("Main Frame", context.get(), event.GetKeyCode(), event.GetUnicodeKey(), event.GetModifiers()))
event.Skip();
}
void FrameMain::OnMouseWheel(wxMouseEvent &evt) {
ForwardMouseWheelEvent(this, evt);
}

View File

@ -98,6 +98,7 @@ class FrameMain: public wxFrame {
void UpdateTitle();
void OnKeyDown(wxKeyEvent &event);
void OnMouseWheel(wxMouseEvent &evt);
/// @brief Autosave the currently open file, if any
void OnAutoSave(wxTimerEvent &event);