Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 713)
+++ trunk/MagicSoft/Mars/Changelog	(revision 714)
@@ -3,7 +3,17 @@
  2000/03/30: Thomas Bretz
  
-   * mdatacheck/MH*, mdatacheck/MFillH* moved to mhist
-   
-   * mraw/MrawEvtPixelIter: IsLoGain -> HasLoGain
+   * mdatacheck/MH*, mdatacheck/MFillH*:
+     - moved to mhist
+   
+   * mraw/MrawEvtPixelIter:
+     - IsLoGain -> HasLoGain
+   
+   * mgui/MG*:
+     - renamed
+     - moved to mmain
+     - move Browser functionality to MBrowser
+ 
+   * mmain/, mhist:
+     - new
  
  
Index: trunk/MagicSoft/Mars/Makefile
===================================================================
--- trunk/MagicSoft/Mars/Makefile	(revision 713)
+++ trunk/MagicSoft/Mars/Makefile	(revision 714)
@@ -36,4 +36,5 @@
 #
 SUBDIRS = mgui        \
+          mmain       \
 	  manalysis   \
           meventdisp  \
@@ -120,4 +121,7 @@
 	@cd mmontecarlo; make mrproper; cd ..
 	@echo "cd .."
+	@echo "cd mmain"
+	@cd mmain; make mrproper; cd ..
+	@echo "cd .."
 
 tar:	mrproper
Index: trunk/MagicSoft/Mars/mars.cc
===================================================================
--- trunk/MagicSoft/Mars/mars.cc	(revision 713)
+++ trunk/MagicSoft/Mars/mars.cc	(revision 714)
@@ -1,9 +1,6 @@
 #include <TROOT.h>
-#include <TSystem.h>
 #include <TApplication.h>
-#include <TVirtualX.h>
-#include <TGClient.h>   
 
-#include "MGMarsMain.h"
+#include "MMars.h"
 
 // **********************************************************************
@@ -18,17 +15,22 @@
 int main(int argc, char **argv )
 {
-  // initialise ROOT
+    //
+    // initialise ROOT
+    //
+    TROOT simple("Mars", "MARS - MAGIC analysis and reconstruction software");
 
-  TROOT simple("Mars", "MARS - MAGIC analysis and reconstruction software");
+    TApplication app("MarsApp", &argc, argv);
 
-  TApplication theApp("MarsApp", &argc, argv);
+    //
+    // start the main window
+    //
+    new MMars;
 
-  // start the main window
-  
-  MGMarsMain *mainWin = new MGMarsMain(400, 650);
-  
-  theApp.Run();
+    //
+    // run the application
+    //
+    app.Run();
 
-  return 0;  
+    return 0;
 }
  
Index: trunk/MagicSoft/Mars/mgui/GuiIncl.h
===================================================================
--- trunk/MagicSoft/Mars/mgui/GuiIncl.h	(revision 713)
+++ trunk/MagicSoft/Mars/mgui/GuiIncl.h	(revision 714)
@@ -1,14 +1,3 @@
 #ifndef __CINT__
 
-#include <TGButton.h>       // TGPictureButton
-#include <TGTab.h>          // TGTab
-#include <TGMenu.h>         // TGPopupMenu
-#include <TGMsgBox.h>       // TGMsgBox
-#include <TGListBox.h>      // TGListBox
-#include <TGListView.h>     // TGListBox
-#include <TGSplitter.h>     // TGHorizontal3DLine
-#include <TGFSContainer.h>  // TGFileContainer
-#include <TGLabel.h>        // TGLabel
-#include <TGTextEntry.h>  
-
 #endif // __CINT__
Index: trunk/MagicSoft/Mars/mgui/GuiLinkDef.h
===================================================================
--- trunk/MagicSoft/Mars/mgui/GuiLinkDef.h	(revision 713)
+++ trunk/MagicSoft/Mars/mgui/GuiLinkDef.h	(revision 714)
@@ -4,11 +4,4 @@
 #pragma link off all classes;
 #pragma link off all functions;
-
-#pragma link C++ class MGMarsMain;
-#pragma link C++ class MGEventDispMain;
-#pragma link C++ class MGDataCheckMain;
-#pragma link C++ class MGMonteCarloMain;
-
-#pragma link C++ class MGPrototyp;
 
 #pragma link C++ class MHexagon;
Index: trunk/MagicSoft/Mars/mgui/MCamDisplay.h
===================================================================
--- trunk/MagicSoft/Mars/mgui/MCamDisplay.h	(revision 713)
+++ trunk/MagicSoft/Mars/mgui/MCamDisplay.h	(revision 714)
@@ -20,7 +20,7 @@
 class TBox;
 class TText;
-class TClonesArray ;
+class TClonesArray;
 
-class MCerPhotEvt  ;
+class MCerPhotEvt;
 class MGeomCam;
 
