tilde~
Puredata Qt-based GUI
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
UIMessage.h
Go to the documentation of this file.
1 // (c) 2017 Alex Nadzharov
2 // License: GPL3
3 
4 #ifndef CMO_MSG_H
5 #define CMO_MSG_H
6 
7 #include <qlineedit.h>
8 
9 #include "Port.h"
10 #include "UIObject.h"
11 
12 #include <QGraphicsView>
13 
14 //#include "cm_pdlink.h"
15 
16 namespace tilde {
17 
21 class UIMessage : public UIObject {
22  Q_OBJECT
23 
24 private:
25  bool _clicked;
26  QLineEdit* _editor;
27 
28 public:
29  explicit UIMessage();
30 
31  static UIObject* createObj(QString data);
32 
33  virtual void paint(QPainter* p, const QStyleOptionGraphicsItem* option, QWidget*);
34  void resizeEvent();
35 
36  // ------------------------------------------------------
37 
38  void objectPressEvent(QGraphicsSceneMouseEvent* ev);
39  void objectReleaseEvent(QGraphicsSceneMouseEvent*);
40 
41  // ------------------------------------
42 
43  virtual void move(float x, float y);
44  virtual void move(QPoint p);
45  virtual void move(QPointF p);
46 
47  virtual void setParentCanvasView(CanvasView* v);
48 
49  void fromQString(QString objData);
50 
51  void setPdMessage(QString message);
52 
53  void updateUI(t_cpd_list* list);
54 
55  virtual std::string asPdFileString();
56 
57  virtual void autoResize();
58 
59 private slots:
60  void editorDone();
61  void editorChanged();
62 };
63 }
64 
65 #endif // CMO_MSG_H
virtual void paint(QPainter *p, const QStyleOptionGraphicsItem *option, QWidget *)
UIObject properties
Definition: UIMessage.cpp:105
static UIObject * createObj(QString data)
Definition: UIMessage.cpp:89
gui object: message box (ui.msg)
Definition: UIMessage.h:21
void updateUI(t_cpd_list *list)
Definition: UIMessage.cpp:282
virtual std::string asPdFileString()
call this after setting object data
Definition: UIMessage.cpp:325
UIMessage()
Definition: UIMessage.cpp:23
void objectReleaseEvent(QGraphicsSceneMouseEvent *)
Definition: UIMessage.cpp:214
virtual void setParentCanvasView(CanvasView *v)
Definition: UIMessage.cpp:222
void fromQString(QString objData)
template
Definition: UIMessage.cpp:235
void resizeEvent()
Definition: UIMessage.cpp:137
virtual void move(float x, float y)
Definition: UIMessage.cpp:191
Definition: UIObject.h:44
Canvas View - used by Patch window controller.
Definition: CanvasView.h:36
void setPdMessage(QString message)
Definition: UIMessage.cpp:251
Definition: g_canvas.h:89
void objectPressEvent(QGraphicsSceneMouseEvent *ev)
Definition: UIMessage.cpp:145
virtual void autoResize()
custom resize event
Definition: UIMessage.cpp:308