ROOT
v6-20
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
27
class
TList
;
28
class
TClass
;
29
30
31
class
TClassMenuItem
:
public
TObject
{
32
33
public
:
34
enum
EClassMenuItemType
{
35
kPopupUserFunction
,
kPopupSeparator
,
kPopupStandardList
36
};
37
enum
{
kIsExternal
,
kIsSelf
};
38
39
private
:
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
51
protected
:
52
TClassMenuItem
(
const
TClassMenuItem
&);
53
TClassMenuItem
&
operator=
(
const
TClassMenuItem
&);
54
55
public
:
56
TClassMenuItem
();
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
; }
72
virtual
void
SetType
(
Int_t
type
) {
fType
= (
EClassMenuItemType
)
type
; }
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_t
int Int_t
Definition:
RtypesCore.h:41
kFALSE
const Bool_t kFALSE
Definition:
RtypesCore.h:88
Bool_t
bool Bool_t
Definition:
RtypesCore.h:59
kTRUE
const Bool_t kTRUE
Definition:
RtypesCore.h:87
ClassDef
#define ClassDef(name, id)
Definition:
Rtypes.h:326
type
int type
Definition:
TGX11.cxx:120
TObject.h
TString.h
TClassMenuItem
Describes one element of the context menu associated to a class The menu item may describe.
Definition:
TClassMenuItem.h:31
TClassMenuItem::kIsExternal
@ kIsExternal
Definition:
TClassMenuItem.h:37
TClassMenuItem::kIsSelf
@ kIsSelf
Definition:
TClassMenuItem.h:37
TClassMenuItem::SetTitle
virtual void SetTitle(const char *title)
Definition:
TClassMenuItem.h:73
TClassMenuItem::fCalledObject
TObject * fCalledObject
Definition:
TClassMenuItem.h:45
TClassMenuItem::GetArgs
virtual const char * GetArgs() const
Definition:
TClassMenuItem.h:64
TClassMenuItem::fParent
TClass * fParent
Definition:
TClassMenuItem.h:49
TClassMenuItem::SetType
virtual void SetType(Int_t type)
Definition:
TClassMenuItem.h:72
TClassMenuItem::fSelf
Bool_t fSelf
Definition:
TClassMenuItem.h:42
TClassMenuItem::IsSeparator
virtual Bool_t IsSeparator() const
Definition:
TClassMenuItem.h:69
TClassMenuItem::SetToggle
virtual void SetToggle(Bool_t toggle=kTRUE)
Definition:
TClassMenuItem.h:75
TClassMenuItem::IsStandardList
virtual Bool_t IsStandardList() const
Definition:
TClassMenuItem.h:70
TClassMenuItem::IsCallSelf
virtual Bool_t IsCallSelf() const
Definition:
TClassMenuItem.h:68
TClassMenuItem::fFunctionName
TString fFunctionName
Definition:
TClassMenuItem.h:46
TClassMenuItem::fTitle
TString fTitle
Definition:
TClassMenuItem.h:44
TClassMenuItem::GetTitle
virtual const char * GetTitle() const
Returns title of object.
Definition:
TClassMenuItem.h:62
TClassMenuItem::GetCalledObject
virtual TObject * GetCalledObject() const
Definition:
TClassMenuItem.h:65
TClassMenuItem::SetCall
virtual void SetCall(TObject *obj, const char *method, const char *args="", Int_t selfobjposition=0)
Definition:
TClassMenuItem.h:76
TClassMenuItem::GetFunctionName
virtual const char * GetFunctionName() const
Definition:
TClassMenuItem.h:63
TClassMenuItem::fArgs
TString fArgs
Definition:
TClassMenuItem.h:47
TClassMenuItem::fType
EClassMenuItemType fType
Definition:
TClassMenuItem.h:40
TClassMenuItem::GetType
virtual Int_t GetType() const
Definition:
TClassMenuItem.h:66
TClassMenuItem::fToggle
Bool_t fToggle
Definition:
TClassMenuItem.h:43
TClassMenuItem::TClassMenuItem
TClassMenuItem()
Default TClassMenuItem ctor.
Definition:
TClassMenuItem.cxx:41
TClassMenuItem::SetSelf
virtual void SetSelf(Bool_t self)
Definition:
TClassMenuItem.h:74
TClassMenuItem::~TClassMenuItem
virtual ~TClassMenuItem()
TClassMenuItem dtor.
Definition:
TClassMenuItem.cxx:130
TClassMenuItem::EClassMenuItemType
EClassMenuItemType
Definition:
TClassMenuItem.h:34
TClassMenuItem::kPopupStandardList
@ kPopupStandardList
Definition:
TClassMenuItem.h:35
TClassMenuItem::kPopupSeparator
@ kPopupSeparator
Definition:
TClassMenuItem.h:35
TClassMenuItem::kPopupUserFunction
@ kPopupUserFunction
Definition:
TClassMenuItem.h:35
TClassMenuItem::IsToggle
virtual Bool_t IsToggle() const
Definition:
TClassMenuItem.h:71
TClassMenuItem::fSubMenu
TList * fSubMenu
Definition:
TClassMenuItem.h:48
TClassMenuItem::GetSelfObjectPos
virtual Int_t GetSelfObjectPos() const
Definition:
TClassMenuItem.h:67
TClassMenuItem::fSelfObjectPos
Int_t fSelfObjectPos
Definition:
TClassMenuItem.h:41
TClassMenuItem::operator=
TClassMenuItem & operator=(const TClassMenuItem &)
assignment operator
Definition:
TClassMenuItem.cxx:109
TClass
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition:
TClass.h:75
TList
A doubly linked list.
Definition:
TList.h:44
TObject
Mother of all ROOT objects.
Definition:
TObject.h:37
TString
Basic string class.
Definition:
TString.h:131
core
gui
inc
TClassMenuItem.h
ROOT v6-20 - Reference Guide Generated on Fri Apr 1 2022 00:19:48 (GVA Time) using Doxygen 1.9.4