tilde~
Puredata Qt-based GUI
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
UIMatrix.h
Go to the documentation of this file.
1 // (c) 2017 Alex Nadzharov
2 // License: GPL3
3 
4 #ifndef CMO_MATRIX_H
5 #define CMO_MATRIX_H
6 
7 #include <qlineedit.h>
8 
9 #include "Port.h"
10 #include "UIObject.h"
11 
12 #include <QGraphicsView>
13 
14 namespace tilde {
15 
23 
24 };
25 
29 class UIMatrix : public UIObject {
30  Q_OBJECT
31 
32 private:
33  bool _clicked;
34 
35 public:
36  explicit UIMatrix();
37 
38  static UIObject* createObj(QString data);
39 
40  void initProperties();
41 
42  Q_SLOT void propertyUpdate();
43  Q_SLOT void propertyMatrixSize();
44 
45  // ------------------------------------------
46 
47  void drawCross(QPainter* p, QPoint matrixPos);
48  void drawBox(QPainter* p, QPoint matrixPos);
49 
50  // ---- move to private
51 
53 
54  int radioSize();
55 
56  QRect rectFromMatrixPos(QPoint matrixPos);
57 
58  void paintHRadio(QPainter* p);
59  void paintVRadio(QPainter* p);
60 
61  void paintToggleMatrix(QPainter* p);
62  void paintButtonMatrix(QPainter* p);
63 
64  // ---- move to private
65 
66  virtual void paint(QPainter* p, const QStyleOptionGraphicsItem* option, QWidget*);
67 
68  void resizeEvent();
69 
70  // ---------------------------------------------------------------
71 
72  void mousePressEvent(QGraphicsSceneMouseEvent* ev);
73  void mouseReleaseEvent(QGraphicsSceneMouseEvent*);
74  void mouseMoveEvent(QGraphicsSceneMouseEvent* event);
75 
76  void updateUI(t_cpd_list* msg);
77 };
78 }
79 
80 #endif // CMO_MSG_H
Definition: UIMatrix.h:21
Definition: UIMatrix.h:22
virtual void paint(QPainter *p, const QStyleOptionGraphicsItem *option, QWidget *)
draws buttons as boxes
Definition: UIMatrix.cpp:228
Definition: UIMatrix.h:19
void paintHRadio(QPainter *p)
Definition: UIMatrix.cpp:190
void updateUI(t_cpd_list *msg)
Definition: UIMatrix.cpp:377
void paintButtonMatrix(QPainter *p)
draws buttons as ui.toggle
Definition: UIMatrix.cpp:222
void paintVRadio(QPainter *p)
Definition: UIMatrix.cpp:204
UIMatrix()
Definition: UIMatrix.cpp:16
void initProperties()
Definition: UIMatrix.cpp:48
void drawCross(QPainter *p, QPoint matrixPos)
Definition: UIMatrix.cpp:98
int radioSize()
Definition: UIMatrix.cpp:161
void drawBox(QPainter *p, QPoint matrixPos)
Definition: UIMatrix.cpp:108
Definition: UIMatrix.h:17
Definition: UIMatrix.h:18
void mouseReleaseEvent(QGraphicsSceneMouseEvent *)
Definition: UIMatrix.cpp:357
void mouseMoveEvent(QGraphicsSceneMouseEvent *event)
Definition: UIMatrix.cpp:359
uiMatrixType
Definition: UIMatrix.h:16
void mousePressEvent(QGraphicsSceneMouseEvent *ev)
Definition: UIMatrix.cpp:281
void resizeEvent()
Definition: UIMatrix.cpp:272
Q_SLOT void propertyMatrixSize()
Definition: UIMatrix.cpp:72
static UIObject * createObj(QString data)
Definition: UIMatrix.cpp:32
QRect rectFromMatrixPos(QPoint matrixPos)
Definition: UIMatrix.cpp:172
void paintToggleMatrix(QPainter *p)
draws buttons as ui.toggle
Definition: UIMatrix.cpp:218
Definition: UIObject.h:44
Q_SLOT void propertyUpdate()
Definition: UIMatrix.cpp:67
uiMatrixType matrixType()
Definition: UIMatrix.cpp:125
Definition: UIMatrix.h:20
gui object: ui.matrix - substitute all objects with multiple buttons (hradio, vradio, ui.matrix)
Definition: UIMatrix.h:29