library: libGui #include "TRootContextMenu.h"

# TRootContextMenu

class description - source file - inheritance tree (.pdf)

## class TRootContextMenu : public TGPopupMenu, public TContextMenuImp

| Inheritance Chart:

`TObject`

<-

`TGObject`

<-

`TGWindow`

`TQObject`

<-

`TGFrame`

<-

`TGPopupMenu`

`TContextMenuImp`

<-

`TRootContextMenu`

        private:

          void CreateMenu(TObject* object)

        public:

                           TRootContextMenu(TContextMenu* c = 0, const char* name = "ROOT Context Menu")
                           TRootContextMenu(const TRootContextMenu&)
                   virtual ~TRootContextMenu()
            static TClass* Class()
              virtual void Dialog(TObject* object, TMethod* method)
              virtual void Dialog(TObject* object, TFunction* function)
              virtual void DisplayPopup(Int_t x, Int_t y)
              TRootDialog* GetDialog() const
           virtual TClass* IsA() const
            virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
              virtual void ShowMembers(TMemberInspector& insp, char* parent)
              virtual void Streamer(TBuffer& b)
                      void StreamerNVirtual(TBuffer& b)

### Data Members

        private:

          TRootDialog* fDialog  dialog prompting for command line arguments
                TList* fTrash   list of objects to be deleted before refilling menu

## Class Description

     TRootContextMenu

     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.
     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.

TRootContextMenu(TContextMenu *c, const char *) : TGPopupMenu(gClient->GetDefaultRoot()), TContextMenuImp(c)

     Create context menu.

~TRootContextMenu()

     Delete a context menu.

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.

void Dialog(TObject *object, TMethod *method)

     Create dialog object with OK and Cancel buttons. This dialog
     prompts for the arguments of "method".

void Dialog(TObject *object, TFunction *function)

     Create dialog object with OK and Cancel buttons. This dialog
     prompts for the arguments of "function".
     function may be a global function or a method

Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)

     Handle context menu messages.

### Inline Functions

                TRootDialog* GetDialog() const
                     TClass* Class()
                     TClass* IsA() const
                        void ShowMembers(TMemberInspector& insp, char* parent)
                        void Streamer(TBuffer& b)
                        void StreamerNVirtual(TBuffer& b)
            TRootContextMenu TRootContextMenu(const TRootContextMenu&)

Author: Fons Rademakers 12/02/98
Last update: root/gui:$Name: $:$Id: TRootContextMenu.cxx,v 1.13 2005/06/21 17:09:26 brun Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *