Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 950)
+++ trunk/MagicSoft/Mars/Changelog	(revision 951)
@@ -1,3 +1,13 @@
                                                                   -*-*- END -*-*-
+
+ 2001/09/27: Thomas Bretz
+
+   * mmain/MBrowser.cc:
+     - added comments
+
+   * mmain/MAnalysis.[h,cc]:
+     - added entry field for cleaning levels
+
+
 
  2001/09/26: Thomas Bretz
@@ -35,5 +45,4 @@
    * mmc/McLinkDef.h:
      - removed nonsens define statement
-     
 
 
Index: trunk/MagicSoft/Mars/mmain/MAnalysis.cc
===================================================================
--- trunk/MagicSoft/Mars/mmain/MAnalysis.cc	(revision 950)
+++ trunk/MagicSoft/Mars/mmain/MAnalysis.cc	(revision 951)
@@ -25,11 +25,15 @@
 #include "MAnalysis.h"
 
-#include <TGButton.h>  // TGTextButton
+#include <stdlib.h>        // atof
+#include <iostream.h>
+
+#include <TGLabel.h>       // TGlabel
+#include <TGButton.h>      // TGTextButton
+#include <TGTextEntry.h>   // TGNumberEntry
 
 ClassImp(MAnalysis)
 
 enum {
-    M_BUTTON_HILLAS,
-    M_CHECK_DISPLHIL
+    M_BUTTON_HILLAS
 };
 
@@ -50,17 +54,94 @@
 void MAnalysis::AddSetupTab()
 {
+    //
+    // Create Setup Tab
+    //
     TGCompositeFrame *frame = CreateNewTab("Setup");
 
-    TGLayoutHints *laybut = new TGLayoutHints(kLHintsTop|kLHintsLeft, 10, 10, 5, 5);
-    fList->Add(laybut);
-
-    fCheckButton1 = new TGCheckButton(frame, "Display Hillas Histograms when finished", M_CHECK_DISPLHIL);
-    fCheckButton2 = new TGCheckButton(frame, "Display Star Map Histogram when finished", M_CHECK_DISPLHIL);
+    //
+    // Align the lines:
+    //  - top, left
+    //  - padding: top=20, bottom=0, left=20, right=0
+    //
+    TGLayoutHints *layline = new TGLayoutHints(kLHintsNormal, 20, 0, 20);
+    fList->Add(layline);
+
+    //
+    // Create check buttons for the first two lines
+    //
+    fCheckButton1 = new TGCheckButton(frame, "Display Hillas Histograms when finished");  //, M_CHECK_DISPLHIL);
+    fCheckButton2 = new TGCheckButton(frame, "Display Star Map Histogram when finished"); //, M_CHECK_DISPLHIL);
 
     fList->Add(fCheckButton1);
     fList->Add(fCheckButton2);
 
-    frame->AddFrame(fCheckButton1, laybut);
-    frame->AddFrame(fCheckButton2, laybut);
+    //
+    // Create first two lines with the checkbuttons
+    //
+    frame->AddFrame(fCheckButton1, layline);
+    frame->AddFrame(fCheckButton2, layline);
+
+    //
+    // Create entry fields and labels for line 3 and 4
+    //
+
+    /*
+     * --> use with root >=3.02 <--
+     *
+
+     TGNumberEntry *fNumEntry1 = new TGNumberEntry(frame, 3.0, 2, M_NENT_LVL1, kNESRealOne, kNEANonNegative);
+     TGNumberEntry *fNumEntry2 = new TGNumberEntry(frame, 2.5, 2, M_NENT_LVL1, kNESRealOne, kNEANonNegative);
+
+     */
+
+    //
+    // Create a frame for line 3 and 4 to be able
+    // to align entry field and label in one line
+    //
+    TGHorizontalFrame *f1 = new TGHorizontalFrame(frame, 0, 0);
+    TGHorizontalFrame *f2 = new TGHorizontalFrame(frame, 0, 0);
+
+    fNumEntry1 = new TGTextEntry(f1, "****");
+    fNumEntry2 = new TGTextEntry(f2, "****");
+
+    // --- doesn't work like expected --- fNumEntry1->SetAlignment(kTextRight);
+    // --- doesn't work like expected --- fNumEntry2->SetAlignment(kTextRight);
+
+    fNumEntry1->SetText("3.0");
+    fNumEntry2->SetText("2.5");
+ 
+    fList->Add(fNumEntry1);
+    fList->Add(fNumEntry2);
+
+    TGLabel *l1 = new TGLabel(f1, "Cleaning Level 1 for standard image cleaning.");
+    TGLabel *l2 = new TGLabel(f2, "Cleaning Level 2 for standard image cleaning.");
+
+    l1->SetTextJustify(kTextLeft);
+    l2->SetTextJustify(kTextLeft);
+
+    fList->Add(l1);
+    fList->Add(l2);
+
+    //
+    // Align the text of the label centered, left in the row
+    // with a left padding of 10
+    //
+    TGLayoutHints *laylabel = new TGLayoutHints(kLHintsCenterY|kLHintsLeft, 10); //, 10); //, 5, 5);
+    fList->Add(laylabel);
+
+    //
+    // Add one entry field and the corresponding label to each line
+    //
+    f1->AddFrame(fNumEntry1);
+    f2->AddFrame(fNumEntry2);
+
+    f1->AddFrame(l1, laylabel);
+    f2->AddFrame(l2, laylabel);
+
+    //
+    // Add line 3 and 4 to tab
+    //
+    frame->AddFrame(f1, layline);
+    frame->AddFrame(f2, layline);
 }
 
