trunk/src/emu/imagedev/floppy.c
| r242736 | r242737 | |
| 980 | 980 | break; |
| 981 | 981 | |
| 982 | 982 | case ui_menu_select_rw::WRITE_OTHER: |
| 983 | | ui_menu::stack_push(auto_alloc_clear(machine(), ui_menu_file_create(machine(), container, image, current_directory, current_file))); |
| 984 | | state = CREATE_FILE; |
| 983 | ui_menu::stack_push(auto_alloc_clear(machine(), ui_menu_file_create(machine(), container, image, current_directory, current_file, &create_ok))); |
| 984 | state = CHECK_CREATE; |
| 985 | 985 | break; |
| 986 | 986 | |
| 987 | 987 | case -1: |
trunk/src/emu/ui/filesel.c
| r242736 | r242737 | |
| 54 | 54 | { |
| 55 | 55 | size_t buflen = strlen(buffer); |
| 56 | 56 | |
| 57 | | if ((unichar == 8) && (buflen > 0)) |
| 57 | if ((unichar == 8 || unichar == 0x7f) && (buflen > 0)) |
| 58 | 58 | { |
| 59 | 59 | *(char *)utf8_previous_char(&buffer[buflen]) = 0; |
| 60 | 60 | } |
| r242736 | r242737 | |
| 65 | 65 | } |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | | |
| 69 | 68 | //------------------------------------------------- |
| 70 | 69 | // extra_text_draw_box - generically adds header |
| 71 | 70 | // or footer text |
| r242736 | r242737 | |
| 220 | 219 | // ctor |
| 221 | 220 | //------------------------------------------------- |
| 222 | 221 | |
| 223 | | ui_menu_file_create::ui_menu_file_create(running_machine &machine, render_container *container, device_image_interface *image, astring ¤t_directory, astring ¤t_file) |
| 222 | ui_menu_file_create::ui_menu_file_create(running_machine &machine, render_container *container, device_image_interface *image, astring ¤t_directory, astring ¤t_file, bool *ok) |
| 224 | 223 | : ui_menu(machine, container), |
| 225 | 224 | m_current_directory(current_directory), |
| 226 | 225 | m_current_file(current_file) |
| 227 | 226 | { |
| 228 | 227 | m_image = image; |
| 228 | m_ok = ok; |
| 229 | *m_ok = true; |
| 229 | 230 | } |
| 230 | 231 | |
| 231 | 232 | |
| r242736 | r242737 | |
| 328 | 329 | reset(UI_MENU_RESET_REMEMBER_POSITION); |
| 329 | 330 | } |
| 330 | 331 | break; |
| 332 | case IPT_UI_CANCEL: |
| 333 | *m_ok = false; |
| 334 | break; |
| 331 | 335 | } |
| 332 | 336 | } |
| 333 | 337 | } |
| 334 | 338 | |
| 335 | | |
| 336 | | |
| 337 | 339 | /*************************************************************************** |
| 338 | 340 | FILE SELECTOR MENU |
| 339 | 341 | ***************************************************************************/ |
trunk/src/emu/ui/filesel.h
| r242736 | r242737 | |
| 34 | 34 | class ui_menu_file_create : public ui_menu |
| 35 | 35 | { |
| 36 | 36 | public: |
| 37 | | ui_menu_file_create(running_machine &machine, render_container *container, device_image_interface *image, astring ¤t_directory, astring ¤t_file); |
| 37 | ui_menu_file_create(running_machine &machine, render_container *container, device_image_interface *image, astring ¤t_directory, astring ¤t_file, bool *ok); |
| 38 | 38 | virtual ~ui_menu_file_create(); |
| 39 | 39 | virtual void populate(); |
| 40 | 40 | virtual void handle(); |
| r242736 | r242737 | |
| 46 | 46 | astring & m_current_file; |
| 47 | 47 | const image_device_format * m_current_format; |
| 48 | 48 | char m_filename_buffer[1024]; |
| 49 | |
| 50 | protected: |
| 51 | bool * m_ok; |
| 49 | 52 | }; |
| 50 | 53 | |
| 51 | 54 | |
trunk/src/emu/ui/imgcntrl.c
| r242736 | r242737 | |
| 276 | 276 | break; |
| 277 | 277 | |
| 278 | 278 | case ui_menu_file_selector::R_CREATE: |
| 279 | | ui_menu::stack_push(auto_alloc_clear(machine(), ui_menu_file_create(machine(), container, image, current_directory, current_file))); |
| 280 | | state = CREATE_FILE; |
| 279 | ui_menu::stack_push(auto_alloc_clear(machine(), ui_menu_file_create(machine(), container, image, current_directory, current_file, &create_ok))); |
| 280 | state = CHECK_CREATE; |
| 281 | 281 | break; |
| 282 | 282 | |
| 283 | 283 | case ui_menu_file_selector::R_SOFTLIST: |
| r242736 | r242737 | |
| 309 | 309 | break; |
| 310 | 310 | } |
| 311 | 311 | |
| 312 | | case CREATE_CONFIRM: { |
| 312 | case CREATE_CONFIRM: |
| 313 | 313 | state = create_confirmed ? DO_CREATE : START_FILE; |
| 314 | 314 | handle(); |
| 315 | 315 | break; |
| 316 | | } |
| 317 | 316 | |
| 317 | case CHECK_CREATE: |
| 318 | state = create_ok ? CREATE_FILE : START_FILE; |
| 319 | handle(); |
| 320 | break; |
| 321 | |
| 318 | 322 | case DO_CREATE: { |
| 319 | 323 | astring path; |
| 320 | 324 | zippath_combine(path, current_directory, current_file); |
trunk/src/emu/ui/imgcntrl.h
| r242736 | r242737 | |
| 25 | 25 | |
| 26 | 26 | protected: |
| 27 | 27 | enum { |
| 28 | | START_FILE, START_OTHER_PART, START_SOFTLIST, SELECT_PARTLIST, SELECT_ONE_PART, SELECT_OTHER_PART, SELECT_FILE, CREATE_FILE, CREATE_CONFIRM, DO_CREATE, SELECT_SOFTLIST, |
| 28 | START_FILE, START_OTHER_PART, START_SOFTLIST, |
| 29 | SELECT_PARTLIST, SELECT_ONE_PART, SELECT_OTHER_PART, |
| 30 | SELECT_FILE, CREATE_FILE, CREATE_CONFIRM, CHECK_CREATE, DO_CREATE, SELECT_SOFTLIST, |
| 29 | 31 | LAST_ID |
| 30 | 32 | }; |
| 31 | 33 | |
| r242736 | r242737 | |
| 39 | 41 | // methods |
| 40 | 42 | virtual void hook_load(astring filename, bool softlist); |
| 41 | 43 | |
| 44 | bool create_ok; |
| 45 | |
| 42 | 46 | private: |
| 43 | 47 | // instance variables |
| 44 | 48 | bool create_confirmed; |