16 #include "OOPDHeaders.h"
18 #include <QGraphicsView>
132 virtual void paint(QPainter* p,
const QStyleOptionGraphicsItem*, QWidget*)
138 p->setBrush(QBrush());
141 p->setRenderHint(QPainter::HighQualityAntialiasing,
true);
142 p->scale(scale(), scale());
144 p->setPen(QPen(QColor(255, 192, 0), 2, Qt::SolidLine, Qt::SquareCap, Qt::BevelJoin));
154 p->setPen(QPen(rectColor, 1, (
errorBox()) ? Qt::DashLine : Qt::SolidLine, Qt::SquareCap, Qt::BevelJoin));
156 QTextOption* op =
new QTextOption;
157 op->setAlignment(Qt::AlignLeft);
158 p->setPen(QPen(QColor(0, 0, 0), 1, Qt::SolidLine, Qt::SquareCap, Qt::BevelJoin));
164 p->setPen(QPen(QColor(0, 192, 255), 1, (
errorBox()) ? Qt::DashLine : Qt::SolidLine, Qt::SquareCap, Qt::BevelJoin));
176 if (ev->button() == Qt::RightButton) {
179 && !scene()->views().isEmpty()
180 && scene()->views().first()
181 && scene()->views().first()->viewport()) {
183 QGraphicsView* v = scene()->views().first();
184 QPoint pos = v->viewport()->mapToGlobal(ev->pos().toPoint());
232 if (event->buttons() & Qt::LeftButton) {
238 setCursor(QCursor(Qt::PointingHandCursor));
240 setCursor(QCursor(Qt::ArrowCursor));
250 QFontMetrics fm(myFont);
252 new_w = (new_w < 25) ? 25 : new_w;
406 #endif // CM_UICLASS_H
float height()
Definition: UIItem.h:43
void fromQString(QString message)
basic mouse up
Definition: UIBox.cpp:206
virtual void paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidget *)
paint event
Definition: UIClass.h:132
void mouseReleaseEvent(QGraphicsSceneMouseEvent *)
mouse up
Definition: UIClass.h:221
Property * get(QString pName)
Definition: PropertyList.cpp:22
QColor asQColor()
Definition: Property.cpp:229
gui object: oopd class (pdclass)
Definition: UIClass.h:30
float width()
Definition: UIItem.h:42
void writeFile()
Definition: OPClass.cpp:102
void msgDelMethod(PdArguments msg)
Definition: UIClass.h:298
void mouseMoveEvent(QGraphicsSceneMouseEvent *event)
mouse move
Definition: UIClass.h:230
QPoint dragOffset
Definition: UIItem.h:31
QString toQString()
sets object text data
Definition: UIObject.cpp:509
#define t_canvas
Definition: m_pd.h:205
QColor bgColor()
Definition: UIItem.h:49
PropertyList * properties()
>init properties for the class - called from constructor
Definition: UIObject.cpp:215
UIObjectData * objectData()
Definition: UIObject.cpp:101
Definition: CommonTypes.h:14
~UIClass()
Definition: UIClass.h:41
#define PREF_QSTRING(x)
Definition: Preferences.h:17
void moveBox(UIItem *box, QGraphicsSceneMouseEvent *event)
void showPopupMenu(QPoint pos)
createContextMenu
Definition: UIObject.cpp:243
QRectF boundingRect() const
get edit mode flag value
Definition: UIItem.h:71
t_editMode getEditMode()
get edit mode pointer - for inlets/outlets
Definition: UIItem.cpp:54
PatchWindowController * subpatchController()
Definition: UIBox.h:72
virtual void setInletsPos()
returns help patch name with path if the file is found
Definition: UIObject.cpp:250
virtual void autoResize()
custom resize event
Definition: UIBox.cpp:321
virtual void setOutletsPos()
sets inlet position. could be overriden for custom inlet positions
Definition: UIObject.cpp:268
void msgDelProperty(PdArguments msg)
Definition: UIClass.h:286
void signalEditObject(void *box)
basic update - calls update() probably remove later
void msgNewClass(PdArguments msg)
Definition: UIClass.h:265
void msgInfo(PdArguments)
Definition: UIClass.h:304
UIClass()
Definition: UIClass.cpp:8
static void updateUI(void *uiobj, PdArguments msg)
Definition: UIClass.h:344
bool errorBox()
Definition: UIObject.cpp:522
void msgAddMethod(PdArguments msg)
Definition: UIClass.h:292
OOPD class structure.
Definition: OPClass.h:38
void selectBox(UIItem *box, QGraphicsSceneMouseEvent *event)
void msgAddProperty(PdArguments msg)
Definition: UIClass.h:280
bool isSelected()
deselect object
Definition: UIItem.cpp:40
Definition: UIObject.h:44
void setWidth(float w)
Definition: UIItem.h:37
static UIObject * createObject(QString objectData, t_canvas *pdCanvas, QGraphicsView *parent=0)
Definition: UIClass.h:48
void showWindow()
Definition: OPClass.cpp:48
void setPdMessage(QString message)
Definition: UIClass.h:244
void mousePressEvent(QGraphicsSceneMouseEvent *ev)
mouse down
Definition: UIClass.h:173
gui object: standard object box
Definition: UIBox.h:46