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

test_evdb.cc

Go to the documentation of this file.
00001 #include "JobControl/CmdLine.h"
00002 #include "EventDisplayBase/Canvas.h"
00003 #include "EventDisplayBase/DisplayWindow.h"
00004 #include "EventDisplayBase/RootEnv.h"
00005 
00006 //......................................................................
00007 
00008 class testCanvas1 : public evdb::Canvas
00009 {
00010 public:
00011   testCanvas1(TGMainFrame* mf) : evdb::Canvas(mf) {
00012     evdb::Printable::AddToListOfPrintables(this->PrintTag(),this);
00013   }
00014   ~testCanvas1() {
00015     evdb::Printable::RemoveFromListOfPrintables(this);
00016   }
00017   const char* Description() const { return "Test Canvas 1"; }
00018   const char* PrintTag()    const { return "Test1"; }
00019   void Draw(const char* /* opt */) { }
00020 };
00021 
00022 //......................................................................
00023 
00024 class testCanvas2 : public evdb::Canvas
00025 {
00026 public:
00027   testCanvas2(TGMainFrame* mf) : evdb::Canvas(mf) {
00028     evdb::Printable::AddToListOfPrintables(this->PrintTag(),this);
00029   }
00030   ~testCanvas2() {
00031     evdb::Printable::RemoveFromListOfPrintables(this);
00032   }
00033   const char* Description() const { return "Test Canvas 2"; }
00034   const char* PrintTag()    const { return "Test2"; }
00035   void Draw(const char* /* opt */) { }
00036 };
00037 
00038 //......................................................................
00039 
00040 static evdb::Canvas* mk_canvas1(TGMainFrame* mf) {
00041   return new testCanvas1(mf);
00042 }
00043 static evdb::Canvas* mk_canvas2(TGMainFrame* mf) {
00044   return new testCanvas2(mf);
00045 }
00046 
00047 //......................................................................
00048 
00049 int main(int argc, char** argv) 
00050 {
00051   evdb::RootEnv* rootenv = new evdb::RootEnv(argc, argv);
00052 
00053   evdb::DisplayWindow::Register("Test1","Test display #1",600,900,mk_canvas1);
00054   evdb::DisplayWindow::Register("Test2","Test display #2",300,600,mk_canvas2);
00055   
00056   evdb::DisplayWindow::OpenWindow(0);
00057   
00058   int istat = rootenv->Run();
00059   
00060   return istat;
00061 }

Generated on Thu Sep 4 02:05:29 2008 for NOvA Offline by doxygen 1.3.5