gKit2 light
widgets.h
Go to the documentation of this file.
1 
2 #ifndef _WIDGETS_H
3 #define _WIDGETS_H
4 
5 #include "text.h"
6 
7 
10 
66 struct Widgets
67 {
68  Widgets( ) : console(), px(0), py(0), focus(0), fx(0), fy(0), mb(0), mx(0), my(0), wx(0), wy(0), key(0), mod(0) {}
69 
71  int px, py;
72 
73  int focus;
74  int fx, fy;
75 
76  int mb;
77  int mx, my;
78  int wx, wy;
79 
80  int key;
81  unsigned int mod;
82 };
83 
84 
88 void release_widgets( Widgets& widgets );
89 
91 void begin( Widgets& widgets );
92 
94 void begin_line( Widgets& widgets );
95 
97 void label( Widgets& widgets, const char *format, ... );
98 
102 bool button( Widgets& widgets, const char *text, int& status );
107 bool select( Widgets& widgets, const char *text, const int option, int& status );
108 
113 void text_area( Widgets& w, const int height, const char *text, int& begin_line );
114 
132 bool edit( Widgets& widgets, const int text_size, char *text );
133 
135 bool value( Widgets& widgets, const char *label, int& value, const int value_min, const int value_max, const int value_step );
137 bool value( Widgets& widgets, const char *label, float& value, const float value_min, const float value_max, const float value_step );
138 
140 void end_line( Widgets& widgets );
141 
143 void end( Widgets& widgets );
144 
146 void default_color( Widgets& widgets, const Color& color );
147 
149 void draw( Widgets& widgets, const int width, const int height );
150 
152 #endif
void begin(Widgets &widgets)
debut de la description des elements de l'interface graphique.
Definition: widgets.cpp:29
Widgets create_widgets()
cree une interface graphique. a detruire avec release_widgets( ).
Definition: widgets.cpp:12
void release_widgets(Widgets &widgets)
detruit l'interface graphique.
Definition: widgets.cpp:23
bool button(Widgets &widgets, const char *text, int &status)
Definition: widgets.cpp:155
void label(Widgets &widgets, const char *format,...)
cree un texte. meme fonctionnement que printf().
Definition: widgets.cpp:142
bool value(Widgets &widgets, const char *label, int &value, const int value_min, const int value_max, const int value_step)
valeur editable par increment.
Definition: widgets.cpp:191
void end_line(Widgets &widgets)
termine la description des elements de la ligne.
Definition: widgets.cpp:136
bool select(Widgets &widgets, const char *text, const int option, int &status)
Definition: widgets.cpp:173
bool edit(Widgets &widgets, const int text_size, char *text)
Definition: widgets.cpp:319
void end(Widgets &widgets)
termine la description des elements de l'interface graphique.
Definition: widgets.cpp:404
void draw(Widgets &widgets, const int width, const int height)
affiche les elements decrits entre begin() et end().
Definition: widgets.cpp:414
void text_area(Widgets &w, const int height, const char *text, int &begin_line)
Definition: widgets.cpp:273
void begin_line(Widgets &widgets)
place les prochains elements sur une nouvelle ligne.
Definition: widgets.cpp:129
void default_color(Widgets &widgets, const Color &color)
choisit une couleur par defaut pour le texte.
Definition: widgets.cpp:409
representation d'une couleur (rgba) transparente ou opaque.
Definition: color.h:14
Definition: text.h:62
int wy
scroll
Definition: widgets.h:78
unsigned int mod
touches supplementaires, alt, ctrl, etc.
Definition: widgets.h:81
int fy
position du focus
Definition: widgets.h:74
Text console
affichage des elements de l'interface.
Definition: widgets.h:70
int mb
click
Definition: widgets.h:76
int my
position du click
Definition: widgets.h:77
int focus
focus
Definition: widgets.h:73
int py
placement du prochain widget
Definition: widgets.h:71
int key
touche
Definition: widgets.h:80