Previous 199869 Revisions Next

r34262 Thursday 8th January, 2015 at 11:23:50 UTC by Fabio Priuli
(MESS) ui: fixed a small problem with tape control menu with
systems with multiple cassette drives attached. nw.
[src/emu/ui]devctrl.h tapectrl.c

trunk/src/emu/ui/devctrl.h
r242773r242774
3838   void previous();
3939   void next();
4040   astring current_display_name();
41   UINT32 current_display_flags();
4142
4243private:
4344   // device iterator
r242773r242774
124125astring ui_menu_device_control<_DeviceType>::current_display_name()
125126{
126127   astring display_name;
127   display_name.cpy(current_device()->device().name());
128   display_name.cpy(current_device()->name());
128129   if (count() > 1)
129130   {
130131      astring temp;
r242773r242774
134135   return display_name;
135136}
136137
138
139//-------------------------------------------------
140//  current_display_flags
141//-------------------------------------------------
142
143template<class _DeviceType>
144UINT32 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
137158#endif /* __UI_DEVCTRL_H__ */
trunk/src/emu/ui/tapectrl.c
r242773r242774
5555
5656void ui_menu_tape_control::populate()
5757{
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
6858   if (current_device())
6959   {     
7060      // 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);
7262
7363      if (current_device()->exists())
7464      {
r242773r242774
125115
126116void ui_menu_tape_control::handle()
127117{
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)
129119   reset(UI_MENU_RESET_REMEMBER_POSITION);
130120   populate();
131121


Previous 199869 Revisions Next


© 1997-2024 The MAME Team