#ifndef ROOT_TClassMenuItem
#define ROOT_TClassMenuItem
#ifndef ROOT_TObject
#include "TObject.h"
#endif
#ifndef ROOT_TString
#include "TString.h"
#endif
class TList;
class TClass;
class TClassMenuItem : public TObject {
public:
enum EClassMenuItemType {
kPopupUserFunction, kPopupSeparator, kPopupStandardList
};
enum { kIsExternal, kIsSelf };
private:
EClassMenuItemType fType;
Int_t fSelfObjectPos;
Bool_t fSelf;
Bool_t fToggle;
TString fTitle;
TObject *fCalledObject;
TString fFunctionName;
TString fArgs;
TList *fSubMenu;
TClass *fParent;
protected:
TClassMenuItem(const TClassMenuItem&);
TClassMenuItem& operator=(const TClassMenuItem&);
public:
TClassMenuItem();
TClassMenuItem(Int_t type, TClass *parent, const char *title="",
const char *functionname="", TObject *obj=0,
const char *args="", Int_t selfobjposition=-1,
Bool_t self=kFALSE);
virtual ~TClassMenuItem();
virtual const char *GetTitle() const { return fTitle; }
virtual const char *GetFunctionName() const { return fFunctionName; }
virtual const char *GetArgs() const { return fArgs; }
virtual TObject *GetCalledObject() const { return fCalledObject; }
virtual Int_t GetType() const { return fType; }
virtual Int_t GetSelfObjectPos() const { return fSelfObjectPos; }
virtual Bool_t IsCallSelf() const { return fSelf; }
virtual Bool_t IsSeparator() const { return fType==kPopupSeparator ? kTRUE : kFALSE; }
virtual Bool_t IsStandardList() const { return fType==kPopupStandardList ? kTRUE : kFALSE; }
virtual Bool_t IsToggle() const { return fToggle; }
virtual void SetType(Int_t type) { fType = (EClassMenuItemType) type; }
virtual void SetTitle(const char *title) { fTitle = title; }
virtual void SetSelf(Bool_t self) { fSelf = self; }
virtual void SetToggle(Bool_t toggle = kTRUE) { fToggle = toggle; }
virtual void SetCall(TObject *obj, const char *method,
const char *args="", Int_t selfobjposition = 0)
{ fCalledObject = obj; fFunctionName = method;
fArgs = args; fSelfObjectPos = selfobjposition;}
ClassDef(TClassMenuItem,0)
};
#endif