Warning, file /include/root/TClassMenuItem.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TClassMenuItem
0013 #define ROOT_TClassMenuItem
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 #include "TObject.h"
0025 #include "TString.h"
0026
0027 class TList;
0028 class TClass;
0029
0030
0031 class TClassMenuItem : public TObject {
0032
0033 public:
0034 enum EClassMenuItemType {
0035 kPopupUserFunction, kPopupSeparator, kPopupStandardList
0036 };
0037 enum { kIsExternal, kIsSelf };
0038
0039 private:
0040 EClassMenuItemType fType;
0041 Int_t fSelfObjectPos;
0042 Bool_t fSelf;
0043 Bool_t fToggle;
0044 TString fTitle;
0045 TObject *fCalledObject;
0046 TString fFunctionName;
0047 TString fArgs;
0048 TList *fSubMenu;
0049 TClass *fParent;
0050
0051 protected:
0052 TClassMenuItem(const TClassMenuItem&);
0053 TClassMenuItem& operator=(const TClassMenuItem&);
0054
0055 public:
0056 TClassMenuItem();
0057 TClassMenuItem(Int_t type, TClass *parent, const char *title="",
0058 const char *functionname="", TObject *obj=nullptr,
0059 const char *args="", Int_t selfobjposition=-1,
0060 Bool_t self=kFALSE);
0061 virtual ~TClassMenuItem();
0062 const char *GetTitle() const override { return fTitle.Data(); }
0063 virtual const char *GetFunctionName() const { return fFunctionName; }
0064 virtual const char *GetArgs() const { return fArgs; }
0065 virtual TObject *GetCalledObject() const { return fCalledObject; }
0066 virtual Int_t GetType() const { return fType; }
0067 virtual Int_t GetSelfObjectPos() const { return fSelfObjectPos; }
0068 virtual Bool_t IsCallSelf() const { return fSelf; }
0069 virtual Bool_t IsSeparator() const { return fType==kPopupSeparator ? kTRUE : kFALSE; }
0070 virtual Bool_t IsStandardList() const { return fType==kPopupStandardList ? kTRUE : kFALSE; }
0071 virtual Bool_t IsToggle() const { return fToggle; }
0072 virtual void SetType(Int_t type) { fType = (EClassMenuItemType) type; }
0073 virtual void SetTitle(const char *title) { fTitle = title; }
0074 virtual void SetSelf(Bool_t self) { fSelf = self; }
0075 virtual void SetToggle(Bool_t toggle = kTRUE) { fToggle = toggle; }
0076 virtual void SetCall(TObject *obj, const char *method,
0077 const char *args="", Int_t selfobjposition = 0)
0078 { fCalledObject = obj; fFunctionName = method;
0079 fArgs = args; fSelfObjectPos = selfobjposition;}
0080
0081 ClassDefOverride(TClassMenuItem,0)
0082 };
0083
0084 #endif