- Timestamp:
- Dec 28, 1999, 6:04:24 PM (26 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/button.cpp
r2221 r2228 1 /* $Id: button.cpp,v 1.2 6 1999-12-27 22:53:51cbratschi Exp $ */1 /* $Id: button.cpp,v 1.27 1999-12-28 17:04:22 cbratschi Exp $ */ 2 2 /* File: button.cpp -- Button type widgets 3 3 * … … 125 125 DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE); 126 126 127 if ( dwStyle & BS_NOTIFY&& !wParam) BUTTON_SendNotify(hwnd,BN_DISABLE);127 if ((dwStyle & BS_NOTIFY) && !wParam) BUTTON_SendNotify(hwnd,BN_DISABLE); 128 128 129 129 //PAINT_BUTTON(hwnd,dwStyle & 0x0f,ODA_DRAWENTIRE); … … 151 151 } else checkBoxWidth = checkBoxHeight = 0; 152 152 } 153 if ( style < 0L || style >= MAX_BTN_TYPE) return -1; /* abort */153 if ((style < 0L) || (style >= MAX_BTN_TYPE)) return -1; /* abort */ 154 154 155 155 infoPtr = (BUTTONINFO*)malloc(sizeof(BUTTONINFO)); … … 409 409 if (dwStyle & BS_NOTIFY) BUTTON_SendNotify(hwnd,BN_SETFOCUS); 410 410 411 if (( style == BS_AUTORADIOBUTTON || style == BS_RADIOBUTTON) &&411 if (((style == BS_AUTORADIOBUTTON) || (style == BS_RADIOBUTTON)) && 412 412 (GetCapture() != hwnd) && !(SendMessageA(hwnd,BM_GETCHECK,0,0) & BST_CHECKED)) 413 413 { … … 484 484 HANDLE oldHbitmap = infoPtr->hImage; 485 485 486 if ( dwStyle & BS_BITMAP || dwStyle & BS_ICON) infoPtr->hImage = (HANDLE)lParam;486 if ((dwStyle & BS_BITMAP) || (dwStyle & BS_ICON)) infoPtr->hImage = (HANDLE)lParam; 487 487 488 488 return oldHbitmap; … … 529 529 dwStyle &= ~WS_TABSTOP; 530 530 531 //if (oldStyle != dwStyle) SetWindowLongA(hwnd,GWL_STYLE,dwStyle);531 if (oldStyle != dwStyle) SetWindowLongA(hwnd,GWL_STYLE,dwStyle); 532 532 } 533 533 infoPtr->state = (infoPtr->state & ~3) | wParam; … … 775 775 */ 776 776 textLen = GetWindowTextLengthA(hwnd); 777 if ( textLen > 0&& (!(dwStyle & (BS_ICON|BS_BITMAP))))777 if ((textLen > 0) && (!(dwStyle & (BS_ICON|BS_BITMAP)))) 778 778 { 779 779 INT format = BUTTON_GetTextFormat(dwStyle,DT_CENTER,DT_VCENTER); … … 885 885 SelectObject( hDC, hOldBrush ); 886 886 887 if ( infoPtr->state & BUTTON_HASFOCUS&& IsWindowEnabled(hwnd))887 if ((infoPtr->state & BUTTON_HASFOCUS) && IsWindowEnabled(hwnd)) 888 888 { 889 889 InflateRect( &focus_rect, -1, -1 ); … … 980 980 GetWindowTextA(hwnd,text,textLen); 981 981 } 982 if ( action == ODA_DRAWENTIRE || action == ODA_SELECT)982 if ((action == ODA_DRAWENTIRE) || (action == ODA_SELECT)) 983 983 { 984 984 UINT state; -
trunk/src/user32/edit.cpp
r2221 r2228 1 /* $Id: edit.cpp,v 1.2 7 1999-12-27 22:53:52 cbratschi Exp $ */1 /* $Id: edit.cpp,v 1.28 1999-12-28 17:04:22 cbratschi Exp $ */ 2 2 /* 3 3 * Edit control … … 20 20 new in Win98, Win2k: for single line too 21 21 - WinNT/Win2k: higher size limits (single: 0x7FFFFFFE, multi: none) 22 - too many GetDC/ReleaseDC calls -> GetDC is very slow! 23 EM_REPLACESEL: calls more than 10 times GetDC/ReleaseDC! 24 add HDC parameter 22 25 */ 23 26 … … 182 185 static INT EDIT_WordBreakProc(LPSTR s, INT index, INT count, INT action); 183 186 static VOID EDIT_Draw(HWND hwnd,EDITSTATE *es,HDC hdc); 184 static VOID EDIT_Refresh(HWND hwnd,EDITSTATE *es );187 static VOID EDIT_Refresh(HWND hwnd,EDITSTATE *es,BOOL useCache); 185 188 186 189 /* … … 623 626 //DPRINTF_EDIT_MSG32("WM_ENABLE"); 624 627 es->bEnableState = (BOOL)wParam; 625 EDIT_Refresh(hwnd,es );628 EDIT_Refresh(hwnd,es,FALSE); 626 629 break; 627 630 … … 767 770 static void EDIT_BuildLineDefs_ML(HWND hwnd, EDITSTATE *es) 768 771 { 769 HDC dc ;772 HDC dc = 0; 770 773 HFONT old_font = 0; 771 774 LPSTR start, cp; … … 782 785 es->line_count = 0; 783 786 es->text_width = 0; 784 785 dc = GetDC(hwnd);786 if (es->font)787 old_font = SelectObject(dc, es->font);788 787 789 788 fw = es->format_rect.right - es->format_rect.left; … … 809 808 current_def->net_length = cp - start; 810 809 } 810 811 if (!dc) 812 { 813 dc = GetDC(hwnd); 814 if (es->font) 815 old_font = SelectObject(dc, es->font); 816 } 817 811 818 current_def->width = (INT)LOWORD(GetTabbedTextExtentA(dc, 812 819 start, current_def->net_length, … … 857 864 es->line_count++; 858 865 } while (current_def->ending != END_0); 859 if (es->font) 860 SelectObject(dc, old_font); 861 ReleaseDC(hwnd, dc); 866 if (dc) 867 { 868 if (es->font) 869 SelectObject(dc, old_font); 870 ReleaseDC(hwnd, dc); 871 } 862 872 EDIT_UpdateScrollBars(hwnd,es,TRUE,TRUE); 863 873 } … … 905 915 { 906 916 INT index; 907 HDC dc ;917 HDC dc = 0; 908 918 HFONT old_font = 0; 909 919 … … 929 939 return line_index; 930 940 } 931 dc = GetDC(hwnd); 932 if (es->font) 933 old_font = SelectObject(dc, es->font); 934 low = line_index + 1; 935 high = line_index + line_def->net_length + 1; 936 while (low < high - 1) 937 { 938 INT mid = (low + high) / 2; 939 if (LOWORD(GetTabbedTextExtentA(dc, es->text + line_index,mid - line_index, es->tabs_count, es->tabs)) > x) high = mid; 940 else low = mid; 941 } 942 index = low; 941 low = line_index + 1; 942 high = line_index + line_def->net_length + 1; 943 if (low < high-1) 944 { 945 if (!dc) 946 { 947 dc = GetDC(hwnd); 948 if (es->font) 949 old_font = SelectObject(dc, es->font); 950 } 951 952 while (low < high-1) 953 { 954 INT mid = (low + high) / 2; 955 if (LOWORD(GetTabbedTextExtentA(dc, es->text + line_index,mid - line_index, es->tabs_count, es->tabs)) > x) high = mid; 956 else low = mid; 957 } 958 } 959 index = low; 943 960 944 961 if (after_wrap) … … 954 971 return es->x_offset; 955 972 text = EDIT_GetPasswordPointer_SL(hwnd, es); 956 dc = GetDC(hwnd);957 if (es->font)958 old_font = SelectObject(dc, es->font);959 973 if (x < 0) 960 974 { 961 INT low = 0; 962 INT high = es->x_offset; 963 while (low < high - 1) 975 INT low = 0; 976 INT high = es->x_offset; 977 978 if (low < high-1) 979 { 980 if (!dc) 964 981 { 965 INT mid = (low + high) / 2; 966 GetTextExtentPoint32A( dc, text + mid, 967 es->x_offset - mid, &size ); 968 if (size.cx > -x) low = mid; 969 else high = mid; 982 dc = GetDC(hwnd); 983 if (es->font) 984 old_font = SelectObject(dc, es->font); 970 985 } 971 index = low; 972 } 973 else 986 987 while (low < high-1) 988 { 989 INT mid = (low + high) / 2; 990 991 GetTextExtentPoint32A( dc, text + mid, 992 es->x_offset - mid, &size ); 993 if (size.cx > -x) low = mid; 994 else high = mid; 995 } 996 } 997 index = low; 998 } else 974 999 { 975 INT low = es->x_offset; 976 INT high = lstrlenA(es->text) + 1; 977 while (low < high - 1) 1000 INT low = es->x_offset; 1001 INT high = lstrlenA(es->text) + 1; 1002 1003 if (low < high-1) 1004 { 1005 if (!dc) 978 1006 { 979 INT mid = (low + high) / 2; 980 GetTextExtentPoint32A( dc, text + es->x_offset, 981 mid - es->x_offset, &size ); 982 if (size.cx > x) high = mid; 983 else low = mid; 1007 dc = GetDC(hwnd); 1008 if (es->font) 1009 old_font = SelectObject(dc, es->font); 984 1010 } 985 index = low; 1011 1012 while (low < high-1) 1013 { 1014 INT mid = (low + high) / 2; 1015 1016 GetTextExtentPoint32A( dc, text + es->x_offset, 1017 mid - es->x_offset, &size ); 1018 if (size.cx > x) high = mid; 1019 else low = mid; 1020 } 1021 } 1022 index = low; 986 1023 } 987 1024 if (es->style & ES_PASSWORD) 988 1025 HeapFree(es->heap, 0 ,text); 989 1026 } 990 if (es->font) 991 SelectObject(dc, old_font); 992 ReleaseDC(hwnd, dc); 1027 if (dc) 1028 { 1029 if (es->font) 1030 SelectObject(dc, old_font); 1031 ReleaseDC(hwnd, dc); 1032 } 993 1033 return index; 994 1034 } … … 1099 1139 { 1100 1140 HideCaret(hwnd); 1101 InvalidateRect(hwnd, &rc, FALSE);1141 InvalidateRect(hwnd, &rc, TRUE); 1102 1142 ShowCaret(hwnd); 1103 1143 } … … 2209 2249 INT x; 2210 2250 INT y = 0; 2211 HDC dc ;2251 HDC dc = 0; 2212 2252 HFONT old_font = 0; 2213 2253 SIZE size; 2214 2254 2215 2255 index = MIN(index, len); 2216 dc = GetDC(hwnd); 2217 if (es->font) 2218 old_font = SelectObject(dc, es->font); 2256 if (!dc) 2257 { 2258 dc = GetDC(hwnd); 2259 if (es->font) 2260 old_font = SelectObject(dc, es->font); 2261 } 2219 2262 if (es->style & ES_MULTILINE) { 2220 2263 l = EDIT_EM_LineFromChar(hwnd, es, index); … … 2384 2427 2385 2428 EDIT_EM_SetSel(hwnd, es, s, s, FALSE); 2429 2386 2430 es->flags |= EF_MODIFIED; 2387 2431 es->flags |= EF_UPDATE; 2388 2432 EDIT_EM_ScrollCaret(hwnd, es); 2389 2390 2433 EDIT_NOTIFY_PARENT(hwnd,EN_UPDATE); 2391 2434 /* FIXME: really inefficient */ 2392 EDIT_Refresh(hwnd,es );2435 EDIT_Refresh(hwnd,es,TRUE); 2393 2436 } 2394 2437 … … 2486 2529 } while ((x < goal) && es->x_offset); 2487 2530 /* FIXME: use ScrollWindow() somehow to improve performance */ 2488 EDIT_Refresh(hwnd,es );2531 EDIT_Refresh(hwnd,es,TRUE); 2489 2532 EDIT_UpdateScrollBars(hwnd,es,TRUE,FALSE); 2490 2533 } else if (x > es->format_rect.right) … … 2499 2542 } while ((x > goal) && (x_last > es->format_rect.right)); 2500 2543 /* FIXME: use ScrollWindow() somehow to improve performance */ 2501 EDIT_Refresh(hwnd,es );2544 EDIT_Refresh(hwnd,es,TRUE); 2502 2545 EDIT_UpdateScrollBars(hwnd,es,TRUE,FALSE); 2503 2546 } … … 2564 2607 es->flags &= ~EF_UPDATE; 2565 2608 EDIT_BuildLineDefs_ML(hwnd, es); 2566 EDIT_Refresh(hwnd,es );2609 EDIT_Refresh(hwnd,es,FALSE); 2567 2610 EDIT_EM_ScrollCaret(hwnd, es); 2568 2611 EDIT_UpdateScrollBars(hwnd,es,TRUE,TRUE); … … 2630 2673 EDIT_BuildLineDefs_ML(hwnd, es); 2631 2674 2632 EDIT_Refresh(hwnd,es );2675 EDIT_Refresh(hwnd,es,FALSE); 2633 2676 if (es->flags & EF_FOCUSED) { 2634 2677 DestroyCaret(); … … 2670 2713 es->style &= ~ES_PASSWORD; 2671 2714 } 2672 EDIT_Refresh(hwnd,es );2715 EDIT_Refresh(hwnd,es,FALSE); 2673 2716 } 2674 2717 … … 2693 2736 { 2694 2737 EDIT_SetRectNP(hwnd,es,lprc); 2695 EDIT_Refresh(hwnd,es );2738 EDIT_Refresh(hwnd,es,FALSE); 2696 2739 } 2697 2740 } … … 2798 2841 if ((es->style & ES_MULTILINE) && !(es->style & ES_AUTOHSCROLL)) { 2799 2842 EDIT_BuildLineDefs_ML(hwnd, es); 2800 EDIT_Refresh(hwnd,es );2843 EDIT_Refresh(hwnd,es,FALSE); 2801 2844 } 2802 2845 } … … 3719 3762 } 3720 3763 3721 static VOID EDIT_Refresh(HWND hwnd,EDITSTATE *es )3764 static VOID EDIT_Refresh(HWND hwnd,EDITSTATE *es,BOOL useCache) 3722 3765 { 3723 3766 HDC hdc,hdcCompatible; … … 3726 3769 3727 3770 if (!IsWindowVisible(hwnd)) return; 3771 3772 if (!useCache) 3773 { 3774 InvalidateRect(hwnd,NULL,TRUE); 3775 return; 3776 } 3728 3777 3729 3778 //CB: original controls redraws many times, cache drawing … … 3844 3893 3845 3894 if (redraw) 3846 EDIT_Refresh(hwnd,es );3895 EDIT_Refresh(hwnd,es,FALSE); 3847 3896 if (es->flags & EF_FOCUSED) { 3848 3897 DestroyCaret(); … … 3902 3951 SetRect(&rc, 0, 0, width, height); 3903 3952 EDIT_SetRectNP(hwnd, es, &rc); 3904 EDIT_Refresh(hwnd,es );3953 EDIT_Refresh(hwnd,es,FALSE); 3905 3954 } 3906 3955 } -
trunk/src/user32/oslibgdi.cpp
r2221 r2228 1 /* $Id: oslibgdi.cpp,v 1. 5 1999-12-27 22:53:52cbratschi Exp $ */1 /* $Id: oslibgdi.cpp,v 1.6 1999-12-28 17:04:23 cbratschi Exp $ */ 2 2 /* 3 3 * Window GDI wrapper functions for OS/2 … … 19 19 #include <oslibgdi.h> 20 20 #include <oslibwin.h> 21 #include "win32wbase.h" 21 22 22 23 //CB: new mapping infrastructure to avoid transformation bugs -> available soon 23 24 24 25 /* 25 All functionscan be used to transform from Win32 to OS/2 and vice versa26 All mapScreen/Window can be used to transform from Win32 to OS/2 and vice versa 26 27 First letter is lower case to avoid conflicts with Win32 API names 27 28 28 29 Single y mapping: 29 30 mapScreenY() 30 mapWindowY() 31 mapClientY() 32 mapChildY() 31 33 32 34 Single point mapping: 33 35 mapScreenPoint() 34 mapWindowPoint() 36 mapClientPoint() 37 mapChildPoint() 35 38 36 39 Single rect mapping: 37 40 mapScreenRect() 38 map WindowRect()41 mapClientRect() 39 42 40 43 Rect transformation: … … 43 46 */ 44 47 45 INT mapScreenY(INT y) 46 { 47 return WinQuerySysValue(HWND_DESKTOP,SV_CYSCREEN)-1-y; 48 } 49 //****************************************************************************** 50 //****************************************************************************** 51 INT mapScreenY(INT screenH,INT y) 52 { 53 return screenH-1-y; 54 } 55 48 INT mapScreenY(INT screenPosY) 49 { 50 return WinQuerySysValue(HWND_DESKTOP,SV_CYSCREEN)-1-screenPosY; 51 } 52 //****************************************************************************** 53 //****************************************************************************** 54 INT mapScreenY(INT screenH,INT screenPosY) 55 { 56 return screenH-1-screenPosY; 57 } 58 //****************************************************************************** 59 //****************************************************************************** 60 INT mapClientY(INT clientH,INT clientPosY) 61 { 62 return clientH-1-clientPosY; 63 } 64 //****************************************************************************** 65 //****************************************************************************** 66 INT mapClientY(HWND os2Client,INT clientPosY) 67 { 68 RECTL rect; 69 70 if (os2Client == OSLIB_HWND_DESKTOP) os2Client = HWND_DESKTOP; //client shouldn't be desktop 71 if (!WinQueryWindowRect(os2Client,&rect)) return 0; 72 return rect.yTop-1-clientPosY; 73 } 74 //****************************************************************************** 75 //****************************************************************************** 76 INT mapClientY(Win32BaseWindow *win32wnd,INT clientPosY) 77 { 78 return win32wnd->getWindowHeight()-1-clientPosY; 79 } 80 //****************************************************************************** 81 //****************************************************************************** 82 INT mapChildY(INT parentH,INT childY,INT childPosY) 83 { 84 return parentH-1-childY-childPosY; 85 } 86 //****************************************************************************** 87 //****************************************************************************** 88 INT mapChildY(HWND os2Parent,INT childY,INT childPosY) 89 { 90 RECTL rect; 91 92 if (os2Parent == OSLIB_HWND_DESKTOP) os2Parent = HWND_DESKTOP; 93 if (!WinQueryWindowRect(os2Parent,&rect)) return 0; 94 return rect.yTop-1-childY-childPosY; 95 } 96 //****************************************************************************** 97 //****************************************************************************** 98 INT mapChildY(HWND os2Parent,HWND os2Child,INT childPosY) 99 { 100 RECTL rect; 101 SWP swp; 102 103 if (os2Parent == OSLIB_HWND_DESKTOP) os2Parent = HWND_DESKTOP; 104 if (!WinQueryWindowRect(os2Parent,&rect)) return 0; 105 if (!WinQueryWindowPos(os2Child,&swp)) return 0; 106 return rect.yTop-1-swp.y-childPosY; 107 } 108 //****************************************************************************** 109 //****************************************************************************** 110 BOOL mapScreenPoint(OSLIBPOINT *screenPt) 111 { 112 if(!screenPt) return FALSE; 113 screenPt->y = WinQuerySysValue(HWND_DESKTOP,SV_CYSCREEN)-1-screenPt->y; 114 return TRUE; 115 } 116 //****************************************************************************** 117 //****************************************************************************** 118 INT mapScreenY(INT screenH,OSLIBPOINT *screenPt) 119 { 120 if (!screenPt) return FALSE; 121 screenPt->y = screenH-1-screenPt->y; 122 return TRUE; 123 } 124 125 //old mapping functions 56 126 57 127 //****************************************************************************** -
trunk/src/user32/scroll.cpp
r2204 r2228 1 /* $Id: scroll.cpp,v 1. 29 1999-12-26 17:30:17cbratschi Exp $ */1 /* $Id: scroll.cpp,v 1.30 1999-12-28 17:04:23 cbratschi Exp $ */ 2 2 /* 3 3 * Scrollbar control … … 666 666 CREATESTRUCTA *lpCreat = (CREATESTRUCTA *)lParam; 667 667 668 if (!(lpCreat->style & (SBS_SIZEBOX | SBS_SIZEGRIP)) && lpCreat->style & (SBS_LEFTALIGN | SBS_RIGHTALIGN))668 if (!(lpCreat->style & (SBS_SIZEBOX | SBS_SIZEGRIP)) && (lpCreat->style & (SBS_LEFTALIGN | SBS_RIGHTALIGN))) 669 669 { 670 670 if (lpCreat->style & SBS_VERT) … … 793 793 SCROLL_Scrolling = TRUE; 794 794 timerRunning = FALSE; 795 if ( SCROLL_FocusWin == hwnd&& SCROLL_Highlighted)795 if ((SCROLL_FocusWin == hwnd) && SCROLL_Highlighted) 796 796 { 797 797 hdc = GetDC(hwnd); … … 892 892 893 893 case SCROLL_TOP_ARROW: 894 if ( msg == WM_LBUTTONUP || msg == WM_CAPTURECHANGED)894 if ((msg == WM_LBUTTONUP) || (msg == WM_CAPTURECHANGED)) 895 895 KillSystemTimer(hwnd,SCROLL_TIMER); 896 else if ( msg == WM_LBUTTONDOWN|| (!timerRunning && msg == WM_SYSTIMER))896 else if ((msg == WM_LBUTTONDOWN) || (!timerRunning && msg == WM_SYSTIMER)) 897 897 { 898 898 SetSystemTimer( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ? … … 902 902 } 903 903 904 if ( msg == WM_LBUTTONDOWN || SCROLL_lastHitTest != hittest)904 if ((msg == WM_LBUTTONDOWN) || (SCROLL_lastHitTest != hittest)) 905 905 { 906 906 SCROLL_DrawTopArrow(hdc,infoPtr,&rect,arrowSize,vertical,(hittest == SCROLL_trackHitTest)); 907 907 SCROLL_lastHitTest = hittest; 908 908 } 909 if ( hittest == SCROLL_trackHitTest && (msg == WM_LBUTTONDOWN || msg == WM_SYSTIMER))909 if ((hittest == SCROLL_trackHitTest) && ((msg == WM_LBUTTONDOWN) || (msg == WM_SYSTIMER))) 910 910 SendMessageA(hwndOwner,vertical ? WM_VSCROLL:WM_HSCROLL,SB_LINEUP,hwndCtl); 911 911 … … 913 913 914 914 case SCROLL_TOP_RECT: 915 if ( msg == WM_LBUTTONUP || msg == WM_CAPTURECHANGED)915 if ((msg == WM_LBUTTONUP) || (msg == WM_CAPTURECHANGED)) 916 916 KillSystemTimer(hwnd,SCROLL_TIMER); 917 else if ( msg == WM_LBUTTONDOWN || (!timerRunning && msg == WM_SYSTIMER))917 else if ((msg == WM_LBUTTONDOWN) || (!timerRunning && (msg == WM_SYSTIMER))) 918 918 { 919 919 SetSystemTimer( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ? … … 923 923 } 924 924 925 if ( msg == WM_LBUTTONDOWN || SCROLL_lastHitTest != hittest)925 if ((msg == WM_LBUTTONDOWN) || (SCROLL_lastHitTest != hittest)) 926 926 { 927 927 SCROLL_DrawInterior( hwnd, hdc, nBar, &rect, arrowSize, thumbSize, … … 931 931 } 932 932 933 if ( hittest == SCROLL_trackHitTest && (msg == WM_LBUTTONDOWN || msg == WM_SYSTIMER))933 if ((hittest == SCROLL_trackHitTest) && ((msg == WM_LBUTTONDOWN) || (msg == WM_SYSTIMER))) 934 934 SendMessageA(hwndOwner,vertical ? WM_VSCROLL:WM_HSCROLL,SB_PAGEUP,hwndCtl); 935 935 … … 946 946 thumbTrackSent = FALSE; 947 947 SCROLL_DrawMovingThumb(hdc, &rect, vertical, arrowSize, thumbSize); 948 } else if ( msg == WM_LBUTTONUP || msg == WM_CAPTURECHANGED)948 } else if ((msg == WM_LBUTTONUP) || (msg == WM_CAPTURECHANGED)) 949 949 { 950 950 UINT val; … … 957 957 trackThumbPos + lastMousePos - lastClickPos ); 958 958 959 if ( val != infoPtr->CurVal|| thumbTrackSent)959 if ((val != infoPtr->CurVal) || thumbTrackSent) 960 960 SendMessageA( hwndOwner, vertical ? WM_VSCROLL : WM_HSCROLL, 961 961 MAKEWPARAM( SB_THUMBPOSITION, val ), hwndCtl ); … … 1000 1000 1001 1001 case SCROLL_BOTTOM_RECT: 1002 if ( msg == WM_LBUTTONUP || msg == WM_CAPTURECHANGED)1002 if ((msg == WM_LBUTTONUP) || (msg == WM_CAPTURECHANGED)) 1003 1003 KillSystemTimer(hwnd,SCROLL_TIMER); 1004 else if ( msg == WM_LBUTTONDOWN || (!timerRunning && msg == WM_SYSTIMER))1004 else if ((msg == WM_LBUTTONDOWN) || (!timerRunning && (msg == WM_SYSTIMER))) 1005 1005 { 1006 1006 SetSystemTimer( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ? … … 1010 1010 } 1011 1011 1012 if ( msg == WM_LBUTTONDOWN || SCROLL_lastHitTest != hittest)1012 if ((msg == WM_LBUTTONDOWN) || (SCROLL_lastHitTest != hittest)) 1013 1013 { 1014 1014 SCROLL_DrawInterior( hwnd, hdc, nBar, &rect, arrowSize, thumbSize, … … 1018 1018 } 1019 1019 1020 if ( hittest == SCROLL_trackHitTest && (msg == WM_LBUTTONDOWN || msg == WM_SYSTIMER))1020 if ((hittest == SCROLL_trackHitTest) && ((msg == WM_LBUTTONDOWN) || (msg == WM_SYSTIMER))) 1021 1021 SendMessageA(hwndOwner,vertical ? WM_VSCROLL:WM_HSCROLL,SB_PAGEDOWN,hwndCtl); 1022 1022 … … 1024 1024 1025 1025 case SCROLL_BOTTOM_ARROW: 1026 if ( msg == WM_LBUTTONUP || msg == WM_CAPTURECHANGED)1026 if ((msg == WM_LBUTTONUP) || (msg == WM_CAPTURECHANGED)) 1027 1027 KillSystemTimer(hwnd,SCROLL_TIMER); 1028 else if ( msg == WM_LBUTTONDOWN || (!timerRunning && msg == WM_SYSTIMER))1028 else if ((msg == WM_LBUTTONDOWN) || (!timerRunning && (msg == WM_SYSTIMER))) 1029 1029 { 1030 1030 SetSystemTimer( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ? … … 1034 1034 } 1035 1035 1036 if ( msg == WM_LBUTTONDOWN || SCROLL_lastHitTest != hittest)1036 if ((msg == WM_LBUTTONDOWN) || (SCROLL_lastHitTest != hittest)) 1037 1037 { 1038 1038 SCROLL_DrawBottomArrow(hdc,infoPtr,&rect,arrowSize,vertical,(hittest == SCROLL_trackHitTest)); 1039 1039 SCROLL_lastHitTest = hittest; 1040 1040 } 1041 if ( hittest == SCROLL_trackHitTest && (msg == WM_LBUTTONDOWN || msg == WM_SYSTIMER))1041 if ((hittest == SCROLL_trackHitTest) && ((msg == WM_LBUTTONDOWN) || (msg == WM_SYSTIMER))) 1042 1042 SendMessageA(hwndOwner,vertical ? WM_VSCROLL:WM_HSCROLL,SB_LINEDOWN,hwndCtl); 1043 1043 … … 1045 1045 } 1046 1046 1047 if ( msg == WM_LBUTTONUP || msg == WM_CAPTURECHANGED)1047 if ((msg == WM_LBUTTONUP) || (msg == WM_CAPTURECHANGED)) 1048 1048 { 1049 1049 SCROLL_trackHitTest = SCROLL_NOWHERE; /* Terminate tracking */ … … 1669 1669 BOOL rc = FALSE; 1670 1670 1671 if (( nBar == SB_VERT || nBar == SB_BOTH) && window->getStyle() & WS_VSCROLL)1671 if (((nBar == SB_VERT) || (nBar == SB_BOTH)) && (window->getStyle() & WS_VSCROLL)) 1672 1672 { 1673 1673 HWND hwndScroll = Win32BaseWindow::OS2ToWin32Handle(window->getVertScrollHandle()); … … 1685 1685 } 1686 1686 } 1687 if (( nBar == SB_HORZ || (rc && nBar == SB_BOTH)) && window->getStyle() & WS_HSCROLL)1687 if (((nBar == SB_HORZ) || (rc && (nBar == SB_BOTH))) && (window->getStyle() & WS_HSCROLL)) 1688 1688 { 1689 1689 HWND hwndScroll = Win32BaseWindow::OS2ToWin32Handle(window->getHorzScrollHandle()); … … 1713 1713 BOOL WINAPI GetScrollBarInfo(HWND hwnd,LONG idObject,PSCROLLBARINFO psbi) 1714 1714 { 1715 if (!psbi || psbi->cbSize != sizeof(SCROLLBARINFO))1715 if (!psbi || (psbi->cbSize != sizeof(SCROLLBARINFO))) 1716 1716 { 1717 1717 SetLastError(ERROR_INVALID_PARAMETER); -
trunk/src/user32/static.cpp
r2160 r2228 1 /* $Id: static.cpp,v 1.1 3 1999-12-20 16:45:16cbratschi Exp $ */1 /* $Id: static.cpp,v 1.14 1999-12-28 17:04:24 cbratschi Exp $ */ 2 2 /* 3 3 * Static control … … 123 123 if ((dwStyle & SS_TYPEMASK) != SS_BITMAP) return 0; 124 124 125 if (hBitmap && GetObjectType(hBitmap) != OBJ_BITMAP) {125 if (hBitmap && (GetObjectType(hBitmap) != OBJ_BITMAP)) { 126 126 //ERR("huh? hBitmap!=0, but not bitmap\n"); 127 127 return 0; … … 249 249 DWORD style = GetWindowLongA(hwnd,GWL_STYLE) & SS_TYPEMASK; 250 250 251 if ( style < 0L || style > SS_TYPEMASK)251 if ((style < 0L) || (style > SS_TYPEMASK)) 252 252 { 253 253 //Unknown style … … 268 268 DWORD style = GetWindowLongA(hwnd,GWL_STYLE) & SS_TYPEMASK; 269 269 270 if ( style == SS_ICON&& infoPtr->hIcon)270 if ((style == SS_ICON) && infoPtr->hIcon) 271 271 { 272 272 DestroyIcon(infoPtr->hIcon); 273 } else if ( style == SS_BITMAP&& infoPtr->hIcon)273 } else if ((style == SS_BITMAP) && infoPtr->hIcon) 274 274 { 275 275 DeleteObject(infoPtr->hIcon); 276 } else if ( style == SS_ENHMETAFILE&& infoPtr->hIcon)276 } else if ((style == SS_ENHMETAFILE) && infoPtr->hIcon) 277 277 { 278 278 DeleteEnhMetaFile((HENHMETAFILE)infoPtr->hIcon); … … 345 345 STATICINFO* infoPtr = (STATICINFO*)GetInfoPtr(hwnd); 346 346 347 if ( wParam < 4|| !lParam) return 0;347 if ((wParam < 4) || !lParam) return 0; 348 348 memcpy((VOID*)lParam,&infoPtr->hIcon,4); 349 349 -
trunk/src/user32/text.cpp
r2101 r2228 1 /* $Id: text.cpp,v 1. 2 1999-12-17 17:49:53cbratschi Exp $ */1 /* $Id: text.cpp,v 1.3 1999-12-28 17:04:24 cbratschi Exp $ */ 2 2 3 3 /* … … 48 48 INT WIN32API DrawTextA(HDC hDC,LPCSTR lpString,INT nCount,PRECT lpRect,UINT nFormat) 49 49 { 50 dprintf 2(("USER32: DrawTextA %x",hDC));50 dprintf(("USER32: DrawTextA %x",hDC)); 51 51 52 52 return InternalDrawTextExA(hDC,lpString,nCount,lpRect,nFormat,NULL,FALSE); … … 56 56 INT WIN32API DrawTextW(HDC hDC,LPCWSTR lpString,INT nCount,PRECT lpRect,UINT nFormat) 57 57 { 58 dprintf 2(("USER32: DrawTextW %x",hDC));58 dprintf(("USER32: DrawTextW %x",hDC)); 59 59 60 60 return InternalDrawTextExW(hDC,lpString,nCount,lpRect,nFormat,NULL,FALSE); … … 64 64 INT WIN32API DrawTextExA(HDC hdc,LPCSTR lpchText,INT cchText,LPRECT lprc,UINT dwDTFormat,LPDRAWTEXTPARAMS lpDTParams) 65 65 { 66 dprintf 2(("USER32:DrawTextExA %x\n",hdc));66 dprintf(("USER32:DrawTextExA %x\n",hdc)); 67 67 68 68 return InternalDrawTextExA(hdc,lpchText,cchText,lprc,dwDTFormat,lpDTParams,TRUE); … … 72 72 int WIN32API DrawTextExW(HDC hdc,LPWSTR lpchText,INT cchText,LPRECT lprc,UINT dwDTFormat,LPDRAWTEXTPARAMS lpDTParams) 73 73 { 74 dprintf 2(("USER32: DrawTextExW %x",hDC));74 dprintf(("USER32: DrawTextExW %x",hdc)); 75 75 76 76 return InternalDrawTextExW(hdc,lpchText,cchText,lprc,dwDTFormat,lpDTParams,TRUE); … … 80 80 DWORD WIN32API GetTabbedTextExtentA( HDC hDC, LPCSTR lpString, int nCount, int nTabPositions, LPINT lpnTabStopPositions) 81 81 { 82 dprintf 2(("USER32: GetTabbedTextExtentA %x",hDC));82 dprintf(("USER32: GetTabbedTextExtentA %x",hDC)); 83 83 84 84 return InternalGetTabbedTextExtentA(hDC,lpString,nCount,nTabPositions,lpnTabStopPositions); … … 88 88 DWORD WIN32API GetTabbedTextExtentW(HDC hDC,LPCWSTR lpString,INT nCount,INT nTabPositions,LPINT lpnTabStopPositions) 89 89 { 90 dprintf 2(("USER32: GetTabbedTextExtentW %x",hDC));90 dprintf(("USER32: GetTabbedTextExtentW %x",hDC)); 91 91 92 92 return InternalGetTabbedTextExtentW(hDC,lpString,nCount,nTabPositions,lpnTabStopPositions); … … 96 96 LONG WIN32API TabbedTextOutA(HDC hdc,INT x,INT y,LPCSTR lpString,INT nCount,INT nTabPositions, LPINT lpnTabStopPositions,INT nTabOrigin) 97 97 { 98 dprintf 2(("USER32: TabbedTextOutA %x",hDC));98 dprintf(("USER32: TabbedTextOutA %x",hdc)); 99 99 100 100 return InternalTabbedTextOutA(hdc,x,y,lpString,nCount,nTabPositions,lpnTabStopPositions,nTabOrigin); … … 104 104 LONG WIN32API TabbedTextOutW( HDC hdc, int x, int y, LPCWSTR lpString, int nCount, int nTabPositions, LPINT lpnTabStopPositions, int nTabOrigin) 105 105 { 106 dprintf 2(("USER32: TabbedTextOutW %x",hDC));106 dprintf(("USER32: TabbedTextOutW %x",hdc)); 107 107 108 108 return InternalTabbedTextOutW(hdc,x,y,lpString,nCount,nTabPositions,lpnTabStopPositions,nTabOrigin); … … 190 190 BOOL WIN32API GrayStringA(HDC hdc,HBRUSH hBrush,GRAYSTRINGPROC lpOutputFunc,LPARAM lpData,int nCount,int X,int Y,int nWidth,int nHeight) 191 191 { 192 dprintf 2(("USER32: GrayStringA %x",hDC));192 dprintf(("USER32: GrayStringA %x",hdc)); 193 193 194 194 return InternalGrayString(hdc,hBrush,lpOutputFunc,lpData,nCount,X,Y,nWidth,nHeight,FALSE); … … 198 198 BOOL WIN32API GrayStringW(HDC hdc,HBRUSH hBrush,GRAYSTRINGPROC lpOutputFunc,LPARAM lpData,int nCount,int X,int Y,int nWidth,int nHeight) 199 199 { 200 dprintf 2(("USER32: GrayStringW %x",hDC));200 dprintf(("USER32: GrayStringW %x",hdc)); 201 201 202 202 return InternalGrayString(hdc,hBrush,lpOutputFunc,lpData,nCount,X,Y,nWidth,nHeight,TRUE);
Note:
See TracChangeset
for help on using the changeset viewer.