Changeset 6380 for trunk/src/comctl32/pager.c
- Timestamp:
- Jul 21, 2001, 11:08:03 AM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/comctl32/pager.c
r5416 r6380 43 43 INT TLbtnState; /* state of top or left btn */ 44 44 INT BRbtnState; /* state of bottom or right btn */ 45 45 INT direction; /* direction of the scroll, (e.g. PGF_SCROLLUP) */ 46 46 } PAGER_INFO; 47 47 … … 52 52 #define MIN_ARROW_HEIGHT 5 53 53 54 #define TIMERID1 1 55 #define TIMERID2 2 56 #define INITIAL_DELAY 500 57 #define REPEAT_DELAY 50 54 58 55 59 /* the horizontal arrows are: … … 170 174 if (btnState == PGF_HOT) 171 175 { 172 rc.left++, rc.top++; rc.right++, rc.bottom++; 173 DrawEdge( hdc, &rc, EDGE_RAISED, BF_RECT); 176 DrawEdge( hdc, &rc, BDR_RAISEDINNER, BF_RECT); 174 177 if (horz) 175 178 PAGER_DrawHorzArrow(hdc, rc, COLOR_WINDOWFRAME, topLeft); 176 179 else 177 180 PAGER_DrawVertArrow(hdc, rc, COLOR_WINDOWFRAME, topLeft); 178 rc.left--, rc.top--; rc.right--, rc.bottom--;179 181 } 180 182 else if (btnState == PGF_NORMAL) … … 188 190 else if (btnState == PGF_DEPRESSED) 189 191 { 190 rc.left++, rc.top++;191 192 DrawEdge( hdc, &rc, BDR_SUNKENOUTER, BF_RECT); 192 193 if (horz) … … 194 195 else 195 196 PAGER_DrawVertArrow(hdc, rc, COLOR_WINDOWFRAME, topLeft); 196 rc.left--, rc.top--;197 197 } 198 198 else if (btnState == PGF_GRAYED) … … 211 211 PAGER_DrawVertArrow(hdc, rc, COLOR_3DSHADOW, topLeft); 212 212 } 213 rc.left--, rc.top--; rc.right--, rc.bottom--;214 213 } 215 214 … … 478 477 PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd); 479 478 INT scrollRange = PAGER_GetScrollRange(hwnd, infoPtr); 479 INT oldPos = infoPtr->nPos; 480 480 481 481 if ((scrollRange <= 0) || (newPos < 0)) … … 488 488 TRACE("[%04x] pos=%d\n", hwnd, infoPtr->nPos); 489 489 490 /* gray and restore btns, and if from WM_SETPOS, hide the gray btns */ 491 PAGER_UpdateBtns(hwnd, infoPtr, scrollRange, !fromBtnPress); 492 PAGER_PositionChildWnd(hwnd, infoPtr); 490 if (infoPtr->nPos != oldPos) 491 { 492 /* gray and restore btns, and if from WM_SETPOS, hide the gray btns */ 493 PAGER_UpdateBtns(hwnd, infoPtr, scrollRange, !fromBtnPress); 494 PAGER_PositionChildWnd(hwnd, infoPtr); 495 } 493 496 494 497 return 0; … … 567 570 delta = wndRect.bottom - wndRect.top - infoPtr->nHeight; 568 571 if (delta > infoPtr->nButtonSize) 569 infoPtr->nHeight += 4 * infoPtr->nButtonSize / 3;572 infoPtr->nHeight += infoPtr->nButtonSize; 570 573 else if (delta > 0) 571 574 infoPtr->nHeight += infoPtr->nButtonSize / 3; … … 594 597 595 598 if (scrollRange <= 0) 599 { 600 infoPtr->nPos = -1; 596 601 PAGER_SetPos(hwnd, 0, FALSE); 602 } 597 603 else 598 604 { … … 673 679 SWP_SHOWWINDOW | SWP_NOSIZE); 674 680 681 infoPtr->nPos = -1; 675 682 PAGER_SetPos(hwnd, 0, FALSE); 676 683 } … … 717 724 if (nmpgScroll.iScroll > 0) 718 725 { 726 infoPtr->direction = dir; 727 719 728 if (dir == PGF_SCROLLLEFT || dir == PGF_SCROLLUP) 720 729 PAGER_SetPos(hwnd, infoPtr->nPos - nmpgScroll.iScroll, TRUE); … … 722 731 PAGER_SetPos(hwnd, infoPtr->nPos + nmpgScroll.iScroll, TRUE); 723 732 } 733 else 734 infoPtr->direction = -1; 724 735 } 725 736 } … … 751 762 infoPtr->TLbtnState = PGF_INVISIBLE; 752 763 infoPtr->BRbtnState = PGF_INVISIBLE; 764 infoPtr->direction = -1; 753 765 754 766 if (dwStyle & PGS_AUTOSCROLL) … … 981 993 PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd); 982 994 995 KillTimer (hwnd, TIMERID1); 996 KillTimer (hwnd, TIMERID2); 997 983 998 TRACE("[%04x] ReleaseCapture\n", hwnd); 984 999 ReleaseCapture(); … … 1018 1033 repaintBtns = infoPtr->TLbtnState != PGF_DEPRESSED; 1019 1034 infoPtr->TLbtnState = PGF_DEPRESSED; 1035 SetTimer(hwnd, TIMERID1, INITIAL_DELAY, 0); 1020 1036 } 1021 1037 else if (hit == HTRIGHT || hit == HTBOTTOM) … … 1023 1039 repaintBtns = infoPtr->BRbtnState != PGF_DEPRESSED; 1024 1040 infoPtr->BRbtnState = PGF_DEPRESSED; 1041 SetTimer(hwnd, TIMERID1, INITIAL_DELAY, 0); 1025 1042 } 1026 1043 … … 1059 1076 TRACE("[%04x]\n", hwnd); 1060 1077 1078 KillTimer (hwnd, TIMERID1); 1079 KillTimer (hwnd, TIMERID2); 1080 1061 1081 /* make PRESSED btns NORMAL but don't hide gray btns */ 1062 1082 PAGER_UpdateBtns(hwnd, infoPtr, -1, FALSE); … … 1201 1221 return PAGER_Paint (hwnd, wParam); 1202 1222 */ 1223 case WM_TIMER: 1224 /* if initial timer, kill it and start the repeat timer */ 1225 if (wParam == TIMERID1) 1226 { 1227 KillTimer(hwnd, TIMERID1); 1228 SetTimer(hwnd, TIMERID2, REPEAT_DELAY, 0); 1229 } 1230 1231 KillTimer(hwnd, TIMERID2); 1232 if (infoPtr->direction > 0) 1233 { 1234 PAGER_Scroll(hwnd, infoPtr->direction); 1235 SetTimer(hwnd, TIMERID2, REPEAT_DELAY, 0); 1236 } 1237 break; 1238 1203 1239 case WM_NOTIFY: 1204 1240 case WM_COMMAND: … … 1209 1245 return defComCtl32ProcA(hwnd, uMsg, wParam, lParam); 1210 1246 #else 1211 return DefWindowProcA (hwnd, uMsg, wParam, lParam);1247 return DefWindowProcA (hwnd, uMsg, wParam, lParam); 1212 1248 #endif 1213 1249 }
Note:
See TracChangeset
for help on using the changeset viewer.