TORCS  1.3.9
The Open Racing Car Simulator
GUI Management API

This is an interface to manage menus. More...

Files

file  gui.cpp
 This API is used to manage all the menu screens.
 
file  guibutton.cpp
 GUI Buttons Management.
 
file  guiedit.cpp
 GUI Edit Box Management.
 
file  guihelp.cpp
 GUI help screen management.
 
file  guiimage.cpp
 GUI Images management.
 
file  guilabel.cpp
 GUI labels management.
 
file  guimenu.cpp
 GUI menu management.
 
file  guiscrollbar.cpp
 GUI scrollbar management.
 
file  guiscrollist.cpp
 GUI scroll-list management.
 

Functions

void GfuiDisplayNothing (void)
 Dummy display function for glut. More...
 
void GfuiIdle (void)
 Idle function for the GUI to be called during Idle loop of glut. More...
 
void GfuiDisplay (void)
 Display function for the GUI to be called during redisplay of glut. More...
 
void GfuiMouseHide (void)
 Hide the mouse cursor. More...
 
void GfuiMouseShow (void)
 Show the mouse cursor. More...
 
tMouseInfoGfuiMouseInfo (void)
 Get the mouse information (position and buttons) More...
 
void GfuiMouseSetPos (int x, int y)
 Set the mouse position. More...
 
int GfuiScreenIsActive (void *screen)
 Tell if the screen is active or not. More...
 
void GfuiScreenActivate (void *screen)
 Activate a screen and make it current. More...
 
void GfuiScreenReplace (void *screen)
 Activate a screen and make it current plus release the current screen. More...
 
void GfuiScreenDeactivate (void)
 Deactivate the current screen. More...
 
void * GfuiScreenCreate (void)
 Create a new screen. More...
 
void * GfuiScreenCreateEx (float *bgColor, void *userDataOnActivate, tfuiCallback onActivate, void *userDataOnDeactivate, tfuiCallback onDeactivate, int mouseAllowed)
 Create a screen. More...
 
void GfuiScreenRelease (void *scr)
 Release the given screen. More...
 
void * GfuiHookCreate (void *userDataOnActivate, tfuiCallback onActivate)
 Create a callback hook. More...
 
void GfuiHookRelease (void *hook)
 Release the given hook. More...
 
void GfuiAddKey (void *scr, unsigned char key, const char *descr, void *userData, tfuiCallback onKeyPressed, tfuiCallback onKeyReleased)
 Add a Keyboard callback to a screen. More...
 
void GfuiRegisterKey (unsigned char key, char *descr, void *userData, tfuiCallback onKeyPressed, tfuiCallback onKeyReleased)
 Add a Keyboard callback to the current screen. More...
 
void GfuiAddSKey (void *scr, int key, const char *descr, void *userData, tfuiCallback onKeyPressed, tfuiCallback onKeyReleased)
 Add a Special Keyboard shortcut to the screen. More...
 
void GfuiScreenAddBgImg (void *scr, const char *filename)
 Add an image background to a screen. More...
 
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)
 Add a graphical button to a screen. More...
 
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. More...
 
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)
 Add a button to a screen. More...
 
void GfuiButtonSetText (void *scr, int id, const char *text)
 Change the label of a button. More...
 
int GfuiButtonGetFocused (void)
 Get the Id of the button focused in the current screen. More...
 
int GfuiEditboxCreate (void *scr, const char *text, int font, int x, int y, int width, int maxlen, void *userDataOnFocus, tfuiCallback onFocus, tfuiCallback onFocusLost, int margin)
 Add a editbox to a screen. More...
 
int GfuiEditboxGetFocused (void)
 Get the Id of the editbox focused in the current screen. More...
 
char * GfuiEditboxGetString (void *scr, int id)
 Get the string. More...
 
void GfuiEditboxSetString (void *scr, int id, const char *text)
 Set a new string. More...
 
void GfuiHelpScreen (void *prevScreen)
 Generate a help screen. More...
 
int GfuiStaticImageCreate (void *scr, int x, int y, int w, int h, char *name)
 Create a new static image. More...
 
