Diff for /np2/win9x/dialog/dialogs.cpp between versions 1.5 and 1.6

version 1.5, 2005/02/07 15:39:28 version 1.6, 2005/02/09 20:11:36
Line 6 Line 6
 #include        "dialogs.h"  #include        "dialogs.h"
   
   
 static const char str_nc[] = "N/C";  const OEMCHAR str_nc[] = OEMTEXT("N/C");
   
 const char str_int0[] = "INT0";  const OEMCHAR str_int0[] = OEMTEXT("INT0");
 const char str_int1[] = "INT1";  const OEMCHAR str_int1[] = OEMTEXT("INT1");
 const char str_int2[] = "INT2";  const OEMCHAR str_int2[] = OEMTEXT("INT2");
 const char str_int4[] = "INT4";  const OEMCHAR str_int4[] = OEMTEXT("INT4");
 const char str_int5[] = "INT5";  const OEMCHAR str_int5[] = OEMTEXT("INT5");
 const char str_int6[] = "INT6";  const OEMCHAR str_int6[] = OEMTEXT("INT6");
   
   
 // ---- file select  // ---- file select
   
 BOOL dlgs_selectfile(HWND hWnd, const FILESEL *item,  BOOL dlgs_selectfile(HWND hWnd, const FILESEL *item,
                                                                                         char *path, UINT size, int *ro) {                                                                                  OEMCHAR *path, UINT size, int *ro) {
   
         OPENFILENAME    ofn;          OPENFILENAME    ofn;
   
Line 46  BOOL dlgs_selectfile(HWND hWnd, const FI Line 46  BOOL dlgs_selectfile(HWND hWnd, const FI
 }  }
   
 BOOL dlgs_selectwritefile(HWND hWnd, const FILESEL *item,  BOOL dlgs_selectwritefile(HWND hWnd, const FILESEL *item,
                                                                                         char *path, UINT size) {                                                                                          OEMCHAR *path, UINT size) {
   
         OPENFILENAME    ofn;          OPENFILENAME    ofn;
   
Line 70  BOOL dlgs_selectwritefile(HWND hWnd, con Line 70  BOOL dlgs_selectwritefile(HWND hWnd, con
 }  }
   
 BOOL dlgs_selectwritenum(HWND hWnd, const FILESEL *item,  BOOL dlgs_selectwritenum(HWND hWnd, const FILESEL *item,
                                                                                         char *path, UINT size) {                                                                                          OEMCHAR *path, UINT size) {
   
         char    *file;          OEMCHAR *file;
         char    *p;          OEMCHAR *p;
         char    *q;          OEMCHAR *q;
         UINT    i;          UINT    i;
         BOOL    r;          BOOL    r;
   
         if ((item == NULL) || (path == NULL) || (size == 0)) {          if ((item == NULL) || (path == NULL) || (size == 0)) {
                 return(FALSE);                  return(FALSE);
         }          }
         file = (char *)_MALLOC(size + 16, path);          file = (OEMCHAR *)_MALLOC((size + 16) * sizeof(OEMCHAR), path);
         if (file == NULL) {          if (file == NULL) {
                 return(FALSE);                  return(FALSE);
         }          }
         p = file_getname(path);          p = file_getname(path);
         milstr_ncpy(file, path, size);          milstr_ncpy(file, path, size);
         file_cutname(file);          file_cutname(file);
         q = file + strlen(file);          q = file + OEMSTRLEN(file);
   
         for (i=0; i<10000; i++) {          for (i=0; i<10000; i++) {
                 SPRINTF(q, p, i);                  OEMSPRINTF(q, p, i);
                 if (file_attr(file) == (short)-1) {                  if (file_attr(file) == (short)-1) {
                         break;                          break;
                 }                  }
Line 107  BOOL dlgs_selectwritenum(HWND hWnd, cons Line 107  BOOL dlgs_selectwritenum(HWND hWnd, cons
   
 // ---- mimpi def file  // ---- mimpi def file
   
 static const char mimpi_title[] = "Open MIMPI define file";  static const OEMCHAR mimpi_title[] = OEMTEXT("Open MIMPI define file");
 static const char mimpi_ext[] = "def";  static const OEMCHAR mimpi_ext[] = OEMTEXT("def");
 static const char mimpi_filter[] = "MIMPI define file(*.def)\0*.def\0";  static const OEMCHAR mimpi_filter[] = OEMTEXT("MIMPI define file(*.def)\0*.def\0");
 static const FILESEL mimpi = {mimpi_title, mimpi_ext, mimpi_filter, 1};  static const FILESEL mimpi = {mimpi_title, mimpi_ext, mimpi_filter, 1};
   
 void dlgs_browsemimpidef(HWND hWnd, UINT16 res) {  void dlgs_browsemimpidef(HWND hWnd, UINT16 res) {
   
         HWND    subwnd;          HWND            subwnd;
         char    path[MAX_PATH];          OEMCHAR         path[MAX_PATH];
 const char      *p;  const OEMCHAR   *p;
   
         subwnd = GetDlgItem(hWnd, res);          subwnd = GetDlgItem(hWnd, res);
         GetWindowText(subwnd, path, sizeof(path));          GetWindowText(subwnd, path, NELEMENTS(path));
         if (dlgs_selectfile(hWnd, &mimpi, path, sizeof(path), NULL)) {          if (dlgs_selectfile(hWnd, &mimpi, path, NELEMENTS(path), NULL)) {
                 p = path;                  p = path;
         }          }
         else {          else {
Line 132  const char *p; Line 132  const char *p;
   
 // ---- list  // ---- list
   
 void dlgs_setliststr(HWND hWnd, UINT16 res, const char **item, UINT items) {  void dlgs_setliststr(HWND hWnd, UINT16 res, const OEMCHAR **item, UINT items) {
   
         HWND    wnd;          HWND    wnd;
         UINT    i;          UINT    i;
Line 147  void dlgs_setlistuint32(HWND hWnd, UINT1 Line 147  void dlgs_setlistuint32(HWND hWnd, UINT1
   
         HWND    wnd;          HWND    wnd;
         UINT    i;          UINT    i;
         char    str[16];          OEMCHAR str[16];
   
         wnd = GetDlgItem(hWnd, res);          wnd = GetDlgItem(hWnd, res);
         for (i=0; i<items; i++) {          for (i=0; i<items; i++) {
                 wsprintf(str, str_u, item[i]);                  OEMSPRINTF(str, str_u, item[i]);
                 SendMessage(wnd, CB_INSERTSTRING, (WPARAM)i, (LPARAM)str);                  SendMessage(wnd, CB_INSERTSTRING, (WPARAM)i, (LPARAM)str);
         }          }
 }  }
Line 159  void dlgs_setlistuint32(HWND hWnd, UINT1 Line 159  void dlgs_setlistuint32(HWND hWnd, UINT1
   
 // ---- MIDIデバイスのリスト  // ---- MIDIデバイスのリスト
   
 void dlgs_setlistmidiout(HWND hWnd, UINT16 res, const char *defname) {  void dlgs_setlistmidiout(HWND hWnd, UINT16 res, const OEMCHAR *defname) {
   
         HWND            wnd;          HWND            wnd;
         UINT            defcur;          UINT            defcur;
Line 197  void dlgs_setlistmidiout(HWND hWnd, UINT Line 197  void dlgs_setlistmidiout(HWND hWnd, UINT
         SendMessage(wnd, CB_SETCURSEL, (WPARAM)defcur, (LPARAM)0);          SendMessage(wnd, CB_SETCURSEL, (WPARAM)defcur, (LPARAM)0);
 }  }
   
 void dlgs_setlistmidiin(HWND hWnd, UINT16 res, const char *defname) {  void dlgs_setlistmidiin(HWND hWnd, UINT16 res, const OEMCHAR *defname) {
   
         HWND            wnd;          HWND            wnd;
         UINT            defcur;          UINT            defcur;

Removed from v.1.5  
changed lines
  Added in v.1.6


RetroPC.NET-CVS <cvs@retropc.net>