Public Member Functions | Private Attributes | List of all members
evdb::EditMenu Class Reference

The edit pull down menu. More...

#include <EditMenu.h>

Public Member Functions

 EditMenu (TGMenuBar *menubar, TGMainFrame *mf)
 
virtual ~EditMenu ()
 
void SetServices ()
 
void MenuSelect (int which)
 
void WipeMenu (TGPopupMenu *m)
 

Private Attributes

TGPopupMenu * fEditMenu
 The file menu. More...
 
TGPopupMenu * fDrawingMenu
 Drawing options. More...
 
TGPopupMenu * fExpMenu
 Experiment services. More...
 
TGLayoutHints * fLayout
 How to layout the menu. More...
 

Detailed Description

The edit pull down menu.

Definition at line 19 of file EditMenu.h.

Constructor & Destructor Documentation

evdb::EditMenu::EditMenu ( TGMenuBar *  menubar,
TGMainFrame *  mf 
)

Definition at line 12 of file EditMenu.cxx.

14  {
15  fEditMenu = new TGPopupMenu(gClient->GetRoot());
16 
17  fDrawingMenu = new TGPopupMenu();
18  fExpMenu = new TGPopupMenu();
19 
20  fEditMenu->AddPopup("Configure &Drawing", fDrawingMenu);
21  fEditMenu->AddPopup("Configure &Experiment Services", fExpMenu);
22 
23  fLayout = new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 0, 0);
24 
25  menubar->AddPopup("&Edit",fEditMenu,fLayout);
26  }
TGPopupMenu * fExpMenu
Experiment services.
Definition: EditMenu.h:35
TGLayoutHints * fLayout
How to layout the menu.
Definition: EditMenu.h:36
TGPopupMenu * fDrawingMenu
Drawing options.
Definition: EditMenu.h:34
TGPopupMenu * fEditMenu
The file menu.
Definition: EditMenu.h:33
evdb::EditMenu::~EditMenu ( )
virtual

Definition at line 30 of file EditMenu.cxx.

31  {
32  if (fLayout) { delete fLayout; fLayout = nullptr; }
33  if (fEditMenu) { delete fEditMenu; fEditMenu = nullptr; }
34  if (fExpMenu) { delete fExpMenu; fExpMenu = nullptr; }
35  if (fDrawingMenu) { delete fDrawingMenu; fDrawingMenu = nullptr; }
36  }
TGPopupMenu * fExpMenu
Experiment services.
Definition: EditMenu.h:35
TGLayoutHints * fLayout
How to layout the menu.
Definition: EditMenu.h:36
TGPopupMenu * fDrawingMenu
Drawing options.
Definition: EditMenu.h:34
TGPopupMenu * fEditMenu
The file menu.
Definition: EditMenu.h:33

Member Function Documentation

void evdb::EditMenu::MenuSelect ( int  which)

Definition at line 76 of file EditMenu.cxx.

77  {
79  }
static ServiceTable & Instance()
void Edit(unsigned int i)
void evdb::EditMenu::SetServices ( )

Definition at line 51 of file EditMenu.cxx.

52  {
53  this->WipeMenu(fDrawingMenu);
54  this->WipeMenu(fExpMenu);
55 
56  const ServiceTable& st = ServiceTable::Instance();
57 
58  unsigned int i;
59  for (i=0; i<st.fServices.size(); ++i) {
60  const ServiceTableEntry& ste = st.fServices[i];
61  if (ste.fCategory==kDRAWING_SERVICE) {
62  fDrawingMenu->AddEntry(ste.fName.c_str(), i);
63  }
64  else if (ste.fCategory==kEXPERIMENT_SERVICE) {
65  fExpMenu->AddEntry(ste.fName.c_str(), i);
66  }
67  fEditMenu->Connect("Activated(Int_t)",
68  "evdb::EditMenu",
69  this,
70  "MenuSelect(int)");
71  }
72  }
static constexpr int kDRAWING_SERVICE
Definition: ServiceTable.h:19
static ServiceTable & Instance()
void WipeMenu(TGPopupMenu *m)
Definition: EditMenu.cxx:40
TGPopupMenu * fExpMenu
Experiment services.
Definition: EditMenu.h:35
static constexpr int kEXPERIMENT_SERVICE
Definition: ServiceTable.h:20
TGPopupMenu * fDrawingMenu
Drawing options.
Definition: EditMenu.h:34
TGPopupMenu * fEditMenu
The file menu.
Definition: EditMenu.h:33
void evdb::EditMenu::WipeMenu ( TGPopupMenu *  m)

Definition at line 40 of file EditMenu.cxx.

41  {
42  for (unsigned int i=0;;++i) {
43  TGMenuEntry* me = m->GetEntry(i);
44  if (me) m->DeleteEntry(i);
45  else break;
46  }
47  }
static const double m
Definition: Units.h:79

Member Data Documentation

TGPopupMenu* evdb::EditMenu::fDrawingMenu
private

Drawing options.

Definition at line 34 of file EditMenu.h.

TGPopupMenu* evdb::EditMenu::fEditMenu
private

The file menu.

Definition at line 33 of file EditMenu.h.

TGPopupMenu* evdb::EditMenu::fExpMenu
private

Experiment services.

Definition at line 35 of file EditMenu.h.

TGLayoutHints* evdb::EditMenu::fLayout
private

How to layout the menu.

Definition at line 36 of file EditMenu.h.


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