class TContextMenu: public TNamed


TContextMenu

This class provides an interface to  context sensitive popup menus.
These menus pop up when the user hits the right mouse button, and
are destroyed when the menu pops downs.

Context Menus are automatically generated by ROOT using the
following convention: if the string // *MENU* is found in the
comment field of a member function. This function will be added to
the list of items in the menu.

The picture below shows a canvas with a pop-up menu.

                      

 The picture below shows a canvas with a pop-up menu and a dialog box.

                    

Function Members (Methods)

public:
TContextMenu(const char* name, const char* title = "Context sensitive popup menu")
virtual~TContextMenu()
voidTObject::AbstractMethod(const char* method) const
virtual voidAction(TClassMenuItem* classmenuitem)
voidAction(TMethod* method)
voidAction(TToggle* toggle)
virtual voidAction(TObject* object, TMethod* method)
virtual voidAction(TObject* object, TToggle* toggle)
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTNamed::Clear(Option_t* option = "")
virtual TObject*TNamed::Clone(const char* newname = "") const
virtual Int_tTNamed::Compare(const TObject* obj) const
virtual voidTNamed::Copy(TObject& named) const
virtual char*CreateArgumentTitle(TMethodArg* argument)
virtual char*CreateDialogTitle(TObject* object, TFunction* method)
virtual char*CreatePopupTitle(TObject* object)
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
voidExecute(const char* params)
voidExecute(TObjArray* params)
virtual voidExecute(const char* method, const char* params, Int_t* error = 0)
virtual voidExecute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidExecute(TObject* object, TFunction* method, const char* params)
virtual voidExecute(TObject* object, TFunction* method, TObjArray* params)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual voidTNamed::FillBuffer(char*& buffer)
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
virtual TBrowser*GetBrowser()
virtual TObject*GetCalledObject()
virtual TContextMenuImp*GetContextMenuImp()
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual const char*TObject::GetIconName() const
virtual const char*TNamed::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
virtual TVirtualPad*GetSelectedCanvas()
virtual TClassMenuItem*GetSelectedMenuItem()
virtual TFunction*GetSelectedMethod()
virtual TObject*GetSelectedObject()
virtual TVirtualPad*GetSelectedPad()
virtual const char*TNamed::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTNamed::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTNamed::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTNamed::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual Bool_tTObject::Notify()
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidPopup(Int_t x, Int_t y, TObject* obj, TBrowser* b)
virtual voidPopup(Int_t x, Int_t y, TObject* obj, TVirtualPad* c = 0, TVirtualPad* p = 0)
virtual voidTNamed::Print(Option_t* option = "") const
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(basic_ostream<char,char_traits<char> >& out, Option_t* option = "")
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual voidSetBrowser(TBrowser* b)
virtual voidSetCalledObject(TObject* o)
virtual voidSetCanvas(TVirtualPad* c)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
virtual voidSetMethod(TFunction* m)
virtual voidTNamed::SetName(const char* name)MENU
virtual voidSetNameTitle(const char* name, const char* title)
virtual voidSetObject(TObject* o)
static voidTObject::SetObjectStat(Bool_t stat)
virtual voidSetPad(TVirtualPad* p)
virtual voidSetSelectedMenuItem(TClassMenuItem* mi)
virtual voidTNamed::SetTitle(const char* title = "")MENU
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual Int_tTNamed::Sizeof() const
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
protected:
virtual voidDisplayPopUp(Int_t x, Int_t y)
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()
private:
TContextMenu()
TContextMenu(const TContextMenu&)
TContextMenu&operator=(const TContextMenu&)

Data Members

