Logo ROOT   6.08/07
Reference Guide
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 #ifndef ROOT_TGFrame
24 #include "TGFrame.h"
25 #endif
26 
27 class TVirtualPad;
28 class TCanvas;
29 class TGLabel;
30 class TGToolTip;
31 class TList;
32 class TGTab;
33 class TGedEditor;
34 
35 class TGedFrame : public TGCompositeFrame {
36 
37 public:
38  // Inner class to store information for each extra tab.
39  class TGedSubFrame : public TObject {
40  private:
41  TGedSubFrame(const TGedSubFrame&); // Not implemented
42  TGedSubFrame& operator=(const TGedSubFrame&); // Not implemented
43  public:
46 
47  TGedSubFrame(TString n, TGCompositeFrame* f) : fName(n), fFrame(f) {}
48  };
49 
50 private:
51  TGedFrame(const TGedFrame&); // Not implemented
52  TGedFrame& operator=(const TGedFrame&); // Not implemented
53 
54 protected:
55  Bool_t fInit; // init flag for setting signals/slots
56  TGedEditor *fGedEditor; // manager of this frame
57  TClass *fModelClass; // class corresponding to instantiated GedFrame
58  Bool_t fAvoidSignal; // flag for executing slots
59 
60  TList *fExtraTabs; // addtional tabs in ged editor
61  Int_t fPriority; // location in GedEditor
62 
63  virtual void MakeTitle(const char *title);
64 
65 public:
66  TGedFrame(const TGWindow *p = 0,
67  Int_t width = 140, Int_t height = 30,
68  UInt_t options = kChildFrame,
70  virtual ~TGedFrame();
71 
72  virtual void Update();
73 
74  virtual Option_t *GetDrawOption() const;
75 
77  Int_t GetPriority() { return fPriority; }
78  TList* GetExtraTabs() { return fExtraTabs; }
80  virtual void AddExtraTab(TGedSubFrame* sf);
81  virtual TGVerticalFrame* CreateEditorTabSubFrame(const char* name);
82 
83  virtual void Refresh(TObject *model);
84  virtual void SetDrawOption(Option_t *option="");
85  virtual Bool_t AcceptModel(TObject*) { return kTRUE; }
86  void SetModelClass(TClass* mcl) { fModelClass = mcl; }
87  virtual void SetModel(TObject* obj) = 0;
88  virtual void SetGedEditor(TGedEditor* ed) { fGedEditor = ed; }
89  virtual void ActivateBaseClassEditors(TClass* cl);
90 
91  ClassDef(TGedFrame, 0); //base editor's frame
92 };
93 
94 class TGedNameFrame : public TGedFrame {
95 private:
96  TGedNameFrame(const TGedNameFrame&); // not implemented
97  TGedNameFrame& operator=(const TGedNameFrame&); // not implemented
98 
99 protected:
100  TGLabel *fLabel; //label of attribute frame
101  TGCompositeFrame *f1, *f2; //container frames
102  TGToolTip *fTip; //tool tip associated with button
103 
104 public:
105  TGedNameFrame(const TGWindow *p =0 ,
106  Int_t width = 170, Int_t height = 30,
107  UInt_t options = kChildFrame,
109  virtual ~TGedNameFrame();
110 
111  virtual Bool_t HandleButton(Event_t *event);
112  virtual Bool_t HandleCrossing(Event_t *event);
113 
114  virtual void SetModel(TObject* obj);
115 
116  ClassDef(TGedNameFrame,0) //frame showing the selected object name
117 };
118 
119 #endif
120 
virtual Bool_t AcceptModel(TObject *)
Definition: TGedFrame.h:85
virtual Bool_t HandleButton(Event_t *)
Definition: TGFrame.h:399
TClass * fModelClass
Definition: TGedFrame.h:57
Definition: TGTab.h:66
TList * GetExtraTabs()
Definition: TGedFrame.h:78
const char Option_t
Definition: RtypesCore.h:62
TGedFrame(const TGedFrame &)
TClass * GetModelClass()
Definition: TGedFrame.h:76
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
Bool_t fAvoidSignal
Definition: TGedFrame.h:58
#define ClassDef(name, id)
Definition: Rtypes.h:254
ULong_t Pixel_t
Definition: GuiTypes.h:41
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:665
TGedSubFrame(TString n, TGCompositeFrame *f)
Definition: TGedFrame.h:47
virtual void Update()
Update the current pad when an attribute is changed via GUI.
Definition: TGedFrame.cxx:73
virtual TGVerticalFrame * CreateEditorTabSubFrame(const char *name)
Create a vertical frame to be used by 'owner' in extra tab 'name'.
Definition: TGedFrame.cxx:123
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition: TVirtualPad.h:59
virtual Option_t * GetDrawOption() const
Get option used by the graphics system to draw this object.
Definition: TObject.cxx:400
A doubly linked list.
Definition: TList.h:47
virtual ~TGedFrame()
Destructor of the base GUI attribute frame.
Definition: TGedFrame.cxx:54
TGCompositeFrame * f2
Definition: TGedFrame.h:101
TGToolTip * fTip
Definition: TGedFrame.h:102
unsigned int UInt_t
Definition: RtypesCore.h:42
virtual void Refresh(TObject *model)
Refresh the GUI info about the object attributes.
Definition: TGedFrame.cxx:135
Int_t GetPriority()
Definition: TGedFrame.h:77
The ROOT global object gROOT contains a list of all defined classes.
Definition: TClass.h:81
TGedEditor * GetGedEditor()
Definition: TGedFrame.h:79
TGCompositeFrame * fFrame
Definition: TGedFrame.h:45
The Canvas class.
Definition: TCanvas.h:41
TGLabel * fLabel
Definition: TGedFrame.h:100
double f(double x)
virtual void SetModel(TObject *obj)=0
Mother of all ROOT objects.
Definition: TObject.h:37
Bool_t fInit
Definition: TGedFrame.h:55
virtual void AddExtraTab(TGedSubFrame *sf)
Adds tab container to list of extra tabs.
Definition: TGedFrame.cxx:112
TF1 * f1
Definition: legend1.C:11
TGedSubFrame(const TGedSubFrame &)
virtual void SetDrawOption(Option_t *option="")
Set drawing option for object.
Definition: TObject.cxx:722
const Bool_t kTRUE
Definition: Rtypes.h:91
TGedEditor * fGedEditor
Definition: TGedFrame.h:56
virtual void MakeTitle(const char *title)
Create attribute frame title.
Definition: TGedFrame.cxx:96
const Int_t n
Definition: legend1.C:16
TGedSubFrame & operator=(const TGedSubFrame &)
char name[80]
Definition: TGX11.cxx:109
virtual Bool_t HandleCrossing(Event_t *)
Definition: TGFrame.h:401
void SetModelClass(TClass *mcl)
Definition: TGedFrame.h:86
TList * fExtraTabs
Definition: TGedFrame.h:60
virtual void SetGedEditor(TGedEditor *ed)
Definition: TGedFrame.h:88
Int_t fPriority
Definition: TGedFrame.h:61
virtual void ActivateBaseClassEditors(TClass *cl)
Provide list of editors for base-classes.
Definition: TGedFrame.cxx:168