Exemple #1
0
void menu_show( MENU * menu )
{
	int i;

	ui_mouse_hide();

	gr_set_current_canvas(NULL);
	// Don't save background it if it's already drawn
	if (!menu->Displayed) 
	{
		// Save the background
		gr_bm_ubitblt(menu->w, menu->h, 0, 0, menu->x, menu->y, &(grd_curscreen->sc_canvas.cv_bitmap), menu->Background);

		// Draw the menu background
		gr_setcolor( CGREY );
		gr_urect( menu->x, menu->y, menu->x + menu->w - 1, menu->y + menu->h - 1 );
		if ( menu != &Menu[0] )
		{
			gr_setcolor( CBLACK );
			gr_ubox( menu->x, menu->y, menu->x + menu->w - 1, menu->y + menu->h - 1 );
		}
	}
		
	// Draw the items
	
	for (i=0; i< menu->NumItems; i++ )
		item_show( menu, i );

	ui_mouse_show();
	
	// Mark as displayed.
	menu->Displayed = 1;
}
Exemple #2
0
void ui_draw_userbox( UI_DIALOG *dlg, UI_GADGET_USERBOX * userbox )
{
#if 0  //ndef OGL
	if ( userbox->status==1 )
#endif
	{
		userbox->status = 0;

		gr_set_current_canvas( userbox->canvas );

		const uint8_t color = (dlg->keyboard_focus_gadget == userbox)
			? CRED
			: CBRIGHT;
		gr_ubox(-1, -1, userbox->width, userbox->height, color);
	}
}
Exemple #3
0
void ui_draw_userbox( UI_DIALOG *dlg, UI_GADGET_USERBOX * userbox )
{
#if 0  //ndef OGL
	if ( userbox->status==1 )
#endif
	{
		userbox->status = 0;

		gr_set_current_canvas( userbox->canvas );

		if (dlg->keyboard_focus_gadget == (UI_GADGET *)userbox)
			gr_setcolor( CRED );
		else
			gr_setcolor( CBRIGHT );

		gr_ubox( -1, -1, userbox->width, userbox->height );
	}
}
Exemple #4
0
static void menu_draw(MENU *menu)
{
	int i;
	
	gr_set_default_canvas();
	auto &canvas = *grd_curcanv;

	// Draw the menu background
	gr_urect(canvas, menu->x, menu->y, menu->x + menu->w - 1, menu->y + menu->h - 1, CGREY);
	if ( menu != &Menu[0] )
	{
		gr_ubox(canvas, menu->x, menu->y, menu->x + menu->w - 1, menu->y + menu->h - 1, CBLACK);
	}
	
	// Draw the items
	
	for (i=0; i< menu->NumItems; i++ )
		item_show( menu, i );
}
Exemple #5
0
void menu_draw(MENU *menu)
{
	int i;
	
	gr_set_current_canvas(NULL);

	// Draw the menu background
	gr_setcolor( CGREY );
	gr_urect( menu->x, menu->y, menu->x + menu->w - 1, menu->y + menu->h - 1 );
	if ( menu != &Menu[0] )
	{
		gr_setcolor( CBLACK );
		gr_ubox( menu->x, menu->y, menu->x + menu->w - 1, menu->y + menu->h - 1 );
	}
	
	// Draw the items
	
	for (i=0; i< menu->NumItems; i++ )
		item_show( menu, i );
}