Logo ROOT   6.18/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
25class TVirtualPad;
26class TCanvas;
27class TGLabel;
28class TGToolTip;
29class TList;
30class TGTab;
31class TGedEditor;
32
34
35public:
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
46 };
47
48private:
49 TGedFrame(const TGedFrame&); // Not implemented
50 TGedFrame& operator=(const TGedFrame&); // Not implemented
51
52protected:
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
63public:
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
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
92class TGedNameFrame : public TGedFrame {
93private:
94 TGedNameFrame(const TGedNameFrame&); // not implemented
95 TGedNameFrame& operator=(const TGedNameFrame&); // not implemented
96
97protected:
98 TGLabel *fLabel; //label of attribute frame
99 TGCompositeFrame *f1, *f2; //container frames
100 TGToolTip *fTip; //tool tip associated with button
101
102public:
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
ULong_t Pixel_t
Definition: GuiTypes.h:39
#define f(i)
Definition: RSha256.hxx:104
int Int_t
Definition: RtypesCore.h:41
unsigned int UInt_t
Definition: RtypesCore.h:42
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kTRUE
Definition: RtypesCore.h:87
const char Option_t
Definition: RtypesCore.h:62
#define ClassDef(name, id)
Definition: Rtypes.h:326
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
@ kChildFrame
Definition: TGFrame.h:57
char name[80]
Definition: TGX11.cxx:109
The Canvas class.
Definition: TCanvas.h:31
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:75
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:665
Definition: TGTab.h:62
TGedSubFrame(const TGedSubFrame &)
TGedSubFrame(TString n, TGCompositeFrame *f)
Definition: TGedFrame.h:45
TGedSubFrame & operator=(const TGedSubFrame &)
TGCompositeFrame * fFrame
Definition: TGedFrame.h:43
virtual void SetGedEditor(TGedEditor *ed)
Definition: TGedFrame.h:86
virtual Option_t * GetDrawOption() const
Get draw options of the selected object.
Definition: TGedFrame.cxx:81
TClass * GetModelClass()
Definition: TGedFrame.h:74
virtual void AddExtraTab(TGedSubFrame *sf)
Adds tab container to list of extra tabs.
Definition: TGedFrame.cxx:112
virtual void ActivateBaseClassEditors(TClass *cl)
Provide list of editors for base-classes.
Definition: TGedFrame.cxx:168
TGedFrame & operator=(const TGedFrame &)
virtual void SetModel(TObject *obj)=0
TGedEditor * fGedEditor
Definition: TGedFrame.h:54
virtual TGVerticalFrame * CreateEditorTabSubFrame(const char *name)
Create a vertical frame to be used by 'owner' in extra tab 'name'.
Definition: TGedFrame.cxx:123
TClass * fModelClass
Definition: TGedFrame.h:55
virtual void SetDrawOption(Option_t *option="")
Set drawing option for object.
Definition: TGedFrame.cxx:145
Bool_t fInit
Definition: TGedFrame.h:53
TList * GetExtraTabs()
Definition: TGedFrame.h:76
virtual void MakeTitle(const char *title)
Create attribute frame title.
Definition: TGedFrame.cxx:96
void SetModelClass(TClass *mcl)
Definition: TGedFrame.h:84
TGedFrame(const TGedFrame &)
TList * fExtraTabs
Definition: TGedFrame.h:58
virtual void Refresh(TObject *model)
Refresh the GUI info about the object attributes.
Definition: TGedFrame.cxx:135
Int_t GetPriority()
Definition: TGedFrame.h:75
virtual ~TGedFrame()
Destructor of the base GUI attribute frame.
Definition: TGedFrame.cxx:54
virtual void Update()
Update the current pad when an attribute is changed via GUI.
Definition: TGedFrame.cxx:73
Int_t fPriority
Definition: TGedFrame.h:59
TGedEditor * GetGedEditor()
Definition: TGedFrame.h:77
virtual Bool_t AcceptModel(TObject *)
Definition: TGedFrame.h:83
Bool_t fAvoidSignal
Definition: TGedFrame.h:56
virtual Bool_t HandleCrossing(Event_t *event)
Handle mouse crossing event for tooltip.
Definition: TGedFrame.cxx:221
TGCompositeFrame * f1
Definition: TGedFrame.h:99
TGedNameFrame(const TGedNameFrame &)
TGLabel * fLabel
Definition: TGedFrame.h:98
TGToolTip * fTip
Definition: TGedFrame.h:100
TGCompositeFrame * f2
Definition: TGedFrame.h:99
virtual ~TGedNameFrame()
Destructor.
Definition: TGedFrame.cxx:213
TGedNameFrame & operator=(const TGedNameFrame &)
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event.
Definition: TGedFrame.cxx:234
virtual void SetModel(TObject *obj)
Sets text for the label.
Definition: TGedFrame.cxx:244
A doubly linked list.
Definition: TList.h:44
Mother of all ROOT objects.
Definition: TObject.h:37
Basic string class.
Definition: TString.h:131
TVirtualPad is an abstract base class for the Pad and Canvas classes.
Definition: TVirtualPad.h:50
const Int_t n
Definition: legend1.C:16