Changeset 715 for trunk/geant4


Ignore:
Timestamp:
Feb 6, 2008, 6:52:42 PM (16 years ago)
Author:
garnier
Message:

correction du ticket #116. Correction du menu contextuel full screen qui n etait pas remis a jour lors du clic sur escape

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/geant4/visualization/OpenGL/src/G4OpenGLQtViewer.cc

    r714 r715  
    422422
    423423#if QT_VERSION < 0x030200
    424   QAction *polyhedron = new QAction("&Polyhedron","&Polyhedron",CTRL+Key_P,mRepresentation);
    425   QAction *nurbs = new QAction("&NURBS","&NURBS",CTRL+Key_N,mRepresentation);
    426 
    427   QAction *ortho = new QAction("&Orthographic","&Orthographic",CTRL+Key_O,mProjection);
    428   QAction *perspective = new QAction("&Perspective","&Perspective",CTRL+Key_P,mProjection);
     424  QAction *polyhedron = new QAction("&Polyhedron","&Polyhedron",CTRL+Key_P,mRepresentation,0,true);
     425  QAction *nurbs = new QAction("&NURBS","&NURBS",CTRL+Key_N,mRepresentation,0,true);
     426
     427  QAction *ortho = new QAction("&Orthographic","&Orthographic",CTRL+Key_O,mProjection,0,true);
     428  QAction *perspective = new QAction("&Perspective","&Perspective",CTRL+Key_P,mProjection,0,true);
    429429#else
    430430  QAction *polyhedron = new QAction("&Polyhedron",CTRL+Key_P,mRepresentation);
     
    433433  QAction *ortho = new QAction("&Orthographic",CTRL+Key_O,mProjection);
    434434  QAction *perspective = new QAction("&Perspective",CTRL+Key_P,mProjection);
     435  polyhedron->setToggleAction(true);
     436  nurbs->setToggleAction(true);
     437  ortho->setToggleAction(true);
     438  perspective->setToggleAction(true);
    435439#endif
    436440  polyhedron->addTo(mRepresentation);
     
    590594
    591595#if QT_VERSION < 0x030200
    592   QAction *white = new QAction("&White","&White",CTRL+Key_W,mBackground);
    593   QAction *black =  new QAction("&Black","&Black",CTRL+Key_B,mBackground);
     596  QAction *white = new QAction("&White","&White",CTRL+Key_W,mBackground,0,true);
     597  QAction *black =  new QAction("&Black","&Black",CTRL+Key_B,mBackground,0,true);
    594598#else
    595599  QAction *white = new QAction("&White",CTRL+Key_W,mBackground);
    596600  QAction *black =  new QAction("&Black",CTRL+Key_B,mBackground);
     601  white->setToggleAction(true);
     602  black->setToggleAction(true);
    597603#endif
    598604  white->addTo(mBackground);
     
    620626
    621627#if QT_VERSION < 0x030200
    622   QAction *createEPS =  new QAction("&Save as ...","&Save as ...",CTRL+Key_S,mActions);
     628  QAction *createEPS =  new QAction("&Save as ...","&Save as ...",CTRL+Key_S,mActions,0,true);
    623629#else
    624630  QAction *createEPS =  new QAction("&Save as ...",CTRL+Key_S,mActions);
     631  createEPS->setToggleAction(true);
    625632#endif
    626633  createEPS->addTo(mActions);
     
    651658
    652659#if QT_VERSION < 0x030200
    653   QAction *transparencyOn = new QAction("&On","&On",CTRL+Key_O,mTransparency);
    654   QAction *transparencyOff = new QAction("&Off","&Off",CTRL+Key_F,mTransparency);
     660  QAction *transparencyOn = new QAction("&On","&On",CTRL+Key_O,mTransparency,0,true);
     661  QAction *transparencyOff = new QAction("&Off","&Off",CTRL+Key_F,mTransparency,0,true);
    655662#else
    656663  QAction *transparencyOn = new QAction("&On",CTRL+Key_O,mTransparency);
    657664  QAction *transparencyOff = new QAction("&Off",CTRL+Key_F,mTransparency);
     665  transparencyOn->setToggleAction(true);
     666  transparencyOff->setToggleAction(true);
    658667#endif
    659668  transparencyOn->addTo(mTransparency);
     
    682691
    683692#if QT_VERSION < 0x030200
    684   QAction *antialiasingOn = new QAction("&On","&On",CTRL+Key_O,mAntialiasing);
    685   QAction *antialiasingOff = new QAction("&Off","&Off",CTRL+Key_F,mAntialiasing);
     693  QAction *antialiasingOn = new QAction("&On","&On",CTRL+Key_O,mAntialiasing,0,true);
     694  QAction *antialiasingOff = new QAction("&Off","&Off",CTRL+Key_F,mAntialiasing,0,true);
    686695#else
    687696  QAction *antialiasingOn = new QAction("&On",CTRL+Key_O,mAntialiasing);
    688697  QAction *antialiasingOff = new QAction("&Off",CTRL+Key_F,mAntialiasing);
     698  antialiasingOn->setToggleAction(true);
     699  antialiasingOff->setToggleAction(true);
    689700#endif
    690701  antialiasingOn->addTo(mAntialiasing);
     
    710721
    711722#if QT_VERSION < 0x030200
    712   QAction *haloingOn = new QAction("&On","&On",CTRL+Key_O,mHaloing);
    713   QAction *haloingOff = new QAction("&Off","&Off",CTRL+Key_F,mHaloing);
     723  QAction *haloingOn = new QAction("&On","&On",CTRL+Key_O,mHaloing,0,true);
     724  QAction *haloingOff = new QAction("&Off","&Off",CTRL+Key_F,mHaloing,0,true);
    714725#else
    715726  QAction *haloingOn = new QAction("&On",CTRL+Key_O,mHaloing);
    716727  QAction *haloingOff = new QAction("&Off",CTRL+Key_F,mHaloing);
     728  haloingOn->setToggleAction(true);
     729  haloingOff->setToggleAction(true);
    717730#endif
    718731  haloingOn->addTo(mHaloing);
     
    736749
    737750#if QT_VERSION < 0x030200
    738   QAction *auxOn = new QAction("&On","&On",CTRL+Key_O,mAux);
    739   QAction *auxOff = new QAction("&Off","&Off",CTRL+Key_F,mAux);
     751  QAction *auxOn = new QAction("&On","&On",CTRL+Key_O,mAux,0,true);
     752  QAction *auxOff = new QAction("&Off","&Off",CTRL+Key_F,mAux,0,true);
    740753#else
    741754  QAction *auxOn = new QAction("&On",CTRL+Key_O,mAux);
    742755  QAction *auxOff = new QAction("&Off",CTRL+Key_F,mAux);
     756  auxOn->setToggleAction(true);
     757  auxOff->setToggleAction(true);
    743758#endif
    744759  auxOn->addTo(mAux);
     
    757772
    758773
    759 #if QT_VERSION >= 0x030200
     774
    760775#if QT_VERSION < 0x040000
    761776  QPopupMenu *mFullScreen = new QPopupMenu(mSpecial);
    762777  mSpecial->insertItem("Full screen",mFullScreen);
    763778
     779#if QT_VERSION < 0x030200
     780  QAction *fullOn = new QAction("&On","&On",CTRL+Key_O,mFullScreen,0,true);
     781  QAction *fullOff = new QAction("&Off","&Off",CTRL+Key_F,mFullScreen,0,true);
     782#else
    764783  QAction *fullOn = new QAction("&On",CTRL+Key_O,mFullScreen);
    765784  QAction *fullOff = new QAction("&Off",CTRL+Key_F,mFullScreen);
     785  fullOn->setToggleAction(true);
     786  fullOff->setToggleAction(true);
     787#endif
    766788  fullOn->addTo(mFullScreen);
    767789  fullOff->addTo(mFullScreen);
    768790#else
    769   QMenu *mFullScreen = mSpecial->addMenu("Full screen");
     791  QMenu *mFullScreen = mSpecial->addMenu("&Full screen");
    770792  QAction *fullOn = mFullScreen->addAction("On");
    771793  QAction *fullOff = mFullScreen->addAction("Off");
    772794#endif
    773795  createRadioAction(fullOn,fullOff,SLOT(toggleFullScreen()),2);
    774 #endif
    775796
    776797}
     
    808829  if (action1->parent()->inherits("QPopupMenu")){
    809830    ((QPopupMenu*)action1->parent())->setCheckable(true);
    810   }
    811   ((QPopupMenu*)action1->parent())->setItemChecked(0,true);
    812   ((QPopupMenu*)action1->parent())->setItemChecked(1,true);
     831    ((QPopupMenu*)action2->parent())->setCheckable(true);
     832  }
     833  action1->setOn(false);
     834   action2->setOn(false);
    813835
    814836  if (nCheck ==1)
    815     ((QPopupMenu*)action1->parent())->setItemChecked(0,true);
     837    action1->setOn(true);
    816838  else
    817     ((QPopupMenu*)action1->parent())->setItemChecked(1,true);
     839    action2->setOn(true);
    818840   
    819841  //FIXME : Should not work on Qt3
     
    18571879  if (event->key() == Qt::Key_Escape) { // escaped from full screen
    18581880    toggleFullScreen();
     1881    emit toggleMouseAction();
    18591882  }
    18601883  if (event->key() == Qt::Key_Plus) { // zoom in
Note: See TracChangeset for help on using the changeset viewer.