mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-08-17 17:02:51 +08:00
Make it possible to easily see the events generated by (double) clicking various mouse buttons. Co-authored-by: Vadim Zeitlin <vadim@wxwidgets.org>
75 lines
1.6 KiB
C++
75 lines
1.6 KiB
C++
#ifndef _WX_GESTURES_H_
|
|
#define _WX_GESTURES_H_
|
|
|
|
#include "wx/wx.h"
|
|
|
|
class MyGestureFrame : public wxFrame
|
|
{
|
|
public:
|
|
MyGestureFrame();
|
|
|
|
void OnGesture(wxGestureEvent& event);
|
|
void OnQuit(wxCloseEvent& event);
|
|
|
|
private:
|
|
wxLog *m_logOld;
|
|
wxTextCtrl *m_logText;
|
|
};
|
|
|
|
class MyGesturePanel : public wxPanel
|
|
{
|
|
public:
|
|
MyGesturePanel(MyGestureFrame* parent);
|
|
|
|
void OnPaint(wxPaintEvent& event);
|
|
void OnPan(wxPanGestureEvent& event);
|
|
void OnZoom(wxZoomGestureEvent& event);
|
|
void OnRotate(wxRotateGestureEvent& event);
|
|
void OnTwoFingerTap(wxTwoFingerTapEvent& event);
|
|
void OnLongPress(wxLongPressEvent& event);
|
|
void OnPressAndTap(wxPressAndTapEvent& event);
|
|
|
|
private:
|
|
wxBitmap m_bitmap;
|
|
wxPoint2DDouble m_translateDistance;
|
|
wxAffineMatrix2D m_affineMatrix;
|
|
double m_lastZoomFactor;
|
|
double m_lastRotationAngle;
|
|
wxPoint m_lastGesturePos;
|
|
};
|
|
|
|
class MyMouseFrame : public wxFrame
|
|
{
|
|
public:
|
|
MyMouseFrame();
|
|
|
|
void OnQuit(wxCloseEvent& event);
|
|
|
|
private:
|
|
wxLog *m_logOld;
|
|
wxTextCtrl *m_logText;
|
|
};
|
|
|
|
class MyMousePanel : public wxPanel
|
|
{
|
|
public:
|
|
MyMousePanel(MyMouseFrame* parent);
|
|
|
|
private:
|
|
void DoLogMouseEvent(const wxMouseEvent& event, const wxString& eventName);
|
|
|
|
void OnLeftDown(wxMouseEvent& event);
|
|
void OnLeftUp(wxMouseEvent& event);
|
|
void OnRightDown(wxMouseEvent& event);
|
|
void OnRightUp(wxMouseEvent& event);
|
|
void OnLeftDClick(wxMouseEvent& event);
|
|
void OnRightDClick(wxMouseEvent& event);
|
|
void OnEnter(wxMouseEvent& event);
|
|
void OnLeave(wxMouseEvent& event);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _WX_GESTURES_H_
|