Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TRootContextMenu.h
Go to the documentation of this file.
1// @(#)root/gui:$Id$
2// Author: Fons Rademakers 12/02/98
3
4/*************************************************************************
5 * Copyright (C) 1995-2021, 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_TRootContextMenu
13#define ROOT_TRootContextMenu
14
15
16#include "TContextMenuImp.h"
17#include "TGMenu.h"
18
19class TRootDialog;
20
21
23
24private:
25 TRootDialog *fDialog; ///< dialog prompting for command line arguments
26 TList *fTrash; ///< list of objects to be deleted before refilling menu
27
30 void CreateMenu(TObject *object);
31
32public:
33 TRootContextMenu(TContextMenu *c = nullptr, const char *name = "ROOT Context Menu");
34 virtual ~TRootContextMenu();
35
36 virtual void DisplayPopup(Int_t x, Int_t y);
37 virtual void Dialog(TObject *object, TMethod *method);
38 virtual void Dialog(TObject *object, TFunction *function);
39 virtual void DrawEntry(TGMenuEntry *entry);
40 TRootDialog *GetDialog() const { return fDialog; };
44 virtual void OnlineHelp();
45 virtual void RecursiveRemove(TObject *obj);
46
48
49protected:
50 TGPopupMenu * FindHierarchy(const char *commentstring, TString &last_component);
51 void AddEntrySorted(TGPopupMenu *current, const char *s, Int_t id, void *ud = nullptr,
52 const TGPicture *p = nullptr, Bool_t sorted = kTRUE);
53
54 ClassDef(TRootContextMenu,0) //ROOT native GUI context sensitive popup menu
55};
56
57#endif
#define c(i)
Definition RSha256.hxx:101
int Int_t
Definition RtypesCore.h:45
long Longptr_t
Definition RtypesCore.h:82
bool Bool_t
Definition RtypesCore.h:63
const Bool_t kTRUE
Definition RtypesCore.h:100
#define ClassDef(name, id)
Definition Rtypes.h:325
char name[80]
Definition TGX11.cxx:110
This class provides an interface to GUI independent context sensitive popup menus.
This class provides an interface to context sensitive popup menus.
Global functions class (global functions are obtained from CINT).
Definition TFunction.h:30
This class contains all information about a menu entry.
Definition TGMenu.h:57
The TGPicture class implements pictures and icons used in the different GUI elements and widgets.
Definition TGPicture.h:25
This class creates a popup menu object.
Definition TGMenu.h:110
A doubly linked list.
Definition TList.h:38
Each ROOT class (see TClass) has a linked list of methods.
Definition TMethod.h:38
Mother of all ROOT objects.
Definition TObject.h:41
This class provides an interface to context sensitive popup menus.
Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2)
Handle context menu messages.
TGPopupMenu * FindHierarchy(const char *commentstring, TString &last_component)
Decodes the Hierarchy="Level0/Level1/Level2/..." statement from the comment field and returns the - i...
virtual void OnlineHelp()
Open the online help matching the actual class/method.
virtual Bool_t HandleButton(Event_t *event)
Handle button event in the context menu.
TRootContextMenu & operator=(const TRootContextMenu &)
virtual void Dialog(TObject *object, TMethod *method)
Create dialog object with OK and Cancel buttons.
virtual Bool_t HandleMotion(Event_t *event)
Handle pointer motion event in context menu.
virtual void RecursiveRemove(TObject *obj)
Close the context menu if the object is deleted in the RecursiveRemove() operation.
virtual void DisplayPopup(Int_t x, Int_t y)
Display context popup menu for currently selected object.
void CreateMenu(TObject *object)
Create the context menu depending on the selected object.
TRootContextMenu(const TRootContextMenu &)
TList * fTrash
list of objects to be deleted before refilling menu
TRootDialog * fDialog
dialog prompting for command line arguments
virtual ~TRootContextMenu()
Delete a context menu.
void AddEntrySorted(TGPopupMenu *current, const char *s, Int_t id, void *ud=nullptr, const TGPicture *p=nullptr, Bool_t sorted=kTRUE)
Add a entry to current menu with alphabetical ordering.
virtual void DrawEntry(TGMenuEntry *entry)
Draw context menu entry.
virtual Bool_t HandleCrossing(Event_t *event)
Handle pointer crossing event in context menu.
TRootDialog * GetDialog() const
A TRootDialog is used to prompt for the arguments of an object's member function.
Definition TRootDialog.h:21
Basic string class.
Definition TString.h:136
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
Event structure.
Definition GuiTypes.h:174