Esempio n. 1
0
void EscapeMenuLoadState(void)
{
    char form[20];
    T_word32 i;
    T_buttonID buttonID;

    DebugRoutine("EscapeMenuLoadState");

    // Setup the form
    sprintf(form, "ESCMENU%d.FRM", G_escMenuState);
    FormLoadFromFile(form);
    FormSetCallbackRoutine(EscapeMenuFormControl);

    for (i=0; i<NUMBER_KEYS; i++) {
        buttonID = FormFindObjID(1000+i);
        if (buttonID) {
            // Found a button on the page, replace it
            ButtonSetText(buttonID, EscMenuKeyToString(G_keys[i]), 31);
        }
    }

    // Set the options
    EscapeMenuSetOptions();

    G_escKeyPressed = FALSE;

    DebugEnd();
}
Esempio n. 2
0
static void EscapeMenuSetOptionButtonText(T_byte8 aOptionIndex, const char *aText, T_byte8 aColor)
{
    T_buttonID buttonID;

    DebugRoutine("EscapeMenuSetOptionButtonText");

    buttonID = FormFindObjID(7000+aOptionIndex);
    if (buttonID)
        ButtonSetText(buttonID, (const T_byte8 *)aText, aColor);

    DebugEnd();
}
Esempio n. 3
0
File: FORM.C Progetto: LesInk/Test
T_formObjectID FormAddTextButton(
        T_word16 x1,
        T_word16 y1,
        T_byte8 *data,
        T_byte8 *picturename,
        T_byte8 *fontname,
        T_byte8 fcolor,
        T_byte8 bcolor,
        E_Boolean toggletype,
        T_word16 hotkey,
        T_word32 idnum)
{
    T_word16 i;
    T_buttonID buttonID;

    DebugRoutine("FormAddTextButton");
    DebugCheck(picturename!=NULL);

    G_formHasButtons = TRUE;
    for (i = 0; i < MAX_FORM_OBJECTS; i++) {
        /* find an empty slot */
        if (G_formObjectArray[i] == NULL ) {
            /* found one, create a new button */
            buttonID = ButtonCreate(x1, y1, picturename, toggletype, hotkey,
                    NULL, NULL );
            ButtonSetFont(buttonID, fontname);
            ButtonSetText(buttonID, data, fcolor);
            /* now that a button has been created, make an objstruct for it */
            G_formObjectArray[i] = FormCreateObject(FORM_OBJECT_BUTTON,
                    (T_formObjectID)buttonID, idnum);
            /* we made a new object struct, break from the loop */
            break;
        }
    }

    /* make sure we haven't exceeded any limits */
    DebugCheck(i!=MAX_FORM_OBJECTS);
    DebugEnd();
    /* return the ID for the object created */
    return (G_formObjectArray[i]);
}