TRootContextMenu.h

Go to the documentation of this file.
00001 // @(#)root/gui:$Id: TRootContextMenu.h 32061 2010-01-20 07:51:15Z bellenot $
00002 // Author: Fons Rademakers   12/02/98
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TRootContextMenu
00013 #define ROOT_TRootContextMenu
00014 
00015 
00016 //////////////////////////////////////////////////////////////////////////
00017 //                                                                      //
00018 // TRootContextMenu                                                     //
00019 //                                                                      //
00020 // This class provides an interface to context sensitive popup menus.   //
00021 // These menus pop up when the user hits the right mouse button, and    //
00022 // are destroyed when the menu pops downs.                              //
00023 //                                                                      //
00024 //////////////////////////////////////////////////////////////////////////
00025 
00026 #ifndef ROOT_TContextMenuImp
00027 #include "TContextMenuImp.h"
00028 #endif
00029 #ifndef ROOT_TGMenu
00030 #include "TGMenu.h"
00031 #endif
00032 
00033 class TRootDialog;
00034 
00035 
00036 class TRootContextMenu : public TGPopupMenu, public TContextMenuImp {
00037 
00038 private:
00039    TRootDialog *fDialog;    // dialog prompting for command line arguments
00040    TList       *fTrash;     // list of objects to be deleted before refilling menu
00041 
00042    TRootContextMenu(const TRootContextMenu&);
00043    TRootContextMenu& operator=(const TRootContextMenu&);
00044    void CreateMenu(TObject *object);
00045 
00046 public:
00047    TRootContextMenu(TContextMenu *c = 0, const char *name = "ROOT Context Menu");
00048    virtual ~TRootContextMenu();
00049 
00050    virtual void   DisplayPopup(Int_t x, Int_t y);
00051    virtual void   Dialog(TObject *object, TMethod *method);
00052    virtual void   Dialog(TObject *object, TFunction *function);
00053    virtual void   DrawEntry(TGMenuEntry *entry);
00054    TRootDialog   *GetDialog() const { return fDialog; };
00055    virtual Bool_t HandleButton(Event_t *event);
00056    virtual Bool_t HandleCrossing(Event_t *event);
00057    virtual Bool_t HandleMotion(Event_t *event);
00058    virtual void   OnlineHelp();
00059    virtual void   RecursiveRemove(TObject *obj);
00060 
00061    Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
00062 
00063 protected:
00064    TGPopupMenu * FindHierarchy(const char *commentstring, TString &last_component);
00065    void AddEntrySorted(TGPopupMenu *current, const char *s, Int_t id, void *ud = 0,
00066                        const TGPicture *p = 0, Bool_t sorted = kTRUE);
00067 
00068    ClassDef(TRootContextMenu,0)  //ROOT native GUI context sensitive popup menu
00069 };
00070 
00071 #endif

Generated on Tue Jul 5 14:20:11 2011 for ROOT_528-00b_version by  doxygen 1.5.1