void GfuiStaticImageSet (void *scr, int id, char *name)
 Replace an image by another one. More...
 
int GfuiLabelCreateEx (void *scr, const char *text, float *fgColor, int font, int x, int y, int align, int maxlen)
 Create a new label (extended version). More...
 
int GfuiLabelCreate (void *scr, const char *text, int font, int x, int y, int align, int maxlen)
 Add a label to a screen. More...
 
int GfuiTitleCreate (void *scr, const char *text, int maxlen)
 Add a Title to the screen. More...
 
void GfuiLabelSetText (void *scr, int id, const char *text)
 Change the text of a label. More...
 
void GfuiLabelSetColor (void *scr, int id, float *color)
 Change the color of a label. More...
 
void GfuiMenuDefaultKeysAdd (void *scr)
 Add the default menu keyboard callback to a screen. More...
 
void * GfuiMenuScreenCreate (const char *title)
 Create a new menu screen. More...
 
int GfuiMenuButtonCreate (void *scr, const char *text, const char *tip, void *userdata, tfuiCallback onpush)
 Add a button to a menu screen. More...
 
int GfuiMenuBackQuitButtonCreate (void *scr, const char *text, const char *tip, void *userdata, tfuiCallback onpush)
 Add the "Back" or "Quit" button at the bottom of the menu screen. More...
 
void GfuiUnSelectCurrent (void)
 Remove the focus on the current element. More...
 
int GfuiVisibilitySet (void *scr, int id, int visible)
 Set/unset the visibility attribute of an object. More...
 
int GfuiEnable (void *scr, int id, int flag)
 Enable / Disable an object. More...
 
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. More...
 
int GfuiScrollBarPosGet (void *scr, int id)
 Get the current position of a scroll bar. More...
 
void GfuiScrollBarPosSet (void *scr, int id, int min, int max, int len, int start)
 Set new values for position. More...
 
int GfuiScrollListCreate (void *scr, int font, int x, int y, int align, int width, int height, int scrollBarPos, void *userDataOnSelect, tfuiCallback onSelect)
 Create a new scroll list. More...
 
char * GfuiScrollListGetSelectedElement (void *scr, int Id, void **userData)
 Get the selected element from the scroll list. More...
 
char * GfuiScrollListGetElement (void *scr, int Id, int index, void **userData)
 Get the specified element from the scroll list. More...
 
char * GfuiScrollListExtractSelectedElement (void *scr, int Id, void **userData)
 Extract the selected element from the scroll list (removed). More...
 
char * GfuiScrollListExtractElement (void *scr, int Id, int index, void **userData)
 Extract the specified element from the scroll list. More...
 
int GfuiScrollListInsertElement (void *scr, int Id, char *element, int index, void *userData)
 Insert an element in a scroll list. More...
 
int GfuiScrollListMoveSelectedElement (void *scr, int Id, int delta)
 Move the selected element within the scroll list. More...
 

Detailed Description

This is an interface to manage menus.

Note
The screen size is fiwed to 640x480 and the origin is in the lower-left corner.

Function Documentation

◆ GfuiAddKey()

void GfuiAddKey ( void *  scr,
unsigned char  key,
const char *  descr,
void *  userData,
tfuiCallback  onKeyPressed,
tfuiCallback  onKeyReleased 
)

Add a Keyboard callback to a screen.

Parameters
scrScreen
keyKey code (glut value)
descrDescription for help screen
userDataParameter to the callback function
onKeyPressedCallback function
onKeyReleasedCallback function

Definition at line 742 of file gui.cpp.

◆ GfuiAddSKey()

void GfuiAddSKey ( void *  scr,
int  key,
const char *  descr,
void *  userData,
tfuiCallback  onKeyPressed,
tfuiCallback  onKeyReleased 
)

Add a Special Keyboard shortcut to the screen.

(see glut for normal and special keys)

Parameters
scrScreen
keyKey code (glut value)
descrDescription for help screen
userDataParameter to the callback function
onKeyPressedCallback function
onKeyReleasedCallback function

