- Timestamp:
- Feb 10, 2000, 7:51:19 PM (26 years ago)
- Location:
- trunk/src/comctl32
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/comctl32/draglist.c
r2126 r2740 22 22 BOOL WINAPI MakeDragList (HWND hwndLB) 23 23 { 24 FIXME("(0x%x)\n", hwndLB);24 //FIXME("(0x%x)\n", hwndLB); 25 25 26 26 … … 31 31 VOID WINAPI DrawInsert (HWND hwndParent, HWND hwndLB, INT nItem) 32 32 { 33 FIXME("(0x%x 0x%x %d)\n", hwndParent, hwndLB, nItem);33 //FIXME("(0x%x 0x%x %d)\n", hwndParent, hwndLB, nItem); 34 34 35 35 … … 43 43 DWORD dwScrollTime; 44 44 45 FIXME("(0x%x %ld x %ld %s)\n",46 45 //FIXME("(0x%x %ld x %ld %s)\n", 46 // hwndLB, pt.x, pt.y, bAutoScroll ? "TRUE" : "FALSE"); 47 47 48 48 ScreenToClient (hwndLB, &pt); … … 52 52 if (PtInRect (&rcClient, pt)) 53 53 { 54 55 56 57 58 54 /* point is inside -- get the item index */ 55 while (TRUE) 56 { 57 if (SendMessageA (hwndLB, LB_GETITEMRECT, nIndex, (LPARAM)&rcClient) == LB_ERR) 58 return -1; 59 59 60 61 60 if (PtInRect (&rcClient, pt)) 61 return nIndex; 62 62 63 64 63 nIndex++; 64 } 65 65 } 66 66 else 67 67 { 68 69 70 68 /* point is outside */ 69 if (!bAutoScroll) 70 return -1; 71 71 72 73 72 if ((pt.x > rcClient.right) || (pt.x < rcClient.left)) 73 return -1; 74 74 75 76 77 78 75 if (pt.y < 0) 76 nIndex--; 77 else 78 nIndex++; 79 79 80 80 dwScrollTime = GetTickCount (); 81 81 82 83 82 if ((dwScrollTime - dwLastScrollTime) < 200) 83 return -1; 84 84 85 85 dwLastScrollTime = dwScrollTime; 86 86 87 87 SendMessageA (hwndLB, LB_SETTOPINDEX, (WPARAM)nIndex, 0); 88 88 } 89 89 -
trunk/src/comctl32/listview.c
r2635 r2740 1 /*$Id: listview.c,v 1.2 1 2000-02-04 17:02:07 cbratschi Exp $*/1 /*$Id: listview.c,v 1.22 2000-02-10 18:51:17 cbratschi Exp $*/ 2 2 /* 3 3 * Listview control … … 51 51 #include "commctrl.h" 52 52 #include "listview.h" 53 #include "debugtools.h"53 //#include "debugtools.h" 54 54 #include "comctl32.h" 55 55 … … 329 329 if ((LVS_TYPEMASK & lStyle) == LVS_EDITLABELS) 330 330 { 331 FIXME(" LVS_EDITLABELS\n");331 //FIXME(" LVS_EDITLABELS\n"); 332 332 } 333 333 334 334 if ((LVS_TYPEMASK & lStyle) == LVS_NOLABELWRAP) 335 335 { 336 FIXME(" LVS_NOLABELWRAP\n");336 //FIXME(" LVS_NOLABELWRAP\n"); 337 337 } 338 338 339 339 if ((LVS_TYPEMASK & lStyle) == LVS_NOSCROLL) 340 340 { 341 FIXME(" LVS_NOSCROLL\n"); 342 } 343 344 if ((LVS_TYPEMASK & lStyle) == LVS_NOSORTHEADER) 345 { 346 FIXME(" LVS_NOSORTHEADER\n"); 341 //FIXME(" LVS_NOSCROLL\n"); 347 342 } 348 343 349 344 if ((LVS_TYPEMASK & lStyle) == LVS_OWNERDRAWFIXED) 350 345 { 351 FIXME(" LVS_OWNERDRAWFIXED\n");346 //FIXME(" LVS_OWNERDRAWFIXED\n"); 352 347 } 353 348 354 349 if ((LVS_TYPEMASK & lStyle) == LVS_SHAREIMAGELISTS) 355 350 { 356 FIXME(" LVS_SHAREIMAGELISTS\n");351 //FIXME(" LVS_SHAREIMAGELISTS\n"); 357 352 } 358 353 359 354 if ((LVS_TYPEMASK & lStyle) == LVS_SORTASCENDING) 360 355 { 361 FIXME(" LVS_SORTASCENDING\n");356 //FIXME(" LVS_SORTASCENDING\n"); 362 357 } 363 358 364 359 if ((LVS_TYPEMASK & lStyle) == LVS_SORTDESCENDING) 365 360 { 366 FIXME(" LVS_SORTDESCENDING\n");361 //FIXME(" LVS_SORTDESCENDING\n"); 367 362 } 368 363 } … … 3561 3556 ) 3562 3557 return FALSE; 3558 3563 3559 hdpaSubItems = (HDPA)DPA_GetPtr(infoPtr->hdpaItems, lpLVItem->iItem); 3564 3560 if (hdpaSubItems == NULL) 3565 3561 return FALSE; 3562 3566 3563 lpItem = (LISTVIEW_ITEM *)DPA_GetPtr(hdpaSubItems, 0); 3567 3564 if (lpItem == NULL) 3568 3565 return FALSE; 3566 3569 3567 ZeroMemory(&dispInfo, sizeof(NMLVDISPINFOA)); 3570 3568 if (lpLVItem->iSubItem == 0) … … 3640 3638 } 3641 3639 } 3640 3642 3641 if (lpLVItem->iSubItem == 0) 3643 3642 { … … 3652 3651 lpLVItem->state = lpItem->state & lpLVItem->stateMask; 3653 3652 } 3653 3654 3654 if (lpLVItem->mask & LVIF_PARAM) 3655 3655 { 3656 3656 lpLVItem->lParam = lpItem->lParam; 3657 3657 } 3658 3658 3659 if (lpLVItem->mask & LVIF_INDENT) 3659 3660 { … … 3661 3662 } 3662 3663 } 3664 3663 3665 return TRUE; 3664 3666 } … … 5717 5719 UINT uView = lpcs->style & LVS_TYPEMASK; 5718 5720 LOGFONTA logFont; 5721 DWORD headerStyle = WS_CHILD | HDS_HORZ; 5719 5722 5720 5723 /* initialize info pointer */ … … 5751 5754 5752 5755 /* create header */ 5756 if (!(lpcs->style & LVS_NOSORTHEADER)) headerStyle |= HDS_BUTTONS; 5753 5757 infoPtr->hwndHeader = CreateWindowA(WC_HEADERA, (LPCSTR)NULL, 5754 WS_CHILD | HDS_HORZ | HDS_BUTTONS,5758 headerStyle, 5755 5759 0, 0, 0, 0, hwnd, (HMENU)0, 5756 5760 lpcs->hInstance, NULL); … … 6475 6479 if (infoPtr->notifyFormat == NFR_UNICODE) 6476 6480 { 6477 FIXME("NO support for unicode structures");6481 //FIXME("NO support for unicode structures"); 6478 6482 } 6479 6483 } … … 6908 6912 LISTVIEW_AlignTop(hwnd); 6909 6913 } 6914 } 6915 6916 if ((lpss->styleOld & LVS_NOSORTHEADER) != (lpss->styleNew & LVS_NOSORTHEADER)) 6917 { 6918 INT headerStyle = GetWindowLongA(infoPtr->hwndHeader,GWL_STYLE); 6919 6920 if (lpss->styleNew & LVS_NOSORTHEADER) 6921 headerStyle &= ~HDS_BUTTONS; 6922 else 6923 headerStyle |= HDS_BUTTONS; 6924 SetWindowLongA(infoPtr->hwndHeader,GWL_STYLE,headerStyle); 6910 6925 } 6911 6926 -
trunk/src/comctl32/resource.asm
r2523 r2740 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 : Thu Jan 13 17:56:562000 */4 ;/* Date : Fri Feb 4 19:27:28 2000 */ 5 5 6 6 .386p … … 12 12 public _Resource_PEResTab 13 13 dd 0 14 dd 038 7e03d8h14 dd 0389b1a10h 15 15 dd 0 16 16 dw 0, 5 … … 27 27 L2: 28 28 dd 0 29 dd 038 7e03d8h29 dd 0389b1a10h 30 30 dd 0 31 31 dw 0, 7 … … 46 46 L4: 47 47 dd 0 48 dd 038 7e03d8h48 dd 0389b1a10h 49 49 dd 0 50 50 dw 0, 1 … … 53 53 L5: 54 54 dd 0 55 dd 038 7e03d8h55 dd 0389b1a10h 56 56 dd 0 57 57 dw 0, 3 … … 64 64 L6: 65 65 dd 0 66 dd 038 7e03d8h66 dd 0389b1a10h 67 67 dd 0 68 68 dw 0, 1 … … 71 71 L16: 72 72 dd 0 73 dd 038 7e03d8h73 dd 0389b1a10h 74 74 dd 0 75 75 dw 0, 1 … … 78 78 L2_120: 79 79 dd 0 80 dd 038 7e03d8h80 dd 0389b1a10h 81 81 dd 0 82 82 dw 0, 1 … … 85 85 L2_121: 86 86 dd 0 87 dd 038 7e03d8h87 dd 0389b1a10h 88 88 dd 0 89 89 dw 0, 1 … … 92 92 L2_124: 93 93 dd 0 94 dd 038 7e03d8h94 dd 0389b1a10h 95 95 dd 0 96 96 dw 0, 1 … … 99 99 L2_125: 100 100 dd 0 101 dd 038 7e03d8h101 dd 0389b1a10h 102 102 dd 0 103 103 dw 0, 1 … … 106 106 L2_130: 107 107 dd 0 108 dd 038 7e03d8h108 dd 0389b1a10h 109 109 dd 0 110 110 dw 0, 1 … … 113 113 L2_131: 114 114 dd 0 115 dd 038 7e03d8h115 dd 0389b1a10h 116 116 dd 0 117 117 dw 0, 1 … … 120 120 L2_401: 121 121 dd 0 122 dd 038 7e03d8h122 dd 0389b1a10h 123 123 dd 0 124 124 dw 0, 1 … … 127 127 L4_300: 128 128 dd 0 129 dd 038 7e03d8h129 dd 0389b1a10h 130 130 dd 0 131 131 dw 0, 1 … … 134 134 L5_200: 135 135 dd 0 136 dd 038 7e03d8h136 dd 0389b1a10h 137 137 dd 0 138 138 dw 0, 1 … … 141 141 L5_1006: 142 142 dd 0 143 dd 038 7e03d8h143 dd 0389b1a10h 144 144 dd 0 145 145 dw 0, 1 … … 148 148 L5_1020: 149 149 dd 0 150 dd 038 7e03d8h150 dd 0389b1a10h 151 151 dd 0 152 152 dw 0, 1 … … 155 155 L6_261: 156 156 dd 0 157 dd 038 7e03d8h157 dd 0389b1a10h 158 158 dd 0 159 159 dw 0, 1 … … 162 162 L16_1: 163 163 dd 0 164 dd 038 7e03d8h164 dd 0389b1a10h 165 165 dd 0 166 166 dw 0, 1 -
trunk/src/comctl32/status.c
r2205 r2740 1 /* $Id: status.c,v 1.1 7 1999-12-26 17:32:13cbratschi Exp $ */1 /* $Id: status.c,v 1.18 2000-02-10 18:51:19 cbratschi Exp $ */ 2 2 /* 3 3 * Interface code to StatusWindow widget/control … … 853 853 int width, len; 854 854 HDC hdc; 855 STATUSWINDOWINFO * self;856 857 self= (STATUSWINDOWINFO*)COMCTL32_Alloc (sizeof(STATUSWINDOWINFO));858 SetWindowLongA (hwnd, 0, (DWORD) self);859 860 self->numParts = 1;861 self->parts = 0;862 self->simple = FALSE;863 self->clrBk = CLR_DEFAULT;864 self->hFont = 0;855 STATUSWINDOWINFO *infoPtr; 856 857 infoPtr = (STATUSWINDOWINFO*)COMCTL32_Alloc (sizeof(STATUSWINDOWINFO)); 858 SetWindowLongA (hwnd, 0, (DWORD)infoPtr); 859 860 infoPtr->numParts = 1; 861 infoPtr->parts = 0; 862 infoPtr->simple = FALSE; 863 infoPtr->clrBk = CLR_DEFAULT; 864 infoPtr->hFont = 0; 865 865 GetClientRect (hwnd, &rect); 866 866 867 867 nclm.cbSize = sizeof(NONCLIENTMETRICSA); 868 868 SystemParametersInfoA (SPI_GETNONCLIENTMETRICS, 0, &nclm, 0); 869 self->hDefaultFont = CreateFontIndirectA (&nclm.lfStatusFont);869 infoPtr->hDefaultFont = CreateFontIndirectA (&nclm.lfStatusFont); 870 870 871 871 /* initialize simple case */ 872 self->part0.bound = rect;873 self->part0.text = 0;874 self->part0.x = 0;875 self->part0.style = 0;876 self->part0.hIcon = 0;872 infoPtr->part0.bound = rect; 873 infoPtr->part0.text = 0; 874 infoPtr->part0.x = 0; 875 infoPtr->part0.style = 0; 876 infoPtr->part0.hIcon = 0; 877 877 878 878 /* initialize first part */ 879 self->parts = COMCTL32_Alloc (sizeof(STATUSWINDOWPART));880 self->parts[0].bound = rect;881 self->parts[0].text = 0;882 self->parts[0].x = -1;883 self->parts[0].style = 0;884 self->parts[0].hIcon = 0;879 infoPtr->parts = COMCTL32_Alloc (sizeof(STATUSWINDOWPART)); 880 infoPtr->parts[0].bound = rect; 881 infoPtr->parts[0].text = 0; 882 infoPtr->parts[0].x = -1; 883 infoPtr->parts[0].style = 0; 884 infoPtr->parts[0].hIcon = 0; 885 885 886 886 if (IsWindowUnicode (hwnd)) { 887 self->bUnicode = TRUE;887 infoPtr->bUnicode = TRUE; 888 888 if (lpCreate->lpszName && 889 889 (len = lstrlenW ((LPCWSTR)lpCreate->lpszName))) { 890 self->parts[0].text = COMCTL32_Alloc ((len + 1)*sizeof(WCHAR));891 lstrcpyW ( self->parts[0].text, (LPCWSTR)lpCreate->lpszName);890 infoPtr->parts[0].text = COMCTL32_Alloc ((len + 1)*sizeof(WCHAR)); 891 lstrcpyW (infoPtr->parts[0].text, (LPCWSTR)lpCreate->lpszName); 892 892 } 893 893 } … … 895 895 if (lpCreate->lpszName && 896 896 (len = lstrlenA ((LPCSTR)lpCreate->lpszName))) { 897 self->parts[0].text = COMCTL32_Alloc ((len + 1)*sizeof(WCHAR));898 lstrcpyAtoW ( self->parts[0].text, (char*)lpCreate->lpszName);897 infoPtr->parts[0].text = COMCTL32_Alloc ((len + 1)*sizeof(WCHAR)); 898 lstrcpyAtoW (infoPtr->parts[0].text, (char*)lpCreate->lpszName); 899 899 } 900 900 } … … 905 905 HFONT hOldFont; 906 906 907 hOldFont = SelectObject (hdc, self->hDefaultFont);907 hOldFont = SelectObject (hdc,infoPtr->hDefaultFont); 908 908 GetTextMetricsA(hdc, &tm); 909 self->textHeight = tm.tmHeight;909 infoPtr->textHeight = tm.tmHeight; 910 910 SelectObject (hdc, hOldFont); 911 911 ReleaseDC(0, hdc); … … 913 913 914 914 if (GetWindowLongA (hwnd, GWL_STYLE) & SBT_TOOLTIPS) { 915 self->hwndToolTip =915 infoPtr->hwndToolTip = 916 916 CreateWindowExA (0, TOOLTIPS_CLASSA, NULL, 0, 917 917 CW_USEDEFAULT, CW_USEDEFAULT, … … 920 920 GetWindowLongA (hwnd, GWL_HINSTANCE), NULL); 921 921 922 if ( self->hwndToolTip) {922 if (infoPtr->hwndToolTip) { 923 923 NMTOOLTIPSCREATED nmttc; 924 924 … … 926 926 nmttc.hdr.idFrom = GetWindowLongA (hwnd, GWL_ID); 927 927 nmttc.hdr.code = NM_TOOLTIPSCREATED; 928 nmttc.hwndToolTips = self->hwndToolTip;928 nmttc.hwndToolTips = infoPtr->hwndToolTip; 929 929 930 930 SendMessageA (GetParent (hwnd), WM_NOTIFY, … … 935 935 GetClientRect (GetParent (hwnd), &rect); 936 936 width = rect.right - rect.left; 937 self->height = self->textHeight + 4 + VERT_BORDER; 938 MoveWindow (hwnd, lpCreate->x, lpCreate->y-1, 939 width, self->height, FALSE); 937 infoPtr->height = infoPtr->textHeight + 4 + VERT_BORDER; 938 //CB: todo: find bug! 939 infoPtr->height += 4; 940 MoveWindow(hwnd,lpCreate->x,lpCreate->y-1,width,infoPtr->height,FALSE); 940 941 STATUSBAR_SetPartBounds (hwnd); 941 942 -
trunk/src/comctl32/treeview.c
r2635 r2740 1 /* $Id: treeview.c,v 1.2 2 2000-02-04 17:02:09 cbratschi Exp $ */1 /* $Id: treeview.c,v 1.23 2000-02-10 18:51:19 cbratschi Exp $ */ 2 2 /* Treeview control 3 3 * … … 65 65 ((TREEVIEW_INFO *) GetWindowLongA( hwnd, 0)) 66 66 67 static BOOL 68 TREEVIEW_SendSimpleNotify (HWND hwnd, UINT code); 69 static BOOL 70 TREEVIEW_SendTreeviewNotify (HWND hwnd, UINT code, UINT action, 71 HTREEITEM oldItem, HTREEITEM newItem); 72 static BOOL 73 TREEVIEW_SendTreeviewDnDNotify (HWND hwnd, UINT code, HTREEITEM dragItem, 74 POINT pt); 75 static BOOL 76 TREEVIEW_SendDispInfoNotify (HWND hwnd, TREEVIEW_ITEM *wineItem, 77 UINT code, UINT what); 78 static BOOL 79 TREEVIEW_SendCustomDrawNotify (HWND hwnd, DWORD dwDrawStage, HDC hdc, 80 RECT rc); 81 static BOOL 82 TREEVIEW_SendCustomDrawItemNotify (HWND hwnd, HDC hdc, 83 TREEVIEW_ITEM *tvItem, UINT uItemDrawState); 84 static LRESULT 85 TREEVIEW_DoSelectItem (HWND hwnd, INT action, HTREEITEM newSelect, INT cause); 86 static void 87 TREEVIEW_Refresh (HWND hwnd,HDC hdc); 88 89 static LRESULT CALLBACK 90 TREEVIEW_Edit_SubclassProc (HWND hwnd, UINT uMsg, WPARAM wParam, 91 LPARAM lParam); 92 93 LRESULT WINAPI 94 TREEVIEW_EndEditLabelNow (HWND hwnd, WPARAM wParam, LPARAM lParam); 95 96 97 67 static BOOL TREEVIEW_SendSimpleNotify (HWND hwnd, UINT code); 68 static BOOL TREEVIEW_SendTreeviewNotify (HWND hwnd, UINT code, UINT action, HTREEITEM oldItem, HTREEITEM newItem); 69 static BOOL TREEVIEW_SendTreeviewDnDNotify (HWND hwnd, UINT code, HTREEITEM dragItem, POINT pt); 70 static BOOL TREEVIEW_SendDispInfoNotify (HWND hwnd, TREEVIEW_ITEM *wineItem, UINT code, UINT what); 71 static BOOL TREEVIEW_SendCustomDrawNotify (HWND hwnd, DWORD dwDrawStage, HDC hdc, RECT rc); 72 static BOOL TREEVIEW_SendCustomDrawItemNotify (HWND hwnd, HDC hdc, TREEVIEW_ITEM *tvItem, UINT uItemDrawState); 73 static LRESULT TREEVIEW_DoSelectItem (HWND hwnd, INT action, HTREEITEM newSelect, INT cause); 74 static void TREEVIEW_Refresh(HWND hwnd); 75 static void TREEVIEW_Draw(HWND hwnd,HDC hdc,RECT *updateRect); 76 77 static LRESULT CALLBACK TREEVIEW_Edit_SubclassProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 78 79 LRESULT WINAPI TREEVIEW_EndEditLabelNow (HWND hwnd, WPARAM wParam, LPARAM lParam); 98 80 99 81 /* helper functions. Work with the assumption that validity of operands … … 383 365 384 366 385 386 387 388 389 390 367 static LRESULT 391 368 TREEVIEW_GetImageList (HWND hwnd, WPARAM wParam, LPARAM lParam) … … 502 479 { 503 480 TREEVIEW_INFO *infoPtr = TREEVIEW_GetInfoPtr(hwnd); 504 HDC hdc;505 481 506 482 //FIXME("%d %ld\n",wParam,lParam); … … 511 487 infoPtr->insertMarkItem=(HTREEITEM) lParam; 512 488 513 hdc = GetDC(hwnd); 514 TREEVIEW_Refresh(hwnd,hdc); 515 ReleaseDC(hwnd,hdc); 489 //CB: todo 490 TREEVIEW_Refresh(hwnd); 516 491 517 492 return 1; … … 912 887 HTREEITEM *iItem; 913 888 LPRECT lpRect = (LPRECT)lParam; 914 HDC hdc;915 889 916 890 // TRACE (treeview,"\n"); … … 920 894 if (lpRect == NULL) 921 895 return FALSE; 922 923 if (infoPtr->Timer & TV_REFRESH_TIMER_SET)924 {925 hdc = GetDC(hwnd);926 TREEVIEW_Refresh(hwnd,hdc); /* we want a rect for the current view */927 ReleaseDC(hwnd,hdc);928 }929 896 930 897 /* … … 965 932 TREEVIEW_INFO *infoPtr = TREEVIEW_GetInfoPtr(hwnd); 966 933 934 //CB: todo: that's the number of completely visible items 935 967 936 return (LRESULT) infoPtr->uVisibleHeight / infoPtr->uRealItemHeight; 968 937 } … … 1046 1015 } 1047 1016 1017 static void TREEVIEW_RefreshItem(HWND hwnd,TREEVIEW_ITEM *item) 1018 { 1019 if (item && item->visible) 1020 { 1021 //CB: todo: only redraw text and icon 1022 InvalidateRect(hwnd,&item->rect,TRUE); 1023 } 1024 } 1025 1026 static void TREEVIEW_Refresh(HWND hwnd) 1027 { 1028 InvalidateRect(hwnd,NULL,TRUE); 1029 } 1030 1031 static void TREEVIEW_CalcItems(HWND hwnd) 1032 { 1033 //CB: todo: TREEVIEW_Draw should only draw, not calculate! 1034 } 1035 1036 static void TREEVIEW_SetScrollbars(HWND hwnd) 1037 { 1038 //CB: todo: dito 1039 } 1040 1041 static int TREEVIEW_GetFirstVisibleItem(HWND hwnd) 1042 { 1043 //CB: todo 1044 1045 return 0; 1046 } 1047 1048 1048 static void 1049 TREEVIEW_Refresh (HWND hwnd,HDC hdc) 1050 1049 TREEVIEW_Draw(HWND hwnd,HDC hdc,RECT *updateRect) 1051 1050 { 1052 1051 TREEVIEW_INFO *infoPtr = TREEVIEW_GetInfoPtr(hwnd); 1053 1052 TEXTMETRICA tm; 1054 1053 HBRUSH hbrBk; 1055 RECT rect ;1054 RECT rect,view; 1056 1055 INT iItem, indent, x, y, cx, height, itemHeight; 1057 INT viewtop,viewbottom,viewleft,viewright;1058 1056 TREEVIEW_ITEM *wineItem, *prevItem; 1059 1057 1060 1058 //TRACE("\n"); 1061 1062 if (infoPtr->Timer & TV_REFRESH_TIMER_SET) {1063 KillTimer (hwnd, TV_REFRESH_TIMER);1064 infoPtr->Timer &= ~TV_REFRESH_TIMER_SET;1065 }1066 1067 1059 1068 1060 GetClientRect (hwnd, &rect); … … 1077 1069 infoPtr->uVisibleWidth= rect.right-rect.left; 1078 1070 1079 view top=infoPtr->cy;1080 view bottom=infoPtr->cy + rect.bottom-rect.top;1081 view left=infoPtr->cx;1082 viewright=infoPtr->cx + rect.right-rect.left;1071 view = updateRect ? *updateRect:rect; 1072 view.left = 0; 1073 view.right = rect.right; 1074 OffsetRect(&view,infoPtr->cx,infoPtr->cy); 1083 1075 1084 1076 /* draw background */ … … 1093 1085 indent=0; 1094 1086 x=y=0; 1095 //TRACE("[%d %d %d %d]\n",viewtop,viewbottom,viewleft,viewright);1096 1087 1097 1088 while (iItem) { … … 1110 1101 infoPtr->uRealItemHeight=itemHeight; 1111 1102 1112 1113 /* FIXME: remove this in later stage */1114 /*1115 if (wineItem->pszText!=LPSTR_TEXTCALLBACK32A)1116 TRACE (treeview, "%d %d [%d %d %d %d] (%s)\n",y,x,1117 wineItem->rect.top, wineItem->rect.bottom,1118 wineItem->rect.left, wineItem->rect.right,1119 wineItem->pszText);1120 else1121 TRACE (treeview, "%d [%d %d %d %d] (CALLBACK)\n",1122 wineItem->hItem,1123 wineItem->rect.top, wineItem->rect.bottom,1124 wineItem->rect.left, wineItem->rect.right);1125 */1126 1127 1103 height=itemHeight * wineItem->iIntegral +1; 1128 if ((y >= viewtop) && (y <= viewbottom) && 1129 (x >= viewleft ) && (x <= viewright)) { 1104 if ((((y >= view.top) && (y <= view.bottom)) || ((y+height >= view.top) && (y+height <= view.bottom))) && 1105 (x >= view.left) && (x <= view.right)) 1106 { 1130 1107 wineItem->visible = TRUE; 1131 1108 wineItem->rect.top = y - infoPtr->cy + rect.top; … … 1171 1148 1172 1149 infoPtr->uTotalHeight=y; 1173 if (y >= (view bottom-viewtop)) {1150 if (y >= (view.bottom-view.top)) { 1174 1151 if (!(infoPtr->uInternalStatus & TV_VSCROLL)) 1175 1152 ShowScrollBar (hwnd, SB_VERT, TRUE); … … 1202 1179 1203 1180 switch (wParam) { 1204 case TV_REFRESH_TIMER:1205 KillTimer (hwnd, TV_REFRESH_TIMER);1206 infoPtr->Timer &= ~TV_REFRESH_TIMER_SET;1207 InvalidateRect(hwnd, NULL, FALSE);1208 return 0;1209 1181 case TV_EDIT_TIMER: 1210 1182 KillTimer (hwnd, TV_EDIT_TIMER); … … 1218 1190 return 1; 1219 1191 } 1220 1221 1222 static void1223 TREEVIEW_QueueRefresh (HWND hwnd)1224 1225 {1226 TREEVIEW_INFO *infoPtr = TREEVIEW_GetInfoPtr(hwnd);1227 1228 // TRACE (treeview,"\n");1229 if (infoPtr->Timer & TV_REFRESH_TIMER_SET) {1230 KillTimer (hwnd, TV_REFRESH_TIMER);1231 }1232 1233 SetTimer (hwnd, TV_REFRESH_TIMER, TV_REFRESH_DELAY, 0);1234 infoPtr->Timer|=TV_REFRESH_TIMER_SET;1235 }1236 1237 1238 1192 1239 1193 static LRESULT … … 1312 1266 TREEVIEW_ITEM *wineItem, *returnItem; 1313 1267 INT iItem, retval, flag; 1314 HDC hdc;1315 1268 1316 1269 flag = (INT) wParam; … … 1322 1275 case TVGN_CARET:retval=(INT)infoPtr->selectedItem; 1323 1276 break; 1324 case TVGN_FIRSTVISIBLE: /* FIXME:we should only recalculate, not redraw */ 1325 hdc = GetDC (hwnd); 1326 TREEVIEW_Refresh (hwnd, hdc); 1327 ReleaseDC(hwnd,hdc); 1328 retval=(INT)infoPtr->firstVisible; 1329 break; 1277 case TVGN_FIRSTVISIBLE: /* FIXME:we should only recalculate, not redraw */ 1278 //CB: todo: remove 1279 TREEVIEW_Refresh(hwnd); 1280 retval=(INT)infoPtr->firstVisible; 1281 break; 1330 1282 case TVGN_DROPHILITE: 1331 1283 retval=(INT)infoPtr->dropItem; … … 1983 1935 } 1984 1936 1985 TREEVIEW_QueueRefresh (hwnd); 1937 //CB: todo: calc 1938 TREEVIEW_Refresh(hwnd); 1986 1939 1987 1940 return (LRESULT) iItem; … … 2059 2012 } 2060 2013 2061 TREEVIEW_QueueRefresh (hwnd); 2014 //CB: todo: calc 2015 TREEVIEW_Refresh(hwnd); 2062 2016 2063 2017 return TRUE; … … 2236 2190 } 2237 2191 2238 TREEVIEW_QueueRefresh (hwnd); 2192 //CB: todo: calc 2193 TREEVIEW_Refresh(hwnd); 2239 2194 return 0; 2240 2195 } … … 2244 2199 TREEVIEW_StyleChanged (HWND hwnd, WPARAM wParam, LPARAM lParam) 2245 2200 { 2246 HDC hdc;2247 2248 2201 //TRACE("(%x %lx)\n",wParam,lParam); 2249 hdc = GetDC (hwnd); 2250 TREEVIEW_Refresh (hwnd, hdc); 2251 ReleaseDC(hwnd,hdc); 2202 //CB: todo: calc 2203 TREEVIEW_Refresh (hwnd); 2252 2204 2253 2205 return 0; … … 2309 2261 infoPtr->pCallBackSort=NULL; 2310 2262 infoPtr->uScrollTime = 300; /* milliseconds */ 2311 2263 infoPtr->wpEditOrig = NULL; /* we haven't subclassed anything yet */ 2312 2264 infoPtr->hwndToolTip=0; 2313 2265 if (!(dwStyle & TVS_NOTOOLTIPS)) { /* Create tooltip control */ … … 2389 2341 SetWindowLongA( hwnd, 0, (DWORD)NULL); 2390 2342 2391 if (infoPtr->Timer & TV_REFRESH_TIMER_SET)2392 KillTimer (hwnd, TV_REFRESH_TIMER);2393 2343 if (infoPtr->hwndToolTip) 2394 2344 DestroyWindow (infoPtr->hwndToolTip); … … 2408 2358 // TRACE (treeview,"\n"); 2409 2359 hdc = wParam==0 ? BeginPaint (hwnd, &ps) : (HDC)wParam; 2410 TREEVIEW_ Refresh (hwnd,hdc);2360 TREEVIEW_Draw(hwnd,hdc,&ps.rcPaint); 2411 2361 if(!wParam) 2412 2362 EndPaint (hwnd, &ps); … … 2420 2370 { 2421 2371 TREEVIEW_SendSimpleNotify (hwnd, NM_SETFOCUS); 2422 InvalidateRect(hwnd, NULL, FALSE); 2372 2373 //CB: todo: focus item 2374 2423 2375 return 0; 2424 2376 } … … 2428 2380 { 2429 2381 TREEVIEW_SendSimpleNotify (hwnd, NM_KILLFOCUS); 2430 InvalidateRect(hwnd, NULL, FALSE); 2382 2383 //CB: todo: focus item 2384 2431 2385 return 0; 2432 2386 } … … 2828 2782 // wineItem->state); 2829 2783 2830 TREEVIEW_QueueRefresh (hwnd); 2784 //CB: todo: replace 2785 TREEVIEW_Refresh(hwnd); 2831 2786 return TRUE; 2832 2787 } … … 3119 3074 wineItem->state|=state<<12; 3120 3075 //TRACE ("state:%x\n", wineItem->state); 3121 TREEVIEW_ QueueRefresh(hwnd);3076 TREEVIEW_Refresh(hwnd); 3122 3077 } 3123 3078 } … … 3300 3255 infoPtr->selectedItem=(HTREEITEM)newSelect; 3301 3256 3257 TREEVIEW_RefreshItem(hwnd,prevItem); 3258 TREEVIEW_RefreshItem(hwnd,wineItem); 3259 3302 3260 TREEVIEW_SendTreeviewNotify( 3303 3261 hwnd, … … 3320 3278 wineItem->state |=TVIS_DROPHILITED; 3321 3279 3280 TREEVIEW_RefreshItem(hwnd,prevItem); 3281 TREEVIEW_RefreshItem(hwnd,wineItem); 3282 3322 3283 break; 3323 3284 … … 3326 3287 break; 3327 3288 } 3328 3329 TREEVIEW_QueueRefresh (hwnd);3330 3289 3331 3290 // TRACE (treeview,"Leaving state %d\n", wineItem->state); … … 3384 3343 ReleaseDC (0, hdc); 3385 3344 3345 //CB: todo: calc 3386 3346 if (lParam) 3387 TREEVIEW_ QueueRefresh(hwnd);3347 TREEVIEW_Refresh(hwnd); 3388 3348 3389 3349 return 0; … … 3398 3358 TREEVIEW_INFO *infoPtr = TREEVIEW_GetInfoPtr(hwnd); 3399 3359 int maxHeight; 3360 int lastPos = infoPtr->cy; 3400 3361 3401 3362 // TRACE (treeview,"wp %x, lp %lx\n", wParam, lParam); … … 3433 3394 } 3434 3395 3435 TREEVIEW_QueueRefresh (hwnd); 3396 ScrollWindowEx(hwnd,0,lastPos-infoPtr->cy,NULL,NULL,0,NULL,SW_INVALIDATE); 3397 3436 3398 return TRUE; 3437 3399 } … … 3478 3440 } 3479 3441 3480 TREEVIEW_QueueRefresh (hwnd); 3442 TREEVIEW_Refresh(hwnd); 3443 3444 //CB: todo: use ScrollWindowEx 3445 3481 3446 return TRUE; 3482 3447 } … … 3685 3650 { 3686 3651 if (uMsg==WM_CREATE) 3687 3652 return TREEVIEW_Create (hwnd, wParam, lParam); 3688 3653 3689 3654 if (!TREEVIEW_GetInfoPtr(hwnd)) … … 3928 3893 3929 3894 ZeroMemory (&wndClass, sizeof(WNDCLASSA)); 3930 wndClass.style = CS_GLOBALCLASS | CS_DBLCLKS ;3895 wndClass.style = CS_GLOBALCLASS | CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW; 3931 3896 wndClass.lpfnWndProc = (WNDPROC)TREEVIEW_WindowProc; 3932 3897 wndClass.cbClsExtra = 0;
Note:
See TracChangeset
for help on using the changeset viewer.