
Lightweight gui system 
----------------------
rale - 2006


Modify GUIinclude.h if you are not using SDL.


// INIT

GUIHolder *holder;	

holder  = new GUIHolder();
holder->init();

holder->addWidget(new GUIButton(125,635,14,14,"PREVIEW", "Preview"));
holder->addWidget(new GUIButton(125,665,14,14,"DOEFFECT", "Do effect"));
holder->addWidget(new GUIToggleButton(125,695,14,14,"UNDOLAST", "Undo last"),false);

// RENDER

holder->render(0); // float = deltatime (not needed currently..)

holder->processEvent(GUIMouseMovedEvent(event.motion.x,event.motion.y));
holder->processEvent(GUIKeyboardEvent(SDL_GetKeyName(event.key.keysym.sym), false, false));
holder->processEvent(GUIKeyboardEvent(SDL_GetKeyName(event.key.keysym.sym), true, false));
std::string returnvalue = holder->processEvent(GUIMousePressedEvent(event.motion.x,event.motion.y, false, true, false));

if(returnvalue == "PREVIEW") doPreview; //etc


// DEINIT

this->holder->deinit();

if(this->holder!=0) delete holder; 
holder = 0;