Exemple #1
0
void
init_dlg (Dlg_head * h)
{
    if ((top_dlg != NULL) && ((Dlg_head *) top_dlg->data)->modal)
        h->modal = TRUE;

    /* add dialog to the stack */
    top_dlg = g_list_prepend (top_dlg, h);

    /* Initialize dialog manager and widgets */
    if (h->state == DLG_CONSTRUCT)
    {
        if (!h->modal)
            dialog_switch_add (h);

        h->callback (h, NULL, DLG_INIT, 0, NULL);
        dlg_broadcast_msg (h, WIDGET_INIT, FALSE);
        dlg_read_history (h);
    }

    h->state = DLG_ACTIVE;

    /* Select the first widget that takes focus */
    while (h->current != NULL && !dlg_focus (h))
        h->current = dlg_widget_next (h, h->current);

    dlg_redraw (h);

    h->ret_value = 0;
}
Exemple #2
0
void
dlg_init (WDialog * h)
{
    if (top_dlg != NULL && DIALOG (top_dlg->data)->modal)
        h->modal = TRUE;

    /* add dialog to the stack */
    top_dlg = g_list_prepend (top_dlg, h);

    /* Initialize dialog manager and widgets */
    if (h->state == DLG_CONSTRUCT)
    {
        if (!h->modal)
            dialog_switch_add (h);

        send_message (h, NULL, MSG_INIT, 0, NULL);
        dlg_broadcast_msg (h, MSG_INIT);
        dlg_read_history (h);
    }

    h->state = DLG_ACTIVE;

    /* Select the first widget that takes focus */
    while (h->current != NULL && !dlg_focus (h))
        h->current = dlg_widget_next (h, h->current);

    dlg_redraw (h);

    h->ret_value = 0;
}
Exemple #3
0
void
dlg_init (WDialog * h)
{
    Widget *wh = WIDGET (h);

    if (top_dlg != NULL && widget_get_state (WIDGET (top_dlg->data), WST_MODAL))
        widget_set_state (wh, WST_MODAL, TRUE);

    /* add dialog to the stack */
    top_dlg = g_list_prepend (top_dlg, h);

    /* Initialize dialog manager and widgets */
    if (widget_get_state (wh, WST_CONSTRUCT))
    {
        if (!widget_get_state (wh, WST_MODAL))
            dialog_switch_add (h);

        send_message (h, NULL, MSG_INIT, 0, NULL);
        dlg_broadcast_msg (h, MSG_INIT);
        dlg_read_history (h);
    }

    /* Select the first widget that takes focus */
    while (h->current != NULL && !widget_get_options (WIDGET (h->current->data), WOP_SELECTABLE)
           && !widget_get_state (WIDGET (h->current->data), WST_DISABLED))
        dlg_set_current_widget_next (h);

    widget_set_state (wh, WST_ACTIVE, TRUE);
    dlg_redraw (h);
    /* focus found widget */
    if (h->current != NULL)
        widget_set_state (WIDGET (h->current->data), WST_FOCUSED, TRUE);

    h->ret_value = 0;
}