Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TGedFrame.h
Go to the documentation of this file.
1 // @(#)root/ged:$Id$
2 // Author: Ilka Antcheva 10/05/04
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2002, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TGedFrame
13 #define ROOT_TGedFrame
14 
15 //////////////////////////////////////////////////////////////////////////
16 // //
17 // TGedFrame //
18 // //
19 // Base editor's attribute frame - a service class. //
20 // //
21 //////////////////////////////////////////////////////////////////////////
22 
23 #include "TGFrame.h"
24 
25 class TVirtualPad;
26 class TCanvas;
27 class TGLabel;
28 class TGToolTip;
29 class TList;
30 class TGTab;
31 class TGedEditor;
32 
33 class TGedFrame : public TGCompositeFrame {
34 
35 public:
36  // Inner class to store information for each extra tab.
37  class TGedSubFrame : public TObject {
38  private:
39  TGedSubFrame(const TGedSubFrame&); // Not implemented
40  TGedSubFrame& operator=(const TGedSubFrame&); // Not implemented
41  public:
42  TString fName;
43  TGCompositeFrame *fFrame;
44 
45  TGedSubFrame(TString n, TGCompositeFrame* f) : fName(n), fFrame(f) {}
46  };
47 
48 private:
49  TGedFrame(const TGedFrame&); // Not implemented
50  TGedFrame& operator=(const TGedFrame&); // Not implemented
51 
52 protected:
53  Bool_t fInit; // init flag for setting signals/slots
54  TGedEditor *fGedEditor; // manager of this frame
55  TClass *fModelClass; // class corresponding to instantiated GedFrame
56  Bool_t fAvoidSignal; // flag for executing slots
57 
58  TList *fExtraTabs; // addtional tabs in ged editor
59  Int_t fPriority; // location in GedEditor
60 
61  virtual void MakeTitle(const char *title);
62 
63 public:
64  TGedFrame(const TGWindow *p = 0,
65  Int_t width = 140, Int_t height = 30,
66  UInt_t options = kChildFrame,
67  Pixel_t back = GetDefaultFrameBackground());
68  virtual ~TGedFrame();
69 
70  virtual void Update();
71 
72  virtual Option_t *GetDrawOption() const;
73 
74  TClass* GetModelClass() { return fModelClass; }
75  Int_t GetPriority() { return fPriority; }
76  TList* GetExtraTabs() { return fExtraTabs; }
77  TGedEditor* GetGedEditor() { return fGedEditor; }
78  virtual void AddExtraTab(TGedSubFrame* sf);
79  virtual TGVerticalFrame* CreateEditorTabSubFrame(const char* name);
80 
81  virtual void Refresh(TObject *model);
82  virtual void SetDrawOption(Option_t *option="");
83  virtual Bool_t AcceptModel(TObject*) { return kTRUE; }
84  void SetModelClass(TClass* mcl) { fModelClass = mcl; }
85  virtual void SetModel(TObject* obj) = 0;
86  virtual void SetGedEditor(TGedEditor* ed) { fGedEditor = ed; }
87  virtual void ActivateBaseClassEditors(TClass* cl);
88 
89  ClassDef(TGedFrame, 0); //base editor's frame
90 };
91 
92 class TGedNameFrame : public TGedFrame {
93 private:
94  TGedNameFrame(const TGedNameFrame&); // not implemented
95  TGedNameFrame& operator=(const TGedNameFrame&); // not implemented
96 
97 protected:
98  TGLabel *fLabel; //label of attribute frame
99  TGCompositeFrame *f1, *f2; //container frames
100  TGToolTip *fTip; //tool tip associated with button
101 
102 public:
103  TGedNameFrame(const TGWindow *p =0 ,
104  Int_t width = 170, Int_t height = 30,
105  UInt_t options = kChildFrame,
106  Pixel_t back = GetDefaultFrameBackground());
107  virtual ~TGedNameFrame();
108 
109  virtual Bool_t HandleButton(Event_t *event);
110  virtual Bool_t HandleCrossing(Event_t *event);
111 
112  virtual void SetModel(TObject* obj);
113 
114  ClassDef(TGedNameFrame,0) //frame showing the selected object name
115 };
116 
117 #endif
118