Changeset 3154 for trunk/src/comctl32
- Timestamp:
- Mar 18, 2000, 5:17:35 PM (26 years ago)
- Location:
- trunk/src/comctl32
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/comctl32/CCBase.cpp
r3145 r3154 1 /* $Id: CCBase.cpp,v 1. 3 2000-03-17 17:13:22cbratschi Exp $ */1 /* $Id: CCBase.cpp,v 1.4 2000-03-18 16:17:20 cbratschi Exp $ */ 2 2 /* 3 3 * COMCTL32 Base Functions and Macros for all Controls … … 14 14 BOOL checkVersion(INT iVersion) 15 15 { 16 return TRUE; //CB: todo16 return iVersion <= COMCTL32_VERSION; 17 17 } 18 18 … … 213 213 //Tooltips 214 214 215 HWND createToolTip(HWND hwnd,UINT flags )215 HWND createToolTip(HWND hwnd,UINT flags,BOOL addtool) 216 216 { 217 217 HWND hwndToolTip; … … 231 231 sendNotify(hwnd,NM_TOOLTIPSCREATED,&nmttc.hdr); 232 232 233 ZeroMemory(&ti,sizeof(TTTOOLINFOA)); 234 ti.cbSize = sizeof(TTTOOLINFOA); 235 ti.uFlags = flags; 236 ti.hwnd = hwnd; 237 ti.uId = 0; 238 ti.lpszText = ""; 239 SetRectEmpty (&ti.rect); 240 241 SendMessageA(hwndToolTip,TTM_ADDTOOLA,0,(LPARAM)&ti); 233 if (addtool) 234 { 235 ZeroMemory(&ti,sizeof(TTTOOLINFOA)); 236 ti.cbSize = sizeof(TTTOOLINFOA); 237 ti.uFlags = flags; 238 ti.hwnd = hwnd; 239 ti.uId = 0; 240 ti.lpszText = ""; 241 SetRectEmpty (&ti.rect); 242 243 SendMessageA(hwndToolTip,TTM_ADDTOOLA,0,(LPARAM)&ti); 244 } 242 245 243 246 return hwndToolTip; -
trunk/src/comctl32/CCBase.h
r3145 r3154 1 /* $Id: CCBase.h,v 1. 4 2000-03-17 17:13:22cbratschi Exp $ */1 /* $Id: CCBase.h,v 1.5 2000-03-18 16:17:21 cbratschi Exp $ */ 2 2 /* 3 3 * COMCTL32 Base Functions and Macros for all Controls … … 39 39 LRESULT sendVScroll(HWND hwnd,UINT wNotifyCode); 40 40 41 HWND createToolTip(HWND hwnd,UINT flags );41 HWND createToolTip(HWND hwnd,UINT flags,BOOL addtool); 42 42 VOID destroyToolTip(HWND hwndToolTip); 43 43 -
trunk/src/comctl32/comctl32undoc.cpp
r2875 r3154 1 /* $Id: comctl32undoc.cpp,v 1. 1 2000-02-23 17:09:40cbratschi Exp $ */1 /* $Id: comctl32undoc.cpp,v 1.2 2000-03-18 16:17:22 cbratschi Exp $ */ 2 2 /* 3 3 * Undocumented functions from COMCTL32.DLL … … 13 13 14 14 /* 15 - Corel 20000 212level16 - WINE 20000130 level15 - Corel 20000317 level 16 - (WINE 20000130 level) 17 17 */ 18 18 … … 764 764 LPVOID pSrc; 765 765 766 dprintf (("COMCTL32: DSA_GetItem"));766 dprintf2(("COMCTL32: DSA_GetItem")); 767 767 768 768 if (!hdsa) … … 797 797 LPVOID pSrc; 798 798 799 dprintf (("COMCTL32: DSA_GetItemPtr"));799 dprintf2(("COMCTL32: DSA_GetItemPtr")); 800 800 801 801 if (!hdsa) … … 833 833 LPVOID pDest, lpTemp; 834 834 835 dprintf (("COMCTL32: DSA_SetItem"));835 dprintf2(("COMCTL32: DSA_SetItem")); 836 836 837 837 if ((!hdsa) || nIndex < 0) … … 890 890 LPDWORD p; 891 891 892 dprintf (("COMCTL32: DSA_InsertItem"));892 dprintf2(("COMCTL32: DSA_InsertItem")); 893 893 894 894 if ((!hdsa) || nIndex < 0) … … 959 959 INT nSize; 960 960 961 dprintf (("COMCTL32: DSA_DeleteItem"));961 dprintf2(("COMCTL32: DSA_DeleteItem")); 962 962 963 963 if (!hdsa) … … 1200 1200 DPA_GetPtr (const HDPA hdpa, INT i) 1201 1201 { 1202 dprintf (("COMCTL32: DPA_GetPtr"));1202 dprintf2(("COMCTL32: DPA_GetPtr")); 1203 1203 1204 1204 if (!hdpa) … … 1234 1234 INT i; 1235 1235 1236 dprintf (("COMCTL32: DPA_GetPtrIndex"));1236 dprintf2(("COMCTL32: DPA_GetPtrIndex")); 1237 1237 1238 1238 if (!hdpa->ptrs) … … 1269 1269 LPVOID *lpTemp, *lpDest; 1270 1270 1271 dprintf (("COMCTL32: DPA_InsertPtr"));1271 dprintf2(("COMCTL32: DPA_InsertPtr")); 1272 1272 1273 1273 if ((!hdpa) || (i < 0)) … … 1341 1341 LPVOID *lpTemp; 1342 1342 1343 dprintf (("COMCTL32: DPA_SetPtr"));1343 dprintf2(("COMCTL32: DPA_SetPtr")); 1344 1344 1345 1345 if ((!hdpa) || i < 0) … … 1395 1395 INT nSize; 1396 1396 1397 dprintf (("COMCTL32: DPA_DeletePtr"));1397 dprintf2(("COMCTL32: DPA_DeletePtr")); 1398 1398 1399 1399 if ((!hdpa) || i < 0 || i >= hdpa->nItemCount) … … 1479 1479 * RETURNS 1480 1480 * NONE 1481 * 1482 * NOTES: 1483 * Reverted back to the orginal quick sort, because the existing sort did not sort. 1484 * Kudos to the orginal author of the quick sort. 1481 1485 */ 1482 1486 … … 1492 1496 i = l; 1493 1497 j = r; 1494 1495 if ( i >= j ) 1496 return; 1497 else if ( i == (j - 1) ) 1498 { 1499 if ( (pfnCompare)( lpPtrs[i], lpPtrs[j], lParam ) > 0 ) 1498 v = lpPtrs[(int)(l+r)/2]; 1499 do { 1500 while ((pfnCompare)(lpPtrs[i], v, lParam) < 0) i++; 1501 while ((pfnCompare)(lpPtrs[j], v, lParam) > 0) j--; 1502 if (i <= j) 1500 1503 { 1501 t = lpPtrs[i];1502 lpPtrs[i] = lpPtrs[j];1503 lpPtrs[j] = t;1504 }1505 return;1506 }1507 1508 v = lpPtrs[(int)(l+r)/2];1509 1510 while ( i < j)1511 {1512 while ( (pfnCompare)( lpPtrs[i], v, lParam ) <= 0 && i < j )1513 i++;1514 1515 while ( (pfnCompare)( v, lpPtrs[j], lParam ) <= 0 && i < j )1516 j--;1517 1518 if ( i < j )1519 {1520 /* Swap the values; increment i and decrement j to avoid1521 infinite conditions where i and j swap forever */1522 1504 t = lpPtrs[i]; 1523 1505 lpPtrs[i++] = lpPtrs[j]; 1524 1506 lpPtrs[j--] = t; 1525 1507 } 1526 } 1527 1528 if ( i - 1 > l ) 1529 DPA_QuickSort (lpPtrs, l, i - 1, pfnCompare, lParam); 1530 if ( j + 1 < r ) 1531 DPA_QuickSort (lpPtrs, j + 1, r, pfnCompare, lParam); 1508 } while (i <= j); 1509 if (l < j) DPA_QuickSort (lpPtrs, l, j, pfnCompare, lParam); 1510 if (i < r) DPA_QuickSort (lpPtrs, i, r, pfnCompare, lParam); 1532 1511 } 1533 1512 -
trunk/src/comctl32/header.cpp
r2895 r3154 1 /* $Id: header.cpp,v 1. 2 2000-02-25 17:00:15cbratschi Exp $ */1 /* $Id: header.cpp,v 1.3 2000-03-18 16:17:23 cbratschi Exp $ */ 2 2 /* 3 3 * Header control … … 16 16 * Version: 5.00 17 17 */ 18 19 /* 20 - Corel 20000317 level 21 */ 18 22 19 23 #include <string.h> -
trunk/src/comctl32/listview.cpp
r2895 r3154 1 /*$Id: listview.cpp,v 1. 2 2000-02-25 17:00:16cbratschi Exp $*/1 /*$Id: listview.cpp,v 1.3 2000-03-18 16:17:24 cbratschi Exp $*/ 2 2 /* 3 3 * Listview control … … 39 39 40 40 /* 41 - Corel 20000 212level42 - WINE 20000130 level41 - Corel 20000317 level 42 - (WINE 20000130 level) 43 43 */ 44 44 45 45 #include <string.h> 46 46 #include <wcstr.h> 47 #include <stdio.h> 47 48 #include "winbase.h" 48 49 #include "commctrl.h" … … 50 51 #include "listview.h" 51 52 #include "comctl32.h" 53 #include "ctype.h" 52 54 53 55 /* … … 96 98 97 99 #define LISTVIEW_GetInfoPtr(hwnd) ((LISTVIEW_INFO*)getInfoPtr(hwnd)) 100 101 INT WINAPI COMCTL32_StrCmpNIA(LPCSTR,LPCSTR,INT); 102 103 #define strncasecmp COMCTL32_StrCmpNIA 98 104 99 105 /* … … 2032 2038 } 2033 2039 2040 /* Don't bother painting item being edited */ 2041 if (infoPtr->hwndEdit && lvItem.state & LVIS_FOCUSED) 2042 return; 2043 2034 2044 rcItem.top += infoPtr->iconSize.cy + ICON_BOTTOM_PADDING; 2035 2045 nLabelWidth = ListView_GetStringWidthW(hwnd, lvItem.pszText); … … 2069 2079 * None 2070 2080 */ 2071 static VOID LISTVIEW_ RefreshReport(HWND hwnd, HDC hdc)2081 static VOID LISTVIEW_DrawReport(HWND hwnd, HDC hdc) 2072 2082 { 2073 2083 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd); … … 2242 2252 * None 2243 2253 */ 2244 static VOID LISTVIEW_ RefreshList(HWND hwnd, HDC hdc)2254 static VOID LISTVIEW_DrawList(HWND hwnd, HDC hdc) 2245 2255 { 2246 2256 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd); … … 2250 2260 INT nColumnCount; 2251 2261 INT nCountPerColumn; 2252 INT nItemWidth = LISTVIEW_GetItemWidth(hwnd);2253 INT nItemHeight = LISTVIEW_GetItemHeight(hwnd);2262 INT nItemWidth = infoPtr->nItemWidth; 2263 INT nItemHeight = infoPtr->nItemHeight; 2254 2264 2255 2265 /* get number of fully visible columns */ … … 2285 2295 * None 2286 2296 */ 2287 static VOID LISTVIEW_ RefreshIcon(HWND hwnd, HDC hdc, BOOL bSmall)2297 static VOID LISTVIEW_DrawIcon(HWND hwnd, HDC hdc, BOOL bSmall) 2288 2298 { 2289 2299 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd); … … 2338 2348 * NoneX 2339 2349 */ 2340 static VOID LISTVIEW_ Refresh(HWND hwnd, HDC hdc)2350 static VOID LISTVIEW_Draw(HWND hwnd, HDC hdc) 2341 2351 { 2342 2352 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd); … … 2357 2367 if (uView == LVS_LIST) 2358 2368 { 2359 LISTVIEW_ RefreshList(hwnd, hdc);2369 LISTVIEW_DrawList(hwnd, hdc); 2360 2370 } 2361 2371 else if (uView == LVS_REPORT) 2362 2372 { 2363 LISTVIEW_ RefreshReport(hwnd, hdc);2373 LISTVIEW_DrawReport(hwnd, hdc); 2364 2374 } 2365 2375 else if (uView == LVS_SMALLICON) 2366 2376 { 2367 LISTVIEW_ RefreshIcon(hwnd, hdc, TRUE);2377 LISTVIEW_DrawIcon(hwnd, hdc, TRUE); 2368 2378 } 2369 2379 else if (uView == LVS_ICON) 2370 2380 { 2371 LISTVIEW_ RefreshIcon(hwnd, hdc, FALSE);2381 LISTVIEW_DrawIcon(hwnd, hdc, FALSE); 2372 2382 } 2373 2383 … … 5172 5182 LISTVIEW_ITEM *lpItem = NULL; 5173 5183 5174 // TRACE("(hwnd=%x,lpLVItem=%p)\n", hwnd, lpLVItem);5175 5176 5184 if (lpLVItem != NULL) 5177 5185 { … … 5214 5222 if (lpLVItem->mask & LVIF_STATE) 5215 5223 { 5216 if (lpLVItem->stateMask & LVIS_FOCUSED) 5224 lpItem->state &= ~(LVIS_FOCUSED|LVIS_SELECTED); 5225 if (lpLVItem->stateMask & LVIS_SELECTED) 5226 { 5227 LISTVIEW_SetSelection(hwnd, nItem); 5228 } 5229 else if (lpLVItem->stateMask & LVIS_FOCUSED) 5217 5230 { 5218 5231 LISTVIEW_SetItemFocus(hwnd, nItem); … … 5940 5953 LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd); 5941 5954 5955 if (first == second) 5956 return 0; 5957 5942 5958 rv = (infoPtr->pfnCompare)( ((LISTVIEW_ITEM*) first)->lParam, 5943 5959 ((LISTVIEW_ITEM*) second)->lParam, infoPtr->lParamSort ); … … 6523 6539 } 6524 6540 6541 /************************ Defines that LISTVIEW_ProcessLetterKeys uses *******************************/ 6542 #define KEY_DELAY 900 6543 #define LISTVIEW_InitLvItemStruct(item,idx,TEXT) \ 6544 ZeroMemory(&(item), sizeof(LVITEMA)); \ 6545 (item).mask = LVIF_TEXT; \ 6546 (item).iItem = (idx); \ 6547 (item).iSubItem = 0; \ 6548 (item).pszText = (CHAR*)&(TEXT); \ 6549 (item).cchTextMax = MAX_PATH 6550 6551 /************************************************************************************************************************ 6552 * DESCRIPTION: 6553 * Processes keyboard messages generated by pressing the letter keys on the keyboard. 6554 * Assumes the list is sorted alphabetically, without regard to case. 6555 * 6556 * PARAMETERS: 6557 * [ I ] HWND: handle to the window 6558 * [ I ] WPARAM: the character code, the actual character 6559 * [ I ] LPARAM: key data 6560 * 6561 * 6562 * RETURN: 6563 * Zero. 6564 * 6565 * CHANGE LOG: 6566 * Feb 17, 2000 -------------> Creation of function. 6567 * Feb 22, 2000 -------------> Added macros. 6568 * TODO: 6569 * 6570 * 6571 ************************************************************************************************************************/ 6572 static INT LISTVIEW_ProcessLetterKeys( HWND hwnd, WPARAM charCode, LPARAM keyData ) 6573 { 6574 LISTVIEW_INFO *infoPtr = NULL; 6575 INT nItem = -1; 6576 BOOL bRedraw; 6577 INT nSize = 0; 6578 INT idx = 0; 6579 BOOL bFoundMatchingFiles = FALSE; 6580 LVITEMA item; 6581 CHAR TEXT[ MAX_PATH ]; 6582 CHAR szCharCode[ 2 ]; 6583 DWORD timeSinceLastKeyPress = 0; 6584 6585 sprintf( szCharCode, "%c", charCode ); 6586 6587 /* simple parameter checking */ 6588 if ( !hwnd || !charCode || !keyData ) 6589 return 0; 6590 6591 infoPtr = (LISTVIEW_INFO *)GetWindowLongA(hwnd, 0); 6592 6593 if ( !infoPtr ) 6594 return 0; 6595 6596 /* only allow the valid WM_CHARs through */ 6597 if ( isalnum( charCode ) || charCode == '.' || charCode == '`' || charCode == '!' 6598 || charCode == '@' || charCode == '#' || charCode == '$' || charCode == '%' 6599 || charCode == '^' || charCode == '&' || charCode == '*' || charCode == '(' 6600 || charCode == ')' || charCode == '-' || charCode == '_' || charCode == '+' 6601 || charCode == '=' || charCode == '\\'|| charCode == ']' || charCode == '}' 6602 || charCode == '[' || charCode == '{' || charCode == '/' || charCode == '?' 6603 || charCode == '>' || charCode == '<' || charCode == ',' || charCode == '~') 6604 { 6605 timeSinceLastKeyPress = GetTickCount(); 6606 6607 nSize = GETITEMCOUNT( infoPtr ); 6608 /* if there are 0 items, there is no where to go */ 6609 if ( nSize == 0 ) 6610 return 0; 6611 /* 6612 * If the last charCode equals the current charCode then look 6613 * to the next element in list to see if it matches the previous 6614 * charCode. 6615 */ 6616 if ( infoPtr->charCode == charCode ) 6617 { 6618 if ( timeSinceLastKeyPress - infoPtr->timeSinceLastKeyPress < KEY_DELAY ) 6619 { /* append new character to search string */ 6620 strcat( infoPtr->szSearchParam, szCharCode ); 6621 infoPtr->nSearchParamLength++; 6622 6623 /* loop from start of list view */ 6624 for( idx = infoPtr->nFocusedItem; idx < nSize; idx++ ) 6625 { /* get item */ 6626 LISTVIEW_InitLvItemStruct( item, idx, TEXT ); 6627 ListView_GetItemA( hwnd, &item ); 6628 6629 /* compare items */ 6630 if ( strncasecmp( item.pszText, infoPtr->szSearchParam, 6631 infoPtr->nSearchParamLength ) == 0 ) 6632 { 6633 nItem = idx; 6634 break; 6635 } 6636 } 6637 } 6638 else if ( infoPtr->timeSinceLastKeyPress > timeSinceLastKeyPress ) 6639 { /* The DWORD went over it's boundery?? Ergo assuming too slow??. */ 6640 for ( idx = 0; idx < nSize; idx++ ) 6641 { 6642 LISTVIEW_InitLvItemStruct( item, idx, TEXT ); 6643 ListView_GetItemA( hwnd, &item ); 6644 6645 if ( strncasecmp( &( item.pszText[ 0 ] ), szCharCode, 1 ) == 0 ) 6646 { 6647 nItem = idx; 6648 break; 6649 } 6650 } 6651 strcpy( infoPtr->szSearchParam, szCharCode ); 6652 infoPtr->nSearchParamLength = 1; 6653 } 6654 else 6655 { /* Save szCharCode for use in later searches */ 6656 strcpy( infoPtr->szSearchParam, szCharCode ); 6657 infoPtr->nSearchParamLength = 1; 6658 6659 LISTVIEW_InitLvItemStruct( item, infoPtr->nFocusedItem + 1, TEXT ); 6660 ListView_GetItemA( hwnd, &item ); 6661 6662 if ( strncasecmp( &( item.pszText[ 0 ] ), szCharCode, 1 ) == 0 ) 6663 nItem = infoPtr->nFocusedItem + 1; 6664 else 6665 { /* 6666 * Ok so there are no more folders that match 6667 * now we look for files. 6668 */ 6669 for ( idx = infoPtr->nFocusedItem + 1; idx < nSize; idx ++ ) 6670 { 6671 LISTVIEW_InitLvItemStruct( item, idx, TEXT ); 6672 ListView_GetItemA( hwnd, &item ); 6673 6674 if ( strncasecmp( &( item.pszText[ 0 ] ), szCharCode, 1 ) == 0 ) 6675 { 6676 nItem = idx; 6677 bFoundMatchingFiles = TRUE; 6678 break; 6679 } 6680 } 6681 if ( !bFoundMatchingFiles ) 6682 { /* go back to first instance */ 6683 for ( idx = 0; idx < nSize; idx ++ ) 6684 { 6685 LISTVIEW_InitLvItemStruct( item,idx, TEXT ); 6686 ListView_GetItemA( hwnd, &item ); 6687 6688 if ( strncasecmp( &( item.pszText[ 0 ] ), szCharCode, 1 ) == 0 ) 6689 { 6690 nItem = idx; 6691 break; 6692 } 6693 } 6694 } 6695 } 6696 } 6697 } /*END: if ( infoPtr->charCode == charCode )*/ 6698 6699 else /* different keypressed */ 6700 { 6701 /* could be that they are spelling the file/directory for us */ 6702 if ( timeSinceLastKeyPress - infoPtr->timeSinceLastKeyPress > KEY_DELAY ) 6703 { /* 6704 * Too slow, move to the first instance of the 6705 * charCode. 6706 */ 6707 for ( idx = 0; idx < nSize; idx++ ) 6708 { 6709 LISTVIEW_InitLvItemStruct( item,idx, TEXT ); 6710 ListView_GetItemA( hwnd, &item ); 6711 6712 if ( strncasecmp( &( item.pszText[ 0 ] ), szCharCode, 1 ) == 0 ) 6713 { 6714 nItem = idx; 6715 break; 6716 } 6717 } 6718 strcpy( infoPtr->szSearchParam, szCharCode ); 6719 infoPtr->nSearchParamLength = 1; 6720 } 6721 else if ( infoPtr->timeSinceLastKeyPress > timeSinceLastKeyPress ) 6722 { /* The DWORD went over it's boundery?? Ergo assuming too slow??. */ 6723 for ( idx = 0; idx < nSize; idx++ ) 6724 { 6725 LISTVIEW_InitLvItemStruct( item,idx, TEXT ); 6726 ListView_GetItemA( hwnd, &item ); 6727 6728 if ( strncasecmp( &( item.pszText[ 0 ] ), szCharCode, 1 ) == 0 ) 6729 { 6730 nItem = idx; 6731 break; 6732 } 6733 } 6734 strcpy( infoPtr->szSearchParam, szCharCode ); 6735 infoPtr->nSearchParamLength = 1; 6736 } 6737 else /* Search for the string the user is typing */ 6738 { 6739 /* append new character to search string */ 6740 strcat( infoPtr->szSearchParam, szCharCode ); 6741 infoPtr->nSearchParamLength++; 6742 6743 /* loop from start of list view */ 6744 for( idx = 0; idx < nSize; idx++ ) 6745 { /* get item */ 6746 LISTVIEW_InitLvItemStruct( item, idx, TEXT ); 6747 ListView_GetItemA( hwnd, &item ); 6748 6749 /* compare items */ 6750 if ( strncasecmp( item.pszText, infoPtr->szSearchParam, 6751 infoPtr->nSearchParamLength ) == 0 ) 6752 { 6753 nItem = idx; 6754 break; 6755 } 6756 } 6757 } 6758 }/*END: else */ 6759 } 6760 else 6761 return 0; 6762 6763 bRedraw = LISTVIEW_KeySelection(hwnd, nItem ); 6764 if (bRedraw != FALSE) 6765 { 6766 /* refresh client area */ 6767 InvalidateRect(hwnd, NULL, TRUE); 6768 UpdateWindow(hwnd); 6769 } 6770 6771 /* Store the WM_CHAR for next time */ 6772 infoPtr->charCode = charCode; 6773 6774 /* Store time */ 6775 infoPtr->timeSinceLastKeyPress = timeSinceLastKeyPress; 6776 6777 return 0; 6778 6779 }/*END:LISTVIEW_ProcessLetterKeys( HWND hwndParent, INT nVirtualKey, LONG lKeyData ) */ 6780 6525 6781 /*** 6526 6782 * DESCRIPTION: … … 6866 7122 { 6867 7123 hdc = BeginPaint(hwnd, &ps); 6868 LISTVIEW_ Refresh(hwnd, hdc);7124 LISTVIEW_Draw(hwnd, hdc); 6869 7125 EndPaint(hwnd, &ps); 6870 7126 } 6871 7127 else 6872 7128 { 6873 LISTVIEW_ Refresh(hwnd, hdc);7129 LISTVIEW_Draw(hwnd, hdc); 6874 7130 } 6875 7131 … … 7307 7563 } 7308 7564 7565 /* If they change the view and we have an active edit control 7566 we will need to kill the control since the redraw will 7567 misplace the edit control. 7568 */ 7569 if (infoPtr->hwndEdit && 7570 ((uNewView & (LVS_ICON|LVS_LIST|LVS_SMALLICON)) != 7571 ((LVS_ICON|LVS_LIST|LVS_SMALLICON) & uOldView))) 7572 { 7573 SendMessageA(infoPtr->hwndEdit, WM_KILLFOCUS, 0, 0); 7574 } 7575 7309 7576 return 0; 7310 7577 } … … 7568 7835 return LISTVIEW_Update(hwnd, (INT)wParam); 7569 7836 7570 /* case WM_CHAR: */ 7837 case WM_CHAR: 7838 return LISTVIEW_ProcessLetterKeys( hwnd, wParam, lParam ); 7839 7571 7840 case WM_COMMAND: 7572 7841 return LISTVIEW_Command(hwnd, wParam, lParam); -
trunk/src/comctl32/propsheet.cpp
r3145 r3154 1 /* $Id: propsheet.cpp,v 1. 2 2000-03-17 17:13:24cbratschi Exp $ */1 /* $Id: propsheet.cpp,v 1.3 2000-03-18 16:17:26 cbratschi Exp $ */ 2 2 /* 3 3 * Property Sheets … … 13 13 */ 14 14 15 /* WINE 991212 level */ 15 /* 16 - Corel WINE 20000317 level 17 - (WINE 991212 level) 18 */ 16 19 17 20 #include <string.h> … … 88 91 */ 89 92 static BOOL PROPSHEET_CreateDialog(PropSheetInfo* psInfo); 93 static BOOL PROPSHEET_SizeMismatch(HWND hwndDlg, PropSheetInfo* psInfo); 90 94 static BOOL PROPSHEET_IsTooSmall(HWND hwndDlg, PropSheetInfo* psInfo); 91 95 static BOOL PROPSHEET_AdjustSize(HWND hwndDlg, PropSheetInfo* psInfo); … … 480 484 481 485 /****************************************************************************** 486 * PROPSHEET_SizeMismatch 487 * 488 * Verify that the tab control and the "largest" property sheet page dlg. template 489 * match in size. 490 */ 491 static BOOL PROPSHEET_SizeMismatch(HWND hwndDlg, PropSheetInfo* psInfo) 492 { 493 HWND hwndTabCtrl = GetDlgItem(hwndDlg, IDC_TABCONTROL); 494 RECT rcOrigTab, rcPage; 495 496 /* 497 * Original tab size. 498 */ 499 GetClientRect(hwndTabCtrl, &rcOrigTab); 500 //TRACE("orig tab %d %d %d %d\n", rcOrigTab.left, rcOrigTab.top, 501 // rcOrigTab.right, rcOrigTab.bottom); 502 503 /* 504 * Biggest page size. 505 */ 506 rcPage.left = psInfo->x; 507 rcPage.top = psInfo->y; 508 rcPage.right = psInfo->width; 509 rcPage.bottom = psInfo->height; 510 511 MapDialogRect(hwndDlg, &rcPage); 512 //TRACE("biggest page %d %d %d %d\n", rcPage.left, rcPage.top, 513 // rcPage.right, rcPage.bottom); 514 515 if ( (rcPage.right - rcPage.left) != (rcOrigTab.right - rcOrigTab.left) ) 516 return TRUE; 517 if ( (rcPage.bottom - rcPage.top) != (rcOrigTab.bottom - rcOrigTab.top) ) 518 return TRUE; 519 520 return FALSE; 521 } 522 523 /****************************************************************************** 482 524 * PROPSHEET_IsTooSmallWizard 483 525 * … … 2094 2136 else 2095 2137 { 2096 if (PROPSHEET_ IsTooSmall(hwnd, psInfo))2138 if (PROPSHEET_SizeMismatch(hwnd, psInfo)) 2097 2139 { 2098 2140 PROPSHEET_AdjustSize(hwnd, psInfo); -
trunk/src/comctl32/rebar.cpp
r2875 r3154 1 /* $Id: rebar.cpp,v 1. 1 2000-02-23 17:09:47 cbratschi Exp $ */1 /* $Id: rebar.cpp,v 1.2 2000-03-18 16:17:27 cbratschi Exp $ */ 2 2 /* 3 3 * Rebar control … … 29 29 #include "wingdi.h" 30 30 #include "commctrl.h" 31 #include "ccbase.h" 31 32 #include "rebar.h" 32 33 #include "comctl32.h" … … 42 43 43 44 44 #define REBAR_GetInfoPtr( wndPtr) ((REBAR_INFO *)GetWindowLongA (hwnd, 0))45 #define REBAR_GetInfoPtr(hwnd) ((REBAR_INFO*)getInfoPtr(hwnd)) 45 46 46 47 … … 909 910 910 911 static LRESULT 911 REBAR_GetUnicodeFormat (HWND hwnd)912 {913 REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);914 return infoPtr->bUnicode;915 }916 917 static LRESULT918 REBAR_GetVersion (HWND hwnd)919 {920 REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);921 return infoPtr->iVersion;922 }923 924 static LRESULT925 912 REBAR_HitTest (HWND hwnd, WPARAM wParam, LPARAM lParam) 926 913 { … … 1498 1485 { 1499 1486 REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd); 1500 HWND hwndTemp = infoPtr->h wndNotify;1501 1502 infoPtr->h wndNotify = (HWND)wParam;1487 HWND hwndTemp = infoPtr->header.hwndNotify; 1488 1489 infoPtr->header.hwndNotify = (HWND)wParam; 1503 1490 1504 1491 return (LRESULT)hwndTemp; … … 1523 1510 /* << REBAR_SetTooltips >> */ 1524 1511 1525 1526 static LRESULT1527 REBAR_SetUnicodeFormat (HWND hwnd, WPARAM wParam)1528 {1529 REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);1530 BOOL bTemp = infoPtr->bUnicode;1531 infoPtr->bUnicode = (BOOL)wParam;1532 return bTemp;1533 }1534 1535 static LRESULT1536 REBAR_SetVersion (HWND hwnd, INT iVersion)1537 {1538 REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);1539 INT iOldVersion = infoPtr->iVersion;1540 1541 if (iVersion > COMCTL32_VERSION)1542 return -1;1543 1544 infoPtr->iVersion = iVersion;1545 1546 return iOldVersion;1547 }1548 1512 1549 1513 static LRESULT … … 1613 1577 1614 1578 /* allocate memory for info structure */ 1615 infoPtr = (REBAR_INFO *)COMCTL32_Alloc (sizeof(REBAR_INFO)); 1616 SetWindowLongA (hwnd, 0, (DWORD)infoPtr); 1579 infoPtr = (REBAR_INFO*)initControl(hwnd,sizeof(REBAR_INFO)); 1617 1580 1618 1581 /* initialize info structure */ 1619 infoPtr->iVersion = 0;1620 1582 infoPtr->clrBk = CLR_NONE; 1621 1583 infoPtr->clrText = RGB(0, 0, 0); … … 1627 1589 infoPtr->hcurDrag = LoadCursorA (0, IDC_SIZEA); 1628 1590 1629 infoPtr->bUnicode = IsWindowUnicode (hwnd);1630 1631 1591 // if (GetWindowLongA (hwnd, GWL_STYLE) & RBS_AUTOSIZE) 1632 1592 // FIXME (rebar, "style RBS_AUTOSIZE set!\n"); 1633 1593 1634 #if 01635 SendMessageA (hwnd, WM_NOTIFYFORMAT, (WPARAM)hwnd, NF_QUERY);1636 #endif1637 1638 // TRACE (rebar, "created!\n");1639 1594 return 0; 1640 1595 } … … 1681 1636 1682 1637 /* free rebar info data */ 1683 COMCTL32_Free (infoPtr); 1684 1685 // TRACE (rebar, "destroyed!\n"); 1638 doneControl(hwnd); 1639 1686 1640 return 0; 1687 1641 } … … 1943 1897 return REBAR_GetToolTips (hwnd); 1944 1898 1945 case RB_GETUNICODEFORMAT:1946 return REBAR_GetUnicodeFormat (hwnd);1947 1948 case CCM_GETVERSION:1949 return REBAR_GetVersion (hwnd);1950 1951 1899 case RB_HITTEST: 1952 1900 return REBAR_HitTest (hwnd, wParam, lParam); … … 1993 1941 1994 1942 /* case RB_SETTOOLTIPS: */ 1995 1996 case RB_SETUNICODEFORMAT:1997 return REBAR_SetUnicodeFormat (hwnd, wParam);1998 1999 case CCM_SETVERSION:2000 return REBAR_SetVersion (hwnd, (INT)wParam);2001 1943 2002 1944 case RB_SHOWBAND: … … 2051 1993 // ERR (rebar, "unknown msg %04x wp=%08x lp=%08lx\n", 2052 1994 // uMsg, wParam, lParam); 2053 return DefWindowProcA (hwnd, uMsg, wParam, lParam);1995 return defComCtl32ProcA (hwnd, uMsg, wParam, lParam); 2054 1996 } 2055 1997 return 0; … … 2061 2003 { 2062 2004 WNDCLASSA wndClass; 2063 2064 //SvL: Don't check this now2065 // if (GlobalFindAtomA (REBARCLASSNAMEA)) return;2066 2005 2067 2006 ZeroMemory (&wndClass, sizeof(WNDCLASSA)); … … 2081 2020 REBAR_Unregister (VOID) 2082 2021 { 2083 if (GlobalFindAtomA (REBARCLASSNAMEA)) 2084 UnregisterClassA (REBARCLASSNAMEA, (HINSTANCE)NULL); 2085 } 2086 2022 UnregisterClassA (REBARCLASSNAMEA, (HINSTANCE)NULL); 2023 } 2024 -
trunk/src/comctl32/rsrc.orc
r3031 r3154 70 70 71 71 IDT_CHECK BITMAP LOADONCALL DISCARDABLE 72 { 72 { 73 73 '42 4D 8E 01 00 00 00 00 00 00 5E 00 00 00 28 00' 74 74 '00 00 1F 00 00 00 10 00 00 00 01 00 04 00 02 00' … … 959 959 BLOCK "VarFileInfo" 960 960 BEGIN 961 961 VALUE "Translation", 0x409, 0x04E4 962 962 END 963 963 END -
trunk/src/comctl32/status.cpp
r2875 r3154 1 /* $Id: status.cpp,v 1. 1 2000-02-23 17:09:48cbratschi Exp $ */1 /* $Id: status.cpp,v 1.2 2000-03-18 16:17:29 cbratschi Exp $ */ 2 2 /* 3 3 * Interface code to StatusWindow widget/control … … 14 14 #include "commctrl.h" 15 15 #include "comctl32.h" 16 #include "ccbase.h" 16 17 #include "status.h" 17 18 #include <string.h> … … 44 45 #define TEXT_SPACE 3 45 46 46 #define STATUSBAR_GetInfoPtr(hwnd) ((STATUSWINDOWINFO *)GetWindowLongA (hwnd, 0))47 #define STATUSBAR_GetInfoPtr(hwnd) ((STATUSWINDOWINFO*)getInfoPtr(hwnd)) 47 48 48 49 … … 489 490 490 491 return 0; 491 }492 493 494 static LRESULT495 STATUSBAR_GetUnicodeFormat (HWND hwnd)496 {497 STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd);498 return infoPtr->bUnicode;499 492 } 500 493 … … 793 786 STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd); 794 787 795 // TRACE (statusbar, "part %d: \"%s\"\n", (INT)wParam, (LPSTR)lParam);796 788 if (infoPtr->hwndToolTip) { 797 789 TTTOOLINFOW ti; … … 808 800 } 809 801 810 811 static LRESULT812 STATUSBAR_SetUnicodeFormat (HWND hwnd, WPARAM wParam)813 {814 STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd);815 BOOL bTemp = infoPtr->bUnicode;816 817 // TRACE (statusbar, "(0x%x)\n", (BOOL)wParam);818 infoPtr->bUnicode = (BOOL)wParam;819 820 return bTemp;821 }822 823 824 802 static LRESULT 825 803 STATUSBAR_Simple (HWND hwnd, WPARAM wParam, LPARAM lParam) … … 827 805 STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd); 828 806 HDC hdc; 829 NMHDR nmhdr;830 807 831 808 infoPtr->simple = (BOOL)wParam; 832 809 833 810 /* send notification */ 834 nmhdr.hwndFrom = hwnd; 835 nmhdr.idFrom = GetWindowLongA (hwnd, GWL_ID); 836 nmhdr.code = SBN_SIMPLEMODECHANGE; 837 SendMessageA (GetParent (hwnd), WM_NOTIFY, 0, (LPARAM)&nmhdr); 811 sendNotify(hwnd,SBN_SIMPLEMODECHANGE); 838 812 839 813 hdc = GetDC (hwnd); … … 855 829 STATUSWINDOWINFO *infoPtr; 856 830 857 infoPtr = (STATUSWINDOWINFO*)COMCTL32_Alloc (sizeof(STATUSWINDOWINFO)); 858 SetWindowLongA (hwnd, 0, (DWORD)infoPtr); 831 infoPtr = (STATUSWINDOWINFO*)initControl(hwnd,sizeof(STATUSWINDOWINFO)); 859 832 860 833 infoPtr->numParts = 1; … … 884 857 infoPtr->parts[0].hIcon = 0; 885 858 886 if ( IsWindowUnicode (hwnd)) {887 infoPtr->bUnicode = TRUE;888 if (lpCreate->lpszName &&889 (len = lstrlenW ((LPCWSTR)lpCreate->lpszName))){890 891 892 893 } 894 else{895 if (lpCreate->lpszName &&896 (len = lstrlenA ((LPCSTR)lpCreate->lpszName))){897 898 899 859 if (infoPtr->header.fUnicode) 860 { 861 if (lpCreate->lpszName && (len = lstrlenW ((LPCWSTR)lpCreate->lpszName))) 862 { 863 infoPtr->parts[0].text = (WCHAR*)COMCTL32_Alloc ((len + 1)*sizeof(WCHAR)); 864 lstrcpyW (infoPtr->parts[0].text, (LPCWSTR)lpCreate->lpszName); 865 } 866 } else 867 { 868 if (lpCreate->lpszName && (len = lstrlenA ((LPCSTR)lpCreate->lpszName))) 869 { 870 infoPtr->parts[0].text = (WCHAR*)COMCTL32_Alloc ((len + 1)*sizeof(WCHAR)); 871 lstrcpyAtoW (infoPtr->parts[0].text, (char*)lpCreate->lpszName); 872 } 900 873 } 901 874 … … 912 885 } 913 886 914 if (GetWindowLongA (hwnd, GWL_STYLE) & SBT_TOOLTIPS) { 915 infoPtr->hwndToolTip = 916 CreateWindowExA (0, TOOLTIPS_CLASSA, NULL, 0, 917 CW_USEDEFAULT, CW_USEDEFAULT, 918 CW_USEDEFAULT, CW_USEDEFAULT, 919 hwnd, 0, 920 GetWindowLongA (hwnd, GWL_HINSTANCE), NULL); 921 922 if (infoPtr->hwndToolTip) { 923 NMTOOLTIPSCREATED nmttc; 924 925 nmttc.hdr.hwndFrom = hwnd; 926 nmttc.hdr.idFrom = GetWindowLongA (hwnd, GWL_ID); 927 nmttc.hdr.code = NM_TOOLTIPSCREATED; 928 nmttc.hwndToolTips = infoPtr->hwndToolTip; 929 930 SendMessageA (GetParent (hwnd), WM_NOTIFY, 931 (WPARAM)nmttc.hdr.idFrom, (LPARAM)&nmttc); 932 } 933 } 887 if (GetWindowLongA(hwnd,GWL_STYLE) & SBT_TOOLTIPS) 888 infoPtr->hwndToolTip = createToolTip(hwnd,0,FALSE); 934 889 935 890 GetClientRect (GetParent (hwnd), &rect); … … 948 903 STATUSBAR_WMDestroy (HWND hwnd) 949 904 { 950 STATUSWINDOWINFO * self= STATUSBAR_GetInfoPtr (hwnd);905 STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd); 951 906 int i; 952 907 953 for (i = 0; i < self->numParts; i++) {954 if ( self->parts[i].text && !(self->parts[i].style & SBT_OWNERDRAW))955 COMCTL32_Free ( self->parts[i].text);956 } 957 if ( self->part0.text && !(self->part0.style & SBT_OWNERDRAW))958 COMCTL32_Free ( self->part0.text);959 COMCTL32_Free ( self->parts);908 for (i = 0; i < infoPtr->numParts; i++) { 909 if (infoPtr->parts[i].text && !(infoPtr->parts[i].style & SBT_OWNERDRAW)) 910 COMCTL32_Free (infoPtr->parts[i].text); 911 } 912 if (infoPtr->part0.text && !(infoPtr->part0.style & SBT_OWNERDRAW)) 913 COMCTL32_Free (infoPtr->part0.text); 914 COMCTL32_Free (infoPtr->parts); 960 915 961 916 /* delete default font */ 962 if ( self->hDefaultFont)963 DeleteObject ( self->hDefaultFont);917 if (infoPtr->hDefaultFont) 918 DeleteObject (infoPtr->hDefaultFont); 964 919 965 920 /* delete tool tip control */ 966 if (self->hwndToolTip) 967 DestroyWindow (self->hwndToolTip); 968 969 COMCTL32_Free (self); 921 destroyToolTip(infoPtr->hwndToolTip); 922 923 doneControl(hwnd); 970 924 971 925 return 0; … … 990 944 return 0; 991 945 len = lstrlenW (infoPtr->parts[0].text); 992 if (wParam > len) { 993 if (infoPtr->bUnicode) 994 lstrcpyW ((LPWSTR)lParam, infoPtr->parts[0].text); 995 else 996 lstrcpyWtoA ((LPSTR)lParam, infoPtr->parts[0].text); 997 return len; 946 if (wParam > len) 947 { 948 if (infoPtr->header.fUnicode) 949 lstrcpyW ((LPWSTR)lParam, infoPtr->parts[0].text); 950 else 951 lstrcpyWtoA ((LPSTR)lParam, infoPtr->parts[0].text); 952 return len; 998 953 } 999 954 … … 1109 1064 COMCTL32_Free (part->text); 1110 1065 part->text = 0; 1111 if (infoPtr-> bUnicode) {1066 if (infoPtr->header.fUnicode) { 1112 1067 if (lParam && (len = lstrlenW((LPCWSTR)lParam))) { 1113 1068 part->text = (WCHAR*)COMCTL32_Alloc ((len+1)*sizeof(WCHAR)); … … 1160 1115 } 1161 1116 1162 1163 static LRESULT1164 STATUSBAR_SendNotify (HWND hwnd, UINT code)1165 {1166 NMHDR nmhdr;1167 1168 nmhdr.hwndFrom = hwnd;1169 nmhdr.idFrom = GetWindowLongA (hwnd, GWL_ID);1170 nmhdr.code = code;1171 SendMessageA (GetParent (hwnd), WM_NOTIFY, 0, (LPARAM)&nmhdr);1172 return 0;1173 }1174 1175 1176 1177 1117 static LRESULT WINAPI 1178 1118 StatusWindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) … … 1207 1147 return STATUSBAR_GetTipTextW (hwnd, wParam, lParam); 1208 1148 1209 case SB_GETUNICODEFORMAT:1210 return STATUSBAR_GetUnicodeFormat (hwnd);1211 1212 1149 case SB_ISSIMPLE: 1213 1150 return STATUSBAR_IsSimple (hwnd); … … 1237 1174 return STATUSBAR_SetTipTextW (hwnd, wParam, lParam); 1238 1175 1239 case SB_SETUNICODEFORMAT:1240 return STATUSBAR_SetUnicodeFormat (hwnd, wParam);1241 1242 1176 case SB_SIMPLE: 1243 1177 return STATUSBAR_Simple (hwnd, wParam, lParam); … … 1260 1194 1261 1195 case WM_LBUTTONDBLCLK: 1262 return STATUSBAR_SendNotify (hwnd,NM_DBLCLK);1196 return sendNotify(hwnd,NM_DBLCLK); 1263 1197 1264 1198 case WM_LBUTTONUP: 1265 return STATUSBAR_SendNotify (hwnd,NM_CLICK);1199 return sendNotify(hwnd,NM_CLICK); 1266 1200 1267 1201 case WM_MOUSEMOVE: … … 1281 1215 1282 1216 case WM_RBUTTONDBLCLK: 1283 return STATUSBAR_SendNotify (hwnd,NM_RDBLCLK);1217 return sendNotify(hwnd,NM_RDBLCLK); 1284 1218 1285 1219 case WM_RBUTTONUP: 1286 return STATUSBAR_SendNotify (hwnd,NM_RCLICK);1220 return sendNotify(hwnd,NM_RCLICK); 1287 1221 1288 1222 case WM_SETFONT: … … 1299 1233 // ERR (statusbar, "unknown msg %04x wp=%04x lp=%08lx\n", 1300 1234 // msg, wParam, lParam); 1301 return DefWindowProcA (hwnd, msg, wParam, lParam);1235 return defComCtl32ProcA (hwnd, msg, wParam, lParam); 1302 1236 } 1303 1237 return 0; … … 1315 1249 { 1316 1250 WNDCLASSA wndClass; 1317 1318 //SvL: Don't check this now1319 // if (GlobalFindAtomA (STATUSCLASSNAMEA)) return;1320 1251 1321 1252 ZeroMemory (&wndClass, sizeof(WNDCLASSA)); … … 1341 1272 STATUS_Unregister (VOID) 1342 1273 { 1343 if (GlobalFindAtomA (STATUSCLASSNAMEA)) 1344 UnregisterClassA (STATUSCLASSNAMEA, (HINSTANCE)NULL); 1345 } 1346 1274 UnregisterClassA (STATUSCLASSNAMEA, (HINSTANCE)NULL); 1275 } 1276 -
trunk/src/comctl32/tab.cpp
r2875 r3154 1 /* $Id: tab.cpp,v 1. 1 2000-02-23 17:09:48cbratschi Exp $ */1 /* $Id: tab.cpp,v 1.2 2000-03-18 16:17:30 cbratschi Exp $ */ 2 2 /* 3 3 * Tab control … … 16 16 17 17 /* inconsistent: report! */ 18 /* WINE 991212 level */ 18 /* 19 - Corel WINE 20000317 level 20 - (WINE 991212 level) 21 */ 19 22 20 23 #include <string.h> … … 22 25 #include "winbase.h" 23 26 #include "commctrl.h" 27 #include "ccbase.h" 24 28 #include "tab.h" 25 29 #include "comctl32.h" … … 42 46 #define DEFAULT_TAB_WIDTH 96 43 47 44 #define TAB_GetInfoPtr(hwnd) ((TAB_INFO *)GetWindowLongA(hwnd,0))48 #define TAB_GetInfoPtr(hwnd) ((TAB_INFO*)getInfoPtr(hwnd)) 45 49 46 50 /****************************************************************************** … … 50 54 static void TAB_InvalidateTabArea(HWND hwnd, TAB_INFO* infoPtr); 51 55 static void TAB_EnsureSelectionVisible(HWND hwnd, TAB_INFO* infoPtr); 52 53 static BOOL54 TAB_SendSimpleNotify (HWND hwnd, UINT code)55 {56 NMHDR nmhdr;57 58 nmhdr.hwndFrom = hwnd;59 nmhdr.idFrom = GetWindowLongA(hwnd, GWL_ID);60 nmhdr.code = code;61 62 return (BOOL) SendMessageA (GetParent (hwnd), WM_NOTIFY,63 (WPARAM) nmhdr.idFrom, (LPARAM) &nmhdr);64 }65 66 56 67 57 static VOID … … 82 72 } 83 73 84 85 86 74 static LRESULT 87 75 TAB_GetCurSel (HWND hwnd) … … 140 128 } else { 141 129 if (infoPtr->iSelected != iItem) { 142 if ( TAB_SendSimpleNotify(hwnd, TCN_SELCHANGING)!=TRUE) {130 if (sendNotify(hwnd,TCN_SELCHANGING) != TRUE) { 143 131 infoPtr->iSelected = iItem; 144 TAB_SendSimpleNotify(hwnd,TCN_SELCHANGE);132 sendNotify(hwnd,TCN_SELCHANGE); 145 133 146 134 TAB_EnsureSelectionVisible(hwnd, infoPtr); … … 282 270 (infoPtr->uFocus != newItem) ) 283 271 { 284 if (! TAB_SendSimpleNotify(hwnd,TCN_SELCHANGING))272 if (!sendNotify(hwnd,TCN_SELCHANGING)) 285 273 { 286 274 infoPtr->iSelected = newItem; 287 275 infoPtr->uFocus = newItem; 288 TAB_SendSimpleNotify(hwnd,TCN_SELCHANGE);276 sendNotify(hwnd,TCN_SELCHANGE); 289 277 290 278 TAB_EnsureSelectionVisible(hwnd, infoPtr); … … 404 392 (infoPtr->iSelected != newItem) ) 405 393 { 406 if ( TAB_SendSimpleNotify(hwnd, TCN_SELCHANGING)!=TRUE)394 if (sendNotify(hwnd,TCN_SELCHANGING) != TRUE) 407 395 { 408 396 infoPtr->iSelected = newItem; 409 397 infoPtr->uFocus = newItem; 410 TAB_SendSimpleNotify(hwnd, TCN_SELCHANGE);398 sendNotify(hwnd, TCN_SELCHANGE); 411 399 412 400 TAB_EnsureSelectionVisible(hwnd, infoPtr); … … 440 428 (infoPtr->iSelected != newItem) ) 441 429 { 442 if ( TAB_SendSimpleNotify(hwnd, TCN_SELCHANGING)!=TRUE)430 if (sendNotify(hwnd,TCN_SELCHANGING) != TRUE) 443 431 { 444 432 infoPtr->iSelected = newItem; 445 433 infoPtr->uFocus = newItem; 446 TAB_SendSimpleNotify(hwnd,TCN_SELCHANGE);434 sendNotify(hwnd,TCN_SELCHANGE); 447 435 448 436 TAB_EnsureSelectionVisible(hwnd, infoPtr); … … 451 439 } 452 440 } 453 TAB_SendSimpleNotify(hwnd,NM_CLICK);441 sendNotify(hwnd,NM_CLICK); 454 442 455 443 return 0; … … 459 447 TAB_RButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam) 460 448 { 461 TAB_SendSimpleNotify(hwnd, NM_RCLICK); 449 sendNotify(hwnd,NM_RCLICK); 450 462 451 return 0; 463 452 } … … 805 794 clientRect.right); 806 795 796 /* Don't need scrolling, then update infoPtr->leftmostVisible */ 797 if(!infoPtr->needsScrolling) 798 infoPtr->leftmostVisible = 0; 799 807 800 TAB_SetupScrolling(hwnd, infoPtr, &clientRect); 808 801 … … 1379 1372 infoPtr->items[iItem].lParam = pti->lParam; 1380 1373 1374 TAB_SetItemBounds(hwnd); 1381 1375 TAB_InvalidateTabArea(hwnd, infoPtr); 1382 1376 … … 1384 1378 // hwnd, iItem, infoPtr->items[iItem].pszText); 1385 1379 1386 TAB_SetItemBounds(hwnd);1387 1380 return iItem; 1388 1381 } … … 1446 1439 infoPtr->items[iItem].lParam = pti->lParam; 1447 1440 1441 TAB_SetItemBounds(hwnd); 1448 1442 TAB_InvalidateTabArea(hwnd, infoPtr); 1449 1443 … … 1451 1445 // hwnd, iItem, infoPtr->items[iItem].pszText); 1452 1446 1453 TAB_SetItemBounds(hwnd);1454 1447 return iItem; 1455 1448 } … … 1783 1776 HDC hdc; 1784 1777 HFONT hOldFont; 1785 1786 infoPtr = (TAB_INFO *)COMCTL32_Alloc (sizeof(TAB_INFO)); 1787 1788 SetWindowLongA(hwnd, 0, (DWORD)infoPtr); 1778 DWORD dwStyle; 1779 1780 infoPtr = (TAB_INFO*)initControl(hwnd,sizeof(TAB_INFO)); 1789 1781 1790 1782 infoPtr->uNumItem = 0; … … 1800 1792 infoPtr->leftmostVisible = 0; 1801 1793 1802 // TRACE(tab, "Created tab control, hwnd [%04x]\n", hwnd); 1803 if (GetWindowLongA(hwnd, GWL_STYLE) & TCS_TOOLTIPS) { 1804 /* Create tooltip control */ 1805 infoPtr->hwndToolTip = 1806 CreateWindowExA (0, TOOLTIPS_CLASSA, NULL, 0, 1807 CW_USEDEFAULT, CW_USEDEFAULT, 1808 CW_USEDEFAULT, CW_USEDEFAULT, 1809 hwnd, 0, 0, 0); 1810 1811 /* Send NM_TOOLTIPSCREATED notification */ 1812 if (infoPtr->hwndToolTip) { 1813 NMTOOLTIPSCREATED nmttc; 1814 1815 nmttc.hdr.hwndFrom = hwnd; 1816 nmttc.hdr.idFrom = GetWindowLongA(hwnd, GWL_ID); 1817 nmttc.hdr.code = NM_TOOLTIPSCREATED; 1818 nmttc.hwndToolTips = infoPtr->hwndToolTip; 1819 1820 SendMessageA (GetParent (hwnd), WM_NOTIFY, 1821 (WPARAM)GetWindowLongA(hwnd, GWL_ID), (LPARAM)&nmttc); 1822 } 1823 } 1794 /* The tab control always has the WS_CLIPSIBLINGS style. Even 1795 if you don't specify in CreateWindow. This is necesary in 1796 order for paint to work correctly. This follows windows behaviour. */ 1797 dwStyle = GetWindowLongA(hwnd, GWL_STYLE); 1798 SetWindowLongA(hwnd, GWL_STYLE, dwStyle|WS_CLIPSIBLINGS); 1799 1800 1801 /* Create tooltip control */ 1802 if (dwStyle & TCS_TOOLTIPS) 1803 infoPtr->hwndToolTip = createToolTip(hwnd,0,FALSE); 1824 1804 1825 1805 /* … … 1873 1853 DestroyWindow(infoPtr->hwndUpDown); 1874 1854 1875 COMCTL32_Free (infoPtr); 1855 doneControl(hwnd); 1856 1876 1857 return 0; 1877 1858 } … … 2044 2025 // ERR (tab, "unknown msg %04x wp=%08x lp=%08lx\n", 2045 2026 // uMsg, wParam, lParam); 2046 return DefWindowProcA (hwnd, uMsg, wParam, lParam);2027 return defComCtl32ProcA (hwnd, uMsg, wParam, lParam); 2047 2028 } 2048 2029 … … 2055 2036 { 2056 2037 WNDCLASSA wndClass; 2057 2058 //SvL: Don't check this now2059 // if (GlobalFindAtomA (WC_TABCONTROLA)) return;2060 2038 2061 2039 ZeroMemory (&wndClass, sizeof(WNDCLASSA)); … … 2075 2053 TAB_Unregister (VOID) 2076 2054 { 2077 if (GlobalFindAtomA (WC_TABCONTROLA)) 2078 UnregisterClassA (WC_TABCONTROLA, (HINSTANCE)NULL); 2079 } 2080 2055 UnregisterClassA (WC_TABCONTROLA, (HINSTANCE)NULL); 2056 } 2057 -
trunk/src/comctl32/toolbar.cpp
r3145 r3154 1 /* $Id: toolbar.cpp,v 1. 2 2000-03-17 17:13:24cbratschi Exp $ */1 /* $Id: toolbar.cpp,v 1.3 2000-03-18 16:17:31 cbratschi Exp $ */ 2 2 /* 3 3 * Toolbar control … … 29 29 30 30 /* 31 - Corel 20000 212level31 - Corel 20000317 level 32 32 - WINE 991212 level 33 33 */ … … 44 44 #include "cache.h" 45 45 #include "comctl32.h" 46 #include "ccbase.h" 46 47 #include "toolbar.h" 47 48 … … 50 51 #define BOTTOM_BORDER 2 51 52 52 #define TOOLBAR_GetInfoPtr(hwnd) ((TOOLBAR_INFO *)GetWindowLongA(hwnd,0))53 #define TOOLBAR_GetInfoPtr(hwnd) ((TOOLBAR_INFO*)getInfoPtr(hwnd)) 53 54 54 55 … … 738 739 } 739 740 740 static void TBCUSTOMIZE_GetToolName A(TOOLBAR_INFO* infoPtr,TBUTTON_INFO* btnPtr,INT pos)741 static void TBCUSTOMIZE_GetToolName(TOOLBAR_INFO* infoPtr,TBUTTON_INFO* btnPtr,INT pos) 741 742 { 742 743 if (btnPtr->iString > -1 && btnPtr->iString < infoPtr->nNumStrings) … … 751 752 { 752 753 if (!btnPtr->pszName) btnPtr->pszName = (WCHAR*)COMCTL32_Alloc(MAXTOOLNAME*sizeof(WCHAR)); 753 lstrcpy AtoW(btnPtr->pszName,"Separator");754 lstrcpyW(btnPtr->pszName,(WCHAR*)L"Separator"); 754 755 } else 755 756 { 756 TBNOTIFYA tbNotify; 757 758 tbNotify.hdr.hwndFrom = infoPtr->hwndToolbar; 759 tbNotify.hdr.idFrom = GetWindowLongA(infoPtr->hwndToolbar,GWL_ID); 760 tbNotify.hdr.code = TBN_GETBUTTONINFOA; 757 TBNOTIFYW tbNotify; 758 BOOL unicode = isUnicodeNotify(&infoPtr->header); 759 761 760 tbNotify.iItem = pos; 762 761 tbNotify.tbButton = (TBBUTTON*)btnPtr; 763 762 tbNotify.cchText = MAXTOOLNAME; 764 tbNotify.pszText = (CHAR*)COMCTL32_Alloc(MAXTOOLNAME); 765 tbNotify.pszText[0] = 0; 766 767 if (!SendMessageA(infoPtr->hwndNotify,WM_NOTIFY,(WPARAM)tbNotify.hdr.idFrom,(LPARAM)&tbNotify)) 768 { //CB: failed, try other methods 769 if (infoPtr->hwndToolTip) 770 { //try to get tool tip text 771 TTTOOLINFOA ti; 772 773 ZeroMemory (&ti,sizeof(ti)); 774 ti.cbSize = sizeof(ti); 775 ti.hwnd = infoPtr->hwndToolbar; 776 ti.uId = btnPtr->idCommand; 777 ti.hinst = 0; 778 ti.lpszText = (CHAR*)COMCTL32_Alloc(INFOTIPSIZE); 779 ti.lpszText[0] = 0; 780 781 SendMessageA(infoPtr->hwndToolTip,TTM_GETTEXTA,0,(LPARAM)&ti); 782 if (ti.lpszText[0] != 0) lstrcpynA(tbNotify.pszText,ti.lpszText,MAXTOOLNAME); 783 else strcpy(tbNotify.pszText,"Button"); 784 785 COMCTL32_Free(ti.lpszText); 786 787 } else strcpy(tbNotify.pszText,"Button"); 788 } 789 790 if (!btnPtr->pszName) btnPtr->pszName = (WCHAR*)COMCTL32_Alloc(MAXTOOLNAME*sizeof(WCHAR)); 791 lstrcpyAtoW(btnPtr->pszName,tbNotify.pszText); 792 COMCTL32_Free(tbNotify.pszText); 793 } 794 } 795 796 static void TBCUSTOMIZE_GetToolNameW(TOOLBAR_INFO* infoPtr,TBUTTON_INFO* btnPtr,INT pos) 797 { 798 if (btnPtr->iString > -1 && btnPtr->iString < infoPtr->nNumStrings) 799 { 800 if (!btnPtr->pszName) btnPtr->pszName = (WCHAR*)COMCTL32_Alloc(MAXTOOLNAME*sizeof(WCHAR)); 801 lstrcpynW(btnPtr->pszName,infoPtr->strings[btnPtr->iString],MAXTOOLNAME*sizeof(WCHAR)); 802 803 return; 804 } 805 806 if (btnPtr->fsStyle & TBSTYLE_SEP) 807 { 808 if (!btnPtr->pszName) btnPtr->pszName = (WCHAR*)COMCTL32_Alloc(MAXTOOLNAME*sizeof(WCHAR)); 809 lstrcpyAtoW(btnPtr->pszName,"Separator"); 810 } else 811 { 812 TBNOTIFYW tbNotify; 813 814 if (!btnPtr->pszName) btnPtr->pszName = (WCHAR*)COMCTL32_Alloc(MAXTOOLNAME*sizeof(WCHAR)); 815 btnPtr->pszName[0] = 0; 816 817 tbNotify.hdr.hwndFrom = infoPtr->hwndToolbar; 818 tbNotify.hdr.idFrom = GetWindowLongA(infoPtr->hwndToolbar,GWL_ID); 819 tbNotify.hdr.code = TBN_GETBUTTONINFOW; 820 tbNotify.iItem = pos; 821 tbNotify.tbButton = (TBBUTTON*)btnPtr; 822 tbNotify.cchText = MAXTOOLNAME; 823 tbNotify.pszText = btnPtr->pszName; 824 825 if (!SendMessageW(infoPtr->hwndNotify,WM_NOTIFY,(WPARAM)tbNotify.hdr.idFrom,(LPARAM)&tbNotify)) 763 if (unicode) 764 { 765 tbNotify.pszText = (WCHAR*)COMCTL32_Alloc(MAXTOOLNAME*sizeof(WCHAR)); 766 tbNotify.pszText[0] = 0; 767 } else 768 { 769 tbNotify.pszText = (WCHAR*)COMCTL32_Alloc(MAXTOOLNAME*sizeof(CHAR)); 770 ((CHAR*)tbNotify.pszText)[0] = 0; 771 } 772 773 if (!sendNotify(infoPtr->hwndToolbar,unicode ? TBN_GETBUTTONINFOW:TBN_GETBUTTONINFOA,&tbNotify.hdr)) 826 774 { //CB: failed, try other methods 827 775 if (infoPtr->hwndToolTip) … … 837 785 ti.lpszText[0] = 0; 838 786 839 SendMessageA(infoPtr->hwndToolTip,TTM_GETTEXTW,0,(LPARAM)&ti); 840 if (ti.lpszText[0] != 0) lstrcpynW(btnPtr->pszName,ti.lpszText,MAXTOOLNAME); 841 else lstrcpyAtoW(btnPtr->pszName,"Button"); 787 SendMessageW(infoPtr->hwndToolTip,TTM_GETTEXTW,0,(LPARAM)&ti); 788 if (unicode) 789 { 790 if (ti.lpszText[0] != 0) lstrcpynW(tbNotify.pszText,ti.lpszText,MAXTOOLNAME); 791 else lstrcpyW(tbNotify.pszText,(WCHAR*)L"Button"); 792 } else 793 { 794 if (ti.lpszText[0] != 0) lstrcpynWtoA((CHAR*)tbNotify.pszText,ti.lpszText,MAXTOOLNAME); 795 else lstrcpyWtoA((CHAR*)tbNotify.pszText,(WCHAR*)L"Button"); 796 } 842 797 843 798 COMCTL32_Free(ti.lpszText); 844 799 845 } else lstrcpyAtoW(btnPtr->pszName,"Button"); 846 } 800 } else 801 { 802 if (unicode) 803 lstrcpyW(tbNotify.pszText,(WCHAR*)L"Button"); 804 else 805 lstrcpyA((CHAR*)tbNotify.pszText,"Button"); 806 } 807 } 808 809 if (!btnPtr->pszName) btnPtr->pszName = (WCHAR*)COMCTL32_Alloc(MAXTOOLNAME*sizeof(WCHAR)); 810 if (unicode) 811 lstrcpyW(btnPtr->pszName,tbNotify.pszText); 812 else 813 lstrcpyAtoW(btnPtr->pszName,(CHAR*)tbNotify.pszText); 814 COMCTL32_Free(tbNotify.pszText); 847 815 } 848 816 } … … 872 840 for (i = 0; i < infoPtr->nNumButtons; i++, btnPtr++) 873 841 { 874 if (IsWindowUnicode(infoPtr->hwndNotify)) 875 { 876 TBNOTIFYW tbNotify; 877 878 tbNotify.hdr.hwndFrom = infoPtr->hwndToolbar; 879 tbNotify.hdr.idFrom = GetWindowLongA(infoPtr->hwndToolbar,GWL_ID); 880 tbNotify.iItem = i; 881 tbNotify.tbButton = (TBBUTTON*)btnPtr; 882 tbNotify.cchText = 0; 883 tbNotify.pszText = NULL; 884 885 // send TBN_QUERYINSERT notification 886 887 tbNotify.hdr.code = TBN_QUERYINSERT; 888 889 if (!SendMessageW(infoPtr->hwndNotify,WM_NOTIFY,(WPARAM)tbNotify.hdr.idFrom,(LPARAM)&tbNotify)) continue; 890 891 // send TBN_QUERYDELETE notification 892 893 tbNotify.hdr.code = TBN_QUERYDELETE; 894 895 btnPtr->bDelete = (BOOL)SendMessageW(infoPtr->hwndNotify,WM_NOTIFY,(WPARAM)tbNotify.hdr.idFrom,(LPARAM)&tbNotify); 896 897 //get tool name 898 899 TBCUSTOMIZE_GetToolNameW(infoPtr,btnPtr,i); 900 901 } else 902 { 903 TBNOTIFYA tbNotify; 904 905 tbNotify.hdr.hwndFrom = infoPtr->hwndToolbar; 906 tbNotify.hdr.idFrom = GetWindowLongA(infoPtr->hwndToolbar,GWL_ID); 907 tbNotify.iItem = i; 908 tbNotify.tbButton = (TBBUTTON*)btnPtr; 909 tbNotify.cchText = 0; 910 tbNotify.pszText = NULL; 911 912 // send TBN_QUERYINSERT notification 913 914 tbNotify.hdr.code = TBN_QUERYINSERT; 915 916 if (!SendMessageA(infoPtr->hwndNotify,WM_NOTIFY,(WPARAM)tbNotify.hdr.idFrom,(LPARAM)&tbNotify)) continue; 917 918 // send TBN_QUERYDELETE notification 919 920 tbNotify.hdr.code = TBN_QUERYDELETE; 921 922 btnPtr->bDelete = (BOOL)SendMessageA(infoPtr->hwndNotify,WM_NOTIFY,(WPARAM)tbNotify.hdr.idFrom,(LPARAM)&tbNotify); 923 924 //get tool name 925 926 TBCUSTOMIZE_GetToolNameA(infoPtr,btnPtr,i); 927 } 842 TBNOTIFYW tbNotify; 843 844 tbNotify.iItem = i; 845 tbNotify.tbButton = (TBBUTTON*)btnPtr; 846 tbNotify.cchText = 0; 847 tbNotify.pszText = NULL; 848 849 // send TBN_QUERYINSERT notification 850 if (!sendNotify(infoPtr->hwndToolbar,TBN_QUERYINSERT,&tbNotify.hdr)) continue; 851 852 // send TBN_QUERYDELETE notification 853 btnPtr->bDelete = (BOOL)sendNotify(infoPtr->hwndToolbar,TBN_QUERYDELETE,&tbNotify.hdr); 854 855 //get tool name 856 857 TBCUSTOMIZE_GetToolName(infoPtr,btnPtr,i); 928 858 929 859 if (btnPtr->fsState & TBSTATE_HIDDEN) … … 959 889 { 960 890 TOOLBAR_INFO* infoPtr; 891 DWORD dwStyle; 961 892 962 893 infoPtr = (TOOLBAR_INFO*)lParam; 963 894 SetWindowLongA(hwnd,DWL_USER,(DWORD)infoPtr); 895 dwStyle = GetWindowLongA(infoPtr->hwndToolbar,GWL_STYLE); 964 896 965 897 if (infoPtr) 966 898 { 967 INT x ;899 INT x,itemHeight; 968 900 969 901 //custom ID: 1-nNumButtons, 0 == new separator … … 980 912 memcpy(&infoPtr->oldButtons[0],&infoPtr->buttons[0],infoPtr->nNumOldButtons*sizeof(TBUTTON_INFO)); 981 913 914 //set height 915 if (dwStyle & TBSTYLE_FLAT) 916 itemHeight = infoPtr->nBitmapHeight+4; 917 else 918 itemHeight = infoPtr->nBitmapHeight+8; 919 920 SendDlgItemMessageA(hwnd,IDC_AVAILBTN_LBOX,LB_SETITEMHEIGHT,0,itemHeight); 921 SendDlgItemMessageA(hwnd,IDC_TOOLBARBTN_LBOX,LB_SETITEMHEIGHT,0,itemHeight); 922 923 infoPtr->changed = FALSE; 924 982 925 if (!TBCUSTOMIZE_FillData(hwnd,infoPtr)) EndDialog(hwnd,FALSE); 983 } 926 } else EndDialog(hwnd,FALSE); 984 927 985 928 return TRUE; … … 996 939 { 997 940 TOOLBAR_INFO* infoPtr = (TOOLBAR_INFO*)GetWindowLongA(hwnd,DWL_USER); 998 NMHDR nmhdr;999 941 INT x; 1000 942 943 if (!infoPtr->changed) return; 944 1001 945 //Send TBN_RESET 1002 nmhdr.hwndFrom = infoPtr->hwndToolbar; 1003 nmhdr.idFrom = GetWindowLongA(infoPtr->hwndToolbar,GWL_ID); 1004 nmhdr.code = TBN_RESET; 1005 1006 SendMessageA(infoPtr->hwndNotify,WM_NOTIFY,(WPARAM)nmhdr.idFrom,(LPARAM)&nmhdr); 946 sendNotify(infoPtr->hwndToolbar,TBN_RESET); 1007 947 1008 948 for (x = 0;x < infoPtr->nNumOldButtons;x++) COMCTL32_Free(infoPtr->oldButtons[x].pszName); … … 1021 961 TOOLBAR_CalcToolbar(infoPtr->hwndToolbar); 1022 962 InvalidateRect(infoPtr->hwndToolbar,NULL,TRUE); 963 964 infoPtr->changed = FALSE; 1023 965 } 1024 966 … … 1143 1085 TOOLBAR_CalcToolbar(infoPtr->hwndToolbar); 1144 1086 InvalidateRect(infoPtr->hwndToolbar,NULL,TRUE); 1087 1088 infoPtr->changed = TRUE; 1145 1089 } 1146 1090 … … 1261 1205 TOOLBAR_CalcToolbar(infoPtr->hwndToolbar); 1262 1206 InvalidateRect(infoPtr->hwndToolbar,NULL,TRUE); 1207 1208 infoPtr->changed = TRUE; 1263 1209 } 1264 1210 … … 1266 1212 { 1267 1213 TOOLBAR_INFO* infoPtr = (TOOLBAR_INFO*)GetWindowLongA(hwnd,DWL_USER); 1268 NMHDR nmhdr;1269 1214 1270 1215 //Send TBN_CUSTHELP 1271 nmhdr.hwndFrom = infoPtr->hwndToolbar; 1272 nmhdr.idFrom = GetWindowLongA(infoPtr->hwndToolbar,GWL_ID); 1273 nmhdr.code = TBN_CUSTHELP; 1274 1275 SendMessageA(infoPtr->hwndNotify,WM_NOTIFY,(WPARAM)nmhdr.idFrom,(LPARAM)&nmhdr); 1216 sendNotify(infoPtr->hwndToolbar,TBN_CUSTHELP); 1276 1217 } 1277 1218 … … 1310 1251 TOOLBAR_CalcToolbar(infoPtr->hwndToolbar); 1311 1252 InvalidateRect(infoPtr->hwndToolbar,NULL,TRUE); 1253 1254 infoPtr->changed = TRUE; 1312 1255 } 1313 1256 … … 1349 1292 TOOLBAR_CalcToolbar(infoPtr->hwndToolbar); 1350 1293 InvalidateRect(infoPtr->hwndToolbar,NULL,TRUE); 1294 1295 infoPtr->changed = TRUE; 1351 1296 } 1352 1297 … … 1400 1345 EndDialog(hwnd,FALSE); 1401 1346 break; 1347 1402 1348 case IDC_RESET_BTN: 1403 1349 TBCUSTOMIZE_Reset(hwnd); 1404 1350 break; 1351 1405 1352 case IDOK: //== add tool 1406 1353 TBCUSTOMIZE_AddTool(hwnd); 1407 1354 break; 1355 1408 1356 case IDC_REMOVE_BTN: 1409 1357 TBCUSTOMIZE_RemoveTool(hwnd); 1410 1358 break; 1359 1411 1360 case IDC_HELP_BTN: 1412 1361 TBCUSTOMIZE_Help(hwnd); 1413 1362 break; 1363 1414 1364 case IDC_MOVEUP_BTN: 1415 1365 TBCUSTOMIZE_MoveToolUp(hwnd); 1416 1366 break; 1367 1417 1368 case IDC_MOVEDN_BTN: 1418 1369 TBCUSTOMIZE_MoveToolDown(hwnd); 1419 1370 break; 1371 1420 1372 case IDC_AVAILBTN_LBOX: 1421 1373 switch(HIWORD(wParam)) … … 1429 1381 } 1430 1382 break; 1383 1431 1384 case IDC_TOOLBARBTN_LBOX: 1432 1385 switch(HIWORD(wParam)) … … 1551 1504 } 1552 1505 1553 static BOOL TBCUSTOMIZE_MeasureItem(HWND hwnd,WPARAM wParam,LPARAM lParam)1554 {1555 if (wParam == IDC_AVAILBTN_LBOX || wParam == IDC_TOOLBARBTN_LBOX)1556 {1557 TOOLBAR_INFO* infoPtr = (TOOLBAR_INFO*)GetWindowLongA(hwnd,DWL_USER);1558 MEASUREITEMSTRUCT *lpmis = (MEASUREITEMSTRUCT*)lParam;1559 1560 if (infoPtr)1561 {1562 DWORD dwStyle = GetWindowLongA(infoPtr->hwndToolbar,GWL_STYLE);1563 1564 if (dwStyle & TBSTYLE_FLAT)1565 lpmis->itemHeight = infoPtr->nBitmapHeight+4;1566 else1567 lpmis->itemHeight = infoPtr->nBitmapHeight+8;1568 } else lpmis->itemHeight = 16+8;1569 1570 return TRUE;1571 }1572 1573 return FALSE;1574 }1575 1576 /***********************************************************************1577 * TOOLBAR_CustomizeDialogProc1578 * This function implements the toolbar customization dialog.1579 */1580 1581 1506 /*********************************************************************** 1582 1507 * TOOLBAR_CustomizeDialogProc … … 1604 1529 case WM_DRAWITEM: 1605 1530 return TBCUSTOMIZE_DrawItem(hwnd,wParam,lParam); 1606 1607 case WM_MEASUREITEM:1608 return TBCUSTOMIZE_MeasureItem(hwnd,wParam,lParam);1609 1531 1610 1532 default: … … 2076 1998 cx, cy, uPosFlags); 2077 1999 2000 /* The following line makes sure that the infoPtr->bAutoSize is turned off after 2001 * the setwindowpos calls */ 2002 infoPtr->bAutoSize = FALSE; 2003 2078 2004 return 0; 2079 2005 } … … 2194 2120 LPCVOID temp; 2195 2121 HRSRC hRes; 2196 NMHDR nmhdr;2197 2122 2198 2123 if (infoPtr->nNumButtons == 0) return 0; 2199 2124 2200 2125 /* send TBN_BEGINADJUST notification */ 2201 nmhdr.hwndFrom = hwnd; 2202 nmhdr.idFrom = GetWindowLongA(hwnd,GWL_ID); 2203 nmhdr.code = TBN_BEGINADJUST; 2204 2205 SendMessageA (infoPtr->hwndNotify,WM_NOTIFY,(WPARAM)nmhdr.idFrom,(LPARAM)&nmhdr); 2126 sendNotify(hwnd,TBN_BEGINADJUST); 2206 2127 2207 2128 if (!(hRes = FindResourceA (COMCTL32_hModule, … … 2220 2141 2221 2142 /* send TBN_ENDADJUST notification */ 2222 nmhdr.code = TBN_ENDADJUST; 2223 2224 SendMessageA(infoPtr->hwndNotify,WM_NOTIFY,(WPARAM)nmhdr.idFrom,(LPARAM)&nmhdr); 2143 sendNotify(hwnd,TBN_ENDADJUST); 2225 2144 2226 2145 return ret; … … 2723 2642 2724 2643 static LRESULT 2725 TOOLBAR_GetUnicodeFormat (HWND hwnd, WPARAM wParam, LPARAM lParam)2726 {2727 TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);2728 2729 // TRACE (toolbar, "%s hwnd=0x%x stub!\n",2730 // infoPtr->bUnicode ? "TRUE" : "FALSE", hwnd);2731 2732 return infoPtr->bUnicode;2733 }2734 2735 static LRESULT2736 TOOLBAR_GetVersion (HWND hwnd)2737 {2738 TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);2739 return infoPtr->iVersion;2740 }2741 2742 static LRESULT2743 2644 TOOLBAR_HideButton (HWND hwnd, WPARAM wParam, LPARAM lParam) 2744 2645 { … … 3403 3304 if (infoPtr == NULL) 3404 3305 return 0; 3405 hwndOldNotify = infoPtr->h wndNotify;3406 infoPtr->h wndNotify = (HWND)wParam;3306 hwndOldNotify = infoPtr->header.hwndNotify; 3307 infoPtr->header.hwndNotify = (HWND)wParam; 3407 3308 3408 3309 return hwndOldNotify; … … 3503 3404 } 3504 3405 3505 3506 static LRESULT3507 TOOLBAR_SetUnicodeFormat (HWND hwnd, WPARAM wParam, LPARAM lParam)3508 {3509 TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);3510 BOOL bTemp;3511 3512 // TRACE (toolbar, "%s hwnd=0x%04x stub!\n",3513 // ((BOOL)wParam) ? "TRUE" : "FALSE", hwnd);3514 3515 bTemp = infoPtr->bUnicode;3516 infoPtr->bUnicode = (BOOL)wParam;3517 3518 return bTemp;3519 }3520 3521 static LRESULT3522 TOOLBAR_SetVersion (HWND hwnd, INT iVersion)3523 {3524 TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);3525 INT iOldVersion = infoPtr->iVersion;3526 3527 infoPtr->iVersion = iVersion;3528 3529 return iOldVersion;3530 }3531 3532 3406 static LRESULT 3533 3407 TOOLBAR_Create (HWND hwnd, WPARAM wParam, LPARAM lParam) … … 3550 3424 3551 3425 infoPtr->bCaptured = FALSE; 3552 infoPtr->bUnicode = IsWindowUnicode(hwnd);3553 3426 infoPtr->nButtonDown = -1; 3554 3427 infoPtr->nOldHit = -1; 3555 3428 infoPtr->nHotItem = -2; /* It has to be initially different from nOldHit */ 3556 infoPtr->hwndNotify = GetParent (hwnd);3557 3429 infoPtr->bTransparent = (dwStyle & TBSTYLE_FLAT); 3558 3430 infoPtr->dwDTFlags = (dwStyle & TBSTYLE_LIST) ? DT_LEFT | DT_VCENTER | DT_SINGLELINE : DT_CENTER; 3559 3431 infoPtr->bAnchor = FALSE; /* no anchor highlighting */ 3560 infoPtr->iVersion = 0;3561 3432 3562 3433 infoPtr->hwndToolbar = hwnd; … … 3567 3438 infoPtr->hFont = CreateFontIndirectA (&logFont); 3568 3439 3440 /* Create tooltip control */ 3569 3441 if (dwStyle & TBSTYLE_TOOLTIPS) 3570 { 3571 /* Create tooltip control */ 3572 infoPtr->hwndToolTip = 3573 CreateWindowExA (WS_EX_TOOLWINDOW,TOOLTIPS_CLASSA,NULL,WS_POPUP, 3574 CW_USEDEFAULT,CW_USEDEFAULT, 3575 CW_USEDEFAULT,CW_USEDEFAULT, 3576 hwnd,0,0,0); 3577 3578 /* Send NM_TOOLTIPSCREATED notification */ 3579 if (infoPtr->hwndToolTip) 3580 { 3581 NMTOOLTIPSCREATED nmttc; 3582 3583 nmttc.hdr.hwndFrom = hwnd; 3584 nmttc.hdr.idFrom = GetWindowLongA(hwnd,GWL_ID); 3585 nmttc.hdr.code = NM_TOOLTIPSCREATED; 3586 nmttc.hwndToolTips = infoPtr->hwndToolTip; 3587 3588 SendMessageA(infoPtr->hwndNotify,WM_NOTIFY,(WPARAM)nmttc.hdr.idFrom,(LPARAM)&nmttc); 3589 } 3590 } 3442 infoPtr->hwndToolTip = createToolTip(hwnd,0,FALSE); 3591 3443 3592 3444 return 0; … … 3631 3483 3632 3484 /* free toolbar info data */ 3633 COMCTL32_Free (infoPtr); 3634 SetWindowLongA(hwnd, 0, 0); 3485 doneControl(hwnd); 3635 3486 3636 3487 return 0; … … 3718 3569 NMTOOLBARA nmtb; 3719 3570 3720 nmtb.hdr.hwndFrom = hwnd;3721 nmtb.hdr.idFrom = GetWindowLongA (hwnd, GWL_ID);3722 nmtb.hdr.code = TBN_DROPDOWN;3723 3571 nmtb.iItem = btnPtr->idCommand; 3724 3572 3725 SendMessageA (infoPtr->hwndNotify, WM_NOTIFY, 3726 (WPARAM)nmtb.hdr.idFrom, (LPARAM)&nmtb); 3573 sendNotify(hwnd,TBN_DROPDOWN,&nmtb.hdr); 3727 3574 } 3728 3575 … … 3805 3652 NMTOOLBARW nmtb; 3806 3653 3807 nmtb.hdr.hwndFrom = hwnd;3808 nmtb.hdr.idFrom = GetWindowLongA (hwnd, GWL_ID);3809 nmtb.hdr.code = TBN_DROPDOWN;3810 3654 nmtb.iItem = nHit; 3811 3655 /* nmtb.tbButton not used with TBN_DROPDOWN */ … … 3819 3663 nmtb.rcButton = btnPtr->rect; 3820 3664 3821 SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, 3822 (WPARAM)nmtb.hdr.idFrom, (LPARAM)&nmtb); 3665 sendNotify(hwnd,TBN_DROPDOWN,&nmtb.hdr); 3823 3666 } 3824 3667 } … … 3935 3778 3936 3779 /* allocate memory for info structure */ 3937 infoPtr = (TOOLBAR_INFO *)COMCTL32_Alloc (sizeof(TOOLBAR_INFO)); 3938 SetWindowLongA (hwnd, 0, (DWORD)infoPtr); 3780 infoPtr = (TOOLBAR_INFO*)initControl(hwnd,sizeof(TOOLBAR_INFO)); 3939 3781 3940 3782 /* paranoid!! */ … … 3990 3832 3991 3833 if ((infoPtr->hwndToolTip) && (lpnmh->hwndFrom == infoPtr->hwndToolTip)) { 3992 SendMessageA (infoPtr->h wndNotify, WM_NOTIFY, wParam, lParam);3834 SendMessageA (infoPtr->header.hwndNotify, WM_NOTIFY, wParam, lParam); 3993 3835 3994 3836 #if 0 … … 4256 4098 return TOOLBAR_GetToolTips (hwnd, wParam, lParam); 4257 4099 4258 case TB_GETUNICODEFORMAT:4259 return TOOLBAR_GetUnicodeFormat (hwnd, wParam, lParam);4260 4261 case CCM_GETVERSION:4262 return TOOLBAR_GetVersion (hwnd);4263 4264 4100 case TB_HIDEBUTTON: 4265 4101 return TOOLBAR_HideButton (hwnd, wParam, lParam); … … 4385 4221 return TOOLBAR_SetToolTips (hwnd, wParam, lParam); 4386 4222 4387 case TB_SETUNICODEFORMAT:4388 return TOOLBAR_SetUnicodeFormat (hwnd, wParam, lParam);4389 4390 case CCM_SETVERSION:4391 return TOOLBAR_SetVersion (hwnd, (INT)wParam);4392 4393 4223 /* case WM_CHAR: */ 4394 4224 … … 4428 4258 case WM_NOTIFY: 4429 4259 return TOOLBAR_Notify (hwnd, wParam, lParam); 4430 4431 /* case WM_NOTIFYFORMAT: */4432 4260 4433 4261 case WM_PAINT: … … 4455 4283 // ERR (toolbar, "unknown msg %04x wp=%08x lp=%08lx\n", 4456 4284 // uMsg, wParam, lParam); 4457 return DefWindowProcA (hwnd, uMsg, wParam, lParam);4285 return defComCtl32ProcA (hwnd, uMsg, wParam, lParam); 4458 4286 } 4459 4287 return 0; -
trunk/src/comctl32/tooltips.cpp
r3145 r3154 1 /* $Id: tooltips.cpp,v 1. 3 2000-03-17 17:13:26cbratschi Exp $ */1 /* $Id: tooltips.cpp,v 1.4 2000-03-18 16:17:32 cbratschi Exp $ */ 2 2 /* 3 3 * Tool tip control … … 17 17 */ 18 18 19 /* WINE 20000130 level */ 19 /* 20 - Corel WINE 20000317 level 21 - (WINE 20000130 level) 22 */ 20 23 21 24 #include <string.h> … … 23 26 #include "winbase.h" 24 27 #include "commctrl.h" 28 #include "ccbase.h" 25 29 #include "tooltips.h" 26 30 #include "comctl32.h" … … 1926 1930 1927 1931 /* allocate memory for info structure */ 1928 infoPtr = (TOOLTIPS_INFO *)COMCTL32_Alloc(sizeof(TOOLTIPS_INFO)); 1929 SetWindowLongA(hwnd,0,(DWORD)infoPtr); 1932 infoPtr = (TOOLTIPS_INFO*)initControl(hwnd,sizeof(TOOLTIPS_INFO)); 1930 1933 1931 1934 /* initialize info structure */ … … 1954 1957 1955 1958 SetRectEmpty(&infoPtr->rcMargin); 1956 1957 nResult = (INT)SendMessageA(GetParent(hwnd),WM_NOTIFYFORMAT,(WPARAM)hwnd,(LPARAM)NF_QUERY);1958 // if (nResult == NFR_ANSI)1959 // TRACE (tooltips, " -- WM_NOTIFYFORMAT returns: NFR_ANSI\n");1960 // else if (nResult == NFR_UNICODE)1961 // FIXME (tooltips, " -- WM_NOTIFYFORMAT returns: NFR_UNICODE\n");1962 // else1963 // FIXME (tooltips, " -- WM_NOTIFYFORMAT returns: error!\n");1964 1959 1965 1960 SetWindowPos(hwnd,HWND_TOP,0,0,0,0,SWP_NOZORDER | SWP_HIDEWINDOW | SWP_NOACTIVATE); … … 2013 2008 2014 2009 /* free tool tips info data */ 2015 COMCTL32_Free(infoPtr);2010 doneControl(hwnd); 2016 2011 2017 2012 return 0; … … 2087 2082 2088 2083 return DefWindowProcA (hwnd, WM_NCHITTEST, wParam, lParam); 2089 }2090 2091 static LRESULT2092 TOOLTIPS_NotifyFormat (HWND hwnd, WPARAM wParam, LPARAM lParam)2093 {2094 // FIXME ("hwnd=%x wParam=%x lParam=%lx\n", hwnd, wParam, lParam);2095 2096 return 0;2097 2084 } 2098 2085 … … 2244 2231 case WM_RBUTTONUP: 2245 2232 infoPtr = TOOLTIPS_GetInfoPtr(lpttsi->hwndToolTip); 2246 nTool = TOOLTIPS_GetToolFromMessage (infoPtr, hwnd);2247 2248 // TRACE (tooltips, "subclassed mouse message %04x\n", uMsg); 2249 2250 2233 if (!infoPtr) break; 2234 nTool = TOOLTIPS_GetToolFromMessage (infoPtr, hwnd); 2235 2236 infoPtr->nOldTool = infoPtr->nTool; 2237 infoPtr->nTool = nTool; 2251 2238 TOOLTIPS_Hide (lpttsi->hwndToolTip, infoPtr); 2252 2239 break; … … 2254 2241 case WM_MOUSEMOVE: 2255 2242 infoPtr = TOOLTIPS_GetInfoPtr (lpttsi->hwndToolTip); 2256 //@@@AH 2000/02/25 check if there is a valid instance data pointer 2257 if (!infoPtr) 2258 { 2259 dprintf(("Tooltips:SubclassProc:WM_MOUSEMOVE: infoPtr == NULL!\n")); 2260 break; 2261 } 2243 if (!infoPtr) break; 2262 2244 nTool = TOOLTIPS_GetToolFromMessage (infoPtr, hwnd); 2263 2245 2264 // TRACE (tooltips, "subclassed WM_MOUSEMOVE\n");2265 2246 infoPtr->nOldTool = infoPtr->nTool; 2266 2247 infoPtr->nTool = nTool; … … 2271 2252 SetTimer (hwnd, ID_TIMERSHOW, 2272 2253 infoPtr->nInitialTime, 0); 2273 //TRACE (tooltips, "timer 1 started!\n");2254 //TRACE (tooltips, "timer 1 started!\n"); 2274 2255 } 2275 2256 else { … … 2445 2426 return TOOLTIPS_NCHitTest (hwnd, wParam, lParam); 2446 2427 2447 case WM_NOTIFYFORMAT:2448 return TOOLTIPS_NotifyFormat (hwnd, wParam, lParam);2449 2450 2428 case WM_PAINT: 2451 2429 return TOOLTIPS_Paint (hwnd, wParam, lParam); … … 2464 2442 // ERR (tooltips, "unknown msg %04x wp=%08x lp=%08lx\n", 2465 2443 // uMsg, wParam, lParam); 2466 return DefWindowProcA (hwnd, uMsg, wParam, lParam);2444 return defComCtl32ProcA (hwnd, uMsg, wParam, lParam); 2467 2445 } 2468 2446 return 0; -
trunk/src/comctl32/trackbar.cpp
r3145 r3154 1 /* $Id: trackbar.cpp,v 1. 2 2000-03-17 17:13:26cbratschi Exp $ */1 /* $Id: trackbar.cpp,v 1.3 2000-03-18 16:17:33 cbratschi Exp $ */ 2 2 /* 3 3 * Trackbar control … … 987 987 { //above 988 988 x = (infoPtr->rcChannel.right+infoPtr->rcChannel.left)/2-(rcBuddy.right-rcBuddy.left)/2+rcSelf.left; 989 989 y = rcSelf.top-(rcBuddy.bottom-rcBuddy.top); 990 990 } else 991 991 { //left 992 993 992 x = rcSelf.left-(rcBuddy.right-rcBuddy.left); 993 y = (infoPtr->rcChannel.bottom+infoPtr->rcChannel.top)/2-(rcBuddy.bottom-rcBuddy.top)/2+rcSelf.top; 994 994 } 995 995 … … 1005 1005 if (dwStyle & TBS_VERT) 1006 1006 { //below 1007 1008 1007 x = (infoPtr->rcChannel.right+infoPtr->rcChannel.left)/2-(rcBuddy.right-rcBuddy.left)/2+rcSelf.left; 1008 y = rcSelf.bottom; 1009 1009 } else 1010 1010 { //right … … 1717 1717 uFlags |= TTF_ALIGNBOTTOM | TTF_HCENTER; 1718 1718 1719 infoPtr->hwndToolTip = createToolTip(hwnd,uFlags );1719 infoPtr->hwndToolTip = createToolTip(hwnd,uFlags,TRUE); 1720 1720 } 1721 1721 … … 2147 2147 TRACKBAR_UpdateThumbPosition(hwnd,infoPtr->nPos,FALSE); //infoPtr->nPos now set 2148 2148 2149 TRACKBAR_SendNotify(hwnd,TB_THUMBTRACK | (infoPtr->nPos >>16));2149 TRACKBAR_SendNotify(hwnd,TB_THUMBTRACK | (infoPtr->nPos << 16)); 2150 2150 2151 2151 if (infoPtr->flags & TB_SHOW_TOOLTIP) -
trunk/src/comctl32/treeview.cpp
r2895 r3154 1 /* $Id: treeview.cpp,v 1. 2 2000-02-25 17:00:18cbratschi Exp $ */1 /* $Id: treeview.cpp,v 1.3 2000-03-18 16:17:34 cbratschi Exp $ */ 2 2 /* Treeview control 3 3 * … … 69 69 static BOOL TREEVIEW_SendCustomDrawNotify (HWND hwnd, DWORD dwDrawStage, HDC hdc, RECT rc); 70 70 static BOOL TREEVIEW_SendCustomDrawItemNotify (HWND hwnd, HDC hdc, TREEVIEW_ITEM *tvItem, UINT uItemDrawState); 71 static LRESULT TREEVIEW_RButtonUp (HWND hwnd, LPPOINT pPt); 71 72 static LRESULT TREEVIEW_SelectItem (HWND hwnd, WPARAM wParam, LPARAM lParam); 72 73 static LRESULT TREEVIEW_DoSelectItem(HWND hwnd,INT action,HTREEITEM newSelect,INT cause); … … 1986 1987 txt2 = item->pszText; 1987 1988 1988 return lstrcmp W(txt1,txt2);1989 return lstrcmpiW(txt1,txt2); //CB: or lstrcmpW? 1989 1990 } 1990 1991 … … 2429 2430 2430 2431 wineItem->calculated = FALSE; 2432 //TREEVIEW_Sort(hwnd,0,NULL,NULL); //CB: the Corel people do this, I think it's wrong 2431 2433 TREEVIEW_QueueRefresh(hwnd); 2432 2434 … … 2734 2736 infoPtr->hwndToolTip = 0; 2735 2737 if (!(dwStyle & TVS_NOTOOLTIPS)) 2736 infoPtr->hwndToolTip = createToolTip(hwnd,TTF_TRACK | TTF_ABSOLUTE );2738 infoPtr->hwndToolTip = createToolTip(hwnd,TTF_TRACK | TTF_ABSOLUTE,TRUE); 2737 2739 2738 2740 if (dwStyle & TVS_CHECKBOXES) … … 2797 2799 sendNotify(hwnd,NM_SETFOCUS); 2798 2800 2799 if (!(dwStyle & TVS_SHOWSELALWAYS) && infoPtr->selectedItem) 2800 TREEVIEW_RefreshItem(hwnd,TREEVIEW_ValidItem(infoPtr,infoPtr->selectedItem),FALSE); 2801 if (!(dwStyle & TVS_SHOWSELALWAYS)) 2802 { 2803 if (infoPtr->selectedItem) 2804 TREEVIEW_RefreshItem(hwnd,TREEVIEW_ValidItem(infoPtr,infoPtr->selectedItem),FALSE); 2805 else if (infoPtr->firstVisible) 2806 TREEVIEW_DoSelectItem(hwnd,TVGN_CARET,infoPtr->firstVisible,TVC_UNKNOWN); 2807 } 2801 2808 2802 2809 return 0; … … 3199 3206 } 3200 3207 3208 /* If item was collapsed we probably need to change selection */ 3209 if (flag & TVE_COLLAPSE) 3210 { 3211 HTREEITEM hItem = infoPtr->selectedItem; 3212 3213 if (!TREEVIEW_ValidItem (infoPtr, hItem)) 3214 hItem = wineItem->hItem; 3215 else 3216 { 3217 while ( hItem ) 3218 { 3219 hItem = infoPtr->items[(INT)hItem].parent; 3220 3221 if (hItem == wineItem->hItem) 3222 break; 3223 } 3224 } 3225 3226 if (hItem) 3227 TREEVIEW_DoSelectItem(hwnd, TVGN_CARET, hItem, TVC_UNKNOWN); 3228 } 3229 3201 3230 //CB: todo: optimize! 3202 3231 TREEVIEW_UnqueueRefresh(hwnd,FALSE,FALSE); … … 3486 3515 msg.message <= WM_RBUTTONDBLCLK) 3487 3516 { 3517 if (msg.message == WM_RBUTTONUP) 3518 TREEVIEW_RButtonUp (hwnd, &pt); 3488 3519 break; 3489 3520 } … … 3735 3766 3736 3767 static LRESULT 3768 TREEVIEW_RButtonUp (HWND hwnd, LPPOINT pPt) 3769 { 3770 POINT pt; 3771 3772 pt.x = pPt->x; 3773 pt.y = pPt->y; 3774 3775 /* Change to screen coordinate for WM_CONTEXTMENU */ 3776 ClientToScreen(hwnd, &pt); 3777 3778 /* Send the WM_CONTEXTMENU on a right click */ 3779 SendMessageA( hwnd, WM_CONTEXTMENU, (WPARAM) hwnd, MAKELPARAM(pt.x, pt.y)); 3780 return 0; 3781 } 3782 3783 static LRESULT 3737 3784 TREEVIEW_CreateDragImage (HWND hwnd, WPARAM wParam, LPARAM lParam) 3738 3785 { … … 4219 4266 newItem = (& infoPtr->items[(INT)prevItem->parent]); 4220 4267 4221 hNewSelection = newItem->hItem; 4268 hNewSelection = newItem->hItem; //CB: what does Win32??? Please not the Corel hack!!! 4222 4269 } 4223 4270 -
trunk/src/comctl32/updown.cpp
r2875 r3154 1 /* $Id: updown.cpp,v 1. 1 2000-02-23 17:09:51cbratschi Exp $ */1 /* $Id: updown.cpp,v 1.2 2000-03-18 16:17:35 cbratschi Exp $ */ 2 2 /* 3 3 * Updown control … … 37 37 #include "commctrl.h" 38 38 #include "winnls.h" 39 #include "ccbase.h" 39 40 #include "updown.h" 40 41 … … 70 71 #define UNKNOWN_PARAM(msg, wParam, lParam) 71 72 72 #define UPDOWN_GetInfoPtr(hwnd) ((UPDOWN_INFO *)GetWindowLongA(hwnd,0))73 #define UPDOWN_GetInfoPtr(hwnd) ((UPDOWN_INFO*)getInfoPtr(hwnd)) 73 74 74 75 static LRESULT CALLBACK … … 714 715 DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE); 715 716 716 infoPtr = (UPDOWN_INFO*)COMCTL32_Alloc(sizeof(UPDOWN_INFO)); 717 SetWindowLongA (hwnd, 0, (DWORD)infoPtr); 717 infoPtr = (UPDOWN_INFO*)initControl(hwnd,sizeof(UPDOWN_INFO)); 718 718 719 719 /* initialize the info struct */ … … 744 744 RemovePropA(infoPtr->Buddy, BUDDY_UPDOWN_HWND); 745 745 746 COMCTL32_Free (infoPtr); 747 748 // TRACE(updown, "UpDown Ctrl destruction, hwnd=%04x\n", hwnd); 746 doneControl(hwnd); 749 747 750 748 return 0; … … 1094 1092 // ERR (updown, "unknown msg %04x wp=%04x lp=%08lx\n", 1095 1093 // message, wParam, lParam); 1096 return DefWindowProcA(hwnd,message,wParam,lParam);1094 return defComCtl32ProcA(hwnd,message,wParam,lParam); 1097 1095 } 1098 1096 … … 1159 1157 WNDCLASSA wndClass; 1160 1158 1161 //SvL: Don't check this now1162 // if( GlobalFindAtomA( UPDOWN_CLASSA ) ) return;1163 1164 1159 ZeroMemory( &wndClass, sizeof( WNDCLASSA ) ); 1165 1160 wndClass.style = CS_GLOBALCLASS | CS_VREDRAW; … … 1184 1179 UPDOWN_Unregister (VOID) 1185 1180 { 1186 if (GlobalFindAtomA (UPDOWN_CLASSA)) 1187 UnregisterClassA (UPDOWN_CLASSA, (HINSTANCE)NULL); 1188 } 1189 1181 UnregisterClassA (UPDOWN_CLASSA, (HINSTANCE)NULL); 1182 } 1183
Note:
See TracChangeset
for help on using the changeset viewer.