/usr/include/root/TContextMenu.h is in libroot-core-dev 5.34.14-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | // @(#)root/base:$Id$
// Author: Nenad Buncic 08/02/96
/*************************************************************************
* Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOT_TContextMenu
#define ROOT_TContextMenu
////////////////////////////////////////////////////////////////////////////////
// //
// 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. //
// //
////////////////////////////////////////////////////////////////////////////////
#ifndef ROOT_TContextMenuImp
#include "TContextMenuImp.h"
#endif
#ifndef ROOT_TNamed
#include "TNamed.h"
#endif
class TMethod;
class TFunction;
class TMethodArg;
class TVirtualPad;
class TObjArray;
class TBrowser;
class TToggle;
class TClassMenuItem;
class TContextMenu : public TNamed {
friend class TContextMenuImp;
private:
TContextMenu(const TContextMenu&); // TContextMenu can not be copied since we do not know the actual type of the TContextMenuImp (and it can not be 'Cloned')
TContextMenu& operator=(const TContextMenu&); // TContextMenu can not be copied since we do not know the actual type of the TContextMenuImp (and it can not be 'Cloned')
protected:
TContextMenuImp *fContextMenuImp; //!Context menu system specific implementation
TFunction *fSelectedMethod; //selected method
TObject *fSelectedObject; //selected object
TObject *fCalledObject; //object to call
TClassMenuItem *fSelectedMenuItem; //selected class menu item
TVirtualPad *fSelectedCanvas; //selected canvas (if exist)
TVirtualPad *fSelectedPad; //selected pad (if exist)
TBrowser *fBrowser; //selected browser (if exist)
virtual void DisplayPopUp(Int_t x, Int_t y)
{ if (fContextMenuImp) fContextMenuImp->DisplayPopup(x, y); }
private:
TContextMenu();
public:
TContextMenu(const char *name, const char *title = "Context sensitive popup menu");
virtual ~TContextMenu();
virtual void Action(TObject *object, TMethod *method);
virtual void Action(TObject *object, TToggle *toggle);
virtual void Action(TClassMenuItem *classmenuitem);
void Action(TMethod *method) { Action(fSelectedObject, method); }
void Action(TToggle *toggle) { Action(fSelectedObject, toggle); }
virtual const char *CreateArgumentTitle(TMethodArg *argument);
virtual const char *CreateDialogTitle(TObject *object, TFunction *method);
virtual const char *CreatePopupTitle(TObject *object );
virtual void Execute(const char *method, const char *params, Int_t *error=0) { TObject::Execute(method, params, error); }
virtual void Execute(TMethod *method, TObjArray *params, Int_t *error=0) { TObject::Execute(method, params, error); }
virtual void Execute(TObject *object, TFunction *method, const char *params);
virtual void Execute(TObject *object, TFunction *method, TObjArray *params);
void Execute(const char *params) { Execute(fCalledObject, fSelectedMethod, params); }
void Execute(TObjArray *params) { Execute(fCalledObject, fSelectedMethod, params); }
virtual TBrowser *GetBrowser() { return fBrowser; }
virtual TContextMenuImp *GetContextMenuImp() { return fContextMenuImp; }
virtual TVirtualPad *GetSelectedCanvas() { return fSelectedCanvas; }
virtual TFunction *GetSelectedMethod() { return fSelectedMethod; }
virtual TObject *GetSelectedObject() { return fSelectedObject; }
virtual TObject *GetCalledObject() { return fCalledObject; }
virtual TClassMenuItem *GetSelectedMenuItem() { return fSelectedMenuItem; }
virtual TVirtualPad *GetSelectedPad() { return fSelectedPad; }
virtual void Popup(Int_t x, Int_t y, TObject *obj, TVirtualPad *c=0, TVirtualPad *p=0); // Create menu from canvas
virtual void Popup(Int_t x, Int_t y, TObject *obj, TBrowser *b); // Create menu from Browser
virtual void SetCanvas(TVirtualPad *c) { fSelectedCanvas = c; }
virtual void SetBrowser(TBrowser *b) { fBrowser = b; }
virtual void SetMethod(TFunction *m) { fSelectedMethod = m; }
virtual void SetCalledObject(TObject *o) { fCalledObject = o; }
virtual void SetSelectedMenuItem(TClassMenuItem *mi) { fSelectedMenuItem = mi; }
virtual void SetNameTitle(const char *name, const char *title) { TNamed::SetNameTitle(name, title); }
virtual void SetObject(TObject *o) { fSelectedObject = o; }
virtual void SetPad(TVirtualPad *p) { fSelectedPad = p; }
ClassDef(TContextMenu,0) //Context sensitive popup menu
};
#endif
|