Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
nutools
old
EventDisplayBase
EditMenu.cxx
Go to the documentation of this file.
1
///
2
/// \file EditMenu.cxx
3
/// \brief The edit pull down menu
4
/// \author messier@indiana.edu
5
///
6
#include "nutools/EventDisplayBase/EditMenu.h"
7
#include "TGMenu.h"
8
#include "nutools/EventDisplayBase/ServiceTable.h"
9
10
namespace
evdb
11
{
12
EditMenu::EditMenu
(TGMenuBar* menubar,
13
TGMainFrame*
/*mf*/
)
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
}
27
28
//......................................................................
29
30
EditMenu::~EditMenu
()
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
}
37
38
//....................................................................
39
40
void
EditMenu::WipeMenu
(TGPopupMenu*
m
)
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
}
48
49
//....................................................................
50
51
void
EditMenu::SetServices
()
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
}
73
74
//......................................................................
75
76
void
EditMenu::MenuSelect
(
int
i)
77
{
78
ServiceTable::Instance
().
Edit
(i);
79
}
80
81
}
// namespace
82
////////////////////////////////////////////////////////////////////////
evdb::kDRAWING_SERVICE
static constexpr int kDRAWING_SERVICE
Definition:
ServiceTable.h:19
genie::units::m
static const double m
Definition:
Units.h:79
evdb::ServiceTable::Instance
static ServiceTable & Instance()
Definition:
ServiceTable.cxx:48
evdb::EditMenu::EditMenu
EditMenu(TGMenuBar *menubar, TGMainFrame *mf)
Definition:
EditMenu.cxx:12
evdb::ServiceTable
Collection of Services used in the event display.
Definition:
ServiceTable.h:36
evdb::EditMenu::WipeMenu
void WipeMenu(TGPopupMenu *m)
Definition:
EditMenu.cxx:40
evdb::ServiceTable::Edit
void Edit(unsigned int i)
Definition:
ServiceTable.cxx:56
evdb
Manage all things related to colors for the event display.
Definition:
Edge3DDrawer_tool.cc:10
evdb::EditMenu::fExpMenu
TGPopupMenu * fExpMenu
Experiment services.
Definition:
EditMenu.h:35
evdb::ServiceTableEntry::fName
std::string fName
Definition:
ServiceTable.h:26
evdb::kEXPERIMENT_SERVICE
static constexpr int kEXPERIMENT_SERVICE
Definition:
ServiceTable.h:20
evdb::EditMenu::SetServices
void SetServices()
Definition:
EditMenu.cxx:51
evdb::EditMenu::MenuSelect
void MenuSelect(int which)
Definition:
EditMenu.cxx:76
evdb::EditMenu::fLayout
TGLayoutHints * fLayout
How to layout the menu.
Definition:
EditMenu.h:36
evdb::EditMenu::fDrawingMenu
TGPopupMenu * fDrawingMenu
Drawing options.
Definition:
EditMenu.h:34
evdb::ServiceTable::fServices
std::vector< ServiceTableEntry > fServices
Definition:
ServiceTable.h:50
evdb::EditMenu::~EditMenu
virtual ~EditMenu()
Definition:
EditMenu.cxx:30
evdb::ServiceTableEntry::fCategory
int fCategory
Definition:
ServiceTable.h:29
evdb::ServiceTableEntry
Information about a service required by the event display.
Definition:
ServiceTable.h:25
evdb::EditMenu::fEditMenu
TGPopupMenu * fEditMenu
The file menu.
Definition:
EditMenu.h:33
Generated by
1.8.11