1 | #include "MEvtDisp.h"
|
---|
2 |
|
---|
3 | #include <TGButton.h> // TGTextButton
|
---|
4 |
|
---|
5 | #include "MGFadcDisp.h"
|
---|
6 |
|
---|
7 | ClassImp(MEvtDisp)
|
---|
8 |
|
---|
9 | enum {
|
---|
10 | M_BUT_DISP1_EVT,
|
---|
11 | M_BUT_DISP1_PED,
|
---|
12 | M_BUT_DISP1_CAL,
|
---|
13 | };
|
---|
14 |
|
---|
15 | MEvtDisp::MEvtDisp(const TGWindow *main, const TGWindow *p,
|
---|
16 | const UInt_t w, const UInt_t h)
|
---|
17 | : MBrowser(main, p, w, h)
|
---|
18 | {
|
---|
19 |
|
---|
20 | fButFadcDispEvts = new TGTextButton(fTop1, "FADC Disp for Events", M_BUT_DISP1_EVT );
|
---|
21 | fButFadcDispEvts->Associate(this) ;
|
---|
22 | fTop1->AddFrame (fButFadcDispEvts, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
|
---|
23 |
|
---|
24 | fButFadcDispPed = new TGTextButton(fTop1, "FADC Disp for PedEvts", M_BUT_DISP1_PED );
|
---|
25 | fButFadcDispPed->Associate(this) ;
|
---|
26 | fTop1->AddFrame (fButFadcDispPed, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
|
---|
27 |
|
---|
28 | fButFadcDispCal = new TGTextButton(fTop1, "FADC Disp for CalEvts", M_BUT_DISP1_CAL );
|
---|
29 | fButFadcDispCal->Associate(this) ;
|
---|
30 | fTop1->AddFrame (fButFadcDispCal, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
|
---|
31 |
|
---|
32 | MapSubwindows();
|
---|
33 |
|
---|
34 | Layout();
|
---|
35 |
|
---|
36 | SetWindowName("EventDispMain");
|
---|
37 | SetIconName("EventDispMain");
|
---|
38 |
|
---|
39 | MapWindow();
|
---|
40 | }
|
---|
41 |
|
---|
42 | MEvtDisp::~MEvtDisp()
|
---|
43 | {
|
---|
44 | delete fButFadcDispCal;
|
---|
45 | delete fButFadcDispPed;
|
---|
46 | delete fButFadcDispEvts;
|
---|
47 | }
|
---|
48 |
|
---|
49 | // ======================================================================
|
---|
50 |
|
---|
51 | Bool_t MEvtDisp::ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
|
---|
52 | {
|
---|
53 | // Process events generated by the buttons in the frame.
|
---|
54 |
|
---|
55 | if (GET_MSG(msg) != kC_COMMAND || GET_SUBMSG(msg) != kCM_BUTTON)
|
---|
56 | return MBrowser::ProcessMessage(msg, parm1, parm2);
|
---|
57 |
|
---|
58 | switch (parm1)
|
---|
59 | {
|
---|
60 | case M_BUT_DISP1_EVT:
|
---|
61 | case M_BUT_DISP1_PED:
|
---|
62 | case M_BUT_DISP1_CAL:
|
---|
63 | if (!InputFileSelected())
|
---|
64 | {
|
---|
65 | DisplError("No Input (root) File selected!");
|
---|
66 | return kTRUE;
|
---|
67 | }
|
---|
68 |
|
---|
69 | switch (parm1)
|
---|
70 | {
|
---|
71 | case M_BUT_DISP1_EVT:
|
---|
72 | new MGFadcDisp(fInputFile, "Events",
|
---|
73 | fClient->GetRoot(), this, 600, 500);
|
---|
74 | return kTRUE;
|
---|
75 |
|
---|
76 | case M_BUT_DISP1_PED:
|
---|
77 | new MGFadcDisp( fInputFile , "PedEvts",
|
---|
78 | fClient->GetRoot(), this, 600, 500 ) ;
|
---|
79 | return kTRUE;
|
---|
80 |
|
---|
81 | case M_BUT_DISP1_CAL:
|
---|
82 | new MGFadcDisp( fInputFile , "CalEvts",
|
---|
83 | fClient->GetRoot(), this, 600, 500 ) ;
|
---|
84 | return kTRUE;
|
---|
85 | }
|
---|
86 | return kTRUE;
|
---|
87 | }
|
---|
88 |
|
---|
89 | return MBrowser::ProcessMessage(msg, parm1, parm2);
|
---|
90 | }
|
---|