Changeset 524 for trunk/geant4/interfaces/basic/src
- Timestamp:
- Jun 22, 2007, 12:41:05 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/geant4/interfaces/basic/src/G4UIQt.cc
r523 r524 1 // TODO !2 3 1 // 4 2 // ******************************************************************** … … 65 63 static G4bool exitSession = true; 66 64 static G4bool exitPause = true; 67 /***************************************************************************/ 68 /** 69 Build a Qt window with a menubar, output area and promt area 70 71 72 73 74 75 76 77 78 | | clear ||79 80 81 82 83 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 */ 88 86 G4UIQt::G4UIQt ( 89 int argc,90 char** argv91 )87 int argc, 88 char** argv 89 ) 92 90 :fHelpDialog(NULL) 93 94 /***************************************************************************/95 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/96 91 { 97 92 G4Qt* interactorManager = G4Qt::getInstance (); … … 166 161 if(UI!=NULL) UI->SetCoutDestination(this); // TO KEEP 167 162 } 168 /***************************************************************************/ 163 164 165 169 166 G4UIQt::~G4UIQt( 170 167 ) 171 /***************************************************************************/172 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/173 168 { 174 169 G4UImanager* UI = G4UImanager::GetUIpointer(); // TO KEEP … … 182 177 delete fMainWindow; 183 178 } 184 /***************************************************************************/ 185 /* 186 Start the Qt main loop 187 */ 179 180 181 182 183 /** Start the Qt main loop 184 */ 188 185 G4UIsession* G4UIQt::SessionStart ( 189 186 ) 190 /***************************************************************************/191 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/192 187 { 193 188 … … 204 199 // je ne pense pas 13/06 205 200 206 // void* event; // TO KEEP207 // while((event = interactorManager->GetEvent())!=NULL) { // TO KEEP208 // interactorManager->DispatchEvent(event); // TO KEEP209 // if(exitSession==true) break; // TO KEEP210 // } // TO KEEP201 // 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 211 206 212 207 interactorManager->EnableSecondaryLoop (); … … 214 209 return this; 215 210 } 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 */ 221 218 void G4UIQt::Prompt ( 222 219 G4String aPrompt 223 220 ) 224 /***************************************************************************/225 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/226 221 { 227 222 fCommandLabel->setText((char*)aPrompt.data()); 228 223 } 229 /***************************************************************************/ 224 225 230 226 void G4UIQt::SessionTerminate ( 231 227 ) 232 /***************************************************************************/233 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/234 228 { 235 229 G4Qt* interactorManager = G4Qt::getInstance (); … … 237 231 ((QApplication*)interactorManager->GetMainInteractor())->exit(); 238 232 } 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 */ 240 244 void G4UIQt::PauseSessionStart ( 241 G4String a_state 242 ) 243 /***************************************************************************/ 244 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/ 245 G4String aState 246 ) 245 247 { 246 248 printf("G4UIQt::PauseSessionStart\n"); 247 if(a _state=="G4_pause> ") { // TO KEEP249 if(aState=="G4_pause> ") { // TO KEEP 248 250 SecondaryLoop ("Pause, type continue to exit this state"); // TO KEEP 249 251 } // TO KEEP 250 252 251 if(a _state=="EndOfEvent") { // TO KEEP253 if(aState=="EndOfEvent") { // TO KEEP 252 254 // Picking with feed back in event data Done here !!! 253 255 SecondaryLoop ("End of event, type continue to exit this state"); // TO KEEP 254 256 } // TO KEEP 255 257 } 256 /***************************************************************************/ 258 259 260 261 /** 262 Begin the secondary loop 263 @param a_prompt : label to display as the prompt label 264 */ 257 265 void G4UIQt::SecondaryLoop ( 258 G4String a_prompt 259 ) 260 /***************************************************************************/ 261 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/ 266 G4String aPrompt 267 ) 262 268 { 263 269 printf("G4UIQt::SecondaryLoop\n"); 264 270 G4Qt* interactorManager = G4Qt::getInstance (); // TO KEEP ? 265 Prompt(a _prompt); // TO KEEP271 Prompt(aPrompt); // TO KEEP 266 272 exitPause = false; // TO KEEP 267 273 void* event; // TO KEEP … … 272 278 Prompt("session"); // TO KEEP 273 279 } 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 */ 278 287 G4int 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()); 285 292 fTextArea->verticalScrollBar()->setSliderPosition(fTextArea->verticalScrollBar()->maximum()); 286 293 return 0; 287 294 } 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 */ 292 301 G4int G4UIQt::ReceiveG4cerr ( 293 G4String a_string 294 ) 295 /***************************************************************************/ 296 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/ 302 G4String aString 303 ) 297 304 { 298 305 QColor previousColor = fTextArea->textColor(); 299 306 fTextArea->setTextColor(Qt::red); 300 fTextArea->append(QString((char*)a _string.data()).trimmed());307 fTextArea->append(QString((char*)aString.data()).trimmed()); 301 308 fTextArea->setTextColor(previousColor); 302 309 fTextArea->verticalScrollBar()->setSliderPosition(fTextArea->verticalScrollBar()->maximum()); … … 304 311 } 305 312 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 */ 307 320 void 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); 318 326 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 */ 322 337 void 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); 334 347 if(parent==NULL) return; 335 348 336 349 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)); 339 352 connect(signalMapper, SIGNAL(mapped(const QString &)),this, SLOT(buttonCallback(const QString&))); 340 353 } … … 344 357 345 358 /** 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 */ 365 void G4UIQt::TerminalHelp( 366 G4String newCommand 367 ) 368 { 369 // Create the help dialog 356 370 if (!fHelpDialog) { 357 371 fHelpDialog = new QDialog; … … 416 430 G4String targetCom=""; 417 431 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 } 424 438 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 } 428 444 } 429 445 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 434 450 //collapsed open item 435 451 QList<QTreeWidgetItem *> selected; 436 452 selected = fHelpTreeWidget->selectedItems(); 437 453 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 } 439 459 } 440 460 441 // clear old selection 442 fHelpTreeWidget->clearSelection(); 443 list.first()->setSelected(true); 461 // set new selection 462 findItem->setSelected(true); 444 463 464 // expand parent item 465 while ( findItem) { 466 findItem->setExpanded(true); 467 findItem = findItem->parent(); 468 } 469 445 470 // Call the update of the right textArea 446 471 helpTreeCallback(); 447 472 } 448 } 473 } 449 474 fHelpDialog->setWindowTitle("Help on commands"); 450 475 fHelpDialog->resize(800,600); … … 457 482 458 483 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 */ 489 void G4UIQt::CreateChildTree( 490 QTreeWidgetItem *aParent 491 ,G4UIcommandTree *aCommandTree 492 ) 493 { 460 494 461 495 // Creating new item 462 496 QTreeWidgetItem * newItem; 463 497 464 465 498 // Get the Sub directories 466 for (int a=0;a<a _commandTree->GetTreeEntry();a++) {499 for (int a=0;a<aCommandTree->GetTreeEntry();a++) { 467 500 468 501 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() ; 471 504 newItem = new QTreeWidgetItem(stringList); 472 505 473 CreateChildTree(newItem,a _commandTree->GetTree(a+1));474 a _parent->addChild(newItem);506 CreateChildTree(newItem,aCommandTree->GetTree(a+1)); 507 aParent->addChild(newItem); 475 508 } 476 509 … … 479 512 // Get the Commands 480 513 481 for (int a=0;a<a _commandTree->GetCommandEntry();a++) {514 for (int a=0;a<aCommandTree->GetCommandEntry();a++) { 482 515 483 516 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() ; 486 519 newItem = new QTreeWidgetItem(stringList); 487 520 488 a _parent->addChild(newItem);521 aParent->addChild(newItem); 489 522 newItem->setExpanded(false); 490 523 } … … 493 526 494 527 /** 495 This fonction return the command list parameters in a QString 496 497 */ 498 /***************************************************************************/ 528 */ 529 QTreeWidgetItem* 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 */ 499 553 QString G4UIQt::GetCommandList ( 500 G4UIcommand *a_command 501 ) 502 /***************************************************************************/ 503 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/ 554 G4UIcommand *aCommand 555 ) 504 556 { 505 557 506 558 QString txt; 507 G4String commandPath = a _command->GetCommandPath();508 G4String rangeString = a _command->GetRange();559 G4String commandPath = aCommand->GetCommandPath(); 560 G4String rangeString = aCommand->GetRange(); 509 561 510 562 if((commandPath.length()-1)!='/') 511 {512 txt += "Command " + QString((char*)(commandPath).data()) + "\n";513 }563 { 564 txt += "Command " + QString((char*)(commandPath).data()) + "\n"; 565 } 514 566 txt += "Guidance :\n"; 515 G4int n_guidanceEntry = a _command->GetGuidanceEntries();567 G4int n_guidanceEntry = aCommand->GetGuidanceEntries(); 516 568 517 569 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"; } 519 571 if( ! rangeString.isNull() ) 520 572 { txt += " Range of parameters : " + QString((char*)(rangeString).data()) + "\n"; } 521 G4int n_parameterEntry = a _command->GetParameterEntries();573 G4int n_parameterEntry = aCommand->GetParameterEntries(); 522 574 if( n_parameterEntry > 0 ) 523 575 { … … 527 579 528 580 for( G4int i_thParameter=0; i_thParameter<n_parameterEntry; i_thParameter++ ) 529 { param = a _command->GetParameter(i_thParameter);581 { param = aCommand->GetParameter(i_thParameter); 530 582 txt += "\nParameter : " + QString((char*)(param->GetParameterName()).data()) + "\n"; 531 583 if( ! param->GetParameterGuidance().isNull() ) … … 551 603 552 604 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 */ 564 608 G4bool G4UIQt::GetHelpChoice( 565 609 G4int& aInt 566 610 ) 567 /***************************************************************************/568 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/569 611 { 570 612 printf("G4UIQt::GetHelpChoice SHOULD NEVER GO HERE"); … … 572 614 } 573 615 574 /***************************************************************************/ 616 617 /** 618 Implement G4VBasicShell vurtual function 619 */ 575 620 void G4UIQt::ExitHelp( 576 621 ) 577 /***************************************************************************/578 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/579 622 { 580 623 printf("G4UIQt::ExitHelp SHOULD NEVER GO HERE"); … … 583 626 584 627 /** 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 */ 593 635 bool G4UIQt::eventFilter( 594 QObject *obj 595 ,QEvent *event 596 ) 597 /***************************************************************************/ 598 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/ 636 QObject *obj 637 ,QEvent *event 638 ) 599 639 { 600 640 if (obj == fCommandHistoryArea) { … … 649 689 /***************************************************************************/ 650 690 651 /***************************************************************************/ 691 /** 692 Called when user give "help" command. 693 */ 652 694 void G4UIQt::showHelpCallback ( 653 695 ) 654 /***************************************************************************/655 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/656 696 { 657 697 TerminalHelp(""); 658 698 } 659 699 660 /***************************************************************************/ 700 701 /** 702 Called when user click on clear button. Clear the text Output area 703 */ 661 704 void G4UIQt::clearButtonCallback ( 662 705 ) 663 /***************************************************************************/664 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/665 706 { 666 707 fTextArea->clear(); … … 669 710 670 711 /** 671 Callback call when "click on a menu entry.672 Send the associated command to geant4673 712 Callback call when "click on a menu entry.<br> 713 Send the associated command to geant4 714 */ 674 715 void G4UIQt::commandEnteredCallback ( 675 716 ) 676 /***************************************************************************/677 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/678 717 { 679 718 G4String command (fCommandArea->text().toStdString().c_str()); … … 685 724 686 725 if (command(0,4) != "help") { 687 726 ApplyShellCommand (command,exitSession,exitPause); 688 727 } else { 689 728 TerminalHelp(command); … … 695 734 } 696 735 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 */ 701 742 void 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()); 708 747 printf ("debug : execute:\n-%s- %d %d \n",ss.data(),exitSession,exitPause); 709 748 ApplyShellCommand(ss,exitSession,exitPause); … … 711 750 SessionTerminate(); 712 751 } 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 */ 716 758 void G4UIQt::helpTreeCallback ( 717 759 ) 718 /***************************************************************************/719 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/720 760 { 721 761 // G4bool GetHelpChoice(G4int&); … … 748 788 749 789 750 790 /** 791 Callback called when user select an old command in the command history<br> 792 Give it to the command area. 793 */ 751 794 void G4UIQt::commandHistoryCallback( 752 795 ) 753 /***************************************************************************/ 754 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/ 755 { 756 // G4bool GetHelpChoice(G4int&); 796 { 757 797 QListWidgetItem* item = NULL; 758 798 if (!fCommandHistoryArea)
Note: See TracChangeset
for help on using the changeset viewer.