Beispiel #1
0
extern  char    *GetWndFont( a_window *wnd )
{
    if( WndHasClass( wnd ) ) {
        if( WndFontInfo[WndClass( wnd )] != NULL ) {
            return( WndFontInfo[WndClass( wnd )] );
        }
    }
    return( WndFontInfo[WND_ALL] );
}
Beispiel #2
0
extern  void    WndResizeHook( a_window *wnd )
{
    gui_rect    rect;

    if( WndIsMaximized( wnd ) || WndIsMinimized( wnd ) )
        return;
    if( !WndHasClass( wnd ) )
        return;
    WndGetRect( wnd, &rect );
    WndRectToPos( &rect, &WndPosition[WndClass( wnd )], WndMainClientSize() );
}
Beispiel #3
0
extern  void    WndFontHook( a_window *wnd )
{
    char        *font;

    if( !WndHasClass( wnd ) )
        return;
    font = WndGetFontInfo( wnd );
    if( font != NULL ) {
        SetFont( WndClass( wnd ), font );
    }
}
Beispiel #4
0
bool FileOpenGadget( a_window *wnd, wnd_line_piece *line, mod_handle mod )
{
    a_window    *curr;
    for( curr = WndNext( NULL ); curr != NULL; curr = WndNext( curr ) ) {
        if( WndClass( curr ) != WND_SOURCE ) continue;
        if( mod == WndFile( curr )->mod ) {
            if( line != NULL ) SetGadgetLine( wnd, line, GADGET_OPEN_SOURCE );
            return( TRUE );
        }
    }
    if( line != NULL ) SetGadgetLine( wnd, line, GADGET_CLOSED_SOURCE );
    return( FALSE );
}
Beispiel #5
0
void WndMainResized( void )
{
    a_window    *wnd;
    gui_rect    rect;

    if( _IsOff( SW_DETACHABLE_WINDOWS ) ) {
        WndGetRect( WndMain, &WndMainRect );
        for( wnd = WndNext( NULL ); wnd != NULL; wnd = WndNext( wnd ) ) {
            if( !WndHasClass( wnd ) )
                continue;
            WndPosToRect( &WndPosition[WndClass( wnd )], &rect, WndMainClientSize() );
            WndResizeWindow( wnd, &rect );
        }
    }
}
Beispiel #6
0
extern  void    AsmNewSrcNotify( a_window *src, mod_handle mod, bool track )
{
    asm_window  *asw;
    a_window    *wnd;

    for( wnd = WndNext( NULL ); wnd != NULL; wnd = WndNext( wnd ) ) {
        if( WndClass( wnd ) != WND_ASSEMBLY ) continue;
        asw = WndAsm( wnd );
        if( track != asw->track ) continue;
        if( mod != asw->mod ) continue;
        if( asw->src != NULL ) continue;
        SrcJoinAsm( src, wnd );
        AsmJoinSrc( wnd, src );
        break;
    }
}
Beispiel #7
0
extern  void    SrcNewAsmNotify( a_window *asw, mod_handle mod, bool track )
{
    file_window *file;
    a_window    *wnd;

    for( wnd = WndNext( NULL ); wnd != NULL; wnd = WndNext( wnd ) ) {
        if( WndClass( wnd ) != WND_SOURCE ) continue;
        file = WndFile( wnd );
        if( track != file->track ) continue;
        if( mod != file->mod ) continue;
        if( file->asw != NULL ) continue;
        AsmJoinSrc( asw, wnd );
        SrcJoinAsm( wnd, asw );
        break;
    }
}
void ProcPendingPaint( void )
{
    gui_colour_set      *set;
    a_window            *wnd;

    if( _IsOff( SW_PENDING_REPAINT ) ) return;
    _SwitchOff( SW_PENDING_REPAINT );
    for( wnd = WndNext( NULL ); wnd != NULL; wnd = WndNext( wnd ) ) {
        if( WndHasClass( wnd ) ) {
            set = WndClassColour[WndClass( wnd )];
        } else {
            set = NULL;
        }
        if( set == NULL ) {
            set = WndClassColour[WND_ALL];
        }
        if( set == NULL ) {
            set = WndColours;
        }
        WndSetFontInfo( wnd, GetWndFont( wnd ) );
        WndSetColours( wnd, WndNumColours, set );
    }
}
Beispiel #9
0
void ConfigDisp( void )
{

    a_window        *wnd, *scan;
    char            buff[20];
    char            buff2[20];
    a_window        *head, *next;
    int             h;
    wnd_class_wv    wndclass;
    gui_rect        rect;

    ReqEOC();
    GetCmdEntry( WndNameTab, WND_ALL, buff );
    GetCmdEntry( DispOptions, CLOSE, buff2 );
    Format( TxtBuff, "%s %s /%s", GetCmdName( CMD_DISPLAY ), buff, buff2 );
    WndDlgTxt( TxtBuff );
    if( WndHaveStatusWindow() ) {
        GetCmdEntry( MiscTab, MISC_STATUS, buff );
        Format( TxtBuff, "%s %s", GetCmdName( CMD_DISPLAY ), buff );
        WndDlgTxt( TxtBuff );
    }
    if( WndHaveToolBar() ) {
        h = WndToolHeight();
        GetCmdEntry( MiscTab, MISC_TOOL, buff );
        GetCmdEntry( DispOptions, WndToolFixed() ? FIXED : FLOATING, buff2 );
        Format( TxtBuff, "%s %s /%s %d", GetCmdName( CMD_DISPLAY ),
                buff, buff2, h );
        WndDlgTxt( TxtBuff );
    }
    for( wndclass = 0; wndclass < WND_NUM_CLASSES; ++wndclass ) {
        if( wndclass == WND_ALL )
            continue;
        if( WndFindClass( NULL, wndclass ) != NULL )
            continue;
        WndPosToRect( &WndPosition[wndclass], &rect, &WndScreen );
        if( rect.width == 0 )
            continue;
        if( rect.height == 0 )
            continue;
        PrintPosition( CLOSE, wndclass, &rect, buff, buff2 );
    }
    head = WndNext( NULL );
    if( head == NULL )
        return;
    // traverse in reverse order so that windows get created in correct order
    for( wnd = head; (next = WndNext( wnd )) != NULL; wnd = next )
        ;
    for( ;; ) {
        if( WndHasClass( wnd ) ) {
            wndclass = WndClass( wnd );
            switch( wndclass ) {
            case WND_ALL:
                break;
            case WND_BINARY:
            case WND_FILE:
            case WND_MEMORY:
                WndResizeHook( wnd );
                WndPosToRect( &WndPosition[wndclass], &rect, &WndScreen );
                PrintPosition( CLOSE, wndclass, &rect, buff, buff2 );
                break;
            case WND_VARIABLE:
            case WND_TMPFILE:
                break;
            default:
                WndResizeHook( wnd );
                WndPosToRect( &WndPosition[wndclass], &rect, &WndScreen );
                PrintPosition( OPEN, wndclass, &rect, buff, buff2 );
                break;
            }
        }
        if( wnd == head )
            break;
        for( scan = head; (next = WndNext( scan )) != wnd; scan = next )
            ;
        wnd = scan;
    }
}