source: trunk/MagicSoft/Mars/mmain/MEvtDisp.cc@ 951

Last change on this file since 951 was 947, checked in by tbretz, 23 years ago
*** empty log message ***
File size: 3.3 KB
Line 
1/* ======================================================================== *\
2!
3! *
4! * This file is part of MARS, the MAGIC Analysis and Reconstruction
5! * Software. It is distributed to you in the hope that it can be a useful
6! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
7! * It is distributed WITHOUT ANY WARRANTY.
8! *
9! * Permission to use, copy, modify and distribute this software and its
10! * documentation for any purpose is hereby granted without fee,
11! * provided that the above copyright notice appear in all copies and
12! * that both that copyright notice and this permission notice appear
13! * in supporting documentation. It is provided "as is" without express
14! * or implied warranty.
15! *
16!
17!
18! Author(s): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
19! Author(s): Thomas Bretz 12/2000 (tbretz@uni-sw.gwdg.de)
20!
21! Copyright: MAGIC Software Development, 2000-2001
22!
23!
24\* ======================================================================== */
25
26#include "MEvtDisp.h"
27
28#include <TGButton.h> // TGTextButton
29
30#include "MGFadcDisp.h"
31
32ClassImp(MEvtDisp)
33
34enum {
35 M_BUT_DISP1_EVT,
36 M_BUT_DISP1_PED,
37 M_BUT_DISP1_CAL
38};
39
40MEvtDisp::MEvtDisp(const TGWindow *main, const TGWindow *p,
41 const UInt_t w, const UInt_t h)
42: MBrowser(main, p, w, h)
43{
44 TGTextButton *fadcevt = new TGTextButton(fTop1, "FADC Disp for Events", M_BUT_DISP1_EVT);
45 TGTextButton *fadcped = new TGTextButton(fTop1, "FADC Disp for PedEvts", M_BUT_DISP1_PED);
46 TGTextButton *fadccal = new TGTextButton(fTop1, "FADC Disp for CalEvts", M_BUT_DISP1_CAL);
47
48 fadcevt->Associate(this);
49 fadcped->Associate(this);
50 fadccal->Associate(this);
51
52 fList->Add(fadcevt);
53 fList->Add(fadcped);
54 fList->Add(fadccal);
55
56 TGLayoutHints *laybut = new TGLayoutHints(kLHintsTop|kLHintsLeft, 10, 10, 5, 5);
57 fList->Add(laybut);
58
59 fTop1->AddFrame(fadcevt, laybut);
60 fTop1->AddFrame(fadcped, laybut);
61 fTop1->AddFrame(fadccal, laybut);
62
63 MapSubwindows();
64
65 Layout();
66
67 SetWindowName("EventDispMain");
68 SetIconName("EventDispMain");
69
70 MapWindow();
71}
72
73// ======================================================================
74
75Bool_t MEvtDisp::ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
76{
77 // Process events generated by the buttons in the frame.
78
79 if (GET_MSG(msg) != kC_COMMAND || GET_SUBMSG(msg) != kCM_BUTTON)
80 return MBrowser::ProcessMessage(msg, parm1, parm2);
81
82 switch (parm1)
83 {
84 case M_BUT_DISP1_EVT:
85 case M_BUT_DISP1_PED:
86 case M_BUT_DISP1_CAL:
87 if (!InputFileSelected())
88 {
89 DisplError("No Input (root) File selected!");
90 return kTRUE;
91 }
92
93 switch (parm1)
94 {
95 case M_BUT_DISP1_EVT:
96 new MGFadcDisp(fInputFile, "Events",
97 fClient->GetRoot(), this, 600, 500);
98 return kTRUE;
99
100 case M_BUT_DISP1_PED:
101 new MGFadcDisp(fInputFile , "PedEvts",
102 fClient->GetRoot(), this, 600, 500);
103 return kTRUE;
104
105 case M_BUT_DISP1_CAL:
106 new MGFadcDisp(fInputFile , "CalEvts",
107 fClient->GetRoot(), this, 600, 500);
108 return kTRUE;
109 }
110 return kTRUE;
111 }
112
113 return MBrowser::ProcessMessage(msg, parm1, parm2);
114}
Note: See TracBrowser for help on using the repository browser.