Definition at line 816 of file gui.cpp.

◆ GfuiButtonCreate()

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 
)

Add a button to a screen.

Parameters
scrScreen
textButton label
fontFont id
xX position on screen
yY position on screen (0 = bottom)
widthwidth of the button (0 = text size)
alignButton alignment:
GFUI_ALIGN_HR_VB horizontal right, vertical bottom
GFUI_ALIGN_HR_VC horizontal right, vertical center
GFUI_ALIGN_HR_VT horizontal right, vertical top
GFUI_ALIGN_HC_VB horizontal center, vertical bottom
GFUI_ALIGN_HC_VC horizontal center, vertical center
GFUI_ALIGN_HC_VT horizontal center, vertical top
GFUI_ALIGN_HL_VB horizontal left, vertical bottom
GFUI_ALIGN_HL_VC horizontal left, vertical center
GFUI_ALIGN_HL_VT horizontal left, vertical top
mouseMouse behavior:
GFUI_MOUSE_UP Action performed when the mouse right button is released
GFUI_MOUSE_DOWN Action performed when the mouse right button is pushed
userDataOnPushParameter to the Push callback
onPushPush callback function
userDataOnFocusParameter to the Focus (and lost) callback
onFocusFocus callback function
onFocusLostFocus Lost callback function
Returns
Button Id
-1 Error

Definition at line 248 of file guibutton.cpp.

Here is the call graph for this function:

◆ GfuiButtonGetFocused()

int GfuiButtonGetFocused ( void  )

Get the Id of the button focused in the current screen.

Returns
Button Id
-1 if no button or no screen or the focus is not on a button

Definition at line 387 of file guibutton.cpp.

◆ GfuiButtonSetText()

void GfuiButtonSetText ( void *  scr,
int  id,
const char *  text 
)

Change the label of a button.

Parameters
scrScreen
idButton Id
textNew label of the button

Definition at line 357 of file guibutton.cpp.

Here is the call graph for this function:

◆ GfuiButtonStateCreate()

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.

Parameters
scrScreen
textButton label
fontFont id
xX position on screen
yY position on screen (0 = bottom)
widthwidth of the button (0 = text size)
alignButton alignment:
GFUI_ALIGN_HR_VB horizontal right, vertical bottom
GFUI_ALIGN_HR_VC horizontal right, vertical center
GFUI_ALIGN_HR_VT horizontal right, vertical top
GFUI_ALIGN_HC_VB horizontal center, vertical bottom
GFUI_ALIGN_HC_VC horizontal center, vertical center
GFUI_ALIGN_HC_VT horizontal center, vertical top
GFUI_ALIGN_HL_VB horizontal left, vertical bottom
GFUI_ALIGN_HL_VC horizontal left, vertical center
GFUI_ALIGN_HL_VT horizontal left, vertical top
mouseMouse behavior:
GFUI_MOUSE_UP Action performed when the mouse right button is released
GFUI_MOUSE_DOWN Action performed when the mouse right button is pushed
userDataOnPushParameter to the Push callback
onPushPush callback function
userDataOnFocusParameter to the Focus (and lost) callback
onFocusFocus callback function
onFocusLostFocus Lost callback function
Returns
Button Id
-1 Error

Definition at line 188 of file guibutton.cpp.

Here is the call graph for this function:

◆ GfuiDisplay()

void GfuiDisplay ( void  )

Display function for the GUI to be called during redisplay of glut.

Definition at line 136 of file gui.cpp.

Here is the call graph for this function:

◆ GfuiDisplayNothing()

void GfuiDisplayNothing ( void  )

Dummy display function for glut.

Declare this function to glut if nothing is to be displayed by the redisplay mechanism.

Definition at line 108 of file gui.cpp.

◆ GfuiEditboxCreate()

int GfuiEditboxCreate ( void *  scr,
const char *  text,
int  font,
int  x,
int  y,
int  width,
int  maxlen,
void *  userDataOnFocus,
tfuiCallback  onFocus,
tfuiCallback  onFocusLost,
int  margin 
)

