proj home

Files   Classes   Functions   Hierarchy  

menusystemtest04.cpp

Go to the documentation of this file.
00001 
00002 #include <graphmisc.h>
00003 #include <menusystemsave01.h>
00004 #include <menusystemtest04.h>
00005 #include <stringconvert.h>
00006 #include <zpr.h>
00007 
00008 string menusystemtest04::doc[] =
00009 { 
00010   "",
00011   "Save menu system test"
00012 };
00013 
00014 menusystem * menusystemtest04::root = 0;
00015 
00016 void menusystemtest04::savefile(menusystemsave01& ms)
00017 {
00018   cout << "savefile" << endl;
00019 }
00020 
00021 
00022 menusystemtest04::menusystemtest04(int argc, char** argv)
00023   : menusystem(point2<int>(60,50),10)
00024 {
00025   glutInit(&argc,argv);
00026   glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
00027   glutInitWindowSize(800,600);
00028   glutCreateWindow("");
00029   glutDisplayFunc(display);
00030   glutKeyboardFunc(keyboard);
00031 
00032   OpenGLinitialisation();
00033 
00034   glEnable(GL_DEPTH_TEST);
00035   glEnable(GL_CULL_FACE);
00036   glEnable(GL_NORMALIZE);
00037 
00038   xGraphics.set();
00039 
00040   root = this;
00041   //root = new menusystemtest04Main();
00042   //this->fontcolor = point4<float>(1.0,0.0,0.0,0.8);
00043   drawpre.push_back(new gobjglColor3f(1.0,0.0,0.0));
00044   this->lightingdisable();
00045 
00046   root->currentset();
00047 
00048   menusystem * m = new menusystemsave01
00049   (
00050     point2<int>(105,70),
00051     "file.csv",
00052     columnchange,
00053     callback1createnew(*this,&menusystemtest04::savefile)
00054   );
00055   root->addsubmenu(m);
00056 
00057 /*
00058   menusystem * m = new menusystemtest04Config(mypart);
00059   root->addsubmenu(m);
00060   root->currentset();
00061 */
00062 
00063   addfont12("menusystem Example 04",2);
00064 
00065   addfont10("[s]  Save >",2);
00066   addfont10("[q]  Quit",1);
00067   
00068   gobjpush(this);
00069 
00070   zpr zz;
00071   zz.update();
00072 
00073   glutMainLoop();
00074 }
00075 
00076 void menusystemtest04::display()
00077 { 
00078   glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
00079 
00080   gobj::global->draw();
00081 
00082   glerrordisplay();
00083   
00084   glutSwapBuffers();
00085 }
00086 
00087 void menusystemtest04::keyboard
00088 (
00089   unsigned char key, 
00090   int x, 
00091   int y
00092 )
00093 {
00094   assert(root!=0);
00095   root->read(key);
00096 }
00097 
00098 void menusystemtest04::readImmediate(charc ch)
00099 {
00100   switch (ch)
00101   {
00102     case 'q': exit(0); break;
00103     case 's': transfercontroltosubmenu(0); break;
00104   }
00105 }
00106 
00107 
00108 
00109 

Generated on Fri Mar 4 00:49:29 2011 for Chelton Evans Source by  doxygen 1.5.8