void ProcPaint( void ) { wnd_class wndcls; gui_colour fore; gui_colour back; gui_colour_set *set; bool dialog; int attr; dialog = FALSE; wndcls = WND_NO_CLASS; if( ScanStatus() ) { attr = 0; } else if( ScanCmd( "DIalog\0" ) == 0 ) { dialog = TRUE; attr = ScanAttr( DlgAttrMap, ArraySize( DlgAttrMap ) ); } else { wndcls = ReqWndName(); attr = ScanAttr( AttrMap, ArraySize( AttrMap ) ); } fore = ScanColour(); ScanCmd( "On\0" ); back = ScanColour(); ReqEOC(); if( attr < 0 ) return; if( wndcls == WND_NO_CLASS ) { if( dialog ) { GUIGetDialogColours( WndDlgColours ); set_dlg_attr( (gui_dlg_attr)attr, fore, back ); GUISetDialogColours( WndDlgColours ); } else { WndStatusColour.fore = fore; WndStatusColour.back = back; if( WndHaveStatusWindow() ) { WndCloseStatusWindow(); WndCreateStatusWindow( &WndStatusColour ); } } } else { set = WndClassColour[wndcls]; if( set == NULL ) { set = WndAlloc( sizeof( WndColours ) ); memcpy( set, WndColours, sizeof( WndColours ) ); WndClassColour[wndcls] = set; } set_wndcls_attr( (wnd_attr)attr, set, fore, back, ( wndcls == WND_ALL ) ); _SwitchOn( SW_PENDING_REPAINT ); } }
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; } }