[Uml-devel] branches/KDE/3.5/kdesdk/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Sun Sep 4 01:08:27 UTC 2005


SVN commit 456928 by okellogg:

BUG:112017 - setSelectedWidget(): First check associations, then messages, then
other widgets.


 M  +1 -1      ChangeLog  
 M  +31 -32    umbrello/toolbarstate.cpp  


--- branches/KDE/3.5/kdesdk/umbrello/ChangeLog #456927:456928
@@ -11,7 +11,7 @@
 * Bugs fixed / wishes implemented (see http://bugs.kde.org)
  57588  58809  66461  67719  72016  79433  87252  88117  97162 105564
 108223 109591 109636 110216 110231 110379 111088 111470 111502 111759
-111768
+111768 112017
 
 Version 1.4.2 (maintenance release)
 
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/toolbarstate.cpp #456927:456928
@@ -169,9 +169,38 @@
     UMLWidget* backup = 0;
     UMLWidget* boxBackup = 0;
 
+    // Check associations.
+    AssociationWidgetListIt assoc_it(m_pUMLView->getAssociationList());
+    AssociationWidget* assocwidget = 0;
+    while ((assocwidget = assoc_it.current()) != NULL) {
+        if (assocwidget->onAssociation( me->pos() ))
+        {
+            // TODO: Fix this. It makes a callback to the association mousePressEvent function.
+            assocwidget->mousePressEvent(me);
+            m_pUMLView->setMoveAssoc(assocwidget);
+            m_bWidgetSelected = true;
+            return true;
+        }
+        ++assoc_it;
+    }
+    m_pUMLView->setMoveAssoc(NULL);
+
+    // Check messages.
+    MessageWidgetListIt mit( m_pUMLView->getMessageList() );
+    UMLWidget *obj = 0;
+    while ((obj = (UMLWidget*)mit.current()) != 0) {
+        if (obj->isVisible() && obj->onWidget(me->pos())) {
+            m_pUMLView->setOnWidget( obj );
+            obj ->  mousePressEvent( me );
+            m_bWidgetSelected = true;
+            return true;
+        }
+        ++mit;
+    }
+
     // Check widgets.
     UMLWidgetListIt it( m_pUMLView->getWidgetList() );
-    UMLWidget* obj = 0;
+    obj = 0;
     while ( (obj = it.current()) != 0 ) {
         ++it;
         if( !obj->isVisible() || !obj->onWidget(me->pos()) )
@@ -192,7 +221,7 @@
         } else {
             backup = obj;
         }
-    }//end while
+    }
     //if backup is set then let it have the event
     if(backup) {
         backup -> mousePressEvent( me );
@@ -201,20 +230,6 @@
         m_bWidgetSelected = true;
         return true;
     }
-
-    // Check messages.
-    MessageWidgetListIt mit( m_pUMLView->getMessageList() );
-    obj = 0;
-    while ((obj = (UMLWidget*)mit.current()) != 0) {
-        if (obj->isVisible() && obj->onWidget(me->pos())) {
-            m_pUMLView->setOnWidget( obj );
-            obj ->  mousePressEvent( me );
-            m_bWidgetSelected = true;
-            return true;
-        }
-        ++mit;
-    }
-
     // Boxes have lower priority.
     if (boxBackup) {
         boxBackup -> mousePressEvent( me );
@@ -224,22 +239,6 @@
         return true;
     }
 
-    // Check associations.
-    AssociationWidgetListIt assoc_it(m_pUMLView->getAssociationList());
-    AssociationWidget* assocwidget = 0;
-    while((assocwidget=assoc_it.current())) {
-        if( assocwidget -> onAssociation( me -> pos() ))
-        {
-            // TODO: Fix this. It makes a callback to the association mousePressEvent function.
-            assocwidget->mousePressEvent(me);
-            m_pUMLView->setMoveAssoc(assocwidget);
-
-            m_bWidgetSelected = true;
-            return true;
-        }
-        ++assoc_it;
-    }
-    m_pUMLView->setMoveAssoc(NULL);
     m_pUMLView->setOnWidget(NULL);
 
     m_bWidgetSelected = false;




More information about the umbrello-devel mailing list