2010-09-11 14:32:31 +02:00
|
|
|
/** \brief Header file for the IMGUI widgets
|
|
|
|
*
|
|
|
|
* \todo [med] Cyclying through widgets via tab and shift-tab
|
|
|
|
*/
|
2010-08-29 23:59:24 +02:00
|
|
|
#ifndef _IMGUICONTROLS_H
|
|
|
|
#define _IMGUICONTROLS_H
|
|
|
|
|
2010-09-11 14:32:31 +02:00
|
|
|
#include <SDL/SDL.h>
|
2010-09-11 02:28:50 +02:00
|
|
|
#include <string>
|
|
|
|
|
2010-08-29 23:59:24 +02:00
|
|
|
namespace Engine {
|
|
|
|
|
2010-09-11 14:32:31 +02:00
|
|
|
/** \brief IMGUI widgets and functions
|
|
|
|
*/
|
2010-08-29 23:59:24 +02:00
|
|
|
namespace GUI {
|
|
|
|
|
|
|
|
/** \brief Checks whether the mouse is in the given rectangle */
|
|
|
|
bool regionhit (int x, int y, int w, int h);
|
|
|
|
|
|
|
|
/** \brief Draws a label at the given position with vertical center at y */
|
|
|
|
void Label (int id, const char* caption, int x, int y);
|
2010-11-13 18:45:15 +01:00
|
|
|
/** \brief Draws a label centered at the given position with vertical center at y */
|
|
|
|
void LabelCentered (int id, const char* caption, int x, int y);
|
|
|
|
|
2010-08-29 23:59:24 +02:00
|
|
|
|
|
|
|
/** \brief Draws a button at the given position
|
|
|
|
*
|
|
|
|
* The caption will be centered in the middle of the clickable area.
|
|
|
|
*
|
|
|
|
* \returns true if it was clicked
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
bool Button (int id, const char* caption, int x, int y, int w, int h);
|
|
|
|
|
2010-09-11 02:28:50 +02:00
|
|
|
bool LineEdit (int id, int x, int y, std::string &text_value, const int &maxlength);
|
|
|
|
|
2010-09-11 14:32:31 +02:00
|
|
|
/** \brief Checks whether a given key was pressed
|
|
|
|
*
|
|
|
|
* This function can be used to check whether a single key (e.g. ESC) was
|
|
|
|
* pressed. This is useful when one wants to abort an action or quit from the
|
|
|
|
* main screen by pressing a single key.
|
|
|
|
*/
|
|
|
|
bool CheckKeyPress (int keycode);
|
|
|
|
|
2010-08-29 23:59:24 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* _IMGUICONTROLS_H */
|