tilde~
Puredata Qt-based GUI
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PatchWindow.h
Go to the documentation of this file.
1 #ifndef CM_PATCHWINDOW_H
2 #define CM_PATCHWINDOW_H
3 
4 #include "BaseWindow.h"
5 
6 namespace tilde {
7 
8 class CanvasView;
9 class UIBox;
10 class PatchWindowController;
11 
14 class PatchWindow : public BaseWindow {
15 
16 private:
17  PatchWindowController* _controller;
18 
19  QScrollArea* _scroll;
20 
22 
23  QAction* _selectAllAct;
24  QAction* _selectAgainAct;
25 
26  QAction* _delObjectAct;
27  QAction* _editModeAct;
28 
29  QAction* _putObjectAct;
30  QAction* _putMessageAct;
31 
32  // QAction *putSymbolAct;
33  QAction* putCommentAct;
34 
35  QAction* putBangAct;
36  QAction* putToggleAct;
37  QAction* putNumberAct;
38  QAction* putSliderAct;
39  QAction* putKnobAct;
40  QAction* putRadioAct;
41  QAction* putDisplay;
42 
43  QAction* putArray;
44 
45  QAction* putKeyboard;
46  QAction* putSlider2D;
47  QAction* putBPF;
48 
49  QAction* putRangeSliderAct;
50  QAction* putSlidersAct;
51  QAction* putIncDecAct;
52  QAction* putMatrixAct;
53 
54  QAction* putScope;
55  QAction* putSpectroscope;
56 
57  QAction* putScriptAct;
58 
59  QAction* putPdClass;
60  QAction* putPdInstance;
61 
62  QAction* showGridAct;
63  QAction* snapToGridAct;
64 
65  QAction* alignToGridAct;
66 
67  QAction* alignLeftAct;
68  QAction* alignCenterAct;
69  QAction* alignRightAct;
70  QAction* alignTopAct;
71  QAction* alignBottomAct;
72 
73  QAction* distHAct;
74  QAction* distVAct;
75 
76  QAction* tidyUpAct;
77 
78  QAction* groupObjAct;
79  QAction* ungroupObjAct;
80 
81  QAction* zoomInAct;
82  QAction* zoomOutAct;
83 
84  QAction* zoom100Act;
85 
86  CanvasView* _canvasView;
87 
88 private slots:
89 
90  void slotEnableUndo(bool v);
91  void slotEnableRedo(bool v);
92 
93  void slotResize(int);
94  void slotMove(int);
95 
96 public:
97  PatchWindow();
98 
99  CanvasView* canvasView() { return _canvasView; };
100  void setCanvasView(CanvasView* v) { _canvasView = v; }
101 
103  PatchWindowController* controller() { return _controller; } //temporary!
104 
105  void createActions();
106  void createMenus();
107 
108  // ----------
109  void moveEvent(QMoveEvent *);
110  void resizeEvent(QResizeEvent* );
111 
112  //----------------------------------------------------------------------------------------
113 
114  // todo less spaghetti
115 
116  void newObjectBox();
117  void newMessageBox();
118  void newFloatBox();
119  void newCommentBox();
120  void newBangBox();
121  void newToggleBox();
122  void newScriptBox();
123  void newArrayBox();
124  void newSliderBox();
125  void newRadioBox();
126  void newPdClassBox();
127  void newPdInstanceBox();
128 
129  // ----------------------------------------------------
130 
131  void objectMakerDone();
132 
133  void setEditMode();
134  void setGridVisible();
135  void setGridSnap();
136 
137  // -------
138 
139  void closeEvent(QCloseEvent* event);
140 
141  // -------
142 
143  void setFileName(QString fname);
144 
147  void keyPressEvent(QKeyEvent* event);
148  void keyReleaseEvent(QKeyEvent* event);
149 
150  //
151  void zoomIn();
152  void zoomOut();
153 
154  void zoom100();
155 };
156 }
157 
158 #endif // CM_PATCHWINDOW_H
void newFloatBox()
Definition: PatchWindow.cpp:621
void resizeEvent(QResizeEvent *)
Definition: PatchWindow.cpp:577
void setCanvasView(CanvasView *v)
Definition: PatchWindow.h:100
void newToggleBox()
Definition: PatchWindow.cpp:666
Patch window. Creates scroll view and cm_canvas; Creates menu commands, forwards them to cm_canvas...
Definition: PatchWindow.h:14
CanvasView * canvasView()
Definition: PatchWindow.h:99
PatchWindowController * controller()
Definition: PatchWindow.h:103
void setGridVisible()
Definition: PatchWindow.cpp:498
void newPdClassBox()
Definition: PatchWindow.cpp:736
void newMessageBox()
Definition: PatchWindow.cpp:606
void setGridSnap()
Definition: PatchWindow.cpp:505
void zoom100()
Definition: PatchWindow.cpp:408
void newPdInstanceBox()
Definition: PatchWindow.cpp:750
void newArrayBox()
Definition: PatchWindow.cpp:694
void keyPressEvent(QKeyEvent *event)
keys: ctrl for temporary lock; esc to stop editing actions
Definition: PatchWindow.cpp:416
void zoomIn()
Definition: PatchWindow.cpp:396
void newObjectBox()
Definition: PatchWindow.cpp:595
void newScriptBox()
Definition: PatchWindow.cpp:680
void createActions()
Definition: PatchWindow.cpp:42
The Patch window controller.
Definition: PatchWindowController.h:48
void keyReleaseEvent(QKeyEvent *event)
Definition: PatchWindow.cpp:433
void zoomOut()
Definition: PatchWindow.cpp:402
void newBangBox()
Definition: PatchWindow.cpp:652
void setController(PatchWindowController *c)
Definition: PatchWindow.cpp:307
void objectMakerDone()
creates object TODO move to controller
Definition: PatchWindow.cpp:444
void newRadioBox()
Definition: PatchWindow.cpp:722
void setFileName(QString fname)
set file name when opening patch file
Definition: PatchWindow.cpp:380
void setEditMode()
Definition: PatchWindow.cpp:489
void newSliderBox()
Definition: PatchWindow.cpp:708
Base class for windows (patch, pd)
Definition: BaseWindow.h:19
Canvas View - used by Patch window controller.
Definition: CanvasView.h:36
void moveEvent(QMoveEvent *)
Definition: PatchWindow.cpp:588
void newCommentBox()
Definition: PatchWindow.cpp:637
PatchWindow()
Definition: PatchWindow.cpp:16
void closeEvent(QCloseEvent *event)
Definition: PatchWindow.cpp:356
void createMenus()
Definition: PatchWindow.cpp:237