--- np2/win9x/dialog/dialogs.cpp 2007/07/20 14:39:12 1.10 +++ np2/win9x/dialog/dialogs.cpp 2007/10/26 14:38:34 1.11 @@ -22,6 +22,22 @@ const TCHAR str_int5[] = _T("INT5"); const TCHAR str_int6[] = _T("INT6"); +// ---- enable + +void dlgs_enablebyautocheck(HWND hWnd, UINT uID, UINT uCheckID) +{ + EnableWindow(GetDlgItem(hWnd, uID), + (SendDlgItemMessage(hWnd, uCheckID, BM_GETCHECK, 0, 0) != 0)); +} + +void dlgs_disablebyautocheck(HWND hWnd, UINT uID, UINT uCheckID) +{ + EnableWindow(GetDlgItem(hWnd, uID), + (SendDlgItemMessage(hWnd, uCheckID, BM_GETCHECK, 0, 0) == 0)); + +} + + // ---- file select BOOL dlgs_selectfile(HWND hWnd, const FILESEL *item, @@ -190,7 +206,6 @@ void dlgs_setliststr(HWND hWnd, UINT16 r } void dlgs_setlistuint32(HWND hWnd, UINT16 res, const UINT32 *item, UINT items) { - HWND wnd; UINT i; OEMCHAR str[16]; @@ -203,6 +218,66 @@ void dlgs_setlistuint32(HWND hWnd, UINT1 } +void dlgs_setdroplistitem(HWND hWnd, UINT uID, + const TCHAR **ppszItem, UINT uItems) +{ + HWND hItem; + UINT uPos; + UINT i; + TCHAR szString[128]; + + hItem = GetDlgItem(hWnd, uID); + uPos = 0; + for (i=0; i= 0) + { + return SendMessage(hItem, CB_GETITEMDATA, (WPARAM)nPos, 0); + } + return -1; +} + + // ---- MIDIデバイスのリスト void dlgs_setlistmidiout(HWND hWnd, UINT16 res, const OEMCHAR *defname) { @@ -278,6 +353,7 @@ void dlgs_setlistmidiin(HWND hWnd, UINT1 } + // ---- draw void dlgs_drawbmp(HDC hdc, UINT8 *bmp) { @@ -317,3 +393,32 @@ dsdb_err1: _MFREE(bmp); } + +// ---- + +BOOL dlgs_getitemrect(HWND hWnd, UINT uID, RECT *pRect) +{ + HWND hItem; + POINT pt; + + if (pRect == NULL) + { + return FALSE; + } + hItem = GetDlgItem(hWnd, uID); + if (!GetWindowRect(hItem, pRect)) + { + return FALSE; + } + ZeroMemory(&pt, sizeof(pt)); + if (!ClientToScreen(hWnd, &pt)) + { + return FALSE; + } + pRect->left -= pt.x; + pRect->top -= pt.y; + pRect->right -= pt.x; + pRect->bottom -= pt.y; + return TRUE; +} +