public:
enum TObject::EStatusBits { kCanDelete
kMustCleanup
kObjInCanvas
kIsReferenced
kHasUUID
kCannotPick
kNoContextMenu
kInvalidObject
};
enum TObject::[unnamed] { kIsOnHeap
kNotDeleted
kZombie
kBitMask
kSingleKey
kOverwrite
kWriteDelete
};
protected:
TBrowser*fBrowserselected browser (if exist)
TObject*fCalledObjectobject to call
TContextMenuImp*fContextMenuImp!Context menu system specific implementation
TStringTNamed::fNameobject identifier
TVirtualPad*fSelectedCanvasselected canvas (if exist)
TClassMenuItem*fSelectedMenuItemselected class menu item
TFunction*fSelectedMethodselected method
TObject*fSelectedObjectselected object
TVirtualPad*fSelectedPadselected pad (if exist)
TStringTNamed::fTitleobject title

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TContextMenu(const char* name, const char* title = "Context sensitive popup menu")
 Create a context menu.
~TContextMenu()
 Destroy a context menu.
void Action(TObject *object, TMethod *method)
 Action to be performed when this menu item is selected.
 If the selected method requires arguments we popup an
 automatically generated dialog, otherwise the method is
 directly executed.
void Action(TClassMenuItem *menuitem)
 Action to be performed when this menu item is selected.
 If the selected method requires arguments we popup an
 automatically generated dialog, otherwise the method is
 directly executed.
void Action(TObject *object, TToggle *toggle)
 Action to be performed when this toggle menu item is selected.
char * CreateArgumentTitle(TMethodArg* argument)
 Create string describing argument (for use in dialog box).
char * CreateDialogTitle(TObject* object, TFunction* method)
 Create title for dialog box retrieving argument values.
char * CreatePopupTitle(TObject* object)
 Create title for popup menu.
void Execute(TObject *object, TFunction *method, const char *params)
 Execute method with specified arguments for specified object.
void Execute(TObject *object, TFunction *method, TObjArray *params)
 Execute method with specified arguments for specified object.
void Popup(Int_t x, Int_t y, TObject* obj, TVirtualPad* c = 0, TVirtualPad* p = 0)
 Popup context menu at given location in canvas c and pad p for selected
 object.
void Popup(Int_t x, Int_t y, TObject* obj, TBrowser* b)
 Popup context menu at given location in browser b for selected object.
TContextMenu(const TContextMenu& )
TContextMenu& operator=(const TContextMenu& )
void DisplayPopUp(Int_t x, Int_t y)
{ if (fContextMenuImp) fContextMenuImp->DisplayPopup(x, y); }
TContextMenu()
void Action(TObject *object, TMethod *method)
void Action(TObject *object, TToggle *toggle)
void Execute(const char *method, const char *params, Int_t *error=0)
{ TObject::Execute(method, params, error); }
void Execute(TMethod *method, TObjArray *params, Int_t *error=0)
{ TObject::Execute(method, params, error); }
void Execute(TObject *object, TFunction *method, const char *params)
void Execute(TObject *object, TFunction *method, TObjArray *params)
TBrowser * GetBrowser()
{ return fBrowser; }
TContextMenuImp * GetContextMenuImp()
{ return fContextMenuImp; }
TVirtualPad * GetSelectedCanvas()
{ return fSelectedCanvas; }
TFunction * GetSelectedMethod()
{ return fSelectedMethod; }
TObject * GetSelectedObject()
{ return fSelectedObject; }
TObject * GetCalledObject()
{ return fCalledObject; }
TClassMenuItem * GetSelectedMenuItem()
{ return fSelectedMenuItem; }
TVirtualPad * GetSelectedPad()
{ return fSelectedPad; }
void SetCanvas(TVirtualPad* c)
{ fSelectedCanvas = c; }
void SetBrowser(TBrowser* b)
{ fBrowser = b; }
void SetMethod(TFunction* m)
{ fSelectedMethod = m; }
void SetCalledObject(TObject* o)
{ fCalledObject = o; }
void SetSelectedMenuItem(TClassMenuItem* mi)
{ fSelectedMenuItem = mi; }
void SetNameTitle(const char* name, const char* title)
{ TNamed::SetNameTitle(name, title); }
void SetObject(TObject* o)
{ fSelectedObject = o; }
void SetPad(TVirtualPad* p)
{ fSelectedPad = p; }

Author: Nenad Buncic 08/02/96
Last change: root/base:$Id: TContextMenu.h 26615 2008-12-03 00:57:41Z pcanal $
Last generated: 2008-12-03 08:49
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.