X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/1b7818e18ed7bcf3464e307b97c6e0e6d72cc69b..2bdaa0aa3fab52f0808f60d9bbdabcd56d0efae9:/BoxItem.h diff --git a/BoxItem.h b/BoxItem.h index 4ab2022..ee4070a 100644 --- a/BoxItem.h +++ b/BoxItem.h @@ -31,20 +31,24 @@ class BoxItem : public AbstractBoxItem { public: - enum Position { Left = 1, Right, Top, Bottom, Center}; + enum Position { Free = 0, Left , Right, Top, Bottom, TopLeft, BottomLeft, TopRight, BottomRight }; // if not Free, glue the box to the desired border enum SpanType { NoSpan = 0, HSpan = 1, VSpan = 2 }; - BoxItem(AbstractBlock *_refBlock, Dispatcher *_dispatcher, Parameters *_params, GroupItem* parent, LockType _lock = NoLock, SpanType _span = NoSpan, Position _hPos = Center, Position _vPos = Center) throw(Exception); - BoxItem(Dispatcher *_dispatcher, Parameters *_params, GroupItem* parent, LockType _lock = NoLock, SpanType _span = NoSpan, Position _hPos = Center, Position _vPos = Center) throw(Exception); + BoxItem(AbstractBlock *_refBlock, Dispatcher *_dispatcher, Parameters *_params, GroupItem* parent, int _lock = NoLock, SpanType _span = NoSpan, Position _position = Free) throw(Exception); + BoxItem(Dispatcher *_dispatcher, Parameters *_params, GroupItem* parent, int _lock = NoLock, SpanType _span = NoSpan, Position _position = Free) throw(Exception); ~BoxItem(); void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); // getters inline GroupItem *getChildGroupItem() { return childGroupItem; } + inline Position getPosition() { return position; } + inline SpanType getSpan() { return span; } // setters inline void setChildGroupItem(GroupItem* item) { childGroupItem = item; } + inline void setPosition(Position _position) { position = _position; } + inline void setSpan(SpanType _span) { span = _span; } // testers bool isBoxItem(); @@ -55,14 +59,13 @@ public: void loadFunctional(QDomElement funcElement) throw(Exception); void save(QXmlStreamWriter& writer); + void updateMinimumSize(); // modify the minimum size + bool updateGeometry(ChangeType type); // modify the originPoint and the total dimension + protected: SpanType span; - Position hPos; - Position vPos; - - void updateMinimumSize(); // modify the minimum size - bool updateGeometry(ChangeType type); // modify the originPoint and the total dimension + Position position; void mousePressEvent(QGraphicsSceneMouseEvent *event); void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);