Changeset 524 for trunk


Ignore:
Timestamp:
Jun 22, 2007, 12:41:05 PM (17 years ago)
Author:
garnier
Message:

r652@mac-90108: laurentgarnier | 2007-06-22 12:43:09 +0200
en test

Location:
trunk/geant4/interfaces/basic
Files:
2 edited

Legend:

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

    r519 r524  
    102102  void TerminalHelp(G4String);
    103103  void CreateChildTree(QTreeWidgetItem*,G4UIcommandTree*);
     104  QTreeWidgetItem* FindTreeItem(QTreeWidgetItem *,QString);
     105
    104106  QString GetCommandList(G4UIcommand*);
    105   void expandHelpItem (QTreeWidgetItem *,G4UIcommand*);
    106107
    107108  G4bool GetHelpChoice(G4int&) ;// have to be implemeted because we heritate from G4VBasicShell
  • trunk/geant4/interfaces/basic/src/G4UIQt.cc

    r523 r524  
    1 // TODO !
    2 
    31//
    42// ********************************************************************
     
    6563static G4bool exitSession = true;
    6664static G4bool exitPause = true;
    67 /***************************************************************************/
    68 /**
    69  Build a Qt window with a menubar, output area and promt area
    70       +-----------------------+
    71       |exit menu|             |
    72       |                       |
    73       | +-------------------+ |
    74       | |                   | |
    75       | |  Output area      | |
    76       | |                   | |
    77       | +-------------------+ |
    78       |     | clear |         |
    79       | +-------------------+ |
    80       | |  promt history    | |
    81       | +-------------------+ |
    82       | +-------------------+ |
    83       | |> promt area       | |
    84       | +-------------------+ |
    85       +-----------------------+
    86 */
    87 
     65
     66/**   Build a Qt window with a menubar, output area and promt area<br>
     67<pre>
     68   +-----------------------+
     69   |exit menu|             |
     70   |                       |
     71   | +-------------------+ |
     72   | |                   | |
     73   | |  Output area      | |
     74   | |                   | |
     75   | +-------------------+ |
     76   |      | clear |        |
     77   | +-------------------+ |
     78   | |  promt history    | |
     79   | +-------------------+ |
     80   | +-------------------+ |
     81   | |> promt area       | |
     82   | +-------------------+ |
     83   +-----------------------+
     84</pre>
     85*/
    8886G4UIQt::G4UIQt (
    89  int argc,
    90  char** argv
    91 )
     87                int argc,
     88                char** argv
     89                )
    9290  :fHelpDialog(NULL)
    93 
    94 /***************************************************************************/
    95 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
    9691{
    9792  G4Qt* interactorManager = G4Qt::getInstance ();
     
    166161  if(UI!=NULL) UI->SetCoutDestination(this);  // TO KEEP
    167162}
    168 /***************************************************************************/
     163
     164
     165
    169166G4UIQt::~G4UIQt(
    170167)
    171 /***************************************************************************/
    172 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
    173168{
    174169  G4UImanager* UI = G4UImanager::GetUIpointer();  // TO KEEP
     
    182177    delete fMainWindow;
    183178}
    184 /***************************************************************************/
    185 /*
    186     Start the Qt main loop
    187  */
     179
     180
     181
     182
     183/**   Start the Qt main loop
     184*/
    188185G4UIsession* G4UIQt::SessionStart (
    189186)
    190 /***************************************************************************/
    191 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
    192187{
    193188
     
    204199  // je ne pense pas 13/06
    205200
    206 //   void* event; // TO KEEP
    207 //   while((event = interactorManager->GetEvent())!=NULL) {  // TO KEEP
    208 //     interactorManager->DispatchEvent(event); // TO KEEP
    209 //     if(exitSession==true) break; // TO KEEP
    210 //   } // TO KEEP
     201  //   void* event; // TO KEEP
     202  //   while((event = interactorManager->GetEvent())!=NULL) {  // TO KEEP
     203  //     interactorManager->DispatchEvent(event); // TO KEEP
     204  //     if(exitSession==true) break; // TO KEEP
     205  //   } // TO KEEP
    211206
    212207  interactorManager->EnableSecondaryLoop ();
     
    214209  return this;
    215210}
    216 /***************************************************************************/
    217 
    218 /**
    219   Display the prompt in the prompt area
    220  */
     211
     212
     213/**   Display the prompt in the prompt area
     214   @param aPrompt : string to display as the promt label
     215   //FIXME : probablement inutile puisque le seul a afficher qq chose d'autre
     216   que "session" est SecondaryLoop()
     217*/
    221218void G4UIQt::Prompt (
    222219 G4String aPrompt
    223220)
    224 /***************************************************************************/
    225 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
    226221{
    227222  fCommandLabel->setText((char*)aPrompt.data());
    228223}
    229 /***************************************************************************/
     224
     225
    230226void G4UIQt::SessionTerminate (
    231227)
    232 /***************************************************************************/
    233 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
    234228{
    235229  G4Qt* interactorManager = G4Qt::getInstance ();
     
    237231  ((QApplication*)interactorManager->GetMainInteractor())->exit();
    238232}
    239 /***************************************************************************/
     233
     234
     235
     236/**
     237   Called by intercoms/src/G4UImanager.cc<br>
     238   Called by visualization/management/src/G4VisCommands.cc with "EndOfEvent" argument<br>
     239   It have to pause the session command terminal.<br>
     240   Call SecondaryLoop to wait for exit event<br>
     241   @param aState
     242   @see : G4VisCommandReviewKeptEvents::SetNewValue
     243*/
    240244void G4UIQt::PauseSessionStart (
    241  G4String a_state
    242 )
    243 /***************************************************************************/
    244 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
     245 G4String aState
     246)
    245247{
    246248  printf("G4UIQt::PauseSessionStart\n");
    247   if(a_state=="G4_pause> ") {  // TO KEEP
     249  if(aState=="G4_pause> ") {  // TO KEEP
    248250    SecondaryLoop ("Pause, type continue to exit this state"); // TO KEEP
    249251  } // TO KEEP
    250252
    251   if(a_state=="EndOfEvent") { // TO KEEP
     253  if(aState=="EndOfEvent") { // TO KEEP
    252254    // Picking with feed back in event data Done here !!!
    253255    SecondaryLoop ("End of event, type continue to exit this state"); // TO KEEP
    254256  } // TO KEEP
    255257}
    256 /***************************************************************************/
     258
     259
     260
     261/**
     262   Begin the secondary loop
     263   @param a_prompt : label to display as the prompt label
     264 */
    257265void G4UIQt::SecondaryLoop (
    258  G4String a_prompt
    259 )
    260 /***************************************************************************/
    261 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
     266 G4String aPrompt
     267)
    262268{
    263269  printf("G4UIQt::SecondaryLoop\n");
    264270  G4Qt* interactorManager = G4Qt::getInstance (); // TO KEEP ?
    265   Prompt(a_prompt); // TO KEEP
     271  Prompt(aPrompt); // TO KEEP
    266272  exitPause = false; // TO KEEP
    267273  void* event; // TO KEEP
     
    272278  Prompt("session"); // TO KEEP
    273279}
    274 /***************************************************************************/
    275 /**
    276   Receive a cout from Geant4. We have to display it in the cout zone
    277  */
     280
     281
     282
     283/**
     284   Receive a cout from Geant4. We have to display it in the cout zone
     285   @param aString : label to add in the display area
     286*/
    278287G4int G4UIQt::ReceiveG4cout (
    279  G4String a_string
    280 )
    281 /***************************************************************************/
    282 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
    283 {
    284   fTextArea->append(QString((char*)a_string.data()).trimmed());
     288 G4String aString
     289)
     290{
     291  fTextArea->append(QString((char*)aString.data()).trimmed());
    285292  fTextArea->verticalScrollBar()->setSliderPosition(fTextArea->verticalScrollBar()->maximum());
    286293  return 0;
    287294}
    288 /***************************************************************************/
    289 /**
    290   Receive a cerr from Geant4. We have to display it in the cout zone
    291  */
     295
     296
     297/**
     298   Receive a cerr from Geant4. We have to display it in the cout zone
     299   @param aString : label to add in the display area
     300*/
    292301G4int G4UIQt::ReceiveG4cerr (
    293  G4String a_string
    294 )
    295 /***************************************************************************/
    296 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
     302 G4String aString
     303)
    297304{
    298305  QColor previousColor = fTextArea->textColor();
    299306  fTextArea->setTextColor(Qt::red);
    300   fTextArea->append(QString((char*)a_string.data()).trimmed());
     307  fTextArea->append(QString((char*)aString.data()).trimmed());
    301308  fTextArea->setTextColor(previousColor);
    302309  fTextArea->verticalScrollBar()->setSliderPosition(fTextArea->verticalScrollBar()->maximum());
     
    304311}
    305312
    306 /***************************************************************************/
     313
     314
     315/**
     316   Add a new menu to the menu bar
     317   @param aName name of menu
     318   @param aLabel label to display
     319 */
    307320void G4UIQt::AddMenu (
    308  const char* a_name
    309 ,const char* a_label
    310 )
    311 /***************************************************************************/
    312 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
    313 {
    314   printf("G4UIQt::AddMenu %s %s\n",a_name,a_label);
    315 
    316   //  QMenu *fileMenu = fMainWindow->menuBar()->addMenu(a_label);
    317   QMenu *fileMenu = new QMenu(a_label);
     321 const char* aName
     322,const char* aLabel
     323)
     324{
     325  QMenu *fileMenu = new QMenu(aLabel);
    318326  fMainWindow->menuBar()->insertMenu(fMainWindow->menuBar()->actions().last(),fileMenu);
    319   AddInteractor (a_name,(G4Interactor)fileMenu);
    320 }
    321 /***************************************************************************/
     327  AddInteractor (aName,(G4Interactor)fileMenu);
     328}
     329
     330
     331/**
     332   Add a new button to a menu
     333   @param aMenu : parent menu
     334   @param aLabel : label to display
     335   @param aCommand : command to execute as a callback
     336 */
    322337void G4UIQt::AddButton (
    323  const char* a_menu
    324 ,const char* a_label
    325 ,const char* a_command
    326 )
    327 /***************************************************************************/
    328 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
    329 {
    330   if(a_menu==NULL) return; // TO KEEP
    331   if(a_label==NULL) return; // TO KEEP
    332   if(a_command==NULL) return; // TO KEEP
    333   QMenu *parent = (QMenu*)GetInteractor(a_menu);
     338 const char* aMenu
     339,const char* aLabel
     340,const char* aCommand
     341)
     342{
     343  if(aMenu==NULL) return; // TO KEEP
     344  if(aLabel==NULL) return; // TO KEEP
     345  if(aCommand==NULL) return; // TO KEEP
     346  QMenu *parent = (QMenu*)GetInteractor(aMenu);
    334347  if(parent==NULL) return;
    335348 
    336349  signalMapper = new QSignalMapper(this);
    337   QAction *action = parent->addAction(a_label, signalMapper, SLOT(map()));
    338   signalMapper->setMapping(action, QString(a_command));
     350  QAction *action = parent->addAction(aLabel, signalMapper, SLOT(map()));
     351  signalMapper->setMapping(action, QString(aCommand));
    339352  connect(signalMapper, SIGNAL(mapped(const QString &)),this, SLOT(buttonCallback(const QString&)));
    340353}
     
    344357
    345358/**
    346   Open the help dialog in a separate window.
    347   This will be display as a tree widget
    348   Implementation of <b>void G4VBasicShell::TerminalHelp(G4String newCommand)</b>
    349 
    350   @param newCommand : open the tree widget item on this command if is set
    351  */
    352 void G4UIQt::TerminalHelp(G4String newCommand)
    353 {
    354 
    355 
     359   Open the help dialog in a separate window.<br>
     360   This will be display as a tree widget.<br>
     361   Implementation of <b>void G4VBasicShell::TerminalHelp(G4String newCommand)</b>
     362
     363   @param newCommand : open the tree widget item on this command if is set
     364*/
     365void G4UIQt::TerminalHelp(
     366 G4String newCommand
     367)
     368{
     369  // Create the help dialog
    356370  if (!fHelpDialog) {
    357371    fHelpDialog = new QDialog;
     
    416430  G4String targetCom="";
    417431  if( i != std::string::npos )
    418   {
    419     G4String newValue = newCommand(i+1,newCommand.length()-(i+1));
    420     newValue.strip(G4String::both);
    421     targetCom = ModifyToFullPathCommand( newValue );
    422     printf("test : av:%s-- ap:%s--\n",((char*)newValue.data()),((char*)targetCom.data()));
    423   }
     432    {
     433      G4String newValue = newCommand(i+1,newCommand.length()-(i+1));
     434      newValue.strip(G4String::both);
     435      targetCom = ModifyToFullPathCommand( newValue );
     436      printf("test : av:%s-- ap:%s--\n",((char*)newValue.data()),((char*)targetCom.data()));
     437    }
    424438  if (targetCom != "") {
    425     QList<QTreeWidgetItem *> list = fHelpTreeWidget->findItems(QString(((char*)targetCom.data())),Qt::MatchFixedString,0);
    426     for (int a=0;a<13;a++) {
    427       printf("verif.... =%s= +%s+\n",fHelpTreeWidget->topLevelItem(a)->text(0).toStdString().c_str(),((char*)targetCom.data()));
     439    QTreeWidgetItem* findItem = NULL;
     440    for (int a=0;a<fHelpTreeWidget->topLevelItemCount();a++) {
     441      if (!findItem) {
     442        findItem = FindTreeItem(fHelpTreeWidget->topLevelItem(a),QString((char*)targetCom.data()));
     443      }
    428444    }
    429445
    430     if (!list.isEmpty()) {
    431       if (list.first()->childCount() >0) 
    432         list.first()->setExpanded(true);
    433      
     446    if (findItem) {     
     447      // clear old selection
     448      fHelpTreeWidget->clearSelection();
     449
    434450      //collapsed open item
    435451      QList<QTreeWidgetItem *> selected;
    436452      selected = fHelpTreeWidget->selectedItems();
    437453      if ( selected.count() != 0 ) {
    438         fHelpTreeWidget->collapseItem (selected.at( 0 ) );
     454        QTreeWidgetItem * tmp =selected.at( 0 );
     455        while ( tmp) {
     456          tmp->setExpanded(false);
     457          tmp = findItem->parent();
     458        }
    439459      }
    440460     
    441       // clear old selection
    442       fHelpTreeWidget->clearSelection();
    443       list.first()->setSelected(true);
     461      // set new selection
     462      findItem->setSelected(true);
    444463     
     464      // expand parent item
     465      while ( findItem) {
     466        findItem->setExpanded(true);
     467        findItem = findItem->parent();
     468      }
     469
    445470      // Call the update of the right textArea
    446471      helpTreeCallback();
    447472    }
    448   } 
     473  }
    449474  fHelpDialog->setWindowTitle("Help on commands");
    450475  fHelpDialog->resize(800,600);
     
    457482
    458483
    459 void G4UIQt::CreateChildTree(QTreeWidgetItem *a_parent,G4UIcommandTree *a_commandTree) {
     484/**
     485   Fill the Help Tree Widget
     486   @param aParent : parent item to fill
     487   @param aCommandTree : commandTree node associate with this part of the Tree
     488*/
     489void G4UIQt::CreateChildTree(
     490 QTreeWidgetItem *aParent
     491,G4UIcommandTree *aCommandTree
     492)
     493{
    460494
    461495  // Creating new item
    462496  QTreeWidgetItem * newItem;
    463497
    464 
    465498  // Get the Sub directories
    466   for (int a=0;a<a_commandTree->GetTreeEntry();a++) {
     499  for (int a=0;a<aCommandTree->GetTreeEntry();a++) {
    467500   
    468501    QStringList stringList;
    469     stringList << QString((char*)(a_commandTree->GetTree(a+1)->GetPathName()).data()).trimmed()  ;
    470     stringList << QString((char*)(a_commandTree->GetTree(a+1)->GetTitle()).data()).trimmed()  ;
     502    stringList << QString((char*)(aCommandTree->GetTree(a+1)->GetPathName()).data()).trimmed()  ;
     503    stringList << QString((char*)(aCommandTree->GetTree(a+1)->GetTitle()).data()).trimmed()  ;
    471504    newItem = new QTreeWidgetItem(stringList);
    472505
    473     CreateChildTree(newItem,a_commandTree->GetTree(a+1));
    474     a_parent->addChild(newItem);
     506    CreateChildTree(newItem,aCommandTree->GetTree(a+1));
     507    aParent->addChild(newItem);
    475508  }
    476509
     
    479512  // Get the Commands
    480513
    481   for (int a=0;a<a_commandTree->GetCommandEntry();a++) {
     514  for (int a=0;a<aCommandTree->GetCommandEntry();a++) {
    482515   
    483516    QStringList stringList;
    484     stringList << QString((char*)(a_commandTree->GetCommand(a+1)->GetCommandPath()).data()).trimmed()  ;
    485     stringList << QString((char*)(a_commandTree->GetCommand(a+1)->GetCommandPath()).data()).trimmed()  ;
     517    stringList << QString((char*)(aCommandTree->GetCommand(a+1)->GetCommandPath()).data()).trimmed()  ;
     518    stringList << QString((char*)(aCommandTree->GetCommand(a+1)->GetCommandPath()).data()).trimmed()  ;
    486519    newItem = new QTreeWidgetItem(stringList);
    487520     
    488     a_parent->addChild(newItem);
     521    aParent->addChild(newItem);
    489522    newItem->setExpanded(false);
    490523  }
     
    493526
    494527/**
    495   This fonction return the command list parameters in a QString
    496 
    497  */
    498 /***************************************************************************/
     528*/
     529QTreeWidgetItem* G4UIQt::FindTreeItem(
     530 QTreeWidgetItem *aParent
     531,QString aCommand
     532)
     533{
     534  if (aParent->text(0) == aCommand)
     535    return aParent;
     536 
     537  QTreeWidgetItem * tmp = NULL;
     538  for (int a=0;a<aParent->childCount();a++) {
     539    if (!tmp)
     540      tmp = FindTreeItem(aParent->child(a),aCommand);
     541  }
     542  return tmp;
     543}
     544
     545
     546/**
     547   Build the command list parameters in a QString<br>
     548   Reimplement partialy the G4UIparameter.cc
     549   @param aCommand : command to list parameters
     550   @see G4UIparameter::List()
     551   @return the command list parameters
     552*/
    499553QString G4UIQt::GetCommandList (
    500   G4UIcommand *a_command
    501 )
    502 /***************************************************************************/
    503 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
     554 G4UIcommand *aCommand
     555)
    504556{
    505557
    506558  QString txt;
    507   G4String commandPath = a_command->GetCommandPath();
    508   G4String rangeString = a_command->GetRange();
     559  G4String commandPath = aCommand->GetCommandPath();
     560  G4String rangeString = aCommand->GetRange();
    509561
    510562  if((commandPath.length()-1)!='/')
    511   {
    512     txt += "Command " + QString((char*)(commandPath).data()) + "\n";
    513   }
     563    {
     564      txt += "Command " + QString((char*)(commandPath).data()) + "\n";
     565    }
    514566  txt += "Guidance :\n";
    515   G4int n_guidanceEntry = a_command->GetGuidanceEntries();
     567  G4int n_guidanceEntry = aCommand->GetGuidanceEntries();
    516568
    517569  for( G4int i_thGuidance=0; i_thGuidance < n_guidanceEntry; i_thGuidance++ )
    518     { txt += QString((char*)(a_command->GetGuidanceLine(i_thGuidance)).data()) + "\n"; }
     570    { txt += QString((char*)(aCommand->GetGuidanceLine(i_thGuidance)).data()) + "\n"; }
    519571  if( ! rangeString.isNull() )
    520572    { txt += " Range of parameters : " + QString((char*)(rangeString).data()) + "\n"; }
    521   G4int n_parameterEntry = a_command->GetParameterEntries();
     573  G4int n_parameterEntry = aCommand->GetParameterEntries();
    522574  if( n_parameterEntry > 0 )
    523575    {
     
    527579
    528580      for( G4int i_thParameter=0; i_thParameter<n_parameterEntry; i_thParameter++ )
    529         { param = a_command->GetParameter(i_thParameter);
     581        { param = aCommand->GetParameter(i_thParameter);
    530582          txt += "\nParameter : " + QString((char*)(param->GetParameterName()).data()) + "\n";
    531583          if( ! param->GetParameterGuidance().isNull() )
     
    551603
    552604
    553 /***************************************************************************/
    554 void G4UIQt::expandHelpItem (
    555  QTreeWidgetItem *a_parent
    556 ,G4UIcommand* a_expandCommand
    557 )
    558 /***************************************************************************/
    559 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
    560 {
    561 }
    562 
    563 /***************************************************************************/
     605/**
     606  Implement G4VBasicShell vurtual function
     607 */
    564608G4bool G4UIQt::GetHelpChoice(
    565609 G4int& aInt
    566610)
    567 /***************************************************************************/
    568 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
    569611{
    570612  printf("G4UIQt::GetHelpChoice SHOULD NEVER GO HERE");
     
    572614}
    573615
    574 /***************************************************************************/
     616
     617/**
     618   Implement G4VBasicShell vurtual function
     619*/
    575620void G4UIQt::ExitHelp(
    576621)
    577 /***************************************************************************/
    578 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
    579622{
    580623  printf("G4UIQt::ExitHelp SHOULD NEVER GO HERE");
     
    583626
    584627/**
    585  Event filter method. Every event from QtApplication goes here.
    586  We apply a filter only for the Up and Down Arrow press when the QLineEdit
    587  is active. If this filter match, Up arrow we give the previous command
    588  and Down arrow will give the next if exist.
    589  @param obj Emitter of the event
    590  @param event Kind of event
    591 */
    592 /***************************************************************************/
     628   Event filter method. Every event from QtApplication goes here.<br/>
     629   We apply a filter only for the Up and Down Arrow press when the QLineEdit<br/>
     630   is active. If this filter match, Up arrow we give the previous command<br/>
     631   and Down arrow will give the next if exist.<br/>
     632   @param obj Emitter of the event
     633   @param event Kind of event
     634*/
    593635bool G4UIQt::eventFilter(
    594  QObject *obj
    595 ,QEvent *event
    596 )
    597 /***************************************************************************/
    598 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
     636                         QObject *obj
     637                         ,QEvent *event
     638                         )
    599639{
    600640  if (obj == fCommandHistoryArea) {
     
    649689/***************************************************************************/
    650690
    651 /***************************************************************************/
     691/**
     692   Called when user give "help" command.
     693*/
    652694void G4UIQt::showHelpCallback (
    653695)
    654 /***************************************************************************/
    655 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
    656696{
    657697  TerminalHelp("");
    658698}
    659699
    660 /***************************************************************************/
     700
     701/**
     702   Called when user click on clear button. Clear the text Output area
     703*/
    661704void G4UIQt::clearButtonCallback (
    662705)
    663 /***************************************************************************/
    664 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
    665706{
    666707  fTextArea->clear();
     
    669710
    670711/**
    671   Callback call when "click on a menu entry.
    672   Send the associated command to geant4
    673  */
     712   Callback call when "click on a menu entry.<br>
     713   Send the associated command to geant4
     714*/
    674715void G4UIQt::commandEnteredCallback (
    675716)
    676 /***************************************************************************/
    677 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
    678717{
    679718  G4String command (fCommandArea->text().toStdString().c_str());
     
    685724
    686725    if (command(0,4) != "help") {
    687         ApplyShellCommand (command,exitSession,exitPause);
     726      ApplyShellCommand (command,exitSession,exitPause);
    688727    } else {
    689728      TerminalHelp(command);
     
    695734}
    696735
    697 /**
    698   Callback call when "enter" clicked on the command zone.
    699   Send the command to geant4
    700  */
     736
     737/**
     738   Callback call when "enter" clicked on the command zone.<br>
     739   Send the command to geant4
     740   @param aCommand
     741*/
    701742void G4UIQt::buttonCallback (
    702   const QString& a_command
    703 )
    704 /***************************************************************************/
    705 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
    706 {
    707   G4String ss = G4String(a_command.toStdString().c_str());
     743 const QString& aCommand
     744)
     745{
     746  G4String ss = G4String(aCommand.toStdString().c_str());
    708747  printf ("debug : execute:\n-%s- %d %d \n",ss.data(),exitSession,exitPause);
    709748  ApplyShellCommand(ss,exitSession,exitPause);
     
    711750    SessionTerminate();
    712751}
    713 /**
    714 This callback is activated when user selected a item in the help tree
    715  */
     752
     753
     754
     755/**
     756   This callback is activated when user selected a item in the help tree
     757*/
    716758void G4UIQt::helpTreeCallback (
    717759)
    718 /***************************************************************************/
    719 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
    720760{
    721761  //  G4bool GetHelpChoice(G4int&);
     
    748788
    749789
    750 
     790/**
     791   Callback called when user select an old command in the command history<br>
     792   Give it to the command area.
     793*/
    751794void G4UIQt::commandHistoryCallback(
    752795)
    753 /***************************************************************************/
    754 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
    755 {
    756   //  G4bool GetHelpChoice(G4int&);
     796{
    757797  QListWidgetItem* item =  NULL;
    758798  if (!fCommandHistoryArea)
Note: See TracChangeset for help on using the changeset viewer.