|
|
| version 1.3, 2004/02/13 20:31:55 | version 1.4, 2005/03/20 08:58:20 |
|---|---|
| Line 7 | Line 7 |
| #include "dialogs.h" | #include "dialogs.h" |
| static const char str_nc[] = "N/C"; | static const TCHAR str_nc[] = _T("N/C"); |
| const char str_int0[] = "INT0"; | const TCHAR str_int0[] = _T("INT0"); |
| const char str_int1[] = "INT1"; | const TCHAR str_int1[] = _T("INT1"); |
| const char str_int2[] = "INT2"; | const TCHAR str_int2[] = _T("INT2"); |
| const char str_int4[] = "INT4"; | const TCHAR str_int4[] = _T("INT4"); |
| const char str_int5[] = "INT5"; | const TCHAR str_int5[] = _T("INT5"); |
| const char str_int6[] = "INT6"; | const TCHAR str_int6[] = _T("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) { | TCHAR *path, UINT size, int *ro) { |
| OPENFILENAME ofn; | OPENFILENAME ofn; |
| Line 47 BOOL dlgs_selectfile(HWND hWnd, const FI | Line 47 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) { | TCHAR *path, UINT size) { |
| OPENFILENAME ofn; | OPENFILENAME ofn; |
| Line 71 BOOL dlgs_selectwritefile(HWND hWnd, con | Line 71 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) { | TCHAR *path, UINT size) { |
| char *file; | TCHAR *file; |
| char *p; | TCHAR *p; |
| char *q; | TCHAR *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 = (TCHAR *)_MALLOC((size + 16) * sizeof(TCHAR), 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 + lstrlen(file); |
| for (i=0; i<10000; i++) { | for (i=0; i<10000; i++) { |
| SPRINTF(q, p, i); | wsprintf(q, p, i); |
| if (file_attr(file) == (short)-1) { | if (file_attr(file) == (short)-1) { |
| break; | break; |
| } | } |
| Line 108 BOOL dlgs_selectwritenum(HWND hWnd, cons | Line 108 BOOL dlgs_selectwritenum(HWND hWnd, cons |
| // ---- list | // ---- list |
| void dlgs_setliststr(HWND hWnd, WORD res, const char **item, UINT items) { | void dlgs_setliststr(HWND hWnd, UINT res, const TCHAR **item, UINT items) { |
| HWND wnd; | HWND wnd; |
| UINT i; | UINT i; |
| Line 119 void dlgs_setliststr(HWND hWnd, WORD res | Line 119 void dlgs_setliststr(HWND hWnd, WORD res |
| } | } |
| } | } |
| void dlgs_setlistuint32(HWND hWnd, WORD res, const UINT32 *item, UINT items) { | void dlgs_setlistuint32(HWND hWnd, UINT res, const UINT32 *item, UINT items) { |
| HWND wnd; | HWND wnd; |
| UINT i; | UINT i; |
| char str[16]; | TCHAR str[16]; |
| wnd = GetDlgItem(hWnd, res); | wnd = GetDlgItem(hWnd, res); |
| for (i=0; i<items; i++) { | for (i=0; i<items; i++) { |
| Line 135 void dlgs_setlistuint32(HWND hWnd, WORD | Line 135 void dlgs_setlistuint32(HWND hWnd, WORD |
| // ---- draw | // ---- draw |
| void dlgs_drawbmp(HDC hdc, BYTE *bmp) { | void dlgs_drawbmp(HDC hdc, UINT8 *bmp) { |
| BMPFILE *bf; | BMPFILE *bf; |
| BMPINFO *bi; | BMPINFO *bi; |
| BMPDATA inf; | BMPDATA inf; |
| HBITMAP hbmp; | HBITMAP hbmp; |
| BYTE *image; | UINT8 *image; |
| HDC hmdc; | HDC hmdc; |
| if (bmp == NULL) { | if (bmp == NULL) { |