#include <WindowMenu.h>
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 |
|
||||||||||||
|
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 }
|
|
|
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 }
|
|
|
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 }
|
|
|
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 }
|
|
|
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 }
|
|
|
|
|
|
Definition at line 35 of file WindowMenu.h. Referenced by WindowMenu(), and ~WindowMenu(). |
|
|
Definition at line 34 of file WindowMenu.h. Referenced by WindowMenu(), and ~WindowMenu(). |
1.3.5