Logo ROOT   6.08/07
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 #ifndef ROOT_TObject
25 #include "TObject.h"
26 #endif
27 #ifndef ROOT_TString
28 #include "TString.h"
29 #endif
30 
31 class TList;
32 class TClass;
33 
34 
35 class TClassMenuItem : public TObject {
36 
37 public:
40  };
41  enum { kIsExternal, kIsSelf };
42 
43 private:
44  EClassMenuItemType fType; //type flag (EClassMenuItemType)
45  Int_t fSelfObjectPos; //rang in argument list corresponding to the object being clicked on
46  Bool_t fSelf; //flag to indicate that object to be called is the selected one
47  Bool_t fToggle; //flag toggle method
48  TString fTitle; //title if not standard
49  TObject *fCalledObject; //object to be called
50  TString fFunctionName; //name of the function or method to be called
51  TString fArgs; //arguments type list *** NOT CHECKED ***
52  TList *fSubMenu; //list of submenu items
53  TClass *fParent; //parent class
54 
55 protected:
58 
59 public:
61  TClassMenuItem(Int_t type, TClass *parent, const char *title="",
62  const char *functionname="", TObject *obj=0,
63  const char *args="", Int_t selfobjposition=-1,
64  Bool_t self=kFALSE);
65  virtual ~TClassMenuItem();
66  virtual const char *GetTitle() const { return fTitle; }
67  virtual const char *GetFunctionName() const { return fFunctionName; }
68  virtual const char *GetArgs() const { return fArgs; }
69  virtual TObject *GetCalledObject() const { return fCalledObject; }
70  virtual Int_t GetType() const { return fType; }
71  virtual Int_t GetSelfObjectPos() const { return fSelfObjectPos; }
72  virtual Bool_t IsCallSelf() const { return fSelf; }
73  virtual Bool_t IsSeparator() const { return fType==kPopupSeparator ? kTRUE : kFALSE; }
74  virtual Bool_t IsStandardList() const { return fType==kPopupStandardList ? kTRUE : kFALSE; }
75  virtual Bool_t IsToggle() const { return fToggle; }
76  virtual void SetType(Int_t type) { fType = (EClassMenuItemType) type; }
77  virtual void SetTitle(const char *title) { fTitle = title; }
78  virtual void SetSelf(Bool_t self) { fSelf = self; }
79  virtual void SetToggle(Bool_t toggle = kTRUE) { fToggle = toggle; }
80  virtual void SetCall(TObject *obj, const char *method,
81  const char *args="", Int_t selfobjposition = 0)
82  { fCalledObject = obj; fFunctionName = method;
83  fArgs = args; fSelfObjectPos = selfobjposition;}
84 
85  ClassDef(TClassMenuItem,0) //One element of the class context menu
86 };
87 
88 #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:137
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
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:254
virtual Bool_t IsToggle() const
virtual void SetSelf(Bool_t self)
A doubly linked list.
Definition: TList.h:47
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:81
virtual void SetCall(TObject *obj, const char *method, const char *args="", Int_t selfobjposition=0)
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: Rtypes.h:91
virtual Bool_t IsCallSelf() const