1 /**************************************************************************
2 * Copyright(c) 1998-2003, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 /////////////////////////////////////////////////////////////////////////
17 // ALICE SHUTTER ITEM CLASS //
18 // Author: Mayeul ROUSSELET //
19 // e-mail: Mayeul.Rousselet@cern.ch //
20 // Last update:26/08/2003 //
21 /////////////////////////////////////////////////////////////////////////
23 #include <TGShutter.h>
27 #include "AliShutterItem.h"
28 #include "AliDisplay2.h"
30 ClassImp(AliShutterItem)
32 //_____________________________________________________________
33 AliShutterItem::AliShutterItem(TGShutter *s, const char *text, UInt_t id)
36 fShutterItem = new TGShutterItem(s, new TGHotString(text), id);
37 fMainFrame = (TGCompositeFrame *) fShutterItem->GetContainer();
38 s->AddItem(fShutterItem);
41 //_____________________________________________________________
42 AliShutterItem::~AliShutterItem(void)
50 //_____________________________________________________________
51 void AliShutterItem::AddTextButton(const char* text, const char *tiptext, UInt_t idb)
53 //Add a TGTextButton in the TGShutterItem. This button will execute the fonction
54 fButton = new TGTextButton(fMainFrame,new TGHotString(text),idb);
55 fButton->Resize(100,fButton->GetDefaultHeight());
56 fButton->Connect("Clicked()","AliShutterItem",this,"DoButton(Int_t)");
57 fButton->SetToolTipText(tiptext);
58 //fButton->Connect("Clicked()","AliDisplay2",gAliDisplay2,"DoViews(Int_t)");
59 fMainFrame->AddFrame(fButton, new TGLayoutHints( kLHintsTop | kLHintsCenterX ,5,5,10,10));
62 //_____________________________________________________________
63 void AliShutterItem::AddPictureButton(const char* file, const char *tiptext, UInt_t idb)
65 //Add a TGPictureButton in the TGShutterItem. The icon file must be in DISPLAY/icons
66 TString filename=StrDup(gAliDisplay2->GetIconsPath());
67 filename.Append(file);
68 TGPicture *picture = (TGPicture *) gClient->GetPicture(filename);
69 fButton = new TGPictureButton(fMainFrame,picture,idb);
70 fButton->SetToolTipText(tiptext);
71 fButton->Connect("Clicked()","AliShutterItem",this,"DoButton(Int_t)");
72 fMainFrame->AddFrame(fButton, new TGLayoutHints( kLHintsTop | kLHintsCenterX ,5,5,10,10));
75 //_____________________________________________________________
76 void AliShutterItem::AddCheckButton(const char *text,Int_t idb)
79 fButton = new TGCheckButton(fMainFrame,new TGHotString(text),idb);
80 fButton->Resize(100,fButton->GetDefaultHeight());
81 fButton->Connect("Clicked()","AliShutterItem",this,"DoButton(Int_t)");
82 fMainFrame->AddFrame(fButton, new TGLayoutHints( kLHintsTop | kLHintsLeft ,5,5,10,10));
85 //_____________________________________________________________
86 void AliShutterItem::DoButton(Int_t /*pos*/) const
88 // Show next/previous event if the buttom was used
89 TGFrame *frame = (TGFrame *) gTQSender;
90 TGButton *bu= (TGButton *) frame;
91 int id = bu->WidgetId();
94 gAliDisplay2->ShowNextEvent(1);
98 gAliDisplay2->ShowNextEvent(-1);
102 if(gAliDisplay2->IsEnabled(kHits)) gAliDisplay2->Disable(kHits);
103 else gAliDisplay2->Enable(kHits);
106 case kIdbCheckCLUSTERS:{
107 if(gAliDisplay2->IsEnabled(kClusters)) gAliDisplay2->Disable(kClusters);
108 else gAliDisplay2->Enable(kClusters);
112 if(gAliDisplay2->IsEnabled(kHLT)) gAliDisplay2->Disable(kHLT);
113 else gAliDisplay2->Enable(kHLT);
116 case kIdbCheckTRACKS:{
117 if(gAliDisplay2->IsEnabled(kTracks)) gAliDisplay2->Disable(kTracks);
118 else gAliDisplay2->Enable(kTracks);
122 gAliDisplay2->DoView(kIdbSIDEVIEW);
126 gAliDisplay2->DoView(kIdbFRONTVIEW);
130 gAliDisplay2->DoView(kIdbTOPVIEW);
134 gAliDisplay2->DoView(kIdbALLVIEW);