Logo ROOT  
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
27class TList;
28class TClass;
29
30
31class TClassMenuItem : public TObject {
32
33public:
36 };
38
39private:
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
51protected:
54
55public:
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; }
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
int Int_t
Definition: RtypesCore.h:41
const Bool_t kFALSE
Definition: RtypesCore.h:88
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kTRUE
Definition: RtypesCore.h:87
#define ClassDef(name, id)
Definition: Rtypes.h:326
int type
Definition: TGX11.cxx:120
Describes one element of the context menu associated to a class The menu item may describe.
virtual void SetTitle(const char *title)
TObject * fCalledObject
virtual const char * GetArgs() const
TClass * fParent
virtual void SetType(Int_t type)
virtual Bool_t IsSeparator() const
virtual void SetToggle(Bool_t toggle=kTRUE)
virtual Bool_t IsStandardList() const
virtual Bool_t IsCallSelf() const
TString fFunctionName
virtual const char * GetTitle() const
Returns title of object.
virtual TObject * GetCalledObject() const
virtual void SetCall(TObject *obj, const char *method, const char *args="", Int_t selfobjposition=0)
virtual const char * GetFunctionName() const
EClassMenuItemType fType
virtual Int_t GetType() const
TClassMenuItem()
Default TClassMenuItem ctor.
virtual void SetSelf(Bool_t self)
virtual ~TClassMenuItem()
TClassMenuItem dtor.
virtual Bool_t IsToggle() const
virtual Int_t GetSelfObjectPos() const
TClassMenuItem & operator=(const TClassMenuItem &)
assignment operator
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:75
A doubly linked list.
Definition: TList.h:44
Mother of all ROOT objects.
Definition: TObject.h:37
Basic string class.
Definition: TString.h:131