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

evdb::EditMenu Class Reference

The edit pull down menu. More...

#include <EditMenu.h>

List of all members.

Public Member Functions

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

Private Member Functions

int Preferences ()
int NoImpl (const char *m)

Private Attributes

TGMainFrame * fMainFrame
 Main graphics frame.

TGPopupMenu * fEditMenu
 The file menu.

TGLayoutHints * fLayout
 How to layout the menu.


Detailed Description

The edit pull down menu.

Definition at line 19 of file EditMenu.h.


Constructor & Destructor Documentation

EditMenu::EditMenu TGMenuBar *  menubar,
TGMainFrame *  mf
 

Definition at line 26 of file EditMenu.cxx.

References cfg::Table::ConfigList, fEditMenu, fLayout, gsConfig, and cfg::Table::Instance().

00026                                                       :
00027   fMainFrame(mf)
00028 {
00029   fEditMenu = new TGPopupMenu(gClient->GetRoot());
00030   fLayout   = new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 0, 0);
00031   
00032   // Create the list of functions. Associate each which a command code
00033   
00034   int icfg = 0;
00035   cfg::Table::ConfigList& cfglist = cfg::Table::Instance().GetList();
00036   cfg::Table::ConfigList::iterator itr   (cfglist.begin());
00037   cfg::Table::ConfigList::iterator itrEnd(cfglist.end());
00038   for (; itr!=itrEnd; ++itr) {
00039     fEditMenu->AddEntry((*itr)->GetName(), icfg);
00040     gsConfig[icfg] = (*itr);
00041     ++icfg;
00042   }
00043   
00044   fEditMenu->Connect("Activated(Int_t)",
00045                      "evdb::EditMenu",this,"HandleMenu(int)");
00046   
00047   // Attach the menu to the menu bar
00048   menubar->AddPopup("&Edit",fEditMenu,fLayout);
00049 }

EditMenu::~EditMenu  )  [virtual]
 

Definition at line 53 of file EditMenu.cxx.

References fEditMenu, and fLayout.

00054 {
00055   if (fLayout)   { delete fLayout;   fLayout   = 0; }
00056   if (fEditMenu) { delete fEditMenu; fEditMenu = 0; }
00057 }


Member Function Documentation

void EditMenu::HandleMenu int  menu  ) 
 

Definition at line 61 of file EditMenu.cxx.

References fMainFrame, and gsConfig.

00062 {
00063   new CfgEdit(gsConfig[i], fMainFrame); 
00064 }

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

Definition at line 76 of file EditMenu.cxx.

References fMainFrame.

Referenced by Preferences().

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

int EditMenu::Preferences  )  [private]
 

Definition at line 68 of file EditMenu.cxx.

References NoImpl().

00069 {
00070   this->NoImpl("Preferences");
00071   return 0;
00072 }


Member Data Documentation

TGPopupMenu* evdb::EditMenu::fEditMenu [private]
 

The file menu.

Definition at line 35 of file EditMenu.h.

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

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

How to layout the menu.

Definition at line 36 of file EditMenu.h.

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

TGMainFrame* evdb::EditMenu::fMainFrame [private]
 

Main graphics frame.

Definition at line 34 of file EditMenu.h.

Referenced by HandleMenu(), and NoImpl().


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