]>
Commit | Line | Data |
---|---|---|
a553f267 | 1 | //----------------------------------------------------------------------------- |
212ef3a0 | 2 | // Copyright (C) 2009 Michael Gernoth <michael at gernoth.net> |
3 | // | |
a553f267 | 4 | // This code is licensed to you under the terms of the GNU GPL, version 2 or, |
5 | // at your option, any later version. See the LICENSE.txt file for the text of | |
6 | // the license. | |
7 | //----------------------------------------------------------------------------- | |
8 | // GUI (QT) | |
9 | //----------------------------------------------------------------------------- | |
10 | ||
6658905f | 11 | #include <QApplication> |
12 | #include <QPushButton> | |
13 | #include <QObject> | |
14 | #include <QWidget> | |
15 | #include <QPainter> | |
16 | ||
17 | class ProxWidget : public QWidget | |
18 | { | |
19 | Q_OBJECT; | |
20 | ||
21 | private: | |
22 | int GraphStart; | |
23 | double GraphPixelsPerPoint; | |
24 | int CursorAPos; | |
25 | int CursorBPos; | |
c6e5c7ea | 26 | //int CursorCPos; |
27 | //int CursorDPos; | |
6658905f | 28 | |
29 | public: | |
30 | ProxWidget(QWidget *parent = 0); | |
31 | ||
32 | protected: | |
33 | void paintEvent(QPaintEvent *event); | |
34 | void closeEvent(QCloseEvent *event); | |
35 | void mouseMoveEvent(QMouseEvent *event); | |
36 | void mousePressEvent(QMouseEvent *event) { mouseMoveEvent(event); } | |
37 | void keyPressEvent(QKeyEvent *event); | |
38 | }; | |
39 | ||
40 | class ProxGuiQT : public QObject | |
41 | { | |
42 | Q_OBJECT; | |
43 | ||
44 | private: | |
45 | QApplication *plotapp; | |
46 | ProxWidget *plotwidget; | |
47 | int argc; | |
48 | char **argv; | |
49 | void (*main_func)(void); | |
50 | ||
51 | public: | |
52 | ProxGuiQT(int argc, char **argv); | |
53 | ~ProxGuiQT(void); | |
54 | void ShowGraphWindow(void); | |
55 | void RepaintGraphWindow(void); | |
56 | void HideGraphWindow(void); | |
57 | void MainLoop(void); | |
58 | ||
59 | private slots: | |
60 | void _ShowGraphWindow(void); | |
61 | void _RepaintGraphWindow(void); | |
62 | void _HideGraphWindow(void); | |
63 | ||
64 | signals: | |
65 | void ShowGraphWindowSignal(void); | |
66 | void RepaintGraphWindowSignal(void); | |
67 | void HideGraphWindowSignal(void); | |
68 | }; |