コード例 #1
0
ファイル: msgbox.c プロジェクト: ABratovic/open-watcom-v2
void ShowMsgBox( char *caption, char *msg )
{
    a_dialog            *msgbox;
    bool                done;
    EVENT               event;

    static EVENT        events[] = {
        EV_NO_EVENT,
        EV_ENTER,
        EV_ESCAPE,
        EV_MOUSE_PRESS,
        EV_LIST_BOX_DCLICK,
        EV_NO_EVENT
    };
    done = FALSE;

    uipushlist( NULL );     /* modal barrier */
    uipushlist( events );
    helpMsgBox[0].u.str = msg;
    msgbox = uibegdialog( caption, helpMsgBox, 5, 50, 0, 0 );
    while( !done ) {
        event = uidialog( msgbox );
        switch( event ) {
        case EV_ENTER:
            done = TRUE;
            break;
        }
    }
    uipoplist();
    uipoplist();
    uienddialog( msgbox );
}
コード例 #2
0
void sample_dialog( void )
{
    ui_event            ui_ev;
    a_dialog            *ui_dlg_info;

    static ui_event     events[] = {
        __rend__,
        EV_ENTER,
        EV_ESCAPE,
        EV_SCREWUP,
        __end__
    };

    ui_dlg_info = uibegdialog( "TEST", FieldDialog, 12, 74, 0, 0 );
    uipushlist( events );
    for( ;; ) {
        ui_ev = uidialog( ui_dlg_info );
        if( ui_ev == EV_ESCAPE || ui_ev == EV_ENTER ) {
            break;
        } else if( ui_ev == EV_SCREWUP ) {
            list_box.data_handle = list_data;
            uiupdatelistbox( &list_box );
        }
    }
    uipoplist( /* events */ );
    uienddialog( ui_dlg_info );
}
コード例 #3
0
void ShowMsgBox( char *caption, char *msg )
{
    a_dialog            *msgbox;
    bool                done;
    ui_event            ui_ev;

    static ui_event     events[] = {
        __rend__,
        EV_ENTER,
        EV_ESCAPE,
        EV_MOUSE_PRESS,
        EV_LIST_BOX_DCLICK,
        __end__
    };
    done = false;

    uipushlist( NULL );     /* modal barrier */
    uipushlist( events );
    helpMsgBox[0].u.str = msg;
    msgbox = uibegdialog( caption, helpMsgBox, 5, 50, 0, 0 );
    while( !done ) {
        ui_ev = uidialog( msgbox );
        switch( ui_ev ) {
        case EV_ENTER:
            done = true;
            break;
        }
    }
    uipoplist();
    uipoplist();
    uienddialog( msgbox );
}
コード例 #4
0
ファイル: guixdlg.c プロジェクト: Azarien/open-watcom-v2
void GUIFreeDialog( a_dialog *ui_dlg_info, VFIELD *fields, char *title,
                    bool colours_set, bool is_dialog )
{
    if( ui_dlg_info != NULL ) {
        GUIDeleteDialog( ui_dlg_info );
        uienddialog( ui_dlg_info );
    }
    if( colours_set ) {
        GUIResetDialColours();
    }
    FreeFields( fields );
    GUIMemFree( title );
}
コード例 #5
0
ファイル: dlg.c プロジェクト: jossk/open-watcom-v2
char *HelpSearch( HelpHdl hdl )
{
    EVENT               event;
    char                done;
    char                *ret;

    static EVENT        events[] = {
        EV_NO_EVENT,
        EV_ENTER,
        EV_ESCAPE,
        EV_MOUSE_PRESS,
        EV_LIST_BOX_DCLICK,
        EV_NO_EVENT
    };

    searchHdl = hdl;
    listData = hdl->header.topiccnt;
    curHelpDialog = uibegdialog( "Search", helpSearchDialog, 12, 60, 0, 0 );
    if( editCtl.buffer == NULL ) {
        fillListBox( "" );
    } else {
        fillListBox( editCtl.buffer );
    }
    uipushlist( NULL );     /* modal barrier */
    uipushlist( events );
    done = 0;
    while( !done ) {
        event = uidialog( curHelpDialog );
        switch( event ) {
        case EV_MOUSE_PRESS:
            if( curHelpDialog->curr != NULL ) {
                if( curHelpDialog->curr->ptr == &listBox ) {
                    copyLBLinetoEditCtl( listBox.box->row );
                }
            }
            break;
        case EV_KILL_UI:
            uiforceevadd( EV_KILL_UI );
        /* fall through */
        case EV_ESCAPE:
            ret = NULL;
            done = 1;
            break;
        case EV_ENTER:
        case EV_LIST_BOX_DCLICK:
            ret = HelpMemAlloc( MAX_EDIT_LINE_LEN );
            GetLBItemLiteral( &listData, listBox.box->row, ret,
                              MAX_EDIT_LINE_LEN );
            if( ret[0] == '\0' ) {
                HelpMemFree( ret );
                ret = NULL;
            }
            done = 1;
            break;
        }
    }
    uipoplist();
    uipoplist();
    uienddialog( curHelpDialog );
    return( ret );
}