Changeset 110 for trunk/src/comctl32/updown.c
- Timestamp:
- Jun 16, 1999, 10:25:45 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/comctl32/updown.c
r94 r110 1 /* $Id: updown.c,v 1. 3 1999-06-10 16:22:04 achimhaExp $ */2 /* 1 /* $Id: updown.c,v 1.4 1999-06-16 20:25:45 cbratschi Exp $ */ 2 /* 3 3 * Updown control 4 4 * 5 5 * Copyright 1997 Dimitrie O. Paun 6 6 * Copyright 1999 Achim Hasenmueller 7 * Copyright 1999 Christoph Bratschi 7 8 * 8 9 * TODO: … … 67 68 //#define UNKNOWN_PARAM(msg, wParam, lParam) WARN(updown, \ 68 69 // "UpDown Ctrl: Unknown parameter(s) for message " #msg \ 69 // 70 // "(%04x): wp=%04x lp=%08lx\n", msg, wParam, lParam); 70 71 #define UNKNOWN_PARAM(msg, wParam, lParam) 71 72 … … 101 102 { 102 103 delta += (delta < 0 ? -1 : 1) * 103 104 105 104 (infoPtr->MaxVal < infoPtr->MinVal ? -1 : 1) * 105 (infoPtr->MinVal - infoPtr->MaxVal) + 106 (delta < 0 ? 1 : -1); 106 107 } 107 108 else … … 119 120 * incr - TRUE get the "increment" rect (up or right) 120 121 * FALSE get the "decrement" rect (down or left) 121 * 122 * 122 123 */ 123 124 static void UPDOWN_GetArrowRect (HWND hwnd, RECT *rect, BOOL incr) … … 130 131 len = rect->right - rect->left; /* compute the width */ 131 132 if (incr) 132 rect->left = len/2+1; 133 rect->left = len/2+1; 133 134 else 134 135 rect->right = len/2; … … 169 170 char sep[2]; 170 171 171 if(GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_STHOUSAND, 172 172 if(GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_STHOUSAND, 173 sep, sizeof(sep)) != 1) 173 174 return ','; 174 175 … … 204 205 return FALSE; 205 206 206 sep = UPDOWN_GetThousandSep(); 207 sep = UPDOWN_GetThousandSep(); 207 208 208 209 /* now get rid of the separators */ 209 210 for(src = dst = txt; *src; src++) 210 211 if(*src != sep) 211 212 *dst++ = *src; 212 213 *dst = 0; 213 214 214 215 /* try to convert the number and validate it */ 215 216 newVal = strtol(txt, &src, infoPtr->Base); 216 if(*src || !UPDOWN_InBounds (hwnd, newVal)) 217 if(*src || !UPDOWN_InBounds (hwnd, newVal)) 217 218 return FALSE; 218 219 219 // TRACE(updown, "new value(%d) read from buddy (old=%d)\n", 220 // 221 } 222 220 // TRACE(updown, "new value(%d) read from buddy (old=%d)\n", 221 // newVal, infoPtr->CurVal); 222 } 223 223 224 infoPtr->CurVal = newVal; 224 225 return TRUE; … … 239 240 int len; 240 241 241 if (!IsWindow(infoPtr->Buddy)) 242 if (!IsWindow(infoPtr->Buddy)) 242 243 return FALSE; 243 244 244 245 // TRACE(updown, "set new value(%d) to buddy.\n", 245 // 246 // infoPtr->CurVal); 246 247 247 248 /*if the buddy is a list window, we must set curr index */ … … 252 253 len = sprintf(txt1, (infoPtr->Base==16) ? "%X" : "%d", infoPtr->CurVal); 253 254 254 sep = UPDOWN_GetThousandSep(); 255 sep = UPDOWN_GetThousandSep(); 255 256 256 257 /* Do thousands seperation if necessary */ … … 258 259 char txt2[20], *src = txt1, *dst = txt2; 259 260 if(len%3 > 0){ 260 lstrcpynA (dst, src, len%3 + 1); /* need to include the null */ 261 262 261 lstrcpynA (dst, src, len%3 + 1); /* need to include the null */ 262 dst += len%3; 263 src += len%3; 263 264 } 264 265 for(len=0; *src; len++){ 265 266 267 266 if(len%3==0) 267 *dst++ = sep; 268 *dst++ = *src++; 268 269 } 269 270 *dst = 0; /* null terminate it */ … … 274 275 275 276 return TRUE; 276 } 277 } 277 278 278 279 /*********************************************************************** … … 287 288 BOOL prssed; 288 289 RECT rect; 289 290 290 291 /* Draw the incr button */ 291 292 UPDOWN_GetArrowRect (hwnd, &rect, TRUE); 292 293 prssed = (infoPtr->Flags & FLAG_INCR) && (infoPtr->Flags & FLAG_MOUSEIN); 293 DrawFrameControl(hdc, &rect, DFC_SCROLL, 294 295 296 294 DrawFrameControl(hdc, &rect, DFC_SCROLL, 295 (dwStyle & UDS_HORZ ? DFCS_SCROLLLEFT : DFCS_SCROLLUP) | 296 (prssed ? DFCS_PUSHED : 0) | 297 (dwStyle&WS_DISABLED ? DFCS_INACTIVE : 0) ); 297 298 298 299 /* Draw the space between the buttons */ 299 300 rect.top = rect.bottom; rect.bottom++; 300 301 DrawEdge(hdc, &rect, 0, BF_MIDDLE); 301 302 302 303 /* Draw the decr button */ 303 304 UPDOWN_GetArrowRect(hwnd, &rect, FALSE); 304 305 prssed = (infoPtr->Flags & FLAG_DECR) && (infoPtr->Flags & FLAG_MOUSEIN); 305 DrawFrameControl(hdc, &rect, DFC_SCROLL, 306 307 308 306 DrawFrameControl(hdc, &rect, DFC_SCROLL, 307 (dwStyle & UDS_HORZ ? DFCS_SCROLLRIGHT : DFCS_SCROLLDOWN) | 308 (prssed ? DFCS_PUSHED : 0) | 309 (dwStyle & WS_DISABLED ? DFCS_INACTIVE : 0) ); 309 310 } 310 311 … … 318 319 { 319 320 HDC hdc; 320 321 321 322 hdc = GetDC (hwnd); 322 323 UPDOWN_Draw (hwnd, hdc); … … 335 336 PAINTSTRUCT ps; 336 337 HDC hdc; 337 338 338 339 hdc = BeginPaint (hwnd, &ps); 339 340 UPDOWN_Draw (hwnd, hdc); … … 345 346 * Tests if 'hwndBud' is a valid window handle. If not, returns FALSE. 346 347 * Else, sets it as a new Buddy. 347 * Then, it should subclass the buddy 348 * Then, it should subclass the buddy 348 349 * If window has the UDS_ARROWKEYS, it subcalsses the buddy window to 349 350 * process the UP/DOWN arrow keys. … … 353 354 static BOOL UPDOWN_SetBuddy (HWND hwnd, HWND hwndBud) 354 355 { 355 UPDOWN_INFO *infoPtr = UPDOWN_GetInfoPtr (hwnd); 356 UPDOWN_INFO *infoPtr = UPDOWN_GetInfoPtr (hwnd); 356 357 DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE); 357 358 RECT budRect; /* new coord for the buddy */ 358 359 int x; /* new x position and width for the up-down */ 359 360 360 361 *infoPtr->szBuddyClass = '\0'; 361 362 … … 380 381 GetWindowRect(infoPtr->Buddy, &budRect); 381 382 MapWindowPoints(HWND_DESKTOP, GetParent(infoPtr->Buddy), 382 383 (POINT *)(&budRect.left), 2); 383 384 384 385 /* now do the positioning */ … … 394 395 /* first adjust the buddy to accomodate the up/down */ 395 396 SetWindowPos(infoPtr->Buddy, 0, budRect.left, budRect.top, 396 budRect.right - budRect.left, budRect.bottom - budRect.top, 397 397 budRect.right - budRect.left, budRect.bottom - budRect.top, 398 SWP_NOACTIVATE|SWP_NOZORDER); 398 399 399 400 /* now position the up/down */ … … 402 403 403 404 SetWindowPos (hwnd, 0, x, budRect.top-DEFAULT_ADDTOP,DEFAULT_WIDTH, 404 405 405 (budRect.bottom-budRect.top)+DEFAULT_ADDTOP+DEFAULT_ADDBOT, 406 SWP_NOACTIVATE|SWP_NOZORDER); 406 407 407 408 return TRUE; 408 } 409 } 409 410 410 411 /*********************************************************************** 411 412 * UPDOWN_DoAction 412 413 * 413 * This function increments/decrements the CurVal by the 414 * This function increments/decrements the CurVal by the 414 415 * 'delta' amount according to the 'incr' flag 415 416 * It notifies the parent as required. … … 419 420 static void UPDOWN_DoAction (HWND hwnd, int delta, BOOL incr) 420 421 { 421 UPDOWN_INFO *infoPtr = UPDOWN_GetInfoPtr (hwnd); 422 UPDOWN_INFO *infoPtr = UPDOWN_GetInfoPtr (hwnd); 422 423 DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE); 423 424 int old_val = infoPtr->CurVal; … … 440 441 ni.hdr.hwndFrom = hwnd; 441 442 ni.hdr.idFrom = GetWindowLongA (hwnd, GWL_ID); 442 ni.hdr.code = UDN_DELTAPOS; 443 ni.hdr.code = UDN_DELTAPOS; 443 444 if (SendMessageA(GetParent (hwnd), WM_NOTIFY, 444 445 (WPARAM)ni.hdr.idFrom, (LPARAM)&ni)) 445 446 return; /* we are not allowed to change */ 446 447 447 448 /* Now adjust value with (maybe new) delta */ 448 449 if (!UPDOWN_OffsetVal (hwnd, ni.iDelta)) … … 450 451 451 452 /* Now take care about our buddy */ 452 if(!IsWindow(infoPtr->Buddy)) 453 if(!IsWindow(infoPtr->Buddy)) 453 454 return; /* Nothing else to do */ 454 455 … … 461 462 we do not have the UDS_SETBUDDYINT style set? */ 462 463 463 SendMessageA (GetParent (hwnd), 464 dwStyle & UDS_HORZ ? WM_HSCROLL : WM_VSCROLL, 465 466 464 SendMessageA (GetParent (hwnd), 465 dwStyle & UDS_HORZ ? WM_HSCROLL : WM_VSCROLL, 466 MAKELONG(incr ? SB_LINEUP : SB_LINEDOWN, infoPtr->CurVal), 467 hwnd); 467 468 } 468 469 … … 487 488 * Deletes any timers, releases the mouse and does redraw if necessary. 488 489 * If the control is not in "capture" mode, it does nothing. 489 * If the control was not in cancel mode, it returns FALSE. 490 * If the control was not in cancel mode, it returns FALSE. 490 491 * If the control was in cancel mode, it returns TRUE. 491 492 */ … … 493 494 { 494 495 UPDOWN_INFO *infoPtr = UPDOWN_GetInfoPtr (hwnd); 495 496 496 497 /* if not in 'capture' mode, do nothing */ 497 498 if(!(infoPtr->Flags & FLAG_CLICKED)) … … 500 501 KillTimer (hwnd, TIMERID1); /* kill all possible timers */ 501 502 KillTimer (hwnd, TIMERID2); 502 503 503 504 if (GetCapture() == hwnd) /* let the mouse go */ 504 ReleaseCapture(); /* if we still have it */ 505 505 ReleaseCapture(); /* if we still have it */ 506 506 507 infoPtr->Flags = 0; /* get rid of any flags */ 507 508 UPDOWN_Refresh (hwnd); /* redraw the control just in case */ 508 509 509 510 return TRUE; 510 511 } … … 515 516 * Handle a mouse event for the updown. 516 517 * 'pt' is the location of the mouse event in client or 517 * windows coordinates. 518 * windows coordinates. 518 519 */ 519 520 static void UPDOWN_HandleMouseEvent (HWND hwnd, UINT msg, POINT pt) … … 529 530 /* If we are already in the 'clicked' mode, then nothing to do */ 530 531 if(infoPtr->Flags & FLAG_CLICKED) 531 532 return; 532 533 533 534 /* If the buddy is an edit, will set focus to it */ 534 535 if (!lstrcmpA (infoPtr->szBuddyClass, "Edit")) 535 536 SetFocus(infoPtr->Buddy); 536 537 537 538 /* Now see which one is the 'active' arrow */ … … 540 541 /* Update the CurVal if necessary */ 541 542 if (dwStyle & UDS_SETBUDDYINT) 542 543 543 UPDOWN_GetBuddyInt (hwnd); 544 544 545 /* Before we proceed, see if we can spin... */ 545 546 if(!(dwStyle & UDS_WRAP)) 546 547 548 547 if(( temp && infoPtr->CurVal==infoPtr->MaxVal) || 548 (!temp && infoPtr->CurVal==infoPtr->MinVal)) 549 return; 549 550 550 551 /* Set up the correct flags */ 551 infoPtr->Flags = 0; 552 infoPtr->Flags = 0; 552 553 infoPtr->Flags |= temp ? FLAG_INCR : FLAG_DECR; 553 554 infoPtr->Flags |= FLAG_MOUSEIN; 554 555 555 556 /* repaint the control */ 556 557 UPDOWN_Refresh (hwnd); … … 563 564 564 565 /* and startup the first timer */ 565 SetTimer(hwnd, TIMERID1, INITIAL_DELAY, 0); 566 SetTimer(hwnd, TIMERID1, INITIAL_DELAY, 0); 566 567 break; 567 568 … … 569 570 /* If we are not in the 'clicked' mode, then nothing to do */ 570 571 if(!(infoPtr->Flags & FLAG_CLICKED)) 571 572 return; 572 573 573 574 /* save the flags to see if any got modified */ … … 576 577 /* Now get the 'active' arrow rectangle */ 577 578 if (infoPtr->Flags & FLAG_INCR) 578 579 UPDOWN_GetArrowRect (hwnd, &rect, TRUE); 579 580 else 580 581 UPDOWN_GetArrowRect (hwnd, &rect, FALSE); 581 582 582 583 /* Update the flags if we are in/out */ 583 584 if(PtInRect(&rect, pt)) 584 585 infoPtr->Flags |= FLAG_MOUSEIN; 585 586 else{ 586 587 588 587 infoPtr->Flags &= ~FLAG_MOUSEIN; 588 if(accelIndex != -1) /* if we have accel info */ 589 accelIndex = 0; /* reset it */ 589 590 } 590 591 /* If state changed, redraw the control */ 591 592 if(temp != infoPtr->Flags) 592 593 UPDOWN_Refresh (hwnd); 593 594 break; 594 595 595 596 default: 596 // 597 // ERR(updown, "Impossible case!\n"); 597 598 break; 598 599 } … … 604 605 */ 605 606 LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, 606 607 LPARAM lParam) 607 608 { 608 609 UPDOWN_INFO *infoPtr = UPDOWN_GetInfoPtr (hwnd); … … 622 623 623 624 /* initialize the info struct */ 624 infoPtr->AccelCount=0; infoPtr->AccelVect=0; 625 infoPtr->AccelCount=0; infoPtr->AccelVect=0; 625 626 infoPtr->CurVal=0; infoPtr->MinVal=0; infoPtr->MaxVal=100; /*FIXME*/ 626 627 infoPtr->Base = 10; /* Default to base 10 */ … … 630 631 /* Do we pick the buddy win ourselves? */ 631 632 if (dwStyle & UDS_AUTOBUDDY) 632 633 633 UPDOWN_SetBuddy (hwnd, GetWindow (hwnd, GW_HWNDPREV)); 634 634 635 // TRACE(updown, "UpDown Ctrl creation, hwnd=%04x\n", hwnd); 635 636 break; 636 637 637 638 case WM_DESTROY: 638 639 if(infoPtr->AccelVect) 639 640 COMCTL32_Free (infoPtr->AccelVect); 640 641 641 642 COMCTL32_Free (infoPtr); … … 643 644 // TRACE(updown, "UpDown Ctrl destruction, hwnd=%04x\n", hwnd); 644 645 break; 645 646 646 647 case WM_ENABLE: 647 648 if (dwStyle & WS_DISABLED) 648 649 UPDOWN_CancelMode (hwnd); 649 650 UPDOWN_Paint (hwnd); 650 651 break; … … 653 654 /* if initial timer, kill it and start the repeat timer */ 654 655 if(wParam == TIMERID1){ 655 656 657 658 659 660 661 662 663 664 665 656 KillTimer(hwnd, TIMERID1); 657 /* if no accel info given, used default timer */ 658 if(infoPtr->AccelCount==0 || infoPtr->AccelVect==0){ 659 accelIndex = -1; 660 temp = REPEAT_DELAY; 661 } 662 else{ 663 accelIndex = 0; /* otherwise, use it */ 664 temp = infoPtr->AccelVect[accelIndex].nSec * 1000 + 1; 665 } 666 SetTimer(hwnd, TIMERID2, temp, 0); 666 667 } 667 668 668 669 /* now, if the mouse is above us, do the thing...*/ 669 670 if(infoPtr->Flags & FLAG_MOUSEIN){ 670 671 672 673 674 675 676 677 678 SetTimer(hwnd, TIMERID2, temp, 0); 679 671 temp = accelIndex==-1 ? 1 : infoPtr->AccelVect[accelIndex].nInc; 672 UPDOWN_DoAction(hwnd, temp, infoPtr->Flags & FLAG_INCR); 673 674 if(accelIndex!=-1 && accelIndex < infoPtr->AccelCount-1){ 675 KillTimer(hwnd, TIMERID2); 676 accelIndex++; /* move to the next accel info */ 677 temp = infoPtr->AccelVect[accelIndex].nSec * 1000 + 1; 678 /* make sure we have at least 1ms intervals */ 679 SetTimer(hwnd, TIMERID2, temp, 0); 680 } 680 681 } 681 682 break; … … 687 688 case WM_LBUTTONUP: 688 689 if(!UPDOWN_CancelMode(hwnd)) 689 690 break; 690 691 /*If we released the mouse and our buddy is an edit */ 691 692 /* we must select all text in it. */ 692 693 if (!lstrcmpA (infoPtr->szBuddyClass, "Edit")) 693 694 break; 695 694 SendMessageA(infoPtr->Buddy, EM_SETSEL, 0, MAKELONG(0, -1)); 695 break; 696 696 697 case WM_LBUTTONDOWN: 697 698 case WM_MOUSEMOVE: 698 699 if(UPDOWN_IsEnabled(hwnd)){ 699 700 701 700 POINT pt; 701 CONV_POINT16TO32( (POINT16 *)&lParam, &pt ); 702 UPDOWN_HandleMouseEvent (hwnd, message, pt ); 702 703 } 703 704 break; … … 705 706 case WM_KEYDOWN: 706 707 if((dwStyle & UDS_ARROWKEYS) && UPDOWN_IsEnabled(hwnd)){ 707 708 case VK_UP: 709 710 711 712 713 714 } 715 break; 716 708 switch(wParam){ 709 case VK_UP: 710 case VK_DOWN: 711 UPDOWN_GetBuddyInt (hwnd); 712 UPDOWN_DoAction (hwnd, 1, wParam==VK_UP); 713 break; 714 } 715 } 716 break; 717 717 718 case WM_PAINT: 718 719 UPDOWN_Paint (hwnd); 719 720 break; 720 721 721 722 case UDM_GETACCEL: 722 723 if (wParam==0 && lParam==0) /*if both zero, */ 723 724 return infoPtr->AccelCount; /*just return the accel count*/ 724 725 if (wParam || lParam){ 725 726 726 UNKNOWN_PARAM(UDM_GETACCEL, wParam, lParam); 727 return 0; 727 728 } 728 729 temp = MIN(infoPtr->AccelCount, wParam); … … 733 734 // TRACE(updown, "UpDown Ctrl new accel info, hwnd=%04x\n", hwnd); 734 735 if(infoPtr->AccelVect){ 735 736 737 736 COMCTL32_Free (infoPtr->AccelVect); 737 infoPtr->AccelCount = 0; 738 infoPtr->AccelVect = 0; 738 739 } 739 740 if(wParam==0) 740 741 return TRUE; 741 742 infoPtr->AccelVect = COMCTL32_Alloc (wParam*sizeof(UDACCEL)); 742 743 if(infoPtr->AccelVect==0) 743 744 return FALSE; 744 745 memcpy(infoPtr->AccelVect, (void*)lParam, wParam*sizeof(UDACCEL)); 745 746 return TRUE; … … 747 748 case UDM_GETBASE: 748 749 if (wParam || lParam) 749 750 UNKNOWN_PARAM(UDM_GETBASE, wParam, lParam); 750 751 return infoPtr->Base; 751 752 752 753 case UDM_SETBASE: 753 // TRACE(updown, "UpDown Ctrl new base(%d), hwnd=%04x\n", 754 // 754 // TRACE(updown, "UpDown Ctrl new base(%d), hwnd=%04x\n", 755 // wParam, hwnd); 755 756 if ( !(wParam==10 || wParam==16) || lParam) 756 757 UNKNOWN_PARAM(UDM_SETBASE, wParam, lParam); 757 758 if (wParam==10 || wParam==16){ 758 759 760 759 temp = infoPtr->Base; 760 infoPtr->Base = wParam; 761 return temp; /* return the prev base */ 761 762 } 762 763 break; … … 764 765 case UDM_GETBUDDY: 765 766 if (wParam || lParam) 766 767 UNKNOWN_PARAM(UDM_GETBUDDY, wParam, lParam); 767 768 return infoPtr->Buddy; 768 769 769 770 case UDM_SETBUDDY: 770 771 if (lParam) 771 772 UNKNOWN_PARAM(UDM_SETBUDDY, wParam, lParam); 772 773 temp = infoPtr->Buddy; 773 774 infoPtr->Buddy = wParam; 774 775 UPDOWN_SetBuddy (hwnd, wParam); 775 // TRACE(updown, "UpDown Ctrl new buddy(%04x), hwnd=%04x\n", 776 // 776 // TRACE(updown, "UpDown Ctrl new buddy(%04x), hwnd=%04x\n", 777 // infoPtr->Buddy, hwnd); 777 778 return temp; 778 779 779 780 case UDM_GETPOS: 780 781 if (wParam || lParam) 781 782 UNKNOWN_PARAM(UDM_GETPOS, wParam, lParam); 782 783 temp = UPDOWN_GetBuddyInt (hwnd); 783 784 return MAKELONG(infoPtr->CurVal, temp ? 0 : 1); … … 785 786 case UDM_SETPOS: 786 787 if (wParam || HIWORD(lParam)) 787 788 UNKNOWN_PARAM(UDM_GETPOS, wParam, lParam); 788 789 temp = SLOWORD(lParam); 789 790 // TRACE(updown, "UpDown Ctrl new value(%d), hwnd=%04x\n", 790 // 791 // temp, hwnd); 791 792 if(!UPDOWN_InBounds(hwnd, temp)){ 792 if(temp < infoPtr->MinVal) 793 794 795 793 if(temp < infoPtr->MinVal) 794 temp = infoPtr->MinVal; 795 if(temp > infoPtr->MaxVal) 796 temp = infoPtr->MaxVal; 796 797 } 797 798 wParam = infoPtr->CurVal; /* save prev value */ 798 799 infoPtr->CurVal = temp; /* set the new value */ 799 800 if(dwStyle & UDS_SETBUDDYINT) 800 801 UPDOWN_SetBuddyInt (hwnd); 801 802 return wParam; /* return prev value */ 802 803 803 804 case UDM_GETRANGE: 804 805 if (wParam || lParam) 805 806 UNKNOWN_PARAM(UDM_GETRANGE, wParam, lParam); 806 807 return MAKELONG(infoPtr->MaxVal, infoPtr->MinVal); 807 808 808 809 case UDM_SETRANGE: 809 810 if (wParam) 810 811 UNKNOWN_PARAM(UDM_SETRANGE, wParam, lParam); /* we must have: */ 811 812 infoPtr->MaxVal = SLOWORD(lParam); /* UD_MINVAL <= Max <= UD_MAXVAL */ 812 813 infoPtr->MinVal = SHIWORD(lParam); /* UD_MINVAL <= Min <= UD_MAXVAL */ 813 814 /* |Max-Min| <= UD_MAXVAL */ 814 // TRACE(updown, "UpDown Ctrl new range(%d to %d), hwnd=%04x\n", 815 // 816 break; 815 // TRACE(updown, "UpDown Ctrl new range(%d to %d), hwnd=%04x\n", 816 // infoPtr->MinVal, infoPtr->MaxVal, hwnd); 817 break; 817 818 818 819 case UDM_GETRANGE32: 819 820 if (wParam) 820 821 *(LPINT)wParam = infoPtr->MinVal; 821 822 if (lParam) 822 823 *(LPINT)lParam = infoPtr->MaxVal; 823 824 break; 824 825 … … 827 828 infoPtr->MaxVal = (INT)lParam; 828 829 if (infoPtr->MaxVal <= infoPtr->MinVal) 829 830 // TRACE(updown, "UpDown Ctrl new range(%d to %d), hwnd=%04x\n", 831 // 832 break; 833 834 default: 835 if (message >= WM_USER) 836 // ERR (updown, "unknown msg %04x wp=%04x lp=%08lx\n",837 // 838 return DefWindowProcA (hwnd, message, wParam, lParam); 839 } 830 infoPtr->MaxVal = infoPtr->MinVal + 1; 831 // TRACE(updown, "UpDown Ctrl new range(%d to %d), hwnd=%04x\n", 832 // infoPtr->MinVal, infoPtr->MaxVal, hwnd); 833 break; 834 835 default: 836 // if (message >= WM_USER) 837 // ERR (updown, "unknown msg %04x wp=%04x lp=%08lx\n", 838 // message, wParam, lParam); 839 return DefWindowProcA (hwnd, message, wParam, lParam); 840 } 840 841 841 842 return 0; … … 844 845 845 846 /*********************************************************************** 846 * UPDOWN_Register[Internal]847 * UPDOWN_Register [Internal] 847 848 * 848 849 * Registers the updown window class. … … 864 865 wndClass.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1); 865 866 wndClass.lpszClassName = UPDOWN_CLASSA; 866 867 867 868 RegisterClassA( &wndClass ); 868 869 } … … 870 871 871 872 /*********************************************************************** 872 * UPDOWN_Unregister[Internal]873 * UPDOWN_Unregister [Internal] 873 874 * 874 875 * Unregisters the updown window class. … … 879 880 { 880 881 if (GlobalFindAtomA (UPDOWN_CLASSA)) 881 882 } 883 882 UnregisterClassA (UPDOWN_CLASSA, (HINSTANCE)NULL); 883 } 884
Note:
See TracChangeset
for help on using the changeset viewer.