Changeset 501 for trunk/geant4
- Timestamp:
- Jun 12, 2007, 10:34:32 AM (17 years ago)
- Location:
- trunk/geant4/interfaces/basic
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/geant4/interfaces/basic/include/G4UIQt.hh
r494 r501 110 110 QTextEdit *fTextArea; 111 111 QTextEdit *fCommandHistoryArea; 112 std::vector <QString*> menuName; 113 std::vector <QString*> menuLabel; 112 114 113 115 private slots : -
trunk/geant4/interfaces/basic/src/G4UIQt.cc
r500 r501 61 61 62 62 static G4bool ConvertStringToInt(const char*,int&); 63 //static void ExecuteChangeSizeFunction(Widget);64 63 65 64 static G4bool exitSession = true; … … 145 144 146 145 147 // QMenu *menuFile = new QMenu("File"); 148 // fMainWindow->menuBar()->addMenu(menuFile); 149 146 QMenu *fileMenu = fMainWindow->menuBar()->addMenu(tr("&File")); 147 fileMenu->addAction("Quitter", this, SLOT(fMainWindow->close())); 148 fileMenu->addAction("Quitter2", this, SLOT(fMainWindow->close())); 149 fileMenu->addSeparator(); 150 150 151 151 … … 301 301 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/ 302 302 { 303 printf("G4UIQt::PauseSessionStart\n"); 303 304 if(a_state=="G4_pause> ") { // TO KEEP 304 305 SecondaryLoop ("Pause, type continue to exit this state"); // TO KEEP … … 317 318 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/ 318 319 { 320 printf("G4UIQt::SecondaryLoop\n"); 319 321 G4Qt* interactorManager = G4Qt::getInstance (); // TO KEEP ? 320 322 Prompt(a_prompt); // TO KEEP … … 355 357 fTextArea->append(QString((char*)a_string.data()).trimmed()); 356 358 fTextArea->setTextColor(previousColor); 359 fTextArea->verticalScrollBar()->setSliderPosition(fTextArea->verticalScrollBar()->maximum()); 357 360 return 0; 358 361 } … … 364 367 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/ 365 368 { 366 // fHelp = true; // TO KEEP 369 printf("G4UIQt::GetHelpChoice\n"); 370 371 fHelp = true; // TO KEEP 367 372 // // SecondaryLoop : // TO KEEP 368 //G4Qt* interactorManager = G4Qt::getInstance (); // TO KEEP ?369 //Prompt("Help"); // TO KEEP370 //exitHelp = false; // TO KEEP371 //void* event; // TO KEEP372 //while((event = interactorManager->GetEvent())!=NULL) { // TO KEEP373 //interactorManager->DispatchEvent(event); // TO KEEP374 //if(exitHelp==true) break; // TO KEEP375 //} // TO KEEP376 //Prompt("session"); // TO KEEP377 //// // TO KEEP378 //if(fHelp==false) return false; // TO KEEP379 //aInt = fHelpChoice; // TO KEEP380 //fHelp = false; // TO KEEP381 //return true; // TO KEEP373 G4Qt* interactorManager = G4Qt::getInstance (); // TO KEEP ? 374 Prompt("Help"); // TO KEEP 375 exitHelp = false; // TO KEEP 376 void* event; // TO KEEP 377 while((event = interactorManager->GetEvent())!=NULL) { // TO KEEP 378 interactorManager->DispatchEvent(event); // TO KEEP 379 if(exitHelp==true) break; // TO KEEP 380 } // TO KEEP 381 Prompt("session"); // TO KEEP 382 // // TO KEEP 383 if(fHelp==false) return false; // TO KEEP 384 aInt = fHelpChoice; // TO KEEP 385 fHelp = false; // TO KEEP 386 return true; // TO KEEP 382 387 } 383 388 /***************************************************************************/ … … 387 392 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/ 388 393 { 389 } 394 printf("G4UIQt::ExitHelp\n"); 395 } 396 390 397 /***************************************************************************/ 391 398 void G4UIQt::AddMenu ( … … 396 403 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/ 397 404 { 405 printf("G4UIQt::AddMenu %s %s\n",a_name,a_label); 406 QString *name = new QString(a_name); 407 QString *label = new QString(a_label); 408 menuName.push_back(name); 409 menuLabel.push_back(label); 410 411 // QMenu *menu = new QMenu("test");//a_label); 412 // fMainWindow->menuBar()->addMenu(menu); 413 398 414 // if(menuBar==NULL) return; 399 415 // if(a_name==NULL) return; … … 423 439 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/ 424 440 { 441 printf("G4UIQt::AddButton %s %s %s\n",a_menu,a_label,a_command); 425 442 // if(a_menu==NULL) return; // TO KEEP 426 443 // if(a_label==NULL) return; // TO KEEP … … 468 485 fCommandArea->setText(""); 469 486 } 470 // /***************************************************************************/471 // void G4UIXm::keyHandler (472 // Widget a_widget473 // ,XtPointer a_tag474 // ,XEvent* a_event475 // ,Boolean*476 // )477 // /***************************************************************************/478 // /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/479 // {480 // KeySym keySym;481 // XLookupString(&(a_event->xkey),NULL,0,&keySym,NULL);482 // if(keySym!=XK_Tab) return;483 // G4UIXm* This = (G4UIXm*)a_tag;484 // char* s = XmTextGetString(a_widget);485 // G4String ss = This->Complete(s);486 // XmTextSetString(a_widget,(char*)ss.data());487 // XtFree(s);488 // XmTextSetInsertionPosition(a_widget,XmTextGetLastPosition(a_widget));489 //}490 487 491 488 /***************************************************************************/ … … 498 495 } 499 496 500 /***************************************************************************/501 // TODO !502 //void G4UIQt::ButtonCallback (503 // Widget a_widget504 //,XtPointer a_tag505 //,XtPointer506 //)507 /***************************************************************************/508 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/509 //{510 // G4UIXm* This = (G4UIXm*)a_tag;511 // if(This->fHelp==true) return; // Disabled when in help.512 // G4String ss = This->GetCommand (a_widget);513 // //printf ("debug : execute:\n%s\n",ss.data());514 // This->ApplyShellCommand(ss,exitSession,exitPause);515 //}516 /***************************************************************************/517 /***************************************************************************/518 /***************************************************************************/519 // char* XmConvertCompoundStringToString (520 // XmString a_cps521 // ,int a_number522 // )523 // /***************************************************************************/524 // /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/525 // {526 // if(a_cps==NULL) return NULL;527 // char* ss = NULL;528 // XmStringContext context;529 // XmStringInitContext(&context,a_cps);530 // int icount = 0;531 // Boolean Done = False;532 // while(Done==False) {533 // char* text = NULL;534 // XmStringCharSet charset = NULL;535 // XmStringDirection direct;536 // Boolean sep;537 // if(XmStringGetNextSegment(context,&text,&charset,&direct,&sep)==True) {538 // XtFree(charset);539 // if(sep==True) Done = True;540 // if(icount==a_number) {541 // ss = text;542 // break;543 // }544 // icount++;545 // XtFree(text);546 // }547 // else548 // Done = True;549 // }550 // XmStringFreeContext(context);551 // return ss;552 //}553 497 ////////////////////////////////////////////////////////////////////////////// 554 498 G4bool ConvertStringToInt( … … 567 511 return true; // TO KEEP 568 512 } 569 #include <X11/IntrinsicP.h>570 //////////////////////////////////////////////////////////////////////////////571 // void ExecuteChangeSizeFunction (572 // Widget aWidget573 // )574 // //////////////////////////////////////////////////////////////////////////////575 // //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//576 // {577 // if(aWidget==NULL) return;578 // if(aWidget->core.widget_class->core_class.resize==NULL) return;579 // (aWidget->core.widget_class->core_class.resize)(aWidget);580 // }581 582 513 583 514 #endif
Note: See TracChangeset
for help on using the changeset viewer.