Add a editbox to a screen.

Parameters
scrScreen
textEditbox start text
fontFont id
xX position on screen
yY position on screen (0 = bottom)
widthwidth of the editbox (0 = text size)
maxlenMax lenght of text (0 = text size)
userDataOnFocusParameter to the Focus (and lost) callback
onFocusFocus callback function
onFocusLostFocus Lost callback function
marginMargin adjustment, default is 10 pixels
Returns
Editbox Id
-1 Error

Definition at line 57 of file guiedit.cpp.

Here is the call graph for this function:

◆ GfuiEditboxGetFocused()

int GfuiEditboxGetFocused ( void  )

Get the Id of the editbox focused in the current screen.

Returns
Editbox Id
-1 if no editbox or no screen or the focus is not on a editbox

Definition at line 138 of file guiedit.cpp.

◆ GfuiEditboxGetString()

char* GfuiEditboxGetString ( void *  scr,
int  id 
)

Get the string.

Parameters
scrScreen
idEdit box Id
Returns
Corresponding string.

Definition at line 358 of file guiedit.cpp.

Here is the call graph for this function:

◆ GfuiEditboxSetString()

void GfuiEditboxSetString ( void *  scr,
int  id,
const char *  text 
)

Set a new string.

Parameters
scrScreen
idEdit box Id
texttext to set
Returns
none

Definition at line 383 of file guiedit.cpp.

Here is the call graph for this function:

◆ GfuiEnable()

int GfuiEnable ( void *  scr,
int  id,
int  flag 
)

Enable / Disable an object.

Parameters
scrScreen
idObject id
flagGFUI_ENABLE or GFUI_DISABLE
Returns
0 ... Ok
-1 .. Error

Definition at line 434 of file guiobject.cpp.

Here is the call graph for this function:

◆ GfuiGrButtonCreate()

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 
)

Add a graphical button to a screen.

Parameters
scrScreen
disabledfilename of the image when the button is disabled
enabledfilename of the image when the button is enabled
focusedfilename of the image when the button is focused
pushedfilename of the image when the button is pushed
xX position on screen
yY position on screen (0 = bottom)
alignButton alignment
mouseMouse behavior:
GFUI_MOUSE_UP Action performed when the mouse right button is released
GFUI_MOUSE_DOWN Action performed when the mouse right button is pushed
userDataOnPushParameter to the Push callback
onPushPush callback function
userDataOnFocusParameter to the Focus (and lost) callback
onFocusFocus callback function
onFocusLostFocus Lost callback function
Returns
Button Id
-1 Error

Definition at line 62 of file guibutton.cpp.

Here is the call graph for this function:

◆ GfuiHelpScreen()

void GfuiHelpScreen ( void *  prevScreen)

Generate a help screen.

Parameters
prevScreenPrevious screen to return to
Warning
The help screen is activated.

Definition at line 48 of file guihelp.cpp.

Here is the call graph for this function:

◆ GfuiHookCreate()

void* GfuiHookCreate ( void *  userDataOnActivate,
tfuiCallback  onActivate 
)

Create a callback hook.

Parameters
userDataOnActivateParameter to the activate function
onActivateFunction called when the screen is activated
Returns
New hook instance
NULL if Error

Definition at line 679 of file gui.cpp.

Here is the call graph for this function:

◆ GfuiHookRelease()

void GfuiHookRelease ( void *  hook)

Release the given hook.

Parameters
hookHook to release

Definition at line 696 of file gui.cpp.

◆ GfuiIdle()

void GfuiIdle ( void  )

Idle function for the GUI to be called during Idle loop of glut.

Definition at line 116 of file gui.cpp.

Here is the call graph for this function:

◆ GfuiLabelCreate()

int GfuiLabelCreate ( void *  scr,
const char *  text,
int  font,
int  x,
int  y,
int  align,
int  maxlen 
)

Add a label to a screen.

