Ignore:
Timestamp:
Jun 14, 2007, 5:39:43 PM (17 years ago)
Author:
garnier
Message:

r616@mac-90108: laurentgarnier | 2007-06-13 17:38:01 +0200
debut de l aide sur une nouvealle fenetre

Location:
trunk/geant4/interfaces
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/geant4/interfaces/basic/include/G4UIQt.hh

    r504 r506  
    9696//   G4String GetCommand(Widget);
    9797private:
    98   void SecondaryLoop(G4String);
     98  void SecondaryLoop(G4String); // a VIRER
    9999  G4bool GetHelpChoice(G4int&);
     100  void TerminalHelp(G4String);
     101
    100102  void ExitHelp();
    101103private:
  • trunk/geant4/interfaces/basic/src/G4UIQt.cc

    r505 r506  
    5757#include <QtGui/qsplitter.h>
    5858#include <QtGui/qscrollbar.h>
     59#include <QtGui/qtreewidget.h>
     60#include <QtGui/qdialog.h>
    5961
    6062#include <stdlib.h>
     
    196198  ((QApplication*)interactorManager->GetMainInteractor())->exec();
    197199  // on ne passe pas le dessous ? FIXME ????
    198 
    199 
    200 
    201 
    202 
     200  // je ne pense pas 13/06
    203201
    204202//   void* event; // TO KEEP
     
    207205//     if(exitSession==true) break; // TO KEEP
    208206//   } // TO KEEP
    209    interactorManager->EnableSecondaryLoop (); // TO KEEP
     207
     208  interactorManager->EnableSecondaryLoop ();
    210209  printf("enable secondary loop\n");
    211   return this; // TO KEEP
     210  return this;
    212211}
    213212/***************************************************************************/
     
    444443    fCommandHistoryArea->append(fCommandArea->text());
    445444    if(fHelp==true) {
     445  printf ("ne doit plus passer ici\n");
    446446      exitHelp = true;
    447447      fHelp = ConvertStringToInt(command.data(),fHelpChoice);
    448448    } else {
    449       ApplyShellCommand (command,exitSession,exitPause);
     449      if (command(0,4) != "help") {
     450        ApplyShellCommand (command,exitSession,exitPause);
     451      } else {
     452        printf ("terminal help\n");
     453        TerminalHelp(command);
     454      }
    450455      if(exitSession==true)
    451456        SessionTerminate();
     
    483488
    484489#endif
     490
     491void G4UIQt::TerminalHelp(G4String newCommand)
     492{
     493  QDialog *helpDialog = new QDialog;
     494
     495  QSplitter *splitter = new QSplitter(Qt::Horizontal);
     496  QTextEdit *textArea = new QTextEdit();
     497  QPushButton *exitButton = new QPushButton("Exit");
     498  QTreeWidget *treeWidget = new QTreeWidget();
     499  connect(exitButton, SIGNAL(clicked()), helpDialog,SLOT(close()));
     500
     501  textArea->setReadOnly(true);
     502
     503  // Set layouts
     504  QHBoxLayout *splitterLayout = new QHBoxLayout;
     505
     506  QWidget* topWidget = new QWidget();
     507  QVBoxLayout *vLayout = new QVBoxLayout;
     508
     509  splitterLayout->addWidget(treeWidget);
     510  splitterLayout->addWidget(textArea);
     511  splitter->setLayout(splitterLayout);
     512
     513  vLayout->addWidget(splitter);
     514  vLayout->addWidget(exitButton);
     515  helpDialog->setLayout(vLayout);
     516
     517
     518  helpDialog->show();
     519  helpDialog->raise();
     520  helpDialog->activateWindow();
     521  ////////////////
     522
     523  printf ("G4UIQt::TerminalHelp \n");
     524//   G4UImanager* UI = G4UImanager::GetUIpointer();
     525//   if(UI==NULL) return;
     526//   G4UIcommandTree * treeTop = UI->GetTree();
     527//   size_t i = newCommand.index(" ");
     528//   if( i != std::string::npos )
     529//   {
     530//     G4String newValue = newCommand(i+1,newCommand.length()-(i+1));
     531//     newValue.strip(G4String::both);
     532//     G4String targetCom = ModifyToFullPathCommand( newValue );
     533//     G4UIcommand* theCommand = treeTop->FindPath( targetCom );
     534//     if( theCommand != NULL )
     535//     {
     536//       theCommand->List();
     537//       return;
     538//     }
     539//     else
     540//     {
     541//       G4cout << "Command <" << newValue << " is not found." << G4endl;
     542//       return;
     543//     }
     544//   }
     545
     546//   G4UIcommandTree * floor[10];
     547//   floor[0] = treeTop;
     548//   G4int iFloor = 0;
     549//   size_t prefixIndex = 1;
     550//   G4String prefix = GetCurrentWorkingDirectory();
     551//   while( prefixIndex < prefix.length()-1 )
     552//   {
     553//     size_t ii = prefix.index("/",prefixIndex);
     554//     floor[iFloor+1] =
     555//       floor[iFloor]->GetTree(G4String(prefix(0,ii+1)));
     556//     prefixIndex = ii+1;
     557//     iFloor++;
     558//   }
     559//   floor[iFloor]->ListCurrentWithNum();
     560//   // 1998 Oct 2 non-number input
     561//   while(1){
     562//    //G4cout << G4endl << "Type the number ( 0:end, -n:n level back ) : "<<std::flush;
     563//     G4cout << G4endl << "Type the number ( 0:end, -n:n level back ) : "<<G4endl;
     564//     G4int i;
     565//     if(!GetHelpChoice(i)){
     566//       G4cout << G4endl << "Not a number, once more" << G4endl;
     567//       continue;
     568//     } else if( i < 0 ){
     569//       iFloor += i;
     570//       if( iFloor < 0 ) iFloor = 0;
     571//       floor[iFloor]->ListCurrentWithNum();
     572//       continue;
     573//     } else if(i == 0) {
     574//       break;
     575//     } else if( i > 0 ) {
     576//       G4int n_tree = floor[iFloor]->GetTreeEntry();
     577//       if( i > n_tree )
     578//       {
     579//         if( i <= n_tree + floor[iFloor]->GetCommandEntry() )
     580//         {
     581//           floor[iFloor]->GetCommand(i-n_tree)->List();
     582//         }
     583//       }
     584//       else
     585//       {
     586//         floor[iFloor+1] = floor[iFloor]->GetTree(i);
     587//         iFloor++;
     588//         floor[iFloor]->ListCurrentWithNum();
     589//       }
     590//     }
     591//   }
     592  G4cout << "Exit from HELP." << G4endl << G4endl;
     593  //G4cout << G4endl;
     594  ExitHelp();
     595}
     596
     597
     598
     599
     600
     601
     602
     603
     604
     605
     606
     607
  • trunk/geant4/interfaces/common/src/G4Qt.cc

    r496 r506  
    132132//  QtAppNextEvent (appContext, &event);
    133133//  return         &event;
    134   printf(" Si j'ai bien compris, cette fonction ne sert à rien");
     134  printf("*");
    135135}
    136136/***************************************************************************/
Note: See TracChangeset for help on using the changeset viewer.