Exemplo n.º 1
0
/**
 *  MousePushEventHandler removes the old handler by placing it on
 *  a stack and sets up the new event handler.  The old event handler
 *  will be restored when a call to MousePopEventHandler is called.
 *
 *  @param mouseEventHandler -- function to call on events, or NULL
 *      for none.
 *
 *<!-----------------------------------------------------------------------*/
T_void MousePushEventHandler(T_mouseEventHandler mouseEventHandler)
{
    DebugRoutine("MousePushEventHandler") ;

    /* Store the old event handler. */
    DoubleLinkListAddElementAtFront(
        G_eventStack,
        (T_void *)MouseGetEventHandler) ;

    /* set up the new handler. */
    MouseSetEventHandler(mouseEventHandler) ;

    DebugEnd() ;
}
Exemplo n.º 2
0
Arquivo: FORM.C Projeto: LesInk/Test
T_void FormPush(T_void)
{
    T_formObjectID *p_formObjs;
    T_void *p_state;
    T_formVariousValues *p_values;

    DebugRoutine("FormPush");

    /* Make sure we have a list. */
    if (G_formStack == DOUBLE_LINK_LIST_BAD)
        G_formStack = DoubleLinkListCreate();

    /* Create a list of form objects to put on the stack. */
    p_formObjs = MemAlloc(sizeof(G_formObjectArray));
    DebugCheck(p_formObjs != NULL);
    memcpy(p_formObjs, G_formObjectArray, sizeof(G_formObjectArray));
    DoubleLinkListAddElementAtFront(G_formStack, p_formObjs);

    /* Clear the list of form objects */
    memset(G_formObjectArray, 0, sizeof(G_formObjectArray));

    /* Put the buttons on the list. */
    p_state = ButtonGetStateBlock();
    DoubleLinkListAddElementAtFront(G_formStack, p_state);

    /* Put the graphics on the list. */
    p_state = GraphicGetStateBlock();
    DoubleLinkListAddElementAtFront(G_formStack, p_state);

    /* Put the sliders on the list. */
    p_state = SliderGetStateBlock();
    DoubleLinkListAddElementAtFront(G_formStack, p_state);

    /* Put the text boxes on the list. */
    p_state = TxtboxGetStateBlock();
    DoubleLinkListAddElementAtFront(G_formStack, p_state);

    /* Put the callback and other flags in the list */
    p_values = MemAlloc(sizeof(T_formVariousValues));
    p_values->callback = formcallback;
    p_values->hasText = G_formHasTextBoxes;
    p_values->hasButtons = G_formHasButtons;
    DoubleLinkListAddElementAtFront(G_formStack, p_values);

    DebugEnd();
}