proj home

Files   Classes   Functions   Hierarchy  

menusystemtest04 Class Reference

Configuration menu. More...

#include <menusystemtest04.h>

Inheritance diagram for menusystemtest04:
Collaboration diagram for menusystemtest04:

List of all members.

Public Member Functions

 menusystemtest04 (int argc, char **argv)
 Main program.
void savefile (menusystemsave01 &ms)

Static Public Member Functions

static void keyboard (unsigned char key, int x, int y)
 Keyboard handler.
static void display ()
 Displays gobj::global .

Static Public Attributes

static menusystemroot = 0
 The menu is contained as a composite member.
static string doc []
 Brief description of each test.

Protected Member Functions

void readImmediate (charc ch)
 Redefine to perform an action on receiving the character.


Detailed Description

Configuration menu.

Definition at line 12 of file menusystemtest04.h.


Constructor & Destructor Documentation

menusystemtest04::menusystemtest04 ( int  argc,
char **  argv 
)

Main program.

Definition at line 22 of file menusystemtest04.cpp.

References menusystem::addfont10(), menusystem::addfont12(), menusystem::addsubmenu(), callback1createnew(), menusystem::columnchange, menusystem::currentset(), display(), textoverlay::drawpre, gobjpush, keyboard(), textoverlay::lightingdisable(), gobjContainerdeque::push_back(), root, savefile(), gobjContainer::set(), and zpr::update().

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 }


Member Function Documentation

void menusystemtest04::display (  )  [static]

Displays gobj::global .

Definition at line 76 of file menusystemtest04.cpp.

References gobjContainer::draw(), glerrordisplay(), and gobj::global.

Referenced by menusystemtest04().

00077 { 
00078   glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
00079 
00080   gobj::global->draw();
00081 
00082   glerrordisplay();
00083   
00084   glutSwapBuffers();
00085 }

void menusystemtest04::keyboard ( unsigned char  key,
int  x,
int  y 
) [static]

Keyboard handler.

Definition at line 88 of file menusystemtest04.cpp.

Referenced by menusystemtest04().

00093 {
00094   assert(root!=0);
00095   root->read(key);
00096 }

void menusystemtest04::readImmediate ( charc  ch  )  [protected, virtual]

Redefine to perform an action on receiving the character.

Reimplemented from menusystem.

Definition at line 98 of file menusystemtest04.cpp.

References menusystem::transfercontroltosubmenu().

00099 {
00100   switch (ch)
00101   {
00102     case 'q': exit(0); break;
00103     case 's': transfercontroltosubmenu(0); break;
00104   }
00105 }

void menusystemtest04::savefile ( menusystemsave01 ms  ) 

Definition at line 16 of file menusystemtest04.cpp.

Referenced by menusystemtest04().

00017 {
00018   cout << "savefile" << endl;
00019 }


Member Data Documentation

string menusystemtest04::doc [static]

Initial value:

{ 
  "",
  "Save menu system test"
}
Brief description of each test.

Definition at line 25 of file menusystemtest04.h.

Referenced by main().

The menu is contained as a composite member.

Definition at line 22 of file menusystemtest04.h.

Referenced by menusystemtest04().


The documentation for this class was generated from the following files:

Generated on Fri Mar 4 00:50:06 2011 for Chelton Evans Source by  doxygen 1.5.8