trunk/src/emu/ui/devctrl.h
| r242773 | r242774 | |
| 38 | 38 | void previous(); |
| 39 | 39 | void next(); |
| 40 | 40 | astring current_display_name(); |
| 41 | UINT32 current_display_flags(); |
| 41 | 42 | |
| 42 | 43 | private: |
| 43 | 44 | // device iterator |
| r242773 | r242774 | |
| 124 | 125 | astring ui_menu_device_control<_DeviceType>::current_display_name() |
| 125 | 126 | { |
| 126 | 127 | astring display_name; |
| 127 | | display_name.cpy(current_device()->device().name()); |
| 128 | display_name.cpy(current_device()->name()); |
| 128 | 129 | if (count() > 1) |
| 129 | 130 | { |
| 130 | 131 | astring temp; |
| r242773 | r242774 | |
| 134 | 135 | return display_name; |
| 135 | 136 | } |
| 136 | 137 | |
| 138 | |
| 139 | //------------------------------------------------- |
| 140 | // current_display_flags |
| 141 | //------------------------------------------------- |
| 142 | |
| 143 | template<class _DeviceType> |
| 144 | UINT32 ui_menu_device_control<_DeviceType>::current_display_flags() |
| 145 | { |
| 146 | UINT32 flags = 0; |
| 147 | if (count() > 1) |
| 148 | { |
| 149 | if (current_index() > 0) |
| 150 | flags |= MENU_FLAG_LEFT_ARROW; |
| 151 | if (current_index() < count() - 1) |
| 152 | flags |= MENU_FLAG_RIGHT_ARROW; |
| 153 | } |
| 154 | return flags; |
| 155 | } |
| 156 | |
| 157 | |
| 137 | 158 | #endif /* __UI_DEVCTRL_H__ */ |
trunk/src/emu/ui/tapectrl.c
| r242773 | r242774 | |
| 55 | 55 | |
| 56 | 56 | void ui_menu_tape_control::populate() |
| 57 | 57 | { |
| 58 | | UINT32 flags = 0; |
| 59 | | |
| 60 | | if (count() > 1) |
| 61 | | { |
| 62 | | if (current_index() == (count() - 1)) |
| 63 | | flags |= MENU_FLAG_LEFT_ARROW; |
| 64 | | else |
| 65 | | flags |= MENU_FLAG_RIGHT_ARROW; |
| 66 | | } |
| 67 | | |
| 68 | 58 | if (current_device()) |
| 69 | 59 | { |
| 70 | 60 | // name of tape |
| 71 | | item_append(current_display_name().cstr(), current_device()->exists() ? current_device()->filename() : "No Tape Image loaded", flags, TAPECMD_SELECT); |
| 61 | item_append(current_display_name().cstr(), current_device()->exists() ? current_device()->filename() : "No Tape Image loaded", current_display_flags(), TAPECMD_SELECT); |
| 72 | 62 | |
| 73 | 63 | if (current_device()->exists()) |
| 74 | 64 | { |
| r242773 | r242774 | |
| 125 | 115 | |
| 126 | 116 | void ui_menu_tape_control::handle() |
| 127 | 117 | { |
| 128 | | // rebuild the menu - we have to do this so that the counter updates |
| 118 | // rebuild the menu (so to update the selected device, if the user has pressed L or R, and the tape counter) |
| 129 | 119 | reset(UI_MENU_RESET_REMEMBER_POSITION); |
| 130 | 120 | populate(); |
| 131 | 121 | |