gKit2 light

- Main Page
- Related Pages
- Modules
- Classes
- Files

- File List
- File Members

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
64 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
70 Text console;
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
86 Widgets create_widgets( );
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 );
136
138 void end_line( Widgets& widgets );
139
141 void end( Widgets& widgets );
142
144 void default_color( Widgets& widgets, const Color& color );
145
147 void draw( Widgets& widgets, const int width, const int height );
148
150 #endif
Widgets::focus
int focus
focus
Definition: widgets.h:73
Widgets::console
Text console
affichage des elements de l'interface.
Definition: widgets.h:70
Widgets
Definition: widgets.h:66
end
void end(Widgets &widgets)
termine la description des elements de l'interface graphique.
Definition: widgets.cpp:363
text.h
Widgets::py
int py
placement du prochain widget
Definition: widgets.h:71
Widgets::fy
int fy
position du focus
Definition: widgets.h:74
Color
representation d'une couleur (rgba) transparente ou opaque.
Definition: color.h:13
create_widgets
Widgets create_widgets()
cree une interface graphique. a detruire avec release_widgets( ).
Definition: widgets.cpp:12
end_line
void end_line(Widgets &widgets)
termine la description des elements de la ligne.
Definition: widgets.cpp:136
Widgets::mb
int mb
click
Definition: widgets.h:76
text_area
void text_area(Widgets &w, const int height, const char *text, int &begin_line)
Definition: widgets.cpp:232
Widgets::key
int key
touche
Definition: widgets.h:80
release_widgets
void release_widgets(Widgets &widgets)
detruit l'interface graphique.
Definition: widgets.cpp:23
default_color
void default_color(Widgets &widgets, const Color &color)
choisit une couleur par defaut pour le texte.
Definition: widgets.cpp:368
Widgets::wy
int wy
scroll
Definition: widgets.h:78
Text
Definition: text.h:61
edit
bool edit(Widgets &widgets, const int text_size, char *text)
Definition: widgets.cpp:278
value
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
select
bool select(Widgets &widgets, const char *text, const int option, int &status)
Definition: widgets.cpp:173
button
bool button(Widgets &widgets, const char *text, int &status)
Definition: widgets.cpp:155
begin
void begin(Widgets &widgets)
debut de la description des elements de l'interface graphique.
Definition: widgets.cpp:29
draw
void draw(Widgets &widgets, const int width, const int height)
affiche les elements decrits entre begin() et end().
Definition: widgets.cpp:373
begin_line
void begin_line(Widgets &widgets)
place les prochains elements sur une nouvelle ligne.
Definition: widgets.cpp:129
Widgets::mod
unsigned int mod
touches supplementaires, alt, ctrl, etc.
Definition: widgets.h:81
Widgets::my
int my
position du click
Definition: widgets.h:77
label
void label(Widgets &widgets, const char *format,...)
cree un texte. meme fonctionnement que printf().
Definition: widgets.cpp:142