32#include <portability.h>
56 scrollist = &(
object->u.scrollist);
71 scrollist = &(
object->u.scrollist);
100 scrollist = &(
object->u.scrollist);
153 object->id = screen->
curId++;
157 object->xmax = x + width;
159 object->ymax =
y + height;
161 scrollist = &(
object->u.scrollist);
171 switch(scrollBarPos) {
202 if(scrollist->
elts == NULL) {
203 scrollist->
elts = elt;
207 cur = scrollist->
elts;
217 }
while(cur != scrollist->
elts);
224 if((cur == scrollist->
elts) && (index != 0)) {
225 scrollist->
elts = elt;
236 if(scrollist->
elts == NULL) {
240 cur = scrollist->
elts;
251 }
while(cur != scrollist->
elts);
256 if(cur == scrollist->
elts) {
257 if(cur->
next == cur) {
296 scrollist = &(
object->u.scrollist);
302 if(scrollist->
elts == NULL) {
306 elt = scrollist->
elts;
317 }
while(elt != scrollist->
elts);
354 scrollist = &(
object->u.scrollist);
356 if((index < 0) || (index > scrollist->
nbElts - 1)) {
360 if(scrollist->
elts == NULL) {
364 elt = scrollist->
elts;
375 }
while(elt != scrollist->
elts);
411 scrollist = &(
object->u.scrollist);
461 scrollist = &(
object->u.scrollist);
463 if((index < 0) || (index > scrollist->
nbElts - 1)) {
512 scrollist = &(
object->u.scrollist);
540 const int BUFSIZE = 256;
547 fgColor = scrollist->
fgColor[0];
548 bgColor = scrollist->
bgColor[0];
550 if(bgColor[3] != 0.0) {
560 glBegin(GL_LINE_STRIP);
574 elt = scrollist->
elts;
577 if(scrollist->
nbElts < 100) {
578 snprintf(buf, BUFSIZE,
" 00 ");
580 snprintf(buf, BUFSIZE,
" 000 ");
588 if(index < scrollist->firstVisible) {
596 glColor4fv(scrollist->
fgColor[0]);
606 snprintf(buf, BUFSIZE,
" %d", index);
609 }
while(elt != scrollist->
elts);
622 if(curObject != NULL) {
624 curObject = curObject->
next;
646 scrollist = &(
object->u.scrollist);
650 if(relY > scrollist->
nbElts) {
687 scrollist = &(
object->u.scrollist);
695 if((newPos < 0) || (newPos > scrollist->
nbElts - 1)) {
int getWidth(const char *text)
static void onSelect(void *)
int GfuiScrollBarCreate(void *scr, int x, int y, int align, int width, int orientation, int min, int max, int len, int start, void *userData, tfuiSBCallback onScroll)
Create a new scroll bar.
int GfuiScrollListCreateAction(void *scr, int font, int x, int y, int align, int width, int height, int scrollBarPos, const tGfuiAction &onSelect)
Create a new scroll list.
int GfuiScrollListInsertElement(void *scr, int Id, char *element, int index, void *userData)
Insert an element in a scroll list.
int GfuiScrollListCreate(void *scr, int font, int x, int y, int align, int width, int height, int scrollBarPos, void *userDataOnSelect, tfuiCallback onSelect)
Create a scrolling list using a callback with caller-supplied data.
char * GfuiScrollListExtractElement(void *scr, int Id, int index, void **userData)
Extract the specified element from the scroll list.
char * GfuiScrollListGetSelectedElement(void *scr, int Id, void **userData)
Get the selected element from the scroll list.
char * GfuiScrollListExtractSelectedElement(void *scr, int Id, void **userData)
Extract the selected element from the scroll list (removed).
char * GfuiScrollListGetElement(void *scr, int Id, int index, void **userData)
Get the specified element from the scroll list.
void GfuiScrollBarPosSet(void *scr, int id, int min, int max, int len, int start)
Set new values for position.
int GfuiScrollListMoveSelectedElement(void *scr, int Id, int delta)
Move the selected element within the scroll list.
void gfuiReleaseAction(tGfuiAction *action)
tGfuiAction gfuiMakeAction(void *userData, tfuiCallback callback)
float GfuiColor[GFUI_COLORNB][4]
tGfuiAction * gfuiCreateAction(const tGfuiAction &action)
void gfuiRunAction(const tGfuiAction *action)
#define GFUI_FGSELSCROLLIST
void gfuiPrintString(int x, int y, GfuiFontClass *font, const char *string)
void gfuiAddObject(tGfuiScreen *screen, tGfuiObject *object)
struct GfuiObject tGfuiObject
struct GfuiListElement tGfuiListElement
tGfuiObject * gfuiGetObject(void *scr, int id)
#define GFUI_FOCUS_MOUSE_MOVE
#define GFUI_BGSELSCROLLIST
GfuiFontClass * gfuiFont[FONT_NB]
struct GfuiListElement * prev
struct GfuiListElement * next
tGfuiScrollList scrollist
union GfuiObject::@107216344126174123112226307372375007210201317144 u
The Gaming Framework API (client part).
void(* tfuiCallback)(void *)
struct ScrollBarInfo tScrollBarInfo
Scroll bar call-back information.
std::function< void()> tGfuiAction
#define GFUI_VERT_SCROLLBAR