Previous 15994 Revisions Next

r2582 Thursday 8th May, 2008 at 21:15:19 UTC by Stefano Priore
Remaining UI issues fixed. Both navigation keys functionality and appearance are equivalent to MAME counterparts
[src/mess]filemngr.c

src/mess/filemngr.c
r2581r2582
489489         fs_item[sel & SEL_MASK].subtext = current_filespecification;
490490
491491         /* display the menu */
492         ui_menu_draw(fs_item, fs_total, sel & SEL_MASK, NULL);
492         visible = ui_menu_draw(fs_item, fs_total, sel & SEL_MASK, NULL);
493493
494494         /* update string with any keys that are pressed */
495495         name = update_entered_string();
r2581r2582
512512      }
513513
514514
515      ui_menu_draw(fs_item, fs_total, sel, NULL);
515      visible = ui_menu_draw(fs_item, fs_total, sel, NULL);
516516
517      visible = 0;
517      /* Maybe the following code up to IPT_UI_PAUSE can be replaced with a call to ui_menu_generic_keys() */
518518
519      /* up backs up by one item */
520      if (input_ui_pressed_repeat(IPT_UI_UP, 6))
521         sel = (sel + total - 1) % total;
522
519523      /* down advances by one item */
520524      if (input_ui_pressed_repeat(IPT_UI_DOWN, 6))
521      {
522         sel++;
523         sel = MIN(sel,total);
524      }
525         sel = (sel +  1) % total;
525526
526      /* end goes to the last */
527      if (input_ui_pressed_repeat(IPT_UI_END, 6))
527      /* page up backs up by visible_items */
528      if (input_ui_pressed_repeat(IPT_UI_PAGE_UP, 6))
528529      {
529         sel = total - 1;
530         if (sel >= visible - 1)
531            sel -= visible - 1;
532         else
533            sel = 0;
530534      }
531535
532536      /* page down advances by visible_items */
533537      if (input_ui_pressed_repeat(IPT_UI_PAGE_DOWN, 6))
534538      {
535         sel = (sel + visible - 1);
536         sel = MIN(sel,total);
539         sel += visible - 1;
540         if (sel >= total)
541            sel = total - 1;
537542      }
538543
539      /* up backs up by one item */
540      if (input_ui_pressed_repeat(IPT_UI_UP, 6))
541      {
542         sel--;
543         sel = MAX(0,sel);
544      }
545
546544      /* home goes to the start */
547      if (input_ui_pressed_repeat(IPT_UI_HOME, 6))
548      {
549         sel = 1;
550      }
545      if (input_ui_pressed(IPT_UI_HOME))
546         sel = 0;
551547
552      /* page up backs up by visible_items */
553      if (input_ui_pressed_repeat(IPT_UI_PAGE_UP, 6))
554      {
555         sel = (sel - visible + 1);
556         sel = MAX(0,sel);
557      }
548      /* end goes to the last */
549      if (input_ui_pressed(IPT_UI_END))
550         sel = total - 1;
558551
552      /* pause enables/disables pause */
553      if (input_ui_pressed(IPT_UI_PAUSE))
554         mame_pause(Machine, !mame_is_paused(Machine));
555
559556      if (input_ui_pressed(IPT_UI_SELECT))
560557      {
561558         if (sel < SEL_MASK)
r2581r2582
656653   ui_menu_item menu_items[40];
657654   const device_config *devices[40];
658655   char names[40][64];
659   int sel, total, arrowize;
656   int sel, total, visible, arrowize;
660657   const device_config *image;
661658
662659   sel = selected - 1;
r2581r2582
708705   }
709706
710707   memset(&menu_items[total], 0, sizeof(menu_items[total]));
711   menu_items[total].text = ui_getstring(UI_returntomain);
708   menu_items[total].text = "Return to Prior Menu";
712709   total++;
713710
714711   arrowize = 0;
r2581r2582
721718      menu_items[sel & SEL_MASK].subtext = entered_filename;
722719
723720      /* display the menu */
724      ui_menu_draw(menu_items, total, sel & SEL_MASK, NULL);
721      visible = ui_menu_draw(menu_items, total, sel & SEL_MASK, NULL);
725722
726723      /* update string with any keys that are pressed */
727724      name = update_entered_string();
r2581r2582
738735      return sel + 1;
739736   }
740737
741   ui_menu_draw(menu_items, total, sel, NULL);
738   visible = ui_menu_draw(menu_items, total, sel, NULL);
742739
743   if (input_ui_pressed_repeat(IPT_UI_DOWN, 8))
744      sel = (sel + 1) % total;
740   /* Maybe the following code up to IPT_UI_PAUSE can be replaced with a call to ui_menu_generic_keys() */
745741
746   if (input_ui_pressed_repeat(IPT_UI_UP, 8))
742   /* up backs up by one item */
743   if (input_ui_pressed_repeat(IPT_UI_UP, 6))
747744      sel = (sel + total - 1) % total;
748745
746   /* down advances by one item */
747   if (input_ui_pressed_repeat(IPT_UI_DOWN, 6))
748      sel = (sel +  1) % total;
749
750   /* page up backs up by visible_items */
751   if (input_ui_pressed_repeat(IPT_UI_PAGE_UP, 6))
752   {
753      if (sel >= visible - 1)
754         sel -= visible - 1;
755      else
756         sel = 0;
757   }
758
759   /* page down advances by visible_items */
760   if (input_ui_pressed_repeat(IPT_UI_PAGE_DOWN, 6))
761   {
762      sel += visible - 1;
763      if (sel >= total)
764         sel = total - 1;
765   }
766
767   /* home goes to the start */
768   if (input_ui_pressed(IPT_UI_HOME))
769      sel = 0;
770
771   /* end goes to the last */
772   if (input_ui_pressed(IPT_UI_END))
773      sel = total - 1;
774
775   /* pause enables/disables pause */
776   if (input_ui_pressed(IPT_UI_PAUSE))
777      mame_pause(Machine, !mame_is_paused(Machine));
778
749779   if (input_ui_pressed(IPT_UI_SELECT))
750780   {
751781      int os_sel;

Previous 15994 Revisions Next


© 1998-2018 The MESS Team