Logo ROOT   6.10/09
Reference Guide
TClassMenuItem.h
Go to the documentation of this file.
1 // @(#)root/meta:$Id$
2 // Author: Damir Buskulic 23/11/2001
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, 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_TClassMenuItem
13 #define ROOT_TClassMenuItem
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TClassMenuItem //
19 // //
20 // Describe one element of the context menu associated to a class //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 #include "TObject.h"
25 #include "TString.h"
26 
27 class TList;
28 class TClass;
29 
30 
31 class TClassMenuItem : public TObject {
32 
33 public:
36  };
37  enum { kIsExternal, kIsSelf };
38 
39 private:
40  EClassMenuItemType fType; //type flag (EClassMenuItemType)
41  Int_t fSelfObjectPos; //rang in argument list corresponding to the object being clicked on
42  Bool_t fSelf; //flag to indicate that object to be called is the selected one
43  Bool_t fToggle; //flag toggle method
44  TString fTitle; //title if not standard
45  TObject *fCalledObject; //object to be called
46  TString fFunctionName; //name of the function or method to be called
47  TString fArgs; //arguments type list *** NOT CHECKED ***
48  TList *fSubMenu; //list of submenu items
49  TClass *fParent; //parent class
50 
51 protected:
54 
55 public:
57  TClassMenuItem(Int_t type, TClass *parent, const char *title="",
58  const char *functionname="", TObject *obj=0,
59  const char *args="", Int_t selfobjposition=-1,
60  Bool_t self=kFALSE);
61  virtual ~TClassMenuItem();
62  virtual const char *GetTitle() const { return fTitle; }
63  virtual const char *GetFunctionName() const { return fFunctionName; }
64  virtual const char *GetArgs() const { return fArgs; }
65  virtual TObject *GetCalledObject() const { return fCalledObject; }
66  virtual Int_t GetType() const { return fType; }
67  virtual Int_t GetSelfObjectPos() const { return fSelfObjectPos; }
68  virtual Bool_t IsCallSelf() const { return fSelf; }
69  virtual Bool_t IsSeparator() const { return fType==kPopupSeparator ? kTRUE : kFALSE; }
70  virtual Bool_t IsStandardList() const { return fType==kPopupStandardList ? kTRUE : kFALSE; }
71  virtual Bool_t IsToggle() const { return fToggle; }
72  virtual void SetType(Int_t type) { fType = (EClassMenuItemType) type; }
73  virtual void SetTitle(const char *title) { fTitle = title; }
74  virtual void SetSelf(Bool_t self) { fSelf = self; }
75  virtual void SetToggle(Bool_t toggle = kTRUE) { fToggle = toggle; }
76  virtual void SetCall(TObject *obj, const char *method,
77  const char *args="", Int_t selfobjposition = 0)
78  { fCalledObject = obj; fFunctionName = method;
79  fArgs = args; fSelfObjectPos = selfobjposition;}
80 
81  ClassDef(TClassMenuItem,0) //One element of the class context menu
82 };
83 
84 #endif
virtual Int_t GetType() const
Describes one element of the context menu associated to a class The menu item may describe...
Basic string class.
Definition: TString.h:129
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
TClass * fParent
virtual void SetToggle(Bool_t toggle=kTRUE)
virtual void SetType(Int_t type)
virtual void SetTitle(const char *title)
#define ClassDef(name, id)
Definition: Rtypes.h:297
virtual Bool_t IsToggle() const
virtual void SetSelf(Bool_t self)
A doubly linked list.
Definition: TList.h:43
virtual const char * GetTitle() const
Returns title of object.
virtual Bool_t IsSeparator() const
TObject * fCalledObject
TString fFunctionName
The ROOT global object gROOT contains a list of all defined classes.
Definition: TClass.h:71
virtual void SetCall(TObject *obj, const char *method, const char *args="", Int_t selfobjposition=0)
const Bool_t kFALSE
Definition: RtypesCore.h:92
TClassMenuItem & operator=(const TClassMenuItem &)
assignment operator
virtual Bool_t IsStandardList() const
int type
Definition: TGX11.cxx:120
virtual const char * GetArgs() const
virtual TObject * GetCalledObject() const
virtual Int_t GetSelfObjectPos() const
virtual const char * GetFunctionName() const
Mother of all ROOT objects.
Definition: TObject.h:37
EClassMenuItemType fType
virtual ~TClassMenuItem()
TClassMenuItem dtor.
TClassMenuItem()
Default TClassMenuItem ctor.
const Bool_t kTRUE
Definition: RtypesCore.h:91
virtual Bool_t IsCallSelf() const