LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
evdb::HelpMenu Class Reference

#include "HelpMenu.h"

Public Member Functions

 HelpMenu (TGMenuBar *menubar, TGMainFrame *mf)
 
virtual ~HelpMenu ()
 
void HandleMenu (int menu)
 

Private Member Functions

int Contents ()
 
int ReleaseNotes ()
 
int About ()
 
int NoImpl (const char *m)
 

Private Attributes

TGMainFrame * fMainFrame
 
TGPopupMenu * fHelpMenu
 
TGLayoutHints * fLayout
 

Detailed Description

Definition at line 18 of file HelpMenu.h.

Constructor & Destructor Documentation

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

Definition at line 34 of file HelpMenu.cxx.

References fHelpMenu, fLayout, evdb::kM_HELP_ABOUT, evdb::kM_HELP_CONTENTS, and evdb::kM_HELP_RELEASENOTES.

34  :
35  fMainFrame(mf)
36  {
37  //======================================================================
38  // Build the help menu
39  //======================================================================
40  fHelpMenu = new TGPopupMenu(gClient->GetRoot());
41  fLayout = new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 0, 0);
42 
43  // Create the list of functions. Associate each which a command code
44  fHelpMenu->AddEntry("&Contents", kM_HELP_CONTENTS);
45  fHelpMenu->AddEntry("&Release Notes", kM_HELP_RELEASENOTES);
46  fHelpMenu->AddSeparator();
47  fHelpMenu->AddEntry("&About", kM_HELP_ABOUT);
48 
49  // fHelpMenu->Connect("Activated(Int_t)",
50  // "evdb::HelpMenu",this,"HandleMenu(int)");
51 
52  // Attach the menu to the menu bar
53  menubar->AddPopup("&Help",fHelpMenu,fLayout);
54  }
TGMainFrame * fMainFrame
Definition: HelpMenu.h:35
TGPopupMenu * fHelpMenu
Definition: HelpMenu.h:36
TGLayoutHints * fLayout
Definition: HelpMenu.h:37
evdb::HelpMenu::~HelpMenu ( )
virtual

Definition at line 58 of file HelpMenu.cxx.

References fHelpMenu, and fLayout.

59  {
60  //======================================================================
61  // Delete the help menu
62  //======================================================================
63  if (fLayout) { delete fLayout; fLayout = 0; }
64  if (fHelpMenu) { delete fHelpMenu; fHelpMenu = 0; }
65  }
TGPopupMenu * fHelpMenu
Definition: HelpMenu.h:36
TGLayoutHints * fLayout
Definition: HelpMenu.h:37

Member Function Documentation

int evdb::HelpMenu::About ( )
private

Definition at line 108 of file HelpMenu.cxx.

References fMainFrame, and evdb::TopWindow().

Referenced by HandleMenu().

109  {
110  //======================================================================
111  // Pop open a window containing information about versions of things
112  // used in the event display.
113  //======================================================================
114  std::string about;
115 
116  about = "MIPP Event Display\n\n";
117 
118  about += " Version: ";
119  about += "$Id: HelpMenu.cxx,v 1.2 2012-09-20 21:38:32 greenc Exp $";
120  about += "\n";
121 
122  about += " ";
123  about += gSystem->GetBuildArch();
124  about += "\n";
125 
126  about += " ";
127  about += gSystem->GetBuildNode();
128  about += "\n";
129 
130  about += " Based on ROOT version: ";
131  about += gROOT->GetVersion();
132  about += "\n";
133 
134  new TGMsgBox(evdb::TopWindow(), fMainFrame,
135  "Release notes",about.c_str(),kMBIconExclamation);
136  return 0;
137  }
TGMainFrame * fMainFrame
Definition: HelpMenu.h:35
const TGWindow * TopWindow()
Definition: evdb.cxx:12
int evdb::HelpMenu::Contents ( )
private

Definition at line 84 of file HelpMenu.cxx.

References NoImpl().

Referenced by HandleMenu().

85  {
86  //======================================================================
87  // Start a help browser
88  //======================================================================
89  this->NoImpl("Contents");
90  return 0;
91  }
int NoImpl(const char *m)
Definition: HelpMenu.cxx:141
void evdb::HelpMenu::HandleMenu ( int  menu)

Definition at line 69 of file HelpMenu.cxx.

References About(), Contents(), evdb::kM_HELP_ABOUT, evdb::kM_HELP_CONTENTS, evdb::kM_HELP_RELEASENOTES, NoImpl(), and ReleaseNotes().

70  {
71  //======================================================================
72  // Take care of menu events
73  //======================================================================
74  switch(menu) {
75  case kM_HELP_CONTENTS: this->Contents(); break;
76  case kM_HELP_RELEASENOTES: this->ReleaseNotes(); break;
77  case kM_HELP_ABOUT: this->About(); break;
78  default: this->NoImpl("??"); break;
79  }
80  }
int ReleaseNotes()
Definition: HelpMenu.cxx:95
int NoImpl(const char *m)
Definition: HelpMenu.cxx:141
int Contents()
Definition: HelpMenu.cxx:84
int evdb::HelpMenu::NoImpl ( const char *  m)
private

Definition at line 141 of file HelpMenu.cxx.

References fMainFrame, s, and evdb::TopWindow().

Referenced by Contents(), and HandleMenu().

142  {
143  std::string s;
144  s = "Sorry action '"; s += method; s+= "' is not implemented.\n";
145  // Why isn't this a memory leak? Dunno, but its seems the TG classes
146  // are all managed by TGClient which takes care of deletion
147  new TGMsgBox(evdb::TopWindow(), fMainFrame,
148  "No implementation",s.c_str(),kMBIconExclamation);
149  return 0;
150  }
Float_t s
Definition: plot.C:23
TGMainFrame * fMainFrame
Definition: HelpMenu.h:35
const TGWindow * TopWindow()
Definition: evdb.cxx:12
int evdb::HelpMenu::ReleaseNotes ( )
private

Definition at line 95 of file HelpMenu.cxx.

References evdb::TopWindow().

Referenced by HandleMenu().

96  {
97  //======================================================================
98  // Print information about this release of the event display
99  //======================================================================
100  const char* releaseNotes = "This is a pre-release version of event display";
101  new TGMsgBox(evdb::TopWindow(), evdb::TopWindow(),
102  "Release notes",releaseNotes,kMBIconExclamation);
103  return 0;
104  }
const TGWindow * TopWindow()
Definition: evdb.cxx:12

Member Data Documentation

TGPopupMenu* evdb::HelpMenu::fHelpMenu
private

Definition at line 36 of file HelpMenu.h.

Referenced by HelpMenu(), and ~HelpMenu().

TGLayoutHints* evdb::HelpMenu::fLayout
private

Definition at line 37 of file HelpMenu.h.

Referenced by HelpMenu(), and ~HelpMenu().

TGMainFrame* evdb::HelpMenu::fMainFrame
private

Definition at line 35 of file HelpMenu.h.

Referenced by About(), and NoImpl().


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