96 static float disabledTipColor[4] = {1.0, 0.0, 0.0, 1.0};
126 std::shared_ptr<tMnuCallbackInfo> cbinfo;
133 ypos = 380 - 30 * nbItems;
136 GfTrace(
"Too many items in that menu !!!\n");
140 ypos = 380 - 30 * (nbItems - 11);
143 cbinfo = std::make_shared<tMnuCallbackInfo>();
144 cbinfo->screen = scr;
145 cbinfo->buttonId = -1;
146 cbinfo->tip = tip ? tip :
"";
147 cbinfo->disabledTip = disabledTip ? disabledTip :
"";
148 const int maxTipLen = (int)(cbinfo->tip.length() > cbinfo->disabledTip.length() ? cbinfo->tip.length() : cbinfo->disabledTip.length());
149 cbinfo->labelId =
GfuiTipCreate(scr, cbinfo->tip.c_str(), maxTipLen);
158 [cbinfo] {
dispInfo(cbinfo.get()); },
159 [cbinfo] {
remInfo(cbinfo.get()); });
160 cbinfo->buttonId = bId;
189 std::shared_ptr<tMnuCallbackInfo> cbinfo;
196 cbinfo = std::make_shared<tMnuCallbackInfo>();
197 cbinfo->screen = scr;
198 cbinfo->buttonId = -1;
199 cbinfo->tip = tip ? tip :
"";
200 cbinfo->labelId =
GfuiTipCreate(scr, cbinfo->tip.c_str(), (
int)cbinfo->tip.length());
209 [cbinfo] {
dispInfo(cbinfo.get()); },
210 [cbinfo] {
remInfo(cbinfo.get()); });
211 cbinfo->buttonId = bId;
int GfuiMenuButtonCreateAction(void *scr, const char *text, const char *tip, const tGfuiAction &onpush)
Add a menu button with a focus tip.
void GfuiHelpScreen(void *prevScreen)
Generate a help screen.
void GfuiMenuDefaultKeysAdd(void *scr)
Add the default menu keyboard callback to a screen.
void GfuiLabelSetText(void *scr, int id, const char *text)
Change the text of a label.
int GfuiMenuButtonCreate(void *scr, const char *text, const char *tip, void *userdata, tfuiCallback onpush)
Add a menu button using a callback with caller-supplied data.
int GfuiTitleCreate(void *scr, const char *text, int maxlen)
Add a Title to the screen.
void GfuiAddKeyAction(void *scr, unsigned char key, const char *descr, const tGfuiAction &onKeyPressed, const tGfuiAction &onKeyReleased)
Add a Keyboard callback to a screen.
void * GfuiMenuScreenCreate(const char *title)
Create a new menu screen.
int GfuiVisibilitySet(void *scr, int id, int visible)
Set/unset the visibility attribute of an object.
void GfuiAddSKeyAction(void *scr, int key, const char *descr, const tGfuiAction &onKeyPressed, const tGfuiAction &onKeyReleased)
Add a Special Keyboard shortcut to the screen.
int GfuiMenuButtonCreateActionWithDisabledTip(void *scr, const char *text, const char *tip, const char *disabledTip, const tGfuiAction &onpush)
Add a button to a menu screen.
int GfuiMenuBackQuitButtonCreate(void *scr, const char *text, const char *tip, void *userdata, tfuiCallback onpush)
Add the bottom Back/Quit menu button using a callback with caller-supplied data.
int GfuiTipCreate(void *scr, const char *text, int maxlen)
Add a Tip (generally associated with a button).
void GfuiLabelSetColor(void *scr, int id, float *color)
Change the color of a label.
void * GfuiScreenCreate(void)
Create a new screen.
int GfuiMenuBackQuitButtonCreateAction(void *scr, const char *text, const char *tip, const tGfuiAction &onpush)
Add the "Back" or "Quit" button at the bottom of the menu screen.
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.
void GfuiScreenShot(void *)
Save a screen shot in png format.
tGfuiAction gfuiMakeAction(void *userData, tfuiCallback callback)
float GfuiColor[GFUI_COLORNB][4]
void gfuiSelectPrev(void *)
void gfuiSelectNext(void *)
struct GfuiObject tGfuiObject
tGfuiObject * gfuiGetObject(void *scr, int id)
void gfuiMouseAction(int action)
The Gaming Framework API (client part).
void(* tfuiCallback)(void *)
std::function< void()> tGfuiAction