TORCS  1.3.10
The Open Racing Car Simulator
Loading...
Searching...
No Matches
guibutton.cpp
Go to the documentation of this file.
1/***************************************************************************
2 guibutton.cpp
3 -------------------
4 created : Fri Aug 13 22:18:21 CEST 1999
5 copyright : (C) 1999-2026 by Eric EspiƩ, Bernhard Wymann
6 email : berniw@bluewin.ch
7
8 ***************************************************************************/
9
10/***************************************************************************
11 * *
12 * This program is free software; you can redistribute it and/or modify *
13 * it under the terms of the GNU General Public License as published by *
14 * the Free Software Foundation; either version 2 of the License, or *
15 * (at your option) any later version. *
16 * *
17 ***************************************************************************/
18
19
24
25#include <stdlib.h>
26#ifdef WIN32
27#include <windows.h>
28#endif
29#include <tgfclient.h>
30#include "gui.h"
31#include "guifont.h"
32
33void
35{
36}
37
57int
58GfuiGrButtonCreateAction(void *scr, const char *disabled, const char *enabled, const char *focused, const char *pushed,
59 int x, int y, int align, int mouse,
60 const tGfuiAction &onPush,
61 const tGfuiAction &onFocus, const tGfuiAction &onFocusLost)
62{
63 tGfuiGrButton *button;
64 tGfuiObject *object;
65 tGfuiScreen *screen = (tGfuiScreen*)scr;
66 int width, height;
67
68 object = (tGfuiObject*)calloc(1, sizeof(tGfuiObject));
69 object->widget = GFUI_GRBUTTON;
70 object->focusMode = GFUI_FOCUS_MOUSE_MOVE;
71 object->id = screen->curId++;
72 object->visible = 1;
73
74 button = &(object->u.grbutton);
75 button->state = GFUI_BTN_RELEASED;
77 button->onFocusAction = gfuiCreateAction(onFocus);
79 button->mouseBehaviour = mouse;
80
81 button->disabled = GfImgReadPng(disabled, &width, &height, 1.0);
82 button->enabled = GfImgReadPng(enabled, &width, &height, 1.0);
83 button->focused = GfImgReadPng(focused, &width, &height, 1.0);
84 button->pushed = GfImgReadPng(pushed, &width, &height, 1.0);
85
86 switch (align) {
88 object->xmin = x - width;
89 object->xmax = x;
90 object->ymin = y;
91 object->ymax = y + height;
92 break;
94 object->xmin = x - width;
95 object->xmax = x;
96 object->ymin = y - height / 2;
97 object->ymax = y + height / 2;
98 break;
100 object->xmin = x - width;
101 object->xmax = x;
102 object->ymin = y - height;
103 object->ymax = y;
104 break;
105 case GFUI_ALIGN_HC_VB:
106 object->xmin = x - width / 2;
107 object->xmax = x + width / 2;
108 object->ymin = y;
109 object->ymax = y + height;
110 break;
111 case GFUI_ALIGN_HC_VC:
112 object->xmin = x - width / 2;
113 object->xmax = x + width / 2;
114 object->ymin = y - height / 2;
115 object->ymax = y + height / 2;
116 break;
117 case GFUI_ALIGN_HC_VT:
118 object->xmin = x - width / 2;
119 object->xmax = x + width / 2;
120 object->ymin = y - height;
121 object->ymax = y;
122 break;
123 case GFUI_ALIGN_HL_VB:
124 object->xmin = x;
125 object->xmax = x + width;
126 object->ymin = y;
127 object->ymax = y + height;
128 break;
129 case GFUI_ALIGN_HL_VC:
130 object->xmin = x;
131 object->xmax = x + width;
132 object->ymin = y - height / 2;
133 object->ymax = y + height / 2;
134 break;
135 case GFUI_ALIGN_HL_VT:
136 object->xmin = x;
137 object->xmax = x + width;
138 object->ymin = y - height;
139 object->ymax = y;
140 break;
141 default:
142 break;
143 }
144
145 button->width = width;
146 button->height = height;
147
148 gfuiAddObject(screen, object);
149 return object->id;
150}
151
152int
153GfuiGrButtonCreate(void *scr, const char *disabled, const char *enabled, const char *focused, const char *pushed,
154 int x, int y, int align, int mouse,
155 void *userDataOnPush, tfuiCallback onPush,
156 void *userDataOnFocus, tfuiCallback onFocus, tfuiCallback onFocusLost)
157{
158 return GfuiGrButtonCreateAction(scr, disabled, enabled, focused, pushed, x, y, align, mouse,
159 gfuiMakeAction(userDataOnPush, onPush), gfuiMakeAction(userDataOnFocus, onFocus),
160 gfuiMakeAction(userDataOnFocus, onFocusLost));
161}
162
169int
170GfuiButtonStateCreate(void *scr, const char *text, int font, int x, int y, int width, int align, int mouse,
171 void *userDataOnPush, tfuiCallback onPush,
172 void *userDataOnFocus, tfuiCallback onFocus, tfuiCallback onFocusLost)
173{
174 return GfuiButtonStateCreateAction(scr, text, font, x, y, width, align, mouse,
175 gfuiMakeAction(userDataOnPush, onPush), gfuiMakeAction(userDataOnFocus, onFocus),
176 gfuiMakeAction(userDataOnFocus, onFocusLost));
177}
178
179int
180GfuiButtonStateCreateAction(void *scr, const char *text, int font, int x, int y, int width, int align, int mouse,
181 const tGfuiAction &onPush,
182 const tGfuiAction &onFocus, const tGfuiAction &onFocusLost)
183{
184 int id;
185 tGfuiButton *button;
186 tGfuiObject *curObject;
187 tGfuiScreen *screen = (tGfuiScreen*)scr;
188
189 id = GfuiButtonCreateAction(scr, text, font, x, y, width, align, mouse, onPush, onFocus, onFocusLost);
190
191 curObject = screen->objects;
192 if (curObject != NULL) {
193 do {
194 curObject = curObject->next;
195 if (curObject->id == id) {
196 if (curObject->widget == GFUI_BUTTON) {
197 button = &(curObject->u.button);
198 button->buttonType = GFUI_BTN_STATE;
199 }
200 return id;
201 }
202 } while (curObject != screen->objects);
203 }
204
205 return id;
206}
207
208
227int
228GfuiButtonCreateAction(void *scr, const char *text, int font, int x, int y, int width, int align, int mouse,
229 const tGfuiAction &onPush,
230 const tGfuiAction &onFocus, const tGfuiAction &onFocusLost)
231{
232 tGfuiButton *button;
233 tGfuiLabel *label;
234 tGfuiObject *object;
235 tGfuiScreen *screen = (tGfuiScreen*)scr;
236
237
238 object = (tGfuiObject*)calloc(1, sizeof(tGfuiObject));
239 object->widget = GFUI_BUTTON;
240 object->focusMode = GFUI_FOCUS_MOUSE_MOVE;
241 object->id = screen->curId++;
242 object->visible = 1;
243
244 button = &(object->u.button);
245 button->state = GFUI_BTN_RELEASED;
247 button->onFocusAction = gfuiCreateAction(onFocus);
249 button->mouseBehaviour = mouse;
250 button->buttonType = GFUI_BTN_PUSH;
251
252 button->bgColor[0] = &(GfuiColor[GFUI_BGBTNDISABLED][0]);
253 button->bgColor[1] = &(GfuiColor[GFUI_BGBTNENABLED][0]);
254 button->bgColor[2] = &(GfuiColor[GFUI_BGBTNCLICK][0]);
255 button->bgFocusColor[0] = &(GfuiColor[GFUI_BGBTNDISABLED][0]);
256 button->bgFocusColor[1] = &(GfuiColor[GFUI_BGBTNFOCUS][0]);
257 button->bgFocusColor[2] = &(GfuiColor[GFUI_BGBTNCLICK][0]);
258 button->fgColor[0] = &(GfuiColor[GFUI_BTNDISABLED][0]);
259 button->fgColor[1] = &(GfuiColor[GFUI_BTNENABLED][0]);
260 button->fgColor[2] = &(GfuiColor[GFUI_BTNCLICK][0]);
261 button->fgFocusColor[0] = &(GfuiColor[GFUI_BTNDISABLED][0]);
262 button->fgFocusColor[1] = &(GfuiColor[GFUI_BTNFOCUS][0]);
263 button->fgFocusColor[2] = &(GfuiColor[GFUI_BTNCLICK][0]);
264
265 label = &(button->label);
266 label->text = (char*)calloc(1, 100);
267 strncpy(label->text, text, 100);
268 label->text[99] = '\0';
269 label->font = gfuiFont[font];
270 label->maxlen = 99;
271 if (width == 0) {
272 width = gfuiFont[font]->getWidth((const char *)text);
273 }
274
275 label->align = align;
276
277 switch(align&0xF0) {
278 case 0x00 /* LEFT */:
279 label->x = object->xmin = x;
280 label->y = y - 2 * gfuiFont[font]->getDescender();
281 object->ymin = y;
282 object->xmax = x + width;
283 object->ymax = y + gfuiFont[font]->getHeight() - gfuiFont[font]->getDescender();
284 break;
285 case 0x10 /* CENTER */:
286 object->xmin = x - width / 2;
287 label->x = x - gfuiFont[font]->getWidth((const char *)text) / 2;
288 label->y = y - 2 * gfuiFont[font]->getDescender();
289 object->ymin = y;
290 object->xmax = x + width / 2;
291 object->ymax = y + gfuiFont[font]->getHeight() - gfuiFont[font]->getDescender();
292 break;
293 case 0x20 /* RIGHT */:
294 label->x = object->xmin = x - width;
295 label->y = y - 2 * gfuiFont[font]->getDescender();
296 object->ymin = y;
297 object->xmax = x;
298 object->ymax = y + gfuiFont[font]->getHeight() - gfuiFont[font]->getDescender();
299 break;
300 }
301#define HORIZ_MARGIN 10
302 object->xmin -= HORIZ_MARGIN;
303 object->xmax += HORIZ_MARGIN;
304
305 gfuiAddObject(screen, object);
306 return object->id;
307}
308
309int
310GfuiButtonCreate(void *scr, const char *text, int font, int x, int y, int width, int align, int mouse,
311 void *userDataOnPush, tfuiCallback onPush,
312 void *userDataOnFocus, tfuiCallback onFocus, tfuiCallback onFocusLost)
313{
314 return GfuiButtonCreateAction(scr, text, font, x, y, width, align, mouse,
315 gfuiMakeAction(userDataOnPush, onPush), gfuiMakeAction(userDataOnFocus, onFocus),
316 gfuiMakeAction(userDataOnFocus, onFocusLost));
317}
318
319
320int GfuiLeanButtonCreate(void *scr, const char *text, int font, int x, int y, int width, int align, int mouse,
321 void *userDataOnPush, tfuiCallback onPush,
322 void *userDataOnFocus, tfuiCallback onFocus, tfuiCallback onFocusLost)
323{
324 return GfuiLeanButtonCreateAction(scr, text, font, x, y, width, align, mouse,
325 gfuiMakeAction(userDataOnPush, onPush), gfuiMakeAction(userDataOnFocus, onFocus),
326 gfuiMakeAction(userDataOnFocus, onFocusLost));
327}
328
329int GfuiLeanButtonCreateAction(void *scr, const char *text, int font, int x, int y, int width, int align, int mouse,
330 const tGfuiAction &onPush,
331 const tGfuiAction &onFocus, const tGfuiAction &onFocusLost)
332{
333 int id = GfuiButtonCreateAction(scr, text, font, x, y, width, align, mouse,
334 onPush, onFocus, onFocusLost);
335 tGfuiObject *o = gfuiGetObject(scr, id);
336 if (o->widget == GFUI_BUTTON) {
337 // Undo margins
338 o->xmax -= HORIZ_MARGIN;
339 o->xmin += HORIZ_MARGIN;
340
341 tGfuiButton *button = &(o->u.button);
342 button->bgColor[1] = &(GfuiColor[GFUI_BGBTNFOCUS][0]);
343 }
344 return id;
345}
346
355void
356GfuiButtonSetText(void *scr, int id, const char *text)
357{
358 tGfuiObject *curObject;
359 tGfuiScreen *screen = (tGfuiScreen*)scr;
360 int oldmin, oldmax;
361
362 curObject = screen->objects;
363 if (curObject != NULL) {
364 do {
365 curObject = curObject->next;
366 if (curObject->id == id) {
367 if (curObject->widget == GFUI_BUTTON) {
368 oldmax = curObject->xmax;
369 oldmin = curObject->xmin;
370 gfuiSetLabelText(curObject, &(curObject->u.button.label), text);
371 curObject->xmax = oldmax;
372 curObject->xmin = oldmin;
373 }
374 return;
375 }
376 } while (curObject != screen->objects);
377 }
378}
379
385int
387{
388 tGfuiObject *curObject;
389
390 if (GfuiScreen != NULL) {
391 curObject = GfuiScreen->objects;
392 if (curObject != NULL) {
393 do {
394 curObject = curObject->next;
395 if (curObject->focus) {
396 if (curObject->widget == GFUI_BUTTON) {
397 return curObject->id;
398 }
399 return -1;
400 }
401 } while (curObject != GfuiScreen->objects);
402 }
403 }
404 return -1;
405}
406
407void
409{
410 tGfuiLabel *label;
411 tGfuiButton *button;
412 float *fgColor;
413 float *bgColor;
414
415 button = &(obj->u.button);
416 if (obj->state == GFUI_DISABLE) {
417 button->state = GFUI_BTN_DISABLE;
418 } else if (obj->state == GFUI_ENABLE && button->state == GFUI_BTN_DISABLE) {
419 button->state = GFUI_BTN_RELEASED;
420 }
421
422 if (obj->focus) {
423 fgColor = button->fgFocusColor[button->state];
424 bgColor = button->bgFocusColor[button->state];
425 } else {
426 fgColor = button->fgColor[button->state];
427 bgColor = button->bgColor[button->state];
428 }
429 if (bgColor[3] != 0.0) {
430 glColor4fv(bgColor);
431 glBegin(GL_QUADS);
432 glVertex2i(obj->xmin, obj->ymin);
433 glVertex2i(obj->xmin, obj->ymax);
434 glVertex2i(obj->xmax, obj->ymax);
435 glVertex2i(obj->xmax, obj->ymin);
436 glEnd();
437 glColor4fv(fgColor);
438 glBegin(GL_LINE_STRIP);
439 glVertex2i(obj->xmin, obj->ymin);
440 glVertex2i(obj->xmin, obj->ymax);
441 glVertex2i(obj->xmax, obj->ymax);
442 glVertex2i(obj->xmax, obj->ymin);
443 glVertex2i(obj->xmin, obj->ymin);
444 glEnd();
445 }
446 label = &(button->label);
447 glColor4fv(fgColor);
448 gfuiPrintString(label->x, label->y, label->font, label->text);
449}
450
451void
453{
454 int sw, sh, vw, vh;
455 tGfuiGrButton *button;
456 unsigned char *img;
457
458 button = &(obj->u.grbutton);
459 if (obj->state == GFUI_DISABLE) {
460 img = button->disabled;
461 } else if (button->state == GFUI_BTN_PUSHED) {
462 img = button->pushed;
463 } else if (obj->focus) {
464 img = button->focused;
465 } else {
466 img = button->enabled;
467 }
468 GfScrGetSize(&sw, &sh, &vw, &vh);
469 glRasterPos2i(obj->xmin, obj->ymin);
470 glPixelZoom((float)vw / (float)GfuiScreen->width, (float)vh / (float)GfuiScreen->height);
471 glDrawPixels(button->width, button->height, GL_RGBA, GL_UNSIGNED_BYTE, img);
472}
473
474void
476{
477 tGfuiObject *object = GfuiScreen->hasFocus;
478 if (object->state == GFUI_DISABLE) {
479 return;
480 }
481
482 tGfuiGrButton *button;
483 button = &(GfuiScreen->hasFocus->u.grbutton);
484
485 switch (button->buttonType) {
486 case GFUI_BTN_PUSH:
487 if (action == 2) { /* enter key */
489 } else if (action == 1) { /* mouse up */
490 if (button->state != GFUI_BTN_RELEASED) {
491 button->state = GFUI_BTN_RELEASED;
492 if (button->mouseBehaviour == GFUI_MOUSE_UP) {
494 }
495 }
496 } else { /* mouse down */
497 if (button->state != GFUI_BTN_PUSHED) {
498 button->state = GFUI_BTN_PUSHED;
499 if (button->mouseBehaviour == GFUI_MOUSE_DOWN) {
501 }
502 }
503 }
504 break;
505
506 case GFUI_BTN_STATE:
507 if (action == 2) { /* enter key */
508 if (button->state == GFUI_BTN_RELEASED) {
509 button->state = GFUI_BTN_PUSHED;
511 } else {
512 button->state = GFUI_BTN_RELEASED;
513 }
514 } else if (action == 1) { /* mouse up */
515 if (button->mouseBehaviour == GFUI_MOUSE_UP) {
516 if (button->state == GFUI_BTN_RELEASED) {
517 button->state = GFUI_BTN_PUSHED;
519 } else {
520 button->state = GFUI_BTN_RELEASED;
521 }
522 }
523 } else { /* mouse down */
524 if (button->mouseBehaviour == GFUI_MOUSE_DOWN) {
525 if (button->state == GFUI_BTN_RELEASED) {
526 button->state = GFUI_BTN_PUSHED;
528 } else {
529 button->state = GFUI_BTN_RELEASED;
530 }
531 }
532 }
533 break;
534 }
535}
536
537void
539{
540 tGfuiObject *object = GfuiScreen->hasFocus;
541 if (object->state == GFUI_DISABLE) {
542 return;
543 }
544
545 tGfuiButton *button;
546 button = &(GfuiScreen->hasFocus->u.button);
547
548 switch (button->buttonType) {
549 case GFUI_BTN_PUSH:
550 if (action == 2) { /* enter key */
552 } else if (action == 1) { /* mouse up */
553 button->state = GFUI_BTN_RELEASED;
554 if (button->mouseBehaviour == GFUI_MOUSE_UP) {
556 }
557 } else { /* mouse down */
558 button->state = GFUI_BTN_PUSHED;
559 if (button->mouseBehaviour == GFUI_MOUSE_DOWN) {
561 }
562 }
563 break;
564
565 case GFUI_BTN_STATE:
566 if (action == 2) { /* enter key */
567 if (button->state == GFUI_BTN_RELEASED) {
568 button->state = GFUI_BTN_PUSHED;
570 } else {
571 button->state = GFUI_BTN_RELEASED;
572 }
573 } else if (action == 1) { /* mouse up */
574 if (button->mouseBehaviour == GFUI_MOUSE_UP) {
575 if (button->state == GFUI_BTN_RELEASED) {
576 button->state = GFUI_BTN_PUSHED;
578 } else {
579 button->state = GFUI_BTN_RELEASED;
580 }
581 }
582 } else { /* mouse down */
583 if (button->mouseBehaviour == GFUI_MOUSE_DOWN) {
584 if (button->state == GFUI_BTN_RELEASED) {
585 button->state = GFUI_BTN_PUSHED;
587 } else {
588 button->state = GFUI_BTN_RELEASED;
589 }
590 }
591 }
592 break;
593 }
594}
595
596void
598{
599 tGfuiButton *button;
600 tGfuiLabel *label;
601
602 button = &(obj->u.button);
603 label = &(button->label);
604
608 free(label->text);
609 free(obj);
610}
611
612void
614{
615 tGfuiGrButton *button;
616
617 button = &(obj->u.grbutton);
618
622 free(button->disabled);
623 free(button->enabled);
624 free(button->focused);
625 free(button->pushed);
626 free(obj);
627}
static Vector y[4]
Definition Convex.cpp:56
static void onPush(tCmdInfo *cmdInfo)
static void onFocusLost(void)
int GfuiButtonGetFocused(void)
Get the Id of the button focused in the current screen.
int GfuiButtonStateCreate(void *scr, const char *text, int font, int x, int y, int width, int align, int mouse, void *userDataOnPush, tfuiCallback onPush, void *userDataOnFocus, tfuiCallback onFocus, tfuiCallback onFocusLost)
Add a state button to a screen.
int GfuiGrButtonCreate(void *scr, const char *disabled, const char *enabled, const char *focused, const char *pushed, int x, int y, int align, int mouse, void *userDataOnPush, tfuiCallback onPush, void *userDataOnFocus, tfuiCallback onFocus, tfuiCallback onFocusLost)
Create an image button using callbacks with caller-supplied data.
int GfuiLeanButtonCreateAction(void *scr, const char *text, int font, int x, int y, int width, int align, int mouse, const tGfuiAction &onPush, const tGfuiAction &onFocus, const tGfuiAction &onFocusLost)
Create a text button without horizontal margins.
int GfuiButtonCreate(void *scr, const char *text, int font, int x, int y, int width, int align, int mouse, void *userDataOnPush, tfuiCallback onPush, void *userDataOnFocus, tfuiCallback onFocus, tfuiCallback onFocusLost)
Create a text button using callbacks with caller-supplied data.
void GfuiButtonSetText(void *scr, int id, const char *text)
Change the label of a button.
int GfuiButtonStateCreateAction(void *scr, const char *text, int font, int x, int y, int width, int align, int mouse, const tGfuiAction &onPush, const tGfuiAction &onFocus, const tGfuiAction &onFocusLost)
Create a text button that toggles between pressed and released while focused.
int GfuiGrButtonCreateAction(void *scr, const char *disabled, const char *enabled, const char *focused, const char *pushed, int x, int y, int align, int mouse, const tGfuiAction &onPush, const tGfuiAction &onFocus, const tGfuiAction &onFocusLost)
Add a graphical button to a screen.
Definition guibutton.cpp:58
int GfuiButtonCreateAction(void *scr, const char *text, int font, int x, int y, int width, int align, int mouse, const tGfuiAction &onPush, const tGfuiAction &onFocus, const tGfuiAction &onFocusLost)
Add a button to a screen.
int GfuiLeanButtonCreate(void *scr, const char *text, int font, int x, int y, int width, int align, int mouse, void *userDataOnPush, tfuiCallback onPush, void *userDataOnFocus, tfuiCallback onFocus, tfuiCallback onFocusLost)
Create a marginless text button using callbacks with caller-supplied data.
unsigned char * GfImgReadPng(const char *filename, int *widthp, int *heightp, float screen_gamma)
Load an image from disk to a buffer in RGBA mode.
Definition img.cpp:53
void GfScrGetSize(int *scrw, int *scrh, int *vieww, int *viewh)
Get the screen and viewport sizes.
Definition screen.cpp:529
tGfuiScreen * GfuiScreen
Definition gui.cpp:32
void gfuiReleaseAction(tGfuiAction *action)
Definition gui.cpp:79
tGfuiAction gfuiMakeAction(void *userData, tfuiCallback callback)
Definition gui.cpp:48
float GfuiColor[GFUI_COLORNB][4]
Definition gui.cpp:38
tGfuiAction * gfuiCreateAction(const tGfuiAction &action)
Definition gui.cpp:60
void gfuiRunAction(const tGfuiAction *action)
Definition gui.cpp:70
#define GFUI_BTNCLICK
Definition gui.h:34
void gfuiSetLabelText(tGfuiObject *object, tGfuiLabel *label, const char *text)
Definition guilabel.cpp:156
#define GFUI_BTN_RELEASED
Definition gui.h:91
#define GFUI_BTN_DISABLE
Definition gui.h:90
#define GFUI_BGBTNENABLED
Definition gui.h:31
#define GFUI_BGBTNDISABLED
Definition gui.h:32
#define GFUI_BTNFOCUS
Definition gui.h:33
void gfuiPrintString(int x, int y, GfuiFontClass *font, const char *string)
Definition guiobject.cpp:32
#define GFUI_BGBTNCLICK
Definition gui.h:30
#define GFUI_BTN_PUSHED
Definition gui.h:92
#define GFUI_BGBTNFOCUS
Definition gui.h:29
void gfuiAddObject(tGfuiScreen *screen, tGfuiObject *object)
struct GfuiObject tGfuiObject
#define GFUI_BTNENABLED
Definition gui.h:35
#define GFUI_BTN_PUSH
Definition gui.h:95
tGfuiObject * gfuiGetObject(void *scr, int id)
#define GFUI_FOCUS_MOUSE_MOVE
Definition gui.h:129
#define GFUI_BTN_STATE
Definition gui.h:96
#define GFUI_BTNDISABLED
Definition gui.h:36
void gfuiReleaseGrButton(tGfuiObject *obj)
void gfuiDrawGrButton(tGfuiObject *obj)
void gfuiButtonInit(void)
Definition guibutton.cpp:34
void gfuiButtonAction(int action)
void gfuiDrawButton(tGfuiObject *obj)
#define HORIZ_MARGIN
void gfuiReleaseButton(tGfuiObject *obj)
void gfuiGrButtonAction(int action)
GfuiFontClass * gfuiFont[FONT_NB]
Definition guifont.cpp:43
tGfuiButton button
Definition gui.h:204
int ymin
Definition gui.h:199
int xmin
Definition gui.h:199
int xmax
Definition gui.h:200
int ymax
Definition gui.h:200
tGfuiGrButton grbutton
Definition gui.h:205
int state
Definition gui.h:198
int id
Definition gui.h:194
union GfuiObject::@107216344126174123112226307372375007210201317144 u
int widget
Definition gui.h:193
int focus
Definition gui.h:197
struct GfuiObject * next
Definition gui.h:211
unsigned int state
Definition gui.h:105
float * fgColor[3]
Definition gui.h:102
tGfuiLabel label
Definition gui.h:100
tGfuiAction * onFocusAction
Definition gui.h:109
tGfuiAction * onFocusLostAction
Definition gui.h:110
float * fgFocusColor[3]
Definition gui.h:104
int buttonType
Definition gui.h:106
int mouseBehaviour
Definition gui.h:107
float * bgColor[3]
Definition gui.h:101
tGfuiAction * onPushAction
Definition gui.h:108
float * bgFocusColor[3]
Definition gui.h:103
int buttonType
Definition gui.h:121
unsigned char * disabled
Definition gui.h:116
tGfuiAction * onFocusLostAction
Definition gui.h:125
int height
Definition gui.h:120
unsigned char * enabled
Definition gui.h:117
unsigned char * focused
Definition gui.h:118
unsigned int state
Definition gui.h:115
tGfuiAction * onPushAction
Definition gui.h:123
unsigned char * pushed
Definition gui.h:119
int mouseBehaviour
Definition gui.h:122
int width
Definition gui.h:120
tGfuiAction * onFocusAction
Definition gui.h:124
char * text
Definition gui.h:80
int maxlen
Definition gui.h:86
int y
Definition gui.h:84
int align
Definition gui.h:85
int x
Definition gui.h:84
GfuiFontClass * font
Definition gui.h:83
tGfuiObject * objects
Definition gui.h:236
int curId
Definition gui.h:238
The Gaming Framework API (client part).
void(* tfuiCallback)(void *)
Definition tgfclient.h:108
#define GFUI_ENABLE
Definition tgfclient.h:242
#define GFUI_MOUSE_DOWN
Definition tgfclient.h:83
#define GFUI_ALIGN_HC_VC
Definition tgfclient.h:75
#define GFUI_GRBUTTON
Definition tgfclient.h:65
#define GFUI_ALIGN_HL_VB
Definition tgfclient.h:71
#define GFUI_BUTTON
Definition tgfclient.h:64
#define GFUI_MOUSE_UP
Definition tgfclient.h:82
std::function< void()> tGfuiAction
Definition tgfclient.h:107
#define GFUI_ALIGN_HR_VB
Definition tgfclient.h:77
#define GFUI_ALIGN_HR_VC
Definition tgfclient.h:78
#define GFUI_ALIGN_HL_VT
Definition tgfclient.h:73
#define GFUI_ALIGN_HC_VT
Definition tgfclient.h:76
#define GFUI_ALIGN_HC_VB
Definition tgfclient.h:74
#define GFUI_ALIGN_HR_VT
Definition tgfclient.h:79
#define GFUI_DISABLE
Definition tgfclient.h:241
#define GFUI_ALIGN_HL_VC
Definition tgfclient.h:72