Merge multi-touch gestures event branch

This is a squashed commit of the SOC2017_GESTURES branch from
https://github.com/prashantkn94/wxWidgets.git

Closes https://github.com/wxWidgets/wxWidgets/pull/551
This commit is contained in:
prashantkn94
2017-09-10 21:13:32 +05:30
committed by Vadim Zeitlin
parent aef4edb969
commit 261b04b5a3
21 changed files with 2318 additions and 10 deletions

View File

@@ -35,6 +35,7 @@
#include <wx/statline.h>
#include <wx/log.h>
#include "gestures.h"
// ----------------------------------------------------------------------------
// event constants
@@ -144,6 +145,9 @@ public:
void OnClickDynamicHandlerButton(wxCommandEvent& event);
void OnClickStaticHandlerFrame(wxCommandEvent& event);
// Gesture
void OnGesture(wxCommandEvent& event);
private:
// symbolic names for the status bar fields
enum
@@ -178,6 +182,8 @@ private:
// the button used to highlight the event handlers execution order
MyEvtTestButton *m_testBtn;
MyGestureFrame *m_gestureFrame;
// any class wishing to process wxWidgets events must use this macro
wxDECLARE_EVENT_TABLE();
@@ -220,7 +226,8 @@ enum
Event_Push,
Event_Pop,
Event_Custom,
Event_Test
Event_Test,
Event_Gesture
};
// ----------------------------------------------------------------------------
@@ -252,6 +259,7 @@ wxBEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_MENU(Event_Test, MyFrame::OnTest)
EVT_MENU(Event_Push, MyFrame::OnPushEventHandler)
EVT_MENU(Event_Pop, MyFrame::OnPopEventHandler)
EVT_MENU(Event_Gesture, MyFrame::OnGesture)
EVT_UPDATE_UI(Event_Pop, MyFrame::OnUpdateUIPop)
@@ -290,6 +298,8 @@ bool MyApp::OnInit()
if ( !wxApp::OnInit() )
return false;
wxImage::AddHandler(new wxJPEGHandler);
// create the main application window
MyFrame *frame = new MyFrame(wxT("Event wxWidgets Sample"),
wxPoint(50, 50), wxSize(600, 340));
@@ -381,6 +391,8 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
menuEvent->AppendSeparator();
menuEvent->Append(Event_Custom, wxT("Fire c&ustom event\tCtrl-U"),
wxT("Generate a custom event"));
menuEvent->Append(Event_Gesture, wxT("&Gesture events\tCtrl-G"),
wxT("Gesture event"));
// now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar();
@@ -577,6 +589,12 @@ void MyFrame::OnPopEventHandler(wxCommandEvent& WXUNUSED(event))
#endif // wxUSE_STATUSBAR
}
void MyFrame::OnGesture(wxCommandEvent& WXUNUSED(event))
{
m_gestureFrame = new MyGestureFrame();
m_gestureFrame->Show(true);
}
void MyFrame::OnTest(wxCommandEvent& WXUNUSED(event))
{
wxLogMessage(wxT("This is the test event handler in the main frame"));
@@ -602,4 +620,3 @@ void MyFrame::OnProcessCustom(wxCommandEvent& WXUNUSED(event))
{
wxLogMessage(wxT("Got a custom event!"));
}