Ejemplo n.º 1
0
STATIC void *sampleCreateWin( void )
/**********************************/
{
    a_window            *wnd;
    wnd_create_struct   info;
    char                *title;

#define TITLE_LEN       255

    title = alloca( TITLE_LEN );
    if( title == NULL ) return( NULL );
    WndInitCreateStruct( &info );
    snprintf( title, TITLE_LEN, LIT( Sample_Data ), CurrSIOData->samp_file_name );
    info.text = title;
    info.info = &WPSampleInfo;
    info.extra = CurrSIOData;
//    info.colour = GetWndColours( class );
    info.title_size = STATUS_ROW + 1;
    info.style |= GUI_INIT_INVISIBLE;
    wnd = WndCreateWithStruct( &info );
    if( wnd == NULL ) return( wnd );
//    WndSetFontInfo( wnd, GetWndFont( wnd ) );
//-//    WndSetSysFont( wnd, P_TRUE );
    WndClrSwitches( wnd, WSW_MUST_CLICK_ON_PIECE|WSW_ONLY_MODIFY_TABSTOP );
    WndSetSwitches( wnd, WSW_RBUTTON_CHANGE_CURR );
    return( wnd );
}
Ejemplo n.º 2
0
extern a_window *WndBrkOpen( void )
{
    a_window            *wnd;
    break_window        *brkw;

    brkw = WndMustAlloc( sizeof( *brkw ) );
    wnd = DbgWndCreate( LIT_DUI( WindowBrk ), &BrkInfo, WND_BREAK, brkw, &BrkIcon );
    if( wnd != NULL )
        WndClrSwitches( wnd, WSW_ONLY_MODIFY_TABSTOP );
    return( wnd );
}
Ejemplo n.º 3
0
a_window WndIOOpen( void )
{
    io_window   *io;
    a_window    wnd;

    io = WndMustAlloc( sizeof( io_window ) );
    io->list = NULL;
    io->num_rows = 0;
    wnd = DbgWndCreate( LIT_DUI( WindowIO_Ports ), &IOInfo, WND_IO, io, &IOIcon );
    if( wnd != NULL )
        WndClrSwitches( wnd, WSW_ONLY_MODIFY_TABSTOP );
    return( wnd );
}
Ejemplo n.º 4
0
void WndPaintDirty( a_window wnd )
{
    int                 i;
    wnd_line_piece      line;
    wnd_line_piece      next_piece_line;
    gui_rect            rect;
    wnd_rect            *dirty;
    gui_coord           size;
    gui_coord           half_char;
    a_window            next;
//    a_window            last;

//    last = NULL;
    for( wnd = WndNext( NULL ); wnd != NULL; wnd = next ) {
        next = WndNext( wnd );
        if( wnd->vscroll_pending != 0 ) {
            if( wnd->hscroll_pending != -1 ) {
                WndSetRepaint( wnd );
            }
            if( WndSwitchOn( wnd, WSW_REPAINT ) ) {
                if( wnd->hscroll_pending != -1 ) {
                    GUIInitHScroll( wnd->gui, wnd->hscroll_pending );
                }
                WndSetRepaint( wnd );
                wnd->hscroll_pending = -1;
                wnd->vscroll_pending = 0;
            } else {
                for( i = 0; i < wnd->title_size; ++i ) {
                    GUIDrawTextExtent( wnd->gui, " ", 1, i, 0, GUI_BACKGROUND, GUI_NO_COLUMN );
                }
                GUIDoVScrollClip( wnd->gui, wnd->vscroll_pending, wnd->title_size, wnd->rows - 1 );
                wnd->vscroll_pending = 0;
            }
        }
        if( WndSwitchOn( wnd, WSW_REPAINT ) ) {
            WndClrSwitches( wnd, WSW_REPAINT );
            WndKillCacheLines( wnd );
            WndCheckCurrentValid( wnd );
            GUIWndDirty( wnd->gui );
            if( wnd->max_indent != 0 && wnd->width >= wnd->max_indent ) {
                GUISetHScroll( wnd->gui, 0 );
                wnd->hscroll_pending = -1;
                GUISetHScrollRange( wnd->gui, wnd->max_indent );
            }
            next = wnd;
        } else {
            for( i = 0; i < wnd->dirtyrects; ++i ) {
                dirty = &wnd->dirty[i];
                if( dirty->row < 0 )
                    continue;
                if( dirty->row >= wnd->rows )
                    continue;
                if( dirty->piece == WND_NO_PIECE ) {
                    if( !WndGetLine( wnd, dirty->row, 0, &line ) )
                        continue;
                    GUIWndDirtyRow( wnd->gui, dirty->row );
                } else {
                    if( !WndGetLine( wnd, dirty->row, dirty->piece, &line ) )
                        continue;
                    if( line.bitmap ) {
                        GUIGetHotSpotSize( line.text[0], &size );
                        rect.x = line.indent;
                        rect.y = dirty->row * wnd->max_char.y;
                        rect.width = line.length;
                        rect.height = size.y;
                    } else if( dirty->colidx != WND_NO_COLIDX ) {
                        if( line.length == 0 )
                            line.text = " ";
                        rect.x = line.indent;
                        rect.x += GUIGetExtentX(wnd->gui, line.text, dirty->colidx);
                        rect.y = dirty->row * wnd->max_char.y;
                        rect.width = GUIGetExtentX( wnd->gui, line.text + dirty->colidx, dirty->end_colidx - dirty->colidx + GUICharLen( UCHAR_VALUE( line.text[dirty->colidx] ) ) );
                        rect.height = wnd->max_char.y;
                    } else if( line.extent == WND_MAX_EXTEND || line.master_tabstop ) {
                        rect.width = 0;
                        rect.height = 0;
                        GUIWndDirtyRow( wnd->gui, dirty->row );
                    } else {
                        rect.x = line.indent;
                        if( WndGetLine( wnd, dirty->row, dirty->piece + 1, &next_piece_line ) ) {
                            if( next_piece_line.indent < line.indent ) {
                                rect.width = WND_APPROX_SIZE;
                            } else {
                                rect.width = next_piece_line.indent - line.indent;
                            }
                        } else {
                            rect.width = WND_APPROX_SIZE;
                        }
                        rect.y = dirty->row * wnd->max_char.y;
                        rect.height = wnd->max_char.y;
                    }
                    /* begin kludge for Kerning problem */
                    if( rect.width != 0 || rect.height != 0 ) {
                        half_char.x = WndAvgCharX( wnd ) / 2;
                        half_char.y = 0;
                        GUITruncToPixel( &half_char );
                        if( rect.x < half_char.x ) {
                            rect.width += half_char.x + rect.x;
                            rect.x = 0;
                        } else {
                            rect.x -= half_char.x;
                            rect.width += half_char.x + half_char.x;
                        }
                        GUIWndDirtyRect( wnd->gui, &rect );
                    }
                }
            }
        }
        if( wnd->hscroll_pending != -1 ) {
            GUISetHScroll( wnd->gui, wnd->hscroll_pending );
            wnd->hscroll_pending = -1;
        }
        wnd->dirtyrects = 0;
        WndSetThumb( wnd );
    }
}