Import Geant4 3.0.0 source tree
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIGAG.hh,v 1.4 1999/12/15 14:50:43 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// G4UIGAG.hh
|
||||
// GAG(Geant4 adaptive GUI) interface class
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIGAG.cc,v 1.9 1999/12/17 12:09:50 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// G4UIGAG.cc
|
||||
// 18.Feb.98 M.Nagamatu and T.Kodama created G4UIGAG from G4UIterminal
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
$Id: History,v 1.31 2000/06/23 08:46:48 stesting Exp $
|
||||
$Id: History,v 1.39 2000/11/29 10:19:19 asaim Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -17,6 +17,35 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
29 November 2000 Makoto Asai (interfaces-V02-00-03)
|
||||
- Tag for Guy's correction.
|
||||
|
||||
28 November 2000 Guy Barrand
|
||||
- G4Xt.cc ; SUN-CC : correct warning : argc hides G4VInteractorManager::argc.
|
||||
|
||||
27 November 2000 Makoto Asai (interfaces-V02-00-02)
|
||||
- G4VUIShell.hh : add virtual keyword to the destructor.
|
||||
|
||||
11 August 2000 Guy Barrand
|
||||
- G4UIWo.cc : add some cast in order to compile with OSF1/cxx strict_ansi mode.
|
||||
|
||||
1 August 2000 Gabriele Cosmo (interfaces-V02-00-01)
|
||||
- Fixed warnings on HP-aCC system in G4UItcsh.cc, due to unproper usage of G4int
|
||||
where unsigned (size_t) was requested instead.
|
||||
|
||||
31 July 2000 Gonzalo Gracia
|
||||
- Modifications required to compile on NT
|
||||
Operator string::[] requires size_t argument.
|
||||
Cast from integer to size_t in several places in basic/src/G4UIArrayString.cc
|
||||
and G4VUIshell.cc
|
||||
|
||||
22 July 2000 Makoto Asai (interfaces-V02-00-00)
|
||||
- Modify G4UIterminal, G4VUIshell, G4UIcsh and G4UItcsh to display the
|
||||
break status as a prompt characters.
|
||||
|
||||
25 June 2000 John Allison (interfaces-V01-01-06-old-G4UIterminal)
|
||||
- As interfaces-V01-01-06 but old revisions of G4UIterminal.cc/hh.
|
||||
|
||||
23 June 2000 John Allison (interfaces-V01-01-06)
|
||||
- Protected G4UIterminal, G4Ui[t]csh against access by index to null strings.
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIWo.hh,v 1.3 1999/12/15 14:50:44 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
#ifndef G4UIWo_h
|
||||
#define G4UIWo_h
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4WoMessenger.hh,v 1.3 1999/12/15 14:50:44 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
#ifndef G4WoMessenger_h
|
||||
#define G4WoMessenger_h 1
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4oCommon.hh,v 1.3 1999/12/15 14:50:44 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
/*
|
||||
Included by G4o.h.
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4oCommon.icc,v 1.3 1999/12/15 14:50:44 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
/*
|
||||
Included by G4o.cc.
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIWo.cc,v 1.3 1999/12/15 14:50:46 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4UIWo.cc,v 1.4 2000/08/11 09:56:50 barrand Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//G4UIWo.cc -- copied from G4UIterminal.cc
|
||||
|
||||
@@ -86,7 +86,7 @@ G4UIWo::G4UIWo (
|
||||
// end Want_c
|
||||
|
||||
//Declare G4 interpreter to Wo.
|
||||
OInterpreterCreate ("G4",ExecuteScript,NULL,NULL,NULL);
|
||||
OInterpreterCreate ("G4",(OInterpreterDoFunction)ExecuteScript,NULL,NULL,NULL);
|
||||
OShellAddNewCommand (WoGetShellInterpreter(),"G4/G4",Execute_G4);
|
||||
SetTypes ();
|
||||
|
||||
@@ -95,10 +95,10 @@ G4UIWo::G4UIWo (
|
||||
|
||||
//Declare G4/vis~/views to Wo.
|
||||
#ifdef HAS_XO
|
||||
OClassDeclareCompoundWidget ("G4/G4XoView" ,CreateG4XoView ,xoCameraWidgetClass);
|
||||
OClassDeclareCompoundWidget ("G4/G4XoView" ,(OClassCreateWidgetFunction)CreateG4XoView ,xoCameraWidgetClass);
|
||||
#endif
|
||||
#ifdef HAS_XM
|
||||
OClassDeclareCompoundWidget ("G4/G4OIXView",CreateG4OIXView,xmMainWindowWidgetClass);
|
||||
OClassDeclareCompoundWidget ("G4/G4OIXView",(OClassCreateWidgetFunction)CreateG4OIXView,xmMainWindowWidgetClass);
|
||||
OClassDeclareWidgetClass ("G4/ThumbWheel" ,NULL);
|
||||
OClassDeclareWidgetClass ("G4/SoGLwMDrawingArea",NULL);
|
||||
OClassDeclareWidgetClass ("G4/XoSoArea" ,NULL);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4WoMessenger.cc,v 1.3 1999/12/15 14:50:46 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
#ifdef G4UI_BUILD_WO_SESSION
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIxvt.hh,v 1.3 1999/12/15 14:50:46 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// XVT driver class header //
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIxvtMessenger.hh,v 1.3 1999/12/15 14:50:46 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIxvt.cc,v 1.3 1999/12/15 14:50:46 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
#ifdef G4UI_BUILD_XVT_SESSION
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIxvtMessenger.cc,v 1.3 1999/12/15 14:50:46 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
#ifdef G4UI_BUILD_XVT_SESSION
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIArrayString.hh,v 1.1 2000/03/26 23:02:33 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
|
||||
#ifndef G4UIArrayString_h
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIWin32.hh,v 1.9 2000/05/26 14:58:29 barrand Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
#ifndef G4UIWin32_h
|
||||
#define G4UIWin32_h
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIXaw.hh,v 1.4 1999/12/15 14:50:46 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
#ifndef G4UIXaw_h
|
||||
#define G4UIXaw_h
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIXm.hh,v 1.10 2000/05/26 14:58:30 barrand Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
#ifndef G4UIXm_h
|
||||
#define G4UIXm_h
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIcsh.hh,v 1.1 2000/03/26 23:03:46 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4UIcsh.hh,v 1.2 2000/07/22 10:52:28 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
|
||||
#ifndef G4UIcsh_h
|
||||
@@ -26,7 +26,7 @@ public:
|
||||
G4UIcsh(const G4String& prompt="%s> ");
|
||||
~G4UIcsh();
|
||||
|
||||
virtual G4String GetCommandLine();
|
||||
virtual G4String GetCommandLine(const char* msg=0);
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UItcsh.hh,v 1.1 2000/03/26 23:03:47 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4UItcsh.hh,v 1.2 2000/07/22 10:52:28 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
|
||||
#ifndef G4UItcsh_h
|
||||
@@ -51,7 +51,7 @@
|
||||
|
||||
class G4UItcsh : public G4VUIshell {
|
||||
protected:
|
||||
virtual void MakePrompt();
|
||||
virtual void MakePrompt(const char* msg=0);
|
||||
|
||||
G4int cursorPosition; // cursor position
|
||||
G4String commandLine; // command line string;
|
||||
@@ -104,7 +104,7 @@ public:
|
||||
~G4UItcsh();
|
||||
|
||||
void SetLsColor(TermColorIndex dirColor, TermColorIndex cmdColor);
|
||||
virtual G4String GetCommandLine();
|
||||
virtual G4String GetCommandLine(const char* msg=0);
|
||||
};
|
||||
|
||||
inline G4bool G4UItcsh::IsCursorLast() const
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIterminal.hh,v 1.5 2000/03/26 23:03:48 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4UIterminal.hh,v 1.6 2000/07/22 10:52:28 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
|
||||
#ifndef G4UIterminal_h
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
|
||||
private:
|
||||
void ExecuteCommand(G4String aCommand);
|
||||
G4String GetCommand();
|
||||
G4String GetCommand(const char* msg=0);
|
||||
G4bool GetHelpChoice(G4int& aInt);
|
||||
void ExitHelp();
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VUIshell.hh,v 1.1 2000/03/26 23:03:48 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4VUIshell.hh,v 1.3 2000/11/27 11:01:51 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
|
||||
#ifndef G4VUIshell_h
|
||||
@@ -41,7 +41,7 @@ class G4VUIshell {
|
||||
protected:
|
||||
G4String promptString;
|
||||
G4String promptSetting; // including %-directive
|
||||
virtual void MakePrompt(); // make prompt string
|
||||
virtual void MakePrompt(const char* msg=0); // make prompt string
|
||||
G4int nColumn; // column size of terminal (default=80)
|
||||
|
||||
// color code support (effective if your terminal supports color code.)
|
||||
@@ -61,7 +61,7 @@ protected:
|
||||
|
||||
public:
|
||||
G4VUIshell(const G4String& prompt="> ");
|
||||
~G4VUIshell();
|
||||
virtual ~G4VUIshell();
|
||||
|
||||
void SetNColumn(G4int ncol);
|
||||
void SetPrompt(const G4String& prompt);
|
||||
@@ -74,7 +74,7 @@ public:
|
||||
// "candidate" is specified with full path.
|
||||
|
||||
// get command string from a command line
|
||||
virtual G4String GetCommandLine()= 0;
|
||||
virtual G4String GetCommandLine(const char* msg=0)= 0;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIArrayString.cc,v 1.2 2000/06/14 03:18:59 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4UIArrayString.cc,v 1.3 2000/07/31 08:00:01 gracia Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
|
||||
#include "g4std/iomanip"
|
||||
@@ -31,7 +31,7 @@ G4UIArrayString::G4UIArrayString(const G4String& stream)
|
||||
nElement++;
|
||||
if(jc == G4String::npos) break;
|
||||
for(G4int i=1; jc+i< astream.length(); i++ ) { // skip continuing spaces
|
||||
if(astream[jc+i]==' ') jc++;
|
||||
if(astream[(size_t)(jc+i)]==' ') jc++;
|
||||
else break;
|
||||
}
|
||||
indx= jc+1;
|
||||
@@ -105,7 +105,7 @@ G4int G4UIArrayString::GetNField(int icol) const
|
||||
// care for color code
|
||||
// if(GetElement(icol,iy)-> index(strESC,0) != G4String::npos) {
|
||||
// if(strESC == (*GetElement(icol,iy))[0] ) {
|
||||
const char tgt = (*GetElement(icol,iy))[0];
|
||||
const char tgt = (*GetElement(icol,iy))[(size_t)0];
|
||||
if(strESC == tgt) {
|
||||
ilen-= 5;
|
||||
if(ilen<0) G4cout << "length(c) cal. error." << G4endl;
|
||||
@@ -157,7 +157,7 @@ void G4UIArrayString::Show(G4int ncol)
|
||||
G4String colorWord;
|
||||
//if(word.index(strESC,0) != G4String::npos) {
|
||||
//if(strESC == word[0]) {
|
||||
const char tgt = word[0];
|
||||
const char tgt = word[(size_t)0];
|
||||
if(strESC == tgt) {
|
||||
colorWord= word(0,5);
|
||||
word.erase(0,5);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIWin32.cc,v 1.6 1999/12/15 14:50:47 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// G.Barrand
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIXaw.cc,v 1.3 1999/12/15 14:50:47 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// G.Barrand
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIXm.cc,v 1.6 1999/12/15 14:50:47 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// G.Barrand
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIcsh.cc,v 1.3 2000/06/23 08:46:49 stesting Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4UIcsh.cc,v 1.4 2000/07/22 10:52:29 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
|
||||
#include "G4UIcsh.hh"
|
||||
@@ -26,10 +26,10 @@ G4UIcsh::~G4UIcsh()
|
||||
|
||||
|
||||
//////////////////////////////////
|
||||
G4String G4UIcsh::GetCommandLine()
|
||||
G4String G4UIcsh::GetCommandLine(const char* msg)
|
||||
//////////////////////////////////
|
||||
{
|
||||
MakePrompt();
|
||||
MakePrompt(msg);
|
||||
G4cout << promptString << G4std::flush;
|
||||
|
||||
G4String newCommand;
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UItcsh.cc,v 1.3 2000/06/23 08:46:49 stesting Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4UItcsh.cc,v 1.5 2000/08/01 08:02:20 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
|
||||
#ifndef WIN32
|
||||
@@ -57,7 +57,7 @@ G4UItcsh::~G4UItcsh()
|
||||
}
|
||||
|
||||
///////////////////////////
|
||||
void G4UItcsh::MakePrompt()
|
||||
void G4UItcsh::MakePrompt(const char* msg)
|
||||
///////////////////////////
|
||||
{
|
||||
if(promptSetting.length()<=1) {
|
||||
@@ -66,16 +66,22 @@ void G4UItcsh::MakePrompt()
|
||||
}
|
||||
|
||||
promptString="";
|
||||
G4int i;
|
||||
size_t i;
|
||||
for(i=0; i<promptSetting.length()-1; i++){
|
||||
if(promptSetting[i]=='%'){
|
||||
switch (promptSetting[i+1]) {
|
||||
case 's': // current application status
|
||||
{
|
||||
G4StateManager* statM= G4StateManager::GetStateManager();
|
||||
G4String stateStr= statM-> GetStateString(statM->GetCurrentState());
|
||||
promptString.append(stateStr);
|
||||
i++;
|
||||
G4String stateStr;
|
||||
if(msg)
|
||||
{ stateStr = msg; }
|
||||
else
|
||||
{
|
||||
G4StateManager* statM= G4StateManager::GetStateManager();
|
||||
stateStr= statM-> GetStateString(statM->GetCurrentState());
|
||||
}
|
||||
promptString.append(stateStr);
|
||||
i++;
|
||||
}
|
||||
break;
|
||||
case '/': // current working directory
|
||||
@@ -123,7 +129,7 @@ void G4UItcsh::InsertCharacter(char cc)
|
||||
|
||||
// display...
|
||||
G4cout << cc;
|
||||
G4int i;
|
||||
size_t i;
|
||||
for(i=cursorPosition-1; i<commandLine.length() ;i++)
|
||||
G4cout << commandLine[i];
|
||||
for(i=cursorPosition-1; i<commandLine.length() ;i++)
|
||||
@@ -150,7 +156,7 @@ void G4UItcsh::BackspaceCharacter()
|
||||
G4cout << AsciiBS << ' ' << AsciiBS << G4std::flush;
|
||||
} else {
|
||||
G4cout << AsciiBS;
|
||||
G4int i;
|
||||
size_t i;
|
||||
for(i=cursorPosition-2; i< commandLine.length()-1 ;i++){
|
||||
G4cout << commandLine[i+1];
|
||||
}
|
||||
@@ -174,7 +180,7 @@ void G4UItcsh::DeleteCharacter()
|
||||
if(IsCursorLast()) return;
|
||||
|
||||
// display...
|
||||
G4int i;
|
||||
size_t i;
|
||||
for(i=cursorPosition-1; i< commandLine.length()-1 ;i++){
|
||||
G4cout << commandLine[i+1];
|
||||
}
|
||||
@@ -241,7 +247,7 @@ void G4UItcsh::ForwardCursor()
|
||||
{
|
||||
if(IsCursorLast()) return;
|
||||
|
||||
G4cout << commandLine[cursorPosition-1] << G4std::flush;
|
||||
G4cout << commandLine[(size_t)(cursorPosition-1)] << G4std::flush;
|
||||
cursorPosition++;
|
||||
}
|
||||
|
||||
@@ -270,7 +276,7 @@ void G4UItcsh::MoveCursorTop()
|
||||
void G4UItcsh::MoveCursorEnd()
|
||||
//////////////////////////////
|
||||
{
|
||||
for(G4int i=cursorPosition-1; i<commandLine.length(); i++){
|
||||
for(size_t i=cursorPosition-1; i<commandLine.length(); i++){
|
||||
G4cout << commandLine[i];
|
||||
}
|
||||
G4cout << G4std::flush;
|
||||
@@ -340,7 +346,7 @@ void G4UItcsh::ListMatchedCommand()
|
||||
G4int len= input.length();
|
||||
G4int indx=-1;
|
||||
for(G4int i=len-1; i>=0; i--) {
|
||||
if(input[i]=='/') {
|
||||
if(input[(size_t)i]=='/') {
|
||||
indx= i;
|
||||
break;
|
||||
}
|
||||
@@ -567,12 +573,12 @@ G4String G4UItcsh::ReadLine()
|
||||
}
|
||||
|
||||
///////////////////////////////////
|
||||
G4String G4UItcsh::GetCommandLine()
|
||||
G4String G4UItcsh::GetCommandLine(const char* msg)
|
||||
///////////////////////////////////
|
||||
{
|
||||
SetTermToInputMode();
|
||||
|
||||
MakePrompt(); // update
|
||||
MakePrompt(msg); // update
|
||||
relativeHistoryIndex= 0;
|
||||
|
||||
G4cout << promptString << G4std::flush;
|
||||
@@ -591,7 +597,7 @@ G4String G4UItcsh::GetCommandLine()
|
||||
|
||||
// update history...
|
||||
G4bool isMeaningfull= FALSE; // check NULL command
|
||||
for (int i=0; i<newCommand.length(); i++) {
|
||||
for (size_t i=0; i<newCommand.length(); i++) {
|
||||
if(newCommand[i] != ' ') {
|
||||
isMeaningfull= TRUE;
|
||||
break;
|
||||
@@ -617,7 +623,7 @@ G4String G4UItcsh::GetFirstMatchedString(const G4String& str1,
|
||||
int nmin = nlen1<nlen2 ? nlen1 : nlen2;
|
||||
|
||||
G4String strMatched;
|
||||
for(int i=0; i<nmin; i++){
|
||||
for(size_t i=0; i<nmin; i++){
|
||||
if(str1[i]==str2[i]) {
|
||||
strMatched+= str1[i];
|
||||
} else {
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UIterminal.cc,v 1.13 2000/06/23 08:46:50 stesting Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4UIterminal.cc,v 1.14 2000/07/22 10:52:29 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
|
||||
#include "g4std/strstream"
|
||||
@@ -74,10 +74,10 @@ void G4UIterminal::PauseSessionStart(G4String msg)
|
||||
{
|
||||
iCont= TRUE;
|
||||
|
||||
G4String newCommand= GetCommand();
|
||||
G4String newCommand= GetCommand(msg);
|
||||
while(iCont){
|
||||
ExecuteCommand(newCommand);
|
||||
newCommand= GetCommand();
|
||||
newCommand= GetCommand(msg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,13 +132,13 @@ void G4UIterminal::ExecuteCommand(G4String aCommand)
|
||||
}
|
||||
|
||||
///////////////////////////////////
|
||||
G4String G4UIterminal::GetCommand()
|
||||
G4String G4UIterminal::GetCommand(const char* msg)
|
||||
///////////////////////////////////
|
||||
{
|
||||
G4String newCommand;
|
||||
G4String nullString;
|
||||
|
||||
newCommand= shell-> GetCommandLine();
|
||||
newCommand= shell-> GetCommandLine(msg);
|
||||
|
||||
G4String nC= newCommand.strip(G4String::leading);
|
||||
if( nC.length() == 0 ) {
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VUIshell.cc,v 1.2 2000/06/14 03:19:00 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4VUIshell.cc,v 1.4 2000/07/31 08:00:01 gracia Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
|
||||
#include "G4UImanager.hh"
|
||||
@@ -40,7 +40,7 @@ G4VUIshell::~G4VUIshell()
|
||||
}
|
||||
|
||||
/////////////////////////////
|
||||
void G4VUIshell::MakePrompt()
|
||||
void G4VUIshell::MakePrompt(const char* msg)
|
||||
/////////////////////////////
|
||||
{
|
||||
if(promptSetting.length()<=1) {
|
||||
@@ -51,14 +51,20 @@ void G4VUIshell::MakePrompt()
|
||||
promptString="";
|
||||
G4int i;
|
||||
for(i=0; i<promptSetting.length()-1; i++){
|
||||
if(promptSetting[i]=='%'){
|
||||
switch (promptSetting[i+1]) {
|
||||
if(promptSetting[(size_t)i]=='%'){
|
||||
switch (promptSetting[(size_t)(i+1)]) {
|
||||
case 's': // current application status
|
||||
{
|
||||
G4StateManager* statM= G4StateManager::GetStateManager();
|
||||
G4String stateStr= statM-> GetStateString(statM->GetCurrentState());
|
||||
promptString.append(stateStr);
|
||||
i++;
|
||||
G4String stateStr;
|
||||
if(msg)
|
||||
{ stateStr = msg; }
|
||||
else
|
||||
{
|
||||
G4StateManager* statM= G4StateManager::GetStateManager();
|
||||
stateStr= statM-> GetStateString(statM->GetCurrentState());
|
||||
}
|
||||
promptString.append(stateStr);
|
||||
i++;
|
||||
}
|
||||
break;
|
||||
case '/': // current working directory
|
||||
@@ -66,17 +72,17 @@ void G4VUIshell::MakePrompt()
|
||||
i++;
|
||||
break;
|
||||
default:
|
||||
promptString.append(G4String(promptSetting[i]));
|
||||
promptString.append(G4String(promptSetting[(size_t)i]));
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
promptString.append(G4String(promptSetting[i]));
|
||||
promptString.append(G4String(promptSetting[(size_t)i]));
|
||||
}
|
||||
}
|
||||
|
||||
// append last chaacter
|
||||
if(i == promptSetting.length()-1)
|
||||
promptString.append(G4String(promptSetting[i]));
|
||||
promptString.append(G4String(promptSetting[(size_t)i]));
|
||||
}
|
||||
|
||||
|
||||
@@ -121,7 +127,7 @@ G4String G4VUIshell::GetAbsCommandDirPath(const G4String& apath) const
|
||||
// if "apath" does not start with "/",
|
||||
// then it is treared as relative path
|
||||
G4String bpath= apath;
|
||||
if(apath[0] != '/') bpath= currentCommandDir + apath;
|
||||
if(apath[(size_t)0] != '/') bpath= currentCommandDir + apath;
|
||||
|
||||
// parsing...
|
||||
G4String absPath= "/";
|
||||
@@ -158,13 +164,13 @@ G4String G4VUIshell::GetCommandPathTail(const G4String& apath) const
|
||||
|
||||
// for trancating "/"
|
||||
G4bool Qsla= FALSE;
|
||||
if(apath[lstr-1]=='/') Qsla= TRUE;
|
||||
if(apath[(size_t)(lstr-1)]=='/') Qsla= TRUE;
|
||||
|
||||
// searching last '/' from tail
|
||||
G4int indx= -1;
|
||||
for(G4int i=lstr-1; i>=0; i--) {
|
||||
if(Qsla && apath[i]!='/') Qsla= FALSE; // break "/" flag!!
|
||||
if(apath[i]=='/' && !Qsla) {
|
||||
if(Qsla && apath[(size_t)i]!='/') Qsla= FALSE; // break "/" flag!!
|
||||
if(apath[(size_t)i]=='/' && !Qsla) {
|
||||
indx= i;
|
||||
break;
|
||||
}
|
||||
@@ -203,7 +209,7 @@ void G4VUIshell::ListCommand(const G4String& dir,
|
||||
if(! input.empty()) {
|
||||
G4int indx= -1;
|
||||
for(G4int i=len-1; i>=0; i--) { // search last '/'
|
||||
if(input[i]=='/') {
|
||||
if(input[(size_t)i]=='/') {
|
||||
indx= i;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VBasicShell.hh,v 1.5 1999/12/15 14:50:47 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
|
||||
#ifndef G4VBasicShell_H
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VInteractorManager.hh,v 1.6 1999/12/15 14:50:47 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// G.Barrand
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Win32.hh,v 1.5 1999/12/15 14:50:47 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// To unify Windows message treatment between
|
||||
// G4/interfaces Windows sessions and G4/visualizations Windows drivers.
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Xt.hh,v 1.4 1999/12/15 14:50:47 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// To unify X11 event treatment between
|
||||
// G4/interfaces Xt sessions and G4/visualizations Xt drivers.
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VBasicShell.cc,v 1.6 1999/12/15 14:50:47 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
|
||||
#include "g4std/vector"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VInteractorManager.cc,v 1.8 1999/12/15 14:50:47 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// G.Barrand
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Win32.cc,v 1.5 1999/12/15 14:50:47 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// G.Barrand
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Xt.cc,v 1.5 1999/12/15 14:50:47 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
// $Id: G4Xt.cc,v 1.6 2000/11/28 08:13:54 barrand Exp $
|
||||
// GEANT4 tag $Name: geant4-03-00 $
|
||||
//
|
||||
// G.Barrand
|
||||
|
||||
@@ -78,17 +78,17 @@ G4Xt::G4Xt (
|
||||
}
|
||||
}
|
||||
#if XtSpecificationRelease == 4
|
||||
Cardinal argc;
|
||||
argc = (Cardinal)a_argn;
|
||||
Cardinal narg;
|
||||
narg = (Cardinal)a_argn;
|
||||
#else
|
||||
int argc;
|
||||
argc = a_argn;
|
||||
int narg;
|
||||
narg = a_argn;
|
||||
#endif
|
||||
Arg xargs[1];
|
||||
XtSetArg (xargs[0],XtNgeometry,"100x100");
|
||||
topWidget = XtAppInitialize (&appContext,a_class,
|
||||
NULL,(Cardinal)0,
|
||||
&argc,a_args,NULL,
|
||||
&narg,a_args,NULL,
|
||||
xargs,1);
|
||||
if(topWidget==NULL) {
|
||||
G4cout << "G4Xt : Unable to init Xt." << G4endl;
|
||||
|
||||
Reference in New Issue
Block a user