Ejemplo n.º 1
0
static void ThdCmd( thread_state *thd, enum thread_cmds cmd )
{
    unsigned    up;

    up = UP_THREAD_STATE;
    switch( cmd ) {
    case T_SHOW:
        FormThdState( thd, TxtBuff, TXT_LEN );
        DUIDlgTxt( TxtBuff );
        up = UP_NO_CHANGE;
        break;
    case T_FREEZE:
        if( thd->state == THD_THAW )
            thd->state = THD_FREEZE;
        break;
    case T_THAW:
        if( thd->state == THD_FREEZE )
            thd->state = THD_THAW;
        break;
    case T_CHANGE:
        MakeThdCurr( thd );
        break;
    }
    DbgUpdate( up );
}
Ejemplo n.º 2
0
static void TrdMenuItem( a_window *wnd, gui_ctl_id id, int row, int piece )
{
    thread_state        *thd = GetThreadRow( row );

    piece=piece;
    switch( id ) {
    case MENU_INITIALIZE:
        if( thd == NULL ) {
            WndMenuGrayAll( wnd );
        } else {
            switch( thd->state ) {
            case THD_THAW:
            case THD_FREEZE:
                WndMenuEnable( wnd, MENU_THREAD_FREEZE, true );
                WndMenuEnable( wnd, MENU_THREAD_THAW, true );
                WndMenuEnable( wnd, MENU_THREAD_CHANGE_TO, true );
                break;
            case THD_DEBUG:
                WndMenuEnable( wnd, MENU_THREAD_FREEZE, false );
                WndMenuEnable( wnd, MENU_THREAD_THAW, false );
                WndMenuEnable( wnd, MENU_THREAD_CHANGE_TO, true );
                break;
            default:
                WndMenuGrayAll( wnd );
                break;
            }                    
        }
        return;
    case MENU_THREAD_FREEZE:
        if( thd->state == THD_THAW )
            thd->state = THD_FREEZE;
        break;
    case MENU_THREAD_THAW:
        if( thd->state == THD_FREEZE )
            thd->state = THD_THAW;
        break;
    case MENU_THREAD_CHANGE_TO:
        switch( thd->state ) {
        case THD_THAW:
        case THD_FREEZE:
        case THD_DEBUG:    
            MakeThdCurr( thd );
            break;
        }
    }
    DbgUpdate( UP_THREAD_STATE );
}