Salome HOME
PAL8395: Fix pb. with bug2extraEdges.py
[modules/geom.git] / src / GEOMGUI / GeometryGUI.cxx
index 7f26db05cbcffe008a86524c5e06f123fd5b2ae8..58841200b3e5c866794033c9980351001116dd57 100644 (file)
@@ -90,30 +90,27 @@ public:
 
   void paint(QPainter* p, const QColorGroup& cg, bool act, bool /*enabled*/, int x, int y, int w, int h)
   {
-    if ( !act ) {
-      p->fillRect( x, y+1, w, h-2, cg.mid() );
-      p->drawRect( x, y+1, w, h-2 );
-    }
-    else {
-      p->fillRect( x, y+1, w, h-2, cg.midlight() );
-      QPen oldPen = p->pen();
-      p->setPen( cg.mid() );
-      p->drawRect( x, y+1, w, h-2 );
-      p->setPen( oldPen );
-    }
+    p->save();
+    p->fillRect( x, y, w, h, act ? cg.highlight() : cg.mid() );
+    p->setPen( act ? cg.highlightedText() : cg.buttonText() );
     p->setFont( myFont );
-    p->drawText( x, y, w, h, AlignHCenter | AlignVCenter | ShowPrefix | DontClip, myString );
+    p->drawText( x, y, w, h, AlignHCenter | AlignVCenter | ShowPrefix | DontClip | SingleLine, myString );
+    p->restore();
   }
 
   QSize sizeHint()
   {
-    return QFontMetrics( myFont ).size( AlignHCenter | AlignVCenter | ShowPrefix | DontClip, myString );
+    return QFontMetrics( myFont ).size( AlignHCenter | AlignVCenter | ShowPrefix | DontClip | SingleLine, myString );
+  }
+
+  bool fullSpan() const
+  {
+    return true;
   }
 
 private:
   QString myString;
   QFont   myFont;
-
 };
 
 //=======================================================================
@@ -406,17 +403,19 @@ bool GeometryGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
            theCommandID == 607 ||   // MENU REPAIR - REMOVE INTERNAL WIRES
            theCommandID == 608 ||   // MENU REPAIR - ADD POINT ON EDGE
            theCommandID == 609 ||   // MENU REPAIR - FREE BOUNDARIES
+           theCommandID == 610 ||   // MENU REPAIR - FREE FACES
           theCommandID == 602 ) {  // MENU REPAIR - GLUE FACES
     library = geomGUI->getLibrary( "libRepairGUI.so" );
   }
-  else if( theCommandID == 701  ||  // MENU MEASURE - PROPERTIES
-          theCommandID == 702  ||  // MENU MEASURE - CDG
-          theCommandID == 703  ||  // MENU MEASURE - INERTIA
-          theCommandID == 7041 ||  // MENU MEASURE - BOUNDING BOX
-          theCommandID == 7042 ||  // MENU MEASURE - MIN DISTANCE
-          theCommandID == 705  ||  // MENU MEASURE - TOLERANCE
-          theCommandID == 706  ||  // MENU MEASURE - WHATIS
-          theCommandID == 707  ||  // MENU MEASURE - CHECK
+  else if( theCommandID == 701   ||  // MENU MEASURE - PROPERTIES
+          theCommandID == 702   ||  // MENU MEASURE - CDG
+          theCommandID == 703   ||  // MENU MEASURE - INERTIA
+          theCommandID == 7041  ||  // MENU MEASURE - BOUNDING BOX
+          theCommandID == 7042  ||  // MENU MEASURE - MIN DISTANCE
+          theCommandID == 705   ||  // MENU MEASURE - TOLERANCE
+          theCommandID == 706   ||  // MENU MEASURE - WHATIS
+          theCommandID == 707   ||  // MENU MEASURE - CHECK
+          theCommandID == 7072  ||  // MENU MEASURE - CHECK COMPOUND OF BLOCKS
           theCommandID == 708 ) {  // MENU MEASURE - POINT COORDINATES
     library = geomGUI->getLibrary( "libMeasureGUI.so" );
   }
@@ -424,9 +423,10 @@ bool GeometryGUI::OnGUIEvent(int theCommandID, QAD_Desktop* parent)
           theCommandID == 801 ) {  // MENU GROUP - EDIT
     library = geomGUI->getLibrary( "libGroupGUI.so" );
   }
-  else if( theCommandID == 9999 ||  // MENU BLOCKS - HEXAHEDRAL SOLID
-           theCommandID == 9998 ||  // MENU BLOCKS - MULTI-TRANSFORMATION
-           theCommandID == 9997 ||  // MENU BLOCKS - QUADRANGLE FACE
+  else if( theCommandID == 9999  ||  // MENU BLOCKS - HEXAHEDRAL SOLID
+           theCommandID == 9998  ||  // MENU BLOCKS - MULTI-TRANSFORMATION
+           theCommandID == 9997  ||  // MENU BLOCKS - QUADRANGLE FACE
+           theCommandID == 99991 ||  // MENU BLOCKS - PROPAGATE
            theCommandID == 9995 ) { // MENU BLOCKS - EXPLODE ON BLOCKS
     library = geomGUI->getLibrary( "libBlocksGUI.so" );
   }
@@ -724,8 +724,8 @@ bool GeometryGUI::CustomPopup(QAD_Desktop* parent, QPopupMenu* popup, const QStr
 
       if ( theObject == "Component" ) {
        ////// menu for component
-       popup->removeItem( QAD_DisplayOnly_Popup_ID );
        if ( !isOCCViewer && !isVTKViewer ) {
+         popup->removeItem( QAD_DisplayOnly_Popup_ID );
          popup->removeItem( QAD_Display_Popup_ID );
          popup->removeItem( QAD_Erase_Popup_ID );
        }
@@ -912,7 +912,7 @@ bool GeometryGUI::CustomPopup(QAD_Desktop* parent, QPopupMenu* popup, const QStr
     popup->removeItem( QAD_TopLabel_Popup_ID );
     if ( theParent == "Viewer" && !objectName.isEmpty() && popup->count() > 0 ) {
       // set bold font for popup menu's title
-      QFont f = QApplication::font(); f.setBold( TRUE );
+      QFont f = popup->font(); f.setBold( TRUE );
       popup->removeItem( QAD_TopLabel_Popup_ID );
       popup->insertItem( new CustomItem( objectName, f ), QAD_TopLabel_Popup_ID, topItem );
     }
@@ -954,6 +954,8 @@ bool GeometryGUI::ActiveStudyChanged(QAD_Desktop* parent)
   Mb->setItemEnabled( 604, ViewOCC ); // SuppressHole
   Mb->setItemEnabled( 606, ViewOCC ); // CloseContour
   Mb->setItemEnabled( 413, ViewOCC ); // Isos Settings
+  Mb->setItemEnabled( 800, ViewOCC ); // Create Group
+  Mb->setItemEnabled( 801, ViewOCC ); // Edit Group
   Mb->setItemEnabled(9998, ViewOCC ); // MENU BLOCKS - MULTI-TRANSFORMATION
 
   geomGUI->EmitSignalCloseAllDialogs();