Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

evdb::WindowMenu Class Reference

#include <WindowMenu.h>

List of all members.

Public Member Functions

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

Private Member Functions

 RQ_OBJECT ("evdb::WindowMenu")
int NoImpl (const char *m)
int No3DViewer ()

Private Attributes

TGPopupMenu * fWindowMenu
TGLayoutHints * fLayout


Constructor & Destructor Documentation

WindowMenu::WindowMenu TGMenuBar *  menubar,
TGMainFrame *  mf
 

Definition at line 23 of file WindowMenu.cxx.

References fLayout, and fWindowMenu.

00024 {
00025   fWindowMenu = new TGPopupMenu(gClient->GetRoot());
00026   fLayout     = new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 0, 0);
00027 
00028   // Create the list of functions. Associate each which a command code
00029   const std::vector<std::string>& names = DisplayWindow::Names();
00030   for (unsigned int i=0; i<names.size(); ++i) {
00031     fWindowMenu->AddEntry(names[i].c_str(), i);
00032   }
00033   fWindowMenu->AddSeparator();
00034   fWindowMenu->AddEntry("&Scan Categories",  -1);
00035   fWindowMenu->AddSeparator();
00036   fWindowMenu->AddEntry("&MC Information",   -2);
00037   fWindowMenu->AddEntry("&ROOT &Browser",    -3);
00038   fWindowMenu->Connect("Activated(Int_t)",
00039                        "evdb::WindowMenu",this,"HandleMenu(int)");
00040   
00041   // Attach the menu to the menu bar
00042   menubar->AddPopup("&Window",fWindowMenu,fLayout);
00043 }

WindowMenu::~WindowMenu  )  [virtual]
 

Definition at line 47 of file WindowMenu.cxx.

References fLayout, and fWindowMenu.

00048 {
00049   if (fLayout)     { delete fLayout;     fLayout     = 0; }
00050   if (fWindowMenu) { delete fWindowMenu; fWindowMenu = 0; }
00051 }


Member Function Documentation

void WindowMenu::HandleMenu int  menu  ) 
 

Definition at line 55 of file WindowMenu.cxx.

References NoImpl().

00056 {
00057   switch(menu) {
00058   case -1: new ScanCat();  break;
00059 //case -2: new MCDialog(); break;
00060   case -3:                 break;
00061   case -4: new TBrowser(); break;
00062   default: 
00063     int aok = DisplayWindow::OpenWindow(menu);
00064     if (aok<0) this->NoImpl("Error openning requested window");
00065     break;
00066   }
00067 }

int WindowMenu::No3DViewer  )  [private]
 

Definition at line 85 of file WindowMenu.cxx.

00086 {
00087   new TGMsgBox(evdb::TopWindow(), 
00088                evdb::TopWindow(),
00089                "Not for this view",
00090                "This display does not implement a 3D viewer",
00091                kMBIconExclamation);
00092   return 0;
00093 }

int WindowMenu::NoImpl const char *  m  )  [private]
 

Definition at line 71 of file WindowMenu.cxx.

Referenced by HandleMenu().

00072 {
00073   std::string s;
00074   s = "Sorry action '"; s += method; s+= "' is not implemented.\n";
00075   // Why isn't this a memory leak? Dunno, but its seems the TG classes
00076   // are all managed by TGClient which takes care of deletion
00077   new TGMsgBox(evdb::TopWindow(),
00078                evdb::TopWindow(),
00079                "No implementation",s.c_str(),kMBIconExclamation);
00080   return 0;
00081 }

evdb::WindowMenu::RQ_OBJECT "evdb::WindowMenu"   )  [private]
 


Member Data Documentation

TGLayoutHints* evdb::WindowMenu::fLayout [private]
 

Definition at line 35 of file WindowMenu.h.

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

TGPopupMenu* evdb::WindowMenu::fWindowMenu [private]
 

Definition at line 34 of file WindowMenu.h.

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


The documentation for this class was generated from the following files:
Generated on Fri Jul 25 02:05:53 2008 for NOvA Offline by doxygen 1.3.5