source: trunk/MagicSoft/Mars/mmain/MCameraDisplay.cc@ 6378

Last change on this file since 6378 was 3503, checked in by tbretz, 21 years ago
*** empty log message ***
File size: 2.8 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): Thomas Bretz, 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
19! Author(s): Harald Kornmayer 1/2001
20!
21! Copyright: MAGIC Software Development, 2000-2004
22!
23!
24\* ======================================================================== */
25
26#include "MCameraDisplay.h"
27
28#include <TGButton.h> // TGTextButton
29
30#include "MGList.h"
31#include "MEventDisplay.h"
32
33ClassImp(MCameraDisplay);
34
35enum {
36 kButDisplay = 0x100
37};
38
39// --------------------------------------------------------------------------
40//
41// Create the 'Data Check' GUI Controls (Window) on the screen. To use it
42// from within the interpreter you can call a Standard Version with
43// 'new MCameraDisplay()'
44//
45MCameraDisplay::MCameraDisplay(/*const TGWindow *main,*/ const TGWindow *p,
46 const UInt_t w, const UInt_t h)
47: MBrowser(/*main,*/ p, w, h)
48{
49 TGTextButton *disp = new TGTextButton(fTop2, "Display Events", kButDisplay);
50 fList->Add(disp);
51
52 disp->Associate(this);
53
54 TGLayoutHints *laybut = new TGLayoutHints(kLHintsTop|kLHintsLeft, 10, 10, 5, 5);
55 fList->Add(laybut);
56
57 fTop2->AddFrame(disp, laybut);
58
59 MapSubwindows();
60
61 Layout();
62
63 SetWindowName("Camera Display Window");
64 SetIconName("Camera Dsiplay");
65
66 MapWindow();
67}
68
69// --------------------------------------------------------------------------
70//
71// Process the GUI control events (here: mainly button clicks)
72//
73Bool_t MCameraDisplay::ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
74{
75 // Process events generated by the buttons in the frame.
76
77 if (GET_MSG(msg)!=kC_COMMAND || GET_SUBMSG(msg)!=kCM_BUTTON)
78 return MBrowser::ProcessMessage(msg, parm1, parm2);
79
80 switch (parm1)
81 {
82 case kButDisplay:
83 if (!InputFileSelected())
84 {
85 DisplError("No Input (root) File selected!");
86 return kTRUE;
87 }
88
89 switch (parm1)
90 {
91 case kButDisplay:
92 new MEventDisplay(fInputFile, "ped.root", "cal.root");
93 return kTRUE;
94 }
95 return kTRUE;
96 }
97
98 return MBrowser::ProcessMessage(msg, parm1, parm2);
99}
Note: See TracBrowser for help on using the repository browser.