Changeset 506 for trunk/geant4/interfaces/basic
- Timestamp:
- Jun 14, 2007, 5:39:43 PM (17 years ago)
- Location:
- trunk/geant4/interfaces/basic
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/geant4/interfaces/basic/include/G4UIQt.hh
r504 r506 96 96 // G4String GetCommand(Widget); 97 97 private: 98 void SecondaryLoop(G4String); 98 void SecondaryLoop(G4String); // a VIRER 99 99 G4bool GetHelpChoice(G4int&); 100 void TerminalHelp(G4String); 101 100 102 void ExitHelp(); 101 103 private: -
trunk/geant4/interfaces/basic/src/G4UIQt.cc
r505 r506 57 57 #include <QtGui/qsplitter.h> 58 58 #include <QtGui/qscrollbar.h> 59 #include <QtGui/qtreewidget.h> 60 #include <QtGui/qdialog.h> 59 61 60 62 #include <stdlib.h> … … 196 198 ((QApplication*)interactorManager->GetMainInteractor())->exec(); 197 199 // on ne passe pas le dessous ? FIXME ???? 198 199 200 201 202 200 // je ne pense pas 13/06 203 201 204 202 // void* event; // TO KEEP … … 207 205 // if(exitSession==true) break; // TO KEEP 208 206 // } // TO KEEP 209 interactorManager->EnableSecondaryLoop (); // TO KEEP 207 208 interactorManager->EnableSecondaryLoop (); 210 209 printf("enable secondary loop\n"); 211 return this; // TO KEEP210 return this; 212 211 } 213 212 /***************************************************************************/ … … 444 443 fCommandHistoryArea->append(fCommandArea->text()); 445 444 if(fHelp==true) { 445 printf ("ne doit plus passer ici\n"); 446 446 exitHelp = true; 447 447 fHelp = ConvertStringToInt(command.data(),fHelpChoice); 448 448 } 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 } 450 455 if(exitSession==true) 451 456 SessionTerminate(); … … 483 488 484 489 #endif 490 491 void 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
Note: See TracChangeset
for help on using the changeset viewer.