Changeset 13400
- Timestamp:
- Feb 18, 2000, 6:13:39 PM (25 years ago)
- Location:
- tags/trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified tags/trunk/include/win/treeview.h ¶
r13393 r13400 1 /* $Id: treeview.h,v 1.1 0 2000-02-17 17:26:07cbratschi Exp $ */1 /* $Id: treeview.h,v 1.11 2000-02-18 17:12:43 cbratschi Exp $ */ 2 2 /* 3 3 * Treeview class extra info … … 15 15 #define TV_DEFAULTITEMHEIGHT 16 16 16 #define TVITEM_ALLOC 32 /* default nr of items to allocate at first try */ 17 #define TV_ISEARCH_DELAY 500 17 18 18 19 … … 89 90 /* 1=valid, 0=free; */ 90 91 /* size of list= uNumPtrsAlloced/32 */ 92 LPWSTR pszISearch; 93 UINT uISearchLen; 91 94 } TREEVIEW_INFO, *LPTREEVIEW_INFO; 92 95 … … 107 110 #define TV_REFRESH_TIMER 1 108 111 #define TV_EDIT_TIMER 2 112 #define TV_ISEARCH_TIMER 3 113 109 114 #define TV_REFRESH_TIMER_SET 1 110 #define TV_EDIT_TIMER_SET 2 115 #define TV_EDIT_TIMER_SET 2 116 #define TV_ISEARCH_TIMER_SET 3 111 117 112 118 -
TabularUnified tags/trunk/src/comctl32/comctl32.c ¶
r13362 r13400 1 /* $Id: comctl32.c,v 1.1 4 2000-02-14 17:31:39cbratschi Exp $ */1 /* $Id: comctl32.c,v 1.15 2000-02-18 17:13:37 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 common controls implementation … … 225 225 LPINT lpMenuId; 226 226 227 // TRACE (commctrl, "%x, %x, %p\n", hwnd, uFlags, lpInfo);228 229 227 dprintf(("COMCTL32: ShowHideMenuCtl")); 230 228 … … 287 285 INT *lpRun; 288 286 HWND hwndCtrl; 289 290 // TRACE (commctrl, "(0x%08lx 0x%08lx 0x%08lx)\n",291 // (DWORD)hwnd, (DWORD)lpRect, (DWORD)lpInfo);292 287 293 288 dprintf(("COMCTL32: GetEffectiveClientRect")); … … 823 818 COMCTL32_DllGetVersion (DLLVERSIONINFO *pdvi) 824 819 { 820 dprintf(("COMCTL32: COMCTL32_DllGetVersion")); 821 825 822 if (pdvi->cbSize != sizeof(DLLVERSIONINFO)) { 826 823 // WARN (commctrl, "wrong DLLVERSIONINFO size from app"); … … 888 885 { 889 886 DWORD flags = 0; 890 int i; 891 BOOL cancel = 0, hover = 0, leave = 0, query = 0; 892 if (ptme->cbSize != sizeof(TRACKMOUSEEVENT)) { 887 int i; 888 BOOL cancel = 0, hover = 0, leave = 0, query = 0; 889 890 dprintf(("COMCTL32: _TrackMouseEvent")); 891 892 if (ptme->cbSize != sizeof(TRACKMOUSEEVENT)) { 893 893 //WARN("wrong TRACKMOUSEEVENT size from app"); 894 894 return E_INVALIDARG; 895 895 } 896 896 897 //TRACE("%lx, %lx, %x, %lx\n", ptme->cbSize, ptme->dwFlags, ptme->hwndTrack, ptme->dwHoverTime); 898 899 flags = ptme->dwFlags; 897 flags = ptme->dwFlags; 900 898 if ( flags & TME_CANCEL ) { 901 899 cancel = 1; -
TabularUnified tags/trunk/src/comctl32/comctl32.h ¶
r12710 r13400 1 /* $Id: comctl32.h,v 1.1 1 1999-12-18 20:56:58 achimhaExp $ */1 /* $Id: comctl32.h,v 1.12 2000-02-18 17:13:37 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 common controls implementation … … 23 23 #include "unicode.h" 24 24 #include "wineuni.h" 25 26 #define TRACE(x)27 #define FIXME(x)28 #define WARN(x)29 25 30 26 #define _OS2WIN_H … … 99 95 #define IDD_MCMONTHMENU 300 100 96 101 #define IDM_JAN 102 #define IDM_FEB 103 #define IDM_MAR 104 #define IDM_APR 105 #define IDM_MAY 106 #define IDM_JUN 107 #define IDM_JUL 108 #define IDM_AUG 109 #define IDM_SEP 110 #define IDM_OCT 111 #define IDM_NOV 112 #define IDM_DEC 97 #define IDM_JAN 301 98 #define IDM_FEB 302 99 #define IDM_MAR 303 100 #define IDM_APR 304 101 #define IDM_MAY 305 102 #define IDM_JUN 306 103 #define IDM_JUL 307 104 #define IDM_AUG 308 105 #define IDM_SEP 309 106 #define IDM_OCT 310 107 #define IDM_NOV 311 108 #define IDM_DEC 312 113 109 114 110 /* treeview checkboxes */ -
TabularUnified tags/trunk/src/comctl32/comctl32undoc.c ¶
r13215 r13400 1 /* $Id: comctl32undoc.c,v 1.1 7 2000-02-04 17:02:06cbratschi Exp $ */1 /* $Id: comctl32undoc.c,v 1.18 2000-02-18 17:13:37 cbratschi Exp $ */ 2 2 /* 3 3 * Undocumented functions from COMCTL32.DLL … … 59 59 #endif 60 60 61 // TRACE (commctrl, "(%p %p %08lx %p %p %08lx): stub!\n", 62 // hdpa1, hdpa2, dwFlags, pfnCompare, pfnParam5, lParam);61 62 dprintf(("COMCTL32: DPA_Merge")); 63 63 64 64 if (IsBadWritePtr (hdpa1, sizeof(DPA))) … … 175 175 LPVOID lpPtr; 176 176 177 dprintf2(("COMCTL32: COMCTL32_Alloc")); 178 177 179 lpPtr = HeapAlloc (COMCTL32_hHeap, HEAP_ZERO_MEMORY, dwSize); 178 180 … … 203 205 { 204 206 LPVOID lpDest; 207 208 dprintf2(("COMCTL32: COMCTL32_ReAlloc")); 205 209 206 210 if (lpSrc) … … 228 232 BOOL WINAPI COMCTL32_Free (LPVOID lpMem) 229 233 { 234 dprintf2(("COMCTL32: COMCTL32_Free")); 235 230 236 return HeapFree (COMCTL32_hHeap, 0, lpMem); 231 237 } … … 248 254 DWORD WINAPI COMCTL32_GetSize (LPVOID lpMem) 249 255 { 256 dprintf2(("COMCTL32: COMCTL32_GetSize")); 250 257 251 258 return HeapSize (COMCTL32_hHeap, 0, lpMem); … … 313 320 CreateMRUListA (LPCREATEMRULIST lpcml) 314 321 { 322 dprintf(("COMCTL32: CreateMRUListA")); 323 315 324 return CreateMRUListLazyA (lpcml, 0, 0, 0); 316 325 } … … 326 335 FreeMRUListA (HANDLE hMRUList) 327 336 { 337 dprintf(("COMCTL32: FreeMRUListA")); 328 338 //FIXME("(%08x) empty stub!\n", hMRUList); 329 339 … … 363 373 AddMRUData (HANDLE hList, LPCVOID lpData, DWORD cbData) 364 374 { 365 //FIXME("(%08x, %p, %ld) empty stub!\n", hList, lpData, cbData);375 dprintf(("COMCTL32: AddMRUData - empty stub!")); 366 376 367 377 return 0; … … 386 396 AddMRUStringA(HANDLE hList, LPCSTR lpszString) 387 397 { 388 //FIXME("(%08x, %s) empty stub!\n", hList, debugstr_a(lpszString));398 dprintf(("COMCTL32: AddMRUStringA - empty stub!")); 389 399 390 400 return 0; … … 406 416 DelMRUString(HANDLE hList, INT nItemPos) 407 417 { 408 //FIXME("(%08x, %d): stub\n", hList, nItemPos); 418 dprintf(("COMCTL32: DelMRUString - empty stub!")); 419 409 420 return TRUE; 410 421 } … … 429 440 FindMRUData (HANDLE hList, LPCVOID lpData, DWORD cbData, LPINT lpRegNum) 430 441 { 431 //FIXME("(%08x, %p, %ld, %p) empty stub!\n", 432 // hList, lpData, cbData, lpRegNum); 442 dprintf(("COMCTL32: FindMRUData - empty stub!")); 433 443 434 444 return 0; … … 453 463 FindMRUStringA (HANDLE hList, LPCSTR lpszString, LPINT lpRegNum) 454 464 { 455 //FIXME("(%08x, %s, %p) empty stub!\n", hList, debugstr_a(lpszString), 456 // lpRegNum); 465 dprintf(("COMCTL32: FindMRUStringA - empty stub!")); 457 466 458 467 return 0; … … 474 483 LPVOID ptr; 475 484 476 //FIXME("(%p) empty stub!\n", lpcml);485 dprintf(("COMCTL32: CreateMRUListLazyA - empty stub!")); 477 486 478 487 if (lpcml == NULL) … … 515 524 DWORD nBufferSize) 516 525 { 517 //FIXME("(%08x, %d, %p, %ld): stub\n", hList, nItemPos, lpBuffer,518 // nBufferSize); 526 dprintf(("COMCTL32: EnumMRUListA - empty stub!")); 527 519 528 return 0; 520 529 } … … 538 547 INT len; 539 548 540 // TRACE (commctrl, "(%p %p %d)\n", lpSrc, lpDest, nMaxLen);549 dprintf(("COMCTL32: Str_GetPtrA")); 541 550 542 551 if (!lpDest && lpSrc) … … 575 584 Str_SetPtrA (LPSTR *lppDest, LPCSTR lpSrc) 576 585 { 577 // TRACE (commctrl, "(%p %p)\n", lppDest, lpSrc);586 dprintf(("COMCTL32: Str_SetPtrA")); 578 587 579 588 if (lpSrc) { … … 611 620 INT len; 612 621 613 // TRACE (commctrl, "(%p %p %d)\n", lpSrc, lpDest, nMaxLen);622 dprintf(("COMCTL32: Str_GetPtrW")); 614 623 615 624 if (!lpDest && lpSrc) … … 648 657 Str_SetPtrW (LPWSTR *lppDest, LPCWSTR lpSrc) 649 658 { 650 // TRACE (commctrl, "(%p %p)\n", lppDest, lpSrc);659 dprintf(("COMCTL32: Str_SetPtrW")); 651 660 652 661 if (lpSrc) { … … 692 701 HDSA hdsa; 693 702 694 // TRACE (commctrl, "(size=%d grow=%d)\n", nSize, nGrow);703 dprintf(("COMCTL32: DSA_Create")); 695 704 696 705 hdsa = (HDSA)COMCTL32_Alloc (sizeof(DSA)); … … 722 731 DSA_Destroy (const HDSA hdsa) 723 732 { 724 // TRACE (commctrl, "(%p)\n", hdsa);733 dprintf(("COMCTL32: DSA_Destroy")); 725 734 726 735 if (!hdsa) … … 752 761 LPVOID pSrc; 753 762 754 // TRACE (commctrl, "(%p %d %p)\n", hdsa, nIndex, pDest);763 dprintf(("COMCTL32: DSA_GetItem")); 755 764 756 765 if (!hdsa) … … 785 794 LPVOID pSrc; 786 795 787 // TRACE (commctrl, "(%p %d)\n", hdsa, nIndex);796 dprintf(("COMCTL32: DSA_GetItemPtr")); 788 797 789 798 if (!hdsa) … … 821 830 LPVOID pDest, lpTemp; 822 831 823 // TRACE("(%p %d %p)\n", hdsa, nIndex, pSrc);832 dprintf(("COMCTL32: DSA_SetItem")); 824 833 825 834 if ((!hdsa) || nIndex < 0) … … 878 887 LPDWORD p; 879 888 880 // TRACE("(%p %d %p)\n", hdsa, nIndex, pSrc);889 dprintf(("COMCTL32: DSA_InsertItem")); 881 890 882 891 if ((!hdsa) || nIndex < 0) … … 947 956 INT nSize; 948 957 949 // TRACE (commctrl, "(%p %d)\n", hdsa, nIndex);958 dprintf(("COMCTL32: DSA_DeleteItem")); 950 959 951 960 if (!hdsa) … … 998 1007 DSA_DeleteAllItems (const HDSA hdsa) 999 1008 { 1000 // TRACE (commctrl, "(%p)\n", hdsa);1009 dprintf(("COMCTL32: DSA_DeleteAllItems")); 1001 1010 1002 1011 if (!hdsa) … … 1034 1043 HDPA hdpa; 1035 1044 1036 // TRACE (commctrl, "(%d)\n", nGrow);1045 dprintf(("COMCTL32: DPA_Create")); 1037 1046 1038 1047 hdpa = (HDPA)COMCTL32_Alloc (sizeof(DPA)); … … 1065 1074 DPA_Destroy (const HDPA hdpa) 1066 1075 { 1067 // TRACE (commctrl, "(%p)\n", hdpa);1076 dprintf(("COMCTL32: DPA_Destroy")); 1068 1077 1069 1078 if (!hdpa) … … 1094 1103 DPA_Grow (const HDPA hdpa, INT nGrow) 1095 1104 { 1096 // TRACE (commctrl, "(%p %d)\n", hdpa, nGrow);1105 dprintf(("COMCTL32: DPA_Grow")); 1097 1106 1098 1107 if (!hdpa) … … 1131 1140 HDPA hdpaTemp; 1132 1141 1142 dprintf(("COMCTL32: DPA_Clone")); 1143 1133 1144 if (!hdpa) 1134 1145 return NULL; 1135 1136 // TRACE (commctrl, "(%p %p)\n", hdpa, hdpaNew);1137 1146 1138 1147 if (!hdpaNew) { … … 1188 1197 DPA_GetPtr (const HDPA hdpa, INT i) 1189 1198 { 1190 // TRACE (commctrl, "(%p %d)\n", hdpa, i);1199 dprintf(("COMCTL32: DPA_GetPtr")); 1191 1200 1192 1201 if (!hdpa) … … 1222 1231 INT i; 1223 1232 1233 dprintf(("COMCTL32: DPA_GetPtrIndex")); 1234 1224 1235 if (!hdpa->ptrs) 1225 1236 return -1; … … 1255 1266 LPVOID *lpTemp, *lpDest; 1256 1267 1257 // TRACE (commctrl, "(%p %d %p)\n", hdpa, i, p);1268 dprintf(("COMCTL32: DPA_InsertPtr")); 1258 1269 1259 1270 if ((!hdpa) || (i < 0)) … … 1327 1338 LPVOID *lpTemp; 1328 1339 1329 // TRACE (commctrl, "(%p %d %p)\n", hdpa, i, p);1340 dprintf(("COMCTL32: DPA_SetPtr")); 1330 1341 1331 1342 if ((!hdpa) || i < 0) … … 1381 1392 INT nSize; 1382 1393 1383 // TRACE (commctrl, "(%p %d)\n", hdpa, i);1394 dprintf(("COMCTL32: DPA_DeletePtr")); 1384 1395 1385 1396 if ((!hdpa) || i < 0 || i >= hdpa->nItemCount) … … 1434 1445 DPA_DeleteAllPtrs (const HDPA hdpa) 1435 1446 { 1436 // TRACE (commctrl, "(%p)\n", hdpa);1447 dprintf(("COMCTL32: DPA_DeleteAllPtrs")); 1437 1448 1438 1449 if (!hdpa) … … 1512 1523 DPA_Sort (const HDPA hdpa, PFNDPACOMPARE pfnCompare, LPARAM lParam) 1513 1524 { 1525 dprintf(("COMCTL32: DPA_Sort")); 1526 1514 1527 if (!hdpa || !pfnCompare) 1515 1528 return FALSE; 1516 1517 // TRACE (commctrl, "(%p %p 0x%lx)\n", hdpa, pfnCompare, lParam);1518 1529 1519 1530 if ((hdpa->nItemCount > 1) && (hdpa->ptrs)) … … 1552 1563 PFNDPACOMPARE pfnCompare, LPARAM lParam, UINT uOptions) 1553 1564 { 1565 dprintf(("COMCTL32: DPA_Search")); 1566 1554 1567 if (!hdpa || !pfnCompare || !pFind) 1555 1568 return -1; 1556 1557 // TRACE (commctrl, "(%p %p %d %p 0x%08lx 0x%08x)\n",1558 // hdpa, pFind, nStart, pfnCompare, lParam, uOptions);1559 1569 1560 1570 if (uOptions & DPAS_SORTED) { … … 1632 1642 HDPA hdpa; 1633 1643 1634 // TRACE (commctrl, "(%d 0x%x)\n", nGrow, hHeap);1644 dprintf(("COMCTL32: DPA_CreateEx")); 1635 1645 1636 1646 if (hHeap) … … 1731 1741 NOTIFYDATA notify; 1732 1742 1733 // TRACE (commctrl, "(0x%04x 0x%04x %d %p)\n", 1734 // hwndFrom, hwndTo, uCode, lpHdr); 1743 dprintf(("COMCTL32: SendNotify")); 1735 1744 1736 1745 notify.hwndFrom = hwndFrom; … … 1765 1774 HWND hwndNotify; 1766 1775 1767 // TRACE (commctrl, "(0x%04x 0x%04x %d %p 0x%08lx)\n", 1768 // hwndFrom, hwndTo, uCode, lpHdr, dwParam5); 1776 dprintf(("COMCTL32: SendNotifyEx")); 1769 1777 1770 1778 hwndNotify = hwndTo; … … 1794 1802 COMCTL32_StrChrA (LPCSTR lpString, CHAR cChar) 1795 1803 { 1804 dprintf(("COMCTL32: StrChrA")); 1805 1796 1806 return strchr (lpString, cChar); 1797 1807 } … … 1807 1817 INT len1, len2, i; 1808 1818 CHAR first; 1819 1820 dprintf(("COMCTL32: StrStrIA")); 1809 1821 1810 1822 if (*lpStr2 == 0) … … 1838 1850 COMCTL32_StrToIntA (LPSTR lpString) 1839 1851 { 1852 dprintf(("COMCTL32: StrToIntA")); 1853 1840 1854 return atoi(lpString); 1841 1855 } … … 1861 1875 INT i; 1862 1876 1863 // TRACE (commctrl, "(%p %p %08lx)\n", hdpa, enumProc, lParam);1877 dprintf(("COMCTL32: DPA_EnumCallback")); 1864 1878 1865 1879 if (!hdpa) … … 1895 1909 DPA_DestroyCallback (const HDPA hdpa, DPAENUMPROC enumProc, LPARAM lParam) 1896 1910 { 1897 // TRACE (commctrl, "(%p %p %08lx)\n", hdpa, enumProc, lParam);1911 dprintf(("COMCTL32: DPA_DestroyCallback")); 1898 1912 1899 1913 DPA_EnumCallback (hdpa, enumProc, lParam); … … 1922 1936 INT i; 1923 1937 1924 // TRACE (commctrl, "(%p %p %08lx)\n", hdsa, enumProc, lParam);1938 dprintf(("COMCTL32: DSA_EnumCallback")); 1925 1939 1926 1940 if (!hdsa) … … 1957 1971 DSA_DestroyCallback (const HDSA hdsa, DSAENUMPROC enumProc, LPARAM lParam) 1958 1972 { 1959 // TRACE (commctrl, "(%p %p %08lx)\n", hdsa, enumProc, lParam);1973 dprintf(("COMCTL32: DSA_DestroyCallback")); 1960 1974 1961 1975 DSA_EnumCallback (hdsa, enumProc, lParam); … … 1968 1982 * 1969 1983 */ 1970 INT WINAPI COMCTL32_StrCSpnA( LPCSTR lpStr, LPCSTR lpSet) { 1984 INT WINAPI COMCTL32_StrCSpnA( LPCSTR lpStr, LPCSTR lpSet) 1985 { 1986 dprintf(("COMCTL32: StrCSpnA")); 1987 1971 1988 return strcspn(lpStr, lpSet); 1972 1989 } … … 1976 1993 * 1977 1994 */ 1978 LPWSTR WINAPI COMCTL32_StrChrW( LPCWSTR lpStart, WORD wMatch) { 1995 LPWSTR WINAPI COMCTL32_StrChrW( LPCWSTR lpStart, WORD wMatch) 1996 { 1997 dprintf(("COMCTL32: StrChrW")); 1998 1979 1999 return (unsigned short*)wcschr(lpStart, wMatch); 1980 2000 } … … 1984 2004 * 1985 2005 */ 1986 INT WINAPI COMCTL32_StrCmpNA( LPCSTR lpStr1, LPCSTR lpStr2, int nChar) { 2006 INT WINAPI COMCTL32_StrCmpNA( LPCSTR lpStr1, LPCSTR lpStr2, int nChar) 2007 { 2008 dprintf(("COMCTL32: StrCmpNA")); 2009 1987 2010 return strncmp(lpStr1, lpStr2, nChar); 1988 2011 } … … 1992 2015 * 1993 2016 */ 1994 INT WINAPI COMCTL32_StrCmpNIA( LPCSTR lpStr1, LPCSTR lpStr2, int nChar) { 2017 INT WINAPI COMCTL32_StrCmpNIA( LPCSTR lpStr1, LPCSTR lpStr2, int nChar) 2018 { 1995 2019 //AH: Inline helper function from WINE 1996 2020 int res; 2021 2022 dprintf(("COMCTL32: StrCmpNIA")); 2023 1997 2024 if (!nChar) return 0; 1998 2025 while ((--nChar > 0) && *lpStr1) … … 2005 2032 * 2006 2033 */ 2007 INT WINAPI COMCTL32_StrCmpNW( LPCWSTR lpStr1, LPCWSTR lpStr2, int nChar) { 2034 INT WINAPI COMCTL32_StrCmpNW( LPCWSTR lpStr1, LPCWSTR lpStr2, int nChar) 2035 { 2036 dprintf(("COMCTL32: StrCmpNW")); 2037 2008 2038 return wcsncmp(lpStr1, lpStr2, nChar); 2009 2039 } … … 2013 2043 * 2014 2044 */ 2015 INT WINAPI COMCTL32_StrCmpNIW( LPCWSTR lpStr1, LPCWSTR lpStr2, int nChar) {2016 // FIXME("(%s, %s, %i): stub\n", debugstr_w(lpStr1), debugstr_w(lpStr2), nChar); 2045 INT WINAPI COMCTL32_StrCmpNIW( LPCWSTR lpStr1, LPCWSTR lpStr2, int nChar) 2046 { 2017 2047 dprintf(("COMCTL32: StrCmpNIW - unimplemented stub\n")); 2048 2018 2049 return 0; 2019 2050 } … … 2037 2068 * 2038 2069 */ 2039 LPSTR WINAPI COMCTL32_StrRChrA( LPCSTR lpStart, LPCSTR lpEnd, WORD wMatch) { 2070 LPSTR WINAPI COMCTL32_StrRChrA( LPCSTR lpStart, LPCSTR lpEnd, WORD wMatch) 2071 { 2040 2072 LPCSTR lpGotIt = NULL; 2073 2074 dprintf(("COMCTL32: StrRChrA")); 2041 2075 2042 2076 if (!lpEnd) lpEnd = lpStart + strlen(lpStart); … … 2068 2102 LPCWSTR lpGotIt = NULL; 2069 2103 2104 dprintf(("COMCTL32: StrRChrW")); 2105 2070 2106 if (!lpEnd) lpEnd = lpStart + lstrlenW(lpStart); 2071 2107 … … 2082 2118 * 2083 2119 */ 2084 LPSTR WINAPI COMCTL32_StrStrA( LPCSTR lpFirst, LPCSTR lpSrch) { 2120 LPSTR WINAPI COMCTL32_StrStrA( LPCSTR lpFirst, LPCSTR lpSrch) 2121 { 2122 dprintf(("COMCTL32: StrStrA")); 2123 2085 2124 return strstr(lpFirst, lpSrch); 2086 2125 } … … 2090 2129 * 2091 2130 */ 2092 LPWSTR WINAPI COMCTL32_StrStrW( LPCWSTR lpFirst, LPCWSTR lpSrch) { 2131 LPWSTR WINAPI COMCTL32_StrStrW( LPCWSTR lpFirst, LPCWSTR lpSrch) 2132 { 2133 dprintf(("COMCTL32: StrStrW")); 2134 2093 2135 return (unsigned short*)wcsstr(lpFirst, lpSrch); 2094 2136 } … … 2098 2140 * 2099 2141 */ 2100 INT WINAPI COMCTL32_StrSpnW( LPWSTR lpStr, LPWSTR lpSet) { 2142 INT WINAPI COMCTL32_StrSpnW( LPWSTR lpStr, LPWSTR lpSet) 2143 { 2101 2144 LPWSTR lpLoop = lpStr; 2145 2146 dprintf(("COMCTL32: StrSpnW")); 2102 2147 2103 2148 /* validate ptr */ … … 2120 2165 */ 2121 2166 2122 BOOL WINAPI comctl32_410( HWND hw, DWORD b, DWORD c, DWORD d) {2123 2124 //FIXME("(%x, %lx, %lx, %lx): stub!\n", hw, b, c, d);2167 BOOL WINAPI comctl32_410( HWND hw, DWORD b, DWORD c, DWORD d) 2168 { 2169 dprintf(("COMCTL32: comctl32_410 - empty stub!")); 2125 2170 2126 2171 return TRUE; … … 2134 2179 */ 2135 2180 2136 BOOL WINAPI comctl32_411( HWND hw, DWORD b, DWORD c) {2137 2138 //FIXME("(%x, %lx, %lx): stub!\n", hw, b, c);2181 BOOL WINAPI comctl32_411( HWND hw, DWORD b, DWORD c) 2182 { 2183 dprintf(("COMCTL32: comctl32_411 - empty stub!")); 2139 2184 2140 2185 return TRUE; … … 2150 2195 BOOL WINAPI comctl32_412( HWND hwnd, DWORD b, DWORD c) 2151 2196 { 2152 //FIXME("(%x, %lx, %lx): stub!\n", hwnd, b, c);2197 dprintf(("COMCTL32: comctl32_412 - empty stub!")); 2153 2198 2154 2199 if (IsWindow (hwnd) == FALSE) … … 2169 2214 */ 2170 2215 2171 BOOL WINAPI comctl32_413( HWND hw, DWORD b, DWORD c, DWORD d) {2172 2173 //FIXME("(%x, %lx, %lx, %lx): stub!\n", hw, b, c, d);2216 BOOL WINAPI comctl32_413( HWND hw, DWORD b, DWORD c, DWORD d) 2217 { 2218 dprintf(("COMCTL32: comctl32_413 - empty stub!")); 2174 2219 2175 2220 return TRUE; … … 2183 2228 */ 2184 2229 2185 BOOL WINAPI InitMUILanguage( LANGID uiLang) {2186 2187 //FIXME("(%04x): stub!\n", uiLang);2230 BOOL WINAPI InitMUILanguage( LANGID uiLang) 2231 { 2232 dprintf(("COMCTL32: InitMUILanguage - empty stub!")); 2188 2233 2189 2234 return TRUE; -
TabularUnified tags/trunk/src/comctl32/draglist.c ¶
r13320 r13400 16 16 17 17 #include "commctrl.h" 18 #include <misc.h> 18 19 19 20 static DWORD dwLastScrollTime = 0; … … 22 23 BOOL WINAPI MakeDragList (HWND hwndLB) 23 24 { 24 //FIXME("(0x%x)\n", hwndLB); 25 25 dprintf(("COMCTL32: MakeDragList - empty stub!")); 26 26 27 27 return FALSE; … … 31 31 VOID WINAPI DrawInsert (HWND hwndParent, HWND hwndLB, INT nItem) 32 32 { 33 //FIXME("(0x%x 0x%x %d)\n", hwndParent, hwndLB, nItem); 34 35 33 dprintf(("COMCTL32: DrawInsert - empty stub!")); 36 34 } 37 35 … … 43 41 DWORD dwScrollTime; 44 42 45 //FIXME("(0x%x %ld x %ld %s)\n", 46 // hwndLB, pt.x, pt.y, bAutoScroll ? "TRUE" : "FALSE"); 43 dprintf(("COMCTL32: LBItemFromPt")); 47 44 48 45 ScreenToClient (hwndLB, &pt); -
TabularUnified tags/trunk/src/comctl32/imagelist.c ¶
r13215 r13400 1 /* $Id: imagelist.c,v 1.1 1 2000-02-04 17:02:07 cbratschi Exp $ */1 /* $Id: imagelist.c,v 1.12 2000-02-18 17:13:37 cbratschi Exp $ */ 2 2 /* 3 3 * ImageList implementation … … 458 458 HBITMAP hOldBitmapImage, hOldBitmap; 459 459 460 dprintf(("COMCTL32: ImageList_Add")); 461 460 462 if (!himl || !hbmImage) 461 463 return -1; … … 539 541 ImageList_AddIcon (HIMAGELIST himl, HICON hIcon) 540 542 { 543 dprintf(("COMCTL32: ImageList_AddIcon")); 544 541 545 return ImageList_ReplaceIcon (himl, -1, hIcon); 542 546 } … … 568 572 HBITMAP hMaskBitmap=0; 569 573 COLORREF bkColor; 574 575 dprintf(("COMCTL32: ImageList_AddMasked")); 570 576 571 577 if (himl == NULL) … … 680 686 HDC hdcSrc, hdcDst; 681 687 682 // FIXME(imagelist, "partially implemented!\n");688 dprintf(("COMCTL32: ImageList_BeginDrag - partial implemented")); 683 689 684 690 if (himlTrack == NULL) … … 752 758 HDC hdcSrc, hdcDst; 753 759 754 // TRACE(imagelist, "iDst=%d iSrc=%d\n", iDst, iSrc);760 dprintf(("COMCTL32: ImageList_Copy")); 755 761 756 762 if ((himlSrc == NULL) || (himlDst == NULL)) … … 880 886 {0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA}; 881 887 882 // TRACE (imagelist, "(%d %d 0x%x %d %d)\n", cx, cy, flags, cInitial, cGrow);888 dprintf(("COMCTL32: ImageList_Create")); 883 889 884 890 himl = (HIMAGELIST)COMCTL32_Alloc (sizeof(struct _IMAGELIST)); … … 960 966 ImageList_Destroy (HIMAGELIST himl) 961 967 { 968 dprintf(("COMCTL32: ImageList_Destroy")); 969 962 970 if (!himl) 963 971 return FALSE; … … 1003 1011 ImageList_DragEnter (HWND hwndLock, INT x, INT y) 1004 1012 { 1013 dprintf(("COMCTL32: ImageList_DragEnter")); 1014 1005 1015 if (himlInternalDrag == NULL) 1006 1016 return FALSE; … … 1040 1050 ImageList_DragLeave (HWND hwndLock) 1041 1051 { 1052 dprintf(("COMCTL32: ImageList_DragLeave")); 1053 1042 1054 if (hwndLock) 1043 1055 hwndInternalDrag = hwndLock; … … 1075 1087 ImageList_DragMove (INT x, INT y) 1076 1088 { 1089 dprintf(("COMCTL32: ImageList_DragMove")); 1090 1077 1091 ImageList_DragShowNolock (FALSE); 1078 1092 … … 1107 1121 HDC hdcDrag; 1108 1122 1109 // FIXME (imagelist, "semi-stub!\n"); 1110 // TRACE (imagelist, "bShow=0x%X!\n", bShow); 1123 dprintf(("COMCTL32: ImageList_DragShowNolock - semi-stub!")); 1111 1124 1112 1125 hdcDrag = GetDCEx (hwndInternalDrag, 0, … … 1161 1174 { 1162 1175 IMAGELISTDRAWPARAMS imldp; 1176 1177 dprintf(("COMCTL32: ImageList_Draw")); 1163 1178 1164 1179 imldp.cbSize = sizeof(IMAGELISTDRAWPARAMS); … … 1216 1231 IMAGELISTDRAWPARAMS imldp; 1217 1232 1233 dprintf(("COMCTL32: ImageList_DrawEx")); 1234 1218 1235 imldp.cbSize = sizeof(IMAGELISTDRAWPARAMS); 1219 1236 imldp.himl = himl; … … 1252 1269 { 1253 1270 INT cx, cy; 1271 1272 dprintf(("COMCTL32: ImageList_DrawIndirect")); 1273 1254 1274 /* 1255 1275 Do some Error Checking … … 1316 1336 HDC hdcSrc, hdcDst; 1317 1337 1338 dprintf(("COMCTL32: ImageList_Duplicate")); 1339 1318 1340 if (himlSrc == NULL) { 1319 1341 // ERR (imagelist, "Invalid image list handle!\n"); … … 1344 1366 DeleteDC (hdcSrc); 1345 1367 1346 1347 1368 himlDst->cCurImage = himlSrc->cCurImage; 1369 himlDst->cMaxImage = himlSrc->cMaxImage; 1348 1370 } 1349 1371 … … 1371 1393 ImageList_EndDrag (VOID) 1372 1394 { 1373 // FIXME (imagelist, "semi-stub!\n");1395 dprintf(("COMCTL32: ImageList_EndDrag - semi-stub")); 1374 1396 1375 1397 if (himlInternalDrag) … … 1404 1426 ImageList_GetBkColor (HIMAGELIST himl) 1405 1427 { 1428 dprintf(("COMCTL32: ImageList_GetBkColor")); 1429 1406 1430 if (himl == NULL) 1407 1431 return CLR_NONE; … … 1431 1455 ImageList_GetDragImage (POINT *ppt, POINT *pptHotspot) 1432 1456 { 1433 // FIXME (imagelist, "semi-stub!\n");1457 dprintf(("COMCTL32: ImageList_GetDragImage - semi-stub!")); 1434 1458 1435 1459 if (himlInternalDrag) … … 1462 1486 HBITMAP hOldSrcBitmap,hOldDstBitmap; 1463 1487 HDC hdcSrc, hdcDst; 1488 1489 dprintf(("COMCTL32: ImageList_GetIcon")); 1464 1490 1465 1491 if ((himl == NULL) || (i < 0) || (i >= himl->cCurImage)) … … 1528 1554 ImageList_GetIconSize (HIMAGELIST himl, INT *cx, INT *cy) 1529 1555 { 1556 dprintf(("COMCTL32: ImageList_GetIconSize")); 1557 1530 1558 if (himl == NULL) 1531 1559 return FALSE; … … 1558 1586 ImageList_GetImageCount (HIMAGELIST himl) 1559 1587 { 1588 dprintf(("COMCTL32: ImageList_GetImageCount")); 1589 1560 1590 if (himl == NULL) 1561 1591 return 0; … … 1583 1613 ImageList_GetImageInfo (HIMAGELIST himl, INT i, IMAGEINFO *pImageInfo) 1584 1614 { 1615 dprintf(("COMCTL32: ImageList_GetImageInfo")); 1616 1585 1617 if ((himl == NULL) || (pImageInfo == NULL)) 1586 1618 return FALSE; … … 1621 1653 ImageList_GetImageRect (HIMAGELIST himl, INT i, LPRECT lpRect) 1622 1654 { 1655 dprintf(("COMCTL32: ImageList_GetImageRect")); 1656 1623 1657 if ((himl == NULL) || (lpRect == NULL)) 1624 1658 return FALSE; … … 1664 1698 HANDLE handle; 1665 1699 INT nImageCount; 1700 1701 dprintf(("COMCTL32: ImageList_LoadImageA")); 1666 1702 1667 1703 handle = LoadImageA (hi, lpbmp, uType, 0, 0, uFlags); … … 1742 1778 INT nImageCount; 1743 1779 1780 dprintf(("COMCTL32: ImageList_LoadImageW")); 1781 1744 1782 handle = LoadImageW (hi, lpbmp, uType, 0, 0, uFlags); 1745 1783 if (!handle) { … … 1805 1843 INT nX1, nX2; 1806 1844 1845 dprintf(("COMCTL32: ImageList_Merge")); 1846 1807 1847 if ((himl1 == NULL) || (himl2 == NULL)) 1808 1848 return NULL; … … 1899 1939 int bitspixel = GetDeviceCaps(hdc,BITSPIXEL)*GetDeviceCaps(hdc,PLANES); 1900 1940 if (bitspixel>8) 1901 1941 return TRUE; 1902 1942 if (bitspixel<=4) 1903 1943 return FALSE; 1904 1944 return GetDeviceCaps(hdc,94) & 0x10; 1905 1945 } … … 1907 1947 /* helper for ImageList_Read, see comments below */ 1908 1948 static HBITMAP _read_bitmap(LPSTREAM pstm,int ilcFlag,int cx,int cy) { 1909 HDC 1910 BITMAPFILEHEADER 1911 BITMAPINFOHEADER 1912 int 1913 LPBITMAPINFOHEADER 1914 int 1915 HBITMAP 1916 LPBYTE 1917 int 1918 1919 if (!SUCCEEDED(IStream_Read ( pstm, &bmfh, sizeof(bmfh), NULL)) 1920 (bmfh.bfType != (('M'<<8)|'B'))||1921 !SUCCEEDED(IStream_Read ( pstm, &bmih, sizeof(bmih), NULL))||1922 1949 HDC xdc = 0; 1950 BITMAPFILEHEADER bmfh; 1951 BITMAPINFOHEADER bmih; 1952 int bitsperpixel,palspace,longsperline,width,height; 1953 LPBITMAPINFOHEADER bmihc = NULL; 1954 int result = 0; 1955 HBITMAP hbitmap = 0; 1956 LPBYTE bits = NULL,nbits = NULL; 1957 int nbytesperline,bytesperline; 1958 1959 if (!SUCCEEDED(IStream_Read ( pstm, &bmfh, sizeof(bmfh), NULL)) || 1960 (bmfh.bfType != (('M'<<8)|'B')) || 1961 !SUCCEEDED(IStream_Read ( pstm, &bmih, sizeof(bmih), NULL)) || 1962 (bmih.biSize != sizeof(bmih)) 1923 1963 ) 1924 1964 return 0; 1925 1965 1926 1966 bitsperpixel = bmih.biPlanes * bmih.biBitCount; 1927 1967 if (bitsperpixel<=8) 1928 1968 palspace = (1<<bitsperpixel)*sizeof(RGBQUAD); 1929 1969 else 1930 1970 palspace = 0; 1931 1971 width = bmih.biWidth; 1932 1972 height = bmih.biHeight; 1933 1973 bmihc = (LPBITMAPINFOHEADER)LocalAlloc(LMEM_ZEROINIT,sizeof(bmih)+palspace); 1934 1974 memcpy(bmihc,&bmih,sizeof(bmih)); 1935 longsperline 1936 bmihc->biSizeImage 1975 longsperline = ((width*bitsperpixel+31)&~0x1f)>>5; 1976 bmihc->biSizeImage = (longsperline*height)<<2; 1937 1977 1938 1978 /* read the palette right after the end of the bitmapinfoheader */ 1939 1979 if (palspace) 1940 1941 1980 if (!SUCCEEDED(IStream_Read ( pstm, bmihc+1, palspace, NULL))) 1981 goto ret1; 1942 1982 1943 1983 xdc = GetDC(0); 1944 1984 #if 0 /* Magic for NxM -> 1x(N*M) not implemented for DIB Sections */ 1945 1985 if ((bitsperpixel>1) && 1946 1986 ((ilcFlag!=ILC_COLORDDB) && (!ilcFlag || may_use_dibsection(xdc))) 1947 1987 ) { 1948 1949 1950 1951 1952 1953 1988 hbitmap = CreateDIBSection(xdc,(BITMAPINFO*)bmihc,0,(LPVOID*)&bits,0,0); 1989 if (!hbitmap) 1990 goto ret1; 1991 if (!SUCCEEDED(IStream_Read( pstm, bits, bmihc->biSizeImage, NULL))) 1992 goto ret1; 1993 result = 1; 1954 1994 } else 1955 1995 #endif 1956 1996 { 1957 1958 1959 nwidth= width*(height/cy);1960 nheight= cy;1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 bytesperline= longsperline*4;1976 nbytesperline= (height/cy)*bytesperline;1977 1978 1979 1980 1981 1982 1983 1984 bmihc->biWidth= nwidth;1985 bmihc->biHeight= nheight;1986 1987 1988 1989 1990 1997 int i,nwidth,nheight; 1998 1999 nwidth = width*(height/cy); 2000 nheight = cy; 2001 2002 if (bitsperpixel==1) 2003 hbitmap = CreateBitmap(nwidth,nheight,1,1,NULL); 2004 else 2005 hbitmap = CreateCompatibleBitmap(xdc,nwidth,nheight); 2006 2007 /* Might be a bit excessive memory use here */ 2008 bits = (LPBYTE)LocalAlloc(LMEM_ZEROINIT,bmihc->biSizeImage); 2009 nbits = (LPBYTE)LocalAlloc(LMEM_ZEROINIT,bmihc->biSizeImage); 2010 if (!SUCCEEDED(IStream_Read ( pstm, bits, bmihc->biSizeImage, NULL))) 2011 goto ret1; 2012 2013 /* Copy the NxM bitmap into a 1x(N*M) bitmap we need, linewise */ 2014 /* Do not forget that windows bitmaps are bottom->top */ 2015 bytesperline = longsperline*4; 2016 nbytesperline = (height/cy)*bytesperline; 2017 for (i=0;i<height;i++) { 2018 memcpy( 2019 nbits+((height-i)%cy)*nbytesperline+(i/cy)*bytesperline, 2020 bits+bytesperline*(height-i), 2021 bytesperline 2022 ); 2023 } 2024 bmihc->biWidth = nwidth; 2025 bmihc->biHeight = nheight; 2026 if (!SetDIBits(xdc,hbitmap,0,nheight,nbits,(BITMAPINFO*)bmihc,0)) 2027 goto ret1; 2028 LocalFree((HLOCAL)nbits); 2029 LocalFree((HLOCAL)bits); 2030 result = 1; 1991 2031 } 1992 2032 ret1: 1993 if (xdc) 1994 if (bmihc) 2033 if (xdc) ReleaseDC(0,xdc); 2034 if (bmihc) LocalFree((HLOCAL)bmihc); 1995 2035 if (!result) { 1996 1997 1998 1999 2036 if (hbitmap) { 2037 DeleteObject(hbitmap); 2038 hbitmap = 0; 2039 } 2000 2040 } 2001 2041 return hbitmap; … … 2015 2055 * 2016 2056 * The format is like this: 2017 * ILHEADilheadstruct;2057 * ILHEAD ilheadstruct; 2018 2058 * 2019 2059 * for the color image part: 2020 * BITMAPFILEHEADERbmfh;2021 * BITMAPINFOHEADERbmih;2060 * BITMAPFILEHEADER bmfh; 2061 * BITMAPINFOHEADER bmih; 2022 2062 * only if it has a palette: 2023 * RGBQUADrgbs[nr_of_paletted_colors];2024 * 2025 * BYTEcolorbits[imagesize];2063 * RGBQUAD rgbs[nr_of_paletted_colors]; 2064 * 2065 * BYTE colorbits[imagesize]; 2026 2066 * 2027 2067 * the following only if the ILC_MASK bit is set in ILHEAD.ilFlags: 2028 * BITMAPFILEHEADERbmfh_mask;2029 * BITMAPINFOHEADERbmih_mask;2068 * BITMAPFILEHEADER bmfh_mask; 2069 * BITMAPINFOHEADER bmih_mask; 2030 2070 * only if it has a palette (it usually does not): 2031 * RGBQUADrgbs[nr_of_paletted_colors];2032 * 2033 * BYTEmaskbits[imagesize];2071 * RGBQUAD rgbs[nr_of_paletted_colors]; 2072 * 2073 * BYTE maskbits[imagesize]; 2034 2074 * 2035 2075 * CAVEAT: Those images are within a NxM bitmap, not the 1xN we expect. … … 2038 2078 HIMAGELIST WINAPI ImageList_Read (LPSTREAM pstm) 2039 2079 { 2040 ILHEAD ilHead; 2041 HIMAGELIST himl; 2042 HBITMAP hbmColor=0,hbmMask=0; 2043 int i; 2080 ILHEAD ilHead; 2081 HIMAGELIST himl; 2082 HBITMAP hbmColor=0,hbmMask=0; 2083 int i; 2084 2085 dprintf(("COMCTL32: ImageList_Read")); 2044 2086 2045 2087 if (!SUCCEEDED(IStream_Read (pstm, &ilHead, sizeof(ILHEAD), NULL))) 2046 2088 return NULL; 2047 2089 if (ilHead.usMagic != (('L' << 8) | 'I')) 2048 2090 return NULL; 2049 2091 if (ilHead.usVersion != 0x101) /* probably version? */ 2050 2092 return NULL; 2051 2093 2052 2094 #if 0 2053 FIXME(" 2054 FIXME(" 2055 FIXME(" 2056 FIXME(" 2057 FIXME(" 2058 FIXME(" 2059 FIXME(" 2060 FIXME(" 2061 FIXME(" 2062 FIXME(" 2095 FIXME(" ilHead.cCurImage = %d\n",ilHead.cCurImage); 2096 FIXME(" ilHead.cMaxImage = %d\n",ilHead.cMaxImage); 2097 FIXME(" ilHead.cGrow = %d\n",ilHead.cGrow); 2098 FIXME(" ilHead.cx = %d\n",ilHead.cx); 2099 FIXME(" ilHead.cy = %d\n",ilHead.cy); 2100 FIXME(" ilHead.flags = %x\n",ilHead.flags); 2101 FIXME(" ilHead.ovls[0] = %d\n",ilHead.ovls[0]); 2102 FIXME(" ilHead.ovls[1] = %d\n",ilHead.ovls[1]); 2103 FIXME(" ilHead.ovls[2] = %d\n",ilHead.ovls[2]); 2104 FIXME(" ilHead.ovls[3] = %d\n",ilHead.ovls[3]); 2063 2105 #endif 2064 2106 2065 2107 hbmColor = _read_bitmap(pstm,ilHead.flags & ~ILC_MASK,ilHead.cx,ilHead.cy); 2066 2108 if (!hbmColor) 2067 2109 return NULL; 2068 2110 if (ilHead.flags & ILC_MASK) { 2069 2070 2071 2072 2073 2111 hbmMask = _read_bitmap(pstm,0,ilHead.cx,ilHead.cy); 2112 if (!hbmMask) { 2113 DeleteObject(hbmColor); 2114 return NULL; 2115 } 2074 2116 } 2075 2117 2076 2118 himl = ImageList_Create ( 2077 2078 2079 2080 1,/* initial */2081 2119 ilHead.cx, 2120 ilHead.cy, 2121 ilHead.flags, 2122 1, /* initial */ 2123 ilHead.cGrow 2082 2124 ); 2083 2125 if (!himl) { 2084 2085 2086 2126 DeleteObject(hbmColor); 2127 DeleteObject(hbmMask); 2128 return NULL; 2087 2129 } 2088 2130 himl->hbmImage = hbmColor; … … 2093 2135 ImageList_SetBkColor(himl,ilHead.bkcolor); 2094 2136 for (i=0;i<4;i++) 2095 2137 ImageList_SetOverlayImage(himl,ilHead.ovls[i],i+1); 2096 2138 return himl; 2097 2139 } … … 2116 2158 HDC hdcSrc, hdcDst; 2117 2159 INT cxNew, nCount; 2160 2161 dprintf(("COMCTL32: ImageList_Remove")); 2118 2162 2119 2163 if ((i < -1) || (i >= himl->cCurImage)) { … … 2247 2291 BITMAP bmp; 2248 2292 2293 dprintf(("COMCTL32: ImageList_Replace")); 2294 2249 2295 if (himl == NULL) { 2250 2296 // ERR (imagelist, "Invalid image list handle!\n"); … … 2310 2356 BITMAP bmp; 2311 2357 2312 // TRACE (imagelist, "(0x%lx 0x%x 0x%x)\n", (DWORD)himl, i, hIcon);2358 dprintf(("COMCTL32: ImageList_ReplaceIcon")); 2313 2359 2314 2360 if (himl == NULL) … … 2400 2446 COLORREF clrOldBk; 2401 2447 2448 dprintf(("COMCTL32: ImageList_SetBkColor")); 2449 2402 2450 if (himl == NULL) 2403 2451 return CLR_NONE; … … 2434 2482 HIMAGELIST himlTemp; 2435 2483 2436 // FIXME (imagelist, "semi-stub!\n");2484 dprintf(("COMCTL32: ImageList_SetDragCursorImage - semi-stub")); 2437 2485 2438 2486 if (himlInternalDrag == NULL) … … 2477 2525 ImageList_SetFilter (HIMAGELIST himl, INT i, DWORD dwFilter) 2478 2526 { 2479 // FIXME (imagelist, "(%p 0x%x 0x%lx):empty stub!\n", 2480 // himl, i, dwFilter); 2527 dprintf(("COMCTL32: ImageList_SetFilter - empty stub!")); 2481 2528 2482 2529 return FALSE; … … 2503 2550 { 2504 2551 INT nCount; 2552 2553 dprintf(("COMCTL32: ImageList_SetIconSize")); 2505 2554 2506 2555 if (!himl) … … 2553 2602 HBITMAP hbmNewBitmap; 2554 2603 INT nNewCount, nCopyCount; 2604 2605 dprintf(("COMCTL32: ImageList_SetImageCount")); 2555 2606 2556 2607 if (!himl) … … 2646 2697 ImageList_SetOverlayImage (HIMAGELIST himl, INT iImage, INT iOverlay) 2647 2698 { 2699 dprintf(("COMCTL32: ImageList_SetOverlayImage")); 2700 2648 2701 if (!himl) 2649 2702 return FALSE; … … 2682 2735 ImageList_Write (HIMAGELIST himl, PVOID pstm) 2683 2736 { 2737 dprintf(("COMCTL32: ImageList_Write - empty stub!")); 2738 2684 2739 if (!himl) 2685 2740 return FALSE; 2686 2741 2687 dprintf(("ImageList_Write empty stub!\n"));2688 2689 2690 2742 return FALSE; 2691 2743 } -
TabularUnified tags/trunk/src/comctl32/propsheet.c ¶
r13362 r13400 1 /* $Id: propsheet.c,v 1.1 8 2000-02-14 17:31:39cbratschi Exp $ */1 /* $Id: propsheet.c,v 1.19 2000-02-18 17:13:38 cbratschi Exp $ */ 2 2 /* 3 3 * Property Sheets … … 1481 1481 break; 1482 1482 default: 1483 //FIXME(propsheet, "Invalid button index %d\n", buttonID);1483 //FIXME(propsheet, "Invalid button index %d\n", buttonID); 1484 1484 break; 1485 1485 } … … 1934 1934 BYTE* pByte; 1935 1935 1936 dprintf(("COMCTL32: PropertySheetA")); 1937 1936 1938 PROPSHEET_CollectSheetInfo(lppsh, psInfo); 1937 1939 … … 1964 1966 INT WINAPI PropertySheetW(LPCPROPSHEETHEADERW propertySheetHeader) 1965 1967 { 1966 // FIXME(propsheet, "(%p): stub\n", propertySheetHeader);1968 dprintf(("COMCTL32: PropertySheetW - empty stub!")); 1967 1969 1968 1970 return -1; … … 1976 1978 { 1977 1979 PROPSHEETPAGEA* ppsp = COMCTL32_Alloc(sizeof(PROPSHEETPAGEA)); 1980 1981 dprintf(("COMCTL32: CreatePropertySheetPageA")); 1978 1982 1979 1983 *ppsp = *lpPropSheetPage; … … 1999 2003 HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW lpPropSheetPage) 2000 2004 { 2001 // FIXME(propsheet, "(%p): stub\n", lpPropSheetPage);2005 dprintf(("COMCTL32: CreatePropertySheetPageW - empty stub!")); 2002 2006 2003 2007 return 0; … … 2010 2014 { 2011 2015 PROPSHEETPAGEA *psp = (PROPSHEETPAGEA *)hPropPage; 2016 2017 dprintf(("COMCTL32: DestroyPropertySheetPage")); 2012 2018 2013 2019 if (!psp) … … 2410 2416 2411 2417 case PSM_SETTITLEW: 2412 FIXME("Unimplemented msg PSM_SETTITLE32W\n");2418 //FIXME("Unimplemented msg PSM_SETTITLE32W\n"); 2413 2419 return 0; 2414 2420 case PSM_SETCURSELID: 2415 FIXME("Unimplemented msg PSM_SETCURSELID\n");2421 //FIXME("Unimplemented msg PSM_SETCURSELID\n"); 2416 2422 return 0; 2417 2423 case PSM_SETFINISHTEXTW: 2418 FIXME("Unimplemented msg PSM_SETFINISHTEXT32W\n");2424 //FIXME("Unimplemented msg PSM_SETFINISHTEXT32W\n"); 2419 2425 return 0; 2420 2426 -
TabularUnified tags/trunk/src/comctl32/resource.asm ¶
r13320 r13400 2 2 ;/* Source : rsrc.rc */ 3 3 ;/* Cmdline: wrc -s -I. -IE:\IBMCPP\include -I..\..\include -I..\..\include\win -o resource.asm rsrc.rc */ 4 ;/* Date : Fri Feb 4 19:27:282000 */4 ;/* Date : Fri Feb 18 16:26:00 2000 */ 5 5 6 6 .386p … … 12 12 public _Resource_PEResTab 13 13 dd 0 14 dd 038 9b1a10h14 dd 038ad6488h 15 15 dd 0 16 16 dw 0, 5 … … 27 27 L2: 28 28 dd 0 29 dd 038 9b1a10h29 dd 038ad6488h 30 30 dd 0 31 31 dw 0, 7 … … 46 46 L4: 47 47 dd 0 48 dd 038 9b1a10h48 dd 038ad6488h 49 49 dd 0 50 50 dw 0, 1 … … 53 53 L5: 54 54 dd 0 55 dd 038 9b1a10h55 dd 038ad6488h 56 56 dd 0 57 57 dw 0, 3 … … 64 64 L6: 65 65 dd 0 66 dd 038 9b1a10h66 dd 038ad6488h 67 67 dd 0 68 68 dw 0, 1 … … 71 71 L16: 72 72 dd 0 73 dd 038 9b1a10h73 dd 038ad6488h 74 74 dd 0 75 75 dw 0, 1 … … 78 78 L2_120: 79 79 dd 0 80 dd 038 9b1a10h80 dd 038ad6488h 81 81 dd 0 82 82 dw 0, 1 … … 85 85 L2_121: 86 86 dd 0 87 dd 038 9b1a10h87 dd 038ad6488h 88 88 dd 0 89 89 dw 0, 1 … … 92 92 L2_124: 93 93 dd 0 94 dd 038 9b1a10h94 dd 038ad6488h 95 95 dd 0 96 96 dw 0, 1 … … 99 99 L2_125: 100 100 dd 0 101 dd 038 9b1a10h101 dd 038ad6488h 102 102 dd 0 103 103 dw 0, 1 … … 106 106 L2_130: 107 107 dd 0 108 dd 038 9b1a10h108 dd 038ad6488h 109 109 dd 0 110 110 dw 0, 1 … … 113 113 L2_131: 114 114 dd 0 115 dd 038 9b1a10h115 dd 038ad6488h 116 116 dd 0 117 117 dw 0, 1 … … 120 120 L2_401: 121 121 dd 0 122 dd 038 9b1a10h122 dd 038ad6488h 123 123 dd 0 124 124 dw 0, 1 … … 127 127 L4_300: 128 128 dd 0 129 dd 038 9b1a10h129 dd 038ad6488h 130 130 dd 0 131 131 dw 0, 1 … … 134 134 L5_200: 135 135 dd 0 136 dd 038 9b1a10h136 dd 038ad6488h 137 137 dd 0 138 138 dw 0, 1 … … 141 141 L5_1006: 142 142 dd 0 143 dd 038 9b1a10h143 dd 038ad6488h 144 144 dd 0 145 145 dw 0, 1 … … 148 148 L5_1020: 149 149 dd 0 150 dd 038 9b1a10h150 dd 038ad6488h 151 151 dd 0 152 152 dw 0, 1 … … 155 155 L6_261: 156 156 dd 0 157 dd 038 9b1a10h157 dd 038ad6488h 158 158 dd 0 159 159 dw 0, 1 … … 162 162 L16_1: 163 163 dd 0 164 dd 038 9b1a10h164 dd 038ad6488h 165 165 dd 0 166 166 dw 0, 1 -
TabularUnified tags/trunk/src/comctl32/treeview.c ¶
r13394 r13400 1 /* $Id: treeview.c,v 1.2 7 2000-02-17 17:26:51cbratschi Exp $ */1 /* $Id: treeview.c,v 1.28 2000-02-18 17:13:39 cbratschi Exp $ */ 2 2 /* Treeview control 3 3 * … … 34 34 35 35 - bug in SetScrollInfo/ShowScrollBar: WM_SIZE and WM_NCPAINT problems (i.e. RegEdit) 36 - WM_HSCROLL: some rects are wrong37 36 - TVS_FULLROWSELECT 38 37 - TVS_SINGLEEXPAND … … 45 44 #include "winbase.h" 46 45 #include "wingdi.h" 46 #include "winnls.h" 47 47 #include "commctrl.h" 48 48 #include "comctl32.h" … … 79 79 static BOOL TREEVIEW_CalcItems(HWND hwnd,HDC hdc,TREEVIEW_INFO *infoPtr); 80 80 static LRESULT TREEVIEW_EnsureVisible(HWND hwnd,HTREEITEM hItem); 81 static VOID TREEVIEW_ISearch(HWND hwnd,CHAR ch); 81 82 82 83 static LRESULT CALLBACK TREEVIEW_Edit_SubclassProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); … … 578 579 TREEVIEW_INFO *infoPtr = TREEVIEW_GetInfoPtr(hwnd); 579 580 580 //TRACE("\n");581 581 return (LRESULT) infoPtr->clrText; 582 582 } … … 735 735 * Get a dotted pen 736 736 */ 737 #ifdef OS2LINEHACK //CB: workaround for Open32 PS_DOT bug737 #ifdef OS2LINEHACK 738 738 TREEVIEW_Polyline(hdc,points,2,infoPtr->clrLine); 739 739 #else … … 1316 1316 BOOL ownDC = FALSE,changedLeftTop = FALSE; 1317 1317 DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE); 1318 INT maxCX,maxCY; 1319 INT xDiff = 0,yDiff = 0; 1318 1320 1319 1321 GetClientRect(hwnd,&rect); … … 1407 1409 infoPtr->uTotalHeight = y; 1408 1410 1409 if (item && item->visible) 1410 { 1411 INT xDiff = 0,yDiff = 0; 1412 1413 //check cx and cy 1414 #if 0 //CB: next step 1415 if ((infoPtr->cy > 0) && (item->rect.bottom < infoPtr->uVisibleHeight)) 1416 { 1417 INT oldCY = infoPtr->cy; 1418 1419 infoPtr->cy = infoPtr->uTotalHeight-infoPtr->uVisibleHeight; 1420 if (infoPtr->cy < 0) infoPtr->cy = 0; 1421 yDiff = infoPtr->cy-oldCY; 1422 } 1423 1424 changedLeftTop = xDiff || yDiff; 1425 if (changedLeftTop) 1426 { 1427 iItem = (INT)infoPtr->TopRootItem; 1428 item = NULL; 1429 indent = 0; 1430 MessageBeep(MB_OK); 1431 while (iItem) 1432 { 1433 item = &infoPtr->items[iItem]; 1434 OffsetRect(&item->rect,xDiff,yDiff); 1435 OffsetRect(&item->text,xDiff,yDiff); 1436 OffsetRect(&item->expandBox,xDiff,yDiff); 1437 OffsetRect(&item->bitmap,xDiff,yDiff); 1438 OffsetRect(&item->statebitmap,xDiff,yDiff); 1439 1440 1441 if ((item->firstChild) && (item->state & TVIS_EXPANDED)) 1411 //check cx and cy 1412 maxCY = infoPtr->uTotalHeight-infoPtr->uVisibleHeight; 1413 if (maxCY < 0) maxCY = 0; 1414 if (infoPtr->cy > maxCY) 1415 { 1416 yDiff = maxCY-infoPtr->cy; 1417 infoPtr->cy = maxCY; 1418 } 1419 1420 maxCX = infoPtr->uTotalWidth-infoPtr->uVisibleWidth; 1421 if (maxCX < 0) maxCX = 0; 1422 if (infoPtr->cx > maxCX) 1423 { 1424 xDiff = maxCX-infoPtr->cx; 1425 infoPtr->cx = maxCX; 1426 } 1427 1428 changedLeftTop = xDiff || yDiff; 1429 if (changedLeftTop) 1430 { 1431 iItem = (INT)infoPtr->TopRootItem; 1432 item = NULL; 1433 indent = 0; 1434 1435 while (iItem) 1436 { 1437 item = &infoPtr->items[iItem]; 1438 OffsetRect(&item->rect,xDiff,yDiff); 1439 OffsetRect(&item->text,xDiff,yDiff); 1440 OffsetRect(&item->expandBox,xDiff,yDiff); 1441 OffsetRect(&item->bitmap,xDiff,yDiff); 1442 OffsetRect(&item->statebitmap,xDiff,yDiff); 1443 1444 if ((item->firstChild) && (item->state & TVIS_EXPANDED)) 1445 { 1446 iItem = (INT)item->firstChild; 1447 indent++; 1448 } else 1449 { 1450 iItem = (INT)item->sibling; 1451 while ((!iItem) && (indent > 0)) 1442 1452 { 1443 iItem = (INT)item->firstChild; 1444 indent++; 1445 } else 1446 { 1453 indent--; 1454 item = &infoPtr->items[(INT)item->parent]; 1447 1455 iItem = (INT)item->sibling; 1448 while ((!iItem) && (indent > 0))1449 {1450 indent--;1451 item = &infoPtr->items[(INT)item->parent];1452 iItem = (INT)item->sibling;1453 }1454 1456 } 1455 } /* while */ 1456 } 1457 #endif 1458 } 1459 1460 if (!(dwStyle & TVS_NOSCROLL)) 1457 } 1458 } /* while */ 1459 } 1460 1461 if (!(dwStyle & TVS_NOSCROLL) && (infoPtr->uVisibleHeight > 0) && (infoPtr->uVisibleWidth > 0)) 1461 1462 { 1462 1463 if (infoPtr->uTotalHeight > infoPtr->uVisibleHeight) … … 1598 1599 TREEVIEW_INFO *infoPtr = TREEVIEW_GetInfoPtr(hwnd); 1599 1600 1600 // TRACE (treeview, " %d\n",wParam); 1601 1602 switch (wParam) { 1603 case TV_REFRESH_TIMER: 1604 KillTimer (hwnd, TV_REFRESH_TIMER); 1605 infoPtr->Timer &= ~TV_REFRESH_TIMER_SET; 1606 TREEVIEW_CalcItems(hwnd,0,infoPtr); 1607 TREEVIEW_Refresh(hwnd); 1608 return 0; 1609 1610 case TV_EDIT_TIMER: 1611 KillTimer (hwnd, TV_EDIT_TIMER); 1612 infoPtr->Timer &= ~TV_EDIT_TIMER_SET; 1613 if (infoPtr->editItem) 1614 TREEVIEW_EditLabel(hwnd,infoPtr->editItem,TRUE); 1615 return 0; 1616 default: 1617 // ERR (treeview,"got unknown timer\n"); 1618 break; 1601 switch (wParam) 1602 { 1603 case TV_REFRESH_TIMER: 1604 KillTimer (hwnd, TV_REFRESH_TIMER); 1605 infoPtr->Timer &= ~TV_REFRESH_TIMER_SET; 1606 TREEVIEW_CalcItems(hwnd,0,infoPtr); 1607 TREEVIEW_Refresh(hwnd); 1608 return 0; 1609 1610 case TV_EDIT_TIMER: 1611 KillTimer (hwnd, TV_EDIT_TIMER); 1612 infoPtr->Timer &= ~TV_EDIT_TIMER_SET; 1613 if (infoPtr->editItem) 1614 TREEVIEW_EditLabel(hwnd,infoPtr->editItem,TRUE); 1615 return 0; 1616 1617 case TV_ISEARCH_TIMER: 1618 KillTimer(hwnd,TV_ISEARCH_TIMER); 1619 infoPtr->Timer &= ~TV_ISEARCH_TIMER_SET; 1620 return 0; 1619 1621 } 1620 1622 … … 2627 2629 } 2628 2630 2629 static LRESULT 2630 TREEVIEW_Size (HWND hwnd, WPARAM wParam, LPARAM lParam) 2631 static LRESULT TREEVIEW_Size (HWND hwnd, WPARAM wParam, LPARAM lParam) 2631 2632 { 2632 2633 TREEVIEW_INFO *infoPtr = TREEVIEW_GetInfoPtr(hwnd); … … 2635 2636 { 2636 2637 if (TREEVIEW_CalcItems(hwnd,0,infoPtr)) 2638 #if 1 //CB: synchron update conflicts with Odin32 implementation -> check and fix 2639 TREEVIEW_QueueRefresh(hwnd); 2640 #else 2637 2641 TREEVIEW_Refresh(hwnd); //because size redraw isn't set 2642 #endif 2638 2643 } 2639 2644 … … 2648 2653 if (infoPtr->hwndEdit) SetFocus(hwnd); 2649 2654 2650 //CB: todo: check styles2651 2655 infoPtr->uInternalStatus |= TV_CALCALL; 2652 2656 TREEVIEW_QueueRefresh(hwnd); … … 2666 2670 TREEVIEW_Create (HWND hwnd, WPARAM wParam, LPARAM lParam) 2667 2671 { 2672 LPCREATESTRUCTA lpcs = (LPCREATESTRUCTA)lParam; 2668 2673 TREEVIEW_INFO *infoPtr; 2669 2674 DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE); … … 2686 2691 infoPtr->uInternalStatus = 0; 2687 2692 if (IsWindowUnicode(hwnd)) infoPtr->uInternalStatus |= TV_UNICODE; 2688 infoPtr->uNumItems =0;2693 infoPtr->uNumItems = 0; 2689 2694 infoPtr->clrBk = GetSysColor (COLOR_WINDOW); 2690 2695 infoPtr->clrLine = GetSysColor (COLOR_WINDOWTEXT); … … 2696 2701 infoPtr->himlState = NULL; 2697 2702 infoPtr->uItemHeight = -1; 2703 infoPtr->uRealItemHeight = 0; 2704 infoPtr->uVisibleHeight = lpcs->cy; 2705 infoPtr->uTotalHeight = 0; 2706 infoPtr->uVisibleWidth = lpcs->cx; 2707 infoPtr->uTotalWidth = 0; 2708 2698 2709 GetTextMetricsA (hdc, &tm); 2699 2710 infoPtr->hFont = GetStockObject (DEFAULT_GUI_FONT); 2700 2711 GetObjectA (infoPtr->hFont, sizeof (LOGFONTA), &logFont); 2701 logFont.lfWeight =FW_BOLD;2712 logFont.lfWeight = FW_BOLD; 2702 2713 infoPtr->hBoldFont = CreateFontIndirectA (&logFont); 2703 2714 2704 2715 infoPtr->items = NULL; 2705 2716 infoPtr->selectedItem = 0; 2706 infoPtr->clrText =-1; /* use system color */2707 infoPtr->dropItem =0;2708 infoPtr->insertMarkItem =0;2709 infoPtr->insertBeforeorAfter =0;2710 infoPtr->pCallBackSort =NULL;2717 infoPtr->clrText = -1; /* use system color */ 2718 infoPtr->dropItem = 0; 2719 infoPtr->insertMarkItem = 0; 2720 infoPtr->insertBeforeorAfter = 0; 2721 infoPtr->pCallBackSort = NULL; 2711 2722 infoPtr->uScrollTime = 300; /* milliseconds */ 2712 2723 infoPtr->hwndEdit = 0; 2713 2714 infoPtr->hwndToolTip=0; 2724 infoPtr->pszISearch = NULL; 2725 infoPtr->uISearchLen = 0; 2726 2727 infoPtr->hwndToolTip = 0; 2715 2728 if (!(dwStyle & TVS_NOTOOLTIPS)) 2716 2729 { … … 2755 2768 infoPtr->himlState = ImageList_Create (16, 16,ILC_COLOR | ILC_MASK, 15, 1); 2756 2769 2757 // CB: MSDN docu says: uses DrawFrameControl2770 //MSDN docu says: uses DrawFrameControl but never believe what they write 2758 2771 hbmLoad = LoadBitmapA (COMCTL32_hModule, MAKEINTRESOURCEA(IDT_CHECK)); 2759 2772 nIndex = ImageList_AddMasked (infoPtr->himlState, hbmLoad, CLR_DEFAULT); … … 2769 2782 { 2770 2783 TREEVIEW_INFO *infoPtr = TREEVIEW_GetInfoPtr(hwnd); 2771 2772 // TRACE (treeview,"\n");2773 2784 2774 2785 TREEVIEW_RemoveTree (hwnd); … … 2783 2794 2784 2795 DeleteObject(infoPtr->hBoldFont); 2796 COMCTL32_Free(infoPtr->pszISearch); 2785 2797 COMCTL32_Free (infoPtr); 2786 2798 … … 3281 3293 TREEVIEW_ITEM *wineItem; 3282 3294 RECT rect; 3283 UINT status,x,y; 3295 UINT status; 3296 INT x,y; 3284 3297 3285 3298 if (!lpht) return 0; … … 3669 3682 goto setfocus; 3670 3683 3671 //CB: todo: check ht.flags for WM_HSCROLL!3672 3673 3684 /* 3674 3685 * If the style allow editing and the node is already selected … … 3959 3970 3960 3971 GetObjectA (infoPtr->hFont, sizeof (LOGFONTA), &logFont); 3961 logFont.lfWeight =FW_BOLD;3972 logFont.lfWeight = FW_BOLD; 3962 3973 DeleteObject(infoPtr->hBoldFont); 3963 3974 infoPtr->hBoldFont = CreateFontIndirectA (&logFont); 3964 3975 3965 hdc = GetDC (0);3976 hdc = GetDC(hwnd); 3966 3977 hOldFont = SelectObject (hdc, hFont); 3967 3978 GetTextMetricsA (hdc, &tm); 3968 3979 height= tm.tmHeight + tm.tmExternalLeading; 3969 if (height >infoPtr->uRealItemHeight)3970 infoPtr->uRealItemHeight =height;3980 if (height > infoPtr->uRealItemHeight) 3981 infoPtr->uRealItemHeight = height; 3971 3982 SelectObject (hdc, hOldFont); 3972 ReleaseDC (0,hdc);3983 ReleaseDC(hwnd,hdc); 3973 3984 3974 3985 if (lParam) … … 3978 3989 TREEVIEW_CalcItems(hwnd,0,infoPtr); 3979 3990 TREEVIEW_Refresh(hwnd); 3980 } 3991 } else infoPtr->uInternalStatus |= TV_CALCALL; 3981 3992 3982 3993 return 0; … … 4165 4176 if (control) 4166 4177 { 4167 DWORD scrollMsg = 0;4178 INT scrollMsg = -1; 4168 4179 BOOL horz = FALSE; 4169 4180 … … 4171 4182 { 4172 4183 case VK_UP: 4173 //CB: todo: VK_UP doesn't work4174 4184 scrollMsg = SB_LINELEFT; 4175 4185 break; … … 4197 4207 break; 4198 4208 } 4199 if (scrollMsg )4209 if (scrollMsg != -1) 4200 4210 { 4201 4211 SendMessageA(hwnd,horz ? WM_HSCROLL:WM_VSCROLL,MAKELONG(scrollMsg,0),0); … … 4315 4325 default: 4316 4326 break; 4317 }4327 } 4318 4328 4319 4329 if (hNewSelection) … … 4330 4340 4331 4341 return FALSE; 4342 } 4343 4344 static LRESULT TREEVIEW_Char(HWND hwnd,WPARAM wParam,LPARAM lParam) 4345 { 4346 CHAR ch = (CHAR)wParam; 4347 4348 TREEVIEW_ISearch(hwnd,ch); 4349 4350 return 0; 4332 4351 } 4333 4352 … … 4393 4412 } 4394 4413 4395 static LRESULT TREEVIEW_GetISearchString(HWND hwnd,LPSTR lpsz,BOOL unicode) 4396 { 4397 //CB: todo: MSDN documentation is useless 4398 4399 return 0; 4414 static BOOL TREEVIEW_Compare(HWND hwnd,TREEVIEW_ITEM *item,LPWSTR text,INT textlen) 4415 { 4416 if (item->pszText == LPSTR_TEXTCALLBACKW) 4417 TREEVIEW_SendDispInfoNotify(hwnd,item,TVN_GETDISPINFO,TVIF_TEXT); 4418 if (item->pszText == LPSTR_TEXTCALLBACKW) return FALSE; 4419 4420 //simulate lstrcmpniW 4421 return CompareStringW(LOCALE_SYSTEM_DEFAULT,NORM_IGNORECASE,item->pszText,MIN(lstrlenW(item->pszText),textlen),text,textlen) == 2; 4422 } 4423 4424 static TREEVIEW_ITEM* TREEVIEW_SearchChildren(HWND hwnd,TREEVIEW_INFO *infoPtr,TREEVIEW_ITEM *item,TREEVIEW_ITEM *stop,LPWSTR text,INT textlen) 4425 { 4426 TREEVIEW_ITEM *child,*child2; 4427 4428 if (!(item->firstChild && (item->state & TVIS_EXPANDED))) return NULL; 4429 4430 child = &infoPtr->items[(INT)item->firstChild]; 4431 while (child) 4432 { 4433 if (child == stop) return NULL; 4434 if (TREEVIEW_Compare(hwnd,child,text,textlen)) return child; 4435 child2 = TREEVIEW_SearchChildren(hwnd,infoPtr,child,stop,text,textlen); 4436 if (child2) return child2; 4437 if (child->sibling) child = &infoPtr->items[(INT)child->sibling]; 4438 else return NULL; 4439 } 4440 4441 return NULL; 4442 } 4443 4444 static TREEVIEW_ITEM* TREEVIEW_Search(HWND hwnd,TREEVIEW_INFO *infoPtr,INT iItem,LPWSTR text,INT textlen) 4445 { 4446 TREEVIEW_ITEM *item,*start; 4447 BOOL found = FALSE; 4448 4449 item = start = &infoPtr->items[iItem]; 4450 4451 if (TREEVIEW_Compare(hwnd,item,text,textlen)) found = TRUE; else 4452 { 4453 //search start to end 4454 while (item->sibling || item->parent) 4455 { 4456 TREEVIEW_ITEM *child = TREEVIEW_SearchChildren(hwnd,infoPtr,item,NULL,text,textlen); 4457 4458 if (child) 4459 { 4460 found = TRUE; 4461 item = child; 4462 break; 4463 } 4464 4465 item = TREEVIEW_GetNextListItem(hwnd,infoPtr,item); 4466 if (item && TREEVIEW_Compare(hwnd,item,text,textlen)) 4467 { 4468 found = TRUE; 4469 break; 4470 } 4471 } 4472 if (!found) 4473 { 4474 iItem = (INT)infoPtr->TopRootItem; 4475 item = &infoPtr->items[iItem]; 4476 //search first to start 4477 while (item != start) 4478 { 4479 TREEVIEW_ITEM *child; 4480 4481 if (TREEVIEW_Compare(hwnd,item,text,textlen)) 4482 { 4483 found = TRUE; 4484 break; 4485 } 4486 child = TREEVIEW_SearchChildren(hwnd,infoPtr,item,start,text,textlen); 4487 4488 if (child) 4489 { 4490 found = TRUE; 4491 item = child; 4492 break; 4493 } 4494 if (item->sibling) item = &infoPtr->items[(INT)item->sibling]; 4495 else break; 4496 } 4497 } 4498 } 4499 4500 return found ? item:NULL; 4501 } 4502 4503 static VOID TREEVIEW_ISearch(HWND hwnd,CHAR ch) 4504 { 4505 TREEVIEW_INFO *infoPtr = TREEVIEW_GetInfoPtr(hwnd); 4506 LPWSTR newString; 4507 INT len,iItem; 4508 CHAR ch2[2]; 4509 TREEVIEW_ITEM *item; 4510 4511 //check timer 4512 if (infoPtr->Timer & TV_ISEARCH_TIMER_SET) 4513 { 4514 KillTimer(hwnd,TV_ISEARCH_TIMER); 4515 infoPtr->Timer &= ~TV_ISEARCH_TIMER_SET; 4516 } else if (infoPtr->uISearchLen > 0) 4517 { 4518 COMCTL32_Free(infoPtr->pszISearch); 4519 infoPtr->pszISearch = NULL; 4520 infoPtr->uISearchLen = 0; 4521 } 4522 4523 //prepare new search string 4524 len = infoPtr->uISearchLen+1; 4525 newString = COMCTL32_Alloc((len+1)*sizeof(WCHAR)); 4526 4527 if (infoPtr->uISearchLen > 0) lstrcpyW(newString,infoPtr->pszISearch); 4528 4529 ch2[0] = ch; 4530 ch2[1] = 0; 4531 lstrcpyAtoW((LPWSTR)&newString[len-1],(LPSTR)&ch2); 4532 4533 //search 4534 4535 iItem = infoPtr->selectedItem ? (INT)infoPtr->selectedItem:(INT)infoPtr->TopRootItem; 4536 item = TREEVIEW_Search(hwnd,infoPtr,iItem,newString,len); 4537 if (!item && infoPtr->pszISearch) 4538 { 4539 TREEVIEW_ITEM *next; 4540 //CB: todo: must press key twice to go to the next item 4541 item = &infoPtr->items[iItem]; 4542 next = TREEVIEW_GetNextListItem(hwnd,infoPtr,item); 4543 if (!next) next = &infoPtr->items[(INT)infoPtr->TopRootItem]; 4544 if (next && (next != item)) 4545 { 4546 next = TREEVIEW_Search(hwnd,infoPtr,(INT)next->hItem,infoPtr->pszISearch,infoPtr->uISearchLen); 4547 if (next) 4548 TREEVIEW_SelectItem(hwnd,(WPARAM)TVGN_CARET,(LPARAM)next->hItem); 4549 } 4550 COMCTL32_Free(newString); 4551 return; 4552 } 4553 4554 //done 4555 if (item) 4556 { 4557 COMCTL32_Free(infoPtr->pszISearch); 4558 infoPtr->pszISearch = newString; 4559 infoPtr->uISearchLen = len; 4560 TREEVIEW_SelectItem(hwnd,(WPARAM)TVGN_CARET,(LPARAM)item->hItem); 4561 SetTimer(hwnd,TV_ISEARCH_TIMER,TV_ISEARCH_DELAY,0); 4562 infoPtr->Timer |= TV_ISEARCH_TIMER_SET; 4563 } else 4564 { 4565 COMCTL32_Free(newString); 4566 MessageBeep(0xFFFFFFFF); 4567 } 4568 } 4569 4570 static LRESULT TREEVIEW_GetISearchString(HWND hwnd,LPWSTR lpsz,BOOL unicode) 4571 { 4572 TREEVIEW_INFO *infoPtr = TREEVIEW_GetInfoPtr(hwnd); 4573 4574 if (infoPtr->uISearchLen == 0) return 0; 4575 4576 if (unicode) 4577 lstrcpyW(lpsz,infoPtr->pszISearch); 4578 else 4579 lstrcpyWtoA((LPSTR)lpsz,infoPtr->pszISearch); 4580 4581 return infoPtr->uISearchLen; 4400 4582 } 4401 4583 … … 4430 4612 TREEVIEW_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) 4431 4613 { 4432 if (uMsg ==WM_CREATE)4433 4614 if (uMsg == WM_CREATE) 4615 return TREEVIEW_Create (hwnd, wParam, lParam); 4434 4616 4435 4617 if (!TREEVIEW_GetInfoPtr(hwnd)) 4436 return DefWindowProcA (hwnd, uMsg, wParam, lParam); 4437 4438 switch (uMsg) { 4618 return DefWindowProcA (hwnd, uMsg, wParam, lParam); 4619 4620 switch (uMsg) 4621 { 4439 4622 case TVM_INSERTITEMA: 4440 4623 return TREEVIEW_InsertItem(hwnd,wParam,lParam,FALSE); … … 4517 4700 4518 4701 case TVM_GETISEARCHSTRINGA: 4519 return TREEVIEW_GetISearchString(hwnd,(LP STR)lParam,FALSE);4702 return TREEVIEW_GetISearchString(hwnd,(LPWSTR)lParam,FALSE); 4520 4703 4521 4704 case TVM_GETISEARCHSTRINGW: 4522 return TREEVIEW_GetISearchString(hwnd,(LP STR)lParam,TRUE);4705 return TREEVIEW_GetISearchString(hwnd,(LPWSTR)lParam,TRUE); 4523 4706 4524 4707 case TVM_GETTOOLTIPS: … … 4602 4785 case WM_KEYDOWN: 4603 4786 return TREEVIEW_KeyDown (hwnd, wParam, lParam); 4787 4788 case WM_CHAR: 4789 return TREEVIEW_Char(hwnd,wParam,lParam); 4604 4790 4605 4791 case WM_SETFOCUS:
Note:
See TracChangeset
for help on using the changeset viewer.