Initialize arrays in constructor (Ivana)
[u/mrichter/AliRoot.git] / DISPLAY / AliShutterFrame.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-2003, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 /////////////////////////////////////////////////////////////////////////
17 // ALICE SHUTTER FRAME CLASS                                           //
18 // Author: Mayeul   ROUSSELET                                          //
19 // e-mail: Mayeul.Rousselet@cern.ch                                    //
20 // Last update:26/08/2003                                              //
21 /////////////////////////////////////////////////////////////////////////
22
23 #include <TGFrame.h>
24 #include <TGLayout.h>
25 #include <TGShutter.h>
26
27 #include "AliDetectorFrame.h"
28 #include "AliDisplay2.h"
29 #include "AliShutterItem.h"
30
31 #include "AliShutterFrame.h"
32
33
34 ClassImp(AliShutterFrame)
35
36 //_____________________________________________________________
37 AliShutterFrame::AliShutterFrame(TGCompositeFrame *p, UInt_t /*w*/, UInt_t h)
38 {
39   // Constructor
40   fShutter = new TGShutter(p,kSunkenFrame);
41   fLayout = new TGLayoutHints(kLHintsExpandY | kLHintsTop | kLHintsLeft);
42   fMainFrame = (TGCompositeFrame *) fShutter;
43   
44   //Event Shutter
45   AliShutterItem *item = new AliShutterItem(fShutter,"Event",kIdsEVENT);
46   
47   item->AddPictureButton("next.xpm","Show next event",kIdbNextEVENT);
48   item->AddPictureButton("prev.xpm","Show previous event",kIdbPrevEVENT);
49   
50   //View Shutter
51   item = new AliShutterItem(fShutter,"View",kIdsVIEW);
52   item->AddPictureButton("top.xpm","Top view",kIdbTOPVIEW);
53   item->AddPictureButton("side.xpm","Side view",kIdbSIDEVIEW);
54   item->AddPictureButton("front.xpm","Front view",kIdbFRONTVIEW);
55   item->AddPictureButton("four.xpm","Four views",kIdbALLVIEW);
56   
57   //Detector Shutter
58   item = new AliShutterItem(fShutter,"Detectors",kIdsDETECTORS);
59   TGCompositeFrame *frame = item->GetShutterItemFrame();
60   fDetectorFrameLayout = new TGLayoutHints( kLHintsTop | kLHintsLeft| kLHintsExpandX | kLHintsCenterX,5,5,5,5);
61   fDetectorFrame = new AliDetectorFrame(frame,200,200,item->GetShutterItem()->GetDefaultFrameBackground());
62   frame->AddFrame(fDetectorFrame->GetDetectorFrame(),fDetectorFrameLayout);
63   
64   //Options Shutter
65   item = new AliShutterItem(fShutter,"Options",kIdsOPTIONS);
66   item->AddCheckButton("Display Hits",kIdbCheckHITS);
67   item->AddCheckButton("Display Clusters",kIdbCheckCLUSTERS);
68   item->AddCheckButton("Display HLT Clusters",kIdbCheckHLT);
69   //    item->AddCheckButton("Display Tracks",kIdbCheckTRACKS);
70   
71   fMainFrame->Resize(150,h);
72 }
73
74 //_____________________________________________________________
75 AliShutterFrame::~AliShutterFrame(void)
76 {
77   // Destructor
78   delete fLayout;
79   delete fShutter;
80   delete fMainFrame;
81   delete fDetectorFrame;
82   delete fDetectorFrameLayout;
83 }
84