Debian Codegraph @

src/framewidget.h

raw symbols SCIP
1 /*
2 Copyright (C) 2008, 2009 Andres Cabrera
3 [email protected]
4
5 This file is part of CsoundQt.
6
7 CsoundQt is free software; you can redistribute it
8 and/or modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or (at your option) any later version.
11
12 CsoundQt is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with Csound; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20 02111-1307 USA
21 */
22
23 #ifndef FRAMEWIDGET_H
24 #define FRAMEWIDGET_H
25
26 #include <QFrame>
27 #include <QWidget>
28
29 class QuteWidget;
30
31 class FrameWidget : public QFrame
32 {
33 Q_OBJECT
34 public:
35 FrameWidget(QWidget* parent);
36 ~FrameWidget();
37
38 void select();
39 void deselect();
40 bool isSelected();
41 void setSelected(bool status);
42
43 void setWidget(QuteWidget* widget) {m_widget = widget;}
44 QuteWidget* getWidget() {return m_widget;}
45
46 protected:
47 virtual void contextMenuEvent(QContextMenuEvent *event);
48 virtual void mousePressEvent ( QMouseEvent * event );
49 virtual void mouseReleaseEvent ( QMouseEvent * event );
50 virtual void mouseMoveEvent (QMouseEvent* event);
51 virtual void mouseDoubleClickEvent (QMouseEvent * event);
52 virtual void resizeEvent (QResizeEvent* event);
53
54 private:
55 int startx, starty, oldx, oldy;
56 QFrame *m_resizeBox;
57 QuteWidget *m_widget;
58 bool m_resize;
59 bool m_selected;
60 bool m_changed;
61
62 signals:
63 void popUpMenu(QPoint pos);
64 void deselectAllSignal();
65 void moved(QPair<int, int>);
66 void resized(QPair<int, int>);
67 void editWidget();
68 void mouseReleased(); // When mouse released, send to set undo history
69 void widgetSelected(QuteWidget *widget);
70 void widgetUnselected(QuteWidget *widget);
71 };
72
73 #endif