- Timestamp:
- Jun 8, 2007, 4:43:47 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/geant4/interfaces/basic/src/G4UIQt.cc
r494 r495 55 55 #include <QtGui/qpushbutton.h> 56 56 #include <QtGui/qlabel.h> 57 #include <QtGui/qsplitter.h> 57 58 58 59 #include <stdlib.h> … … 99 100 fMainWindow = new QMainWindow(); 100 101 fMainWindow->setWindowTitle( "G4UI Session" ); 101 fMainWindow->setBaseSize(300,200); 102 QWidget* centralWidget = new QWidget(); 103 QVBoxLayout* vBox = new QVBoxLayout(); 102 fMainWindow->resize(600,400); 103 QWidget* central = new QWidget(); 104 QWidget* topWidget = new QWidget(); 105 QWidget* bottomWidget = new QWidget(); 106 QVBoxLayout* vBox1 = new QVBoxLayout(); 107 QVBoxLayout* vBox2 = new QVBoxLayout(); 108 109 QSplitter *splitter = new QSplitter(Qt::Vertical, central); 104 110 fTextArea = new QTextEdit(); 105 111 fCommandHistoryArea = new QTextEdit(); … … 118 124 connect(fCommandArea, SIGNAL(returnPressed()), SLOT(commandEnteredCallback())); 119 125 120 vBox->addWidget(fTextArea); 121 vBox->addWidget(clearButton); 122 vBox->addWidget(fCommandHistoryArea); 123 vBox->addWidget(fCommandLabel); 124 vBox->addWidget(fCommandArea); 125 centralWidget->setLayout(vBox); 126 fMainWindow->setCentralWidget(centralWidget); 126 vBox1->addWidget(fTextArea); 127 vBox1->addWidget(clearButton); 128 129 vBox2->addWidget(fCommandHistoryArea); 130 vBox2->addWidget(fCommandLabel); 131 vBox2->addWidget(fCommandArea); 132 133 topWidget->setLayout(vBox1); 134 bottomWidget->setLayout(vBox2); 135 136 splitter->addWidget(topWidget); 137 splitter->addWidget(bottomWidget); 138 139 fMainWindow->setCentralWidget(central); 127 140 128 141 // QMainWindow top = (QMainWindow)interactorManager->GetMainInteractor(); … … 302 315 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/ 303 316 { 304 // TODO ! 305 // XmTextAppendString(text,(char*)a_string.data()); 306 // return 0; 317 fTextArea->append((char*)a_string.data()); 318 return 0; 307 319 } 308 320 /***************************************************************************/ … … 316 328 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/ 317 329 { 318 // TODO ! 319 // XmTextAppendString(text,(char*)a_string.data()); 320 // return 0; 330 fTextArea->append((char*)a_string.data()); 331 return 0; 321 332 } 322 333 /***************************************************************************/ … … 419 430 /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/ 420 431 { 421 432 fCommandHistoryArea->append(fCommandArea->text()); 422 433 G4String command (fCommandArea->text().toStdString().c_str()); 423 434 if(fHelp==true) { … … 425 436 fHelp = ConvertStringToInt(command.data(),fHelpChoice); 426 437 } else { 427 printf("*******************3\n");428 438 ApplyShellCommand (command,exitSession,exitPause); 429 printf("*******************4\n");430 439 } 431 440 fCommandArea->setText(""); 432 441 } 433 442 // /***************************************************************************/ … … 514 523 // return ss; 515 524 //} 516 // /***************************************************************************/517 // void XmTextAppendString (518 // Widget This519 // ,char* a_string520 // )521 // /***************************************************************************/522 // /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/523 // {524 // if(This==NULL) return;525 // if(!XtIsSubclass(This,xmTextWidgetClass)) return;526 // if(a_string==NULL) return;527 // XmTextPosition lastpos = XmTextGetLastPosition(This);528 // XmTextReplace(This,lastpos,lastpos,a_string);529 // XmTextSetInsertionPosition(This,XmTextGetLastPosition(This));530 // }531 525 ////////////////////////////////////////////////////////////////////////////// 532 526 G4bool ConvertStringToInt(
Note: See TracChangeset
for help on using the changeset viewer.