@@ -28,14 +28,14 @@
 {
  private: 
-  Bool_t         fAutoScale ;   //!  indicating the autoscale function
+  Bool_t         fAutoScale;   //!  indicating the autoscale function
   
-  UInt_t         fNumPixels ;   //!
-  TClonesArray  *fPixels   ;    //!
+  UInt_t         fNumPixels;   //!
+  TClonesArray  *fPixels ;    //!
 
-  Float_t        fMinPhe ;      //!  The minimal number of Phe
-  Float_t        fMaxPhe ;      //!  The maximum number of Phe
+  Float_t        fMinPhe;      //!  The minimal number of Phe
+  Float_t        fMaxPhe;      //!  The maximum number of Phe
 
-  TClonesArray  *fLegend  ;     //!
-  TClonesArray  *fLegText ;     //!
+  TClonesArray  *fLegend;     //!
+  TClonesArray  *fLegText;     //!
 
   TBox *GetBox(Int_t i)   { return (TBox*) fLegend->At(i); }
@@ -51,24 +51,24 @@
   MCamDisplay (MGeomCam *geom);
 
-  ~MCamDisplay () ; 
+  ~MCamDisplay (); 
 
-  void Init() ;
+  void Init();
 
-  void Draw(Option_t *option = "" ) ; 
+  void Draw(Option_t *option = "" ); 
 
-  void DrawPhotNum( MCerPhotEvt *event) ;
-  void DrawPhotErr( MCerPhotEvt *event) ;
+  void DrawPhotNum( MCerPhotEvt *event);
+  void DrawPhotErr( MCerPhotEvt *event);
 
-  void Reset() ; 
+  void Reset(); 
 
   MHexagon &operator[](int i) { return *((MHexagon*)fPixels->At(i)); }
 
-  Int_t GetColor( Float_t wert ) ; 
+  Int_t GetColor( Float_t wert ); 
 
-  void UpdateLegend() ;  
+  void UpdateLegend();  
 
   void SetAutoScale (Bool_t input = kTRUE ) 
     { 
-      fAutoScale = input ; 
+      fAutoScale = input; 
     } 
 
Index: trunk/MagicSoft/Mars/mgui/MGDataCheckMain.cc
===================================================================
--- trunk/MagicSoft/Mars/mgui/MGDataCheckMain.cc	(revision 713)
+++ 	(revision )
@@ -1,464 +1,0 @@
-#include "MGDataCheckMain.h"
-
-#include <TSystem.h>        // gSystem
-
-#include <TGTab.h>          // TGTab
-#include <TGMenu.h>         // TGPopupMenu
-#include <TGButton.h>       // TGTextButton
-#include <TGMsgBox.h>       // TGMsgBox
-#include <TGListBox.h>      // TGListBox
-#include <TGFSContainer.h>  // TGFileContainer
-
-// FIXME: Move to MAGIC.h
-#define S_ISDIR(m) (((m)&(0170000)) == (0040000))  
-
-ClassImp(MGDataCheckMain)
-
-enum CommandDataChecker {
-  M_FILE_CLOSE , 
-  M_BUTTON_PEDADC, 
-  M_BUTTON_CRADC, 
-  M_BUTTON_PEDTDC, 
-  M_BUTTON_CRTDC, 
-
-  M_PBUTTON_CDIR_UP, 
-  M_PBUTTON_LIST_MODE, 
-  M_PBUTTON_DETAIL_MODE 
-} ; 
-
-
-MGDataCheckMain::MGDataCheckMain(const TGWindow *p, const TGWindow *main, 
-                            UInt_t w, UInt_t h ) 
-        : TGTransientFrame(p, main, w, h ) 
-{
-  //
-  //    Main window to controll the october test
-  //
-
-  //    set non-gui members to starting values 
-
-  sprintf ( fInputFile, "\n" ) ; 
-
-  //
-  //    First create the MenuBar.   
-  //
-
-  //     Layout objects for menue. 
-
-  fLayMenuBar = new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX, 2, 2, 2, 2 ) ; 
-  fLayMenuItem = new TGLayoutHints ( kLHintsTop | kLHintsLeft , 0, 4, 0, 0 ) ; 
-  
-  //  crate the menu bar
-
-  fFileMenu = new TGPopupMenu ( fClient->GetRoot() ) ; 
-  fFileMenu->AddEntry ("Close", M_FILE_CLOSE ) ; 
-  fFileMenu->Associate(this) ; 
-  
-  //  the button messages are handled by main frame (this) 
-
-  fMenuBar = new TGMenuBar ( this, 1, 1, kHorizontalFrame ) ; 
-  fMenuBar->AddPopup("File", fFileMenu, fLayMenuItem ) ;   
-  AddFrame(fMenuBar, fLayMenuBar ) ; 
-  
-  //
-  //    Create the top window with a lot of buttons 
-  //
-
-  fFrameTop = new TGCompositeFrame (this, 300,100, kVerticalFrame ) ; 
-  
-  fTop1 = new TGHorizontalFrame (fFrameTop, 300, 100 ) ; 
-   
-  fFrameTop->AddFrame (fTop1, new TGLayoutHints(kLHintsCenterX, 10, 10, 5, 5) );
-
-  fTop2 = new TGHorizontalFrame (fFrameTop, 300, 100 ) ; 
- 
-  fButPedADC = new TGTextButton(fTop2, "ADC Spectra of Pedestals", M_BUTTON_PEDADC );
-  fButPedADC->Associate(this) ;   
-  fTop2->AddFrame (fButPedADC, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
-  
-  fButCrADC = new TGTextButton(fTop2, "ADC Specta of Cosmics", M_BUTTON_CRADC );
-  fButCrADC->Associate(this) ;   
-  fTop2->AddFrame (fButCrADC, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
-
-  fFrameTop->AddFrame (fTop2, new TGLayoutHints(kLHintsCenterX, 10, 10, 5, 5) );
-
-  fTop3 = new TGHorizontalFrame (fFrameTop, 300, 100 ) ; 
- 
-  fButPedTDC = new TGTextButton(fTop3, "TDC Spectra of Pedestals", M_BUTTON_PEDTDC );
-  fButPedTDC->Associate(this) ;   
-  fTop3->AddFrame (fButPedTDC, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
-  
-  fButCrTDC = new TGTextButton(fTop3, "TDC Specta of Cosmics", M_BUTTON_CRTDC );
-  fButCrTDC->Associate(this) ;   
-  fTop3->AddFrame (fButCrTDC, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
-
-  fFrameTop->AddFrame (fTop3, new TGLayoutHints(kLHintsCenterX, 10, 10, 5, 5) );
-
-  AddFrame(fFrameTop, new TGLayoutHints (kLHintsTop ) ) ;   
-
-
-  //
-  //    Create the low window with a tabs in it
-  //
-
-  fFrameLow = new TGCompositeFrame (this, 300,100, kHorizontalFrame ) ; 
-  
-  fLayTab = new TGLayoutHints ( kLHintsExpandX   , 5, 5, 5, 5 ) ;
-
-  //    create the first tab
-
-  fTab = new TGTab ( fFrameLow, 400, 400 ) ;   
-
-  TGCompositeFrame *tf = fTab->AddTab("Input File") ; 
-  
-  fTabF1 = new TGCompositeFrame (tf, 100, 100, kHorizontalFrame) ; 
-  //  tf->AddFrame(fTabF1, fLayTab ) ; 
-
-  
-  fTabF1a = new TGCompositeFrame (tf, 100, 100, kHorizontalFrame) ; 
-  tf->AddFrame(fTabF1a,  new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX, 5, 5, 5, 5 ) ) ; 
-
-  fTabF1b = new TGCompositeFrame (tf, 100, 100, kVerticalFrame) ; 
-  //  tf->AddFrame(fTabF1b,  new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX | kLHintsExpandY  , 5, 5, 5, 5 ) ) ; 
-  tf->AddFrame(fTabF1b,  new TGLayoutHints ( kLHintsExpandX | kLHintsExpandY  , 5, 5, 5, 5 ) ) ; 
-
-  
-  fDir = new TGListBox(fTabF1a, -1) ; 
-  fDir->Resize(350,20) ;
-  char temp[100] ; 
-  //  sprintf ( temp, "%s", START_DIRECTORY ) ; 
-  sprintf ( temp, "%s", gSystem->WorkingDirectory()  ) ; 
-  fDir->AddEntry(temp, 1) ; 
-  fTabF1a->AddFrame( fDir, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX, 5, 5, 5, 5 ) ) ; 
-
-
-  fPicCdup = fClient->GetPicture("tb_uplevel.xpm") ; 
-  fCdup = new TGPictureButton(fTabF1a, fPicCdup, M_PBUTTON_CDIR_UP ) ; 
-  fCdup->SetToolTipText("One Level up!") ; 
-  fCdup->Associate(this) ; 
-  fTabF1a->AddFrame (fCdup, new TGLayoutHints(kLHintsLeft | kLHintsTop, 5, 5, 5, 5) ) ; 
-
-  fPicList = fClient->GetPicture("tb_list.xpm") ; 
-  fListMode = new TGPictureButton(fTabF1a, fPicList, M_PBUTTON_LIST_MODE ) ; 
-  fListMode->SetToolTipText("List Mode") ; 
-  fListMode->Associate(this) ; 
-  fListMode->SetState(kButtonUp) ; 
-  fListMode->AllowStayDown(kTRUE) ; 
-  fListMode->AllowStayDown(kTRUE) ;  fTabF1a->AddFrame (fListMode, new TGLayoutHints(kLHintsLeft | kLHintsTop, 5, 5, 5, 5) ) ;
-
-  fPicDetail = fClient->GetPicture("tb_details.xpm") ; 
-  fDetail = new TGPictureButton(fTabF1a, fPicDetail, M_PBUTTON_DETAIL_MODE ) ; 
-  fDetail->SetToolTipText("Details Mode") ; 
-  fDetail->Associate(this) ; 
-  fDetail->SetState(kButtonEngaged) ; 
-  fDetail->AllowStayDown(kTRUE) ; 
-  fTabF1a->AddFrame (fDetail, new TGLayoutHints(kLHintsLeft | kLHintsTop, 5, 5, 5, 5) ) ; 
-
-    
-  fFileView = new TGListView(fTabF1b, 540, 380 ) ; 
-  fFileCont = new TGFileContainer(fFileView->GetViewPort(), 100, 100,
-				  kVerticalFrame, fgWhitePixel) ; 
-
-  fFileCont->Associate(this) ; 
-  fFileView->GetViewPort()->SetBackgroundColor(fgWhitePixel) ; 
-  fFileView->SetContainer(fFileCont) ; 
-  fFileCont->SetFilter("*") ; 
-  //  fFileCont->ChangeDirectory(START_DIRECTORY) ; 
-  fFileCont->ChangeDirectory(gSystem->WorkingDirectory()) ; 
-  fFileView->SetViewMode(kLVDetails); 
-  fFileCont->Sort(kSortByName) ; 
-  
-  fTabF1b->AddFrame(fFileView, new TGLayoutHints(kLHintsTop | kLHintsExpandX | kLHintsExpandY, 5, 5, 5, 5) ) ; 
-
-  tf->AddFrame(fTabF1, fLayTab) ;
- 
-  fFrameLow->AddFrame ( fTab, new TGLayoutHints(kLHintsBottom | kLHintsExpandX | kLHintsExpandY, 5, 5, 5, 5) ); 
-
-  AddFrame(fFrameLow, new TGLayoutHints (kLHintsExpandX|kLHintsExpandY) ) ; 
-
-  //
-  //   Map the window, set up the layout, etc. 
-  //
-
-  SetWMSizeHints(400, 350, 1000, 1000, 10, 10 ) ;      // set the smallest and biggest size of the Main frame
-
-  MapSubwindows();
-  
-  Layout();
-  
-  SetWindowName("DataCheck Window");
-  SetIconName("DataCheck");
-  
-  MapWindow();
-
-} 
-
-
-// ======================================================================
-// ======================================================================
-
-MGDataCheckMain::~MGDataCheckMain()
-{
-  //delete  fPicCdup, fPicList, fPicDetail; 
-    delete fLayTab;
-    delete fLayMenuBar;
-    delete fLayMenuItem;
-    delete fFileView;
-    delete fFileCont;
-    delete fCdup;
-    delete fListMode;
-    delete fDetail;
-    delete fDir ;
-    delete fTabF1b;
-    delete fTabF1a;
-    delete fTabF1;
-    delete fButPedADC;
-    delete fButCrADC;
-    delete fButPedTDC;
-    delete fButCrTDC;
-    delete fTop3;
-    delete fTop2;
-    delete fTop1;
-    delete fTab;
-    delete fFrameTop;
-    delete fFrameLow;
-    delete fFileMenu;
-    delete fMenuBar;
-
-} 
-
-
-// ======================================================================
-// ======================================================================
-
-void MGDataCheckMain::CloseWindow()
-{
-   // Got close message for this MainFrame. Calls parent CloseWindow()
-   // (which destroys the window) and terminate the application.
-   // The close message is generated by the window manager when its close
-   // window menu item is selected.
-
-  delete this ; 
-}
-
-
-// ======================================================================
-// ======================================================================
-
-Bool_t MGDataCheckMain::InputFileSelected() 
-{
-  //   Checks if there is a selected input root file
-  
-  if ( strcmp ( fInputFile, "\n") == 0 )
-    { 
-      return kFALSE ;
-    } 
-  
-  return kTRUE ;
-} 
-
-
-// ======================================================================
-// ======================================================================
-
-Bool_t MGDataCheckMain::ProcessMessage(Long_t msg, Long_t parm1, Long_t)
-{     
-  // Process events generated by the buttons in the frame.
-  
-  Int_t   buttons = 4, retval = 0 ; 
-  Char_t  wort[100] ;
-  Char_t  extens[5] ;
-  Char_t  command[110] ;
- 
-  TGFileItem *item ;     // to process items in the file view container
-  void *np = NULL ;      // null pointer
-
-  switch (GET_MSG(msg)) 
-    {
-    case kC_COMMAND:
-      switch (GET_SUBMSG(msg)) 
-	{
-	case kCM_BUTTON:
-	  
-	  switch (parm1)
-	    {  
-
-	    case M_BUTTON_PEDADC:
-	      	
-	      if ( InputFileSelected() == kFALSE ) {              // it is not selected
-		
-		new TGMsgBox(fClient->GetRoot(), this, "ERROR!", 
-			     "No Input (root) File selected!", kMBIconExclamation, buttons, &retval);
-		break ; 
-	      }      
-	      
-	      fViewAdc.AdcSpectra(fInputFile, "PedEvents" ) ; 
-
-	      break ; 
-		  
-
-	    case M_BUTTON_CRADC:
-	      
-	      if ( InputFileSelected() == kFALSE ) {              // it is not selected
-		
-		new TGMsgBox(fClient->GetRoot(), this, "ERROR!", 
-			     "No Input (root) File selected!", kMBIconExclamation, buttons, &retval);
-		break ; 
-	      }
-	      
-	      fViewAdc.AdcSpectra(fInputFile, "Events" ) ; 
-	      
-	      break ; 
-      
-	    case M_BUTTON_PEDTDC:
-	      
-	      if ( InputFileSelected() == kFALSE ) {              // it is not selected
-		
-		new TGMsgBox(fClient->GetRoot(), this, "ERROR!", 
-			     "No Input (root) File selected!", kMBIconExclamation, buttons, &retval);
-		break ; 
-	      }
-	      
-	      //	      fOctober.PedTdcSpectra(fInputFile) ; 
-
-	      break ; 
-      
-	    case M_BUTTON_CRTDC:
-	      
-	      if ( InputFileSelected() == kFALSE ) {              // it is not selected
-		
-		new TGMsgBox(fClient->GetRoot(), this, "ERROR!", 
-			     "No Input (root) File selected!", kMBIconExclamation, buttons, &retval);
-		break ; 
-	      }
-	      
-	      
-
-	      break ; 
-      
-	    case M_PBUTTON_CDIR_UP :
-
-	      //  goto the parent directory
-	      
-	      gSystem->ChangeDirectory("..") ; 
-	      fDir->RemoveEntry(1) ; 
-	      sprintf (wort, "%s", gSystem->WorkingDirectory() ) ; 
-	      fDir->AddEntry(wort,1) ; 
-	      fDir->MapSubwindows() ; 
-	      fDir->Layout() ; 
-	      fFileCont->ChangeDirectory( wort ) ; 
-	      fFileCont->DisplayDirectory() ; 
-	      
-	      break ; 
-	    
-	    case M_PBUTTON_LIST_MODE:
-	      fFileView->SetViewMode(kLVList) ; 
-	      fDetail->SetState(kButtonUp) ; 
-	      
-	      break ; 
-	      
-	    case M_PBUTTON_DETAIL_MODE:
-	      fFileView->SetViewMode(kLVDetails) ; 
-	      fListMode->SetState(kButtonUp) ; 
-	      
-	      break ;
-	      
-	    default:
-	      break ;
-	    } 
-
-	case kCM_MENU:
-
-	  switch (parm1) {
-	  case M_FILE_CLOSE:
-	    CloseWindow() ; 
-
-	    break; 
-	  }
-	  break ;
-	  
-	default:
-	  break ;
-	  
-	}
-      
-    case kC_CONTAINER: 
-      switch (GET_SUBMSG(msg)) {
-	
-	//      case kCT_ITEMCLICK:
-	// 	printf ("itemclick\n"); 
-	//      break; 
-	
-      
-      case kCT_ITEMDBLCLICK: 
-	//
-	//  process the double click in the file view container
-	//
-	
-	if ( parm1 == kButton1) {
-	  if ( fFileCont->NumSelected() == 1 ) {   
-	    //
-	    //  one file selected
-	    //	  
-	    item = (TGFileItem *) fFileCont->GetNextSelected(&np) ; 
-	    
-	    if ( S_ISDIR(item->GetType()) )   // file is directory
-	      {  
-		//  goto directory 
-		
-		sprintf (wort, "%s", item->GetItemName()->GetString()) ;
-		fFileCont->ChangeDirectory ( wort ) ; 
-		gSystem->ChangeDirectory( wort ) ; 
-		
-		sprintf (wort, "%s", gSystem->WorkingDirectory() ) ; 
-		fDir->RemoveEntry(1) ; 
-		fDir->AddEntry( wort, 1 ) ; 
-		fDir->MapSubwindows() ; 
-		fDir->Layout() ; 
-	      }
-	    else                              // file is no directory, is a file 
-	      { 
-		sprintf (wort, "%s", item->GetItemName()->GetString() ) ; 
-	    
-		//    determine the file type by extensions
-		
-		for (Int_t i = 0 ; i<5; i++) 
-		  extens[i] = '\0' ; 
-		
-		for ( Int_t i=0; wort[i] != '\0'; i++) {
-		  if ( wort[i] == '.') {
-		    strncpy (extens, &wort[i+1], 4 ) ; 
-		    break ; 
-		  }
-		}
-		
-		if ( ! strcmp(extens, "ps") ) {              //     postscript file
-		  sprintf ( command, "gv %s/%s &", 
-			    gSystem->WorkingDirectory(), 
-			    wort ) ; 
-		  gSystem->Exec(command) ; 
-		  break ; 
-		}
-		else if  ( ! strcmp(extens, "root") ) {      //     root file
-		  sprintf ( fInputFile, "%s/%s" , gSystem->WorkingDirectory(), wort ) ;  
-
-		  printf (" %s \n", fInputFile ) ; 
-		  break ; 
-		}
-		
-	      } 
-	  }
-	}
-	break; 
-	
-      default:
-	break ;
-      }
-      
-      
-      
-    default:
-      break;
-    }
-  return kTRUE;
-} 
Index: trunk/MagicSoft/Mars/mgui/MGDataCheckMain.h
===================================================================
--- trunk/MagicSoft/Mars/mgui/MGDataCheckMain.h	(revision 713)
+++ 	(revision )
@@ -1,94 +1,0 @@
-#ifndef MGDATACHECKMAIN_H
-#define MGDATACHECKMAIN_H
-
-#ifndef MAGIC_H
-#include "MAGIC.h"
-#endif
-
-#ifndef ROOT_TGFrame
-#include <TGFrame.h>
-#endif
-
-#ifndef MVIEWADCSPECTRA_H
-#include "MViewAdcSpectra.h"
-#endif
-
-class TGMenuBar;
-class TGPopupMenu;
-class TGTab;
-class TGTextButton;
-class TGListBox;
-class TGPictureButton;
-class TGFileContainer;
-class TGListView;
-
-class MGDataCheckMain : public TGTransientFrame {
- private:
-  
-  //
-  // Create a main frame with a number of different buttons.
-  //
-
-  //   some member not connected with Gui 
-  
-  Char_t            fInputFile[256] ; 
-  MViewAdcSpectra   fViewAdc ; //!
-
-  //  the things for the menu bar 
-    
-  TGMenuBar         *fMenuBar ; 
-  TGPopupMenu       *fFileMenu ;
-
-  //   divide the Window in two different parts
-  
-  TGCompositeFrame  *fFrameTop ;   // top part of the main window
-  TGCompositeFrame  *fFrameLow ;   // low part of the main window
-  TGTab             *fTab      ;   // different tabs in the low window
-  
-  //     the horizontal frame in the top part
-
-  TGHorizontalFrame *fTop1, *fTop2, *fTop3 ; 
-  
-  //   the buttons in the Top Part
-  
-  TGTextButton      *fButPedADC, *fButCrADC  ; 
-  TGTextButton      *fButPedTDC, *fButCrTDC  ; 
-  
-  //   the things in the file selector
-
-  TGCompositeFrame  *fTabF1 ;                       // first tab of low part 
-  TGCompositeFrame  *fTabF1a, *fTabF1b ;            // subpart of the file selector in low window
-  TGListBox         *fDir ; 
-  TGPictureButton   *fCdup, *fListMode, *fDetail ; 
-  TGFileContainer   *fFileCont ; 
-  TGListView        *fFileView ;
-
-  //     Layout hints for different uses 
-  
-  TGLayoutHints     *fLayMenuBar, *fLayMenuItem ; 
-  TGLayoutHints     *fLayTab ; 
-  
-  //     some icons and pictures often used
-  
-  const TGPicture   *fPicCdup;   //!
-  const TGPicture   *fPicList;   //!
-  const TGPicture   *fPicDetail; //!
-  
- public: 
-  MGDataCheckMain(const TGWindow *p, const TGWindow *main, UInt_t w, UInt_t h) ;
-  
-  ~MGDataCheckMain(); 
-  
-  void   CloseWindow()  ; 
-
-  Bool_t InputFileSelected() ; 
-  
-  Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
-
-  ClassDef(MGDataCheckMain, 0)
-
-} ; 
-
-#endif
-
-
Index: trunk/MagicSoft/Mars/mgui/MGEventDispMain.cc
===================================================================
--- trunk/MagicSoft/Mars/mgui/MGEventDispMain.cc	(revision 713)
+++ 	(revision )
@@ -1,492 +1,0 @@
-#include "MGEventDispMain.h"
-
-#include <TSystem.h>        // gSystem
-
-#include <TGTab.h>          // TGTab
-#include <TGMenu.h>         // TGPopupMenu
-#include <TGButton.h>       // TGTextButton
-#include <TGMsgBox.h>       // TGMsgBox
-#include <TGListBox.h>      // TGListBox
-#include <TGFSContainer.h>  // TGFileContainer
-#include <TGSplitter.h>    // TGHorizontal3DLine
-#include <TGTextEntry.h> 
-#include <TGLabel.h>       // TGLabel
-
-#include "MGFadcDisp.h"
-
-// FIXME: Move to MAGIC.h
-#define S_ISDIR(m) (((m)&(0170000)) == (0040000))  
-
-ClassImp(MGEventDispMain)
-
-enum CommandEventDispMain {
-  M_FILE_CLOSE , 
-  M_BUT_DISP1_EVT, 
-  M_BUT_DISP1_PED, 
-  M_BUT_DISP1_CAL, 
-
-  M_FILERESET, 
-  M_PBUTTON_CDIR_UP, 
-  M_PBUTTON_LIST_MODE, 
-  M_PBUTTON_DETAIL_MODE 
-} ; 
-
-
-MGEventDispMain::MGEventDispMain(const TGWindow *p, const TGWindow *main, 
-                            UInt_t w, UInt_t h ) 
-        : TGTransientFrame(p, main, w, h ) 
-{
-  //
-  //    Main window to controll the october test
-  //
-
-  //    set non-gui members to starting values 
-
-  sprintf ( fInputFile, "\n" ) ; 
-
-  //
-  //    First create the MenuBar.   
-  //
-
-  //     Layout objects for menue. 
-
-  fLayMenuBar = new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX, 2, 2, 2, 2 ) ; 
-  fLayMenuItem = new TGLayoutHints ( kLHintsTop | kLHintsLeft , 0, 4, 0, 0 ) ; 
-  
-  //  crate the menu bar
-
-  fFileMenu = new TGPopupMenu ( fClient->GetRoot() ) ; 
-  fFileMenu->AddEntry ("Close", M_FILE_CLOSE ) ; 
-  fFileMenu->Associate(this) ; 
-  
-  //  the button messages are handled by main frame (this) 
-
-  fMenuBar = new TGMenuBar ( this, 1, 1, kHorizontalFrame ) ; 
-  fMenuBar->AddPopup("File", fFileMenu, fLayMenuItem ) ;   
-  AddFrame(fMenuBar, fLayMenuBar ) ; 
-  
-  fLineSep1 = new TGHorizontal3DLine(this) ; 
-  AddFrame(fLineSep1, new TGLayoutHints(kLHintsTop | kLHintsExpandX) );
-
-  
-  //
-  //    Create the top window with a lot of buttons 
-  //
-
-  fFrameTop = new TGCompositeFrame (this, 300,100, kVerticalFrame ) ; 
-  
-  fTop1 = new TGHorizontalFrame (fFrameTop, 300, 100 ) ; 
-
-  fButFadcDispEvts = new TGTextButton(fTop1, "FADC Disp for Events", M_BUT_DISP1_EVT );
-  fButFadcDispEvts->Associate(this) ;   
-  fTop1->AddFrame (fButFadcDispEvts, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
-  
-  fButFadcDispPed  = new TGTextButton(fTop1, "FADC Disp for PedEvts", M_BUT_DISP1_PED );
-  fButFadcDispPed->Associate(this) ;   
-  fTop1->AddFrame (fButFadcDispPed, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
-  
-  fButFadcDispCal  = new TGTextButton(fTop1, "FADC Disp for CalEvts", M_BUT_DISP1_CAL );
-  fButFadcDispCal->Associate(this) ;   
-  fTop1->AddFrame (fButFadcDispCal, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
-  
-  
-
-  fFrameTop->AddFrame (fTop1, new TGLayoutHints(kLHintsCenterX, 10, 10, 5, 5) );
-
-  AddFrame(fFrameTop, new TGLayoutHints (kLHintsTop ) ) ;   
-
-  //   a line between top and low frame
-  
-  fLineSep2 = new TGHorizontal3DLine(this) ; 
-  AddFrame(fLineSep2, new TGLayoutHints(kLHintsTop | kLHintsExpandX) );
-
-  //
-  //    Create the low window with a tabs in it
-  //
-
-  fFrameLow = new TGCompositeFrame (this, 300,100, kHorizontalFrame ) ; 
-  
-  fLayTab = new TGLayoutHints ( kLHintsExpandX   , 5, 5, 5, 5 ) ;
-
-  //    create the first tab
-
-  fTab = new TGTab ( fFrameLow, 400, 400 ) ;   
-
-  TGCompositeFrame *tf = fTab->AddTab("Input File") ; 
-  
-  fTabF1 = new TGCompositeFrame (tf, 100, 100, kHorizontalFrame) ; 
-  //  tf->AddFrame(fTabF1, fLayTab ) ; 
-
-  fTabF1a = new TGCompositeFrame (tf, 100, 100, kHorizontalFrame) ; 
-  tf->AddFrame(fTabF1a,  new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX, 5, 5, 5, 5 ) ) ; 
-
-  fTabF1b = new TGCompositeFrame (tf, 100, 100, kHorizontalFrame) ; 
-  tf->AddFrame(fTabF1b,  new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX, 5, 5, 5, 5 ) ) ; 
-
-  fTabF1c = new TGCompositeFrame (tf, 100, 100, kVerticalFrame) ; 
-  //  tf->AddFrame(fTabF1c,  new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX | kLHintsExpandY  , 5, 5, 5, 5 ) ) ; 
-  tf->AddFrame(fTabF1c,  new TGLayoutHints ( kLHintsExpandX | kLHintsExpandY  , 5, 5, 5, 5 ) ) ; 
-  
-  //   the items in the first subframe
-
-  fLabFileName = new TGLabel(fTabF1a, new TGString("selected File:") );
-  fTabF1a->AddFrame( fLabFileName, new TGLayoutHints (kLHintsLeft, 10, 10, 10, 10)) ; 
-
-  fTxtFileName = new TGTextEntry(fTabF1a, fTxtBufFileName = new TGTextBuffer(100) );
-  fTxtFileName->Resize(60, fTxtFileName->GetDefaultHeight());
-  fTabF1a->AddFrame(fTxtFileName, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 5, 5, 5, 5)); 
-
-  fButFileReset = new TGTextButton (fTabF1a, "Reset", M_FILERESET ) ;
-  fButFileReset->Associate(this) ; 
-  fTabF1a->AddFrame (fButFileReset, new TGLayoutHints (kLHintsRight, 10, 10, 10, 10  ) ) ; 
-  
-  
-  
-  //   the items in the second subfraem
-
-  fLabDir = new TGLabel(fTabF1b, new TGString("Directory:") );
-  fTabF1b->AddFrame( fLabDir, new TGLayoutHints (kLHintsLeft, 10, 10, 10, 10)) ; 
-
-  fDir = new TGListBox(fTabF1b, -1) ; 
-  fDir->Resize(350,20) ;
-  char temp[100] ; 
-  //  sprintf ( temp, "%s", START_DIRECTORY ) ; 
-  sprintf ( temp, "%s", gSystem->WorkingDirectory()  ) ; 
-  fDir->AddEntry(temp, 1) ; 
-  fTabF1b->AddFrame( fDir, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX, 5, 5, 5, 5 ) ) ; 
-
-
-  fPicCdup = fClient->GetPicture("tb_uplevel.xpm") ; 
-  fCdup = new TGPictureButton(fTabF1b, fPicCdup, M_PBUTTON_CDIR_UP ) ; 
-  fCdup->SetToolTipText("One Level up!") ; 
-  fCdup->Associate(this) ; 
-  fTabF1b->AddFrame (fCdup, new TGLayoutHints(kLHintsLeft | kLHintsTop, 5, 5, 5, 5) ) ; 
-
-  fPicList = fClient->GetPicture("tb_list.xpm") ; 
-  fListMode = new TGPictureButton(fTabF1b, fPicList, M_PBUTTON_LIST_MODE ) ; 
-  fListMode->SetToolTipText("List Mode") ; 
-  fListMode->Associate(this) ; 
-  fListMode->SetState(kButtonUp) ; 
-  fListMode->AllowStayDown(kTRUE) ; 
-  fListMode->AllowStayDown(kTRUE) ;  fTabF1b->AddFrame (fListMode, new TGLayoutHints(kLHintsLeft | kLHintsTop, 5, 5, 5, 5) ) ;
-
-  fPicDetail = fClient->GetPicture("tb_details.xpm") ; 
-  fDetail = new TGPictureButton(fTabF1b, fPicDetail, M_PBUTTON_DETAIL_MODE ) ; 
-  fDetail->SetToolTipText("Details Mode") ; 
-  fDetail->Associate(this) ; 
-  fDetail->SetState(kButtonEngaged) ; 
-  fDetail->AllowStayDown(kTRUE) ; 
-  fTabF1b->AddFrame (fDetail, new TGLayoutHints(kLHintsLeft | kLHintsTop, 5, 5, 5, 5) ) ; 
-
-  // the items in the third subframe
-
-  fFileView = new TGListView(fTabF1c, 540, 380 ) ; 
-  fFileCont = new TGFileContainer(fFileView->GetViewPort(), 100, 100,
-				  kVerticalFrame, fgWhitePixel) ; 
-
-  fFileCont->Associate(this) ; 
-  fFileView->GetViewPort()->SetBackgroundColor(fgWhitePixel) ; 
-  fFileView->SetContainer(fFileCont) ; 
-  fFileCont->SetFilter("*") ; 
-  //  fFileCont->ChangeDirectory(START_DIRECTORY) ; 
-  fFileCont->ChangeDirectory(gSystem->WorkingDirectory()) ; 
-  fFileView->SetViewMode(kLVDetails); 
-  fFileCont->Sort(kSortByName) ; 
-  
-  fTabF1c->AddFrame(fFileView, new TGLayoutHints(kLHintsTop | kLHintsExpandX | kLHintsExpandY, 5, 5, 5, 5) ) ; 
-
-  tf->AddFrame(fTabF1, fLayTab) ;
- 
-  fFrameLow->AddFrame ( fTab, new TGLayoutHints(kLHintsBottom | kLHintsExpandX | kLHintsExpandY, 5, 5, 5, 5) ); 
-
-  AddFrame(fFrameLow, new TGLayoutHints (kLHintsExpandX|kLHintsExpandY) ) ; 
-
-  //
-  //   Map the window, set up the layout, etc. 
-  //
-
-  SetWMSizeHints(200, 250, 1000, 1000, 10, 10 ) ;      // set the smallest and biggest size of the Main frame
-
-  MapSubwindows();
-  
-  Layout();
-  
-  SetWindowName("EventDispMain");
-  SetIconName("EventDispMain");
-  
-  MapWindow();
-
-} 
-
-
-// ======================================================================
-// ======================================================================
-
-MGEventDispMain::~MGEventDispMain()
-{
-  //delete  fPicCdup, fPicList, fPicDetail; 
-  
-    delete fLayTab;
-    delete fLayMenuBar;
-    delete fLayMenuItem;
-
-    delete fFileView;
-    delete fFileCont;
-
-    delete fCdup;
-    delete fListMode;
-    delete fDetail;
-    delete fDir ;
-    delete fLabDir ; 
-
-    delete fButFileReset ; 
-    delete fTxtFileName  ; 
-    delete fLabFileName  ; 
-    
-    delete fTabF1c;
-    delete fTabF1b;
-    delete fTabF1a;
-    delete fTabF1;
-
-    delete fButFadcDispCal; 
-    delete fButFadcDispPed; 
-    delete fButFadcDispEvts; 
-    delete fTop1;
-    delete fTab;
-
-    delete fLineSep2 ; 
-    delete fLineSep1 ; 
-
-    delete fFrameTop;
-    delete fFrameLow;
-
-    delete fFileMenu;
-    delete fMenuBar;
-} 
-
-
-// ======================================================================
-// ======================================================================
-
-void MGEventDispMain::CloseWindow()
-{
-   // Got close message for this MainFrame. Calls parent CloseWindow()
-   // (which destroys the window) and terminate the application.
-   // The close message is generated by the window manager when its close
-   // window menu item is selected.
-
-  delete this ; 
-}
-
-
-// ======================================================================
-// ======================================================================
-
-Bool_t MGEventDispMain::InputFileSelected() 
-{
-  //   Checks if there is a selected input root file
-   
-  if ( strcmp ( fInputFile, "\n") == 0 )
-    { 
-      return ( kFALSE ) ; 
-    } 
-  
-  return (kTRUE) ; 
-} 
-
-
-// ======================================================================
-// ======================================================================
-
-Bool_t MGEventDispMain::ProcessMessage(Long_t msg, Long_t parm1, Long_t)
-{     
-  // Process events generated by the buttons in the frame.
-  
-  Int_t   buttons = 4, retval = 0 ; 
-  Char_t  wort[100] ;
-  Char_t  extens[5] ;
-  Char_t  command[110] ;
- 
-  TGFileItem *item ;     // to process items in the file view container
-  void *np = NULL ;      // null pointer
-
-  switch (GET_MSG(msg)) 
-    {
-    case kC_COMMAND:
-      switch (GET_SUBMSG(msg)) 
-	{
-	case kCM_BUTTON:
-	  
-	  switch (parm1)
-	    {  
-
-	    case M_BUT_DISP1_EVT:
-	      	
-	      if ( InputFileSelected() == kFALSE ) {              // it is not selected
-		
-		new TGMsgBox(fClient->GetRoot(), this, "ERROR!", 
-			     "No Input (root) File selected!", kMBIconExclamation, buttons, &retval);
-		break ; 
-	      }      
-	      
-	      new MGFadcDisp( fInputFile , "Events", 
-			      fClient->GetRoot(), this, 600, 500 ) ; 
-	      break ; 
-		
-	    case M_BUT_DISP1_PED:
-	      	
-	      if ( InputFileSelected() == kFALSE ) {              // it is not selected
-		
-		new TGMsgBox(fClient->GetRoot(), this, "ERROR!", 
-			     "No Input (root) File selected!", kMBIconExclamation, buttons, &retval);
-		break ; 
-	      }      
-	      new MGFadcDisp( fInputFile , "PedEvts", 
-			      fClient->GetRoot(), this, 600, 500 ) ; 
-	      break ; 
-
-	    case M_BUT_DISP1_CAL:
-	      
-	      if ( InputFileSelected() == kFALSE ) {              // it is not selected
-		new TGMsgBox(fClient->GetRoot(), this, "ERROR!", 
-			     "No Input (root) File selected!", kMBIconExclamation, buttons, &retval);
-		break ; 
-	      }      
-	      
-	      new MGFadcDisp( fInputFile , "CalEvts", 
-			      fClient->GetRoot(), this, 600, 500 ) ; 
-	      break ; 
-		
-	    case M_FILERESET:
-	      
-	      sprintf ( fInputFile, "\n" ) ; 
-	      fTxtFileName->SetText( fInputFile ) ; 
-	      
-	      break; 
-
-	    case M_PBUTTON_CDIR_UP :
-
-	      //  goto the parent directory
-	      
-	      gSystem->ChangeDirectory("..") ; 
-	      fDir->RemoveEntry(1) ; 
-	      sprintf (wort, "%s", gSystem->WorkingDirectory() ) ; 
-	      fDir->AddEntry(wort,1) ; 
-	      fDir->MapSubwindows() ; 
-	      fDir->Layout() ; 
-	      fFileCont->ChangeDirectory( wort ) ; 
-	      fFileCont->DisplayDirectory() ; 
-	      
-	      break ; 
-	    
-	    case M_PBUTTON_LIST_MODE:
-	      fFileView->SetViewMode(kLVList) ; 
-	      fDetail->SetState(kButtonUp) ; 
-	      
-	      break ; 
-	      
-	    case M_PBUTTON_DETAIL_MODE:
-	      fFileView->SetViewMode(kLVDetails) ; 
-	      fListMode->SetState(kButtonUp) ; 
-	      
-	      break ;
-	      
-	    default:
-	      break ;
-	    } 
-
-	case kCM_MENU:
-
-	  switch (parm1) {
-	  case M_FILE_CLOSE:
-	    CloseWindow() ; 
-
-	    break; 
-	  }
-	  break ;
-	  
-	default:
-	  break ;
-	  
-	}
-      
-    case kC_CONTAINER: 
-      switch (GET_SUBMSG(msg)) {
-	
-	//      case kCT_ITEMCLICK:
-	// 	printf ("itemclick\n"); 
-	//      break; 
-	
-      
-      case kCT_ITEMDBLCLICK: 
-	//
-	//  process the double click in the file view container
-	//
-	
-	if ( parm1 == kButton1) {
-	  if ( fFileCont->NumSelected() == 1 ) {   
-	    //
-	    //  one file selected
-	    //	  
-	    item = (TGFileItem *) fFileCont->GetNextSelected(&np) ; 
-	    
-	    if ( S_ISDIR(item->GetType()) )   // file is directory
-	      {  
-		//  goto directory 
-		
-		sprintf (wort, "%s", item->GetItemName()->GetString()) ;
-		fFileCont->ChangeDirectory ( wort ) ; 
-		gSystem->ChangeDirectory( wort ) ; 
-		
-		sprintf (wort, "%s", gSystem->WorkingDirectory() ) ; 
-		fDir->RemoveEntry(1) ; 
-		fDir->AddEntry( wort, 1 ) ; 
-		fDir->MapSubwindows() ; 
-		fDir->Layout() ; 
-	      }
-	    else                              // file is no directory, is a file 
-	      { 
-		sprintf (wort, "%s", item->GetItemName()->GetString() ) ; 
-	    
-		//    determine the file type by extensions
-		
-		for (Int_t i = 0 ; i<5; i++) 
-		  extens[i] = '\0' ; 
-		
-		for ( Int_t i=0; wort[i] != '\0'; i++) {
-		  if ( wort[i] == '.') {
-		    strncpy (extens, &wort[i+1], 4 ) ; 
-		    break ; 
-		  }
-		}
-		
-		if ( ! strcmp(extens, "ps") ) {              //     postscript file
-		  sprintf ( command, "gv %s/%s &", 
-			    gSystem->WorkingDirectory(), 
-			    wort ) ; 
-		  gSystem->Exec(command) ; 
-		  break ; 
-		}
-		else if  ( ! strcmp(extens, "root") ) {      //     root file
-		  sprintf ( fInputFile, "%s/%s" , gSystem->WorkingDirectory(), wort ) ;  
-		  fTxtFileName->SetText( fInputFile ) ;
-
-		  break ; 
-		}
-		
-	      } 
-	  }
-	}
-	break; 
-	
-      default:
-	break ;
-      }
-      
-      
-      
-    default:
-      break;
-    }
-  return kTRUE;
-} 
Index: trunk/MagicSoft/Mars/mgui/MGEventDispMain.h
===================================================================
--- trunk/MagicSoft/Mars/mgui/MGEventDispMain.h	(revision 713)
+++ 	(revision )
@@ -1,105 +1,0 @@
-#ifndef MGEVENTDISPMAIN_H
-#define MGEVENTDISPMAIN_H
-
-#ifndef MAGIC_H
-#include "MAGIC.h"
-#endif
-
-#ifndef ROOT_TGFrame
-#include <TGFrame.h>
-#endif
-
-
-class TGMenuBar;
-class TGPopupMenu;
-class TGTab;
-class TGTextButton;
-class TGListBox;
-class TGPictureButton;
-class TGFileContainer;
-class TGListView;
-class TGHorizontal3DLine;
-class TGLabel ; 
-class TGTextEntry ; 
-class TGTextBuffer; 
-
-class MGEventDispMain : public TGTransientFrame {
- private:
-  
-  //
-  // Create a main frame with a number of different buttons.
-  //
-
-  //   some member not connected with Gui 
-  
-  Char_t            fInputFile[256] ; 
-
-  //  the things for the menu bar 
-    
-  TGMenuBar         *fMenuBar ; 
-  TGPopupMenu       *fFileMenu ;
-  TGHorizontal3DLine *fLineSep1, *fLineSep2 ; 
-
-
-  //   divide the Window in two different parts
-  
-  TGCompositeFrame  *fFrameTop ;   // top part of the main window
-  TGCompositeFrame  *fFrameLow ;   // low part of the main window
-  TGTab             *fTab      ;   // different tabs in the low window
-  
-  //     the horizontal frame in the top part
-
-  TGHorizontalFrame *fTop1 ; 
-  
-  //   the buttons in the Top Part
-  
-  TGTextButton      *fButFadcDispEvts ; 
-  TGTextButton      *fButFadcDispPed  ; 
-  TGTextButton      *fButFadcDispCal  ; 
-  
-  //   the things in the file selector
-
-  TGCompositeFrame  *fTabF1 ;                       // first tab of low part 
-  TGCompositeFrame  *fTabF1a, *fTabF1b, *fTabF1c ;  // subpart of the file selector in low window
-
-  TGLabel           *fLabFileName ; 
-  TGTextEntry       *fTxtFileName ; 
-  TGTextBuffer      *fTxtBufFileName ; //!
-  TGTextButton      *fButFileReset ; 
- 
-  TGLabel           *fLabDir ; 
-  TGListBox         *fDir ; 
-  TGPictureButton   *fCdup, *fListMode, *fDetail ; 
- 
-  TGFileContainer   *fFileCont ; 
-  TGListView        *fFileView ;
-
-  //     Layout hints for different uses 
-   
-  TGLayoutHints     *fLayMenuBar, *fLayMenuItem ; 
-  TGLayoutHints     *fLayTab ; 
-  
-  //     some icons and pictures often used
-  
-  const TGPicture   *fPicCdup;   //!
-  const TGPicture   *fPicList;   //!
-  const TGPicture   *fPicDetail; //!
-  
- public: 
-  MGEventDispMain(const TGWindow *p, const TGWindow *main, UInt_t w, UInt_t h) ;
-  
-  ~MGEventDispMain(); 
-  
-  void   CloseWindow()  ; 
-
-  Bool_t InputFileSelected() ; 
-  
-  Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
-
-  ClassDef(MGEventDispMain, 0)
-
-} ; 
-
-#endif
-
-
Index: trunk/MagicSoft/Mars/mgui/MGMarsMain.cc
===================================================================
--- trunk/MagicSoft/Mars/mgui/MGMarsMain.cc	(revision 713)
+++ 	(revision )
@@ -1,257 +1,0 @@
-#include "MGMarsMain.h"
-
-#include <TApplication.h>  // gROOT->GetApplication()->...
-
-#include <TGTab.h>         // TGTab
-#include <TGMenu.h>        // TGPopupMenu
-#include <TGMsgBox.h>      // TGMsgBox
-#include <TGButton.h>      // TGPictureButton
-#include <TGSplitter.h>    // TGHorizontal3DLine
-
-#include "MGEventDispMain.h"
-#include "MGDataCheckMain.h"
-#include "MGMonteCarloMain.h"
-
-#include "MGPrototyp.h"
-
-ClassImp(MGMarsMain)
-
-enum CommandIdentifiers {
-  M_FILE_EXIT  ,
-  M_FILE_ABOUT  ,
-
-  M_PICTURE_MAGIC , 
-  M_PICTURE_MARS ,
-
-  M_BUTTON_EVTDISP ,
-  M_BUTTON_DATACHECK ,
-  M_BUTTON_ANALYSE ,
-  M_BUTTON_MONTECARLO 
-} ; 
-
-
-MGMarsMain::MGMarsMain(/*const TGWindow *p,*/ UInt_t w, UInt_t h)
-  : TGMainFrame(gClient->GetRoot(), w, h)
-{ 
-  //    First create the MenuBar.   
-  
-  //     Layout objects for menue. 
-
-  fLayMenuBar = new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX, 2, 2, 2, 2 ) ; 
-  fLayMenuItem = new TGLayoutHints ( kLHintsTop | kLHintsLeft , 0, 4, 0, 0 ) ; 
-  
-  //  crate the menu bar
-  
-  fFileMenu = new TGPopupMenu ( fClient->GetRoot() ) ; 
-  fFileMenu->AddEntry ("Exit", M_FILE_EXIT ) ; 
-  fFileMenu->Associate(this) ; 
-  
-  //  the button messages are handled by main frame (this) 
-  
-  fMenuBar = new TGMenuBar ( this, 1, 1, kHorizontalFrame ) ; 
-  fMenuBar->AddPopup("File", fFileMenu, fLayMenuItem ) ;   
-  AddFrame(fMenuBar, fLayMenuBar ) ; 
-
-  fLineSep = new TGHorizontal3DLine(this) ; 
-  AddFrame(fLineSep, new TGLayoutHints(kLHintsTop | kLHintsExpandX) );
-  
-  //   set up the top part of the main window with the logos
-
-  fTop = new TGHorizontalFrame (this, 300, 100 ) ;
-
-  fPicMagic = new TGPictureButton(fTop, 
-                                  gClient->GetPicture("magiclogo.xpm"), M_PICTURE_MAGIC );
-  fPicMagic->Associate(this) ; 
-  fTop->AddFrame ( fPicMagic, new TGLayoutHints(kLHintsLeft, 10., 10., 20., 10.) ) ; 
-
-  fPicMars = new TGPictureButton(fTop, 
-				 gClient->GetPicture("marslogo.xpm"), M_PICTURE_MARS );
-  fPicMars->Associate(this) ;
-  fTop->AddFrame ( fPicMars, new TGLayoutHints(kLHintsLeft, 10., 10., 10., 10.) ) ; 
-
-  AddFrame(fTop, new TGLayoutHints(kLHintsTop | kLHintsExpandX ) );  
-  
-  //  a seperator 
-
-  fLineSep2 = new TGHorizontal3DLine(this) ; 
-  AddFrame(fLineSep2, new TGLayoutHints(kLHintsTop | kLHintsExpandX) );
-
-  //   the low part of the frame 
-
-  fLow = new TGHorizontalFrame (this, 300, 100 ) ;
-
-  //    create the first tab
-
-  fTab = new TGTab ( fLow, 400, 400 ) ;   
-
-  TGCompositeFrame *tf = fTab->AddTab("Control") ; 
- 
-  fTabF1 = new TGVerticalFrame (tf, 300, 100) ; 
-
-  tf->AddFrame(fTabF1, new TGLayoutHints(kLHintsTop | kLHintsExpandX) ) ; 
-
-  //     the buttons to go in the new window
-
-  fTabF2 = new TGVerticalFrame (tf, 300, 100) ; 
-  
-  fButLayout  = new TGLayoutHints(kLHintsTop | kLHintsCenterX , 10, 10, 10, 10) ; 
-
-  fButEvtDisp = new TGTextButton(fTabF2, "EventDisplay", M_BUTTON_EVTDISP  );
-  fButEvtDisp->Associate(this) ;  
-  fTabF2->AddFrame(fButEvtDisp, fButLayout ) ; 
- 
-  fButDataCheck = new TGTextButton(fTabF2, "Data Check", M_BUTTON_DATACHECK  );
-  fButDataCheck->Associate(this) ;
-  fTabF2->AddFrame(fButDataCheck, fButLayout ) ; 
-
-  fButAnalys = new TGTextButton(fTabF2, "Analysis", M_BUTTON_ANALYSE  );
-  fButAnalys->Associate(this) ;
-  fTabF2->AddFrame(fButAnalys, fButLayout ) ; 
-
-  fButMonteCarlo = new TGTextButton(fTabF2, "MonteCarlo", M_BUTTON_MONTECARLO  );
-  fButMonteCarlo->Associate(this) ;
-  fTabF2->AddFrame(fButMonteCarlo, fButLayout ) ; 
-
-
-   
-
-  tf->AddFrame(fTabF2, new TGLayoutHints(kLHintsTop | kLHintsExpandX) ) ; 
-  
-  
-
-  fLow->AddFrame ( fTab, new TGLayoutHints(kLHintsBottom | kLHintsExpandX | kLHintsExpandY, 5, 5, 5, 5) );   
-  AddFrame(fLow, new TGLayoutHints(kLHintsTop | kLHintsExpandX ) );
-  
-  //   Map the window, set up the layout, etc. 
-  
-  SetWMSizeHints(400, 650, 1000, 1000, 10, 10 ) ;  // set the smallest and biggest size of the Main frame
-  
-  MapSubwindows();
-  
-  Layout();
-  
-  SetWindowName("MARS Main Window");
-  SetIconName("MARS");
-  
-  MapWindow();
-
-} 
-
-// ======================================================================
-
-MGMarsMain::~MGMarsMain()
-{
-  
-    delete fButLayout;
-    delete fLayMenuBar;
-    delete fLayMenuItem;
-    delete fButEvtDisp;
-    delete fButDataCheck;
-    delete fButAnalys;
-    delete fButMonteCarlo;
-    delete fPicMagic;
-    delete fPicMars;
-    delete fTabF1;
-    delete fTabF2;
-    delete fTab;
-    delete fLow;
-    delete fTop;
-    delete fLineSep2;
-    delete fLineSep;
-    delete fFileMenu;
-    delete fMenuBar;
-}  
-// ======================================================================
-
-void MGMarsMain::CloseWindow()
-{
-   // Got close message for this MainFrame. Calls parent CloseWindow()
-   // (which destroys the window) and terminate the application.
-   // The close message is generated by the window manager when its close
-   // window menu item is selected.
-
-   TGMainFrame::CloseWindow();
-   gROOT->GetApplication()->Terminate(0)  ; 
-}
-
-Bool_t MGMarsMain::ProcessMessage(Long_t msg, Long_t parm1, Long_t)
-{     
-  // Process events generated by the buttons in the frame.
-  //  printf (" process Message \n" ) ; 
-
-  Int_t   buttons = 4, retval = 0 ; 
-
-  
-  switch (GET_MSG(msg)) 
-    {
-    case kC_COMMAND:
-      switch (GET_SUBMSG(msg)) 
-	{
-	case kCM_BUTTON:
-	  
-	  switch (parm1)
-	    {  
-
-	    case M_BUTTON_EVTDISP:
-	      
-	      new MGEventDispMain (fClient->GetRoot(), this, 400, 650 ) ; 
-	      break ;
-	      
-	    case M_BUTTON_DATACHECK:
-	      new MGDataCheckMain(fClient->GetRoot(), this, 400, 650 ) ; 
-	      break ;
-
-	    case M_BUTTON_ANALYSE:
-	      //new MGPrototyp(fClient->GetRoot(), this, 400, 650 ) ;
-
-	       new TGMsgBox(fClient->GetRoot(), this,
-			   "WARNING!", 
-			   "Analysis not yet implemented!", 
-			   kMBIconExclamation, buttons, &retval);
-	      break ;
-
-	    case M_BUTTON_MONTECARLO:
-	      new MGMonteCarloMain(fClient->GetRoot(), this, 400, 650 ) ; 
-
-	      break ;
-
-	    case M_PICTURE_MAGIC:
-	      new TGMsgBox(fClient->GetRoot(), this,
-			   "WARNING!", 
-			   "Please open a Netscape to the MAGIC homepage", 
-			   kMBIconExclamation, buttons, &retval);
-	      break ;
-
-	    case M_PICTURE_MARS:
-	      new TGMsgBox(fClient->GetRoot(), this,
-			   "WARNING!", 
-			   "Please open a Netscape to the MARS homepage", 
-			   kMBIconExclamation, buttons, &retval);
-	      break ;
-
-	      
-	    default:
-	      break ; 
-	    } 
-
-
-	case kCM_MENU:
-	
-	  switch (parm1) {
-	  case M_FILE_EXIT: 
-	    CloseWindow() ;
-	    break; 
-	  }
-
-
-	default:
-	  break ;
-	}
-    
-    default:
-      break ;
-    }
-
-   return kTRUE;
-  
-}
Index: trunk/MagicSoft/Mars/mgui/MGMarsMain.h
===================================================================
--- trunk/MagicSoft/Mars/mgui/MGMarsMain.h	(revision 713)
+++ 	(revision )
@@ -1,71 +1,0 @@
-#ifndef MGMARSMAIN_H
-#define MGMARSMAIN_H
-
-#ifndef MAGIC_H
-#include "MAGIC.h"
-#endif
-
-#ifndef ROOT_TGFrame
-#include <TGFrame.h>
-#endif
-
-class TGTab;
-class TGMenuBar;
-class TGPopupMenu;
-class TGTextButton;
-class TGPictureButton;
-class TGHorizontal3DLine;
-
-class MGMarsMain : public TGMainFrame {
- private:
-  
-  //
-  // Create a main frame with a number of different buttons.
-  //
-
-  //  the things for the menu bar 
-    
-  TGMenuBar          *fMenuBar ;
-  TGPopupMenu        *fFileMenu ;
-  TGLayoutHints      *fLayMenuBar;
-  TGLayoutHints      *fLayMenuItem ;
-  TGHorizontal3DLine *fLineSep ; 
-
-  //   divide the Window in two different parts
-  
-  TGHorizontalFrame  *fTop ;   // top part of the main window
-  TGHorizontal3DLine *fLineSep2 ;
-  TGHorizontalFrame  *fLow ;   // low part of the main window
-  TGTab              *fTab ;   // different tabs in the low window
-  
-  //   the object in the top part of the frame
-  
-  TGPictureButton  *fPicMagic;
-  TGPictureButton  *fPicMars ;
- 
-  //   the object in the low part of the frame
- 
-  TGVerticalFrame  *fTabF1; 
-  TGVerticalFrame  *fTabF2 ;
-  
-  TGTextButton     *fButEvtDisp;
-  TGTextButton     *fButDataCheck;
-  TGTextButton     *fButAnalys;
-  TGTextButton     *fButMonteCarlo ;
-  TGLayoutHints    *fButLayout ; 
- 
- public: 
-  MGMarsMain(/*const TGWindow *p,*/ UInt_t w, UInt_t h) ;
-  
-  ~MGMarsMain(); 
-  
-  void CloseWindow()  ; 
-
-  Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
-
-  ClassDef(MGMarsMain, 0)
-} ; 
-
-#endif
-
-
Index: trunk/MagicSoft/Mars/mgui/MGMonteCarloMain.cc
===================================================================
--- trunk/MagicSoft/Mars/mgui/MGMonteCarloMain.cc	(revision 713)
+++ 	(revision )
@@ -1,392 +1,0 @@
-#include "MGMonteCarloMain.h"
-
-#include <TSystem.h>        // gSystem
-
-#include <TGTab.h>          // TGTab
-#include <TGMenu.h>         // TGPopupMenu
-#include <TGButton.h>       // TGTextButton
-#include <TGMsgBox.h>       // TGMsgBox
-#include <TGListBox.h>      // TGListBox
-#include <TGFSContainer.h>  // TGFileContainer
-
-// FIXME: Move to MAGIC.h
-#define S_ISDIR(m) (((m)&(0170000)) == (0040000))  
-
-ClassImp(MGMonteCarloMain)
-
-enum CommandDataChecker {
-  M_FILE_CLOSE , 
-  M_BUTTON_ACTION, 
-
-  M_PBUTTON_CDIR_UP, 
-  M_PBUTTON_LIST_MODE, 
-  M_PBUTTON_DETAIL_MODE 
-} ; 
-
-
-MGMonteCarloMain::MGMonteCarloMain(const TGWindow *p, const TGWindow *main, 
-                            UInt_t w, UInt_t h ) 
-        : TGTransientFrame(p, main, w, h )
-{
-  //
-  //    Main window to controll the october test
-  //
-
-  //    set non-gui members to starting values 
-
-  sprintf ( fInputFile, "\n" ) ; 
-
-  //
-  //    First create the MenuBar.   
-  //
-
-  //     Layout objects for menue. 
-
-  fLayMenuBar = new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX, 2, 2, 2, 2 ) ; 
-  fLayMenuItem = new TGLayoutHints ( kLHintsTop | kLHintsLeft , 0, 4, 0, 0 ) ; 
-  
-  //  crate the menu bar
-
-  fFileMenu = new TGPopupMenu ( fClient->GetRoot() ) ; 
-  fFileMenu->AddEntry ("Close", M_FILE_CLOSE ) ; 
-  fFileMenu->Associate(this) ; 
-  
-  //  the button messages are handled by main frame (this) 
-
-  fMenuBar = new TGMenuBar ( this, 1, 1, kHorizontalFrame ) ; 
-  fMenuBar->AddPopup("File", fFileMenu, fLayMenuItem ) ;   
-  AddFrame(fMenuBar, fLayMenuBar ) ; 
-  
-  //
-  //    Create the top window with a lot of buttons 
-  //
-
-  fFrameTop = new TGCompositeFrame (this, 300,100, kVerticalFrame ) ; 
-  
-  fTop1 = new TGHorizontalFrame (fFrameTop, 300, 100 ) ; 
-
-  fButAction = new TGTextButton(fTop1, "ACTION", M_BUTTON_ACTION );
-  fButAction->Associate(this) ;   
-  fTop1->AddFrame (fButAction, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
-  
-  fFrameTop->AddFrame (fTop1, new TGLayoutHints(kLHintsCenterX, 10, 10, 5, 5) );
-
-  AddFrame(fFrameTop, new TGLayoutHints (kLHintsTop ) ) ;   
-
-
-  //
-  //    Create the low window with a tabs in it
-  //
-
-  fFrameLow = new TGCompositeFrame (this, 300,100, kHorizontalFrame ) ; 
-  
-  fLayTab = new TGLayoutHints ( kLHintsExpandX   , 5, 5, 5, 5 ) ;
-
-  //    create the first tab
-
-  fTab = new TGTab ( fFrameLow, 400, 400 ) ;   
-
-  TGCompositeFrame *tf = fTab->AddTab("Input File") ; 
-  
-  fTabF1 = new TGCompositeFrame (tf, 100, 100, kHorizontalFrame) ; 
-  //  tf->AddFrame(fTabF1, fLayTab ) ; 
-
-  
-  fTabF1a = new TGCompositeFrame (tf, 100, 100, kHorizontalFrame) ; 
-  tf->AddFrame(fTabF1a,  new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX, 5, 5, 5, 5 ) ) ; 
-
-  fTabF1b = new TGCompositeFrame (tf, 100, 100, kVerticalFrame) ; 
-  //  tf->AddFrame(fTabF1b,  new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX | kLHintsExpandY  , 5, 5, 5, 5 ) ) ; 
-  tf->AddFrame(fTabF1b,  new TGLayoutHints ( kLHintsExpandX | kLHintsExpandY  , 5, 5, 5, 5 ) ) ; 
-
-  
-  fDir = new TGListBox(fTabF1a, -1) ; 
-  fDir->Resize(350,20) ;
-  char temp[100] ; 
-  //  sprintf ( temp, "%s", START_DIRECTORY ) ; 
-  sprintf ( temp, "%s", gSystem->WorkingDirectory()  ) ; 
-  fDir->AddEntry(temp, 1) ; 
-  fTabF1a->AddFrame( fDir, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX, 5, 5, 5, 5 ) ) ; 
-
-
-  fPicCdup = fClient->GetPicture("tb_uplevel.xpm") ; 
-  fCdup = new TGPictureButton(fTabF1a, fPicCdup, M_PBUTTON_CDIR_UP ) ; 
-  fCdup->SetToolTipText("One Level up!") ; 
-  fCdup->Associate(this) ; 
-  fTabF1a->AddFrame (fCdup, new TGLayoutHints(kLHintsLeft | kLHintsTop, 5, 5, 5, 5) ) ; 
-
-  fPicList = fClient->GetPicture("tb_list.xpm") ; 
-  fListMode = new TGPictureButton(fTabF1a, fPicList, M_PBUTTON_LIST_MODE ) ; 
-  fListMode->SetToolTipText("List Mode") ; 
-  fListMode->Associate(this) ; 
-  fListMode->SetState(kButtonUp) ; 
-  fListMode->AllowStayDown(kTRUE) ; 
-  fListMode->AllowStayDown(kTRUE) ;  fTabF1a->AddFrame (fListMode, new TGLayoutHints(kLHintsLeft | kLHintsTop, 5, 5, 5, 5) ) ;
-
-  fPicDetail = fClient->GetPicture("tb_details.xpm") ; 
-  fDetail = new TGPictureButton(fTabF1a, fPicDetail, M_PBUTTON_DETAIL_MODE ) ; 
-  fDetail->SetToolTipText("Details Mode") ; 
-  fDetail->Associate(this) ; 
-  fDetail->SetState(kButtonEngaged) ; 
-  fDetail->AllowStayDown(kTRUE) ; 
-  fTabF1a->AddFrame (fDetail, new TGLayoutHints(kLHintsLeft | kLHintsTop, 5, 5, 5, 5) ) ; 
-
-    
-  fFileView = new TGListView(fTabF1b, 540, 380 ) ; 
-  fFileCont = new TGFileContainer(fFileView->GetViewPort(), 100, 100,
-				  kVerticalFrame, fgWhitePixel) ; 
-
-  fFileCont->Associate(this) ; 
-  fFileView->GetViewPort()->SetBackgroundColor(fgWhitePixel) ; 
-  fFileView->SetContainer(fFileCont) ; 
-  fFileCont->SetFilter("*") ; 
-  //  fFileCont->ChangeDirectory(START_DIRECTORY) ; 
-  fFileCont->ChangeDirectory(gSystem->WorkingDirectory()) ; 
-  fFileView->SetViewMode(kLVDetails); 
-  fFileCont->Sort(kSortByName) ; 
-  
-  fTabF1b->AddFrame(fFileView, new TGLayoutHints(kLHintsTop | kLHintsExpandX | kLHintsExpandY, 5, 5, 5, 5) ) ; 
-
-  tf->AddFrame(fTabF1, fLayTab) ;
- 
-  fFrameLow->AddFrame ( fTab, new TGLayoutHints(kLHintsBottom | kLHintsExpandX | kLHintsExpandY, 5, 5, 5, 5) ); 
-
-  AddFrame(fFrameLow, new TGLayoutHints (kLHintsExpandX|kLHintsExpandY) ) ; 
-
-  //
-  //   Map the window, set up the layout, etc. 
-  //
-
-  SetWMSizeHints(200, 250, 1000, 1000, 10, 10 ) ;      // set the smallest and biggest size of the Main frame
-
-  MapSubwindows();
-  
-  Layout();
-  
-  SetWindowName("MonteCarlo Main");
-  SetIconName("MonteCarlo");
-  
-  MapWindow();
-
-} 
-
-
-// ======================================================================
-// ======================================================================
-
-MGMonteCarloMain::~MGMonteCarloMain()
-{
-  //delete  fPicCdup, fPicList, fPicDetail; 
-    delete fLayTab;
-    delete fLayMenuBar;
-    delete fLayMenuItem;
-    delete fFileView;
-    delete fFileCont;
-    delete fCdup;
-    delete fListMode;
-    delete fDetail;
-    delete fDir ;
-    delete fTabF1b;
-    delete fTabF1a;
-    delete fTabF1;
-    delete fButAction; 
-    delete fTop1;
-    delete fTab;
-    delete fFrameTop;
-    delete fFrameLow;
-    delete fFileMenu;
-    delete fMenuBar;
-
-} 
-
-
-// ======================================================================
-// ======================================================================
-
-void MGMonteCarloMain::CloseWindow()
-{
-   // Got close message for this MainFrame. Calls parent CloseWindow()
-   // (which destroys the window) and terminate the application.
-   // The close message is generated by the window manager when its close
-   // window menu item is selected.
-
-  delete this ; 
-}
-
-
-// ======================================================================
-// ======================================================================
-
-Bool_t MGMonteCarloMain::InputFileSelected() 
-{
-  //   Checks if there is a selected input root file
-   
-    return strcmp ( fInputFile, "\n") == 0 ? kFALSE : kTRUE;
-} 
-
-
-// ======================================================================
-// ======================================================================
-
-Bool_t MGMonteCarloMain::ProcessMessage(Long_t msg, Long_t parm1, Long_t)
-{     
-  // Process events generated by the buttons in the frame.
-  
-  Int_t   buttons = 4, retval = 0 ; 
-  Char_t  wort[100] ;
-  Char_t  extens[5] ;
-  Char_t  command[110] ;
- 
-  TGFileItem *item ;     // to process items in the file view container
-  void *np = NULL ;      // null pointer
-
-  switch (GET_MSG(msg)) 
-    {
-    case kC_COMMAND:
-      switch (GET_SUBMSG(msg)) 
-	{
-	case kCM_BUTTON:
-	  
-	  switch (parm1)
-	    {  
-
-	    case M_BUTTON_ACTION:
-	      	
-	      if ( InputFileSelected() == kFALSE ) {              // it is not selected
-		
-		new TGMsgBox(fClient->GetRoot(), this, "ERROR!", 
-			     "No Input (root) File selected!", kMBIconExclamation, buttons, &retval);
-		break ; 
-	      }      
-	      
-	      new TGMsgBox(fClient->GetRoot(), this, "INFORMATION!", 
-			   "Put Intelligence here!!!", kMBIconExclamation, buttons, &retval);
-
-	      break ; 
-		  
-	    case M_PBUTTON_CDIR_UP :
-
-	      //  goto the parent directory
-	      
-	      gSystem->ChangeDirectory("..") ; 
-	      fDir->RemoveEntry(1) ; 
-	      sprintf (wort, "%s", gSystem->WorkingDirectory() ) ; 
-	      fDir->AddEntry(wort,1) ; 
-	      fDir->MapSubwindows() ; 
-	      fDir->Layout() ; 
-	      fFileCont->ChangeDirectory( wort ) ; 
-	      fFileCont->DisplayDirectory() ; 
-	      
-	      break ; 
-	    
-	    case M_PBUTTON_LIST_MODE:
-	      fFileView->SetViewMode(kLVList) ; 
-	      fDetail->SetState(kButtonUp) ; 
-	      
-	      break ; 
-	      
-	    case M_PBUTTON_DETAIL_MODE:
-	      fFileView->SetViewMode(kLVDetails) ; 
-	      fListMode->SetState(kButtonUp) ; 
-	      
-	      break ;
-	      
-	    default:
-	      break ;
-	    } 
-
-	case kCM_MENU:
-
-	  switch (parm1) {
-	  case M_FILE_CLOSE:
-	    CloseWindow() ; 
-
-	    break; 
-	  }
-	  break ;
-	  
-	default:
-	  break ;
-	  
-	}
-      
-    case kC_CONTAINER: 
-      switch (GET_SUBMSG(msg)) {
-	
-	//      case kCT_ITEMCLICK:
-	// 	printf ("itemclick\n"); 
-	//      break; 
-	
-      
-      case kCT_ITEMDBLCLICK: 
-	//
-	//  process the double click in the file view container
-	//
-	
-	if ( parm1 == kButton1) {
-	  if ( fFileCont->NumSelected() == 1 ) {   
-	    //
-	    //  one file selected
-	    //	  
-	    item = (TGFileItem *) fFileCont->GetNextSelected(&np) ; 
-	    
-	    if ( S_ISDIR(item->GetType()) )   // file is directory
-	      {  
-		//  goto directory 
-		
-		sprintf (wort, "%s", item->GetItemName()->GetString()) ;
-		fFileCont->ChangeDirectory ( wort ) ; 
-		gSystem->ChangeDirectory( wort ) ; 
-		
-		sprintf (wort, "%s", gSystem->WorkingDirectory() ) ; 
-		fDir->RemoveEntry(1) ; 
-		fDir->AddEntry( wort, 1 ) ; 
-		fDir->MapSubwindows() ; 
-		fDir->Layout() ; 
-	      }
-	    else                              // file is no directory, is a file 
-	      { 
-		sprintf (wort, "%s", item->GetItemName()->GetString() ) ; 
-	    
-		//    determine the file type by extensions
-		
-		for (Int_t i = 0 ; i<5; i++) 
-		  extens[i] = '\0' ; 
-		
-		for ( Int_t i=0; wort[i] != '\0'; i++) {
-		  if ( wort[i] == '.') {
-		    strncpy (extens, &wort[i+1], 4 ) ; 
-		    break ; 
-		  }
-		}
-		
-		if ( ! strcmp(extens, "ps") ) {              //     postscript file
-		  sprintf ( command, "gv %s/%s &", 
-			    gSystem->WorkingDirectory(), 
-			    wort ) ; 
-		  gSystem->Exec(command) ; 
-		  break ; 
-		}
-		else if  ( ! strcmp(extens, "root") ) {      //     root file
-		  sprintf ( fInputFile, "%s/%s" , gSystem->WorkingDirectory(), wort ) ;  
-
-		  printf (" %s \n", fInputFile ) ; 
-		  break ; 
-		}
-		
-	      } 
-	  }
-	}
-	break; 
-	
-      default:
-	break ;
-      }
-      
-      
-      
-    default:
-      break;
-    }
-  return kTRUE;
-} 
Index: trunk/MagicSoft/Mars/mgui/MGMonteCarloMain.h
===================================================================
--- trunk/MagicSoft/Mars/mgui/MGMonteCarloMain.h	(revision 713)
+++ 	(revision )
@@ -1,89 +1,0 @@
-#ifndef MGMONTECARLOMAIH_H
-#define MGMONTECARLOMAIN_H
-
-#ifndef MAGIC_H
-#include "MAGIC.h"
-#endif
-
-#ifndef ROOT_TGFrame
-#include <TGFrame.h>
-#endif
-
-
-class TGMenuBar;
-class TGPopupMenu;
-class TGTab;
-class TGTextButton;
-class TGListBox;
-class TGPictureButton;
-class TGFileContainer;
-class TGListView;
-
-class MGMonteCarloMain : public TGTransientFrame {
- private:
-  
-  //
-  // Create a main frame with a number of different buttons.
-  //
-
-  //   some member not connected with Gui 
-  
-  Char_t            fInputFile[256] ; 
-
-  //  the things for the menu bar 
-    
-  TGMenuBar         *fMenuBar ; 
-  TGPopupMenu       *fFileMenu ;
-
-  //   divide the Window in two different parts
-  
-  TGCompositeFrame  *fFrameTop ;   // top part of the main window
-  TGCompositeFrame  *fFrameLow ;   // low part of the main window
-  TGTab             *fTab      ;   // different tabs in the low window
-  
-  //     the horizontal frame in the top part
-
-  TGHorizontalFrame *fTop1 ; 
-  
-  //   the buttons in the Top Part
-  
-  TGTextButton      *fButAction ; 
-  
-  //   the things in the file selector
-
-  TGCompositeFrame  *fTabF1 ;                       // first tab of low part 
-  TGCompositeFrame  *fTabF1a, *fTabF1b ;            // subpart of the file selector in low window
-  TGListBox         *fDir ; 
-  TGPictureButton   *fCdup, *fListMode, *fDetail ; 
-  TGFileContainer   *fFileCont ; 
-  TGListView        *fFileView ;
-
-  //     Layout hints for different uses 
-   
-  TGLayoutHints     *fLayMenuBar, *fLayMenuItem ; 
-  TGLayoutHints     *fLayTab ; 
-  
-  //     some icons and pictures often used
-   
-  const TGPicture   *fPicCdup;   //!
-  const TGPicture   *fPicList;   //!
-  const TGPicture   *fPicDetail; //!
-  
- public: 
-  MGMonteCarloMain(const TGWindow *p, const TGWindow *main, UInt_t w, UInt_t h) ;
-  
-  ~MGMonteCarloMain(); 
-  
-  void   CloseWindow()  ; 
-
-  Bool_t InputFileSelected() ; 
-  
-  Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
-
-  ClassDef(MGMonteCarloMain, 0)
-
-} ; 
-
-#endif
-
-
Index: trunk/MagicSoft/Mars/mgui/MGPrototyp.cc
===================================================================
--- trunk/MagicSoft/Mars/mgui/MGPrototyp.cc	(revision 713)
+++ 	(revision )
@@ -1,450 +1,0 @@
-#include "MGPrototyp.h"
-
-#include <TSystem.h>        // gSystem
-
-#include <TGTab.h>          // TGTab
-#include <TGMenu.h>         // TGPopupMenu
-#include <TGButton.h>       // TGTextButton
-#include <TGMsgBox.h>       // TGMsgBox
-#include <TGListBox.h>      // TGListBox
-#include <TGFSContainer.h>  // TGFileContainer
-#include <TGSplitter.h>    // TGHorizontal3DLine
-#include <TGTextEntry.h> 
-#include <TGLabel.h>       // TGLabel
-
-
-// FIXME: Move to MAGIC.h
-#define S_ISDIR(m) (((m)&(0170000)) == (0040000))  
-
-ClassImp(MGPrototyp)
-
-enum CommandPrototyp {
-  M_FILE_CLOSE , 
-  M_BUTTON_ACTION, 
-
-  M_FILERESET, 
-  M_PBUTTON_CDIR_UP, 
-  M_PBUTTON_LIST_MODE, 
-  M_PBUTTON_DETAIL_MODE 
-} ; 
-
-
-MGPrototyp::MGPrototyp(const TGWindow *p, const TGWindow *main, 
-                            UInt_t w, UInt_t h ) 
-        : TGTransientFrame(p, main, w, h ) 
-{
-  //
-  //    Main window to controll the october test
-  //
-
-  //    set non-gui members to starting values 
-
-  sprintf ( fInputFile, "\n" ) ; 
-
-  //
-  //    First create the MenuBar.   
-  //
-
-  //     Layout objects for menue. 
-
-  fLayMenuBar = new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX, 2, 2, 2, 2 ) ; 
-  fLayMenuItem = new TGLayoutHints ( kLHintsTop | kLHintsLeft , 0, 4, 0, 0 ) ; 
-  
-  //  crate the menu bar
-
-  fFileMenu = new TGPopupMenu ( fClient->GetRoot() ) ; 
-  fFileMenu->AddEntry ("Close", M_FILE_CLOSE ) ; 
-  fFileMenu->Associate(this) ; 
-  
-  //  the button messages are handled by main frame (this) 
-
-  fMenuBar = new TGMenuBar ( this, 1, 1, kHorizontalFrame ) ; 
-  fMenuBar->AddPopup("File", fFileMenu, fLayMenuItem ) ;   
-  AddFrame(fMenuBar, fLayMenuBar ) ; 
-  
-  fLineSep1 = new TGHorizontal3DLine(this) ; 
-  AddFrame(fLineSep1, new TGLayoutHints(kLHintsTop | kLHintsExpandX) );
-
-  
-  //
-  //    Create the top window with a lot of buttons 
-  //
-
-  fFrameTop = new TGCompositeFrame (this, 300,100, kVerticalFrame ) ; 
-  
-  fTop1 = new TGHorizontalFrame (fFrameTop, 300, 100 ) ; 
-
-  fButAction = new TGTextButton(fTop1, "ACTION", M_BUTTON_ACTION );
-  fButAction->Associate(this) ;   
-  fTop1->AddFrame (fButAction, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
-  
-  fFrameTop->AddFrame (fTop1, new TGLayoutHints(kLHintsCenterX, 10, 10, 5, 5) );
-
-  AddFrame(fFrameTop, new TGLayoutHints (kLHintsTop ) ) ;   
-
-  //   a line between top and low frame
-  
-  fLineSep2 = new TGHorizontal3DLine(this) ; 
-  AddFrame(fLineSep2, new TGLayoutHints(kLHintsTop | kLHintsExpandX) );
-
-  //
-  //    Create the low window with a tabs in it
-  //
-
-  fFrameLow = new TGCompositeFrame (this, 300,100, kHorizontalFrame ) ; 
-  
-  fLayTab = new TGLayoutHints ( kLHintsExpandX   , 5, 5, 5, 5 ) ;
-
-  //    create the first tab
-
-  fTab = new TGTab ( fFrameLow, 400, 400 ) ;   
-
-  TGCompositeFrame *tf = fTab->AddTab("Input File") ; 
-  
-  fTabF1 = new TGCompositeFrame (tf, 100, 100, kHorizontalFrame) ; 
-  //  tf->AddFrame(fTabF1, fLayTab ) ; 
-
-  fTabF1a = new TGCompositeFrame (tf, 100, 100, kHorizontalFrame) ; 
-  tf->AddFrame(fTabF1a,  new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX, 5, 5, 5, 5 ) ) ; 
-
-  fTabF1b = new TGCompositeFrame (tf, 100, 100, kHorizontalFrame) ; 
-  tf->AddFrame(fTabF1b,  new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX, 5, 5, 5, 5 ) ) ; 
-
-  fTabF1c = new TGCompositeFrame (tf, 100, 100, kVerticalFrame) ; 
-  //  tf->AddFrame(fTabF1c,  new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX | kLHintsExpandY  , 5, 5, 5, 5 ) ) ; 
-  tf->AddFrame(fTabF1c,  new TGLayoutHints ( kLHintsExpandX | kLHintsExpandY  , 5, 5, 5, 5 ) ) ; 
-  
-  //   the items in the first subframe
-
-  fLabFileName = new TGLabel(fTabF1a, new TGString("selected File:") );
-  fTabF1a->AddFrame( fLabFileName, new TGLayoutHints (kLHintsLeft, 10, 10, 10, 10)) ; 
-
-  fTxtFileName = new TGTextEntry(fTabF1a, fTxtBufFileName = new TGTextBuffer(256) );
-  fTxtFileName->Resize(60, fTxtFileName->GetDefaultHeight());
-  fTabF1a->AddFrame(fTxtFileName, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 5, 5, 5, 5)); 
-
-  fButFileReset = new TGTextButton (fTabF1a, "Reset", M_FILERESET ) ;
-  fButFileReset->Associate(this) ; 
-  fTabF1a->AddFrame (fButFileReset, new TGLayoutHints (kLHintsRight, 10, 10, 10, 10  ) ) ; 
-  
-  
-  
-  //   the items in the second subfraem
-
-  fLabDir = new TGLabel(fTabF1b, new TGString("Directory:") );
-  fTabF1b->AddFrame( fLabDir, new TGLayoutHints (kLHintsLeft, 10, 10, 10, 10)) ; 
-
-  fDir = new TGListBox(fTabF1b, -1) ; 
-  fDir->Resize(350,20) ;
-  char temp[100] ; 
-  //  sprintf ( temp, "%s", START_DIRECTORY ) ; 
-  sprintf ( temp, "%s", gSystem->WorkingDirectory()  ) ; 
-  fDir->AddEntry(temp, 1) ; 
-  fTabF1b->AddFrame( fDir, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX, 5, 5, 5, 5 ) ) ; 
-
-
-  fPicCdup = fClient->GetPicture("tb_uplevel.xpm") ; 
-  fCdup = new TGPictureButton(fTabF1b, fPicCdup, M_PBUTTON_CDIR_UP ) ; 
-  fCdup->SetToolTipText("One Level up!") ; 
-  fCdup->Associate(this) ; 
-  fTabF1b->AddFrame (fCdup, new TGLayoutHints(kLHintsLeft | kLHintsTop, 5, 5, 5, 5) ) ; 
-
-  fPicList = fClient->GetPicture("tb_list.xpm") ; 
-  fListMode = new TGPictureButton(fTabF1b, fPicList, M_PBUTTON_LIST_MODE ) ; 
-  fListMode->SetToolTipText("List Mode") ; 
-  fListMode->Associate(this) ; 
-  fListMode->SetState(kButtonUp) ; 
-  fListMode->AllowStayDown(kTRUE) ; 
-  fListMode->AllowStayDown(kTRUE) ;  fTabF1b->AddFrame (fListMode, new TGLayoutHints(kLHintsLeft | kLHintsTop, 5, 5, 5, 5) ) ;
-
-  fPicDetail = fClient->GetPicture("tb_details.xpm") ; 
-  fDetail = new TGPictureButton(fTabF1b, fPicDetail, M_PBUTTON_DETAIL_MODE ) ; 
-  fDetail->SetToolTipText("Details Mode") ; 
-  fDetail->Associate(this) ; 
-  fDetail->SetState(kButtonEngaged) ; 
-  fDetail->AllowStayDown(kTRUE) ; 
-  fTabF1b->AddFrame (fDetail, new TGLayoutHints(kLHintsLeft | kLHintsTop, 5, 5, 5, 5) ) ; 
-
-  // the items in the third subframe
-
-  fFileView = new TGListView(fTabF1c, 540, 380 ) ; 
-  fFileCont = new TGFileContainer(fFileView->GetViewPort(), 100, 100,
-				  kVerticalFrame, fgWhitePixel) ; 
-
-  fFileCont->Associate(this) ; 
-  fFileView->GetViewPort()->SetBackgroundColor(fgWhitePixel) ; 
-  fFileView->SetContainer(fFileCont) ; 
-  fFileCont->SetFilter("*") ; 
-  //  fFileCont->ChangeDirectory(START_DIRECTORY) ; 
-  fFileCont->ChangeDirectory(gSystem->WorkingDirectory()) ; 
-  fFileView->SetViewMode(kLVDetails); 
-  fFileCont->Sort(kSortByName) ; 
-  
-  fTabF1c->AddFrame(fFileView, new TGLayoutHints(kLHintsTop | kLHintsExpandX | kLHintsExpandY, 5, 5, 5, 5) ) ; 
-
-  tf->AddFrame(fTabF1, fLayTab) ;
- 
-  fFrameLow->AddFrame ( fTab, new TGLayoutHints(kLHintsBottom | kLHintsExpandX | kLHintsExpandY, 5, 5, 5, 5) ); 
-
-  AddFrame(fFrameLow, new TGLayoutHints (kLHintsExpandX|kLHintsExpandY) ) ; 
-
-  //
-  //   Map the window, set up the layout, etc. 
-  //
-
-  SetWMSizeHints(200, 250, 1000, 1000, 10, 10 ) ;      // set the smallest and biggest size of the Main frame
-
-  MapSubwindows();
-  
-  Layout();
-  
-  SetWindowName("Prototyp");
-  SetIconName("Prototyp");
-  
-  MapWindow();
-
-} 
-
-
-// ======================================================================
-// ======================================================================
-
-MGPrototyp::~MGPrototyp()
-{
-  //delete  fPicCdup, fPicList, fPicDetail; 
-    delete fLayTab;
-    delete fLayMenuBar;
-    delete fLayMenuItem;
-    delete fFileView;
-    delete fFileCont;
-    delete fCdup;
-    delete fListMode;
-    delete fDetail;
-    delete fDir ;
-    delete fLabDir ; 
-
-    delete fButFileReset ; 
-    delete fTxtFileName  ; 
-    delete fLabFileName  ; 
-    
-    delete fTabF1c;
-    delete fTabF1b;
-    delete fTabF1a;
-    delete fTabF1;
-    delete fButAction; 
-    delete fTop1;
-    delete fTab;
-
-    delete fFrameTop;
-    delete fFrameLow;
-    delete fLineSep2 ; 
-    delete fLineSep1 ; 
-
-    delete fFileMenu;
-    delete fMenuBar;
-
-} 
-
-
-// ======================================================================
-// ======================================================================
-
-void MGPrototyp::CloseWindow()
-{
-   // Got close message for this MainFrame. Calls parent CloseWindow()
-   // (which destroys the window) and terminate the application.
-   // The close message is generated by the window manager when its close
-   // window menu item is selected.
-
-  delete this ; 
-}
-
-
-// ======================================================================
-// ======================================================================
-
-Bool_t MGPrototyp::InputFileSelected() 
-{
-  //   Checks if there is a selected input root file
-   
-  if ( strcmp ( fInputFile, "\n") == 0 )
-    { 
-      return ( kFALSE ) ; 
-    } 
-  
-  return (kTRUE) ; 
-} 
-
-
-// ======================================================================
-// ======================================================================
-
-Bool_t MGPrototyp::ProcessMessage(Long_t msg, Long_t parm1, Long_t)
-{     
-  // Process events generated by the buttons in the frame.
-  
-  Int_t   buttons = 4, retval = 0 ; 
-  Char_t  wort[100] ;
-  Char_t  extens[5] ;
-  Char_t  command[110] ;
- 
-  TGFileItem *item ;     // to process items in the file view container
-  void *np = NULL ;      // null pointer
-
-  switch (GET_MSG(msg)) 
-    {
-    case kC_COMMAND:
-      switch (GET_SUBMSG(msg)) 
-	{
-	case kCM_BUTTON:
-	  
-	  switch (parm1)
-	    {  
-
-	    case M_BUTTON_ACTION:
-	      	
-	      if ( InputFileSelected() == kFALSE ) {              // it is not selected
-		
-		new TGMsgBox(fClient->GetRoot(), this, "ERROR!", 
-			     "No Input (root) File selected!", kMBIconExclamation, buttons, &retval);
-		break ; 
-	      }      
-	      
-	      new TGMsgBox(fClient->GetRoot(), this, "INFORMATION!", 
-			   "Put Intelligence here!!!", kMBIconExclamation, buttons, &retval);
-
-	      break ; 
-		
-
-	    case M_FILERESET:
-	      
-	      sprintf ( fInputFile, "\n" ) ; 
-	      fTxtFileName->SetText( fInputFile ) ; 
-	      
-	      break; 
-	    case M_PBUTTON_CDIR_UP :
-
-	      //  goto the parent directory
-	      
-	      gSystem->ChangeDirectory("..") ; 
-	      fDir->RemoveEntry(1) ; 
-	      sprintf (wort, "%s", gSystem->WorkingDirectory() ) ; 
-	      fDir->AddEntry(wort,1) ; 
-	      fDir->MapSubwindows() ; 
-	      fDir->Layout() ; 
-	      fFileCont->ChangeDirectory( wort ) ; 
-	      fFileCont->DisplayDirectory() ; 
-	      
-	      break ; 
-	    
-	    case M_PBUTTON_LIST_MODE:
-	      fFileView->SetViewMode(kLVList) ; 
-	      fDetail->SetState(kButtonUp) ; 
-	      
-	      break ; 
-	      
-	    case M_PBUTTON_DETAIL_MODE:
-	      fFileView->SetViewMode(kLVDetails) ; 
-	      fListMode->SetState(kButtonUp) ; 
-	      
-	      break ;
-	      
-	    default:
-	      break ;
-	    } 
-
-	case kCM_MENU:
-
-	  switch (parm1) {
-	  case M_FILE_CLOSE:
-	    CloseWindow() ; 
-
-	    break; 
-	  }
-	  break ;
-	  
-	default:
-	  break ;
-	  
-	}
-      
-    case kC_CONTAINER: 
-      switch (GET_SUBMSG(msg)) {
-	
-	//      case kCT_ITEMCLICK:
-	// 	printf ("itemclick\n"); 
-	//      break; 
-	
-      
-      case kCT_ITEMDBLCLICK: 
-	//
-	//  process the double click in the file view container
-	//
-	
-	if ( parm1 == kButton1) {
-	  if ( fFileCont->NumSelected() == 1 ) {   
-	    //
-	    //  one file selected
-	    //	  
-	    item = (TGFileItem *) fFileCont->GetNextSelected(&np) ; 
-	    
-	    if ( S_ISDIR(item->GetType()) )   // file is directory
-	      {  
-		//  goto directory 
-		
-		sprintf (wort, "%s", item->GetItemName()->GetString()) ;
-		fFileCont->ChangeDirectory ( wort ) ; 
-		gSystem->ChangeDirectory( wort ) ; 
-		
-		sprintf (wort, "%s", gSystem->WorkingDirectory() ) ; 
-		fDir->RemoveEntry(1) ; 
-		fDir->AddEntry( wort, 1 ) ; 
-		fDir->MapSubwindows() ; 
-		fDir->Layout() ; 
-	      }
-	    else                              // file is no directory, is a file 
-	      { 
-		sprintf (wort, "%s", item->GetItemName()->GetString() ) ; 
-	    
-		//    determine the file type by extensions
-		
-		for (Int_t i = 0 ; i<5; i++) 
-		  extens[i] = '\0' ; 
-		
-		for ( Int_t i=0; wort[i] != '\0'; i++) {
-		  if ( wort[i] == '.') {
-		    strncpy (extens, &wort[i+1], 4 ) ; 
-		    break ; 
-		  }
-		}
-		
-		if ( ! strcmp(extens, "ps") ) {              //     postscript file
-		  sprintf ( command, "gv %s/%s &", 
-			    gSystem->WorkingDirectory(), 
-			    wort ) ; 
-		  gSystem->Exec(command) ; 
-		  break ; 
-		}
-		else if  ( ! strcmp(extens, "root") ) {      //     root file
-		  sprintf ( fInputFile, "%s/%s" , gSystem->WorkingDirectory(), wort ) ;  
-		  fTxtFileName->SetText( fInputFile ) ;
-
-		  break ; 
-		}
-		
-	      } 
-	  }
-	}
-	break; 
-	
-      default:
-	break ;
-      }
-      
-      
-      
-    default:
-      break;
-    }
-  return kTRUE;
-} 
Index: trunk/MagicSoft/Mars/mgui/MGPrototyp.h
===================================================================
--- trunk/MagicSoft/Mars/mgui/MGPrototyp.h	(revision 713)
+++ 	(revision )
@@ -1,101 +1,0 @@
-#ifndef MGPROTOTYP_H
-#define MGPROTOTYP_H
-
-#ifndef MAGIC_H
-#include "MAGIC.h"
-#endif
-
-#ifndef ROOT_TGFrame
-#include <TGFrame.h>
-#endif
-
-class TGMenuBar;
-class TGPopupMenu;
-class TGTab;
-class TGTextButton;
-class TGListBox;
-class TGPictureButton;
-class TGFileContainer;
-class TGListView;
-class TGHorizontal3DLine;
-class TGLabel ; 
-class TGTextEntry ; 
-class TGTextBuffer; 
-
-class MGPrototyp : public TGTransientFrame {
- private:
-  
-  //
-  // Create a main frame with a number of different buttons.
-  //
-
-  //   some member not connected with Gui 
-  
-  Char_t            fInputFile[256] ; 
-
-  //  the things for the menu bar 
-    
-  TGMenuBar         *fMenuBar ; 
-  TGPopupMenu       *fFileMenu ;
-  TGHorizontal3DLine *fLineSep1, *fLineSep2 ; 
-
-
-  //   divide the Window in two different parts
-  
-  TGCompositeFrame  *fFrameTop ;   // top part of the main window
-  TGCompositeFrame  *fFrameLow ;   // low part of the main window
-  TGTab             *fTab      ;   // different tabs in the low window
-  
-  //     the horizontal frame in the top part
-
-  TGHorizontalFrame *fTop1 ; 
-  
-  //   the buttons in the Top Part
-  
-  TGTextButton      *fButAction ; 
-  
-  //   the things in the file selector
-
-  TGCompositeFrame  *fTabF1 ;                       // first tab of low part 
-  TGCompositeFrame  *fTabF1a, *fTabF1b, *fTabF1c ;  // subpart of the file selector in low window
-
-  TGLabel           *fLabFileName ; 
-  TGTextEntry       *fTxtFileName ; 
-  TGTextBuffer      *fTxtBufFileName ; //!
-  TGTextButton      *fButFileReset ; 
- 
-  TGLabel           *fLabDir ; 
-  TGListBox         *fDir ; 
-  TGPictureButton   *fCdup, *fListMode, *fDetail ; 
-  TGFileContainer   *fFileCont ; 
-  TGListView        *fFileView ;
-
-  //     Layout hints for different uses 
-   
-  TGLayoutHints     *fLayMenuBar, *fLayMenuItem ; 
-  TGLayoutHints     *fLayTab ; 
-  
-  //     some icons and pictures often used
-  
-  const TGPicture   *fPicCdup;   //!
-  const TGPicture   *fPicList;   //!
-  const TGPicture   *fPicDetail; //!
-  
- public: 
-  MGPrototyp(const TGWindow *p, const TGWindow *main, UInt_t w, UInt_t h) ;
-  
-  ~MGPrototyp(); 
-  
-  void   CloseWindow()  ; 
-
-  Bool_t InputFileSelected() ; 
-  
-  Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
-
-  ClassDef(MGPrototyp, 0)
-
-} ; 
-
-#endif
-
-
Index: trunk/MagicSoft/Mars/mgui/Makefile
===================================================================
--- trunk/MagicSoft/Mars/mgui/Makefile	(revision 713)
+++ trunk/MagicSoft/Mars/mgui/Makefile	(revision 714)
@@ -30,9 +30,4 @@
 SRCFILES = MCamDisplay.cc \
 	   MCamNeighbor.cc \
