- Timestamp:
- Sep 28, 1999, 6:36:04 PM (26 years ago)
- Location:
- trunk/src/comctl32
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/comctl32/header.c
r968 r1085 1 /* $Id: header.c,v 1. 9 1999-09-18 12:21:25cbratschi Exp $ */1 /* $Id: header.c,v 1.10 1999-09-28 16:36:04 cbratschi Exp $ */ 2 2 /* 3 3 * Header control … … 21 21 * HEADER_DrawItem. 22 22 * - Little flaw when drawing a bitmap on the right side of the text. 23 * 24 * Status: Development in progress 25 * Version: Unknown 23 26 */ 24 27 … … 36 39 #define VERT_BORDER 4 37 40 #define DIVIDER_WIDTH 10 41 #define MIN_ITEMWIDTH 0 38 42 39 43 #define HEADER_GetInfoPtr(hwnd) ((HEADER_INFO *)GetWindowLongA(hwnd,0)) … … 426 430 oldRop = SetROP2 (hdc, R2_XORPEN); 427 431 MoveToEx (hdc, x, rect.top, NULL); 428 LineTo (hdc, x, rect.bottom -1);432 LineTo (hdc, x, rect.bottom); 429 433 SetROP2 (hdc, oldRop); 430 434 SelectObject (hdc, hOldPen); … … 1263 1267 if (HEADER_SendHeaderNotify (hwnd, HDN_ITEMCHANGINGA, infoPtr->iMoveItem)) 1264 1268 infoPtr->items[infoPtr->iMoveItem].cxy = infoPtr->nOldWidth; 1265 else { 1269 else 1270 { 1266 1271 nWidth = pt.x - infoPtr->items[infoPtr->iMoveItem].rect.left + infoPtr->xTrackOffset; 1267 if (nWidth < 0) 1268 nWidth = 0; 1269 infoPtr->items[infoPtr->iMoveItem].cxy = nWidth; 1270 HEADER_SendHeaderNotify (hwnd, HDN_ITEMCHANGEDA, infoPtr->iMoveItem); 1271 } 1272 1273 HEADER_SetItemBounds (hwnd); 1274 hdc = GetDC (hwnd); 1275 HEADER_Refresh (hwnd, hdc); 1276 ReleaseDC (hwnd, hdc); 1272 if (nWidth < MIN_ITEMWIDTH) 1273 nWidth = MIN_ITEMWIDTH; 1274 1275 if (infoPtr->nOldWidth != nWidth) 1276 { 1277 RECT rect; 1278 1279 infoPtr->items[infoPtr->iMoveItem].cxy = nWidth; 1280 HEADER_SendHeaderNotify (hwnd, HDN_ITEMCHANGEDA, infoPtr->iMoveItem); 1281 1282 GetClientRect(hwnd,&rect); 1283 rect.left = infoPtr->items[infoPtr->iMoveItem].rect.right-2; 1284 HEADER_SetItemBounds (hwnd); 1285 rect.left = MIN(infoPtr->items[infoPtr->iMoveItem].rect.right-2,rect.left); 1286 InvalidateRect(hwnd,&rect,FALSE); 1287 } 1288 } 1277 1289 } 1278 1290 } … … 1344 1356 else { 1345 1357 nWidth = pt.x - infoPtr->items[infoPtr->iMoveItem].rect.left + infoPtr->xTrackOffset; 1346 if (nWidth < 0)1347 nWidth = 0;1358 if (nWidth < MIN_ITEMWIDTH) 1359 nWidth = MIN_ITEMWIDTH; 1348 1360 infoPtr->items[infoPtr->iMoveItem].cxy = nWidth; 1349 1361 HEADER_SendHeaderNotify (hwnd, HDN_ITEMCHANGEDA, -
trunk/src/comctl32/listview.c
r1058 r1085 2450 2450 2451 2451 /* invalidate client area (optimization needed) */ 2452 InvalidateRect(hwnd, NULL, TRUE);2452 InvalidateRect(hwnd, NULL, FALSE); 2453 2453 } 2454 2454 … … 2586 2586 2587 2587 /* refresh client area */ 2588 InvalidateRect(hwnd, NULL, TRUE);2588 InvalidateRect(hwnd, NULL, FALSE); 2589 2589 } 2590 2590 … … 3178 3178 /* make sure we can get the listview info */ 3179 3179 if (!(infoPtr = (LISTVIEW_INFO *)GetWindowLongA(hwnd, 0))) 3180 3180 return (0); 3181 3181 return (infoPtr->dwExStyle); 3182 3182 } … … 3452 3452 /* make sure we can get the listview info */ 3453 3453 if (!(infoPtr = (LISTVIEW_INFO *)GetWindowLongA(hwnd, 0))) 3454 3454 return (-1); 3455 3455 return (infoPtr->nHotItem); 3456 3456 } … … 3684 3684 { 3685 3685 bResult = TRUE; 3686 nLeftPos = lprc->left = ptItem.x + ptOrigin.x; 3686 nLeftPos = lprc->left = ptItem.x + ptOrigin.x; 3687 3687 lprc->top = ptItem.y + ptOrigin.y; 3688 3688 lprc->bottom = lprc->top + infoPtr->nItemHeight; … … 3712 3712 { 3713 3713 bResult = TRUE; 3714 nLeftPos = lprc->left = ptItem.x; 3714 nLeftPos = lprc->left = ptItem.x; 3715 3715 lprc->top = ptItem.y; 3716 3716 lprc->bottom = lprc->top + infoPtr->nItemHeight; … … 3726 3726 } 3727 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3728 nLabelWidth = LISTVIEW_GetLabelWidth(hwnd, nItem); 3729 if (lprc->left + nLabelWidth < nLeftPos + infoPtr->nItemWidth) 3730 { 3731 lprc->right = lprc->left + nLabelWidth; 3732 } 3733 else 3734 { 3735 lprc->right = nLeftPos + infoPtr->nItemWidth; 3736 } 3737 3737 } 3738 3738 break; … … 3787 3787 } 3788 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3789 nLabelWidth = LISTVIEW_GetLabelWidth(hwnd, nItem); 3790 if (lprc->right + nLabelWidth < lprc->left + infoPtr->nItemWidth) 3791 { 3792 lprc->right += nLabelWidth; 3793 } 3794 else 3795 { 3796 lprc->right = lprc->left + infoPtr->nItemWidth; 3797 } 3798 3798 } 3799 3799 break; … … 3819 3819 { 3820 3820 bResult = TRUE; 3821 nLeftPos= lprc->left = ptItem.x + ptOrigin.x; 3821 nLeftPos= lprc->left = ptItem.x + ptOrigin.x; 3822 3822 lprc->top = ptItem.y + ptOrigin.y; 3823 3823 lprc->bottom = lprc->top + infoPtr->nItemHeight; … … 3835 3835 } 3836 3836 3837 nLabelWidth = LISTVIEW_GetLabelWidth(hwnd, nItem); 3838 if (lprc->right + nLabelWidth < lprc->left + infoPtr->nItemWidth) 3839 { 3840 lprc->right += nLabelWidth; 3841 } 3842 else 3843 { 3844 lprc->right = lprc->left + infoPtr->nItemWidth; 3845 } 3837 nLabelWidth = LISTVIEW_GetLabelWidth(hwnd, nItem); 3838 if (lprc->right + nLabelWidth < lprc->left + infoPtr->nItemWidth) 3839 { 3840 lprc->right += nLabelWidth; 3846 3841 } 3842 else 3843 { 3844 lprc->right = lprc->left + infoPtr->nItemWidth; 3845 } 3846 } 3847 3847 } 3848 3848 else 3849 3849 { 3850 3850 bResult = TRUE; 3851 nLeftPos = lprc->left = ptItem.x; 3851 nLeftPos = lprc->left = ptItem.x; 3852 3852 lprc->top = ptItem.y; 3853 3853 lprc->bottom = lprc->top + infoPtr->nItemHeight; … … 3865 3865 } 3866 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3867 nLabelWidth = LISTVIEW_GetLabelWidth(hwnd, nItem); 3868 if (lprc->right + nLabelWidth < nLeftPos + infoPtr->nItemWidth) 3869 { 3870 lprc->right += nLabelWidth; 3871 } 3872 else 3873 { 3874 lprc->right = nLeftPos + infoPtr->nItemWidth; 3875 } 3876 3876 } 3877 3877 break; … … 4543 4543 } 4544 4544 4545 static LRESULT LISTVIEW_InsertColumnW(HWND hwnd, INT nColumn, 4545 static LRESULT LISTVIEW_InsertColumnW(HWND hwnd, INT nColumn, 4546 4546 LPLVCOLUMNW lpColumn) 4547 4547 { 4548 LVCOLUMNA 4549 LRESULT 4550 4548 LVCOLUMNA lvca; 4549 LRESULT lres; 4550 4551 4551 memcpy(&lvca,lpColumn,sizeof(lvca)); 4552 4552 //AH: todo … … 4730 4730 4731 4731 infoPtr->clrBk = clrBk; 4732 InvalidateRect(hwnd, NULL, TRUE);4732 InvalidateRect(hwnd, NULL, FALSE); 4733 4733 4734 4734 return TRUE; … … 4914 4914 infoPtr->nItemWidth = LISTVIEW_GetItemWidth(hwnd); 4915 4915 4916 InvalidateRect(hwnd, NULL, TRUE); // force redraw of the listview4916 InvalidateRect(hwnd, NULL, FALSE); // force redraw of the listview 4917 4917 4918 4918 return lret; … … 4938 4938 /* make sure we can get the listview info */ 4939 4939 if (!(infoPtr = (LISTVIEW_INFO *)GetWindowLongA(hwnd, 0))) 4940 4940 return (0); 4941 4941 /* store previous style */ 4942 4942 dwOldStyle = infoPtr->dwExStyle; … … 4966 4966 /* make sure we can get the listview info */ 4967 4967 if (!(infoPtr = (LISTVIEW_INFO *)GetWindowLongA(hwnd, 0))) 4968 4968 return (-1); 4969 4969 /* store previous index */ 4970 4970 iOldIndex = infoPtr->nHotItem; … … 5256 5256 5257 5257 infoPtr->clrTextBk = clrTextBk; 5258 InvalidateRect(hwnd, NULL, TRUE);5258 InvalidateRect(hwnd, NULL, FALSE); 5259 5259 5260 5260 return TRUE; … … 5278 5278 5279 5279 infoPtr->clrText = clrText; 5280 InvalidateRect(hwnd, NULL, TRUE);5280 InvalidateRect(hwnd, NULL, FALSE); 5281 5281 5282 5282 return TRUE; … … 5410 5410 rc.left = LVIR_BOUNDS; 5411 5411 ListView_GetItemRect(hwnd, nItem, &rc); 5412 InvalidateRect(hwnd, &rc, TRUE);5412 InvalidateRect(hwnd, &rc, FALSE); 5413 5413 } 5414 5414 } … … 5662 5662 scrollInfo.fMask = SIF_POS; 5663 5663 SetScrollInfo(hwnd, SB_VERT, &scrollInfo, TRUE); 5664 InvalidateRect(hwnd, NULL, TRUE);5664 InvalidateRect(hwnd, NULL, FALSE); 5665 5665 } 5666 5666 } … … 5771 5771 scrollInfo.fMask = SIF_POS; 5772 5772 SetScrollInfo(hwnd, SB_HORZ, &scrollInfo, TRUE); 5773 InvalidateRect(hwnd, NULL, TRUE);5773 InvalidateRect(hwnd, NULL, FALSE); 5774 5774 } 5775 5775 } … … 5873 5873 { 5874 5874 /* refresh client area */ 5875 InvalidateRect(hwnd, NULL, TRUE);5875 InvalidateRect(hwnd, NULL, FALSE); 5876 5876 UpdateWindow(hwnd); 5877 5877 } … … 6029 6029 } 6030 6030 6031 InvalidateRect(hwnd, NULL, TRUE);6031 //InvalidateRect(hwnd, NULL, TRUE); 6032 6032 6033 6033 return 0; … … 6165 6165 { 6166 6166 infoPtr->nItemWidth = LISTVIEW_GetItemWidth(hwnd); 6167 InvalidateRect(hwnd, NULL, TRUE);6167 InvalidateRect(hwnd, NULL, FALSE); 6168 6168 } 6169 6169 } … … 6389 6389 infoPtr->bFocus = TRUE; 6390 6390 6391 InvalidateRect(hwnd, NULL, TRUE);6391 InvalidateRect(hwnd, NULL, FALSE); 6392 6392 UpdateWindow(hwnd); 6393 6393 … … 6431 6431 6432 6432 /* invalidate listview control client area */ 6433 InvalidateRect(hwnd, NULL, TRUE);6433 InvalidateRect(hwnd, NULL, FALSE); 6434 6434 6435 6435 if (fRedraw != FALSE) … … 6478 6478 6479 6479 /* invalidate client area + erase background */ 6480 InvalidateRect(hwnd, NULL, TRUE);6480 InvalidateRect(hwnd, NULL, FALSE); 6481 6481 6482 6482 return 0; … … 6636 6636 6637 6637 /* invalidate client area + erase background */ 6638 InvalidateRect(hwnd, NULL, TRUE);6638 InvalidateRect(hwnd, NULL, FALSE); 6639 6639 6640 6640 /* print the list of unsupported window styles */ … … 6864 6864 return LISTVIEW_SetItemTextA(hwnd, (INT)wParam, (LPLVITEMA)lParam); 6865 6865 6866 /* 6866 /* case LVM_SETITEMTEXTW: */ 6867 6867 6868 6868 case LVM_SETSELECTIONMARK:
Note:
See TracChangeset
for help on using the changeset viewer.