Logo ROOT   6.08/07
Reference Guide
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-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_TRootContextMenu
13 #define ROOT_TRootContextMenu
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TRootContextMenu //
19 // //
20 // This class provides an interface to context sensitive popup menus. //
21 // These menus pop up when the user hits the right mouse button, and //
22 // are destroyed when the menu pops downs. //
23 // //
24 //////////////////////////////////////////////////////////////////////////
25 
26 #ifndef ROOT_TContextMenuImp
27 #include "TContextMenuImp.h"
28 #endif
29 #ifndef ROOT_TGMenu
30 #include "TGMenu.h"
31 #endif
32 
33 class TRootDialog;
34 
35 
37 
38 private:
39  TRootDialog *fDialog; // dialog prompting for command line arguments
40  TList *fTrash; // list of objects to be deleted before refilling menu
41 
44  void CreateMenu(TObject *object);
45 
46 public:
47  TRootContextMenu(TContextMenu *c = 0, const char *name = "ROOT Context Menu");
48  virtual ~TRootContextMenu();
49 
50  virtual void DisplayPopup(Int_t x, Int_t y);
51  virtual void Dialog(TObject *object, TMethod *method);
52  virtual void Dialog(TObject *object, TFunction *function);
53  virtual void DrawEntry(TGMenuEntry *entry);
54  TRootDialog *GetDialog() const { return fDialog; };
55  virtual Bool_t HandleButton(Event_t *event);
56  virtual Bool_t HandleCrossing(Event_t *event);
57  virtual Bool_t HandleMotion(Event_t *event);
58  virtual void OnlineHelp();
59  virtual void RecursiveRemove(TObject *obj);
60 
61  Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
62 
63 protected:
64  TGPopupMenu * FindHierarchy(const char *commentstring, TString &last_component);
65  void AddEntrySorted(TGPopupMenu *current, const char *s, Int_t id, void *ud = 0,
66  const TGPicture *p = 0, Bool_t sorted = kTRUE);
67 
68  ClassDef(TRootContextMenu,0) //ROOT native GUI context sensitive popup menu
69 };
70 
71 #endif
This class provides an interface to GUI independent context sensitive popup menus.
return c
virtual void DisplayPopup(Int_t x, Int_t y)
Display context popup menu for currently selected object.
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual Bool_t HandleCrossing(Event_t *event)
Handle pointer crossing event in context menu.
virtual ~TRootContextMenu()
Delete a context menu.
TGPopupMenu * FindHierarchy(const char *commentstring, TString &last_component)
Decodes the Hierarchy="Level0/Level1/Level2/..." statement from the comment field and returns the - i...
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:254
TRootContextMenu(const TRootContextMenu &)
Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Handle context menu messages.
virtual void RecursiveRemove(TObject *obj)
Close the context menu if the object is deleted in the RecursiveRemove() operation.
A doubly linked list.
Definition: TList.h:47
virtual void DrawEntry(TGMenuEntry *entry)
Draw context menu entry.
virtual void Dialog(TObject *object, TMethod *method)
Create dialog object with OK and Cancel buttons.
This class provides an interface to context sensitive popup menus.
Definition: TContextMenu.h:44
TRootContextMenu & operator=(const TRootContextMenu &)
void AddEntrySorted(TGPopupMenu *current, const char *s, Int_t id, void *ud=0, const TGPicture *p=0, Bool_t sorted=kTRUE)
Add a entry to current menu with alphabetical ordering.
long Long_t
Definition: RtypesCore.h:50
virtual Bool_t HandleButton(Event_t *event)
Handle button event in the context menu.
TRootDialog * GetDialog() const
Double_t y[n]
Definition: legend1.C:17
virtual Bool_t HandleMotion(Event_t *event)
Handle pointer motion event in context menu.
TRootDialog * fDialog
Mother of all ROOT objects.
Definition: TObject.h:37
Global functions class (global functions are obtained from CINT).
Definition: TFunction.h:30
void CreateMenu(TObject *object)
Create the context menu depending on the selected object.
Each ROOT class (see TClass) has a linked list of methods.
Definition: TMethod.h:40
virtual void OnlineHelp()
Open the online help matching the actual class/method.
const Bool_t kTRUE
Definition: Rtypes.h:91
char name[80]
Definition: TGX11.cxx:109