[Uml-devel] kdesdk/umbrello/umbrello
Oliver Kellogg
okellogg at users.sourceforge.net
Sun Jul 11 05:53:01 UTC 2004
CVS commit by okellogg:
Fix bug 83382 (Move seq. diagram object boxes back to top)
M +15 -3 objectwidget.cpp 1.36
M +9 -3 objectwidget.h 1.16
M +8 -8 umlview.cpp 1.152
--- kdesdk/umbrello/umbrello/objectwidget.cpp #1.35:1.36
@@ -149,5 +149,10 @@ QString ObjectWidget::getDoc() const {
return m_Doc;
}
-////////////////////////////////////////////////////////////////////////////////////////////////////
+
+void ObjectWidget::setDrawAsActor( bool drawAsActor ) {
+ m_bDrawAsActor = drawAsActor;
+ calculateSize();
+}
+
void ObjectWidget::setMultipleInstance(bool multiple) {
//make sure only calling this in relation to an object on a collab. diagram
@@ -272,5 +277,6 @@ void ObjectWidget::mouseMoveEvent(QMouse
void ObjectWidget::tabUp() {
int newY = getY() - height();
- newY = ( newY + height() ) < 80?80 - height():newY;
+ if (newY < topMargin())
+ newY = topMargin();
setY( newY );
moveEvent( 0 );
@@ -285,6 +291,12 @@ void ObjectWidget::tabDown() {
}
+int ObjectWidget::topMargin() {
+ return 80 - height();
+}
+
bool ObjectWidget::canTabUp() {
- return getY() >= 80;
+ int y = getY();
+ //kdDebug() << "ObjectWidget::canTabUp: y is " << y << endl;
+ return (y > topMargin());
}
--- kdesdk/umbrello/umbrello/objectwidget.h #1.15:1.16
@@ -152,7 +152,5 @@ public:
* @param drawAsActor True if widget shall be drawn as an actor.
*/
- void setDrawAsActor( bool drawAsActor ) {
- m_bDrawAsActor = drawAsActor;
- }
+ void setDrawAsActor( bool drawAsActor );
/**
@@ -178,4 +176,12 @@ public:
/**
+ * Returns the top margin constant (Y axis value)
+ *
+ * @return Y coordinate of the space between the diagram top
+ * and the upper edge of the ObjectWidget.
+ */
+ int topMargin();
+
+ /**
* Returns the end Y co-ord of the seq. line.
*
--- kdesdk/umbrello/umbrello/umlview.cpp #1.151:1.152
@@ -374,8 +374,8 @@ void UMLView::slotToolBarChanged(int c)
void UMLView::showEvent(QShowEvent* /*se*/) {
- #ifdef MANUAL_CONTROL_DOUBLE_BUFFERING
+# ifdef MANUAL_CONTROL_DOUBLE_BUFFERING
kdWarning() << "Show Event for " << getName() << endl;
canvas()->setDoubleBuffering( true );
- #endif
+# endif
UMLApp* theApp = UMLApp::app();
@@ -396,8 +396,8 @@ void UMLView::hideEvent(QHideEvent* /*he
disconnect(m_pDoc, SIGNAL(sigObjectCreated(UMLObject *)), this, SLOT(slotObjectCreated(UMLObject *)));
- #ifdef MANUAL_CONTROL_DOUBLE_BUFFERING
+# ifdef MANUAL_CONTROL_DOUBLE_BUFFERING
kdWarning() << "Hide Event for " << getName() << endl;
canvas()->setDoubleBuffering( false );
- #endif
+# endif
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -415,4 +415,6 @@ void UMLView::slotObjectCreated(UMLObjec
}
+ int y = m_Pos.y();
+
UMLWidget* newWidget = 0;
if(type == ot_Actor) {
@@ -420,4 +422,6 @@ void UMLView::slotObjectCreated(UMLObjec
ObjectWidget *ow = new ObjectWidget(this, o, getLocalID() );
ow->setDrawAsActor(true);
+ if (m_Type == dt_Sequence)
+ y = ow->topMargin();
newWidget = ow;
} else
@@ -462,9 +466,5 @@ void UMLView::slotObjectCreated(UMLObjec
return;
}
- int y=m_Pos.y();
- if (newWidget->getBaseType() == wt_Object && this->getType() == dt_Sequence) {
- y = 80 - newWidget->height();
- }
newWidget->setX( m_Pos.x() );
newWidget->setY( y );
More information about the umbrello-devel
mailing list