static void ui_dialog_draw(UI_DIALOG *dlg) { int x, y, w, h; int req_w, req_h; x = D_X; y = D_Y; w = D_WIDTH; h = D_HEIGHT; req_w = w; req_h = h; if (dlg->flags & DF_BORDER) { req_w -= 2*BORDER_WIDTH; req_h -= 2*BORDER_WIDTH; gr_set_current_canvas( NULL ); ui_draw_frame( x, y, x+w-1, y+h-1 ); } ui_dialog_set_current_canvas(dlg); if (dlg->flags & DF_FILLED) ui_draw_box_out( 0, 0, req_w-1, req_h-1 ); gr_set_fontcolor( CBLACK, CWHITE ); D_TEXT_X = 0; D_TEXT_Y = 0; }
void ui_dprintf_at( UI_DIALOG * dlg, short x, short y, const char * format, ... ) { char buffer[1000]; va_list args; va_start(args, format ); vsnprintf(buffer,sizeof(buffer),format,args); ui_dialog_set_current_canvas( dlg ); gr_string( x, y, buffer ); }
void ui_dprintf( UI_DIALOG * dlg, const char * format, ... ) { char buffer[1000]; va_list args; va_start(args, format ); vsnprintf(buffer,sizeof(buffer),format,args); ui_dialog_set_current_canvas( dlg ); D_TEXT_X = gr_string( D_TEXT_X, D_TEXT_Y, buffer ); }
void ui_pad_draw(UI_DIALOG *dlg, int x, int y) { int bh, bw; bw = 56; bh = 30; ui_dialog_set_current_canvas( dlg ); ui_draw_box_in( x, y, x+(bw*4)+10 + 200, y+(bh*5)+45 ); gr_set_current_canvas( NULL ); gr_setcolor( CWHITE ); gr_urect( desc_x, desc_y, desc_x+ 56*4-1, desc_y+15 ); gr_set_fontcolor( CBLACK, CWHITE ); gr_ustring( desc_x, desc_y, KeyPad[active_pad]->description ); }
void ui_dputs_at( UI_DIALOG * dlg, short x, short y, const char * buffer ) { ui_dialog_set_current_canvas( dlg ); gr_string(*grd_curcanv, x, y, buffer); }