Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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=nullptr,
59 const char *args="", Int_t selfobjposition=-1,
60 Bool_t self=kFALSE);
61 virtual ~TClassMenuItem();
62 const char *GetTitle() const override { return fTitle.Data(); }
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 ClassDefOverride(TClassMenuItem,0) //One element of the class context menu
82};
83
84#endif
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
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
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
const char * GetTitle() const override
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:81
A doubly linked list.
Definition TList.h:38
Mother of all ROOT objects.
Definition TObject.h:41
Basic string class.
Definition TString.h:139
const char * Data() const
Definition TString.h:380