static void PrintPosition( disp_optn optn, wnd_class_wv wndclass, gui_rect *rect, char *buff, char *buff2 ) { GetCmdEntry( WndNameTab, wndclass, buff ); GetCmdEntry( DispOptions, optn, buff2 ); Format( TxtBuff, "%s %s /%s %d,%d,%d,%d", GetCmdName( CMD_DISPLAY ), buff, buff2, rect->x, rect->y, rect->width, rect->height ); WndDlgTxt( TxtBuff ); }
static void PrintStatusColour( void ) { char fore[20]; char back[20]; GetColourName( WndStatusColour.fore, fore ); GetColourName( WndStatusColour.back, back ); Format( TxtBuff, "%s status %s on %s", GetCmdName( CMD_PAINT ), fore, back ); WndDlgTxt( TxtBuff ); }
static void PrintFont( wnd_class_wv wndclass, char *def ) { char wndname[20]; char *font; font = WndFontInfo[wndclass]; if( font == NULL ) return; if( def == NULL || strcmp( font, def ) != 0 ) { GetCmdEntry( WndNameTab, wndclass, wndname ); Format( TxtBuff, "%s %s {%s}", GetCmdName( CMD_FONT ), wndname, font ); WndDlgTxt( TxtBuff ); } }
static void PrintDialogColours( void ) { int i; gui_dlg_attr dlgattr; char fore[20]; char back[20]; char attr[30]; GUIGetDialogColours( WndDlgColours ); for( i = 0; i < ArraySize( DlgAttrMap ); ++i ) { dlgattr = DlgAttrMap[i].attr; GetAttrName( DlgAttrMap, i, attr ); GetColourName( WndDlgColours[dlgattr].fore, fore ); GetColourName( WndDlgColours[dlgattr].back, back ); Format( TxtBuff, "%s dialog %s %s on %s", GetCmdName( CMD_PAINT ), attr, fore, back ); WndDlgTxt( TxtBuff ); } }
static void PrintColours( wnd_class wndcls, gui_colour_set *set, gui_colour_set *def ) { char wndname[20]; char attr[30]; char fore[20]; char back[20]; int i; wnd_class wndcls1; GetCmdEntry( WndNameTab, wndcls, wndname ); for( i = 0; i < ArraySize( AttrMap ); ++i ) { wndcls1 = AttrMap[i].attr; if( def == NULL || memcmp( &set[wndcls1], &def[wndcls1], sizeof( *set ) ) != 0 ) { GetAttrName( AttrMap, i, attr ); GetColourName( set[wndcls1].fore, fore ); GetColourName( set[wndcls1].back, back ); Format( TxtBuff, "%s %s %s %s on %s", GetCmdName( CMD_PAINT ), wndname, attr, fore, back ); WndDlgTxt( TxtBuff ); } } }
bool DUIDlgTxt( const char *text ) { return( WndDlgTxt( text ) ); }
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; } }
static void WriteLog( handle dummy, const char *buff ) { dummy = dummy; WndDlgTxt( buff ); }