]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/EveBase/AliEveGedEditor.cxx
-Fixed bug in offline buffer that deleted event object.
[u/mrichter/AliRoot.git] / EVE / EveBase / AliEveGedEditor.cxx
1 // $Id$
2 // Author: Matevz Tadel 2009
3
4 /**************************************************************************
5  * Copyright(c) 1998-2009, ALICE Experiment at CERN, all rights reserved. *
6  * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
7  * full copyright notice.                                                 *
8  **************************************************************************/
9
10 #include "AliEveGedEditor.h"
11 #include <TGButton.h>
12
13
14 //==============================================================================
15 // AliEveGedNameFrame
16 //==============================================================================
17
18 //______________________________________________________________________________
19 // Full description of AliEveGedNameFrame
20 //
21
22 ClassImp(AliEveGedNameFrame)
23
24 //______________________________________________________________________________
25 AliEveGedNameFrame::AliEveGedNameFrame(const TGWindow *p) :
26   TGedFrame(p),
27   fB(0)
28 {
29   // Constructor.
30
31   fB = new TGTextButton(this);
32   AddFrame(fB, new TGLayoutHints(kLHintsExpandX|kLHintsExpandY));
33 }
34
35 //______________________________________________________________________________
36 void AliEveGedNameFrame::SetModel(TObject* obj)
37 {
38   // Set model object.
39
40   if (obj)
41     fB->SetText(Form("%s [%s]", obj->GetName(), obj->ClassName()));
42   else
43     fB->SetText("No object selected");
44 }
45
46
47 //==============================================================================
48 // AliEveGedEditor
49 //==============================================================================
50
51 //______________________________________________________________________________
52 // Full description of AliEveGedEditor
53 //
54
55 ClassImp(AliEveGedEditor)
56
57 //______________________________________________________________________________
58 AliEveGedEditor::AliEveGedEditor() :
59   TEveGedEditor()
60 {
61   // Constructor.
62
63   // Remove old name-frame -- it is created in TGedEditor constructor
64   // so virtuals are not active yet.
65   fTabContainer->RemoveAll();
66
67   // Replace with a new one.
68   TGedFrame* nf = CreateNameFrame(fTabContainer, "Style");
69   nf->SetGedEditor(this);
70   nf->SetModelClass(0);
71   fTabContainer->AddFrame(nf, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 2, 2, 2, 2));
72 }
73
74 //______________________________________________________________________________
75 TGedFrame* AliEveGedEditor::CreateNameFrame(const TGWindow* parent, const char* /*tab_name*/)
76 {
77   // Create name-frame for a tab.
78
79   return new AliEveGedNameFrame(parent);
80 }