Parameters
scrScreen where to add the label
textText of the label
fontFont id
xPosition of the label on the screen
yPosition of the label on the screen
alignAlignment:
GFUI_ALIGN_HR_VB horizontal right, vertical bottom
GFUI_ALIGN_HR_VC horizontal right, vertical center
GFUI_ALIGN_HR_VT horizontal right, vertical top
GFUI_ALIGN_HC_VB horizontal center, vertical bottom
GFUI_ALIGN_HC_VB horizontal center, vertical center
GFUI_ALIGN_HC_VB horizontal center, vertical top
GFUI_ALIGN_HL_VB horizontal left, vertical bottom
GFUI_ALIGN_HL_VB horizontal left, vertical center
GFUI_ALIGN_HL_VB horizontal left, vertical top
maxlenMaximum length of the button string (used when the label is changed)
0 for the text length.
Returns
label Id
See also
GfuiSetLabelText

Definition at line 142 of file guilabel.cpp.

Here is the call graph for this function:

◆ GfuiLabelCreateEx()

int GfuiLabelCreateEx ( void *  scr,
const char *  text,
float *  fgColor,
int  font,
int  x,
int  y,
int  align,
int  maxlen 
)

Create a new label (extended version).

Parameters
scrScreen where to add the label
textText of the label
fgColorPointer on color static array (RGBA)
fontFont id
xPosition of the label on the screen
yPosition of the label on the screen
alignAlignment:
GFUI_ALIGN_HR_VB horizontal right, vertical bottom
GFUI_ALIGN_HR_VC horizontal right, vertical center
GFUI_ALIGN_HR_VT horizontal right, vertical top
GFUI_ALIGN_HC_VB horizontal center, vertical bottom
GFUI_ALIGN_HC_VB horizontal center, vertical center
GFUI_ALIGN_HC_VB horizontal center, vertical top
GFUI_ALIGN_HL_VB horizontal left, vertical bottom
GFUI_ALIGN_HL_VB horizontal left, vertical center
GFUI_ALIGN_HL_VB horizontal left, vertical top
maxlenMaximum length of the button string (used when the label is changed)
0 for the text length.
Returns
label Id
See also
GfuiSetLabelText

Definition at line 63 of file guilabel.cpp.

Here is the call graph for this function:

◆ GfuiLabelSetColor()

void GfuiLabelSetColor ( void *  scr,
int  id,
float *  color 
)

Change the color of a label.

Parameters
scrScreen where to add the label
idId of the label
coloran array of 4 floats (RGBA)
See also
GfuiAddLabel

Definition at line 239 of file guilabel.cpp.

Here is the call graph for this function:

◆ GfuiLabelSetText()

void GfuiLabelSetText ( void *  scr,
int  id,
const char *  text 
)

Change the text of a label.

Parameters
scrScreen where to add the label
idId of the label
textText of the label
Attention
The maximum length is set at the label creation
See also
GfuiAddLabel

Definition at line 212 of file guilabel.cpp.

Here is the call graph for this function:

◆ GfuiMenuBackQuitButtonCreate()

int GfuiMenuBackQuitButtonCreate ( void *  scr,
const char *  text,
const char *  tip,
void *  userdata,
tfuiCallback  onpush 
)

Add the "Back" or "Quit" button at the bottom of the menu screen.

Parameters
scrScreen or Menu handle
textText of the button
tipText to display when the button is focused
userdataParameter of the Push function
onpushCallback when the button is pushed
Returns
Button Id

Definition at line 156 of file guimenu.cpp.

Here is the call graph for this function:

◆ GfuiMenuButtonCreate()

int GfuiMenuButtonCreate ( void *  scr,
const char *  text,
const char *  tip,
void *  userdata,
tfuiCallback  onpush 
)

Add a button to a menu screen.

Parameters
scrScreen (menu) handle
textText of the button
tipText of the tip displayed when the button is focused
userdataParameter of the Push function
onpushCallback when the button is pushed
Returns
Button Id

Definition at line 110 of file guimenu.cpp.

Here is the call graph for this function:

◆ GfuiMenuDefaultKeysAdd()

void GfuiMenuDefaultKeysAdd ( void *  scr)

