ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 #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 
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 
TGedNameFrame(const TGedNameFrame &)
virtual Bool_t AcceptModel(TObject *)
Definition: TGedFrame.h:85
TClass * fModelClass
Definition: TGedFrame.h:57
Definition: TGTab.h:66
TList * GetExtraTabs()
Definition: TGedFrame.h:78
const char Option_t
Definition: RtypesCore.h:62
virtual ~TGedNameFrame()
Destructor.
Definition: TGedFrame.cxx:213
TGedFrame(const TGedFrame &)
virtual void SetModel(TObject *obj)
Sets text for the label.
Definition: TGedFrame.cxx:244
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
TFile * f
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event.
Definition: TGedFrame.cxx:234
Bool_t fAvoidSignal
Definition: TGedFrame.h:58
ULong_t Pixel_t
Definition: GuiTypes.h:41
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:665
virtual Bool_t HandleCrossing(Event_t *event)
Handle mouse crossing event for tooltip.
Definition: TGedFrame.cxx:221
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
ClassDef(TGedFrame, 0)
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
TPaveLabel title(3, 27.1, 15, 28.7,"ROOT Environment and Tools")
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
TGedFrame & operator=(const TGedFrame &)
TGCompositeFrame * fFrame
Definition: TGedFrame.h:45
The Canvas class.
Definition: TCanvas.h:48
TGLabel * fLabel
Definition: TGedFrame.h:100
virtual void SetDrawOption(Option_t *option="")
Set drawing option for object.
Definition: TGedFrame.cxx:145
virtual void SetModel(TObject *obj)=0
#define name(a, b)
Definition: linkTestLib0.cpp:5
Mother of all ROOT objects.
Definition: TObject.h:58
TGedNameFrame & operator=(const TGedNameFrame &)
Bool_t fInit
Definition: TGedFrame.h:55
virtual Option_t * GetDrawOption() const
Get draw options of the selected object.
Definition: TGedFrame.cxx:81
virtual void AddExtraTab(TGedSubFrame *sf)
Adds tab container to list of extra tabs.
Definition: TGedFrame.cxx:112
TGCompositeFrame * f1
Definition: TGedFrame.h:101
TGedSubFrame(const TGedSubFrame &)
const Bool_t kTRUE
Definition: Rtypes.h:91
TObject * obj
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 &)
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