Index: trunk/MagicSoft/Mars/mmain/MCameraDisplay.cc
===================================================================
--- trunk/MagicSoft/Mars/mmain/MCameraDisplay.cc	(revision 959)
+++ trunk/MagicSoft/Mars/mmain/MCameraDisplay.cc	(revision 959)
@@ -0,0 +1,99 @@
+/* ======================================================================== *\
+!
+! *
+! * This file is part of MARS, the MAGIC Analysis and Reconstruction
+! * Software. It is distributed to you in the hope that it can be a useful
+! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
+! * It is distributed WITHOUT ANY WARRANTY.
+! *
+! * Permission to use, copy, modify and distribute this software and its
+! * documentation for any purpose is hereby granted without fee,
+! * provided that the above copyright notice appear in all copies and
+! * that both that copyright notice and this permission notice appear
+! * in supporting documentation. It is provided "as is" without express
+! * or implied warranty.
+! *
+!
+!
+!   Author(s): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
+!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+#include "MCameraDisplay.h"
+
+#include <TGButton.h>  // TGTextButton
+
+#include "MGCamDisplay.h"
+
+ClassImp(MCameraDisplay)
+
+enum {
+    M_BUTTON_DISP
+};
+
+// --------------------------------------------------------------------------
+//
+//  Create the 'Data Check' GUI Controls (Window) on the screen. To use it
+//  from within the interpreter you can call a Standard Version with
+//  'new MCameraDisplay()'
+//
+MCameraDisplay::MCameraDisplay(const TGWindow *main, const TGWindow *p,
+                       const UInt_t w, const UInt_t h)
+: MBrowser(main, p, w, h)
+{
+    TGTextButton *disp = new TGTextButton(fTop2, "Display Events", M_BUTTON_DISP);
+    fList->Add(disp);
+
+    disp->Associate(this);
+
+    TGLayoutHints *laybut = new TGLayoutHints(kLHintsTop|kLHintsLeft, 10, 10, 5, 5);
+    fList->Add(laybut);
+
+    fTop2->AddFrame(disp, laybut);
+
+    MapSubwindows();
+
+    Layout();
+
+    SetWindowName("Camera Display Window");
+    SetIconName("Camera Dsiplay");
+
+    MapWindow();
+}
+
+// --------------------------------------------------------------------------
+//
+//  Process the GUI control events (here: mainly button clicks)
+//
+Bool_t MCameraDisplay::ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
+{
+    // Process events generated by the buttons in the frame.
+
+    if (GET_MSG(msg)!=kC_COMMAND || GET_SUBMSG(msg)!=kCM_BUTTON)
+        return MBrowser::ProcessMessage(msg, parm1, parm2);
+
+    switch (parm1)
+    {
+    case M_BUTTON_DISP:
+        if (!InputFileSelected())
+        {
+            DisplError("No Input (root) File selected!");
+            return kTRUE;
+        }
+
+        switch (parm1)
+        {
+        case M_BUTTON_DISP:
+            new MGCamDisplay(fInputFile,
+                             fClient->GetRoot(), this, 600, 500);
+            return kTRUE;
+        }
+        return kTRUE;
+    }
+
+    return MBrowser::ProcessMessage(msg, parm1, parm2);
+}
Index: trunk/MagicSoft/Mars/mmain/MCameraDisplay.h
===================================================================
--- trunk/MagicSoft/Mars/mmain/MCameraDisplay.h	(revision 959)
+++ trunk/MagicSoft/Mars/mmain/MCameraDisplay.h	(revision 959)
@@ -0,0 +1,25 @@
+#ifndef MCAMERADISPLAY_H
+#define MCAMERADISPLAY_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+
+#ifndef MBROWSER_H
+#include "MBrowser.h"
+#endif
+
+class MCameraDisplay : public MBrowser
+{
+public:
+    MCameraDisplay(const TGWindow *main=NULL, const TGWindow *p=NULL,
+                   const UInt_t w=500, const UInt_t h=500) ;
+
+    Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
+
+    ClassDef(MCameraDisplay, 0) // GUI: The 'data-check' window.
+};
+
+#endif
+
+
Index: trunk/MagicSoft/Mars/mmain/MDataCheck.cc
===================================================================
--- trunk/MagicSoft/Mars/mmain/MDataCheck.cc	(revision 954)
+++ trunk/MagicSoft/Mars/mmain/MDataCheck.cc	(revision 959)
@@ -28,4 +28,15 @@
 #include <TGButton.h>  // TGTextButton
 
+// ---
+
+#include "MParList.h"
+#include "MTaskList.h"
+#include "MEvtLoop.h"
+#include "MReadTree.h"
+#include "MFillH.h"
+#include "MGDisplayAdc.h"
+
+// ---
+
 ClassImp(MDataCheck)
 
@@ -37,6 +48,12 @@
 };
 
+// --------------------------------------------------------------------------
+//
+//  Create the 'Data Check' GUI Controls (Window) on the screen. To use it
+//  from within the interpreter you can call a Standard Version with
+//  'new MDataCheck()'
+//
 MDataCheck::MDataCheck(const TGWindow *main, const TGWindow *p,
-                                 const UInt_t w, const UInt_t h)
+                       const UInt_t w, const UInt_t h)
 : MBrowser(main, p, w, h)
 {
@@ -75,6 +92,54 @@
 }
 
-// ======================================================================
+// --------------------------------------------------------------------------
+//
+//  Create the 'View Adc' GUI Controls (Window) on the screen.
+//  Therefor we have to process all data in a file and fill the corresponding
+//  histograms.
+//
+void MDataCheck::ViewAdcSpectra(Char_t *inputfile, Char_t *treeName)
+{
+    //
+    // create a (empty) list of parameters which can be used by the tasks
+    // and an (empty) list of tasks which should be executed
+    // connect them in the required way.
+    //
 
+    //
+    //   create the data containers for the raw data
+    //
+    MParList plist;
+
+    //
+    // set up the tasks for this job
+    //
+    MTaskList tasks;
+    plist.AddToList(&tasks);
+
+    MReadTree readin(treeName, inputfile);
+    tasks.AddToList(&readin);
+
+    MFillH fillspect("MRawEvtData", "MHFadcCam");
+    tasks.AddToList(&fillspect);
+
+    //
+    // set up the loop for the processing
+    //
+    MEvtLoop magic;
+    magic.SetParList(&plist);
+
+    //
+    // start the loop running
+    //
+    if (!magic.Eventloop())
+        return;
+
+    new MGDisplayAdc((MHFadcCam*)plist.FindObject("MHFadcCam"));
+}
+
+// --------------------------------------------------------------------------
+//
+//  Process the GUI control events (here: mainly button clicks)
+//
 Bool_t MDataCheck::ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
 {
@@ -99,9 +164,9 @@
         {
         case M_BUTTON_PEDADC:
-            fViewAdc.AdcSpectra(fInputFile, "PedEvents");
+            ViewAdcSpectra(fInputFile, "PedEvents");
             return kTRUE;
 
         case M_BUTTON_CRADC:
-            fViewAdc.AdcSpectra(fInputFile, "Events");
+            ViewAdcSpectra(fInputFile, "Events");
             return kTRUE;
 
Index: trunk/MagicSoft/Mars/mmain/MDataCheck.h
===================================================================
--- trunk/MagicSoft/Mars/mmain/MDataCheck.h	(revision 954)
+++ trunk/MagicSoft/Mars/mmain/MDataCheck.h	(revision 959)
@@ -10,12 +10,8 @@
 #endif
 
-#ifndef MVIEWADCSPECTRA_H
-#include "MViewAdcSpectra.h"
-#endif
-
 class MDataCheck : public MBrowser
 {
 private:
-    MViewAdcSpectra fViewAdc;
+    void ViewAdcSpectra(Char_t *inputfile, Char_t *treeName);
 
 public:
Index: trunk/MagicSoft/Mars/mmain/MMars.cc
===================================================================
--- trunk/MagicSoft/Mars/mmain/MMars.cc	(revision 954)
+++ trunk/MagicSoft/Mars/mmain/MMars.cc	(revision 959)
@@ -34,25 +34,24 @@
 #include <TG3DLine.h>      // TGHorizontal3DLine
                            // use TGSplitter.h for root<3.00
-
 #include "MEvtDisp.h"
 #include "MAnalysis.h"
 #include "MDataCheck.h"
 #include "MMonteCarlo.h"
-
-#include "MGPrototyp.h"
+#include "MCameraDisplay.h"
 
 ClassImp(MMars)
 
 enum {
-  M_FILE_EXIT,
-  M_FILE_ABOUT,
-
-  M_PICTURE_MAGIC,
-  M_PICTURE_MARS,
-
-  M_BUTTON_EVTDISP,
-  M_BUTTON_DATACHECK,
-  M_BUTTON_ANALYSE,
-  M_BUTTON_MONTECARLO
+    M_FILE_EXIT,
+    M_FILE_ABOUT,
+
+    M_PICTURE_MAGIC,
+    M_PICTURE_MARS,
+
+    M_BUTTON_EVTDISP,
+    M_BUTTON_DATACHECK,
+    M_BUTTON_ANALYSE,
+    M_BUTTON_MONTECARLO,
+    M_BUTTON_CAMDISPLAY
 };
 
@@ -97,6 +96,6 @@
     mars->Associate(this);
 
-    TGLayoutHints *lay1 = new TGLayoutHints(kLHintsLeft, 10., 10., 20., 10.);
-    TGLayoutHints *lay2 = new TGLayoutHints(kLHintsLeft, 10., 10., 10., 10.);
+    TGLayoutHints *lay1 = new TGLayoutHints(kLHintsLeft,  10., 10., 20., 10.);
+    TGLayoutHints *lay2 = new TGLayoutHints(kLHintsRight, 10., 10., 10., 10.);
 
     fList->Add(lay1);
@@ -105,4 +104,28 @@
     top->AddFrame(magic, lay1);
     top->AddFrame(mars,  lay2);
+}
+
+void MMars::CreateTextButton(TGVerticalFrame *tab, const char *text,
+                             const UInt_t id, TGLayoutHints *hints) const
+{
+    //
+    // Create the button
+    //
+    TGTextButton *button = new TGTextButton(tab, text, id);
+
+    //
+    // Add button for 'auto-delete'
+    //
+    fList->Add(button);
+
+    //
+    // Send button events (meesages) to this object (s. ProcessMessage)
+    //
+    button->Associate(this);
+
+    //
+    // Add button with corresponding layout to containing frame
+    //
+    tab->AddFrame(button, hints);
 }
 
@@ -136,30 +159,17 @@
     tf->AddFrame(tab2, laytabx);
 
-    TGTextButton *evtdisp    = new TGTextButton(tab2, "EventDisplay", M_BUTTON_EVTDISP);
-    TGTextButton *datacheck  = new TGTextButton(tab2, "Data Check",   M_BUTTON_DATACHECK);
-    TGTextButton *analysis   = new TGTextButton(tab2, "Analysis",     M_BUTTON_ANALYSE);
-    TGTextButton *montecarlo = new TGTextButton(tab2, "MonteCarlo",   M_BUTTON_MONTECARLO);
-
-    fList->Add(evtdisp);
-    fList->Add(datacheck);
-    fList->Add(analysis);
-    fList->Add(montecarlo);
-
-    evtdisp   ->Associate(this);
-    datacheck ->Associate(this);
-    analysis  ->Associate(this);
-    montecarlo->Associate(this);
-
-    TGLayoutHints *laybut = new TGLayoutHints(kLHintsTop|kLHintsCenterX , 10, 10, 10, 10);
+    TGLayoutHints *laybut = new TGLayoutHints(kLHintsTop|kLHintsCenterX, 10, 10, 10, 10);
     fList->Add(laybut);
 
-    tab2->AddFrame(evtdisp,    laybut);
-    tab2->AddFrame(datacheck,  laybut);
-    tab2->AddFrame(analysis,   laybut);
-    tab2->AddFrame(montecarlo, laybut);
+    CreateTextButton(tab2, "Event Display",  M_BUTTON_EVTDISP,    laybut);
+    CreateTextButton(tab2, "Data Check",     M_BUTTON_DATACHECK,  laybut);
+    CreateTextButton(tab2, "Analysis",       M_BUTTON_ANALYSE,    laybut);
+    CreateTextButton(tab2, "Monte Carlo",    M_BUTTON_MONTECARLO, laybut);
+    CreateTextButton(tab2, "Camera Display", M_BUTTON_CAMDISPLAY, laybut);
 }
 
 MMars::MMars(/*const TGWindow *p,*/ UInt_t w, UInt_t h)