Add the default menu keyboard callback to a screen.

The keys are:
Up Arrow .... Select Previous Entry
Down Arrow .. Select Next Entry
F1 .......... Help
Tab ......... Select Next Entry
Enter ....... Perform Action
Escape ...... Quit the menu

Parameters
scrScreen Id

Definition at line 55 of file guimenu.cpp.

Here is the call graph for this function:

◆ GfuiMenuScreenCreate()

void* GfuiMenuScreenCreate ( const char *  title)

Create a new menu screen.

Set the title of the menu Add the default keyboard callbacks to the menu.

Parameters
titletitle of the screen
Returns
Handle of the menu

Definition at line 76 of file guimenu.cpp.

Here is the call graph for this function:

◆ GfuiMouseHide()

void GfuiMouseHide ( void  )

Hide the mouse cursor.

Returns
none

Definition at line 220 of file gui.cpp.

◆ GfuiMouseInfo()

tMouseInfo* GfuiMouseInfo ( void  )

Get the mouse information (position and buttons)

Returns
mouse information

Definition at line 380 of file gui.cpp.

◆ GfuiMouseSetPos()

void GfuiMouseSetPos ( int  x,
int  y 
)

Set the mouse position.

Parameters
xmouse x pos
ymouse y pos
Returns
none

Definition at line 391 of file gui.cpp.

◆ GfuiMouseShow()

void GfuiMouseShow ( void  )

Show the mouse cursor.

Returns
none

Definition at line 230 of file gui.cpp.

◆ GfuiRegisterKey()

void GfuiRegisterKey ( unsigned char  key,
char *  descr,
void *  userData,
tfuiCallback  onKeyPressed,
tfuiCallback  onKeyReleased 
)

Add a Keyboard callback to the current screen.

Parameters
keyKey code (glut value)
descrDescription for help screen
userDataParameter to the callback function
onKeyPressedCallback function called when the specified key is pressed
onKeyReleasedCallback function

Definition at line 800 of file gui.cpp.

Here is the call graph for this function:

◆ GfuiScreenActivate()

void GfuiScreenActivate ( void *  screen)

Activate a screen and make it current.

Parameters
screenScreen to activate
Warning
The current screen at the call time is deactivated.

Definition at line 467 of file gui.cpp.

Here is the call graph for this function:

◆ GfuiScreenAddBgImg()

void GfuiScreenAddBgImg ( void *  scr,
const char *  filename 
)

Add an image background to a screen.

Parameters
scrScreen
filenamefile name of the bg image
Returns
None.

Definition at line 961 of file gui.cpp.

Here is the call graph for this function:

◆ GfuiScreenCreate()

void* GfuiScreenCreate ( void  )

Create a new screen.

Returns
New screen instance
NULL if Error

Definition at line 543 of file gui.cpp.

◆ GfuiScreenCreateEx()

void* GfuiScreenCreateEx ( float *  bgColor,
void *  userDataOnActivate,
tfuiCallback  onActivate,
void *  userDataOnDeactivate,
tfuiCallback  onDeactivate,
int  mouseAllowed 
)

Create a screen.

Parameters
bgColorpointer on color array (RGBA) (if NULL default color is used)
userDataOnActivateParameter to the activate function
onActivateFunction called when the screen is activated
userDataOnDeactivateParameter to the deactivate function
onDeactivateFunction called when the screen is deactivated
mouseAllowedFlag to tell if the mouse cursor can be displayed
Returns
New screen instance
NULL if Error

Definition at line 578 of file gui.cpp.

Here is the call graph for this function:

◆ GfuiScreenDeactivate()

void GfuiScreenDeactivate ( void  )

Deactivate the current screen.

Definition at line 520 of file gui.cpp.

Here is the call graph for this function:

◆ GfuiScreenIsActive()

int GfuiScreenIsActive ( void *  screen)

Tell if the screen is active or not.

Parameters
screenScreen to activate
Returns
1 if active and 0 if not.

Definition at line 456 of file gui.cpp.

◆ GfuiScreenRelease()

