ROOT
6.07/01
Reference Guide
ROOT Home Page
Main Page
Tutorials
User's Classes
Namespaces
All Classes
Files
Release Notes
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
core
meta
inc
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
#ifndef ROOT_TObject
25
#include "
TObject.h
"
26
#endif
27
#ifndef ROOT_TString
28
#include "
TString.h
"
29
#endif
30
31
class
TList
;
32
class
TClass
;
33
34
35
class
TClassMenuItem
:
public
TObject
{
36
37
public
:
38
enum
EClassMenuItemType
{
39
kPopupUserFunction
,
kPopupSeparator
,
kPopupStandardList
40
};
41
enum
{
kIsExternal
,
kIsSelf
};
42
43
private
:
44
EClassMenuItemType
fType
;
//type flag (EClassMenuItemType)
45
Int_t
fSelfObjectPos
;
//rang in argument list corresponding to the object being clicked on
46
Bool_t
fSelf
;
//flag to indicate that object to be called is the selected one
47
Bool_t
fToggle
;
//flag toggle method
48
TString
fTitle
;
//title if not standard
49
TObject
*
fCalledObject
;
//object to be called
50
TString
fFunctionName
;
//name of the function or method to be called
51
TString
fArgs
;
//arguments type list *** NOT CHECKED ***
52
TList
*
fSubMenu
;
//list of submenu items
53
TClass
*
fParent
;
//parent class
54
55
protected
:
56
TClassMenuItem
(
const
TClassMenuItem
&);
57
TClassMenuItem
&
operator=
(
const
TClassMenuItem
&);
58
59
public
:
60
TClassMenuItem
();
61
TClassMenuItem
(
Int_t
type
,
TClass
*parent,
const
char
*
title
=
""
,
62
const
char
*functionname=
""
,
TObject
*
obj
=0,
63
const
char
*args=
""
,
Int_t
selfobjposition=-1,
64
Bool_t
self
=
kFALSE
);
65
virtual
~TClassMenuItem
();
66
virtual
const
char
*
GetTitle
()
const
{
return
fTitle
; }
67
virtual
const
char
*
GetFunctionName
()
const
{
return
fFunctionName
; }
68
virtual
const
char
*
GetArgs
()
const
{
return
fArgs
; }
69
virtual
TObject
*
GetCalledObject
()
const
{
return
fCalledObject
; }
70
virtual
Int_t
GetType
()
const
{
return
fType
; }
71
virtual
Int_t
GetSelfObjectPos
()
const
{
return
fSelfObjectPos
; }
72
virtual
Bool_t
IsCallSelf
()
const
{
return
fSelf
; }
73
virtual
Bool_t
IsSeparator
()
const
{
return
fType
==
kPopupSeparator
?
kTRUE
:
kFALSE
; }
74
virtual
Bool_t
IsStandardList
()
const
{
return
fType
==
kPopupStandardList
?
kTRUE
:
kFALSE
; }
75
virtual
Bool_t
IsToggle
()
const
{
return
fToggle
; }
76
virtual
void
SetType
(
Int_t
type
) {
fType
= (
EClassMenuItemType
) type; }
77
virtual
void
SetTitle
(
const
char
*
title
) {
fTitle
=
title
; }
78
virtual
void
SetSelf
(
Bool_t
self
) {
fSelf
=
self
; }
79
virtual
void
SetToggle
(
Bool_t
toggle =
kTRUE
) {
fToggle
= toggle; }
80
virtual
void
SetCall
(
TObject
*
obj
,
const
char
*method,
81
const
char
*args=
""
,
Int_t
selfobjposition = 0)
82
{
fCalledObject
=
obj
;
fFunctionName
= method;
83
fArgs
= args;
fSelfObjectPos
= selfobjposition;}
84
85
ClassDef
(
TClassMenuItem
,0)
//One element of the class context menu
86
};
87
88
#endif
TClassMenuItem
Describes one element of the context menu associated to a class The menu item may describe...
Definition:
TClassMenuItem.h:35
TClassMenuItem::fTitle
TString fTitle
Definition:
TClassMenuItem.h:48
TClassMenuItem::kPopupUserFunction
Definition:
TClassMenuItem.h:39
TClassMenuItem::kPopupStandardList
Definition:
TClassMenuItem.h:39
TString
Basic string class.
Definition:
TString.h:137
Int_t
int Int_t
Definition:
RtypesCore.h:41
Bool_t
bool Bool_t
Definition:
RtypesCore.h:59
kFALSE
const Bool_t kFALSE
Definition:
Rtypes.h:92
TClassMenuItem::GetSelfObjectPos
virtual Int_t GetSelfObjectPos() const
Definition:
TClassMenuItem.h:71
TClassMenuItem::fParent
TClass * fParent
Definition:
TClassMenuItem.h:53
TClassMenuItem::fSubMenu
TList * fSubMenu
Definition:
TClassMenuItem.h:52
TClassMenuItem::SetToggle
virtual void SetToggle(Bool_t toggle=kTRUE)
Definition:
TClassMenuItem.h:79
TClassMenuItem::SetType
virtual void SetType(Int_t type)
Definition:
TClassMenuItem.h:76
TClassMenuItem::SetTitle
virtual void SetTitle(const char *title)
Definition:
TClassMenuItem.h:77
ClassDef
#define ClassDef(name, id)
Definition:
Rtypes.h:254
TClassMenuItem::IsSeparator
virtual Bool_t IsSeparator() const
Definition:
TClassMenuItem.h:73
TClassMenuItem::kIsExternal
Definition:
TClassMenuItem.h:41
TClassMenuItem::kIsSelf
Definition:
TClassMenuItem.h:41
TClassMenuItem::IsToggle
virtual Bool_t IsToggle() const
Definition:
TClassMenuItem.h:75
TClassMenuItem::IsCallSelf
virtual Bool_t IsCallSelf() const
Definition:
TClassMenuItem.h:72
TClassMenuItem::SetSelf
virtual void SetSelf(Bool_t self)
Definition:
TClassMenuItem.h:78
TClassMenuItem::kPopupSeparator
Definition:
TClassMenuItem.h:39
TClassMenuItem::fToggle
Bool_t fToggle
Definition:
TClassMenuItem.h:47
TList
A doubly linked list.
Definition:
TList.h:47
TString.h
TClassMenuItem::fSelfObjectPos
Int_t fSelfObjectPos
Definition:
TClassMenuItem.h:45
TClassMenuItem::IsStandardList
virtual Bool_t IsStandardList() const
Definition:
TClassMenuItem.h:74
title
TPaveLabel title(3, 27.1, 15, 28.7,"ROOT Environment and Tools")
TClassMenuItem::fCalledObject
TObject * fCalledObject
Definition:
TClassMenuItem.h:49
TClassMenuItem::fFunctionName
TString fFunctionName
Definition:
TClassMenuItem.h:50
TClassMenuItem::fArgs
TString fArgs
Definition:
TClassMenuItem.h:51
TClassMenuItem::GetType
virtual Int_t GetType() const
Definition:
TClassMenuItem.h:70
TClassMenuItem::fSelf
Bool_t fSelf
Definition:
TClassMenuItem.h:46
TClass
The ROOT global object gROOT contains a list of all defined classes.
Definition:
TClass.h:81
TClassMenuItem::SetCall
virtual void SetCall(TObject *obj, const char *method, const char *args="", Int_t selfobjposition=0)
Definition:
TClassMenuItem.h:80
TClassMenuItem::operator=
TClassMenuItem & operator=(const TClassMenuItem &)
assignment operator
Definition:
TClassMenuItem.cxx:109
type
int type
Definition:
TGX11.cxx:120
TClassMenuItem::GetFunctionName
virtual const char * GetFunctionName() const
Definition:
TClassMenuItem.h:67
TObject
Mother of all ROOT objects.
Definition:
TObject.h:58
TClassMenuItem::fType
EClassMenuItemType fType
Definition:
TClassMenuItem.h:44
TObject.h
TClassMenuItem::GetArgs
virtual const char * GetArgs() const
Definition:
TClassMenuItem.h:68
TClassMenuItem::EClassMenuItemType
EClassMenuItemType
Definition:
TClassMenuItem.h:38
TClassMenuItem::~TClassMenuItem
virtual ~TClassMenuItem()
TClassMenuItem dtor.
Definition:
TClassMenuItem.cxx:130
TClassMenuItem::TClassMenuItem
TClassMenuItem()
TClassMenuItem::GetTitle
virtual const char * GetTitle() const
Returns title of object.
Definition:
TClassMenuItem.h:66
kTRUE
const Bool_t kTRUE
Definition:
Rtypes.h:91
TClassMenuItem::GetCalledObject
virtual TObject * GetCalledObject() const
Definition:
TClassMenuItem.h:69
obj
TObject * obj
Definition:
TStreamerInfo.cxx:83