src/mess/tools/imgtool/windows/secview.c
| r1338 | r1339 | |
| 16 | 16 | #include "secview.h" |
| 17 | 17 | #include "wimgres.h" |
| 18 | 18 | #include "hexview.h" |
| 19 | #include "winutf8.h" |
| 19 | 20 | |
| 20 | 21 | #define ANCHOR_LEFT 0x01 |
| 21 | 22 | #define ANCHOR_TOP 0x02 |
| r1338 | r1339 | |
| 210 | 211 | static void set_sector_text(HWND dialog) |
| 211 | 212 | { |
| 212 | 213 | struct sectorview_info *info; |
| 213 | | TCHAR buf[32]; |
| 214 | CHAR buf[32]; |
| 214 | 215 | |
| 215 | 216 | info = get_sectorview_info(dialog); |
| 216 | 217 | |
| 217 | 218 | if (info->track != ~0) |
| 218 | | _sntprintf(buf, sizeof(buf) / sizeof(buf[0]), TEXT("%u"), (unsigned int) info->track); |
| 219 | snprintf(buf, sizeof(buf) / sizeof(buf[0]), "%u", (unsigned int) info->track); |
| 219 | 220 | else |
| 220 | 221 | buf[0] = '\0'; |
| 221 | | SetWindowText(GetDlgItem(dialog, IDC_TRACKEDIT), buf); |
| 222 | win_set_window_text_utf8(GetDlgItem(dialog, IDC_TRACKEDIT), buf); |
| 222 | 223 | |
| 223 | 224 | if (info->head != ~0) |
| 224 | | _sntprintf(buf, sizeof(buf) / sizeof(buf[0]), TEXT("%u"), (unsigned int) info->head); |
| 225 | snprintf(buf, sizeof(buf) / sizeof(buf[0]), "%u", (unsigned int) info->head); |
| 225 | 226 | else |
| 226 | 227 | buf[0] = '\0'; |
| 227 | | SetWindowText(GetDlgItem(dialog, IDC_HEADEDIT), buf); |
| 228 | win_set_window_text_utf8(GetDlgItem(dialog, IDC_HEADEDIT), buf); |
| 228 | 229 | |
| 229 | 230 | if (info->sector != ~0) |
| 230 | | _sntprintf(buf, sizeof(buf) / sizeof(buf[0]), TEXT("%u"), (unsigned int) info->sector); |
| 231 | snprintf(buf, sizeof(buf) / sizeof(buf[0]), "%u", (unsigned int) info->sector); |
| 231 | 232 | else |
| 232 | 233 | buf[0] = '\0'; |
| 233 | | SetWindowText(GetDlgItem(dialog, IDC_SECTOREDIT), buf); |
| 234 | win_set_window_text_utf8(GetDlgItem(dialog, IDC_SECTOREDIT), buf); |
| 234 | 235 | } |
| 235 | 236 | |
| 236 | 237 | |
src/mess/osd/windows/dialog.c
| r1338 | r1339 | |
| 268 | 268 | static INT_PTR CALLBACK dialog_proc(HWND dlgwnd, UINT msg, WPARAM wparam, LPARAM lparam) |
| 269 | 269 | { |
| 270 | 270 | INT_PTR handled = TRUE; |
| 271 | | TCHAR buf[32]; |
| 272 | | char *str; |
| 271 | CHAR buf[32]; |
| 273 | 272 | WORD command; |
| 274 | 273 | |
| 275 | 274 | if (LOG_WINMSGS) |
| r1338 | r1339 | |
| 288 | 287 | case WM_COMMAND: |
| 289 | 288 | command = LOWORD(wparam); |
| 290 | 289 | |
| 291 | | GetWindowText((HWND) lparam, buf, sizeof(buf) / sizeof(buf[0])); |
| 292 | | str = utf8_from_tstring(buf); |
| 293 | | if (!strcmp(str, DLGTEXT_OK)) |
| 290 | win_get_window_text_utf8((HWND) lparam, buf, sizeof(buf) / sizeof(buf[0])); |
| 291 | if (!strcmp(buf, DLGTEXT_OK)) |
| 294 | 292 | command = IDOK; |
| 295 | | else if (!strcmp(str, DLGTEXT_CANCEL)) |
| 293 | else if (!strcmp(buf, DLGTEXT_CANCEL)) |
| 296 | 294 | command = IDCANCEL; |
| 297 | 295 | else |
| 298 | 296 | command = 0; |
| 299 | | free(str); |
| 300 | 297 | |
| 301 | 298 | switch(command) |
| 302 | 299 | { |