Example #1
0
static void mstring( BUFFER *bptr, ORD row, ORD col, ATTR attr,
                     const char __FAR *string, int len )
/**************************************************************/
{
    SAREA       area;

    bstring( bptr, row, col, attr, string, len );
    area.row = row;
    area.col = col;
    area.height = 1;
    area.width = len;
    physupdate( &area );
}
Example #2
0
static EVENT doget( bool update )
/*******************************/
{
    register    EVENT                   ev;
    static      short                   ReturnIdle = 1;
    SAREA       screen;

    for( ;; ) {
        ev = forcedevent();
        if( ev > EV_NO_EVENT )
            break;
        ev = _uievent();
        if( ev > EV_NO_EVENT )
            break;
        if( ReturnIdle ) {
            --ReturnIdle;
            return( EV_IDLE );
        } else {
            if( update )
                uirefresh();
            if( UIData->busy_wait ) {
                return( EV_SINK );
            }
        }
        _armkeyboard();
        Receive( UILocalProxy, 0, 0 ); /* wait for some input */
    }
    ReturnIdle = 1;
    switch( ev ) {
    case EV_REDRAW_SCREEN:
        screen.row = 0;
        screen.col = 0;
        screen.height= UIData->height;
        screen.width=  UIData->width;

        uidirty( screen );
        UserForcedTermRefresh = true;
        physupdate( &screen );
        break;
    case EV_MOUSE_HOLD:
    case EV_MOUSE_HOLD_R:
    case EV_MOUSE_HOLD_M:
    case EV_MOUSE_REPEAT:
    case EV_MOUSE_REPEAT_R:
    case EV_MOUSE_REPEAT_M:
        if( update )
            uirefresh();
        break;
    }
    return( ev );
}
Example #3
0
static int cd_setcur( ORD row, ORD col, CURSOR_TYPE typ, int attr )
/*****************************************************************/
{
    attr = attr;
    if( ( typ != UIData->cursor_type ) ||
        ( row != UIData->cursor_row ) ||
        ( col != UIData->cursor_col ) ) {
        UIData->cursor_type = typ;
        UIData->cursor_row = row;
        UIData->cursor_col = col;
        newcursor();
        physupdate( NULL );
    }
    return( 0 );
}
Example #4
0
static void uisetmouseoff( void )
/*******************************/
{
    LP_STRING    old;
    SAREA       area;

    if( MouseOn ) {
        old = RegenPos( OldMouseRow, OldMouseCol );
        *old = OldAttr;
        area.row  = OldMouseRow;
        area.col = OldMouseCol;
        area.height = 1;
        area.width = 1;
        physupdate( &area );
    }
}
Example #5
0
static void mfill( BUFFER *bptr, ORD row, ORD col, ATTR attr,
                   char ch, int len, int height )
/***********************************************************/
{
    SAREA       area;

    area.row = row;
    area.col = col;
    area.width = len;
    area.height = height;
    while( height != 0 ) {
        bfill( bptr, row, col, attr, ch, len );
        ++row;
        --height;
    }
    physupdate( &area );
}
Example #6
0
void intern drawbox( BUFFER *bptr, SAREA area, const char *box, ATTR attr, bool fill )
/************************************************************************************/
{
    uisize      row;

    bpixel( bptr, area.row, area.col, attr, BOX_CHAR( box, TOP_LEFT ) );
    if( area.width > 2 )
        bfill( bptr, area.row, area.col + 1, attr, BOX_CHAR( box, TOP_LINE ), area.width - 2 );
    bpixel( bptr, area.row, area.col + area.width - 1, attr, BOX_CHAR( box, TOP_RIGHT ) );
    for( row = area.row + 1; row < area.row + area.height - 1; ++row ) {
        bpixel( bptr, row, area.col, attr, BOX_CHAR( box, LEFT_LINE ) );
        if( fill && area.width > 2 ) {
            bfill( bptr, row, area.col + 1, attr, ' ', area.width - 2 );
        }
        bpixel( bptr, row, area.col + area.width - 1, attr, BOX_CHAR( box, RIGHT_LINE ) );
    }
    bpixel( bptr, row, area.col, attr, BOX_CHAR( box, BOTTOM_LEFT ) );
    if( area.width > 2 )
        bfill( bptr, row, area.col + 1, attr, BOX_CHAR( box, BOTTOM_LINE ), area.width - 2 );
    bpixel( bptr, row, area.col + area.width - 1, attr, BOX_CHAR( box, BOTTOM_RIGHT ) );
    physupdate( &area );
}
Example #7
0
static EVENT doget( bool update )
/*******************************/
{
    register    EVENT                   ev;
    static      short                   ReturnIdle = 1;

    for( ;; ) {
        ev = forcedevent();
        if( ev > EV_NO_EVENT )
            break;
        ev = _uievent();
        if( ev > EV_NO_EVENT )
            break;
        if( ReturnIdle ) {
            --ReturnIdle;
            return( EV_IDLE );
        } else {
            if( update )
                uirefresh();
            if( UIData->busy_wait ) {
                return( EV_SINK );
            }
        }
        kb_wait( 60, 0 );
    }
    ReturnIdle = 1;
    if( ev==EV_REDRAW_SCREEN ){
        extern bool     UserForcedTermRefresh;
        SAREA           screen={ 0, 0, 0, 0 };

        screen.height= UIData->height;
        screen.width=  UIData->width;

        uidirty( screen );
        UserForcedTermRefresh= TRUE;
        physupdate( &screen );
    }
    return( ev );
}
Example #8
0
void intern drawbox( BUFFER     *bptr,
                     SAREA      area,
                     char       *box,
                     ATTR       attr,
                     int        fill )
/************************************/
{
    register    ORD                     row;

    bpixel( bptr, area.row, area.col, attr, box[ 0 ] );
    bfill( bptr, area.row, area.col + 1, attr, box[ 4 ], area.width - 2 );
    bpixel( bptr, area.row, area.col + area.width - 1, attr, box[ 1 ] );
    for( row = area.row + 1 ; row < area.row + area.height - 1 ; ++row ) {
        bpixel( bptr, row, area.col, attr, box[ 7 ] );
        if( fill ) {
            bfill( bptr, row, area.col + 1, attr, ' ', area.width - 2 );
        }
        bpixel( bptr, row, area.col + area.width - 1, attr, box[ 5 ] );
    }
    bpixel( bptr, row, area.col, attr, box[ 3 ] );
    bfill( bptr, row, area.col + 1, attr, box[ 6 ], area.width - 2 );
    bpixel( bptr, row, area.col + area.width - 1, attr, box[ 2 ] );
    physupdate( &area );
}