void GfuiScreenRelease ( void *  scr)

Release the given screen.

Parameters
scrScreen to release
Warning
If the screen was activated, it is deactivated.

Definition at line 618 of file gui.cpp.

Here is the call graph for this function:

◆ GfuiScreenReplace()

void GfuiScreenReplace ( void *  screen)

Activate a screen and make it current plus release the current screen.

Parameters
screenScreen to activate
Warning
The current screen at the call time is deactivated.

Definition at line 506 of file gui.cpp.

Here is the call graph for this function:

◆ GfuiScrollBarCreate()

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.

Parameters
scrScreen where to create the scroll bar
xX position
yY position
alignPosition of the specified point:
GFUI_ALIGN_HR_VB horizontal right, vertical bottom
GFUI_ALIGN_HR_VC horizontal right, vertical center
GFUI_ALIGN_HR_VT horizontal right, vertical top
GFUI_ALIGN_HC_VB horizontal center, vertical bottom
GFUI_ALIGN_HC_VC horizontal center, vertical center
GFUI_ALIGN_HC_VT horizontal center, vertical top
GFUI_ALIGN_HL_VB horizontal left, vertical bottom
GFUI_ALIGN_HL_VC horizontal left, vertical center
GFUI_ALIGN_HL_VT horizontal left, vertical top
widthwidth including the arrows
orientationScroll bar orientation:
GFUI_HORI_SCROLLBAR Horizontal
GFUI_VERT_SCROLLBAR Vertical
minMinimum value
maxMaximum value
lenVisible length
startStarting position
userDataUser data given to the call back function
onScrollCall back function called when the position change
Returns
Scroll Bar Id
-1 Error

Definition at line 118 of file guiscrollbar.cpp.

Here is the call graph for this function:

◆ GfuiScrollBarPosGet()

int GfuiScrollBarPosGet ( void *  scr,
int  id 
)

Get the current position of a scroll bar.

Parameters
scrScreen
idScroll bar Id
Returns
Current position
-1 Error

Definition at line 387 of file guiscrollbar.cpp.

Here is the call graph for this function:

◆ GfuiScrollBarPosSet()

void GfuiScrollBarPosSet ( void *  scr,
int  id,
int  min,
int  max,
int  len,
int  start 
)

Set new values for position.

Parameters
scrScreen
idScroll bar Id
minNew minimum value
maxNew maximum value
lenNew visible length
startNew starting position

Definition at line 413 of file guiscrollbar.cpp.

Here is the call graph for this function:

◆ GfuiScrollListCreate()

int GfuiScrollListCreate ( void *  scr,
int  font,
int  x,
int  y,
int  align,
int  width,
int  height,
int  scrollBarPos,
void *  userDataOnSelect,
tfuiCallback  onSelect 
)

Create a new scroll list.

Parameters
scrCurrent screen
fontCurrent font
xX Position
yY Position
alignBox Alignement (Horizontal and Vertical)
widthWidth of the box
heightHeight of the box
scrollBarPosPosition of the scrollbar:
GFUI_SB_NONE No scroll bar
GFUI_SB_RIGHT Right scroll bar
GFUI_SB_LEFT Left scroll bar
userDataOnSelectUser data to pass to the onSelect callback
onSelectCallback when the selection is done
Returns
Scroll List Id

Definition at line 150 of file guiscrollist.cpp.

Here is the call graph for this function:

◆ GfuiScrollListExtractElement()

char* GfuiScrollListExtractElement ( void *  scr,
int  Id,
int  index,
void **  userData 
)

Extract the specified element from the scroll list.

Parameters
scrCurrent screen
IdScroll list Id
indexPosition where to extract the element
userDataaddress of the userData of the element to retrieve
Returns
Name of the extracted element
NULL if Error

Definition at line 438 of file guiscrollist.cpp.

Here is the call graph for this function:

◆ GfuiScrollListExtractSelectedElement()

char* GfuiScrollListExtractSelectedElement ( void *  scr,
int  Id,
void **  userData 
)

Extract the selected element from the scroll list (removed).

