static void menu_move_bar_to( MENU * menu, int number ) { int old_item; old_item = menu->CurrentItem; menu->CurrentItem = number; if (menu->Displayed && (number != old_item)) { item_show( menu, old_item ); item_show( menu, number ); } }
void show(Item a[], int l, int r) { int i; for (i = l; i <= r; i++) item_show(a[i]); printf("\n"); }
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; }
void show(item a[], int left, int right) { int i; for(i = left; i <= right; i++) item_show(a[i]); printf("\n"); }
void list_show(link h) { for (; h->next != NULL; h = h->next) { item_show(h->next->key); } printf("\n"); }
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 ); }
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 ); }