Changeset 3154 for trunk/src/comctl32/tab.cpp
- Timestamp:
- Mar 18, 2000, 5:17:35 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note:
See TracChangeset
for help on using the changeset viewer.