#include <DisplayWindow.h>
Public Member Functions | |
| DisplayWindow (int window=0) | |
| virtual | ~DisplayWindow () |
| virtual void | Draw (const char *opt="") |
| virtual void | CloseWindow () |
| void | Raise () |
Static Public Member Functions | |
| void | Register (const char *name, const char *description, unsigned int h, unsigned int w, CanvasCreator_t creator) |
| const std::vector< std::string > & | Names () |
| int | OpenWindow (int type=0) |
Private Attributes | |
| TGMainFrame * | fMain |
| Main window. | |
| MenuBar * | fMenuBar |
| Top menu bar. | |
| ButtonBar * | fButtonBar |
| Top button bar. | |
| StatusBar * | fStatusBar |
| Status bar running along the bottom. | |
| Canvas * | fDisplay |
| Display of detector event information. | |
Definition at line 28 of file DisplayWindow.h.
|
|
Definition at line 91 of file DisplayWindow.cxx. References evdb::Canvas::Connect(), fButtonBar, fDisplay, fMain, fMenuBar, fStatusBar, gsCanvasCreator, gsHeight, gsName, gsWidth, and gsWindows(). Referenced by OpenWindow().
00092 {
00093 if (gROOT->IsBatch()) assert(0);
00094 assert(gClient);
00095 const TGWindow* tgw = gClient->GetRoot();
00096 assert(tgw);
00097
00098 // Create the main application window. I need a resize to get the
00099 // window to draw the first time, so create the window slightly
00100 // smaller than the intended size. Bogus, but so it goes...
00101 unsigned int w = gsWidth[id];
00102 unsigned int h = gsHeight[id];
00103 fMain = new TGMainFrame(tgw, w-1, h-1);
00104
00105 // Add items to the main window
00106 fMenuBar = new MenuBar(fMain);
00107 fButtonBar = new ButtonBar(fMain);
00108 fDisplay = (*gsCanvasCreator[id])(fMain);
00109 fStatusBar = new StatusBar(fMain);
00110
00111 fMain->SetWindowName(gsName[id].c_str());
00112
00113 // Now that all the subwindows are attached, do the final layout
00114 fMain->MapSubwindows();
00115 fMain->MapWindow();
00116
00117 // Don't understand this, but I need a resize to get things to draw
00118 // the first time...
00119 fMain->Resize(w,h);
00120
00121 // Plug the display into its signal/slots
00122 fDisplay->Connect();
00123
00124 fMain->Connect("CloseWindow()","evdb::DisplayWindow",this,"CloseWindow()");
00125
00126 // Add to list of windows open
00127 gsWindows[id] = this;
00128 }
|
|
|
Definition at line 140 of file DisplayWindow.cxx. References fButtonBar, fDisplay, fMain, fMenuBar, fStatusBar, and gsWindows().
00141 {
00142 if (fDisplay) { delete fDisplay; fDisplay = 0; }
00143 if (fStatusBar) { delete fStatusBar; fStatusBar = 0; }
00144 if (fButtonBar) { delete fButtonBar; fButtonBar = 0; }
00145 if (fMenuBar) { delete fMenuBar; fMenuBar = 0; }
00146 if (fMain) { delete fMain; fMain = 0; }
00147 for (unsigned int i=0; i<gsWindows.size(); ++i) {
00148 if (gsWindows[i] == this) gsWindows[i] = 0;
00149 }
00150 }
|
|
|
Definition at line 136 of file DisplayWindow.cxx.
00136 { delete this; }
|
|
|
Definition at line 132 of file DisplayWindow.cxx. References evdb::Canvas::Draw(), and fDisplay. Referenced by OpenWindow().
|
|
|
Definition at line 45 of file DisplayWindow.cxx. References gsName.
00045 { return gsName; }
|
|
|
Create a window given a system-assigned ID number Definition at line 72 of file DisplayWindow.cxx. References DisplayWindow(), Draw(), gsName, gsWindows(), and Raise(). Referenced by main().
00073 {
00074 unsigned id = 0;
00075 if (type>0) id = type;
00076 if (id>gsName.size()) return 0;
00077
00078 DisplayWindow* w = gsWindows[id];
00079 if (w==0) {
00080 w = gsWindows[id] = new DisplayWindow(id);
00081 }
00082 if (w==0) return 0;
00083 w->Raise();
00084 w->Draw();
00085
00086 return 1;
00087 }
|
|
|
Definition at line 154 of file DisplayWindow.cxx. References fMain. Referenced by OpenWindow().
00154 { fMain->RaiseWindow(); }
|
|
||||||||||||||||||||||||
|
Register a display canvas for use in creating windows Definition at line 52 of file DisplayWindow.cxx. References evdb::CanvasCreator_t, gsCanvasCreator, gsDescription, gsHeight, gsName, gsWidth, and gsWindows(). Referenced by main().
00057 {
00058 gsName.push_back(std::string(name));
00059 gsDescription.push_back(std::string(description));
00060 gsHeight.push_back(h);
00061 gsWidth.push_back(w);
00062 gsCanvasCreator.push_back(creator);
00063
00064 if (gsName.size()>gsWindows.size()) gsWindows.resize(gsName.size());
00065 }
|
|
|
Top button bar.
Definition at line 50 of file DisplayWindow.h. Referenced by DisplayWindow(), and ~DisplayWindow(). |
|
|
Display of detector event information.
Definition at line 52 of file DisplayWindow.h. Referenced by DisplayWindow(), Draw(), and ~DisplayWindow(). |
|
|
Main window.
Definition at line 48 of file DisplayWindow.h. Referenced by DisplayWindow(), Raise(), and ~DisplayWindow(). |
|
|
Top menu bar.
Definition at line 49 of file DisplayWindow.h. Referenced by DisplayWindow(), and ~DisplayWindow(). |
|
|
Status bar running along the bottom.
Definition at line 51 of file DisplayWindow.h. Referenced by DisplayWindow(), and ~DisplayWindow(). |
1.3.5