GUIMain.cxx
Go to the documentation of this file.
1 #include "TGTableLayout.h"
2 #include "TApplication.h"
14 
15 using namespace om;
16 
18  TGMainFrame(gClient->GetRoot(),
19  Layout::fWindowSizeX-1,
20  Layout::fWindowSizeY-1)
21 {
22  int ncol = 3;
23  int nrow = 6;
24  fLayoutManager = new TGTableLayout(this, nrow, ncol);
25  this->SetLayoutManager(fLayoutManager);
26 
27  int tl = kLHintsTop|kLHintsLeft;
28  int tr = kLHintsTop|kLHintsRight;
29  int bl = kLHintsBottom|kLHintsLeft;
30  int xx = kLHintsFillX|kLHintsExpandX;
31  int xy = kLHintsFillY|kLHintsExpandY;
32 
33 
34  // L/R T/B
35  fMenuBarHints = new TGTableLayoutHints(0,3, 0,1, tl|xx, 2, 2, 2, 2);
36  fHeaderBarHints = new TGTableLayoutHints(0,3, 1,2, tl|xx, 2, 2, 2, 2);
37  fButtonBankHints = new TGTableLayoutHints(1,2, 2,3, tl, 2, 2, 2, 2);
38  fHistogramInfoHints = new TGTableLayoutHints(2,3, 2,3, tr|xx, 2, 2, 2, 2);
39  fCaptionBoxHints = new TGTableLayoutHints(0,1, 4,5, bl|xy, 2, 2, 2, 2);
40  fLogViewerHints = new TGTableLayoutHints(0,3, 5,6, bl|xx|xy, 2, 2, 2, 2);
41  fTabsBoxHints = new TGTableLayoutHints(0,1, 3,4, tl|xy, 2, 2, 2, 2);
42  fPlotViewerHints = new TGTableLayoutHints(1,3, 3,5, tl|xx|xy, 2, 2, 2, 2);
43 
44  fMenuBar = new MenuBar(this);
45  this->AddFrame(fMenuBar, fMenuBarHints);
46 
47  fHeaderBar = new HeaderBar(this);
48  this->AddFrame(fHeaderBar, fHeaderBarHints);
49 
50  fCaptionBox = new CaptionBox(this);
51  this->AddFrame(fCaptionBox, fCaptionBoxHints);
52 
53  fHistogramInfo = new HistogramInfo(this);
54  this->AddFrame(fHistogramInfo, fHistogramInfoHints);
55 
56  fLogViewer = new LogViewer(this);
57  this->AddFrame(fLogViewer, fLogViewerHints);
60  om::cout << "Starting online monitoring viewer" << "";
61 
62  fTabsBox = new TabsBox(this);
63  this->AddFrame(fTabsBox, fTabsBoxHints);
64 
65  fButtonBank = new ButtonBank(this);
66  this->AddFrame(fButtonBank, fButtonBankHints);
67 
68  fPlotViewer = new PlotViewer(this);
69  this->AddFrame(fPlotViewer, fPlotViewerHints);
70 
71  this->MapSubwindows();
72  this->Resize(Layout::fWindowSizeX+12,Layout::fWindowSizeY+24);
73  this->MapWindow();
74 
75 }
76 
77 //......................................................................
78 
80 {
81  if (fLogViewer) { delete fLogViewer; fLogViewer = 0; }
82  if (fPlotViewer) { delete fPlotViewer; fPlotViewer = 0; }
83  if (fButtonBank) { delete fButtonBank; fButtonBank = 0; }
84  if (fHistogramInfo) { delete fHistogramInfo; fHistogramInfo = 0; }
85  if (fTabsBox) { delete fTabsBox; fTabsBox = 0; }
86  if (fHeaderBar) { delete fHeaderBar; fHeaderBar = 0; }
87  if (fMenuBar) { delete fMenuBar; fMenuBar = 0; }
88 
89  if (fLogViewerHints) { delete fLogViewerHints; fLogViewerHints = 0; }
93  if (fTabsBoxHints) { delete fTabsBoxHints; fTabsBoxHints = 0; }
94  if (fHeaderBarHints) { delete fHeaderBarHints; fHeaderBarHints = 0; }
95  if (fMenuBarHints) { delete fMenuBarHints; fMenuBarHints = 0; }
96 }
97 
98 //......................................................................
99 
101 {
102  gApplication->Terminate();
103 }
104 
105 ////////////////////////////////////////////////////////////////////////
TGTableLayoutHints * fLogViewerHints
Definition: GUIMain.h:35
TGTableLayoutHints * fPlotViewerHints
Definition: GUIMain.h:34
Double_t xx
Definition: macro.C:12
static const unsigned int fWindowSizeX
Definition: Layout.h:7
TGTableLayoutHints * fTabsBoxHints
Definition: GUIMain.h:30
void SetLogViewer(om::LogViewer *lv)
Definition: OStream.cxx:28
TabsBox * fTabsBox
Definition: GUIMain.h:39
TGTableLayoutHints * fHeaderBarHints
Definition: GUIMain.h:29
OStream cerr
Definition: OStream.cxx:7
ButtonBank * fButtonBank
Definition: GUIMain.h:42
TGTableLayout * fLayoutManager
Definition: GUIMain.h:27
TGTableLayoutHints * fButtonBankHints
Definition: GUIMain.h:33
static const unsigned int fWindowSizeY
Definition: Layout.h:8
TGTableLayoutHints * fHistogramInfoHints
Definition: GUIMain.h:32
void CloseWindow()
Definition: GUIMain.cxx:100
OStream cout
Definition: OStream.cxx:6
HistogramInfo * fHistogramInfo
Definition: GUIMain.h:41
LogViewer * fLogViewer
Definition: GUIMain.h:44
HeaderBar * fHeaderBar
Definition: GUIMain.h:38
MenuBar * fMenuBar
Definition: GUIMain.h:37
TGTableLayoutHints * fMenuBarHints
Definition: GUIMain.h:28
CaptionBox * fCaptionBox
Definition: GUIMain.h:40
Canvas on which plots and reports are drawn.
TGTableLayoutHints * fCaptionBoxHints
Definition: GUIMain.h:31
Online Monitoring package header.
PlotViewer * fPlotViewer
Definition: GUIMain.h:43