source: trunk/geant4/interfaces/basic/src/G4UIQt.cc @ 499

Last change on this file since 499 was 499, checked in by garnier, 17 years ago

r603@mac-90108: laurentgarnier | 2007-06-11 11:01:48 +0200
signaux ok

  • Property svn:mime-type set to text/cpp
File size: 20.2 KB
RevLine 
[484]1// TODO !
2
[481]3//
4// ********************************************************************
5// * License and Disclaimer                                           *
6// *                                                                  *
7// * The  Geant4 software  is  copyright of the Copyright Holders  of *
8// * the Geant4 Collaboration.  It is provided  under  the terms  and *
9// * conditions of the Geant4 Software License,  included in the file *
10// * LICENSE and available at  http://cern.ch/geant4/license .  These *
11// * include a list of copyright holders.                             *
12// *                                                                  *
13// * Neither the authors of this software system, nor their employing *
14// * institutes,nor the agencies providing financial support for this *
15// * work  make  any representation or  warranty, express or implied, *
16// * regarding  this  software system or assume any liability for its *
17// * use.  Please see the license in the file  LICENSE  and URL above *
18// * for the full disclaimer and the limitation of liability.         *
19// *                                                                  *
20// * This  code  implementation is the result of  the  scientific and *
21// * technical work of the GEANT4 collaboration.                      *
22// * By using,  copying,  modifying or  distributing the software (or *
23// * any work based  on the software)  you  agree  to acknowledge its *
24// * use  in  resulting  scientific  publications,  and indicate your *
25// * acceptance of all terms of the Geant4 Software license.          *
26// ********************************************************************
27//
28//
[484]29// $Id: G4UIQt.cc,v 1.14 2007/05/29 11:09:49 $
[481]30// GEANT4 tag $Name: geant4-08-01 $
31//
[484]32// L. Garnier
[481]33
34//#define DEBUG
35
36#ifdef G4UI_BUILD_QT_SESSION
37
38#include "G4Types.hh"
39
40#include <string.h>
41
42#include "G4UIQt.hh"
43#include "G4UImanager.hh"
44#include "G4StateManager.hh"
45#include "G4UIcommandTree.hh"
46#include "G4UIcommandStatus.hh"
47
48#include "G4Qt.hh"
49
50#include <QtGui/qapplication.h>
51#include <QtGui/qwidget.h>
[487]52#include <QtGui/qmenu.h>
53#include <QtGui/qmenubar.h>
54#include <QtGui/qboxlayout.h>
[488]55#include <QtGui/qpushbutton.h>
56#include <QtGui/qlabel.h>
[495]57#include <QtGui/qsplitter.h>
[496]58#include <QtGui/qlistview.h> // en test
59#include <QtGui/qtreeview.h> // en test
[481]60
61#include <stdlib.h>
62
63static G4bool ConvertStringToInt(const char*,int&);
64//static void ExecuteChangeSizeFunction(Widget);
65
66static G4bool exitSession = true;
67static G4bool exitPause = true;
68static G4bool exitHelp = true;
69/***************************************************************************/
70/**
71 Build a Qt window with a menubar, output area and promt area
72      +-----------------------+
73      |exit menu|             |
74      |                       |
75      | +-------------------+ |
76      | |                   | |
77      | |  Output area      | |
78      | |                   | |
79      | +-------------------+ |
[488]80      |     | clear |         |
[481]81      | +-------------------+ |
[494]82      | |  promt history    | |
83      | +-------------------+ |
84      | +-------------------+ |
[481]85      | |> promt area       | |
86      | +-------------------+ |
[484]87      +-----------------------+
[481]88*/
89
90G4UIQt::G4UIQt (
91 int argc,
92 char** argv
93)
94/***************************************************************************/
95/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
96{
[496]97  G4Qt* interactorManager = G4Qt::getInstance ();
[484]98  G4UImanager* UI = G4UImanager::GetUIpointer(); // TO KEEP
99  if(UI!=NULL) UI->SetSession(this); // TO KEEP
[481]100
[494]101  fMainWindow = new QMainWindow();
102  fMainWindow->setWindowTitle( "G4UI Session" );
[496]103
[495]104
[496]105  /*
106    QSplitter *splitter = new QSplitter(Qt::Vertical,central);
107    splitter->setMaximumSize(800,800);
108    QListView *listview = new QListView;
109    listview->setMaximumSize(800,800);
110    QTreeView *treeview = new QTreeView;
111    treeview->setMaximumSize(800,800);
112  */
[498]113  QSplitter *splitter = new QSplitter(Qt::Vertical);
114  fTextArea = new QTextEdit();
[490]115  QPushButton *clearButton = new QPushButton("clear");
[498]116  connect(clearButton, SIGNAL(clicked()), SLOT(clearButtonCallback()));
117
118  fCommandHistoryArea = new QTextEdit();
119  fCommandLabel = new QLabel();
120
121  fCommandArea = new QLineEdit();
122  connect(fCommandArea, SIGNAL(returnPressed()), SLOT(commandEnteredCallback()));
123
124  fTextArea->setReadOnly(true);
125  fCommandHistoryArea->setReadOnly(true);
126
[496]127 
[498]128  QVBoxLayout *layoutSplitter = new QVBoxLayout;
[497]129
[498]130  QWidget* topWidget = new QWidget();
131  QVBoxLayout *layoutTop = new QVBoxLayout;
[481]132
[498]133  QWidget* bottomWidget = new QWidget();
134  QVBoxLayout *layoutBottom = new QVBoxLayout;
[494]135
[490]136
[498]137  layoutTop->addWidget(fTextArea);
138  layoutTop->addWidget(clearButton);
139  topWidget->setLayout(layoutTop);
[494]140
[498]141  layoutBottom->addWidget(fCommandHistoryArea);
142  layoutBottom->addWidget(fCommandLabel);
143  layoutBottom->addWidget(fCommandArea);
144  bottomWidget->setLayout(layoutBottom);
[490]145
[495]146
[498]147  layoutSplitter->addWidget(topWidget);
148  layoutSplitter->addWidget(bottomWidget);
149  splitter->setLayout(layoutSplitter);
[495]150
[498]151  fMainWindow->setCentralWidget(splitter);
[495]152
153
[498]154  //  QMenu *menuFile = new QMenu("File");
155  //  fMainWindow->menuBar()->addMenu(menuFile);
[496]156
157
[498]158
[484]159//  QMainWindow top = (QMainWindow)interactorManager->GetMainInteractor();
[481]160
161//   if(getenv("XENVIRONMENT")==NULL) {
162//     XrmDatabase database = XrmGetDatabase(XtDisplay(top));
163//     if(database!=NULL) {
164//       XrmPutLineResource(&database,"*topShadowColor:white");
165//       XrmPutLineResource(&database,"*bottomShadowColor:black");
166//       XrmPutLineResource(&database,"*foreground:black");
167//       XrmPutLineResource(&database,"*background:lightgrey");
168//       XrmPutLineResource(&database,"*borderColor:lightgrey");
169//       XrmPutLineResource(&database,"*fontList:-*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-1");
170//       XrmPutLineResource(&database,"*text.background:white");
171//       XrmPutLineResource(&database,"*text.fontList:*courier*-r-*--14-*");
172//       XrmPutLineResource(&database,"*text.maxLength:8000");
173//     }
174//   }
175
176//   Arg args[9];
177//   XtSetArg(args[0],XmNkeyboardFocusPolicy,XmPOINTER); // For completion.
178//   shell = XtAppCreateShell ("G4UIXm","G4UIXm",
179//                          topLevelShellWidgetClass,XtDisplay(top),
180//                          args,1);
181//   form = XmCreateForm (shell,(char*)"form",NULL,0);
182//   XtManageChild (form);
183
184//   XtSetArg(args[0],XmNtopAttachment   ,XmATTACH_FORM);
185//   XtSetArg(args[1],XmNleftAttachment  ,XmATTACH_FORM);
186//   XtSetArg(args[2],XmNrightAttachment ,XmATTACH_FORM);
187//   menuBar = XmCreateMenuBar (form,(char*)"menuBar",args,3);
188
189//   XtSetArg(args[0],XmNtopAttachment      ,XmATTACH_NONE);
190//   XtSetArg(args[1],XmNleftAttachment     ,XmATTACH_FORM);
191//   XtSetArg(args[2],XmNrightAttachment    ,XmATTACH_FORM);
192//   XtSetArg(args[3],XmNbottomAttachment   ,XmATTACH_FORM);
193//   command = XmCreateCommand (form,(char*)"command",args,4);
194//   XtManageChild (command);
195
196//   XtSetArg(args[0],XmNtopAttachment   ,XmATTACH_NONE);
197//   XtSetArg(args[1],XmNleftAttachment  ,XmATTACH_FORM);
198//   XtSetArg(args[2],XmNrightAttachment ,XmATTACH_FORM);
199//   XtSetArg(args[3],XmNbottomAttachment,XmATTACH_WIDGET);
200//   XtSetArg(args[4],XmNbottomWidget    ,command);
201//   XmString cps = XmStringLtoRCreate((char*)"Clear",XmSTRING_DEFAULT_CHARSET);
202//   XtSetArg (args[5],XmNlabelString,cps);
203//   Widget clearButton = XmCreatePushButton(form,(char*)"clearButton",args,6);
204//   XmStringFree (cps);
205//   XtManageChild (clearButton);
206
207//   XtSetArg(args[0],XmNtopAttachment   ,XmATTACH_WIDGET);
208//   XtSetArg(args[1],XmNtopWidget       ,menuBar);
209//   XtSetArg(args[2],XmNleftAttachment  ,XmATTACH_FORM);
210//   XtSetArg(args[3],XmNrightAttachment ,XmATTACH_FORM);
211//   XtSetArg(args[4],XmNbottomAttachment,XmATTACH_WIDGET);
212//   XtSetArg(args[5],XmNbottomWidget    ,clearButton);
213//   XtSetArg(args[6],XmNeditMode        ,XmMULTI_LINE_EDIT);
214//   XtSetArg(args[7],XmNrows            ,12);
215//   XtSetArg(args[8],XmNcolumns         ,80);
[484]216//   text = XmCreateSGcrolledText (form,(char*)"text",args,9);
[481]217//   XtManageChild (text);
218
219//   XtAddCallback(clearButton,XmNactivateCallback,
220//              clearButtonCallback,(XtPointer)text);
221//   XtAddCallback(command,XmNcommandEnteredCallback,
222//              commandEnteredCallback,(XtPointer)this);
223
224//   Widget commandText = XmCommandGetChild(command,XmDIALOG_COMMAND_TEXT);
225//   XtAddEventHandler(commandText,KeyPressMask,False,keyHandler,(XtPointer)this);
226
227//   XtRealizeWidget(shell);
228//   XtMapWidget(shell);
229
[484]230  if(UI!=NULL) UI->SetCoutDestination(this);  // TO KEEP
[481]231}
232/***************************************************************************/
233G4UIQt::~G4UIQt(
234)
235/***************************************************************************/
236/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
237{
[484]238  G4UImanager* UI = G4UImanager::GetUIpointer();  // TO KEEP
239  if(UI!=NULL) {  // TO KEEP
240    UI->SetSession(NULL);  // TO KEEP
241    UI->SetCoutDestination(NULL);  // TO KEEP
[481]242  }
[484]243
244 
[494]245  if (fMainWindow!=NULL)
246    delete fMainWindow;
[481]247}
248/***************************************************************************/
249/*
250    Start the Qt main loop
251 */
252G4UIsession* G4UIQt::SessionStart (
253)
254/***************************************************************************/
255/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
256{
[484]257
[496]258  G4Qt* interactorManager = G4Qt::getInstance ();
[494]259  fMainWindow->show();
260  Prompt("session");
261  exitSession = false;
[481]262
[496]263
264  printf("disable secondary loop\n");
265  interactorManager->DisableSecondaryLoop (); // TO KEEP
266  ((QApplication*)interactorManager->GetMainInteractor())->exec();
267  // on ne passe pas le dessous ? FIXME ????
268
269
270
271
272
273
[484]274//   void* event; // TO KEEP
275//   while((event = interactorManager->GetEvent())!=NULL) {  // TO KEEP
276//     interactorManager->DispatchEvent(event); // TO KEEP
277//     if(exitSession==true) break; // TO KEEP
278//   } // TO KEEP
[496]279   interactorManager->EnableSecondaryLoop (); // TO KEEP
280  printf("enable secondary loop\n");
[484]281  return this; // TO KEEP
[481]282}
283/***************************************************************************/
[494]284
[481]285/**
286  Display the prompt in the prompt area
287 */
288void G4UIQt::Prompt (
289 G4String aPrompt
290)
291/***************************************************************************/
292/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
293{
[496]294  //  fCommandLabel->setText((char*)aPrompt.data());
[481]295}
296/***************************************************************************/
297void G4UIQt::SessionTerminate (
298)
299/***************************************************************************/
300/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
301{
302}
303/***************************************************************************/
304void G4UIQt::PauseSessionStart (
305 G4String a_state
306)
307/***************************************************************************/
308/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
309{
[484]310  if(a_state=="G4_pause> ") {  // TO KEEP
311    SecondaryLoop ("Pause, type continue to exit this state"); // TO KEEP
312  } // TO KEEP
[481]313
[484]314  if(a_state=="EndOfEvent") { // TO KEEP
[481]315    // Picking with feed back in event data Done here !!!
[484]316    SecondaryLoop ("End of event, type continue to exit this state"); // TO KEEP
317  } // TO KEEP
[481]318}
319/***************************************************************************/
[484]320void G4UIQt::SecondaryLoop (
[481]321 G4String a_prompt
322)
323/***************************************************************************/
324/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
325{
[484]326  G4Qt* interactorManager = G4Qt::getInstance (); // TO KEEP ?
327  Prompt(a_prompt); // TO KEEP
328  exitPause = false; // TO KEEP
329  void* event; // TO KEEP
330  while((event = interactorManager->GetEvent())!=NULL) {  // TO KEEP
331    interactorManager->DispatchEvent(event); // TO KEEP
332    if(exitPause==true) break; // TO KEEP
333  } // TO KEEP
334  Prompt("session"); // TO KEEP
[481]335}
336/***************************************************************************/
337/**
338  Receive a cout from Geant4. We have to display it in the cout zone
339 */
[484]340G4int G4UIQt::ReceiveG4cout (
[481]341 G4String a_string
342)
343/***************************************************************************/
344/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
345{
[499]346  fTextArea->append((char*)a_string.data());
[495]347  return 0;
[481]348}
349/***************************************************************************/
350/**
351  Receive a cerr from Geant4. We have to display it in the cout zone
352 */
[484]353G4int G4UIQt::ReceiveG4cerr (
[481]354 G4String a_string
355)
356/***************************************************************************/
357/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
358{
[499]359  fTextArea->append((char*)a_string.data());
[495]360  return 0;
[481]361}
362/***************************************************************************/
[484]363G4bool G4UIQt::GetHelpChoice(
[481]364 G4int& aInt
365)
366/***************************************************************************/
367/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
368{
[484]369//   fHelp = true; // TO KEEP
370//   // SecondaryLoop : // TO KEEP
371//   G4Qt* interactorManager = G4Qt::getInstance (); // TO KEEP ?
372//   Prompt("Help"); // TO KEEP
373//   exitHelp = false; // TO KEEP
374//   void* event; // TO KEEP
375//   while((event = interactorManager->GetEvent())!=NULL) {  // TO KEEP
376//     interactorManager->DispatchEvent(event); // TO KEEP
377//     if(exitHelp==true) break; // TO KEEP
378//   } // TO KEEP
379//   Prompt("session"); // TO KEEP
380//   // // TO KEEP
381//   if(fHelp==false) return false; // TO KEEP
382//   aInt = fHelpChoice; // TO KEEP
383//   fHelp = false; // TO KEEP
384//   return true; // TO KEEP
[481]385}
386/***************************************************************************/
[484]387void G4UIQt::ExitHelp(
[481]388)
389/***************************************************************************/
390/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
391{
392}
393/***************************************************************************/
[484]394void G4UIQt::AddMenu (
[481]395 const char* a_name
396,const char* a_label
397)
398/***************************************************************************/
399/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
400{
401//   if(menuBar==NULL) return;
402//   if(a_name==NULL) return;
403//   if(a_label==NULL) return;
404//   XtManageChild (menuBar);
405//   // Pulldown menu :
406//   Widget widget;
407//   widget = XmCreatePulldownMenu (menuBar,(char*)a_name,NULL,0);
408//   AddInteractor (a_name,(G4Interactor)widget);
409//   // Cascade button :
410//   Arg args[2];
411//   XmString cps = XmStringLtoRCreate((char*)a_label,XmSTRING_DEFAULT_CHARSET);
412//   XtSetArg (args[0],XmNlabelString,cps);
413//   XtSetArg (args[1],XmNsubMenuId,widget);
414//   widget = XmCreateCascadeButton (menuBar,(char*)a_name,args,2);
415//   XmStringFree (cps);
416//   XtManageChild (widget);
417//   ExecuteChangeSizeFunction(form);
418}
419/***************************************************************************/
[484]420void G4UIQt::AddButton (
[481]421 const char* a_menu
422,const char* a_label
423,const char* a_command
424)
425/***************************************************************************/
426/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
427{
[484]428//   if(a_menu==NULL) return; // TO KEEP
429//   if(a_label==NULL) return; // TO KEEP
430//   if(a_command==NULL) return; // TO KEEP
[481]431//   Widget parent = (Widget)GetInteractor(a_menu);
432//   if(parent==NULL) return;
433//   Widget widget = XmCreatePushButton(parent,(char*)a_label,NULL,0);
434//   XtManageChild (widget);
435//   XtAddCallback (widget,XmNactivateCallback,ButtonCallback,(XtPointer)this);
436//   commands[widget] = a_command;
[491]437}
[481]438// /***************************************************************************/
439// G4String G4UIXm::GetCommand (
440//  Widget a_widget
441// )
442// /***************************************************************************/
443// /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
444// {
445//   return commands[a_widget];
446// }
447/***************************************************************************/
448/***************************************************************************/
449/***************************************************************************/
[494]450
[481]451/**
[494]452  Callback call when "enter" clicked on the command zone.
[481]453  Send the command to geant4
454 */
[484]455// TODO !
[494]456void G4UIQt::commandEnteredCallback (
457)
[481]458/***************************************************************************/
459/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
[494]460{
[496]461  /*   fCommandHistoryArea->append(fCommandArea->text());
[494]462   G4String command (fCommandArea->text().toStdString().c_str());
463   if(fHelp==true) {
464     exitHelp = true;
465     fHelp = ConvertStringToInt(command.data(),fHelpChoice);
466   } else {
467     ApplyShellCommand (command,exitSession,exitPause);
468   }
[495]469   fCommandArea->setText("");
[496]470  */
[494]471}
[481]472// /***************************************************************************/
473// void G4UIXm::keyHandler (
474//  Widget a_widget
475// ,XtPointer a_tag
476// ,XEvent* a_event
477// ,Boolean*
478// )
479// /***************************************************************************/
480// /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
481// {
482//   KeySym keySym;
483//   XLookupString(&(a_event->xkey),NULL,0,&keySym,NULL);
484//   if(keySym!=XK_Tab) return;
485//   G4UIXm* This = (G4UIXm*)a_tag;
486//   char* s = XmTextGetString(a_widget);
487//   G4String ss = This->Complete(s);
488//   XmTextSetString(a_widget,(char*)ss.data());
489//   XtFree(s);
490//   XmTextSetInsertionPosition(a_widget,XmTextGetLastPosition(a_widget));
491//}
[488]492
493 /***************************************************************************/
[491]494void G4UIQt::clearButtonCallback (
495)
[481]496/***************************************************************************/
497/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
[491]498{
[499]499  fTextArea->clear();
[491]500}
501
[481]502/***************************************************************************/
[484]503// TODO !
504//void G4UIQt::ButtonCallback (
505// Widget a_widget
506//,XtPointer a_tag
507//,XtPointer
508//)
[481]509/***************************************************************************/
510/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
[484]511//{
[481]512//   G4UIXm* This = (G4UIXm*)a_tag;
513//   if(This->fHelp==true) return; // Disabled when in help.
514//   G4String ss = This->GetCommand (a_widget);
515//   //printf ("debug : execute:\n%s\n",ss.data());
516//   This->ApplyShellCommand(ss,exitSession,exitPause);
[484]517//}
[481]518/***************************************************************************/
519/***************************************************************************/
520/***************************************************************************/
521// char* XmConvertCompoundStringToString (
522//  XmString a_cps
523// ,int a_number
524// )
525// /***************************************************************************/
526// /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
527// {
528//   if(a_cps==NULL) return NULL;
529//   char* ss = NULL;
530//   XmStringContext context;
531//   XmStringInitContext(&context,a_cps);
532//   int icount = 0;
533//   Boolean Done = False;
534//   while(Done==False) { 
535//     char* text = NULL;
536//     XmStringCharSet charset = NULL;
537//     XmStringDirection direct;
538//     Boolean sep;
539//     if(XmStringGetNextSegment(context,&text,&charset,&direct,&sep)==True) {
540//       XtFree(charset);
541//       if(sep==True) Done = True;
542//       if(icount==a_number) {
543//      ss = text;
544//      break;
545//       }
546//       icount++;
547//       XtFree(text);
548//     }
549//     else
550//       Done = True;
551//   }
552//   XmStringFreeContext(context);
553//   return ss;
[491]554//}
[481]555//////////////////////////////////////////////////////////////////////////////
556G4bool ConvertStringToInt(
557 const char* aString
558,int& aInt
559)
560//////////////////////////////////////////////////////////////////////////////
561//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
562{
[484]563  aInt = 0; // TO KEEP
564  if(aString==NULL) return false; // TO KEEP
565  char* s; // TO KEEP
566  long value = strtol(aString,&s,10); // TO KEEP
567  if(s==aString) return false; // TO KEEP
568  aInt = value; // TO KEEP
569  return true; // TO KEEP
[481]570}
571#include <X11/IntrinsicP.h>
572//////////////////////////////////////////////////////////////////////////////
573// void ExecuteChangeSizeFunction (
574//  Widget aWidget
575// )
576// //////////////////////////////////////////////////////////////////////////////
577// //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
578// {
579//   if(aWidget==NULL) return;
580//   if(aWidget->core.widget_class->core_class.resize==NULL) return;
581//   (aWidget->core.widget_class->core_class.resize)(aWidget);
582// }
583
584
585#endif
Note: See TracBrowser for help on using the repository browser.