Public Member Functions | Private Attributes | List of all members
om::MenuBar Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-12-03/OnlineMonitoring/viewer/MenuBar.h"

Inheritance diagram for om::MenuBar:

Public Member Functions

 MenuBar (TGWindow *w)
 
 ~MenuBar ()
 
Bool_t ProcessMessage (Long_t msg, Long_t parm1, Long_t p)
 
int FileOpen ()
 
int FileOpenReference ()
 
int FilePrint ()
 
int FileQuit ()
 
int ResetLocks ()
 
int HelpAbout ()
 

Private Attributes

TGPopupMenu * fFile
 
TGPopupMenu * fUpdate
 
TGPopupMenu * fHelp
 

Detailed Description

Definition at line 7 of file MenuBar.h.

Constructor & Destructor Documentation

MenuBar::MenuBar ( TGWindow *  w)

Definition at line 22 of file MenuBar.cxx.

References fFile, fHelp, fUpdate, kFILE_MENU_OPEN, kFILE_MENU_OPENREF, kFILE_MENU_PRINT, kFILE_MENU_QUIT, kHELP_MENU_ABOUT, and kUPDATE_MENU_RESETLOCKS.

22  :
23  TGMenuBar(w, Layout::fMenuBarSizeX, Layout::fMenuBarSizeY, kHorizontalFrame)
24 {
25  fFile = new TGPopupMenu(gClient->GetRoot());
26  fFile->AddEntry("Open", kFILE_MENU_OPEN);
27  fFile->AddEntry("Open reference", kFILE_MENU_OPENREF);
28  fFile->AddSeparator();
29  fFile->AddEntry("Print", kFILE_MENU_PRINT);
30  fFile->AddSeparator();
31  fFile->AddEntry("Quit", kFILE_MENU_QUIT);
32  fFile->Associate(this);
33  this->AddPopup("&File", fFile, 0);
34 
35  fUpdate = new TGPopupMenu(gClient->GetRoot());
36  fUpdate->AddEntry("Reset Locks", kUPDATE_MENU_RESETLOCKS);
37  fUpdate->Associate(this);
38  this->AddPopup("&Update", fUpdate, 0);
39 
40  fHelp = new TGPopupMenu(gClient->GetRoot());
41  fHelp->AddEntry("About", kHELP_MENU_ABOUT);
42  this->AddPopup("&Help", fHelp, 0);
43 }
static const unsigned int fMenuBarSizeX
Definition: Layout.h:10
TGPopupMenu * fUpdate
Definition: MenuBar.h:25
TGPopupMenu * fFile
Definition: MenuBar.h:24
TGPopupMenu * fHelp
Definition: MenuBar.h:26
static const unsigned int fMenuBarSizeY
Definition: Layout.h:11
Float_t w
Definition: plot.C:20
MenuBar::~MenuBar ( )

Definition at line 47 of file MenuBar.cxx.

47 { }

Member Function Documentation

int MenuBar::FileOpen ( )

Definition at line 68 of file MenuBar.cxx.

Referenced by ProcessMessage().

68 { return 0; }
int MenuBar::FileOpenReference ( )

Definition at line 72 of file MenuBar.cxx.

Referenced by ProcessMessage().

72 { return 0; }
int MenuBar::FilePrint ( )

Definition at line 76 of file MenuBar.cxx.

References om::GUIModel::Instance(), and om::GUIModel::SendPrint().

Referenced by ProcessMessage().

77 {
79  return 0;
80 }
static GUIModel & Instance()
Definition: GUIModel.cxx:11
void SendPrint()
Definition: GUIModel.cxx:196
int MenuBar::FileQuit ( )

Definition at line 84 of file MenuBar.cxx.

Referenced by ProcessMessage().

84 { gApplication->Terminate(0); return 0;}
int MenuBar::HelpAbout ( )

Definition at line 105 of file MenuBar.cxx.

Referenced by ProcessMessage().

105 { return 0; }
Bool_t MenuBar::ProcessMessage ( Long_t  msg,
Long_t  parm1,
Long_t  p 
)

Definition at line 51 of file MenuBar.cxx.

References FileOpen(), FileOpenReference(), FilePrint(), FileQuit(), HelpAbout(), kFILE_MENU_OPEN, kFILE_MENU_OPENREF, kFILE_MENU_PRINT, kFILE_MENU_QUIT, kHELP_MENU_ABOUT, kUPDATE_MENU_RESETLOCKS, and ResetLocks().

52 {
53  if ((GET_MSG(msg)==kC_COMMAND) && (GET_SUBMSG(msg)==kCM_MENU)) {
54  switch (parm1) {
55  case kFILE_MENU_OPEN: this->FileOpen(); break;
56  case kFILE_MENU_OPENREF: this->FileOpenReference(); break;
57  case kFILE_MENU_PRINT: this->FilePrint(); break;
58  case kFILE_MENU_QUIT: this->FileQuit(); break;
59  case kUPDATE_MENU_RESETLOCKS: this->ResetLocks(); break;
60  case kHELP_MENU_ABOUT: this->HelpAbout(); break;
61  }
62  }
63  return kTRUE;
64 }
int FilePrint()
Definition: MenuBar.cxx:76
int FileOpenReference()
Definition: MenuBar.cxx:72
int ResetLocks()
Definition: MenuBar.cxx:88
int HelpAbout()
Definition: MenuBar.cxx:105
int FileOpen()
Definition: MenuBar.cxx:68
int FileQuit()
Definition: MenuBar.cxx:84
int MenuBar::ResetLocks ( )

Definition at line 88 of file MenuBar.cxx.

References om::GUIModel::Data(), om::GUIModelData::fHistogramSource, om::GUIModel::Instance(), om::kIPC_CLIENT, om::IPC::ResetAllLocks(), and string.

Referenced by ProcessMessage().

89 {
90  const std::string& src =
92 
93  if (src.find(".shm")==src.npos) return 0;
94 
95  std::string hndl = src.substr(0,4);
96 
97  IPC ipc(om::kIPC_CLIENT,hndl.c_str());
98  ipc.ResetAllLocks();
99 
100  return 0;
101 }
static const int kIPC_CLIENT
Definition: IPC.h:24
static GUIModel & Instance()
Definition: GUIModel.cxx:11
std::string fHistogramSource
Definition: GUIModelData.h:35
Definition: IPC.h:29
const GUIModelData & Data() const
Definition: GUIModel.h:15
void ResetAllLocks()
Definition: IPC.cxx:843
enum BeamMode string

Member Data Documentation

TGPopupMenu* om::MenuBar::fFile
private

Definition at line 24 of file MenuBar.h.

Referenced by MenuBar().

TGPopupMenu* om::MenuBar::fHelp
private

Definition at line 26 of file MenuBar.h.

Referenced by MenuBar().

TGPopupMenu* om::MenuBar::fUpdate
private

Definition at line 25 of file MenuBar.h.

Referenced by MenuBar().


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