[571] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
---|
| 2 | <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> |
---|
| 3 | <title>G4UIQt.hh Source File</title> |
---|
| 4 | <link href="doxygen.css" rel="stylesheet" type="text/css"> |
---|
| 5 | </head><body> |
---|
| 6 | <!-- Generated by Doxygen 1.3.4 --> |
---|
| 7 | <div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a></div> |
---|
| 8 | <h1>G4UIQt.hh</h1><a href="G4UIQt_8hh.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">//</span> |
---|
| 9 | 00002 <span class="comment">// ********************************************************************</span> |
---|
| 10 | 00003 <span class="comment">// * License and Disclaimer *</span> |
---|
| 11 | 00004 <span class="comment">// * *</span> |
---|
| 12 | 00005 <span class="comment">// * The Geant4 software is copyright of the Copyright Holders of *</span> |
---|
| 13 | 00006 <span class="comment">// * the Geant4 Collaboration. It is provided under the terms and *</span> |
---|
| 14 | 00007 <span class="comment">// * conditions of the Geant4 Software License, included in the file *</span> |
---|
| 15 | 00008 <span class="comment">// * LICENSE and available at http://cern.ch/geant4/license . These *</span> |
---|
| 16 | 00009 <span class="comment">// * include a list of copyright holders. *</span> |
---|
| 17 | 00010 <span class="comment">// * *</span> |
---|
| 18 | 00011 <span class="comment">// * Neither the authors of this software system, nor their employing *</span> |
---|
| 19 | 00012 <span class="comment">// * institutes,nor the agencies providing financial support for this *</span> |
---|
| 20 | 00013 <span class="comment">// * work make any representation or warranty, express or implied, *</span> |
---|
| 21 | 00014 <span class="comment">// * regarding this software system or assume any liability for its *</span> |
---|
| 22 | 00015 <span class="comment">// * use. Please see the license in the file LICENSE and URL above *</span> |
---|
| 23 | 00016 <span class="comment">// * for the full disclaimer and the limitation of liability. *</span> |
---|
| 24 | 00017 <span class="comment">// * *</span> |
---|
| 25 | 00018 <span class="comment">// * This code implementation is the result of the scientific and *</span> |
---|
| 26 | 00019 <span class="comment">// * technical work of the GEANT4 collaboration. *</span> |
---|
| 27 | 00020 <span class="comment">// * By using, copying, modifying or distributing the software (or *</span> |
---|
| 28 | 00021 <span class="comment">// * any work based on the software) you agree to acknowledge its *</span> |
---|
| 29 | 00022 <span class="comment">// * use in resulting scientific publications, and indicate your *</span> |
---|
| 30 | 00023 <span class="comment">// * acceptance of all terms of the Geant4 Software license. *</span> |
---|
| 31 | 00024 <span class="comment">// ********************************************************************</span> |
---|
| 32 | 00025 <span class="comment">//</span> |
---|
| 33 | 00026 <span class="comment">//</span> |
---|
| 34 | 00027 <span class="comment">// $Id: G4UIQt.hh,v 1.13 2006/06/29 19:09:33 gunter Exp $</span> |
---|
| 35 | 00028 <span class="comment">// GEANT4 tag $Name: geant4-08-01 $</span> |
---|
| 36 | 00029 <span class="comment">//</span> |
---|
| 37 | 00030 <span class="preprocessor">#ifndef G4UIQt_h</span> |
---|
| 38 | 00031 <span class="preprocessor"></span><span class="preprocessor">#define G4UIQt_h </span> |
---|
| 39 | 00032 <span class="preprocessor"></span> |
---|
| 40 | 00033 <span class="preprocessor">#if defined(G4UI_BUILD_QT_SESSION) || defined(G4UI_USE_QT)</span> |
---|
| 41 | 00034 <span class="preprocessor"></span> |
---|
| 42 | 00035 <span class="preprocessor">#include <map></span> |
---|
| 43 | 00036 |
---|
| 44 | 00037 <span class="preprocessor">#include "<a class="code" href="G4VBasicShell_8hh.html">G4VBasicShell.hh</a>"</span> |
---|
| 45 | 00038 <span class="preprocessor">#include "<a class="code" href="G4VInteractiveSession_8hh.html">G4VInteractiveSession.hh</a>"</span> |
---|
| 46 | 00039 |
---|
| 47 | 00040 <span class="preprocessor">#include <QtGui/qmainwindow.h></span> |
---|
| 48 | 00041 <span class="preprocessor">#include <QtGui/qlineedit.h></span> |
---|
| 49 | 00042 <span class="preprocessor">#include <QtGui/qlistwidget.h></span> |
---|
| 50 | 00043 <span class="preprocessor">#include <QtGui/qtextedit.h></span> |
---|
| 51 | 00044 <span class="preprocessor">#include <QtGui/qlabel.h></span> |
---|
| 52 | 00045 <span class="preprocessor">#include <QtGui/qtreewidget.h></span> |
---|
| 53 | 00046 <span class="preprocessor">#include <QSignalMapper.h></span> |
---|
| 54 | 00047 <span class="preprocessor">#include <QObject></span> |
---|
| 55 | 00048 |
---|
| 56 | 00049 <span class="keyword">class </span>G4UIsession; |
---|
| 57 | 00050 |
---|
| 58 | 00051 |
---|
| 59 | 00052 <span class="comment">// Class description :</span> |
---|
| 60 | 00053 <span class="comment">//</span> |
---|
| 61 | 00054 <span class="comment">// G4UIQt : class to handle a Motif interactive session.</span> |
---|
| 62 | 00055 <span class="comment">// G4UIQt is the Motif version of G4UIterminal.</span> |
---|
| 63 | 00056 <span class="comment">//</span> |
---|
| 64 | 00057 <span class="comment">// A command box is at disposal for entering/recalling Geant4 commands.</span> |
---|
| 65 | 00058 <span class="comment">// A menubar could be customized through the AddMenu, AddButton methods.</span> |
---|
| 66 | 00059 <span class="comment">// Note that there are corresponding Geant4 commands to add a </span> |
---|
| 67 | 00060 <span class="comment">// menus in the menubar and add buttons in a menu.</span> |
---|
| 68 | 00061 <span class="comment">// Ex : </span> |
---|
| 69 | 00062 <span class="comment">// /gui/addMenu test Test</span> |
---|
| 70 | 00063 <span class="comment">// /gui/addButton test Init /run/initialize</span> |
---|
| 71 | 00064 <span class="comment">// /gui/addButton test "Set gun" "/control/execute gun.g4m"</span> |
---|
| 72 | 00065 <span class="comment">// /gui/addButton test "Run one event" "/run/beamOn 1"</span> |
---|
| 73 | 00066 <span class="comment">//</span> |
---|
| 74 | 00067 <span class="comment">// Command completion, by typing "tab" key, is available on the </span> |
---|
| 75 | 00068 <span class="comment">// command line.</span> |
---|
| 76 | 00069 <span class="comment">//</span> |
---|
| 77 | 00070 <span class="comment">// Class description - end :</span> |
---|
| 78 | 00071 |
---|
| 79 | <a name="l00072"></a><a class="code" href="classG4UIQt.html">00072</a> <span class="keyword">class </span><a class="code" href="classG4UIQt.html">G4UIQt</a> : <span class="keyword">public</span> QObject, <span class="keyword">public</span> <a class="code" href="classG4VBasicShell.html">G4VBasicShell</a>, <span class="keyword">public</span> <a class="code" href="classG4VInteractiveSession.html">G4VInteractiveSession</a> { |
---|
| 80 | 00073 Q_OBJECT |
---|
| 81 | 00074 |
---|
| 82 | 00075 <span class="keyword">public</span>: <span class="comment">// With description</span> |
---|
| 83 | 00076 <a class="code" href="classG4UIQt.html#a0">G4UIQt</a>(<span class="keywordtype">int</span>,<span class="keywordtype">char</span>**); |
---|
| 84 | 00077 <span class="comment">// (argv, argc) or (0, NULL) had to be given.</span> |
---|
| 85 | 00078 G4UIsession* <a class="code" href="classG4UIQt.html#a1">SessionStart</a>(); |
---|
| 86 | 00079 <span class="comment">// To enter interactive X loop ; waiting/executing command,...</span> |
---|
| 87 | 00080 <span class="keywordtype">void</span> <a class="code" href="classG4UIQt.html#a2">AddMenu</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>*,<span class="keyword">const</span> <span class="keywordtype">char</span>*); |
---|
| 88 | 00081 <span class="comment">// To add a pulldown menu in the menu bar. </span> |
---|
| 89 | 00082 <span class="comment">// First argument is the name of the menu.</span> |
---|
| 90 | 00083 <span class="comment">// Second argument is the label of the cascade button.</span> |
---|
| 91 | 00084 <span class="comment">// Ex : AddMenu("my_menu","My menu")</span> |
---|
| 92 | 00085 <span class="keywordtype">void</span> <a class="code" href="classG4UIQt.html#a3">AddButton</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>*,<span class="keyword">const</span> <span class="keywordtype">char</span>*,<span class="keyword">const</span> <span class="keywordtype">char</span>*); |
---|
| 93 | 00086 <span class="comment">// To add a push button in a pulldown menu.</span> |
---|
| 94 | 00087 <span class="comment">// First argument is the name of the menu.</span> |
---|
| 95 | 00088 <span class="comment">// Second argument is the label of the button.</span> |
---|
| 96 | 00089 <span class="comment">// Third argument is the Geant4 command executed when the button is fired.</span> |
---|
| 97 | 00090 <span class="comment">// Ex : AddButton("my_menu","Run","/run/beamOn 1"); </span> |
---|
| 98 | 00091 <span class="keyword">public</span>: |
---|
| 99 | 00092 <a class="code" href="classG4UIQt.html#a4">~G4UIQt</a>(); |
---|
| 100 | 00093 <span class="keywordtype">void</span> <a class="code" href="classG4UIQt.html#a5">Prompt</a>(G4String); |
---|
| 101 | 00094 <span class="keywordtype">void</span> <a class="code" href="classG4UIQt.html#a6">SessionTerminate</a>(); |
---|
| 102 | 00095 <span class="keywordtype">void</span> <a class="code" href="classG4UIQt.html#a7">PauseSessionStart</a>(G4String); |
---|
| 103 | 00096 G4int <a class="code" href="classG4UIQt.html#a8">ReceiveG4cout</a>(G4String); |
---|
| 104 | 00097 G4int <a class="code" href="classG4UIQt.html#a9">ReceiveG4cerr</a>(G4String); |
---|
| 105 | 00098 <span class="comment">// G4String GetCommand(Widget);</span> |
---|
| 106 | 00099 |
---|
| 107 | 00100 <span class="keyword">private</span>: |
---|
| 108 | 00101 <span class="keywordtype">void</span> <a class="code" href="classG4UIQt.html#d0">SecondaryLoop</a>(G4String); <span class="comment">// a VIRER</span> |
---|
| 109 | 00102 <span class="keywordtype">void</span> <a class="code" href="classG4UIQt.html#d1">TerminalHelp</a>(G4String); |
---|
| 110 | 00103 <span class="keywordtype">void</span> <a class="code" href="classG4UIQt.html#d2">CreateChildTree</a>(QTreeWidgetItem*,G4UIcommandTree*); |
---|
| 111 | 00104 QString <a class="code" href="classG4UIQt.html#d3">GetCommandList</a>(G4UIcommand*); |
---|
| 112 | 00105 |
---|
| 113 | 00106 G4bool <a class="code" href="classG4UIQt.html#d4">GetHelpChoice</a>(G4int&) ;<span class="comment">// have to be implemeted because we heritate from G4VBasicShell</span> |
---|
| 114 | 00107 <span class="keywordtype">void</span> <a class="code" href="classG4UIQt.html#d5">ExitHelp</a>();<span class="comment">// have to be implemeted because we heritate from G4VBasicShell</span> |
---|
| 115 | 00108 <span class="keywordtype">bool</span> <a class="code" href="classG4UIQt.html#d6">eventFilter</a>(QObject*,QEvent*); |
---|
| 116 | 00109 |
---|
| 117 | 00110 <span class="keyword">private</span>: |
---|
| 118 | 00111 |
---|
| 119 | 00112 <span class="comment">// Widget form,shell,command,menuBar,text;</span> |
---|
| 120 | 00113 <span class="comment">// std::map<QAction*,G4String, std::less<QAction*> > commands;</span> |
---|
| 121 | 00114 <span class="comment">// static void commandEnteredCallback(Widget,XtPointer,XtPointer);</span> |
---|
| 122 | 00115 <span class="comment">// static void keyHandler(Widget,XtPointer,XEvent*,Boolean*);</span> |
---|
| 123 | <a name="l00116"></a><a class="code" href="classG4UIQt.html#r0">00116</a> QMainWindow * <a class="code" href="classG4UIQt.html#r0">fMainWindow</a>; |
---|
| 124 | <a name="l00117"></a><a class="code" href="classG4UIQt.html#r1">00117</a> QLabel *<a class="code" href="classG4UIQt.html#r1">fCommandLabel</a>; |
---|
| 125 | <a name="l00118"></a><a class="code" href="classG4UIQt.html#r2">00118</a> QLineEdit * <a class="code" href="classG4UIQt.html#r2">fCommandArea</a>; |
---|
| 126 | <a name="l00119"></a><a class="code" href="classG4UIQt.html#r3">00119</a> QTextEdit *<a class="code" href="classG4UIQt.html#r3">fTextArea</a>; |
---|
| 127 | <a name="l00120"></a><a class="code" href="classG4UIQt.html#r4">00120</a> QTextEdit *<a class="code" href="classG4UIQt.html#r4">fHelpArea</a>; |
---|
| 128 | <a name="l00121"></a><a class="code" href="classG4UIQt.html#r5">00121</a> QListWidget *<a class="code" href="classG4UIQt.html#r5">fCommandHistoryArea</a>; |
---|
| 129 | <a name="l00122"></a><a class="code" href="classG4UIQt.html#r6">00122</a> QSignalMapper *<a class="code" href="classG4UIQt.html#r6">signalMapper</a> ; |
---|
| 130 | <a name="l00123"></a><a class="code" href="classG4UIQt.html#r7">00123</a> QTreeWidget *<a class="code" href="classG4UIQt.html#r7">fHelpTreeWidget</a>; |
---|
| 131 | <a name="l00124"></a><a class="code" href="classG4UIQt.html#r8">00124</a> QDialog *<a class="code" href="classG4UIQt.html#r8">fHelpDialog</a>; |
---|
| 132 | 00125 |
---|
| 133 | 00126 signals : |
---|
| 134 | 00127 <span class="keywordtype">void</span> <a class="code" href="classG4UIQt.html#l0">myClicked</a>(<span class="keyword">const</span> QString &text); |
---|
| 135 | 00128 |
---|
| 136 | 00129 <span class="keyword">private</span> slots : |
---|
| 137 | 00130 <span class="keywordtype">void</span> <a class="code" href="classG4UIQt.html#k0">clearButtonCallback</a>(); |
---|
| 138 | 00131 <span class="keywordtype">void</span> <a class="code" href="classG4UIQt.html#k1">commandEnteredCallback</a>(); |
---|
| 139 | 00132 <span class="keywordtype">void</span> <a class="code" href="classG4UIQt.html#k2">buttonCallback</a>(<span class="keyword">const</span> QString&); |
---|
| 140 | 00133 <span class="keywordtype">void</span> <a class="code" href="classG4UIQt.html#k3">helpTreeCallback</a>(); |
---|
| 141 | 00134 <span class="keywordtype">void</span> <a class="code" href="classG4UIQt.html#k4">showHelpCallback</a>(); |
---|
| 142 | 00135 <span class="keywordtype">void</span> <a class="code" href="classG4UIQt.html#k5">commandHistoryCallback</a>(); |
---|
| 143 | 00136 }; |
---|
| 144 | 00137 |
---|
| 145 | 00138 <span class="preprocessor">#endif</span> |
---|
| 146 | 00139 <span class="preprocessor"></span> |
---|
| 147 | 00140 <span class="preprocessor">#endif</span> |
---|
| 148 | 00141 <span class="preprocessor"></span> |
---|
| 149 | </pre></div><hr size="1"><address style="align: right;"><small>Generated on Fri Jun 22 11:07:02 2007 by |
---|
| 150 | <a href="http://www.doxygen.org/index.html"> |
---|
| 151 | <img src="doxygen.png" alt="doxygen" align="middle" border=0 > |
---|
| 152 | </a>1.3.4 </small></address> |
---|
| 153 | </body> |
---|
| 154 | </html> |
---|