Parameters
scrCurrent screen
IdScroll list Id
userDataaddress of the userData of the element to retrieve
Returns
Name of the extracted element
NULL if Error

Definition at line 390 of file guiscrollist.cpp.

Here is the call graph for this function:

◆ GfuiScrollListGetElement()

char* GfuiScrollListGetElement ( void *  scr,
int  Id,
int  index,
void **  userData 
)

Get the specified element from the scroll list.

Parameters
scrCurrent screen
IdScroll list Id
indexPosition where to get the element
userDataaddress of the userData of the element to retrieve
Returns
Name of the retrieved element
NULL if Error

Definition at line 334 of file guiscrollist.cpp.

Here is the call graph for this function:

◆ GfuiScrollListGetSelectedElement()

char* GfuiScrollListGetSelectedElement ( void *  scr,
int  Id,
void **  userData 
)

Get the selected element from the scroll list.

Parameters
scrCurrent screen
IdScroll list Id
userDataaddress of the userData of the element to retrieve
Returns
Name of the retrieved element
NULL if Error

Definition at line 276 of file guiscrollist.cpp.

Here is the call graph for this function:

◆ GfuiScrollListInsertElement()

int GfuiScrollListInsertElement ( void *  scr,
int  Id,
char *  element,
int  index,
void *  userData 
)

Insert an element in a scroll list.

Parameters
scrCurrent screen
IdScroll list Id
elementNew element
indexPosition where to insert the element
userDataUser defined data
Returns
0 ... Ok
-1 .. Error

Definition at line 488 of file guiscrollist.cpp.

Here is the call graph for this function:

◆ GfuiScrollListMoveSelectedElement()

int GfuiScrollListMoveSelectedElement ( void *  scr,
int  Id,
int  delta 
)

Move the selected element within the scroll list.

Parameters
scrCurrent screen
IdScroll list Id
deltadisplacement
Returns
0 ... Ok
-1 .. Error

Definition at line 664 of file guiscrollist.cpp.

Here is the call graph for this function:

◆ GfuiStaticImageCreate()

int GfuiStaticImageCreate ( void *  scr,
int  x,
int  y,
int  w,
int  h,
char *  name 
)

Create a new static image.

This kind of image is not clickable.

Parameters
scrScreen where to add the label
xPosition of the left of the image on the screen
yPosition of the bottom of the image on the screen
wWidth of the image on the screen
hHeight of the image on the screen
nameFilename on the image (png)
Returns
Image Id
-1 Error
Warning
the image must be sqare and its size must be a power of 2.

Definition at line 48 of file guiimage.cpp.

Here is the call graph for this function:

◆ GfuiStaticImageSet()

void GfuiStaticImageSet ( void *  scr,
int  id,
char *  name 
)

Replace an image by another one.

Parameters
scrScreen where to add the label
idImage Id
nameFilename on the image (png)
Returns
none
Warning
the image must be sqare and its size must be a power of 2.

Definition at line 86 of file guiimage.cpp.

Here is the call graph for this function:

◆ GfuiTitleCreate()

int GfuiTitleCreate ( void *  scr,
const char *  text,
int  maxlen 
)

Add a Title to the screen.

Parameters
scrScreen where to add the label
textText of the title
maxlenMaximum length of the button string (used when the label is changed)
0 for the text length.
Returns
label Id
See also
GfuiSetLabelText

Definition at line 170 of file guilabel.cpp.

Here is the call graph for this function:

◆ GfuiUnSelectCurrent()

void GfuiUnSelectCurrent ( void  )

Remove the focus on the current element.

Definition at line 162 of file guiobject.cpp.

◆ GfuiVisibilitySet()

int GfuiVisibilitySet ( void *  scr,
int  id,
int  visible 
)

Set/unset the visibility attribute of an object.

Parameters
scrScreen
idObject id
visibleGFUI_VISIBLE or GFUI_INVISIBLE
Returns
0 ... Ok
-1 .. Error

Definition at line 404 of file guiobject.cpp.

Here is the call graph for this function: