DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
Public Types | Public Member Functions | Protected Attributes | List of all members
dd4hep::PopupMenu Class Reference

class PopupMenu PopupMenu.h DDEve/PopupMenu.h More...

#include <PopupMenu.h>

Inheritance diagram for dd4hep::PopupMenu:
dd4hep::DD4hepMenu dd4hep::ViewMenu

Public Types

typedef std::map< int, CallbackCallbacks
 

Public Member Functions

 PopupMenu (const TGWindow *parent)
 Standard constructor. More...
 
virtual ~PopupMenu ()
 Default destructor. More...
 
void HandleMenu (int id)
 Handle menu items. More...
 
TGPopupMenu & menu ()
 Access to implementation. More...
 
virtual void Build (TGMenuBar *menuBar, int hints=kLHintsNormal)
 Add the menu to the menu bar. More...
 
virtual void AddSeparator (TGMenuEntry *before=0)
 Add a menu separator to the menu. More...
 
virtual void AddLabel (const char *label, const TGPicture *p=0, TGMenuEntry *before=0)
 Add a menu label to the menu. More...
 
virtual void AddPopup (const char *name, TGPopupMenu *popup, TGMenuEntry *before=0, const TGPicture *p=0)
 Add a (cascading) popup menu to a popup menu. More...
 
virtual int AddEntry (const char *name, Callback cb, void *ud=0, const TGPicture *p=0, TGMenuEntry *before=0)
 Add a new popup menu entry with a callback. More...
 
template<typename T >
int AddEntry (const char *name, T *ptr, void(T::*pmf)(TGMenuEntry *, void *), void *ud=0, const TGPicture *p=0, TGMenuEntry *before=0)
 Add a new popup menu entry with a callback. More...
 
void CheckEntry (int id)
 Check menu entry. More...
 
void UnCheckEntry (int id)
 Uncheck menu entry. More...
 
bool IsEntryChecked (int id)
 Get check-value. More...
 
TGPopupMenu * operator-> ()
 Public access to the popup menu using '->'. More...
 
 operator TGPopupMenu * ()
 Public access to the popup menu using '->'. More...
 
 ClassDef (PopupMenu, 0)
 

Protected Attributes

Callbacks m_calls
 Callback map. More...
 
TGPopupMenu m_popup
 
int m_cmd
 

Detailed Description

class PopupMenu PopupMenu.h DDEve/PopupMenu.h

Definition at line 36 of file PopupMenu.h.

Member Typedef Documentation

◆ Callbacks

typedef std::map<int,Callback> dd4hep::PopupMenu::Callbacks

Definition at line 38 of file PopupMenu.h.

Constructor & Destructor Documentation

◆ PopupMenu()

dd4hep::PopupMenu::PopupMenu ( const TGWindow *  parent)

Standard constructor.

◆ ~PopupMenu()

PopupMenu::~PopupMenu ( )
virtual

Default destructor.

Definition at line 34 of file PopupMenu.cpp.

Member Function Documentation

◆ AddEntry() [1/2]

int PopupMenu::AddEntry ( const char *  name,
Callback  cb,
void *  ud = 0,
const TGPicture *  p = 0,
TGMenuEntry *  before = 0 
)
virtual

Add a new popup menu entry with a callback.

Definition at line 60 of file PopupMenu.cpp.

◆ AddEntry() [2/2]

template<typename T >
int dd4hep::PopupMenu::AddEntry ( const char *  name,
T *  ptr,
void(T::*)(TGMenuEntry *, void *)  pmf,
void *  ud = 0,
const TGPicture *  p = 0,
TGMenuEntry *  before = 0 
)
inline

Add a new popup menu entry with a callback.

Definition at line 68 of file PopupMenu.h.

◆ AddLabel()

void PopupMenu::AddLabel ( const char *  label,
const TGPicture *  p = 0,
TGMenuEntry *  before = 0 
)
virtual

Add a menu label to the menu.

Definition at line 50 of file PopupMenu.cpp.

◆ AddPopup()

void PopupMenu::AddPopup ( const char *  name,
TGPopupMenu *  popup,
TGMenuEntry *  before = 0,
const TGPicture *  p = 0 
)
virtual

Add a (cascading) popup menu to a popup menu.

Definition at line 55 of file PopupMenu.cpp.

◆ AddSeparator()

void PopupMenu::AddSeparator ( TGMenuEntry *  before = 0)
virtual

Add a menu separator to the menu.

Definition at line 45 of file PopupMenu.cpp.

◆ Build()

void PopupMenu::Build ( TGMenuBar *  menuBar,
int  hints = kLHintsNormal 
)
virtual

Add the menu to the menu bar.

Reimplemented in dd4hep::DD4hepMenu, and dd4hep::ViewMenu.

Definition at line 41 of file PopupMenu.cpp.

◆ CheckEntry()

void PopupMenu::CheckEntry ( int  id)

Check menu entry.

Definition at line 81 of file PopupMenu.cpp.

◆ ClassDef()

dd4hep::PopupMenu::ClassDef ( PopupMenu  ,
 
)

◆ HandleMenu()

void PopupMenu::HandleMenu ( int  id)

Handle menu items.

Definition at line 67 of file PopupMenu.cpp.

◆ IsEntryChecked()

bool PopupMenu::IsEntryChecked ( int  id)

Get check-value.

Definition at line 91 of file PopupMenu.cpp.

◆ menu()

TGPopupMenu& dd4hep::PopupMenu::menu ( )
inline

Access to implementation.

Definition at line 53 of file PopupMenu.h.

◆ operator TGPopupMenu *()

dd4hep::PopupMenu::operator TGPopupMenu * ( )
inline

Public access to the popup menu using '->'.

Definition at line 81 of file PopupMenu.h.

◆ operator->()

TGPopupMenu* dd4hep::PopupMenu::operator-> ( )
inline

Public access to the popup menu using '->'.

Definition at line 79 of file PopupMenu.h.

◆ UnCheckEntry()

void PopupMenu::UnCheckEntry ( int  id)

Uncheck menu entry.

Definition at line 86 of file PopupMenu.cpp.

Member Data Documentation

◆ m_calls

Callbacks dd4hep::PopupMenu::m_calls
protected

Callback map.

Definition at line 41 of file PopupMenu.h.

◆ m_cmd

int dd4hep::PopupMenu::m_cmd
protected

Definition at line 43 of file PopupMenu.h.

◆ m_popup

TGPopupMenu dd4hep::PopupMenu::m_popup
protected

Definition at line 42 of file PopupMenu.h.


The documentation for this class was generated from the following files: