Changeset 8382 for trunk/src/comctl32/pager.c
- Timestamp:
- May 8, 2002, 1:26:30 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/comctl32/pager.c
r6705 r8382 3 3 * 4 4 * Copyright 1998, 1999 Eric Kohl 5 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Lesser General Public 8 * License as published by the Free Software Foundation; either 9 * version 2.1 of the License, or (at your option) any later version. 10 * 11 * This library is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Lesser General Public License for more details. 15 * 16 * You should have received a copy of the GNU Lesser General Public 17 * License along with this library; if not, write to the Free Software 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 5 19 * 6 20 * NOTES … … 18 32 #include "winbase.h" 19 33 #include "commctrl.h" 20 #include "debugtools.h" 21 22 DEFAULT_DEBUG_CHANNEL(pager); 23 24 #ifdef __WIN32OS2__ 25 #include "ccbase.h" 26 #undef inline 27 #define inline 28 #endif 34 #include "wine/debug.h" 35 36 WINE_DEFAULT_DEBUG_CHANNEL(pager); 29 37 30 38 typedef struct 31 39 { 32 #ifdef __WIN32OS2__33 COMCTL32_HEADER header;34 #endif35 40 HWND hwndChild; /* handle of the contained wnd */ 36 41 BOOL bNoResize; /* set when created with CCS_NORESIZE */ … … 594 599 } 595 600 601 /****************************************************************** 602 * For the PGM_RECALCSIZE message (but not the other uses in * 603 * this module), the native control does only the following: * 604 * * 605 * if (some condition) * 606 * PostMessageA(hwnd, EM_FMTLINES, 0, 0); * 607 * return DefWindowProcA(hwnd, PGM_RECALCSIZE, 0, 0); * 608 * * 609 * When we figure out what the "some condition" is we will * 610 * implement that for the message processing. * 611 ******************************************************************/ 612 596 613 static LRESULT 597 614 PAGER_RecalcSize(HWND hwnd) … … 630 647 TRACE("[%04x] %06lx\n", hwnd, infoPtr->clrBk); 631 648 632 PAGER_RecalcSize(hwnd); 633 SendMessageA(hwnd, WM_NCPAINT, (WPARAM)0, (LPARAM)0); 649 /* the native control seems to do things this way */ 650 SetWindowPos(hwnd, 0,0,0,0,0, 651 SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOMOVE | 652 SWP_NOZORDER | SWP_NOACTIVATE); 653 654 RedrawWindow(hwnd, 0, 0, RDW_ERASE | RDW_INVALIDATE); 634 655 635 656 return (LRESULT)clrTemp; … … 757 778 758 779 static LRESULT 780 PAGER_FmtLines(HWND hwnd) 781 { 782 PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd); 783 784 /* initiate NCCalcSize to resize client wnd and get size */ 785 SetWindowPos(hwnd, 0, 0,0,0,0, 786 SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOMOVE | 787 SWP_NOZORDER | SWP_NOACTIVATE); 788 789 SetWindowPos(infoPtr->hwndChild, 0, 790 0,0,infoPtr->nWidth,infoPtr->nHeight, 791 0); 792 793 return DefWindowProcA (hwnd, EM_FMTLINES, 0, 0); 794 } 795 796 static LRESULT 759 797 PAGER_Create (HWND hwnd, WPARAM wParam, LPARAM lParam) 760 798 { … … 763 801 764 802 /* allocate memory for info structure */ 765 #ifdef __WIN32OS2__766 infoPtr =(PAGER_INFO*)initControl(hwnd,sizeof(PAGER_INFO));767 #else768 803 infoPtr = (PAGER_INFO *)COMCTL32_Alloc (sizeof(PAGER_INFO)); 769 #endif770 804 SetWindowLongA (hwnd, 0, (DWORD)infoPtr); 771 805 … … 820 854 RECT rcChildw, rcmyw, wnrc, lbrc, rbrc; 821 855 POINT cursor; 856 BOOL resizeClient = FALSE; 857 BOOL repaintBtns = FALSE; 858 INT scrollRange; 822 859 823 860 /* … … 830 867 DefWindowProcA (hwnd, WM_NCCALCSIZE, wParam, lParam); 831 868 869 TRACE("orig rect=(%d,%d)-(%d,%d)\n", 870 lpRect->left, lpRect->top, lpRect->right, lpRect->bottom); 871 832 872 if (PAGER_IsHorizontal(hwnd)) 833 873 { … … 838 878 GetCursorPos (&cursor); 839 879 GetWindowRect (hwnd, &rcmyw); 880 881 /* Reset buttons and hide any grey ones */ 882 scrollRange = infoPtr->nWidth - (rcmyw.right - rcmyw.left); 883 884 TRACE("nPos=%d, scrollrange=%d, nWidth=%d, myw=(%d,%d)-(%d,%d)\n", 885 infoPtr->nPos, scrollRange, infoPtr->nWidth, 886 rcmyw.left, rcmyw.top, rcmyw.right, rcmyw.bottom); 887 PAGER_GrayAndRestoreBtns(infoPtr, scrollRange, &resizeClient, &repaintBtns); 888 PAGER_HideGrayBtns(infoPtr, &resizeClient); 889 840 890 if (PtInRect (&rcmyw, cursor)) { 841 891 GetWindowRect (hwnd, &wnrc); … … 852 902 RedrawWindow (hwnd, 0, 0, RDW_INVALIDATE | RDW_ERASE); 853 903 } 854 if (infoPtr->TLbtnState ) /* != PGF_INVISIBLE */904 if (infoPtr->TLbtnState && (lpRect->left + infoPtr->nButtonSize < lpRect->right)) 855 905 lpRect->left += infoPtr->nButtonSize; 856 if (infoPtr->BRbtnState )906 if (infoPtr->BRbtnState && (lpRect->right - infoPtr->nButtonSize > lpRect->left)) 857 907 lpRect->right -= infoPtr->nButtonSize; 858 908 } … … 875 925 GetCursorPos (&cursor); 876 926 GetWindowRect (hwnd, &rcmyw); 927 928 /* Reset buttons and hide any grey ones */ 929 scrollRange = infoPtr->nHeight - (rcmyw.bottom - rcmyw.top); 930 931 TRACE("nPos=%d, scrollrange=%d, nHeigth=%d, myw=(%d,%d)-(%d,%d)\n", 932 infoPtr->nPos, scrollRange, infoPtr->nHeight, 933 rcmyw.left, rcmyw.top, 934 rcmyw.right, rcmyw.bottom); 935 PAGER_GrayAndRestoreBtns(infoPtr, scrollRange, &resizeClient, &repaintBtns); 936 PAGER_HideGrayBtns(infoPtr, &resizeClient); 937 877 938 if (PtInRect (&rcmyw, cursor)) { 878 939 … … 900 961 RedrawWindow (hwnd, 0, 0, RDW_INVALIDATE | RDW_ERASE); 901 962 } 902 if (infoPtr->TLbtnState )963 if (infoPtr->TLbtnState && (lpRect->top + infoPtr->nButtonSize < lpRect->bottom)) 903 964 lpRect->top += infoPtr->nButtonSize; 904 if (infoPtr->BRbtnState )965 if (infoPtr->BRbtnState && (lpRect->bottom - infoPtr->nButtonSize > lpRect->top)) 905 966 lpRect->bottom -= infoPtr->nButtonSize; 906 967 /* ???? */ … … 909 970 } 910 971 911 TRACE("[%04x] client rect set to %dx%d at (%d,%d) \n", hwnd,912 lpRect->right-lpRect->left,913 lpRect->bottom-lpRect->top,914 lpRect->left, lpRect->top);972 TRACE("[%04x] client rect set to %dx%d at (%d,%d) BtnState[%d,%d]\n", 973 hwnd, lpRect->right-lpRect->left, lpRect->bottom-lpRect->top, 974 lpRect->left, lpRect->top, 975 infoPtr->TLbtnState, infoPtr->BRbtnState); 915 976 916 977 return 0; … … 1248 1309 switch (uMsg) 1249 1310 { 1311 case EM_FMTLINES: 1312 return PAGER_FmtLines(hwnd); 1313 1250 1314 case PGM_FORWARDMOUSE: 1251 1315 return PAGER_ForwardMouse (hwnd, wParam); … … 1356 1420 1357 1421 default: 1358 #ifdef __WIN32OS2__1359 return defComCtl32ProcA(hwnd, uMsg, wParam, lParam);1360 #else1361 1422 return DefWindowProcA (hwnd, uMsg, wParam, lParam); 1362 #endif1363 1423 } 1364 1424
Note:
See TracChangeset
for help on using the changeset viewer.