-  : TGMainFrame(gClient->GetRoot(), w, h)
+: TGMainFrame(gClient->GetRoot(), w, h)
+//: MBrowser (gClient->GetRoot(), gClient->GetRoot(), w, h)
 {
     //
@@ -196,8 +206,11 @@
     AddFrame(low,     layout);
 
+    //    CreateTopFrame(fTop2);
+    //    CreateBottomFrame(fTop3);
+
     //
     //   Map the window, set up the layout, etc.
     //
-    SetWMSizeHints(400, 380, 400, 380, 10, 10);  // set the smallest and biggest size of the Main frame
+    SetWMSizeHints(400, 410, 400, 410, 10, 10);  // set the smallest and biggest size of the Main frame
 
     MapSubwindows();
@@ -271,12 +284,17 @@
                 return kTRUE;
 
+            case M_BUTTON_CAMDISPLAY:
+                new MCameraDisplay(this);
+                return kTRUE;
+
             case M_PICTURE_MAGIC:
-                DisplWarning("Please open a Netscape to the MAGIC homepage");
+                DisplWarning("Please open a Netscape to the MAGIC homepage\n"
+                             "http://hegra1.mppmu.mpg.de/MAGICWeb/");
                 return kTRUE;
 
             case M_PICTURE_MARS:
-                DisplWarning("Please open a Netscape to the MARS homepage");
-                return kTRUE;
-
+                DisplWarning("Please open a Netscape to the MARS homepage\n"
+                             "http://magic.uni-sw.gwdg.de/mars/");
+                return kTRUE;
             }
 
