Logo ROOT   6.14/05
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 #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:
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,
68  virtual ~TGedFrame();
69 
70  virtual void Update();
71 
72  virtual Option_t *GetDrawOption() const;
73 
75  Int_t GetPriority() { return fPriority; }
76  TList* GetExtraTabs() { return fExtraTabs; }
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,
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 
virtual Bool_t AcceptModel(TObject *)
Definition: TGedFrame.h:83
virtual Bool_t HandleButton(Event_t *)
Definition: TGFrame.h:383
TClass * fModelClass
Definition: TGedFrame.h:55
Definition: TGTab.h:62
TList * GetExtraTabs()
Definition: TGedFrame.h:76
const char Option_t
Definition: RtypesCore.h:62
image html pict1_TGaxis_012 png width
Define new text attributes for the label number "labNum".
Definition: TGaxis.cxx:2551
TGedFrame(const TGedFrame &)
TClass * GetModelClass()
Definition: TGedFrame.h:74
Basic string class.
Definition: TString.h:131
#define f(i)
Definition: RSha256.hxx:104
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
Bool_t fAvoidSignal
Definition: TGedFrame.h:56
#define ClassDef(name, id)
Definition: Rtypes.h:320
ULong_t Pixel_t
Definition: GuiTypes.h:39
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:665
TGedSubFrame(TString n, TGCompositeFrame *f)
Definition: TGedFrame.h:45
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:49
virtual Option_t * GetDrawOption() const
Get option used by the graphics system to draw this object.
Definition: TObject.cxx:341
A doubly linked list.
Definition: TList.h:44
virtual ~TGedFrame()
Destructor of the base GUI attribute frame.
Definition: TGedFrame.cxx:54
TGCompositeFrame * f2
Definition: TGedFrame.h:99
TGToolTip * fTip
Definition: TGedFrame.h:100
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:75
The ROOT global object gROOT contains a list of all defined classes.
Definition: TClass.h:75
TGedEditor * GetGedEditor()
Definition: TGedFrame.h:77
TGCompositeFrame * fFrame
Definition: TGedFrame.h:43
The Canvas class.
Definition: TCanvas.h:31
TGLabel * fLabel
Definition: TGedFrame.h:98
virtual void SetModel(TObject *obj)=0
Mother of all ROOT objects.
Definition: TObject.h:37
Bool_t fInit
Definition: TGedFrame.h:53
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:677
TGedEditor * fGedEditor
Definition: TGedFrame.h:54
const Bool_t kTRUE
Definition: RtypesCore.h:87
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:385
void SetModelClass(TClass *mcl)
Definition: TGedFrame.h:84
TList * fExtraTabs
Definition: TGedFrame.h:58
virtual void SetGedEditor(TGedEditor *ed)
Definition: TGedFrame.h:86
Int_t fPriority
Definition: TGedFrame.h:59
virtual void ActivateBaseClassEditors(TClass *cl)
Provide list of editors for base-classes.
Definition: TGedFrame.cxx:168