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 ~TRootContextMenu() override;
35
36 void DisplayPopup(Int_t x, Int_t y) override;
37 void Dialog(TObject *object, TMethod *method) override;
38 void Dialog(TObject *object, TFunction *function) override;
39 void DrawEntry(TGMenuEntry *entry) override;
40 TRootDialog *GetDialog() const { return fDialog; };
41 Bool_t HandleButton(Event_t *event) override;
42 Bool_t HandleCrossing(Event_t *event) override;
43 Bool_t HandleMotion(Event_t *event) override;
44 virtual void OnlineHelp();
45 void RecursiveRemove(TObject *obj) override;
46
47 Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override;
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 ClassDefOverride(TRootContextMenu,0) //ROOT native GUI context sensitive popup menu
55};
56
57#endif
#define c(i)
Definition RSha256.hxx:101
int Int_t
Signed integer 4 bytes (int).
Definition RtypesCore.h:59
long Longptr_t
Integer large enough to hold a pointer (platform-dependent).
Definition RtypesCore.h:89
bool Bool_t
Boolean (0=false, 1=true) (bool).
Definition RtypesCore.h:77
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
#define ClassDefOverride(name, id)
Definition Rtypes.h:348
char name[80]
Definition TGX11.cxx:148
TContextMenuImp(const TContextMenuImp &cmi)
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
TGPopupMenu(const TGPopupMenu &)=delete
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:42
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.
Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override
Handle context menu messages.
void DisplayPopup(Int_t x, Int_t y) override
Display context popup menu for currently selected object.
TRootContextMenu & operator=(const TRootContextMenu &)
Bool_t HandleButton(Event_t *event) override
Handle button event in the context menu.
Bool_t HandleMotion(Event_t *event) override
Handle pointer motion event in context menu.
void RecursiveRemove(TObject *obj) override
Close the context menu if the object is deleted in the RecursiveRemove() operation.
void CreateMenu(TObject *object)
Create the context menu depending on the selected object.
TRootContextMenu(const TRootContextMenu &)
void Dialog(TObject *object, TMethod *method) override
Create dialog object with OK and Cancel buttons.
TList * fTrash
list of objects to be deleted before refilling menu
TRootDialog * fDialog
dialog prompting for command line arguments
void DrawEntry(TGMenuEntry *entry) override
Draw context menu entry.
Bool_t HandleCrossing(Event_t *event) override
Handle pointer crossing event in 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.
~TRootContextMenu() override
Delete a 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:138
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
Event structure.
Definition GuiTypes.h:175