Previous 15994 Revisions Next

r1339 Monday 26th November, 2007 at 18:04:46 UTC by Firewave
Replaced some more windows API calls with win_*_utf8() wrappers
[src/mess/osd/windows]dialog.c
[src/mess/tools/imgtool/windows]secview.c

src/mess/tools/imgtool/windows/secview.c
r1338r1339
1616#include "secview.h"
1717#include "wimgres.h"
1818#include "hexview.h"
19#include "winutf8.h"
1920
2021#define ANCHOR_LEFT      0x01
2122#define ANCHOR_TOP      0x02
r1338r1339
210211static void set_sector_text(HWND dialog)
211212{
212213   struct sectorview_info *info;
213   TCHAR buf[32];
214   CHAR buf[32];
214215
215216   info = get_sectorview_info(dialog);
216217
217218   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);
219220   else
220221      buf[0] = '\0';
221   SetWindowText(GetDlgItem(dialog, IDC_TRACKEDIT), buf);
222   win_set_window_text_utf8(GetDlgItem(dialog, IDC_TRACKEDIT), buf);
222223
223224   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);
225226   else
226227      buf[0] = '\0';
227   SetWindowText(GetDlgItem(dialog, IDC_HEADEDIT), buf);
228   win_set_window_text_utf8(GetDlgItem(dialog, IDC_HEADEDIT), buf);
228229
229230   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);
231232   else
232233      buf[0] = '\0';
233   SetWindowText(GetDlgItem(dialog, IDC_SECTOREDIT), buf);
234   win_set_window_text_utf8(GetDlgItem(dialog, IDC_SECTOREDIT), buf);
234235}
235236
236237
src/mess/osd/windows/dialog.c
r1338r1339
268268static INT_PTR CALLBACK dialog_proc(HWND dlgwnd, UINT msg, WPARAM wparam, LPARAM lparam)
269269{
270270   INT_PTR handled = TRUE;
271   TCHAR buf[32];
272   char *str;
271   CHAR buf[32];
273272   WORD command;
274273
275274   if (LOG_WINMSGS)
r1338r1339
288287      case WM_COMMAND:
289288         command = LOWORD(wparam);
290289
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))
294292            command = IDOK;
295         else if (!strcmp(str, DLGTEXT_CANCEL))
293         else if (!strcmp(buf, DLGTEXT_CANCEL))
296294            command = IDCANCEL;
297295         else
298296            command = 0;
299         free(str);
300297
301298         switch(command)
302299         {

Previous 15994 Revisions Next


© 1998-2018 The MESS Team