Logo ROOT   6.08/07
Reference Guide
guitest.h
Go to the documentation of this file.
1 #ifndef GUITEST_H
2 #define GUITEST_H
3 
4 #include <stdlib.h>
5 
6 #include <TROOT.h>
7 #include <TApplication.h>
8 #include <TVirtualX.h>
9 
10 #include <TGListBox.h>
11 #include <TGClient.h>
12 #include <TGFrame.h>
13 #include <TGIcon.h>
14 #include <TGLabel.h>
15 #include <TGButton.h>
16 #include <TGTextEntry.h>
17 #include <TGMsgBox.h>
18 #include <TGMenu.h>
19 #include <TGCanvas.h>
20 #include <TGComboBox.h>
21 #include <TGTab.h>
22 #include <TGSlider.h>
23 #include <TGDoubleSlider.h>
24 #include <TGFileDialog.h>
25 #include <TGTextEdit.h>
26 #include <TGShutter.h>
27 #include <TGProgressBar.h>
28 #include <TRootEmbeddedCanvas.h>
29 #include <TCanvas.h>
30 #include <TH1.h>
31 #include <TH2.h>
32 #include <TRandom.h>
33 #include <TSystem.h>
34 #include <TEnv.h>
35 
36 
42 
48 
52 
56 
61 
66 };
67 
68 
69 struct shutterData_t {
70  const char *pixmap_name;
71  const char *tip_text;
74 };
75 
76 
77 
78 
79 
80 
81 class TileFrame : public TGCompositeFrame {
82 
83 private:
85 
86 public:
87  TileFrame(const TGWindow *p);
88  virtual ~TileFrame() { }
89 
90  void SetCanvas(TGCanvas *canvas) { fCanvas = canvas; }
91  Bool_t HandleButton(Event_t *event);
92 };
93 
94 
95 
96 class TestMainFrame : public TGMainFrame {
97 
98 private:
104 
106  TGPopupMenu *fMenuFile, *fMenuTest, *fMenuHelp;
107  TGPopupMenu *fCascadeMenu, *fCascade1Menu, *fCascade2Menu;
108  TGLayoutHints *fMenuBarLayout, *fMenuBarItemLayout, *fMenuBarHelpLayout;
109 
110 public:
111  TestMainFrame(const TGWindow *p, UInt_t w, UInt_t h);
112  virtual ~TestMainFrame();
113 
114  virtual void CloseWindow();
115  virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t);
116 };
117 
118 
119 class TestDialog : public TGTransientFrame {
120 
121 private:
122  TGCompositeFrame *fFrame1, *fF1, *fF2, *fF3, *fF4, *fF5, *fF6, *fF7;
123  TGButton *fOkButton, *fCancelButton, *fStartB, *fStopB;
124  TGButton *fBtn1, *fBtn2, *fChk1, *fChk2, *fRad1, *fRad2;
126  TGRadioButton *fRadio1, *fRadio2;
132  TGTextEntry *fTxt1, *fTxt2;
133  TGLayoutHints *fL1, *fL2, *fL3, *fL4;
141 
142  void FillHistos();
143 
144 public:
145  TestDialog(const TGWindow *p, const TGWindow *main, UInt_t w, UInt_t h,
146  UInt_t options = kVerticalFrame);
147  virtual ~TestDialog();
148 
149  virtual void CloseWindow();
150  virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
151 };
152 
153 
154 class TestMsgBox : public TGTransientFrame {
155 
156 private:
157  TGCompositeFrame *f1, *f2, *f3, *f4, *f5;
158  TGButton *fTestButton, *fCloseButton;
163  TGLayoutHints *fL1, *fL2, *fL3, *fL4, *fL5, *fL6, *fL21;
166  TGLabel *fLtitle, *fLmsg;
168 
169 public:
170  TestMsgBox(const TGWindow *p, const TGWindow *main, UInt_t w, UInt_t h,
171  UInt_t options = kVerticalFrame);
172  virtual ~TestMsgBox();
173 
174  virtual void CloseWindow();
175  virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
176 };
177 
178 
180 
181 private:
183  TGLayoutHints *fBly, *fBfly1;
184  TGHSlider *fHslider1, *fHslider2;
187  TGTextEntry *fTeh1, *fTev1, *fTeh2, *fTev2;
188  TGTextBuffer *fTbh1, *fTbv1, *fTbh2, *fTbv2;
189 
190 public:
191  TestSliders(const TGWindow *p, const TGWindow *main, UInt_t w, UInt_t h);
192  virtual ~TestSliders();
193 
194  virtual void CloseWindow();
195  virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
196 };
197 
198 
200 
201 private:
206 
207 public:
208  TestShutter(const TGWindow *p, const TGWindow *main, UInt_t w, UInt_t h);
209  ~TestShutter();
210 
211  void AddShutterItem(const char *name, shutterData_t data[]);
212  virtual void CloseWindow();
213  virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
214 };
215 
216 
218 
219 private:
222  TGLayoutHints *fHint1, *fHint2, *fHint3, *fHint4, *fHint5;
223  TGHProgressBar *fHProg1, *fHProg2, *fHProg3;
226 
227 public:
228  TestProgress(const TGWindow *p, const TGWindow *main, UInt_t w, UInt_t h);
229  virtual ~TestProgress();
230 
231  virtual void CloseWindow();
232  virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
233 };
234 
235 
236 class Editor : public TGTransientFrame {
237 
238 private:
239  TGTextEdit *fEdit; // text edit widget
240  TGTextButton *fOK; // OK button
241  TGLayoutHints *fL1; // layout of TGTextEdit
242  TGLayoutHints *fL2; // layout of OK button
243 
244 public:
245  Editor(const TGWindow *main, UInt_t w, UInt_t h);
246  virtual ~Editor();
247 
248  void LoadBuffer(const char *buffer);
249  void LoadFile(const char *file);
250 
251  TGTextEdit *GetEditor() const { return fEdit; }
252 
253  void SetTitle();
254  void Popup();
255  void CloseWindow();
256  Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
257 };
258 
259 
260 #endif
TGCheckButton * fCheckMulti
Definition: guitest.h:128
TGTextEntry * fTitle
Definition: guitest.h:164
TGButton * fTestButton
Definition: guitest.h:103
Definition: TGTab.h:66
Definition: guitest.h:62
TGCompositeFrame * f5
Definition: guitest.h:157
Definition: guitest.h:65
TGCanvas * fCanvasWindow
Definition: guitest.h:100
TGTextButton * fGO
Definition: guitest.h:225
TGTextBuffer * fTbtitle
Definition: guitest.h:165
TH1 * h
Definition: legend2.C:5
Definition: guitest.h:63
Definition: guitest.h:60
TList * fCleanup
Definition: guitest.h:140
TGShutter * fShutter
Definition: guitest.h:202
TGLayoutHints * fBly
Definition: guitest.h:183
tomato 1-D histogram with a float per channel (see TH1 documentation)}
Definition: TH1.h:575
Int_t fLastEntry
Definition: guitest.h:136
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
Definition: guitest.h:58
Definition: guitest.h:57
TileFrame * fContainer
Definition: guitest.h:101
TGTextEntry * fTev2
Definition: guitest.h:187
Bool_t fFillHistos
Definition: guitest.h:137
TGTextEdit * fEdit
Definition: guitest.h:239
TGButton * fStopB
Definition: guitest.h:123
TGGC fRedTextGC
Definition: guitest.h:167
TRootEmbeddedCanvas * fEc2
Definition: guitest.h:134
TGVProgressBar * fVProg2
Definition: guitest.h:224
TGVerticalFrame * fVframe2
Definition: guitest.h:182
ETestCommandIdentifiers
Definition: guitest.h:37
TGHProgressBar * fHProg3
Definition: guitest.h:223
TGPictureButton * fPictButton
Definition: guitest.h:159
Definition: guitest.h:59
TGCompositeFrame * fFrame1
Definition: guitest.h:122
TGGroupFrame * fG2
Definition: guitest.h:162
TGCheckButton * fCheck1
Definition: guitest.h:127
TGLayoutHints * fL4
Definition: guitest.h:133
TH2F * fHpxpy
Definition: guitest.h:139
Definition: guitest.h:64
TGComboBox * fCombo
Definition: guitest.h:130
TGTextBuffer * fTbv2
Definition: guitest.h:188
TGVerticalFrame * fVframe1
Definition: guitest.h:221
A doubly linked list.
Definition: TList.h:47
const char * pixmap_name
Definition: guitest.h:70
TGLabel * fLtitle
Definition: guitest.h:166
TGHorizontalFrame * fHframe1
Definition: guitest.h:220
TGPopupMenu * fMenuTest
Definition: guitest.h:106
TGVSlider * fVslider1
Definition: guitest.h:185
TGLayoutHints * fL1
Definition: guitest.h:241
void SetCanvas(TGCanvas *canvas)
Definition: guitest.h:90
TGPopupMenu * fCascadeMenu
Definition: guitest.h:107
virtual ~TileFrame()
Definition: guitest.h:88
tomato 2-D histogram with a float per channel (see TH1 documentation)}
Definition: TH2.h:255
TList * fTrash
Definition: guitest.h:205
unsigned int UInt_t
Definition: RtypesCore.h:42
TGListBox * fListBox
Definition: guitest.h:129
TGMenuBar * fMenuBar
Definition: guitest.h:105
Int_t id
Definition: guitest.h:72
TGTextEdit * GetEditor() const
Definition: guitest.h:251
TGLayoutHints * fHint5
Definition: guitest.h:222
TGTab * fTab
Definition: guitest.h:131
TGButton * button
Definition: guitest.h:73
TGCompositeFrame * fStatusFrame
Definition: guitest.h:99
long Long_t
Definition: RtypesCore.h:50
TGButton * fRad2
Definition: guitest.h:124
TGHSlider * fHslider2
Definition: guitest.h:184
const char * tip_text
Definition: guitest.h:71
TGLayoutHints * fMenuBarLayout
Definition: guitest.h:108
TH1F * fHpx
Definition: guitest.h:138
TGRadioButton * fRadio2
Definition: guitest.h:126
const TGPicture * fDefaultPic
Definition: guitest.h:204
double f2(const double *x)
Definition: file.py:1
TGTextEntry * fTestText
Definition: guitest.h:102
TF1 * f1
Definition: legend1.C:11
TGDoubleVSlider * fVslider2
Definition: guitest.h:186
TGLayoutHints * fL2
Definition: guitest.h:242
Int_t fFirstEntry
Definition: guitest.h:135
TGTextEntry * fTxt2
Definition: guitest.h:132
TGTextButton * fOK
Definition: guitest.h:240
Definition: TGGC.h:35
int main(int argc, char **argv)
char name[80]
Definition: TGX11.cxx:109
TGLayoutHints * fL6
Definition: guitest.h:163
TGCanvas * fCanvas
Definition: guitest.h:84
TGPictureButton * fPicBut1
Definition: guitest.h:125
TGButton * fTestButton
Definition: guitest.h:158
TGLayoutHints * fLayout
Definition: guitest.h:203