diff -r 7a96bd401351 -r b091563e28e6 floatobj.cpp --- a/floatobj.cpp Sun Jan 30 12:58:47 2005 +0000 +++ b/floatobj.cpp Tue Sep 05 09:30:16 2006 +0000 @@ -6,7 +6,7 @@ // FloatObj ///////////////////////////////////////////////////////////////// -FloatObj::FloatObj ():LinkableMapObj() +FloatObj::FloatObj ():OrnamentedObj() { // cout << "Const FloatObj ()\n"; setParObj (this); @@ -14,7 +14,7 @@ depth=-1; } -FloatObj::FloatObj (QCanvas* c):LinkableMapObj(c) +FloatObj::FloatObj (Q3Canvas* c):OrnamentedObj(c) { // cout << "Const FloatObj (c) called from MapCenterObj (c)\n"; setParObj (this); @@ -22,7 +22,7 @@ depth=-1; } -FloatObj::FloatObj (QCanvas* c, LinkableMapObj* p):LinkableMapObj (c) +FloatObj::FloatObj (Q3Canvas* c, LinkableMapObj* p):OrnamentedObj (c) { // cout << "Const FloatObj (c,p)\n"; setParObj (p); @@ -38,39 +38,18 @@ void FloatObj::init () { setChildObj(this); - relPos=getRandPos(); - useOrientation=true; floatExport=true; zPlane=Z_ICON; + setLinkStyle (StyleParabel); + setHideLinkUnselected(true); } void FloatObj::copy (FloatObj* other) { LinkableMapObj::copy (other); - relPos=other->relPos; - useOrientation=other->useOrientation; setVisibility (other->visible); } -void FloatObj::setRelPos() -{ - if (useOrientation) - { - if (parObj->getOrientation()==OrientLeftOfCenter) - relPos.setX ( parObj->x() +parObj->width() - bbox.width() -absPos.x()); - else - relPos.setX (absPos.x() - parObj->x() ); - } - else - relPos.setX (absPos.x() - parObj->x() ); - relPos.setY (absPos.y() - parObj->y() ); -} - -void FloatObj::setRelPos(const QPoint &p) -{ - relPos=p; -} - void FloatObj::setZ(const int &i) { zPlane=i; @@ -81,16 +60,6 @@ return zPlane; } - -void FloatObj::setUseOrientation (const bool &b) -{ - if (useOrientation!=b) - { - useOrientation=b; - requestReposition(); - } -} - void FloatObj::setFloatExport(const bool& b) { floatExport=b; @@ -112,17 +81,15 @@ move (p.x(), p.y()); } +void FloatObj::setDockPos() +{ + parPos=absPos; + childPos=absPos; +} + void FloatObj::reposition() { - if (useOrientation) - { - if (parObj->getOrientation()==OrientLeftOfCenter) - move (parObj->x() - relPos.x() + parObj->width() - bbox.width(), parObj->y()+relPos.y()); - else - move (parObj->x()+relPos.x(), parObj->y()+relPos.y()); - } - else - move (parObj->x()+relPos.x(), parObj->y()+relPos.y()); + move (parObj->getChildPos().x()+relPos.x(), parObj->getChildPos().y()+relPos.y()); updateLink(); } @@ -139,25 +106,11 @@ void FloatObj::select() { LinkableMapObj::select(); - // Temporary draw the link while FO is selected - if (style==StyleUndef) - { - setLinkStyle(getDefLinkStyle()); - setLinkColor(parObj->getLinkColor()); - } - - // Update FloatExport switch in context menu - if (floatExport) - actionEditToggleFloatExport->setEnabled (true); - else - actionEditToggleFloatExport->setEnabled (true); - - + LinkableMapObj::setLinkColor(parObj->getLinkColor()); } void FloatObj::unselect() { LinkableMapObj::unselect(); - setLinkStyle (StyleUndef); }