-	   MGDataCheckMain.cc \
-	   MGEventDispMain.cc \
-	   MGMarsMain.cc \
-	   MGMonteCarloMain.cc \
-           MGPrototyp.cc \
            MGeomCamCT1.cc \
            MGeomCamMagic.cc \
Index: trunk/MagicSoft/Mars/mmain/MBrowser.cc
===================================================================
--- trunk/MagicSoft/Mars/mmain/MBrowser.cc	(revision 714)
+++ trunk/MagicSoft/Mars/mmain/MBrowser.cc	(revision 714)
@@ -0,0 +1,359 @@
+#include "MBrowser.h"
+
+#include <TSystem.h>        // gSystem
+
+#include <TGTab.h>          // TGTab
+#include <TGMenu.h>         // TGPopupMenu
+#include <TGButton.h>       // TGTextButton
+#include <TGMsgBox.h>       // TGMsgBox
+#include <TGListBox.h>      // TGListBox
+#include <TGFSContainer.h>  // TGFileContainer
+
+// FIXME: Move to MAGIC.h
+#define S_ISDIR(m) ((m)&0170000 == 0040000)
+
+#include <iostream.h>
+
+enum {
+    M_FILE_CLOSE          = 0x1000,
+    M_PBUTTON_CDIR_UP     = 0x1001,
+    M_PBUTTON_LIST_MODE   = 0x1002,
+    M_PBUTTON_DETAIL_MODE = 0x1003
+};
+
+
+MBrowser::MBrowser(const TGWindow *main, const TGWindow *p,
+                     const UInt_t w, const UInt_t h)
+: TGTransientFrame(p?p:gClient->GetRoot(),
+                   main?main:gClient->GetRoot(), w, h)
+{
+
+    //
+    //    Main window to controll the october test
+    //
+
+    //    set non-gui members to starting values
+
+    fInputFile[0] = '\0';
+
+    //
+    //    First create the MenuBar.
+    //
+
+    //     Layout objects for menue.
+
+    fLayMenuBar  = new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX, 2, 2, 2, 2 ) ;
+    fLayMenuItem = new TGLayoutHints ( kLHintsTop | kLHintsLeft , 0, 4, 0, 0 ) ;
+
+    //  crate the menu bar
+
+    fFileMenu = new TGPopupMenu ( fClient->GetRoot() ) ;
+    fFileMenu->AddEntry ("Close", M_FILE_CLOSE ) ;
+    fFileMenu->Associate(this) ;
+
+    //  the button messages are handled by main frame (this)
+
+    fMenuBar = new TGMenuBar ( this, 1, 1, kHorizontalFrame ) ;
+    fMenuBar->AddPopup("File", fFileMenu, fLayMenuItem ) ;
+    AddFrame(fMenuBar, fLayMenuBar ) ;
+
+    //
+    //    Create the top window with a lot of buttons
+    //
+    fFrameTop = new TGCompositeFrame (this, 300,100, kVerticalFrame ) ;
+
+    fTop1 = new TGHorizontalFrame (fFrameTop, 300, 100 ) ;
+    fFrameTop->AddFrame (fTop1, new TGLayoutHints(kLHintsCenterX, 10, 10, 5, 5) );
+
+    fTop2 = new TGHorizontalFrame (fFrameTop, 300, 100 ) ;
+    fFrameTop->AddFrame (fTop2, new TGLayoutHints(kLHintsCenterX, 10, 10, 5, 5) );
+
+    fTop3 = new TGHorizontalFrame (fFrameTop, 300, 100 ) ;
+    fFrameTop->AddFrame (fTop3, new TGLayoutHints(kLHintsCenterX, 10, 10, 5, 5) );
+
+    AddFrame(fFrameTop, new TGLayoutHints (kLHintsTop ) ) ;
+
+    //
+    //    Create the low window with a tabs in it
+    //
+    fFrameLow = new TGCompositeFrame (this, 300,100, kHorizontalFrame ) ;
+
+    fLayTab = new TGLayoutHints ( kLHintsExpandX   , 5, 5, 5, 5 ) ;
+
+    //    create the first tab
+
+  fTab = new TGTab ( fFrameLow, 400, 400 ) ;   
+
+  TGCompositeFrame *tf = fTab->AddTab("Input File") ; 
+  
+  fTabF1 = new TGCompositeFrame (tf, 100, 100, kHorizontalFrame) ; 
+  //  tf->AddFrame(fTabF1, fLayTab ) ; 
+
+  fTabF1a = new TGCompositeFrame (tf, 100, 100, kHorizontalFrame) ; 
+  tf->AddFrame(fTabF1a,  new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX, 5, 5, 5, 5 ) ) ; 
+
+  fTabF1b = new TGCompositeFrame (tf, 100, 100, kVerticalFrame) ; 
+  //  tf->AddFrame(fTabF1b,  new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX | kLHintsExpandY  , 5, 5, 5, 5 ) ) ; 
+  tf->AddFrame(fTabF1b,  new TGLayoutHints ( kLHintsExpandX | kLHintsExpandY  , 5, 5, 5, 5 ) ) ; 
+
+  fDir = new TGListBox(fTabF1a, -1) ; 
+  fDir->Resize(350,20) ;
+  char temp[100] ; 
+  //  sprintf ( temp, "%s", START_DIRECTORY ) ; 
+  sprintf ( temp, "%s", gSystem->WorkingDirectory()  ) ; 
+  fDir->AddEntry(temp, 1) ; 
+  fTabF1a->AddFrame( fDir, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX, 5, 5, 5, 5 ) ) ; 
+
+  fPicCdup = fClient->GetPicture("tb_uplevel.xpm") ; 
+  fCdup = new TGPictureButton(fTabF1a, fPicCdup, M_PBUTTON_CDIR_UP ) ; 
+  fCdup->SetToolTipText("One Level up!") ; 
+  fCdup->Associate(this) ; 
+  fTabF1a->AddFrame (fCdup, new TGLayoutHints(kLHintsLeft | kLHintsTop, 5, 5, 5, 5) ) ; 
+
+  fPicList = fClient->GetPicture("tb_list.xpm") ; 
+  fListMode = new TGPictureButton(fTabF1a, fPicList, M_PBUTTON_LIST_MODE ) ; 
+  fListMode->SetToolTipText("List Mode") ; 
+  fListMode->Associate(this) ; 
+  fListMode->SetState(kButtonUp) ; 
+  fListMode->AllowStayDown(kTRUE) ; 
+  fListMode->AllowStayDown(kTRUE) ;  fTabF1a->AddFrame (fListMode, new TGLayoutHints(kLHintsLeft | kLHintsTop, 5, 5, 5, 5) ) ;
+
+  fPicDetail = fClient->GetPicture("tb_details.xpm") ; 
+  fDetail = new TGPictureButton(fTabF1a, fPicDetail, M_PBUTTON_DETAIL_MODE ) ; 
+  fDetail->SetToolTipText("Details Mode") ; 
+  fDetail->Associate(this) ; 
+  fDetail->SetState(kButtonEngaged) ; 
+  fDetail->AllowStayDown(kTRUE) ; 
+  fTabF1a->AddFrame (fDetail, new TGLayoutHints(kLHintsLeft | kLHintsTop, 5, 5, 5, 5) ) ; 
+
+  fFileView = new TGListView(fTabF1b, 540, 380 ) ; 
+  fFileCont = new TGFileContainer(fFileView->GetViewPort(), 100, 100,
+				  kVerticalFrame, fgWhitePixel) ; 
+
+  fFileCont->Associate(this) ; 
+  fFileView->GetViewPort()->SetBackgroundColor(fgWhitePixel) ; 
+  fFileView->SetContainer(fFileCont) ; 
+  fFileCont->SetFilter("*") ; 
+  //  fFileCont->ChangeDirectory(START_DIRECTORY) ; 
+  fFileCont->ChangeDirectory(gSystem->WorkingDirectory()) ; 
+  fFileView->SetViewMode(kLVDetails); 
+  fFileCont->Sort(kSortByName) ; 
+
+  fTabF1b->AddFrame(fFileView, new TGLayoutHints(kLHintsTop | kLHintsExpandX | kLHintsExpandY, 5, 5, 5, 5) ) ; 
+
+  tf->AddFrame(fTabF1, fLayTab) ;
+ 
+  fFrameLow->AddFrame ( fTab, new TGLayoutHints(kLHintsBottom | kLHintsExpandX | kLHintsExpandY, 5, 5, 5, 5) ); 
+
+  AddFrame(fFrameLow, new TGLayoutHints (kLHintsExpandX|kLHintsExpandY) ) ; 
+
+  //
+  //   Map the window, set up the layout, etc. 
+  //
+
+  SetWMSizeHints(400, 350, 1000, 1000, 10, 10 ) ;      // set the smallest and biggest size of the Main frame
+} 
+
+
+// ======================================================================
+// ======================================================================
+
+MBrowser::~MBrowser()
+{
+  //delete  fPicCdup, fPicList, fPicDetail; 
+    delete fLayTab;
+    delete fLayMenuBar;
+    delete fLayMenuItem;
+    delete fFileView;
+    delete fFileCont;
+    delete fCdup;
+    delete fListMode;
+    delete fDetail;
+    delete fDir ;
+    delete fTabF1b;
+    delete fTabF1a;
+    delete fTabF1;
+    delete fTop3;
+    delete fTop2;
+    delete fTop1;
+    delete fTab;
+    delete fFrameTop;
+    delete fFrameLow;
+    delete fFileMenu;
+    delete fMenuBar;
+
+} 
+
+
+// ======================================================================
+// ======================================================================
+
+void MBrowser::CloseWindow()
+{
+   // Got close message for this MainFrame. Calls parent CloseWindow()
+   // (which destroys the window) and terminate the application.
+   // The close message is generated by the window manager when its close
+   // window menu item is selected.
+
+  delete this ; 
+}
+
+
+// ======================================================================
+// ======================================================================
+
+Bool_t MBrowser::InputFileSelected() 
+{
+    //
+    // Checks if there is a selected input root file
+    //
+    return fInputFile[0]!='\0';
+}
+
+
+// ======================================================================
+// ======================================================================
+
+void MBrowser::DisplError(const char *txt)
+{
+    Int_t retval;
+    new TGMsgBox(fClient->GetRoot(), this, "Error!", txt,
+                 kMBIconExclamation, 4, &retval);
+}
+
+void MBrowser::DisplWarning(const char *txt)
+{
+    Int_t retval;
+    new TGMsgBox(fClient->GetRoot(), this, "Warning!", txt,
+                 kMBIconExclamation, 4, &retval);
+}
+
+void MBrowser::DisplInfo(const char *txt)
+{
+    Int_t retval;
+    new TGMsgBox(fClient->GetRoot(), this, "Information!", txt,
+                 kMBIconExclamation, 4, &retval);
+}
+
+Bool_t MBrowser::ProcessMessage(Long_t msg, Long_t parm1, Long_t)
+{     
+  // Process events generated by the buttons in the frame.
+  
+  switch (GET_MSG(msg))
+  {
+  case kC_COMMAND:
+      switch (GET_SUBMSG(msg))
+      {
+      case kCM_BUTTON:
+
+          switch (parm1)
+          {
+          case M_PBUTTON_CDIR_UP :
+              //
+	      //  goto the parent directory
+              //
+              gSystem->ChangeDirectory("..") ;
+              fDir->RemoveEntry(1) ;
+              {
+                  const char *dir = gSystem->WorkingDirectory();
+
+                  fDir->AddEntry(dir, 1);
+                  fDir->MapSubwindows();
+                  fDir->Layout();
+
+                  fFileCont->ChangeDirectory(dir);
+                  fFileCont->DisplayDirectory();
+              }
+	      return kTRUE;
+	    
+	    case M_PBUTTON_LIST_MODE:
+	      fFileView->SetViewMode(kLVList) ; 
+              fDetail->SetState(kButtonUp) ;
+              return kTRUE;
+	      
+          case M_PBUTTON_DETAIL_MODE:
+              fFileView->SetViewMode(kLVDetails) ;
+              fListMode->SetState(kButtonUp) ;
+              return kTRUE;
+          }
+          return kTRUE;
+
+	case kCM_MENU:
+
+	  if (parm1==M_FILE_CLOSE)
+              CloseWindow();
+          return kTRUE;
+      }
+      return kTRUE;
+      
+  case kC_CONTAINER:
+      switch (GET_SUBMSG(msg)) {
+
+          //      case kCT_ITEMCLICK:
+          // 	printf ("itemclick\n");
+          //      break;
+
+      case kCT_ITEMDBLCLICK:
+          //
+          //  process the double click in the file view container
+          //
+
+          if (parm1 != kButton1)
+              return kTRUE;
+
+          if (fFileCont->NumSelected() != 1 )
+              return kTRUE;
+
+          //
+          //  one file selected
+          //
+          void *dummy = NULL;
+          const TGFileItem *item = (TGFileItem *)fFileCont->GetNextSelected(&dummy);
+
+          const char *str = item->GetItemName()->GetString();
+          const char *dir = gSystem->WorkingDirectory();
+
+          if (S_ISDIR(item->GetType()))   // file is directory
+          {
+              //
+              //  goto directory
+              //
+              fFileCont->ChangeDirectory(str);
+              gSystem->ChangeDirectory(str);
+
+              fDir->RemoveEntry(1);
+              fDir->AddEntry(dir, 1);
+              fDir->MapSubwindows();
+              fDir->Layout();
+              return kTRUE;
+          }
+
+          //
+          // file is no directory, is a file
+          //    determine the file type by extensions
+          //
+          const char *extension=strrchr(str, '.');
+
+
+          if (!extension)
+              return kTRUE;
+
+          if (!strcasecmp(extension, ".ps")) // postscript file
+          {
+              char *cmd = new char[strlen(dir)+strlen(str)+40];
+              sprintf(cmd, "gv %s/%s &", dir, str);
+              gSystem->Exec(cmd);
+              delete cmd;
+              return kTRUE;
+          }
+
+          if (!strcasecmp(extension, ".root"))
+          {
+              sprintf(fInputFile, "%s/%s", dir, str);
+              return kTRUE;
+          }
+          return kTRUE;
+      }
+  }
+  return kTRUE;
+} 
Index: trunk/MagicSoft/Mars/mmain/MBrowser.h
===================================================================
--- trunk/MagicSoft/Mars/mmain/MBrowser.h	(revision 714)
+++ trunk/MagicSoft/Mars/mmain/MBrowser.h	(revision 714)
@@ -0,0 +1,94 @@
+#ifndef MBROWSER_H
+#define MBROWSER_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+
+#ifndef ROOT_TGFrame
+#include <TGFrame.h>
+#endif
+
+class TGMenuBar;
+class TGPopupMenu;
+class TGTab;
+class TGTextButton;
+class TGListBox;
+class TGPictureButton;
+class TGFileContainer;
+class TGListView;
+
+class MBrowser : public TGTransientFrame
+{
+private:
+
+    //
+    // Create a main frame with a number of different buttons.
+    //
+
+    //   some member not connected with Gui
+
+    //  the things for the menu bar
+
+    TGMenuBar         *fMenuBar ;
+    TGPopupMenu       *fFileMenu ;
+
+    //
+    //   divide the Window in two different parts
+    //
+    TGCompositeFrame  *fFrameTop;   // top part of the main window
+    TGCompositeFrame  *fFrameLow;   // low part of the main window
+    TGTab             *fTab;        // different tabs in the low window
+
+    //
+    //   the things in the file selector
+    //
+    TGCompositeFrame  *fTabF1;     // first tab of low part
+    TGCompositeFrame  *fTabF1a;    // subpart of the file selector in low window
+    TGCompositeFrame  *fTabF1b;    // subpart of the file selector in low window
+    TGListBox         *fDir;
+    TGPictureButton   *fCdup;
+    TGPictureButton   *fListMode;
+    TGPictureButton   *fDetail;
+    TGFileContainer   *fFileCont;
+    TGListView        *fFileView;
+
+    //     Layout hints for different uses
+
+    TGLayoutHints     *fLayMenuBar;
+    TGLayoutHints     *fLayMenuItem;
+    TGLayoutHints     *fLayTab;
+
+    //     some icons and pictures often used
+
+    const TGPicture   *fPicCdup;
+    const TGPicture   *fPicList;
+    const TGPicture   *fPicDetail;
+
+protected:
+    Char_t fInputFile[256];
+
+    void DisplError(const char *txt);
+    void DisplWarning(const char *txt);
+    void DisplInfo(const char *txt);
+
+    TGHorizontalFrame *fTop1;
+    TGHorizontalFrame *fTop2;
+    TGHorizontalFrame *fTop3;
+
+ public: 
+     MBrowser(const TGWindow *main=NULL, const TGWindow *p=NULL,
+               const UInt_t w=500, const UInt_t h=500) ;
+
+     ~MBrowser();
+
+     void   CloseWindow();
+
+     Bool_t InputFileSelected();
+
+     virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
+} ; 
+
+#endif
+
+
Index: trunk/MagicSoft/Mars/mmain/MDataCheck.cc
===================================================================
--- trunk/MagicSoft/Mars/mmain/MDataCheck.cc	(revision 714)
+++ trunk/MagicSoft/Mars/mmain/MDataCheck.cc	(revision 714)
@@ -0,0 +1,95 @@
+#include "MDataCheck.h"
+
+#include <TGButton.h>  // TGTextButton
+
+ClassImp(MDataCheck)
+
+enum {
+  M_BUTTON_PEDADC,
+  M_BUTTON_CRADC,
+  M_BUTTON_PEDTDC,
+  M_BUTTON_CRTDC
+};
+
+MDataCheck::MDataCheck(const TGWindow *main, const TGWindow *p,
+                                 const UInt_t w, const UInt_t h)
+: MBrowser(main, p, w, h)
+{
+
+    fButPedADC = new TGTextButton(fTop2, "ADC Spectra of Pedestals", M_BUTTON_PEDADC );
+    fButPedADC->Associate(this) ;
+    fTop2->AddFrame (fButPedADC, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
+
+    fButCrADC = new TGTextButton(fTop2, "ADC Specta of Cosmics", M_BUTTON_CRADC );
+    fButCrADC->Associate(this) ;
+    fTop2->AddFrame (fButCrADC, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
+
+    fButPedTDC = new TGTextButton(fTop3, "TDC Spectra of Pedestals", M_BUTTON_PEDTDC );
+    fButPedTDC->Associate(this) ;
+    fTop3->AddFrame (fButPedTDC, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
+
+    fButCrTDC = new TGTextButton(fTop3, "TDC Specta of Cosmics", M_BUTTON_CRTDC );
+    fButCrTDC->Associate(this) ;
+    fTop3->AddFrame (fButCrTDC, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
+
+    MapSubwindows();
+
+    Layout();
+
+    SetWindowName("DataCheck Window");
+    SetIconName("DataCheck");
+
+    MapWindow();
+}
+
+MDataCheck::~MDataCheck()
+{
+    delete fButPedADC;
+    delete fButCrADC;
+    delete fButPedTDC;
+    delete fButCrTDC;
+} 
+
+// ======================================================================
+
+Bool_t MDataCheck::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_PEDADC:
+    case M_BUTTON_CRADC:
+    case M_BUTTON_PEDTDC:
+    case M_BUTTON_CRTDC:
+        if (!InputFileSelected())
+        {     
+            DisplError("No Input (root) File selected!");
+            return kTRUE;
+        }
+
+        switch (parm1)
+        {
+        case M_BUTTON_PEDADC:
+            fViewAdc.AdcSpectra(fInputFile, "PedEvents" ) ;
+            return kTRUE;
+
+        case M_BUTTON_CRADC:
+            fViewAdc.AdcSpectra(fInputFile, "Events" ) ;
+            return kTRUE;
+
+        case M_BUTTON_PEDTDC:
+            // fOctober.PedTdcSpectra(fInputFile) ;
+            return kTRUE;
+
+        case M_BUTTON_CRTDC:
+            return kTRUE;
+        }
+        return kTRUE;
+    }
+
+    return MBrowser::ProcessMessage(msg, parm1, parm2);
+} 
Index: trunk/MagicSoft/Mars/mmain/MDataCheck.h
===================================================================
--- trunk/MagicSoft/Mars/mmain/MDataCheck.h	(revision 714)
+++ trunk/MagicSoft/Mars/mmain/MDataCheck.h	(revision 714)
@@ -0,0 +1,46 @@
+#ifndef MDATACHECK_H
+#define MDATACHECK_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+
+#ifndef ROOT_TGFrame
+#include <TGFrame.h>
+#endif
+
+#ifndef MVIEWADCSPECTRA_H
+#include "MViewAdcSpectra.h"
+#endif
+
+#ifndef MBROWSER_H
+#include "MBrowser.h"
+#endif
+
+class TGTextButton;
+
+class MDataCheck : public MBrowser
+{
+private:
+
+    MViewAdcSpectra fViewAdc;
+
+    TGTextButton   *fButPedADC;
+    TGTextButton   *fButPedTDC;
+    TGTextButton   *fButCrADC;
+    TGTextButton   *fButCrTDC;
+
+public:
+    MDataCheck(const TGWindow *main=NULL, const TGWindow *p=NULL,
+                    const UInt_t w=500, const UInt_t h=500) ;
+
+    ~MDataCheck();
+
+    Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
+
+    ClassDef(MDataCheck, 0)
+};
+
+#endif
+
+
Index: trunk/MagicSoft/Mars/mmain/MEvtDisp.cc
===================================================================
--- trunk/MagicSoft/Mars/mmain/MEvtDisp.cc	(revision 714)
+++ trunk/MagicSoft/Mars/mmain/MEvtDisp.cc	(revision 714)
@@ -0,0 +1,90 @@
+#include "MEvtDisp.h"
+
+#include <TGButton.h>       // TGTextButton
+
+#include "MGFadcDisp.h"
+
+ClassImp(MEvtDisp)
+
+enum {
+  M_BUT_DISP1_EVT, 
+  M_BUT_DISP1_PED, 
+  M_BUT_DISP1_CAL, 
+};
+
+MEvtDisp::MEvtDisp(const TGWindow *main, const TGWindow *p,
+                                 const UInt_t w, const UInt_t h)
+: MBrowser(main, p, w, h)
+{
+
+    fButFadcDispEvts = new TGTextButton(fTop1, "FADC Disp for Events", M_BUT_DISP1_EVT );
+    fButFadcDispEvts->Associate(this) ;
+    fTop1->AddFrame (fButFadcDispEvts, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
+
+    fButFadcDispPed  = new TGTextButton(fTop1, "FADC Disp for PedEvts", M_BUT_DISP1_PED );
+    fButFadcDispPed->Associate(this) ;
+    fTop1->AddFrame (fButFadcDispPed, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
+
+    fButFadcDispCal  = new TGTextButton(fTop1, "FADC Disp for CalEvts", M_BUT_DISP1_CAL );
+    fButFadcDispCal->Associate(this) ;
+    fTop1->AddFrame (fButFadcDispCal, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
+
+    MapSubwindows();
+
+    Layout();
+
+    SetWindowName("EventDispMain");
+    SetIconName("EventDispMain");
+
+    MapWindow();
+} 
+
+MEvtDisp::~MEvtDisp()
+{
+    delete fButFadcDispCal; 
+    delete fButFadcDispPed; 
+    delete fButFadcDispEvts;
+} 
+
+// ======================================================================
+
+Bool_t MEvtDisp::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_BUT_DISP1_EVT:
+    case M_BUT_DISP1_PED:
+    case M_BUT_DISP1_CAL:
+        if (!InputFileSelected())
+        {        
+            DisplError("No Input (root) File selected!");
+            return kTRUE;
+        }
+
+        switch (parm1)
+        {
+        case M_BUT_DISP1_EVT:
+            new MGFadcDisp(fInputFile, "Events",
+                           fClient->GetRoot(), this, 600, 500);
+            return kTRUE;
+
+        case M_BUT_DISP1_PED:
+            new MGFadcDisp( fInputFile , "PedEvts",
+                            fClient->GetRoot(), this, 600, 500 ) ;
+            return kTRUE;
+
+        case M_BUT_DISP1_CAL:
+            new MGFadcDisp( fInputFile , "CalEvts",
+                            fClient->GetRoot(), this, 600, 500 ) ;
+            return kTRUE;
+        }
+        return kTRUE;
+    }
+
+    return MBrowser::ProcessMessage(msg, parm1, parm2);
+} 
Index: trunk/MagicSoft/Mars/mmain/MEvtDisp.h
===================================================================
--- trunk/MagicSoft/Mars/mmain/MEvtDisp.h	(revision 714)
+++ trunk/MagicSoft/Mars/mmain/MEvtDisp.h	(revision 714)
@@ -0,0 +1,39 @@
+#ifndef MEVTDISP_H
+#define MEVTDISP_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+
+#ifndef ROOT_TGFrame
+#include <TGFrame.h>
+#endif
+
+#ifndef MBROWSER_H
+#include "MBrowser.h"
+#endif
+
+class TGTextButton;
+
+class MEvtDisp : public MBrowser
+{ 
+private:
+  
+  TGTextButton *fButFadcDispEvts;
+  TGTextButton *fButFadcDispPed;
+  TGTextButton *fButFadcDispCal;
+
+public:
+    MEvtDisp(const TGWindow *main=NULL, const TGWindow *p=NULL,
+                    const UInt_t w=500, const UInt_t h=500) ;
+
+    ~MEvtDisp();
+
+    Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
+
+    ClassDef(MEvtDisp, 0)
+};
+
+#endif
+
+
Index: trunk/MagicSoft/Mars/mmain/MGPrototyp.cc
===================================================================
--- trunk/MagicSoft/Mars/mmain/MGPrototyp.cc	(revision 714)
+++ trunk/MagicSoft/Mars/mmain/MGPrototyp.cc	(revision 714)
@@ -0,0 +1,450 @@
+#include "MGPrototyp.h"
+
+#include <TSystem.h>        // gSystem
+
+#include <TGTab.h>          // TGTab
+#include <TGMenu.h>         // TGPopupMenu
+#include <TGButton.h>       // TGTextButton
+#include <TGMsgBox.h>       // TGMsgBox
+#include <TGListBox.h>      // TGListBox
+#include <TGFSContainer.h>  // TGFileContainer
+#include <TGSplitter.h>    // TGHorizontal3DLine
+#include <TGTextEntry.h> 
+#include <TGLabel.h>       // TGLabel
+
+
+// FIXME: Move to MAGIC.h
+#define S_ISDIR(m) (((m)&(0170000)) == (0040000))  
+
+ClassImp(MGPrototyp)
+
+enum CommandPrototyp {
+  M_FILE_CLOSE , 
+  M_BUTTON_ACTION, 
+
+  M_FILERESET, 
+  M_PBUTTON_CDIR_UP, 
+  M_PBUTTON_LIST_MODE, 
+  M_PBUTTON_DETAIL_MODE 
+} ; 
+
+
+MGPrototyp::MGPrototyp(const TGWindow *p, const TGWindow *main, 
+                            UInt_t w, UInt_t h ) 
+        : TGTransientFrame(p, main, w, h ) 
+{
+  //
+  //    Main window to controll the october test
+  //
+
+  //    set non-gui members to starting values 
+
+  sprintf ( fInputFile, "\n" ) ; 
+
+  //
+  //    First create the MenuBar.   
+  //
+
+  //     Layout objects for menue. 
+
+  fLayMenuBar = new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX, 2, 2, 2, 2 ) ; 
+  fLayMenuItem = new TGLayoutHints ( kLHintsTop | kLHintsLeft , 0, 4, 0, 0 ) ; 
+  
+  //  crate the menu bar
+
+  fFileMenu = new TGPopupMenu ( fClient->GetRoot() ) ; 
+  fFileMenu->AddEntry ("Close", M_FILE_CLOSE ) ; 
+  fFileMenu->Associate(this) ; 
+  
+  //  the button messages are handled by main frame (this) 
+
+  fMenuBar = new TGMenuBar ( this, 1, 1, kHorizontalFrame ) ; 
+  fMenuBar->AddPopup("File", fFileMenu, fLayMenuItem ) ;   
+  AddFrame(fMenuBar, fLayMenuBar ) ; 
+  
+  fLineSep1 = new TGHorizontal3DLine(this) ; 
+  AddFrame(fLineSep1, new TGLayoutHints(kLHintsTop | kLHintsExpandX) );
+
+  
+  //
+  //    Create the top window with a lot of buttons 
+  //
+
+  fFrameTop = new TGCompositeFrame (this, 300,100, kVerticalFrame ) ; 
+  
+  fTop1 = new TGHorizontalFrame (fFrameTop, 300, 100 ) ; 
+
+  fButAction = new TGTextButton(fTop1, "ACTION", M_BUTTON_ACTION );
+  fButAction->Associate(this) ;   
+  fTop1->AddFrame (fButAction, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
+  
+  fFrameTop->AddFrame (fTop1, new TGLayoutHints(kLHintsCenterX, 10, 10, 5, 5) );
+
+  AddFrame(fFrameTop, new TGLayoutHints (kLHintsTop ) ) ;   
+
+  //   a line between top and low frame
+  
+  fLineSep2 = new TGHorizontal3DLine(this) ; 
+  AddFrame(fLineSep2, new TGLayoutHints(kLHintsTop | kLHintsExpandX) );
+
+  //
+  //    Create the low window with a tabs in it
+  //
+
+  fFrameLow = new TGCompositeFrame (this, 300,100, kHorizontalFrame ) ; 
+  
+  fLayTab = new TGLayoutHints ( kLHintsExpandX   , 5, 5, 5, 5 ) ;
+
+  //    create the first tab
+
+  fTab = new TGTab ( fFrameLow, 400, 400 ) ;   
+
+  TGCompositeFrame *tf = fTab->AddTab("Input File") ; 
+  
+  fTabF1 = new TGCompositeFrame (tf, 100, 100, kHorizontalFrame) ; 
+  //  tf->AddFrame(fTabF1, fLayTab ) ; 
+
+  fTabF1a = new TGCompositeFrame (tf, 100, 100, kHorizontalFrame) ; 
+  tf->AddFrame(fTabF1a,  new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX, 5, 5, 5, 5 ) ) ; 
+
+  fTabF1b = new TGCompositeFrame (tf, 100, 100, kHorizontalFrame) ; 
+  tf->AddFrame(fTabF1b,  new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX, 5, 5, 5, 5 ) ) ; 
+
+  fTabF1c = new TGCompositeFrame (tf, 100, 100, kVerticalFrame) ; 
+  //  tf->AddFrame(fTabF1c,  new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX | kLHintsExpandY  , 5, 5, 5, 5 ) ) ; 
+  tf->AddFrame(fTabF1c,  new TGLayoutHints ( kLHintsExpandX | kLHintsExpandY  , 5, 5, 5, 5 ) ) ; 
+  
+  //   the items in the first subframe
+
+  fLabFileName = new TGLabel(fTabF1a, new TGString("selected File:") );
+  fTabF1a->AddFrame( fLabFileName, new TGLayoutHints (kLHintsLeft, 10, 10, 10, 10)) ; 
+
+  fTxtFileName = new TGTextEntry(fTabF1a, fTxtBufFileName = new TGTextBuffer(256) );
+  fTxtFileName->Resize(60, fTxtFileName->GetDefaultHeight());
+  fTabF1a->AddFrame(fTxtFileName, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 5, 5, 5, 5)); 
+
+  fButFileReset = new TGTextButton (fTabF1a, "Reset", M_FILERESET ) ;
+  fButFileReset->Associate(this) ; 
+  fTabF1a->AddFrame (fButFileReset, new TGLayoutHints (kLHintsRight, 10, 10, 10, 10  ) ) ; 
+  
+  
+  
+  //   the items in the second subfraem
+
+  fLabDir = new TGLabel(fTabF1b, new TGString("Directory:") );
+  fTabF1b->AddFrame( fLabDir, new TGLayoutHints (kLHintsLeft, 10, 10, 10, 10)) ; 
+
+  fDir = new TGListBox(fTabF1b, -1) ; 
+  fDir->Resize(350,20) ;
+  char temp[100] ; 
+  //  sprintf ( temp, "%s", START_DIRECTORY ) ; 
+  sprintf ( temp, "%s", gSystem->WorkingDirectory()  ) ; 
+  fDir->AddEntry(temp, 1) ; 
+  fTabF1b->AddFrame( fDir, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX, 5, 5, 5, 5 ) ) ; 
+
+
+  fPicCdup = fClient->GetPicture("tb_uplevel.xpm") ; 
+  fCdup = new TGPictureButton(fTabF1b, fPicCdup, M_PBUTTON_CDIR_UP ) ; 
+  fCdup->SetToolTipText("One Level up!") ; 
+  fCdup->Associate(this) ; 
+  fTabF1b->AddFrame (fCdup, new TGLayoutHints(kLHintsLeft | kLHintsTop, 5, 5, 5, 5) ) ; 
+
+  fPicList = fClient->GetPicture("tb_list.xpm") ; 
+  fListMode = new TGPictureButton(fTabF1b, fPicList, M_PBUTTON_LIST_MODE ) ; 
+  fListMode->SetToolTipText("List Mode") ; 
+  fListMode->Associate(this) ; 
+  fListMode->SetState(kButtonUp) ; 
+  fListMode->AllowStayDown(kTRUE) ; 
+  fListMode->AllowStayDown(kTRUE) ;  fTabF1b->AddFrame (fListMode, new TGLayoutHints(kLHintsLeft | kLHintsTop, 5, 5, 5, 5) ) ;
+
+  fPicDetail = fClient->GetPicture("tb_details.xpm") ; 
+  fDetail = new TGPictureButton(fTabF1b, fPicDetail, M_PBUTTON_DETAIL_MODE ) ; 
+  fDetail->SetToolTipText("Details Mode") ; 
+  fDetail->Associate(this) ; 
+  fDetail->SetState(kButtonEngaged) ; 
+  fDetail->AllowStayDown(kTRUE) ; 
+  fTabF1b->AddFrame (fDetail, new TGLayoutHints(kLHintsLeft | kLHintsTop, 5, 5, 5, 5) ) ; 
+
+  // the items in the third subframe
+
+  fFileView = new TGListView(fTabF1c, 540, 380 ) ; 
+  fFileCont = new TGFileContainer(fFileView->GetViewPort(), 100, 100,
+				  kVerticalFrame, fgWhitePixel) ; 
+
+  fFileCont->Associate(this) ; 
+  fFileView->GetViewPort()->SetBackgroundColor(fgWhitePixel) ; 
+  fFileView->SetContainer(fFileCont) ; 
+  fFileCont->SetFilter("*") ; 
+  //  fFileCont->ChangeDirectory(START_DIRECTORY) ; 
+  fFileCont->ChangeDirectory(gSystem->WorkingDirectory()) ; 
+  fFileView->SetViewMode(kLVDetails); 
+  fFileCont->Sort(kSortByName) ; 
+  
+  fTabF1c->AddFrame(fFileView, new TGLayoutHints(kLHintsTop | kLHintsExpandX | kLHintsExpandY, 5, 5, 5, 5) ) ; 
+
+  tf->AddFrame(fTabF1, fLayTab) ;
+ 
+  fFrameLow->AddFrame ( fTab, new TGLayoutHints(kLHintsBottom | kLHintsExpandX | kLHintsExpandY, 5, 5, 5, 5) ); 
+
+  AddFrame(fFrameLow, new TGLayoutHints (kLHintsExpandX|kLHintsExpandY) ) ; 
+
+  //
+  //   Map the window, set up the layout, etc. 
+  //
+
+  SetWMSizeHints(200, 250, 1000, 1000, 10, 10 ) ;      // set the smallest and biggest size of the Main frame
+
+  MapSubwindows();
+  
+  Layout();
+  
+  SetWindowName("Prototyp");
+  SetIconName("Prototyp");
+  
+  MapWindow();
+
+} 
+
+
+// ======================================================================
+// ======================================================================
+
+MGPrototyp::~MGPrototyp()
+{
+  //delete  fPicCdup, fPicList, fPicDetail; 
+    delete fLayTab;
+    delete fLayMenuBar;
+    delete fLayMenuItem;
+    delete fFileView;
+    delete fFileCont;
+    delete fCdup;
+    delete fListMode;
+    delete fDetail;
+    delete fDir ;
+    delete fLabDir ; 
+
+    delete fButFileReset ; 
+    delete fTxtFileName  ; 
+    delete fLabFileName  ; 
+    
+    delete fTabF1c;
+    delete fTabF1b;
+    delete fTabF1a;
+    delete fTabF1;
+    delete fButAction; 
+    delete fTop1;
+    delete fTab;
+
+    delete fFrameTop;
+    delete fFrameLow;
+    delete fLineSep2 ; 
+    delete fLineSep1 ; 
+
+    delete fFileMenu;
+    delete fMenuBar;
+
+} 
+
+
+// ======================================================================
+// ======================================================================
+
+void MGPrototyp::CloseWindow()
+{
+   // Got close message for this MainFrame. Calls parent CloseWindow()
+   // (which destroys the window) and terminate the application.
+   // The close message is generated by the window manager when its close
+   // window menu item is selected.
+
+  delete this ; 
+}
+
+
+// ======================================================================
+// ======================================================================
+
+Bool_t MGPrototyp::InputFileSelected() 
+{
+  //   Checks if there is a selected input root file
+   
+  if ( strcmp ( fInputFile, "\n") == 0 )
+    { 
+      return ( kFALSE ) ; 
+    } 
+  
+  return (kTRUE) ; 
+} 
+
+
+// ======================================================================
+// ======================================================================
+
+Bool_t MGPrototyp::ProcessMessage(Long_t msg, Long_t parm1, Long_t)
+{     
+  // Process events generated by the buttons in the frame.
+  
+  Int_t   buttons = 4, retval = 0 ; 
+  Char_t  wort[100] ;
+  Char_t  extens[5] ;
+  Char_t  command[110] ;
+ 
+  TGFileItem *item ;     // to process items in the file view container
+  void *np = NULL ;      // null pointer
+
+  switch (GET_MSG(msg)) 
+    {
+    case kC_COMMAND:
+      switch (GET_SUBMSG(msg)) 
+	{
+	case kCM_BUTTON:
+	  
+	  switch (parm1)
+	    {  
+
+	    case M_BUTTON_ACTION:
+	      	
+	      if ( InputFileSelected() == kFALSE ) {              // it is not selected
+		
+		new TGMsgBox(fClient->GetRoot(), this, "ERROR!", 
+			     "No Input (root) File selected!", kMBIconExclamation, buttons, &retval);
+		break ; 
+	      }      
+	      
+	      new TGMsgBox(fClient->GetRoot(), this, "INFORMATION!", 
+			   "Put Intelligence here!!!", kMBIconExclamation, buttons, &retval);
+
+	      break ; 
+		
+
+	    case M_FILERESET:
+	      
+	      sprintf ( fInputFile, "\n" ) ; 
+	      fTxtFileName->SetText( fInputFile ) ; 
+	      
+	      break; 
+	    case M_PBUTTON_CDIR_UP :
+
+	      //  goto the parent directory
+	      
+	      gSystem->ChangeDirectory("..") ; 
+	      fDir->RemoveEntry(1) ; 
+	      sprintf (wort, "%s", gSystem->WorkingDirectory() ) ; 
+	      fDir->AddEntry(wort,1) ; 
+	      fDir->MapSubwindows() ; 
+	      fDir->Layout() ; 
+	      fFileCont->ChangeDirectory( wort ) ; 
+	      fFileCont->DisplayDirectory() ; 
+	      
+	      break ; 
+	    
+	    case M_PBUTTON_LIST_MODE:
+	      fFileView->SetViewMode(kLVList) ; 
+	      fDetail->SetState(kButtonUp) ; 
+	      
+	      break ; 
+	      
+	    case M_PBUTTON_DETAIL_MODE:
+	      fFileView->SetViewMode(kLVDetails) ; 
+	      fListMode->SetState(kButtonUp) ; 
+	      
+	      break ;
+	      
+	    default:
+	      break ;
+	    } 
+
+	case kCM_MENU:
+
+	  switch (parm1) {
+	  case M_FILE_CLOSE:
+	    CloseWindow() ; 
+
+	    break; 
+	  }
+	  break ;
+	  
+	default:
+	  break ;
+	  
+	}
+      
+    case kC_CONTAINER: 
+      switch (GET_SUBMSG(msg)) {
+	
+	//      case kCT_ITEMCLICK:
+	// 	printf ("itemclick\n"); 
+	//      break; 
+	
+      
+      case kCT_ITEMDBLCLICK: 
+	//
+	//  process the double click in the file view container
+	//
+	
+	if ( parm1 == kButton1) {
+	  if ( fFileCont->NumSelected() == 1 ) {   
+	    //
+	    //  one file selected
+	    //	  
+	    item = (TGFileItem *) fFileCont->GetNextSelected(&np) ; 
+	    
+	    if ( S_ISDIR(item->GetType()) )   // file is directory
+	      {  
+		//  goto directory 
+		
+		sprintf (wort, "%s", item->GetItemName()->GetString()) ;
+		fFileCont->ChangeDirectory ( wort ) ; 
+		gSystem->ChangeDirectory( wort ) ; 
+		
+		sprintf (wort, "%s", gSystem->WorkingDirectory() ) ; 
+		fDir->RemoveEntry(1) ; 
+		fDir->AddEntry( wort, 1 ) ; 
+		fDir->MapSubwindows() ; 
+		fDir->Layout() ; 
+	      }
+	    else                              // file is no directory, is a file 
+	      { 
+		sprintf (wort, "%s", item->GetItemName()->GetString() ) ; 
+	    
+		//    determine the file type by extensions
+		
+		for (Int_t i = 0 ; i<5; i++) 
+		  extens[i] = '\0' ; 
+		
+		for ( Int_t i=0; wort[i] != '\0'; i++) {
+		  if ( wort[i] == '.') {
+		    strncpy (extens, &wort[i+1], 4 ) ; 
+		    break ; 
+		  }
+		}
+		
+		if ( ! strcmp(extens, "ps") ) {              //     postscript file
+		  sprintf ( command, "gv %s/%s &", 
+			    gSystem->WorkingDirectory(), 
+			    wort ) ; 
+		  gSystem->Exec(command) ; 
+		  break ; 
+		}
+		else if  ( ! strcmp(extens, "root") ) {      //     root file
+		  sprintf ( fInputFile, "%s/%s" , gSystem->WorkingDirectory(), wort ) ;  
+		  fTxtFileName->SetText( fInputFile ) ;
+
+		  break ; 
+		}
+		
+	      } 
+	  }
+	}
+	break; 
+	
+      default:
+	break ;
+      }
+      
+      
+      
+    default:
+      break;
+    }
+  return kTRUE;
+} 
Index: trunk/MagicSoft/Mars/mmain/MGPrototyp.h
===================================================================
--- trunk/MagicSoft/Mars/mmain/MGPrototyp.h	(revision 714)
+++ trunk/MagicSoft/Mars/mmain/MGPrototyp.h	(revision 714)
@@ -0,0 +1,101 @@
+#ifndef MGPROTOTYP_H
+#define MGPROTOTYP_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+
+#ifndef ROOT_TGFrame
+#include <TGFrame.h>
+#endif
+
+class TGMenuBar;
+class TGPopupMenu;
+class TGTab;
+class TGTextButton;
+class TGListBox;
+class TGPictureButton;
+class TGFileContainer;
+class TGListView;
+class TGHorizontal3DLine;
+class TGLabel ; 
+class TGTextEntry ; 
+class TGTextBuffer; 
+
+class MGPrototyp : public TGTransientFrame {
+ private:
+  
+  //
+  // Create a main frame with a number of different buttons.
+  //
+
+  //   some member not connected with Gui 
+  
+  Char_t            fInputFile[256] ; 
+
+  //  the things for the menu bar 
+    
+  TGMenuBar         *fMenuBar ; 
+  TGPopupMenu       *fFileMenu ;
+  TGHorizontal3DLine *fLineSep1, *fLineSep2 ; 
+
+
+  //   divide the Window in two different parts
+  
+  TGCompositeFrame  *fFrameTop ;   // top part of the main window
+  TGCompositeFrame  *fFrameLow ;   // low part of the main window
+  TGTab             *fTab      ;   // different tabs in the low window
+  
+  //     the horizontal frame in the top part
+
+  TGHorizontalFrame *fTop1 ; 
+  
+  //   the buttons in the Top Part
+  
+  TGTextButton      *fButAction ; 
+  
+  //   the things in the file selector
+
+  TGCompositeFrame  *fTabF1 ;                       // first tab of low part 
+  TGCompositeFrame  *fTabF1a, *fTabF1b, *fTabF1c ;  // subpart of the file selector in low window
+
+  TGLabel           *fLabFileName ; 
+  TGTextEntry       *fTxtFileName ; 
+  TGTextBuffer      *fTxtBufFileName ; //!
+  TGTextButton      *fButFileReset ; 
+ 
+  TGLabel           *fLabDir ; 
+  TGListBox         *fDir ; 
+  TGPictureButton   *fCdup, *fListMode, *fDetail ; 
+  TGFileContainer   *fFileCont ; 
+  TGListView        *fFileView ;
+
+  //     Layout hints for different uses 
+   
+  TGLayoutHints     *fLayMenuBar, *fLayMenuItem ; 
+  TGLayoutHints     *fLayTab ; 
+  
+  //     some icons and pictures often used
+  
+  const TGPicture   *fPicCdup;   //!
+  const TGPicture   *fPicList;   //!
+  const TGPicture   *fPicDetail; //!
+  
+ public: 
+  MGPrototyp(const TGWindow *p, const TGWindow *main, UInt_t w, UInt_t h) ;
+  
+  ~MGPrototyp(); 
+  
+  void   CloseWindow()  ; 
+
+  Bool_t InputFileSelected() ; 
+  
+  Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
+
+  ClassDef(MGPrototyp, 0)
+
+} ; 
+
+#endif
+
+
Index: trunk/MagicSoft/Mars/mmain/MMars.cc
===================================================================
--- trunk/MagicSoft/Mars/mmain/MMars.cc	(revision 714)
+++ trunk/MagicSoft/Mars/mmain/MMars.cc	(revision 714)
@@ -0,0 +1,235 @@
+#include "MMars.h"
+
+#include <TApplication.h>  // gROOT->GetApplication()->...
+
+#include <TGTab.h>         // TGTab
+#include <TGMenu.h>        // TGPopupMenu
+#include <TGMsgBox.h>      // TGMsgBox
+#include <TGButton.h>      // TGPictureButton
+#include <TGSplitter.h>    // TGHorizontal3DLine
+
+#include "MEvtDisp.h"
+#include "MDataCheck.h"
+#include "MMonteCarlo.h"
+
+#include "MGPrototyp.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 
+} ; 
+
+
+MMars::MMars(/*const TGWindow *p,*/ UInt_t w, UInt_t h)
+  : TGMainFrame(gClient->GetRoot(), w, h)
+{ 
+  //    First create the MenuBar.   
+  
+  //     Layout objects for menue. 
+
+  fLayMenuBar = new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX, 2, 2, 2, 2 ) ; 
+  fLayMenuItem = new TGLayoutHints ( kLHintsTop | kLHintsLeft , 0, 4, 0, 0 ) ; 
+  
+  //  crate the menu bar
+  
+  fFileMenu = new TGPopupMenu ( fClient->GetRoot() ) ; 
+  fFileMenu->AddEntry ("Exit", M_FILE_EXIT ) ; 
+  fFileMenu->Associate(this) ; 
+  
+  //  the button messages are handled by main frame (this) 
+  
+  fMenuBar = new TGMenuBar ( this, 1, 1, kHorizontalFrame ) ; 
+  fMenuBar->AddPopup("File", fFileMenu, fLayMenuItem ) ;   
+  AddFrame(fMenuBar, fLayMenuBar ) ; 
+
+  fLineSep = new TGHorizontal3DLine(this) ; 
+  AddFrame(fLineSep, new TGLayoutHints(kLHintsTop | kLHintsExpandX) );
+  
+  //   set up the top part of the main window with the logos
+
+  fTop = new TGHorizontalFrame (this, 300, 100 ) ;
+
+  fPicMagic = new TGPictureButton(fTop, 
+                                  gClient->GetPicture("magiclogo.xpm"), M_PICTURE_MAGIC );
+  fPicMagic->Associate(this) ; 
+  fTop->AddFrame ( fPicMagic, new TGLayoutHints(kLHintsLeft, 10., 10., 20., 10.) ) ; 
+
+  fPicMars = new TGPictureButton(fTop, 
+				 gClient->GetPicture("marslogo.xpm"), M_PICTURE_MARS );
+  fPicMars->Associate(this) ;
+  fTop->AddFrame ( fPicMars, new TGLayoutHints(kLHintsLeft, 10., 10., 10., 10.) ) ; 
+
+  AddFrame(fTop, new TGLayoutHints(kLHintsTop | kLHintsExpandX ) );  
+  
+  //  a seperator 
+
+  fLineSep2 = new TGHorizontal3DLine(this) ; 
+  AddFrame(fLineSep2, new TGLayoutHints(kLHintsTop | kLHintsExpandX) );
+
+  //   the low part of the frame 
+
+  fLow = new TGHorizontalFrame (this, 300, 100 ) ;
+
+  //    create the first tab
+
+  fTab = new TGTab ( fLow, 400, 400 ) ;   
+
+  TGCompositeFrame *tf = fTab->AddTab("Control") ; 
+ 
+  fTabF1 = new TGVerticalFrame (tf, 300, 100) ; 
+
+  tf->AddFrame(fTabF1, new TGLayoutHints(kLHintsTop | kLHintsExpandX) ) ; 
+
+  //     the buttons to go in the new window
+
+  fTabF2 = new TGVerticalFrame (tf, 300, 100) ; 
+  
+  fButLayout  = new TGLayoutHints(kLHintsTop | kLHintsCenterX , 10, 10, 10, 10) ; 
+
+  fButEvtDisp = new TGTextButton(fTabF2, "EventDisplay", M_BUTTON_EVTDISP  );
+  fButEvtDisp->Associate(this) ;  
+  fTabF2->AddFrame(fButEvtDisp, fButLayout ) ; 
+ 
+  fButDataCheck = new TGTextButton(fTabF2, "Data Check", M_BUTTON_DATACHECK  );
+  fButDataCheck->Associate(this) ;
+  fTabF2->AddFrame(fButDataCheck, fButLayout ) ; 
+
+  fButAnalys = new TGTextButton(fTabF2, "Analysis", M_BUTTON_ANALYSE  );
+  fButAnalys->Associate(this) ;
+  fTabF2->AddFrame(fButAnalys, fButLayout ) ; 
+
+  fButMonteCarlo = new TGTextButton(fTabF2, "MonteCarlo", M_BUTTON_MONTECARLO  );
+  fButMonteCarlo->Associate(this) ;
+  fTabF2->AddFrame(fButMonteCarlo, fButLayout ) ; 
+
+
+   
+
+  tf->AddFrame(fTabF2, new TGLayoutHints(kLHintsTop | kLHintsExpandX) ) ; 
+  
+  
+
+  fLow->AddFrame ( fTab, new TGLayoutHints(kLHintsBottom | kLHintsExpandX | kLHintsExpandY, 5, 5, 5, 5) );   
+  AddFrame(fLow, new TGLayoutHints(kLHintsTop | kLHintsExpandX ) );
+  
+  //   Map the window, set up the layout, etc. 
+  
+  SetWMSizeHints(400, 650, 1000, 1000, 10, 10 ) ;  // set the smallest and biggest size of the Main frame
+  
+  MapSubwindows();
+  
+  Layout();
+  
+  SetWindowName("MARS Main Window");
+  SetIconName("MARS");
+  
+  MapWindow();
+
+} 
+
+// ======================================================================
+
+MMars::~MMars()
+{
+  
+    delete fButLayout;
+    delete fLayMenuBar;
+    delete fLayMenuItem;
+    delete fButEvtDisp;
+    delete fButDataCheck;
+    delete fButAnalys;
+    delete fButMonteCarlo;
+    delete fPicMagic;
+    delete fPicMars;
+    delete fTabF1;
+    delete fTabF2;
+    delete fTab;
+    delete fLow;
+    delete fTop;
+    delete fLineSep2;
+    delete fLineSep;
+    delete fFileMenu;
+    delete fMenuBar;
+}  
+// ======================================================================
+
+void MMars::CloseWindow()
+{
+   // Got close message for this MainFrame. Calls parent CloseWindow()
+   // (which destroys the window) and terminate the application.
+   // The close message is generated by the window manager when its close
+   // window menu item is selected.
+
+   TGMainFrame::CloseWindow();
+   gROOT->GetApplication()->Terminate(0)  ; 
+}
+
+void MMars::DisplWarning(const char *txt)
+{
+    Int_t retval;
+    new TGMsgBox(fClient->GetRoot(), this,
+                 "WARNING!", txt,
+                 kMBIconExclamation, 4, &retval);
+}
+
+Bool_t MMars::ProcessMessage(Long_t msg, Long_t parm1, Long_t)
+{     
+    // Process events generated by the buttons in the frame.
+
+    switch (GET_MSG(msg))
+    {
+    case kC_COMMAND:
+        switch (GET_SUBMSG(msg))
+        {
+        case kCM_BUTTON:
+
+            switch (parm1)
+            {
+
+            case M_BUTTON_EVTDISP:
+                new MEvtDisp(this);
+                return kTRUE;
+
+            case M_BUTTON_DATACHECK:
+                new MDataCheck(this);
+                return kTRUE;
+
+            case M_BUTTON_ANALYSE:
+                DisplWarning("Analysis not yet implemented!");
+                return kTRUE;
+
+            case M_BUTTON_MONTECARLO:
+                new MMonteCarlo(this);
+                return kTRUE;
+
+            case M_PICTURE_MAGIC:
+                DisplWarning("Please open a Netscape to the MAGIC homepage");
+                return kTRUE;
+
+            case M_PICTURE_MARS:
+                DisplWarning("Please open a Netscape to the MARS homepage");
+                return kTRUE;
+
+            }
+
+	case kCM_MENU:
+            if (parm1!=M_FILE_EXIT)
+                return kTRUE;
+
+            CloseWindow() ;
+            return kTRUE;
+	}
+    }
+
+    return kTRUE;
+}
Index: trunk/MagicSoft/Mars/mmain/MMars.h
===================================================================
--- trunk/MagicSoft/Mars/mmain/MMars.h	(revision 714)
+++ trunk/MagicSoft/Mars/mmain/MMars.h	(revision 714)
@@ -0,0 +1,73 @@
+#ifndef MMARS_H
+#define MMARS_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+
+#ifndef ROOT_TGFrame
+#include <TGFrame.h>
+#endif
+
+class TGTab;
+class TGMenuBar;
+class TGPopupMenu;
+class TGTextButton;
+class TGPictureButton;
+class TGHorizontal3DLine;
+
+class MMars : public TGMainFrame {
+ private:
+  
+  //
+  // Create a main frame with a number of different buttons.
+  //
+
+  //  the things for the menu bar 
+    
+  TGMenuBar          *fMenuBar ;
+  TGPopupMenu        *fFileMenu ;
+  TGLayoutHints      *fLayMenuBar;
+  TGLayoutHints      *fLayMenuItem ;
+  TGHorizontal3DLine *fLineSep ; 
+
+  //   divide the Window in two different parts
+  
+  TGHorizontalFrame  *fTop ;   // top part of the main window
+  TGHorizontal3DLine *fLineSep2 ;
+  TGHorizontalFrame  *fLow ;   // low part of the main window
+  TGTab              *fTab ;   // different tabs in the low window
+  
+  //   the object in the top part of the frame
+  
+  TGPictureButton  *fPicMagic;
+  TGPictureButton  *fPicMars ;
+ 
+  //   the object in the low part of the frame
+ 
+  TGVerticalFrame  *fTabF1; 
+  TGVerticalFrame  *fTabF2 ;
+  
+  TGTextButton     *fButEvtDisp;
+  TGTextButton     *fButDataCheck;
+  TGTextButton     *fButAnalys;
+  TGTextButton     *fButMonteCarlo ;
+  TGLayoutHints    *fButLayout ; 
+
+  void DisplWarning(const char *txt);
+
+ public: 
+  MMars(UInt_t w=400, UInt_t h=500) ;
+  
+  ~MMars(); 
+  
+  void CloseWindow()  ; 
+
+  Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
+
+  ClassDef(MMars, 0)
+} ; 
+
+#endif
+
+
Index: trunk/MagicSoft/Mars/mmain/MMonteCarlo.cc
===================================================================
--- trunk/MagicSoft/Mars/mmain/MMonteCarlo.cc	(revision 714)
+++ trunk/MagicSoft/Mars/mmain/MMonteCarlo.cc	(revision 714)
@@ -0,0 +1,48 @@
+#include "MMonteCarlo.h"
+
+#include <TGButton.h>       // TGTextButton
+
+ClassImp(MMonteCarlo)
+
+enum {
+    M_BUTTON_ACTION
+};
+
+MMonteCarlo::MMonteCarlo(const TGWindow *main, const TGWindow *p, 
+                                   const UInt_t w, const UInt_t h )
+    : MBrowser(p, main, w, h)
+{
+
+    fButAction = new TGTextButton(fTop1, "ACTION", M_BUTTON_ACTION );
+    fButAction->Associate(this) ;
+    fTop1->AddFrame (fButAction, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
+
+    MapSubwindows();
+
+    Layout();
+
+    SetWindowName("MonteCarlo Main");
+    SetIconName("MonteCarlo");
+
+    MapWindow();
+} 
+
+MMonteCarlo::~MMonteCarlo()
+{
+    delete fButAction;
+}
+
+// ======================================================================
+
+Bool_t MMonteCarlo::ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
+{     
+    if (GET_MSG(msg) == kC_COMMAND &&
+        GET_SUBMSG(msg) == kCM_BUTTON &&
+        parm1 == M_BUTTON_ACTION)
+    {
+        DisplInfo("Put Intelligence here!");
+        return kTRUE;
+    }
+
+    return MBrowser::ProcessMessage(msg, parm1, parm2);
+}
Index: trunk/MagicSoft/Mars/mmain/MMonteCarlo.h
===================================================================
--- trunk/MagicSoft/Mars/mmain/MMonteCarlo.h	(revision 714)
+++ trunk/MagicSoft/Mars/mmain/MMonteCarlo.h	(revision 714)
@@ -0,0 +1,36 @@
+#ifndef MMONTECARLO_H
+#define MMONTECARLO_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+
+#ifndef ROOT_TGFrame
+#include <TGFrame.h>
+#endif
+#ifndef MBROWSER_H
+#include "MBrowser.h"
+#endif
+
+class TGTextButton;
+
+class MMonteCarlo : public MBrowser
+{ 
+private:
+
+    TGTextButton *fButAction;
+
+public:
+    MMonteCarlo(const TGWindow *main=NULL, const TGWindow *p=NULL,
+                     const UInt_t w=500, const UInt_t h=500) ;
+
+    ~MMonteCarlo();
+
+    Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
+
+    ClassDef(MMonteCarlo, 0)
+};
+
+#endif
+
+
Index: trunk/MagicSoft/Mars/mmain/MainIncl.h
===================================================================
--- trunk/MagicSoft/Mars/mmain/MainIncl.h	(revision 714)
+++ trunk/MagicSoft/Mars/mmain/MainIncl.h	(revision 714)
@@ -0,0 +1,3 @@
+#ifndef __CINT__
+
+#endif // __CINT__
Index: trunk/MagicSoft/Mars/mmain/MainLinkDef.h
===================================================================
--- trunk/MagicSoft/Mars/mmain/MainLinkDef.h	(revision 714)
+++ trunk/MagicSoft/Mars/mmain/MainLinkDef.h	(revision 714)
@@ -0,0 +1,12 @@
+#ifdef __CINT__
+
+#pragma link off all globals;
+#pragma link off all classes;
+#pragma link off all functions;
+
+#pragma link C++ class MMars;
+#pragma link C++ class MEvtDisp;
+#pragma link C++ class MDataCheck;
+#pragma link C++ class MMonteCarlo;
+
+#endif
Index: trunk/MagicSoft/Mars/mmain/Makefile
===================================================================
--- trunk/MagicSoft/Mars/mmain/Makefile	(revision 714)
+++ trunk/MagicSoft/Mars/mmain/Makefile	(revision 714)
@@ -0,0 +1,51 @@
+##################################################################
+#
+#   makefile
+# 
+#   for the MARS software
+#
+##################################################################
+include ../Makefile.conf.$(OSTYPE)
+include ../Makefile.conf.general
+
+#
+# Handling name of the Root Dictionary Files
+#
+CINT  = Main
+
+#
+# Library name to creatre
+#
+LIB   = mmain.a
+
+#
+#  connect the include files defined in the config.mk file
+#
+INCLUDES = -I. -I../mbase -I../manalysis -I../mdatacheck -I../meventdisp
+
+#------------------------------------------------------------------------------
+
+.SUFFIXES: .c .cc .cxx .h .hxx .o 
+
+SRCFILES = MDataCheck.cc \
+	   MEvtDisp.cc \
+	   MMars.cc \
+	   MMonteCarlo.cc \
+           MBrowser.cc
+
+SRCS    = $(SRCFILES)
+HEADERS = $(SRCFILES:.cc=.h)
+OBJS    = $(SRCFILES:.cc=.o) 
+
+############################################################
+
+all: $(LIB)
+
+include ../Makefile.rules
+
+clean:	rmlib rmcint rmobjs rmcore rmbin
+
+mrproper:	clean rmbak
+
+# @endcode
+