@@ -107,4 +188,19 @@
     const Bool_t displstarmap = fCheckButton2->GetState();
 
+    Float_t cleanlvl1 = atof(fNumEntry1->GetText());
+    Float_t cleanlvl2 = atof(fNumEntry2->GetText());
+
+    if (cleanlvl1<0)
+    {
+        cleanlvl1=0;
+        fNumEntry1->SetText("0");
+    }
+
+    if (cleanlvl2<0)
+    {
+        cleanlvl2=0;
+        fNumEntry2->SetText("0");
+    }
+
     //
     // Create a empty Parameter List and an empty Task List
@@ -160,5 +256,5 @@
     MReadTree      read("Events", fInputFile);
     MCerPhotCalc   ncalc;
-    MImgCleanStd   clean;
+    MImgCleanStd   clean(cleanlvl1, cleanlvl2);
     MHillasCalc    hcalc;
     MFillH         hfill(&hillas, hists);
@@ -193,4 +289,6 @@
     if (displstarmap)
         smap->Draw();
+
+    cout << "Calculation of Hillas Parameters finished without error!" << endl;
 }
 
Index: trunk/MagicSoft/Mars/mmain/MAnalysis.h
===================================================================
--- trunk/MagicSoft/Mars/mmain/MAnalysis.h	(revision 950)
+++ trunk/MagicSoft/Mars/mmain/MAnalysis.h	(revision 951)
@@ -10,4 +10,5 @@
 #endif
 
+class TGTextEntry;
 class TGCheckButton;
 
@@ -17,4 +18,7 @@
     TGCheckButton *fCheckButton1;
     TGCheckButton *fCheckButton2;
+
+    TGTextEntry   *fNumEntry1;
+    TGTextEntry   *fNumEntry2;
 
     void CalculateHillas() const;
Index: trunk/MagicSoft/Mars/mmain/MBrowser.cc
===================================================================
--- trunk/MagicSoft/Mars/mmain/MBrowser.cc	(revision 950)
+++ trunk/MagicSoft/Mars/mmain/MBrowser.cc	(revision 951)
@@ -105,12 +105,21 @@
     fDir->Resize(350, 20);
 
+    //
+    // Get the three picturs from the system (must be deleted by FreePicture)
+    //
     fPic1 = fClient->GetPicture("tb_uplevel.xpm");
     fPic2 = fClient->GetPicture("tb_list.xpm");
     fPic3 = fClient->GetPicture("tb_details.xpm");
 
+    //
+    // Create the corresponding picture buttons
+    //
     fCdup     = new TGPictureButton(frame, fPic1, M_PBUTTON_CDIR_UP);
     fListMode = new TGPictureButton(frame, fPic2, M_PBUTTON_LIST_MODE);
     fDetail   = new TGPictureButton(frame, fPic3, M_PBUTTON_DETAIL_MODE);
 
+    //
+    // setup the buttons
+    //
     fCdup    ->SetToolTipText("One Level up!");
     fListMode->SetToolTipText("List Mode");
@@ -123,4 +132,7 @@
     fDetail  ->AllowStayDown(kTRUE);
 
+    //
+    // send messages to 'this' object
+    //
     fDir     ->Associate(this);
     fCdup    ->Associate(this);
@@ -128,4 +140,7 @@
     fListMode->Associate(this);
 
+    //
+    // Add to list for 'automatic' deletion
+    //
     fList->Add(fDir);
     fList->Add(fCdup);
@@ -134,16 +149,17 @@
 
     //
-    // Layout Dir-Listbox and buttons
-    //
-    TGLayoutHints *laydir = new TGLayoutHints(kLHintsTop|kLHintsLeft|kLHintsExpandX, 5, 5, 5, 5);
-    TGLayoutHints *laybut = new TGLayoutHints(kLHintsLeft|kLHintsTop, 5, 5, 5, 5);
-
-    fList->Add(laydir);
-    fList->Add(laybut);
-
-    frame->AddFrame(fDir,      laydir);
-    frame->AddFrame(fCdup,     laybut);
-    frame->AddFrame(fListMode, laybut);
-    frame->AddFrame(fDetail,   laybut);
+    // Layout Dir-Listbox and buttons in one row (frame)
+    //
+    //  - layout:
+    //    alignment: top, left
+    //    padding:   5, 5, 5, 5
+    //
+    TGLayoutHints *layout = new TGLayoutHints(kLHintsNormal, 5, 5, 5, 5);
+    fList->Add(layout);
+
+    frame->AddFrame(fDir,      layout);
+    frame->AddFrame(fCdup,     layout);
+    frame->AddFrame(fListMode, layout);
+    frame->AddFrame(fDetail,   layout);
 }
 
@@ -239,5 +255,4 @@
     fInputFile[0] = '\0';
 
-    fList = new TList;
     fList->SetOwner();
 
@@ -293,6 +308,4 @@
     fClient->FreePicture(fPic2);
     fClient->FreePicture(fPic3);
-
-    delete fList;
 } 
 
Index: trunk/MagicSoft/Mars/mmain/MBrowser.h
===================================================================
--- trunk/MagicSoft/Mars/mmain/MBrowser.h	(revision 950)
+++ trunk/MagicSoft/Mars/mmain/MBrowser.h	(revision 951)
@@ -43,5 +43,5 @@
 
 protected:
-    TList  *fList;
+    TList  *fList; 
     Char_t  fInputFile[256];
 
