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

Last change on this file since 1038 was 959, checked in by tbretz, 23 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): 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 "MCameraDisplay.h"
27
28#include <TGButton.h> // TGTextButton
29
30#include "MGCamDisplay.h"
31
32ClassImp(MCameraDisplay)
33
34enum {
35 M_BUTTON_DISP
36};
37
38// --------------------------------------------------------------------------
39//
40// Create the 'Data Check' GUI Controls (Window) on the screen. To use it
41// from within the interpreter you can call a Standard Version with
42// 'new MCameraDisplay()'
43//
44MCameraDisplay::MCameraDisplay(const TGWindow *main, const TGWindow *p,
45 const UInt_t w, const UInt_t h)
46: MBrowser(main, p, w, h)
47{
48 TGTextButton *disp = new TGTextButton(fTop2, "Display Events", M_BUTTON_DISP);
49 fList->Add(disp);
50
51 disp->Associate(this);
52
53 TGLayoutHints *laybut = new TGLayoutHints(kLHintsTop|kLHintsLeft, 10, 10, 5, 5);
54 fList->Add(laybut);
55
56 fTop2->AddFrame(disp, laybut);
57
58 MapSubwindows();
59
60 Layout();
61
62 SetWindowName("Camera Display Window");
63 SetIconName("Camera Dsiplay");
64
65 MapWindow();
66}
67
68// --------------------------------------------------------------------------
69//
70// Process the GUI control events (here: mainly button clicks)
71//
72Bool_t MCameraDisplay::ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
73{
74 // Process events generated by the buttons in the frame.
75
76 if (GET_MSG(msg)!=kC_COMMAND || GET_SUBMSG(msg)!=kCM_BUTTON)
77 return MBrowser::ProcessMessage(msg, parm1, parm2);
78
79 switch (parm1)
80 {
81 case M_BUTTON_DISP:
82 if (!InputFileSelected())
83 {
84 DisplError("No Input (root) File selected!");
85 return kTRUE;
86 }
87
88 switch (parm1)
89 {
90 case M_BUTTON_DISP:
91 new MGCamDisplay(fInputFile,
92 fClient->GetRoot(), this, 600, 500);
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.