HYDRA_development_version
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
make_GUI.C
Go to the documentation of this file.
1 #ifndef __MAKEGUI__
2 #define __MAKEGUI__
3 
4 
5 
6 #include "TRootBrowser.h"
7 #include "TString.h"
8 #include "TSystem.h"
9 
10 #include "TEveManager.h"
11 #include "TEveBrowser.h"
12 
13 #include "TGFrame.h"
14 #include "TGButton.h"
15 #include "TGColorDialog.h"
16 #include "TGColorSelect.h"
17 
18 #include "hedgui.h"
19 
20 
21 #include "nextEvent.C"
22 
23 //---------------------------------------------------------
24 // MAKE GUI
25 // Create the GUI for Display setup in Eve. Connect
26 // "nex Event" button to HEDEvtNavHandler defined in
27 // nextEvent.C
28 //---------------------------------------------------------
29 
30 
31 void make_GUI(){
32 
33  TEveBrowser* browser = gEve->GetBrowser();
34  browser->StartEmbedding(TRootBrowser::kLeft);
35  TGMainFrame* frmMain = new TGMainFrame(gClient->GetRoot(), 1000, 600);
36  frmMain->SetWindowName("XX GUI");
37  frmMain->SetCleanup(kDeepCleanup);
38 
39  //-------------------------------------------------------------
40  // next event button
41  Int_t width = 300;
42  Int_t height = 100;
43 
44  HEDSetup* setup = HEDSetup::getEDSetup(frmMain,width,height);
45  frmMain->AddFrame(setup,new TGLayoutHints(kLHintsCenterX | kLHintsTop, 0, 0, 1, 1));
46 
47 
48  //-------------------------------------------------------------
49  TGHorizontalFrame *fHL4 = new TGHorizontalFrame(frmMain, width, height, kFixedWidth);
50 
52  setup->fNext = new TGTextButton (fHL4,"next Event", setup->IDs.GetUnID());
53  setup->fNext->SetToolTipText("Click here to load next Event. \n"
54  "If the loop check box is set it will \n"
55  " loop for events. Uncheck the box to \n"
56  "stop. The loop will stop also if \n"
57  "nextEvent() return with non ZERO.");
58  setup->fNext->Connect("Clicked()", "HEDEvtNavHandler", fhandler, "selectEvent()");
59  fHL4->AddFrame(setup->fNext, new TGLayoutHints(kLHintsExpandX));
60  frmMain->AddFrame(fHL4, new TGLayoutHints(kLHintsCenterX, 1, 1, 1, 1));
61 
62  //-------------------------------------------------------------
63 
64  frmMain->MapSubwindows();
65  frmMain->Resize();
66  frmMain->MapWindow();
67 
68  browser->StopEmbedding();
69  browser->SetTabTitle("Event Control", 0);
70 
71 }
72 #endif
73 
HEDIDList IDs
swich SHOWER sectors
Definition: hedgui.h:203
Int_t GetUnID(void)
Definition: hedgui.h:161
static HEDEvtNavHandler * getHandler()
Definition: nextEvent.C:375
void make_GUI()
Definition: make_GUI.C:31
TGTextButton * fNext
Check buttons show WALL.
Definition: hedgui.h:193
static HEDSetup * getEDSetup(const TGWindow *p=0, UInt_t w=0, UInt_t h=0)
Definition: hedgui.h:176