Index: trunk/MagicSoft/Mars/mmain/MMars.h
===================================================================
--- trunk/MagicSoft/Mars/mmain/MMars.h	(revision 954)
+++ trunk/MagicSoft/Mars/mmain/MMars.h	(revision 959)
@@ -10,5 +10,13 @@
 #endif
 
+/*
+ #ifndef MBROWSER_H
+ #include <MBrowser.h>
+ #endif
+ */
+
 class TList;
+class TGVerticalFrame;
+class TGLayoutHints;
 
 class MMars : public TGMainFrame
@@ -20,4 +28,7 @@
     const TGPicture *fPic1;
     const TGPicture *fPic2;
+
+    void CreateTextButton(TGVerticalFrame *tab, const char *text,
+                          const UInt_t id, TGLayoutHints *hints) const;
 
     void CreateMenuBar();
Index: trunk/MagicSoft/Mars/mmain/MainLinkDef.h
===================================================================
--- trunk/MagicSoft/Mars/mmain/MainLinkDef.h	(revision 954)
+++ trunk/MagicSoft/Mars/mmain/MainLinkDef.h	(revision 959)
@@ -12,4 +12,5 @@
 #pragma link C++ class MDataCheck;
 #pragma link C++ class MMonteCarlo;
+#pragma link C++ class MCameraDisplay;
 
 #endif
Index: trunk/MagicSoft/Mars/mmain/Makefile
===================================================================
--- trunk/MagicSoft/Mars/mmain/Makefile	(revision 954)
+++ trunk/MagicSoft/Mars/mmain/Makefile	(revision 959)
@@ -34,4 +34,5 @@
            MAnalysis.cc \
 	   MMonteCarlo.cc \
+           MCameraDisplay.cc \
            MBrowser.cc
 
