- Timestamp:
- Nov 24, 1999, 7:21:37 PM (26 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/button.cpp
r1794 r1828 1 /* $Id: button.cpp,v 1. 19 1999-11-21 14:04:10 achimhaExp $ */1 /* $Id: button.cpp,v 1.20 1999-11-24 18:21:34 cbratschi Exp $ */ 2 2 /* File: button.cpp -- Button type widgets 3 3 * … … 8 8 * 9 9 * WINE version: 991031 10 * 11 * Status: complete 12 * Version: 5.00 10 13 */ 11 14 … … 85 88 static WORD checkBoxWidth = 0, checkBoxHeight = 0; 86 89 90 static LRESULT BUTTON_SendNotify(HWND hwnd,DWORD code) 91 { 92 return SendMessageA(GetParent(hwnd),WM_COMMAND,MAKEWPARAM(GetWindowLongA(hwnd,GWL_ID),code),hwnd); 93 } 87 94 88 95 static LRESULT BUTTON_GetDlgCode(HWND hwnd,WPARAM wParam,LPARAM lParam) … … 117 124 { 118 125 DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE); 126 127 if (dwStyle & BS_NOTIFY && !wParam) BUTTON_SendNotify(hwnd,BN_DISABLE); 119 128 120 129 //PAINT_BUTTON(hwnd,dwStyle & 0x0f,ODA_DRAWENTIRE); … … 175 184 static LRESULT BUTTON_Paint(HWND hwnd,WPARAM wParam,LPARAM lParam) 176 185 { 177 DWORD style = GetWindowLongA(hwnd,GWL_STYLE) & 0x0f; 186 DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE); 187 DWORD style = dwStyle & 0x0f; 188 189 if (dwStyle & BS_NOTIFY) BUTTON_SendNotify(hwnd,BN_PAINT); 178 190 179 191 if (btnPaintFunc[style]) … … 185 197 (btnPaintFunc[style])(hwnd,hdc,ODA_DRAWENTIRE); 186 198 if(!wParam) EndPaint(hwnd,&ps); 187 } 199 } else return DefWindowProcA(hwnd,WM_PAINT,wParam,lParam); 188 200 189 201 return 0; … … 197 209 if(dwStyle & BS_NOTIFY || style == BS_RADIOBUTTON || 198 210 style == BS_USERBUTTON || style == BS_OWNERDRAW) 199 SendMessageA(GetParent(hwnd),WM_COMMAND,MAKEWPARAM(GetWindowLongA(hwnd,GWL_ID),BN_DOUBLECLICKED),hwnd);211 BUTTON_SendNotify(hwnd,BN_DOUBLECLICKED); 200 212 else BUTTON_LButtonDown(hwnd,wParam,lParam); 201 213 … … 206 218 { 207 219 BUTTONINFO* infoPtr = (BUTTONINFO*)GetInfoPtr(hwnd); 220 DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE); 208 221 209 222 SetCapture(hwnd); … … 212 225 infoPtr->state |= BUTTON_BTNPRESSED; 213 226 227 if (dwStyle & BS_NOTIFY) BUTTON_SendNotify(hwnd,BN_HILITE); 228 214 229 return 0; 215 230 } … … 218 233 { 219 234 BUTTONINFO* infoPtr = (BUTTONINFO*)GetInfoPtr(hwnd); 235 DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE); 220 236 RECT rect; 221 237 POINT pt; … … 236 252 if (PtInRect(&rect,pt)) 237 253 { 238 DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE);239 DWORD id = GetWindowLongA(hwnd,GWL_ID);240 241 254 switch(dwStyle & 0x0f) 242 255 { … … 253 266 break; 254 267 } 255 SendMessageA(GetParent(hwnd),WM_COMMAND,MAKEWPARAM(id,BN_CLICKED),hwnd); 256 } 268 BUTTON_SendNotify(hwnd,BN_CLICKED); 269 } 270 271 if (dwStyle & BS_NOTIFY) BUTTON_SendNotify(hwnd,BN_UNHILITE); 257 272 258 273 return 0; … … 262 277 { 263 278 BUTTONINFO* infoPtr = (BUTTONINFO*)GetInfoPtr(hwnd); 279 DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE); 264 280 265 281 if (infoPtr->state & BUTTON_BTNPRESSED) … … 270 286 } 271 287 288 if (dwStyle & BS_NOTIFY) BUTTON_SendNotify(hwnd,BN_UNHILITE); 289 272 290 return 0; 273 291 } … … 345 363 BUTTONINFO* infoPtr = (BUTTONINFO*)GetInfoPtr(hwnd); 346 364 DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE); 347 DWORD id = GetWindowLongA(hwnd,GWL_ID);348 365 349 366 ReleaseCapture(); … … 365 382 break; 366 383 } 367 SendMessageA(GetParent(hwnd),WM_COMMAND,MAKEWPARAM(id,BN_CLICKED),hwnd);384 BUTTON_SendNotify(hwnd,BN_CLICKED); 368 385 } else if (wParam != VK_TAB) ReleaseCapture(); 369 386 … … 381 398 { 382 399 BUTTONINFO* infoPtr = (BUTTONINFO*)GetInfoPtr(hwnd); 383 DWORD style = GetWindowLongA(hwnd,GWL_STYLE) & 0x0f; 400 DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE); 401 DWORD style = dwStyle & 0x0f; 402 403 if (dwStyle & BS_NOTIFY) BUTTON_SendNotify(hwnd,BN_SETFOCUS); 384 404 385 405 if ((style == BS_AUTORADIOBUTTON || style == BS_RADIOBUTTON) && … … 389 409 is unckecked and the focus was not given by a mouse click. */ 390 410 if (style == BS_AUTORADIOBUTTON) SendMessageA(hwnd,BM_SETCHECK,TRUE,0); 391 SendMessageA(GetParent(hwnd),WM_COMMAND,MAKEWPARAM(GetWindowLongA(hwnd,GWL_ID),BN_CLICKED),hwnd);411 BUTTON_SendNotify(hwnd,BN_CLICKED); 392 412 } 393 413 … … 401 421 { 402 422 BUTTONINFO* infoPtr = (BUTTONINFO*)GetInfoPtr(hwnd); 403 DWORD style = GetWindowLongA(hwnd,GWL_STYLE) & 0x0f; 423 DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE); 424 DWORD style = dwStyle & 0x0f; 425 426 if (dwStyle & BS_NOTIFY) BUTTON_SendNotify(hwnd,BN_KILLFOCUS); 404 427 405 428 if (infoPtr->state & BUTTON_HASFOCUS) … … 407 430 infoPtr->state &= ~BUTTON_HASFOCUS; 408 431 PAINT_BUTTON(hwnd,style,ODA_FOCUS); 409 InvalidateRect(hwnd,NULL,TRUE);410 432 } 411 433 … … 721 743 uState |= DFCS_PUSHED; 722 744 } 745 746 if (dwStyle & BS_FLAT) uState |= DFCS_FLAT; 723 747 724 748 DrawFrameControl( hDC, &rc, DFC_BUTTON, uState ); … … 844 868 SelectObject( hDC, hOldBrush ); 845 869 846 if (infoPtr->state & BUTTON_HASFOCUS )870 if (infoPtr->state & BUTTON_HASFOCUS && IsWindowEnabled(hwnd)) 847 871 { 848 872 InflateRect( &focus_rect, -1, -1 ); … … 951 975 if (dwStyle & WS_DISABLED) state |= DFCS_INACTIVE; 952 976 977 if (dwStyle & BS_FLAT) state |= DFCS_FLAT; 978 953 979 DrawFrameControl( hDC, &rbox, DFC_BUTTON, state ); 954 980 … … 963 989 964 990 if ((action == ODA_FOCUS) || 965 ((action == ODA_DRAWENTIRE) && (infoPtr->state & BUTTON_HASFOCUS) ))991 ((action == ODA_DRAWENTIRE) && (infoPtr->state & BUTTON_HASFOCUS) && IsWindowEnabled(hwnd))) 966 992 { 967 993 /* again, this is what CTL3D expects */ … … 1076 1102 hBrush = GetSysColorBrush(COLOR_BTNFACE); 1077 1103 1104 if ((action == ODA_FOCUS) || 1105 ((action == ODA_DRAWENTIRE) && (infoPtr->state & BUTTON_HASFOCUS) && IsWindowEnabled(hwnd))) 1106 { 1107 DrawFocusRect( hDC, &rc ); 1108 InflateRect(&rc,-1,-1); 1109 } 1078 1110 FillRect( hDC, &rc, hBrush ); 1079 if ((action == ODA_FOCUS) ||1080 ((action == ODA_DRAWENTIRE) && (infoPtr->state & BUTTON_HASFOCUS)))1081 DrawFocusRect( hDC, &rc );1082 1111 } 1083 1112 -
trunk/src/user32/combo.cpp
r1802 r1828 1 /* $Id: combo.cpp,v 1.1 8 1999-11-21 17:34:10 achimhaExp $ */1 /* $Id: combo.cpp,v 1.19 1999-11-24 18:21:35 cbratschi Exp $ */ 2 2 /* 3 3 * Combo controls … … 9 9 * 10 10 * WINE version: 991031 11 * 12 * Status: in progress 13 * Version: ?.?? 11 14 */ 12 15 -
trunk/src/user32/edit.cpp
r1794 r1828 1 /* $Id: edit.cpp,v 1.1 6 1999-11-21 14:04:11 achimhaExp $ */1 /* $Id: edit.cpp,v 1.17 1999-11-24 18:21:36 cbratschi Exp $ */ 2 2 /* 3 3 * Edit control … … 10 10 * 11 11 * WINE version: 991031 12 * 13 * Status: in progress 14 * Version: ?.?? 12 15 */ 13 16 … … 22 25 - still problems with caret 23 26 - WS_BORDER -> bug in Win32BaseWindow::SetWindowLong 27 - clipping bug(s) 28 - many messages, styles, notifications 24 29 */ 25 30 -
trunk/src/user32/scroll.cpp
r1781 r1828 1 /* $Id: scroll.cpp,v 1.2 4 1999-11-19 17:59:34cbratschi Exp $ */1 /* $Id: scroll.cpp,v 1.25 1999-11-24 18:21:37 cbratschi Exp $ */ 2 2 /* 3 3 * Scrollbar control … … 266 266 if (pt.y < rect.top + arrowSize) return (infoPtr->flags & ESB_DISABLE_LTUP) ? SCROLL_NOWHERE:SCROLL_TOP_ARROW; 267 267 if (pt.y >= rect.bottom - arrowSize) return (infoPtr->flags & ESB_DISABLE_RTDN) ? SCROLL_NOWHERE:SCROLL_BOTTOM_ARROW; 268 if (!thumbPos) return SCROLL_TOP_RECT;268 if (!thumbPos) return ((infoPtr->flags & ESB_DISABLE_BOTH) == ESB_DISABLE_BOTH) ? SCROLL_NOWHERE:SCROLL_TOP_RECT; 269 269 pt.y -= rect.top; 270 270 if (pt.y < thumbPos) return SCROLL_TOP_RECT; … … 275 275 if (pt.x < rect.left + arrowSize) return (infoPtr->flags & ESB_DISABLE_LTUP) ? SCROLL_NOWHERE:SCROLL_TOP_ARROW; 276 276 if (pt.x >= rect.right - arrowSize) return (infoPtr->flags & ESB_DISABLE_RTDN) ? SCROLL_NOWHERE:SCROLL_BOTTOM_ARROW; 277 if (!thumbPos) return SCROLL_TOP_RECT;277 if (!thumbPos) return ((infoPtr->flags & ESB_DISABLE_BOTH) == ESB_DISABLE_BOTH) ? SCROLL_NOWHERE:SCROLL_TOP_RECT; 278 278 pt.x -= rect.left; 279 279 if (pt.x < thumbPos) return SCROLL_TOP_RECT; … … 795 795 SCROLL_trackVertical = vertical; 796 796 SCROLL_trackHitTest = hittest = SCROLL_HitTest( hwnd, nBar, pt, FALSE ); 797 if (SCROLL_trackHitTest == SCROLL_NOWHERE) return res; 797 if (SCROLL_trackHitTest == SCROLL_NOWHERE) 798 { 799 MessageBeep(MB_ICONEXCLAMATION); 800 801 return res; 802 } 798 803 SCROLL_Scrolling = TRUE; 799 804 timerRunning = FALSE;
Note:
See TracChangeset
for help on using the changeset viewer.