2019-01-25 05:49:10 +08:00
|
|
|
#ifndef TEST_USER_INTERACTION_H
|
|
|
|
#define TEST_USER_INTERACTION_H
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
#include "jkqtplotter/jkqtplotter.h"
|
2019-06-20 22:06:31 +08:00
|
|
|
#include "jkqtplotter/graphs/jkqtpscatter.h"
|
2019-01-25 05:49:10 +08:00
|
|
|
#include <QFormLayout>
|
|
|
|
#include <QCheckBox>
|
|
|
|
#include <QComboBox>
|
|
|
|
#include <cmath>
|
|
|
|
#include <QToolBar>
|
|
|
|
#include <QMainWindow>
|
|
|
|
#include <QHBoxLayout>
|
|
|
|
|
|
|
|
class TestUserInteraction : public QMainWindow
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit TestUserInteraction(QWidget *parent = nullptr);
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
|
|
|
public slots:
|
2022-05-15 20:15:15 +08:00
|
|
|
void setMouseMoveAction(int index);
|
2019-01-27 03:12:54 +08:00
|
|
|
void setLeftMouseAction(int index);
|
2019-01-28 06:24:12 +08:00
|
|
|
void setLeftCtrlMouseAction(int index);
|
|
|
|
void setRightMouseAction(int index);
|
2019-01-27 05:22:46 +08:00
|
|
|
void setPlotMagnification(int index);
|
2019-05-01 18:46:17 +08:00
|
|
|
void setContextMenuMode(int index);
|
2019-01-29 00:05:03 +08:00
|
|
|
void setLeftDoubleClickMouseAction(int index);
|
|
|
|
void setRightDoubleClickMouseAction(int index);
|
|
|
|
void setMouseWheelNoModAction(int index);
|
2019-05-06 01:31:20 +08:00
|
|
|
void setUserActionMarkerType(int index);
|
|
|
|
void setUserActionMarkerColor(int index);
|
|
|
|
void setUserActionOverlayColor(int index);
|
|
|
|
void setUserActionOverlayFillColor(int index);
|
|
|
|
void setUserActionOpaqueColor(int index);
|
|
|
|
void setUserActionOpaqueFillColor(int index);
|
2019-01-25 05:49:10 +08:00
|
|
|
|
2019-01-27 03:12:54 +08:00
|
|
|
void plotMouseMove(double x, double y);
|
|
|
|
void plotMouseClicked(double x, double y, Qt::KeyboardModifiers modifiers, Qt::MouseButton button);
|
|
|
|
void plotMouseDoubleClicked(double x, double y, Qt::KeyboardModifiers modifiers, Qt::MouseButton button);
|
|
|
|
void plotNewZoomRectangle(double mouseDragRectXStart, double mouseDragRectXEnd, double mouseDragRectYStart, double mouseDragRectYEnd, Qt::KeyboardModifiers modifiers);
|
2019-01-29 00:05:03 +08:00
|
|
|
void plotMouseWheelOperated(double x, double y, Qt::KeyboardModifiers modifiers, int deltaAngleX, int deltaAngleY);
|
2019-01-27 03:12:54 +08:00
|
|
|
void contextMenuOpened(double x, double y, QMenu* contextMenu);
|
|
|
|
void zoomChangedLocally(double newxmin, double newxmax, double newymin, double newymax, JKQTPlotter* sender);
|
|
|
|
void userScribbleClick(double x, double y, Qt::KeyboardModifiers modifiers, bool first, bool last);
|
|
|
|
void userRectangleFinished(double x, double y, double width, double height, Qt::KeyboardModifiers modifiers);
|
|
|
|
void userLineFinished(double x1, double y1, double x2, double y2, Qt::KeyboardModifiers modifiers);
|
|
|
|
void userCircleFinished(double x, double y, double radius, Qt::KeyboardModifiers modifiers);
|
|
|
|
void userEllipseFinished(double x, double y, double radiusX, double radiusY, Qt::KeyboardModifiers modifiers);
|
2019-05-06 01:31:20 +08:00
|
|
|
void tooltipDisplayed(double x, double y, const QStringList& entries, const QList<JKQTPPlotElement*>& graphs);
|
|
|
|
void rulerDisplayed(double x1, double y1, double x2, double y2, Qt::KeyboardModifiers modifiers);
|
2019-01-25 05:49:10 +08:00
|
|
|
protected:
|
|
|
|
void initPlot();
|
|
|
|
JKQTPlotter* plot;
|
|
|
|
QGridLayout* layout;
|
|
|
|
QHBoxLayout* layChk;
|
2019-01-27 05:22:46 +08:00
|
|
|
QHBoxLayout* layChk2;
|
2019-01-25 05:49:10 +08:00
|
|
|
QFormLayout* layForm;
|
2019-05-06 01:31:20 +08:00
|
|
|
QFormLayout* layForm2;
|
|
|
|
QFormLayout* layLab;
|
2019-01-25 05:49:10 +08:00
|
|
|
QCheckBox* chkPositionDisplay;
|
|
|
|
QCheckBox* chkShowToolbar;
|
|
|
|
QCheckBox* chkToolbarAlwaysOn;
|
|
|
|
QCheckBox* chkGrid;
|
2022-05-15 20:15:15 +08:00
|
|
|
QComboBox* cmbMouseMoveAction;
|
2019-01-28 06:24:12 +08:00
|
|
|
QComboBox* cmbLeftNoModMouseAction;
|
|
|
|
QComboBox* cmbLeftCtrlModMouseAction;
|
|
|
|
QComboBox* cmbRightNoModMouseAction;
|
2019-01-28 17:46:38 +08:00
|
|
|
QComboBox* cmbRightClickContextMenu;
|
2019-01-29 00:05:03 +08:00
|
|
|
QComboBox* cmbRightDoubleClickMouseAction;
|
|
|
|
QComboBox* cmbLeftDoubleClickMouseAction;
|
|
|
|
QComboBox* cmbMouseWheelAction;
|
2019-05-06 01:31:20 +08:00
|
|
|
QComboBox* cmbUserActionMarkerType;
|
|
|
|
QComboBox* cmbUserActionMarkerColor;
|
|
|
|
QComboBox* cmbUserActionOverlayColor;
|
|
|
|
QComboBox* cmbUserActionOverlayFillColor;
|
|
|
|
QComboBox* cmbUserActionOpaqueColor;
|
|
|
|
QComboBox* cmbUserActionOpaqueFillColor;
|
2019-01-27 05:22:46 +08:00
|
|
|
QCheckBox* chkLogX;
|
|
|
|
QCheckBox* chkLogY;
|
2019-01-27 03:12:54 +08:00
|
|
|
QLabel* labMouseAction;
|
|
|
|
QLabel* labMouseMoved;
|
|
|
|
QLabel* labMouseClicked;
|
2019-01-27 05:22:46 +08:00
|
|
|
QComboBox* cmbMagnification;
|
2019-01-25 05:49:10 +08:00
|
|
|
JKQTPXYLineGraph* graph1;
|
|
|
|
JKQTPXYLineGraph* graph2;
|
2019-01-27 03:12:54 +08:00
|
|
|
|
|
|
|
static QString MouseButton2String(Qt::MouseButton button);
|
|
|
|
static QString KeyboradMod2String(Qt::KeyboardModifiers modifiers);
|
2019-01-25 05:49:10 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TEST_USER_INTERACTION_H
|