Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch tip474 Excluding Merge-Ins
This is equivalent to a diff from 075ba014 to 221ea53e
2020-10-21
| ||
16:00 | Implement TIP #474: Treat the mouse wheel events in a uniform way check-in: 7c9e1f47 user: jan.nijtmans tags: trunk | |
2020-10-07
| ||
15:10 | More warnings -Wshadow with C++ compiler. Simplify <KeyPress> -> <Key> check-in: 38c668de user: jan.nijtmans tags: trunk | |
12:13 | Merge trunk check-in: 31d64fda user: jan.nijtmans tags: tip-587 | |
12:08 | Merge trunk Closed-Leaf check-in: 221ea53e user: jan.nijtmans tags: tip474 | |
11:57 | Merge trunk check-in: 74bd82cb user: jan.nijtmans tags: tip_325 | |
11:52 | Disable two test-cases for Tcl < 8.6.7 (they fail because of bug [25842c161f]) check-in: 075ba014 user: jan.nijtmans tags: trunk | |
06:15 | Better wording for [0008d6a6b3]: Mouse pointer position reported in non-existing window. There is no actual bug, but the man page could be improved (even more). check-in: c92fe64f user: fvogel tags: trunk | |
2020-10-06
| ||
14:49 | Merge trunk check-in: b54f4640 user: jan.nijtmans tags: tip474 | |
Changes to doc/GetScroll.3.
︙ | ︙ | |||
58 59 60 61 62 63 64 | keywords may be abbreviated. If \fIobjv\fR has the \fBmoveto\fR form, \fBTK_SCROLL_MOVETO\fR is returned as result and \fI*fractionPtr\fR is filled in with the \fIfraction\fR argument to the command, which must be a proper real value. If \fIobjv\fR has the \fBscroll\fR form, \fBTK_SCROLL_PAGES\fR or \fBTK_SCROLL_UNITS\fR is returned and \fI*stepsPtr\fR is filled | | > | 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | keywords may be abbreviated. If \fIobjv\fR has the \fBmoveto\fR form, \fBTK_SCROLL_MOVETO\fR is returned as result and \fI*fractionPtr\fR is filled in with the \fIfraction\fR argument to the command, which must be a proper real value. If \fIobjv\fR has the \fBscroll\fR form, \fBTK_SCROLL_PAGES\fR or \fBTK_SCROLL_UNITS\fR is returned and \fI*stepsPtr\fR is filled in with the \fInumber\fR value, which must be a integer or a float, but if it is a float then it is converted to an integer, rounded away from 0. If an error occurs in parsing the arguments, \fBTK_SCROLL_ERROR\fR is returned and an error message is left in interpreter \fIinterp\fR's result. .PP \fBTk_GetScrollInfo\fR is identical in function to \fBTk_GetScrollInfoObj\fR. However, \fBTk_GetScrollInfo\fR accepts string arguments, making it more appropriate for use with legacy |
︙ | ︙ |
Changes to doc/bind.n.
︙ | ︙ | |||
210 211 212 213 214 215 216 | value determines which direction your widget should scroll. Positive values should scroll up and negative values should scroll down. .RS .PP Horizontal scrolling uses \fBShift-MouseWheel\fR events, with positive \fB%D\fR \fIdelta\fR substitution indicating left scrolling and negative right scrolling. | < < < < | | 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 | value determines which direction your widget should scroll. Positive values should scroll up and negative values should scroll down. .RS .PP Horizontal scrolling uses \fBShift-MouseWheel\fR events, with positive \fB%D\fR \fIdelta\fR substitution indicating left scrolling and negative right scrolling. Horizontal scrolling events may fire from many different hardware units such as tilt wheels or touchpads. Horizontal scrolling can also be emulated by holding Shift and scrolling vertically. .RE .IP "\fBKeyPress\fR, \fBKeyRelease\fR" 5 The \fBKeyPress\fR and \fBKeyRelease\fR events are generated whenever a key is pressed or released. \fBKeyPress\fR and \fBKeyRelease\fR .IP "\fBKey\fR, \fBKeyRelease\fR" 5 |
︙ | ︙ |
Changes to doc/canvas.n.
︙ | ︙ | |||
1143 1144 1145 1146 1147 1148 1149 | total width of the canvas is off-screen to the left. \fIFraction\fR must be a fraction between 0 and 1. .TP \fIpathName \fBxview scroll \fInumber what\fR . This command shifts the view in the window left or right according to \fInumber\fR and \fIwhat\fR. | | > | 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 | total width of the canvas is off-screen to the left. \fIFraction\fR must be a fraction between 0 and 1. .TP \fIpathName \fBxview scroll \fInumber what\fR . This command shifts the view in the window left or right according to \fInumber\fR and \fIwhat\fR. \fINumber\fR must be an integer or a float, but if it is a float then it is converted to an integer, rounded away from 0. \fIWhat\fR must be either \fBpages\fR or \fBunits\fR or an abbreviation of one of these. If \fIwhat is \fBpages\fR then the view adjusts in units of nine-tenths the window's width. If \fInumber\fR is negative then information farther to the left becomes visible; if it is positive then information farther to the right becomes visible. |
︙ | ︙ |
Changes to doc/entry.n.
︙ | ︙ | |||
399 400 401 402 403 404 405 | Adjusts the view in the window so that the character \fIfraction\fR of the way through the text appears at the left edge of the window. \fIFraction\fR must be a fraction between 0 and 1. .TP \fIpathName \fBxview scroll \fInumber what\fR This command shifts the view in the window left or right according to \fInumber\fR and \fIwhat\fR. | | > | 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 | Adjusts the view in the window so that the character \fIfraction\fR of the way through the text appears at the left edge of the window. \fIFraction\fR must be a fraction between 0 and 1. .TP \fIpathName \fBxview scroll \fInumber what\fR This command shifts the view in the window left or right according to \fInumber\fR and \fIwhat\fR. \fINumber\fR must be an integer or a float, but if it is a float then it is converted to an integer, rounded away from 0. \fIWhat\fR must be either \fBpages\fR or \fBunits\fR or an abbreviation of one of these. If \fIwhat\fR is \fBpages\fR then the view adjusts by \fInumber\fR screenfuls. If \fInumber\fR is negative then characters farther to the left become visible; if it is positive then characters farther to the right become visible. If \fIwhat\fR is \fBunits\fR, the view adjusts left or right by |
︙ | ︙ |
Changes to doc/listbox.n.
︙ | ︙ | |||
379 380 381 382 383 384 385 | total width of the listbox text is off-screen to the left. \fIfraction\fR must be a fraction between 0 and 1. .TP \fIpathName \fBxview scroll \fInumber what\fR . This command shifts the view in the window left or right according to \fInumber\fR and \fIwhat\fR. | | > | 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 | total width of the listbox text is off-screen to the left. \fIfraction\fR must be a fraction between 0 and 1. .TP \fIpathName \fBxview scroll \fInumber what\fR . This command shifts the view in the window left or right according to \fInumber\fR and \fIwhat\fR. \fINumber\fR must be an integer or a float, but if it is a float then it is converted to an integer, rounded away from 0. \fIWhat\fR must be either \fBpages\fR or \fBunits\fR or an abbreviation of one of these. If \fIwhat\fR is \fBpages\fR then the view adjusts by \fInumber\fR screenfuls. If \fInumber\fR is negative then characters farther to the left become visible; if it is positive then characters farther to the right become visible. |
︙ | ︙ |
Changes to doc/scrollbar.n.
︙ | ︙ | |||
219 220 221 222 223 224 225 | . The widget should adjust its view by \fInumber\fR pages. It is up to the widget to define the meaning of a page; typically it is slightly less than what fits in the window, so that there is a slight overlap between the old and new views. \fINumber\fR is either 1, which means the next page should become visible, or \-1, which means that the previous page should | | > | > > | 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 | . The widget should adjust its view by \fInumber\fR pages. It is up to the widget to define the meaning of a page; typically it is slightly less than what fits in the window, so that there is a slight overlap between the old and new views. \fINumber\fR is either 1, which means the next page should become visible, or \-1, which means that the previous page should become visible. Fractional number are rounded away from 0, so scrolling 0.001 pages has the same effect as scrolling 1 page. .TP \fIprefix \fBscroll \fInumber \fBunits\fR . The widget should adjust its view by \fInumber\fR units. The units are defined in whatever way makes sense for the widget, such as characters or lines in a text widget. \fINumber\fR is either 1, which means one unit should scroll off the top or left of the window, or \-1, which means that one unit should scroll off the bottom or right of the window. Fractional numbers are rounded away from 0, so scrolling 0.001 units has the same effect as scrolling 1 unit. .SH "OLD COMMAND SYNTAX" .PP In versions of Tk before 4.0, the \fBset\fR and \fBget\fR widget commands used a different form. This form is still supported for backward compatibility, but it is deprecated. In the old command syntax, the \fBset\fR widget command has the |
︙ | ︙ |
Changes to doc/spinbox.n.
︙ | ︙ | |||
466 467 468 469 470 471 472 | Adjusts the view in the window so that the character \fIfraction\fR of the way through the text appears at the left edge of the window. \fIFraction\fR must be a fraction between 0 and 1. .TP \fIpathName \fBxview scroll \fInumber what\fR This command shifts the view in the window left or right according to \fInumber\fR and \fIwhat\fR. | | > | 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 | Adjusts the view in the window so that the character \fIfraction\fR of the way through the text appears at the left edge of the window. \fIFraction\fR must be a fraction between 0 and 1. .TP \fIpathName \fBxview scroll \fInumber what\fR This command shifts the view in the window left or right according to \fInumber\fR and \fIwhat\fR. \fINumber\fR must be an integer or a float, but if it is a float then it is converted to an integer, rounded away from 0. \fIWhat\fR must be either \fBpages\fR or \fBunits\fR or an abbreviation of one of these. If \fIwhat\fR is \fBpages\fR then the view adjusts by \fInumber\fR screenfuls. If \fInumber\fR is negative then characters farther to the left become visible; if it is positive then characters farther to the right become visible. If \fIwhat\fR is \fBunits\fR, the view adjusts left or right by |
︙ | ︙ |
Changes to doc/ttk_widget.n.
︙ | ︙ | |||
253 254 255 256 257 258 259 | Adjusts the view in the window so that the character \fIfraction\fR of the way through the content appears at the left edge of the window. \fIFraction\fR must be a fraction between 0 and 1. .TP \fIpathName \fBxview scroll \fInumber what\fR This command shifts the view in the window left or right according to \fInumber\fR and \fIwhat\fR. | | > | 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 | Adjusts the view in the window so that the character \fIfraction\fR of the way through the content appears at the left edge of the window. \fIFraction\fR must be a fraction between 0 and 1. .TP \fIpathName \fBxview scroll \fInumber what\fR This command shifts the view in the window left or right according to \fInumber\fR and \fIwhat\fR. \fINumber\fR must be an integer or a float, but if it is a float then it is converted to an integer, rounded away from 0. \fIWhat\fR must be either \fBpages\fR or \fBunits\fR. '\" or an abbreviation of one of these, but we don't document that. If \fIwhat\fR is \fBpages\fR then the view adjusts by \fInumber\fR screenfuls. If \fInumber\fR is negative then characters farther to the left become visible; if it is positive then characters farther to the right become visible. |
︙ | ︙ |
Changes to generic/tkBind.c.
︙ | ︙ | |||
788 789 790 791 792 793 794 795 | return s; } static unsigned GetButtonNumber( const char *field) { assert(field); | > | > | 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 | return s; } static unsigned GetButtonNumber( const char *field) { unsigned button; assert(field); button = (field[0] >= '1' && field[0] <= '9' && field[1] == '\0') ? field[0] - '0' : 0; return (button > 3) ? (button + 4) : button; } static Time CurrentTimeInMilliSecs(void) { Tcl_Time now; Tcl_GetTime(&now); |
︙ | ︙ | |||
4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 | } break; case EVENT_BUTTON: if (Tcl_GetIntFromObj(interp, valuePtr, &number) != TCL_OK) { return TCL_ERROR; } if (flags & BUTTON) { event.general.xbutton.button = number; } else { badOpt = 1; } break; case EVENT_COUNT: if (Tcl_GetIntFromObj(interp, valuePtr, &number) != TCL_OK) { | > > > | 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 | } break; case EVENT_BUTTON: if (Tcl_GetIntFromObj(interp, valuePtr, &number) != TCL_OK) { return TCL_ERROR; } if (flags & BUTTON) { if (number >= Button4) { number += (Button8 - Button4); } event.general.xbutton.button = number; } else { badOpt = 1; } break; case EVENT_COUNT: if (Tcl_GetIntFromObj(interp, valuePtr, &number) != TCL_OK) { |
︙ | ︙ | |||
5185 5186 5187 5188 5189 5190 5191 | Tcl_AppendToObj(patternObj, "-", 1); Tcl_AppendToObj(patternObj, string, -1); } break; } case ButtonPress: case ButtonRelease: | | | | | 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 | Tcl_AppendToObj(patternObj, "-", 1); Tcl_AppendToObj(patternObj, string, -1); } break; } case ButtonPress: case ButtonRelease: assert(patPtr->info <= 13); Tcl_AppendPrintfToObj(patternObj, "-%u", (unsigned) ((patPtr->info > 7) ? (patPtr->info - 4) : patPtr->info)); break; #if PRINT_SHORT_MOTION_SYNTAX case MotionNotify: { unsigned mask = patPtr->modMask; while (mask & ALL_BUTTONS) { unsigned button = ButtonNumberFromState(mask); Tcl_AppendPrintfToObj(patternObj, "-%u", (button > 7) ? (button - 4) : button); mask &= ~Tk_GetButtonMask(button); } break; } #endif } } |
︙ | ︙ |
Changes to generic/tkEvent.c.
︙ | ︙ | |||
511 512 513 514 515 516 517 | } /* *---------------------------------------------------------------------- * * Tk_GetButtonMask -- * | | > > > | | | 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 | } /* *---------------------------------------------------------------------- * * Tk_GetButtonMask -- * * Return the proper Button${n}Mask for the button. Don't care about * Button4 - Button7, because those are not actually buttons: Those * are used for the horizontal or vertical mouse wheels. Button4Mask * and higher is actually used for Button 8 and higher. * * Results: * A button mask. * * Side effects: * None. * *---------------------------------------------------------------------- */ static const unsigned buttonMasks[] = { 0, Button1Mask, Button2Mask, Button3Mask, 0, 0, 0, 0, Button4Mask, \ Button5Mask, Button6Mask, Button7Mask, Button8Mask, Button9Mask }; unsigned Tk_GetButtonMask( unsigned button) { return (button > Button9) ? 0 : buttonMasks[button]; |
︙ | ︙ | |||
1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 | TkWindow *winPtr; unsigned long mask; InProgress ip; Tcl_Interp *interp = NULL; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); /* * If the generic handler processed this event we are done and can return. */ if (InvokeGenericHandlers(tsdPtr, eventPtr)) { goto releaseEventResources; } | > > > > > > > > > > > > > > > > > | 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 | TkWindow *winPtr; unsigned long mask; InProgress ip; Tcl_Interp *interp = NULL; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); #if !defined(_WIN32) && !defined(MAC_OSX_TK) if ((eventPtr->xbutton.button >= Button4) && (eventPtr->xbutton.button < Button8)) { if (eventPtr->type == ButtonRelease) { return; } else if (eventPtr->type == ButtonPress) { int but = eventPtr->xbutton.button; eventPtr->type = MouseWheelEvent; eventPtr->xany.send_event = -1; eventPtr->xkey.keycode = (but & 1) ? -120 : 120; if (but > Button5) { eventPtr->xkey.state ^= ShiftMask; } } } #endif /* * If the generic handler processed this event we are done and can return. */ if (InvokeGenericHandlers(tsdPtr, eventPtr)) { goto releaseEventResources; } |
︙ | ︙ |
Changes to generic/tkInt.h.
︙ | ︙ | |||
1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 | * bits. */ #define META_MASK (AnyModifier<<1) #define ALT_MASK (AnyModifier<<2) #define EXTENDED_MASK (AnyModifier<<3) #ifndef Button8 # define Button8 8 #endif #ifndef Button9 # define Button9 9 #endif | > > > > > | 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 | * bits. */ #define META_MASK (AnyModifier<<1) #define ALT_MASK (AnyModifier<<2) #define EXTENDED_MASK (AnyModifier<<3) /* * Buttons 8 and 9 are the Xbuttons (left and right side-buttons). On Windows/Mac, those * are known as Buttons 4 and 5. At script level, they also get the numbers 4 and 5. */ #ifndef Button8 # define Button8 8 #endif #ifndef Button9 # define Button9 9 #endif |
︙ | ︙ |
Changes to generic/tkTextDisp.c.
︙ | ︙ | |||
8783 8784 8785 8786 8787 8788 8789 8790 8791 8792 8793 8794 8795 8796 | static const char *const units[] = { "pages", "pixels", "units", NULL }; enum viewUnits { VIEW_SCROLL_PAGES, VIEW_SCROLL_PIXELS, VIEW_SCROLL_UNITS }; int index; if (Tcl_GetIndexFromObjStruct(interp, objv[2], subcommands, sizeof(char *), "option", 0, &index) != TCL_OK) { return TKTEXT_SCROLL_ERROR; } switch ((enum viewSubcmds) index) { | > | 8783 8784 8785 8786 8787 8788 8789 8790 8791 8792 8793 8794 8795 8796 8797 | static const char *const units[] = { "pages", "pixels", "units", NULL }; enum viewUnits { VIEW_SCROLL_PAGES, VIEW_SCROLL_PIXELS, VIEW_SCROLL_UNITS }; int index; double d; if (Tcl_GetIndexFromObjStruct(interp, objv[2], subcommands, sizeof(char *), "option", 0, &index) != TCL_OK) { return TKTEXT_SCROLL_ERROR; } switch ((enum viewSubcmds) index) { |
︙ | ︙ | |||
8810 8811 8812 8813 8814 8815 8816 | } if (Tcl_GetIndexFromObjStruct(interp, objv[4], units, sizeof(char *), "argument", 0, &index) != TCL_OK) { return TKTEXT_SCROLL_ERROR; } switch ((enum viewUnits) index) { case VIEW_SCROLL_PAGES: | | | > > > > | | | > > > | | | > | | < | > | > > | 8811 8812 8813 8814 8815 8816 8817 8818 8819 8820 8821 8822 8823 8824 8825 8826 8827 8828 8829 8830 8831 8832 8833 8834 8835 8836 8837 8838 8839 8840 8841 8842 8843 8844 8845 8846 8847 8848 8849 8850 8851 8852 8853 | } if (Tcl_GetIndexFromObjStruct(interp, objv[4], units, sizeof(char *), "argument", 0, &index) != TCL_OK) { return TKTEXT_SCROLL_ERROR; } switch ((enum viewUnits) index) { case VIEW_SCROLL_PAGES: if (Tcl_GetDoubleFromObj(interp, objv[3], &d) != TCL_OK) { return TKTEXT_SCROLL_ERROR; } *intPtr = (d > 0) ? ceil(d) : floor(d); if (dblPtr) { *dblPtr = d; } return TKTEXT_SCROLL_PAGES; case VIEW_SCROLL_PIXELS: if (Tk_GetPixelsFromObj(interp, textPtr->tkwin, objv[3], intPtr) != TCL_OK) { return TKTEXT_SCROLL_ERROR; } if (dblPtr) { *dblPtr = (double)*intPtr; } return TKTEXT_SCROLL_PIXELS; case VIEW_SCROLL_UNITS: if (Tcl_GetDoubleFromObj(interp, objv[3], &d) != TCL_OK) { return TKTEXT_SCROLL_ERROR; } *intPtr = (d > 0) ? ceil(d) : floor(d); if (dblPtr) { *dblPtr = d; } return TKTEXT_SCROLL_UNITS; } } Tcl_Panic("unexpected switch fallthrough"); return TKTEXT_SCROLL_ERROR; } #if TK_LAYOUT_WITH_BASE_CHUNKS /* *---------------------------------------------------------------------- * |
︙ | ︙ |
Changes to generic/tkUtil.c.
︙ | ︙ | |||
660 661 662 663 664 665 666 667 668 669 670 671 672 673 | } if (Tcl_GetDouble(interp, argv[3], dblPtr) != TCL_OK) { return TK_SCROLL_ERROR; } return TK_SCROLL_MOVETO; } else if ((c == 's') && (strncmp(argv[2], "scroll", length) == 0)) { if (argc != 5) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "wrong # args: should be \"%s %s %s\"", argv[0], argv[1], "scroll number pages|units")); Tcl_SetErrorCode(interp, "TCL", "WRONGARGS", NULL); return TK_SCROLL_ERROR; } | > | > | 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 | } if (Tcl_GetDouble(interp, argv[3], dblPtr) != TCL_OK) { return TK_SCROLL_ERROR; } return TK_SCROLL_MOVETO; } else if ((c == 's') && (strncmp(argv[2], "scroll", length) == 0)) { double d; if (argc != 5) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "wrong # args: should be \"%s %s %s\"", argv[0], argv[1], "scroll number pages|units")); Tcl_SetErrorCode(interp, "TCL", "WRONGARGS", NULL); return TK_SCROLL_ERROR; } if (Tcl_GetDouble(interp, argv[3], &d) != TCL_OK) { return TK_SCROLL_ERROR; } *intPtr = (d > 0) ? ceil(d) : floor(d); length = strlen(argv[4]); c = argv[4][0]; if ((c == 'p') && (strncmp(argv[4], "pages", length) == 0)) { return TK_SCROLL_PAGES; } else if ((c == 'u') && (strncmp(argv[4], "units", length) == 0)) { return TK_SCROLL_UNITS; } |
︙ | ︙ | |||
740 741 742 743 744 745 746 747 748 749 750 | return TK_SCROLL_ERROR; } if (Tcl_GetDoubleFromObj(interp, objv[3], dblPtr) != TCL_OK) { return TK_SCROLL_ERROR; } return TK_SCROLL_MOVETO; } else if (ArgPfxEq("scroll")) { if (objc != 5) { Tcl_WrongNumArgs(interp, 2, objv, "scroll number pages|units"); return TK_SCROLL_ERROR; } | > | > > > > | 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 | return TK_SCROLL_ERROR; } if (Tcl_GetDoubleFromObj(interp, objv[3], dblPtr) != TCL_OK) { return TK_SCROLL_ERROR; } return TK_SCROLL_MOVETO; } else if (ArgPfxEq("scroll")) { double d; if (objc != 5) { Tcl_WrongNumArgs(interp, 2, objv, "scroll number pages|units"); return TK_SCROLL_ERROR; } if (Tcl_GetDoubleFromObj(interp, objv[3], &d) != TCL_OK) { return TK_SCROLL_ERROR; } *intPtr = (d >= 0) ? ceil(d) : floor(d); if (dblPtr) { *dblPtr = d; } arg = TkGetStringFromObj(objv[4], &length); if (ArgPfxEq("pages")) { return TK_SCROLL_PAGES; } else if (ArgPfxEq("units")) { return TK_SCROLL_UNITS; |
︙ | ︙ |
Changes to library/demos/cscroll.tcl.
︙ | ︙ | |||
52 53 54 55 56 57 58 | -anchor center -tags text } } $c bind all <Enter> "scrollEnter $c" $c bind all <Leave> "scrollLeave $c" $c bind all <Button-1> "scrollButton $c" | | | | | | | | > | > > > > | > > > | | 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 | -anchor center -tags text } } $c bind all <Enter> "scrollEnter $c" $c bind all <Leave> "scrollLeave $c" $c bind all <Button-1> "scrollButton $c" if {([tk windowingsystem] eq "aqua") && ![package vsatisfies [package provide Tk] 8.7-]} { bind $c <Button-3> "$c scan mark %x %y" bind $c <B3-Motion> "$c scan dragto %x %y" bind $c <MouseWheel> { %W yview scroll [expr {-%D}] units } bind $c <Option-MouseWheel> { %W yview scroll [expr {-10*%D}] units } bind $c <Shift-MouseWheel> { %W xview scroll [expr {-%D}] units } bind $c <Shift-Option-MouseWheel> { %W xview scroll [expr {-10*%D}] units } } else { bind $c <Button-2> "$c scan mark %x %y" bind $c <B2-Motion> "$c scan dragto %x %y" # We must make sure that positive and negative movements are rounded # equally to integers, avoiding the problem that # (int)1/-30 = -1, # but # (int)-1/-30 = 0 # The following code ensure equal +/- behaviour. bind $c <MouseWheel> { if {%D >= 0} { %W yview scroll [expr {%D/-30}] units } else { %W yview scroll [expr {(%D-29)/-30}] units } } bind $c <Option-MouseWheel> { if {%D >= 0} { %W yview scroll [expr {%D/-3}] units } else { %W yview scroll [expr {(%D-2)/-3}] units } } bind $c <Shift-MouseWheel> { if {%D >= 0} { %W xview scroll [expr {%D/-30}] units } else { %W xview scroll [expr {(%D-29)/-30}] units } } bind $c <Shift-Option-MouseWheel> { if {%D >= 0} { %W xview scroll [expr {%D/-3}] units } else { %W xview scroll [expr {(%D-2)/-3}] units } } } if {[tk windowingsystem] eq "x11" && ![package vsatisfies [package provide Tk] 8.7-]} { # Support for mousewheels on Linux/Unix commonly comes through mapping # the wheel to the extended buttons. If you have a mousewheel, find # Linux configuration info at: # http://linuxreviews.org/howtos/xfree/mouse/ bind $c <Button-4> { if {!$tk_strictMotif} { %W yview scroll -5 units |
︙ | ︙ | |||
122 123 124 125 126 127 128 | %W yview scroll 5 units } } bind $c <Shift-Button-5> { if {!$tk_strictMotif} { %W xview scroll 5 units } | < < < < < < < < < < < < | 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | %W yview scroll 5 units } } bind $c <Shift-Button-5> { if {!$tk_strictMotif} { %W xview scroll 5 units } } } proc scrollEnter canvas { global oldFill set id [$canvas find withtag current] |
︙ | ︙ |
Changes to library/demos/ctext.tcl.
︙ | ︙ | |||
46 47 48 49 50 51 52 | $c bind text <Shift-Button-1> "$c select adjust current @%x,%y" $c bind text <Shift-B1-Motion> "textB1Move $c %x %y" $c bind text <Key> "textInsert $c %A" $c bind text <Return> "textInsert $c \\n" $c bind text <Control-h> "textBs $c" $c bind text <BackSpace> "textBs $c" $c bind text <Delete> "textDel $c" | | | 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | $c bind text <Shift-Button-1> "$c select adjust current @%x,%y" $c bind text <Shift-B1-Motion> "textB1Move $c %x %y" $c bind text <Key> "textInsert $c %A" $c bind text <Return> "textInsert $c \\n" $c bind text <Control-h> "textBs $c" $c bind text <BackSpace> "textBs $c" $c bind text <Delete> "textDel $c" if {[tk windowingsystem] eq "aqua" && ![package vsatisfies [package provide Tk] 8.7-]} { $c bind text <Button-3> "textPaste $c @%x,%y" } else { $c bind text <Button-2> "textPaste $c @%x,%y" } # Next, create some items that allow the text's anchor position # to be edited. |
︙ | ︙ |
Changes to library/demos/floor.tcl.
︙ | ︙ | |||
1355 1356 1357 1358 1359 1360 1361 | # Set up event bindings for canvas: $c bind floor1 <Button-1> "floorDisplay $c 1" $c bind floor2 <Button-1> "floorDisplay $c 2" $c bind floor3 <Button-1> "floorDisplay $c 3" $c bind room <Enter> "newRoom $c" $c bind room <Leave> {set currentRoom ""} | | | 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 | # Set up event bindings for canvas: $c bind floor1 <Button-1> "floorDisplay $c 1" $c bind floor2 <Button-1> "floorDisplay $c 2" $c bind floor3 <Button-1> "floorDisplay $c 3" $c bind room <Enter> "newRoom $c" $c bind room <Leave> {set currentRoom ""} if {[tk windowingsystem] eq "aqua" && ![package vsatisfies [package provide Tk] 8.7-]} { bind $c <Button-3> "$c scan mark %x %y" bind $c <B3-Motion> "$c scan dragto %x %y" } else { bind $c <Button-2> "$c scan mark %x %y" bind $c <B2-Motion> "$c scan dragto %x %y" } bind $c <Destroy> "unset currentRoom" |
︙ | ︙ |
Changes to library/demos/items.tcl.
︙ | ︙ | |||
169 170 171 172 173 174 175 | $c create text 21c 20.9c -text Entry: -anchor sw $c create text 28.5c 17.4c -text Scale: -anchor s # Set up event bindings for canvas: $c bind item <Enter> "itemEnter $c" $c bind item <Leave> "itemLeave $c" | | | 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 | $c create text 21c 20.9c -text Entry: -anchor sw $c create text 28.5c 17.4c -text Scale: -anchor s # Set up event bindings for canvas: $c bind item <Enter> "itemEnter $c" $c bind item <Leave> "itemLeave $c" if {[tk windowingsystem] eq "aqua" && ![package vsatisfies [package provide Tk] 8.7-]} { bind $c <Button-2> "itemMark $c %x %y" bind $c <B2-Motion> "itemStroke $c %x %y" bind $c <Button-3> "$c scan mark %x %y" bind $c <B3-Motion> "$c scan dragto %x %y" } else { bind $c <Button-2> "$c scan mark %x %y" bind $c <B2-Motion> "$c scan dragto %x %y" |
︙ | ︙ |
Changes to library/entry.tcl.
︙ | ︙ | |||
289 290 291 292 293 294 295 | } bind Entry <<TkAccentBackspace>> { tk::EntryBackspace %W } # A few additional bindings of my own. | < | | | | | | | < < < < < < < < < < < < | 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 | } bind Entry <<TkAccentBackspace>> { tk::EntryBackspace %W } # A few additional bindings of my own. bind Entry <Button-2> { if {!$tk_strictMotif} { ::tk::EntryScanMark %W %x } } bind Entry <B2-Motion> { if {!$tk_strictMotif} { ::tk::EntryScanDrag %W %x } } # ::tk::EntryClosestGap -- # Given x and y coordinates, this procedure finds the closest boundary # between characters to the given coordinates and returns the index # of the character just after the boundary. # |
︙ | ︙ |
Changes to library/iconlist.tcl.
︙ | ︙ | |||
442 443 444 445 446 447 448 | bind $canvas <ButtonRelease-1> [list tk::CancelRepeat] bind $canvas <Double-ButtonRelease-1> \ [namespace code {my Double1 %x %y}] bind $canvas <Control-B1-Motion> {;} bind $canvas <Shift-B1-Motion> [namespace code {my ShiftMotion1 %x %y}] | < | | < < | < < < < < < | 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 | bind $canvas <ButtonRelease-1> [list tk::CancelRepeat] bind $canvas <Double-ButtonRelease-1> \ [namespace code {my Double1 %x %y}] bind $canvas <Control-B1-Motion> {;} bind $canvas <Shift-B1-Motion> [namespace code {my ShiftMotion1 %x %y}] bind $canvas <Shift-MouseWheel> [namespace code {my MouseWheel %D}] bind $canvas <Option-Shift-MouseWheel> [namespace code {my MouseWheel %D -12}] bind $canvas <<PrevLine>> [namespace code {my UpDown -1}] bind $canvas <<NextLine>> [namespace code {my UpDown 1}] bind $canvas <<PrevChar>> [namespace code {my LeftRight -1}] bind $canvas <<NextChar>> [namespace code {my LeftRight 1}] bind $canvas <Return> [namespace code {my ReturnKey}] bind $canvas <Key> [namespace code {my KeyPress %A}] |
︙ | ︙ | |||
501 502 503 504 505 506 507 | my Motion1 $x $y set ::tk::Priv(afterId) [after 50 [namespace code {my AutoScan}]] } # ---------------------------------------------------------------------- # Event handlers | | < < < < < < < < < | < | 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 | my Motion1 $x $y set ::tk::Priv(afterId) [after 50 [namespace code {my AutoScan}]] } # ---------------------------------------------------------------------- # Event handlers method MouseWheel {amount {factor -120.0}} { if {$noScroll || $::tk_strictMotif} { return } $canvas xview scroll [expr {$amount/$factor}] units } method Btn1 {x y} { focus $canvas set i [$w index @$x,$y] if {$i eq ""} { return } |
︙ | ︙ |
Changes to library/listbox.tcl.
︙ | ︙ | |||
172 173 174 175 176 177 178 | bind Listbox <Button-2> { %W scan mark %x %y } bind Listbox <B2-Motion> { %W scan dragto %x %y } | < < < < < | | | | < < < < < < < < < < < < < < < | < < < < | < | < < < < < < < | < < < < < < < < | < | < | < < < < < < < < < < < < < < < < < < < < < < | 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 | bind Listbox <Button-2> { %W scan mark %x %y } bind Listbox <B2-Motion> { %W scan dragto %x %y } bind Listbox <MouseWheel> { tk::MouseWheel %W y %D -30.0 } bind Listbox <Option-MouseWheel> { tk::MouseWheel %W y %D -3.0 } bind Listbox <Shift-MouseWheel> { tk::MouseWheel %W x %D -30.0 } bind Listbox <Shift-Option-MouseWheel> { tk::MouseWheel %W x %D -3.0 } # ::tk::ListboxBeginSelect -- # # This procedure is typically invoked on button-1 presses. It begins # the process of making a selection in the listbox. Its exact behavior # depends on the selection mode currently in effect for the listbox; |
︙ | ︙ |
Changes to library/scale.tcl.
︙ | ︙ | |||
56 57 58 59 60 61 62 | bind Scale <B2-Leave> { } bind Scale <B2-Enter> { } bind Scale <ButtonRelease-2> { tk::CancelRepeat tk::ScaleEndDrag %W tk::ScaleActivate %W %x %y } | < < < < < < < < | 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | bind Scale <B2-Leave> { } bind Scale <B2-Enter> { } bind Scale <ButtonRelease-2> { tk::CancelRepeat tk::ScaleEndDrag %W tk::ScaleActivate %W %x %y } bind Scale <Control-Button-1> { tk::ScaleControlPress %W %x %y } bind Scale <<PrevLine>> { tk::ScaleIncrement %W up little noRepeat } bind Scale <<NextLine>> { |
︙ | ︙ |
Changes to library/scrlbar.tcl.
︙ | ︙ | |||
125 126 127 128 129 130 131 | tk::ScrollToPos %W 0 } bind Scrollbar <<LineEnd>> { tk::ScrollToPos %W 1 } } | < | | | | | < < < < < < < < < < < < < < < < < < < < < < | 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | tk::ScrollToPos %W 0 } bind Scrollbar <<LineEnd>> { tk::ScrollToPos %W 1 } } bind Scrollbar <MouseWheel> { tk::ScrollByUnits %W hv %D -30.0 } bind Scrollbar <Option-MouseWheel> { tk::ScrollByUnits %W hv %D -3.0 } # tk::ScrollButtonDown -- # This procedure is invoked when a button is pressed in a scrollbar. # It changes the way the scrollbar is displayed and takes actions # depending on where the mouse is. # |
︙ | ︙ | |||
325 326 327 328 329 330 331 | # # Arguments: # w - The scrollbar widget. # orient - Which kinds of scrollbars this applies to: "h" for # horizontal, "v" for vertical, "hv" for both. # amount - How many units to scroll: typically 1 or -1. | | | | | 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 | # # Arguments: # w - The scrollbar widget. # orient - Which kinds of scrollbars this applies to: "h" for # horizontal, "v" for vertical, "hv" for both. # amount - How many units to scroll: typically 1 or -1. proc ::tk::ScrollByUnits {w orient amount {factor 1.0}} { set cmd [$w cget -command] if {$cmd eq "" || ([string first \ [string index [$w cget -orient] 0] $orient] < 0)} { return } set info [$w get] if {[llength $info] == 2} { uplevel #0 $cmd scroll [expr {$amount/$factor}] units } else { uplevel #0 $cmd [expr {[lindex $info 2] + [expr {$amount/$factor}]}] } } # ::tk::ScrollByPages -- # This procedure tells the scrollbar's associated widget to scroll up # or down by a given number of screenfuls. It notifies the associated # widget in different ways for old and new command syntaxes. |
︙ | ︙ |
Changes to library/spinbox.tcl.
︙ | ︙ | |||
276 277 278 279 280 281 282 | if {!$tk_strictMotif} { %W delete [::tk::EntryPreviousWord %W insert] insert } } # A few additional bindings of my own. | < | | | | | | | | < < < < < < < < < < < < | 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 | if {!$tk_strictMotif} { %W delete [::tk::EntryPreviousWord %W insert] insert } } # A few additional bindings of my own. bind Spinbox <Button-2> { if {!$tk_strictMotif} { ::tk::EntryScanMark %W %x } } bind Spinbox <B2-Motion> { if {!$tk_strictMotif} { ::tk::EntryScanDrag %W %x } } # ::tk::spinbox::Invoke -- # Invoke an element of the spinbox # # Arguments: |
︙ | ︙ |
Changes to library/tclIndex.
︙ | ︙ | |||
195 196 197 198 199 200 201 202 203 204 205 206 207 208 | set auto_index(::tk::TextPrevPos) [list source [file join $dir text.tcl]] set auto_index(::tk::PlaceWindow) [list source [file join $dir tk.tcl]] set auto_index(::tk::SetFocusGrab) [list source [file join $dir tk.tcl]] set auto_index(::tk::RestoreFocusGrab) [list source [file join $dir tk.tcl]] set auto_index(::tk::ScreenChanged) [list source [file join $dir tk.tcl]] set auto_index(::tk::EventMotifBindings) [list source [file join $dir tk.tcl]] set auto_index(::tk::CancelRepeat) [list source [file join $dir tk.tcl]] set auto_index(::tk::TabToWindow) [list source [file join $dir tk.tcl]] set auto_index(::tk::dialog::file::) [list source [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::Config) [list source [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::Create) [list source [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::SetSelectMode) [list source [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::UpdateWhenIdle) [list source [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::Update) [list source [file join $dir tkfbox.tcl]] | > | 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 | set auto_index(::tk::TextPrevPos) [list source [file join $dir text.tcl]] set auto_index(::tk::PlaceWindow) [list source [file join $dir tk.tcl]] set auto_index(::tk::SetFocusGrab) [list source [file join $dir tk.tcl]] set auto_index(::tk::RestoreFocusGrab) [list source [file join $dir tk.tcl]] set auto_index(::tk::ScreenChanged) [list source [file join $dir tk.tcl]] set auto_index(::tk::EventMotifBindings) [list source [file join $dir tk.tcl]] set auto_index(::tk::CancelRepeat) [list source [file join $dir tk.tcl]] set auto_index(::tk::MouseWheel) [list source [file join $dir tk.tcl]] set auto_index(::tk::TabToWindow) [list source [file join $dir tk.tcl]] set auto_index(::tk::dialog::file::) [list source [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::Config) [list source [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::Create) [list source [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::SetSelectMode) [list source [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::UpdateWhenIdle) [list source [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::Update) [list source [file join $dir tkfbox.tcl]] |
︙ | ︙ |
Changes to library/text.tcl.
︙ | ︙ | |||
425 426 427 428 429 430 431 | bind Text <Control-h> { if {!$tk_strictMotif && [%W compare insert != 1.0]} { %W delete insert-1c %W see insert } } | < | | | | | | | | < < < < < < < < < < < < < < < < < < | | | | | | | | | | < < < < < < < < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 | bind Text <Control-h> { if {!$tk_strictMotif && [%W compare insert != 1.0]} { %W delete insert-1c %W see insert } } bind Text <Button-2> { if {!$tk_strictMotif} { tk::TextScanMark %W %x %y } } bind Text <B2-Motion> { if {!$tk_strictMotif} { tk::TextScanDrag %W %x %y } } set ::tk::Priv(prevPos) {} bind Text <MouseWheel> { tk::MouseWheel y %D -3.0 pixels } bind Text <Option-MouseWheel> { tk::MouseWheel y %D -0.3 pixels } bind Text <Shift-MouseWheel> { tk::MouseWheel x %D -3.0 pixels } bind Text <Shift-Option-MouseWheel> { tk::MouseWheel x %D -0.3 pixels } # ::tk::TextClosestGap -- # Given x and y coordinates, this procedure finds the closest boundary # between characters to the given coordinates and returns the index # of the character just after the boundary. # |
︙ | ︙ |
Changes to library/tk.tcl.
︙ | ︙ | |||
362 363 364 365 366 367 368 369 370 371 372 373 | } } #---------------------------------------------------------------------- # Define the set of common virtual events. #---------------------------------------------------------------------- switch -exact -- [tk windowingsystem] { "x11" { event add <<Cut>> <Control-x> <F20> <Control-Lock-X> event add <<Copy>> <Control-c> <F16> <Control-Lock-C> event add <<Paste>> <Control-v> <F18> <Control-Lock-V> | > > > < < | 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 | } } #---------------------------------------------------------------------- # Define the set of common virtual events. #---------------------------------------------------------------------- event add <<ContextMenu>> <Button-3> event add <<PasteSelection>> <ButtonRelease-2> switch -exact -- [tk windowingsystem] { "x11" { event add <<Cut>> <Control-x> <F20> <Control-Lock-X> event add <<Copy>> <Control-c> <F16> <Control-Lock-C> event add <<Paste>> <Control-v> <F18> <Control-Lock-V> event add <<Undo>> <Control-z> <Control-Lock-Z> event add <<Redo>> <Control-Z> <Control-Lock-z> # On Darwin/Aqua, buttons from left to right are 1,3,2. On Darwin/X11 with recent # XQuartz as the X server, they are 1,2,3; other X servers may differ. event add <<SelectAll>> <Control-slash> event add <<SelectNone>> <Control-backslash> event add <<NextChar>> <Right> event add <<SelectNextChar>> <Shift-Right> |
︙ | ︙ | |||
418 419 420 421 422 423 424 | # regardless of which window has focus set ::tk::AlwaysShowSelection 1 } "win32" { event add <<Cut>> <Control-x> <Shift-Delete> <Control-Lock-X> event add <<Copy>> <Control-c> <Control-Insert> <Control-Lock-C> event add <<Paste>> <Control-v> <Shift-Insert> <Control-Lock-V> | < < | 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 | # regardless of which window has focus set ::tk::AlwaysShowSelection 1 } "win32" { event add <<Cut>> <Control-x> <Shift-Delete> <Control-Lock-X> event add <<Copy>> <Control-c> <Control-Insert> <Control-Lock-C> event add <<Paste>> <Control-v> <Shift-Insert> <Control-Lock-V> event add <<Undo>> <Control-z> <Control-Lock-Z> event add <<Redo>> <Control-y> <Control-Lock-Y> event add <<SelectAll>> <Control-slash> <Control-a> <Control-Lock-A> event add <<SelectNone>> <Control-backslash> event add <<NextChar>> <Right> event add <<SelectNextChar>> <Shift-Right> event add <<PrevChar>> <Left> event add <<SelectPrevChar>> <Shift-Left> |
︙ | ︙ | |||
451 452 453 454 455 456 457 | event add <<SelectNextPara>> <Control-Shift-Down> event add <<ToggleSelection>> <Control-Button-1> } "aqua" { event add <<Cut>> <Command-x> <F2> <Command-Lock-X> event add <<Copy>> <Command-c> <F3> <Command-Lock-C> event add <<Paste>> <Command-v> <F4> <Command-Lock-V> | < < | 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 | event add <<SelectNextPara>> <Control-Shift-Down> event add <<ToggleSelection>> <Control-Button-1> } "aqua" { event add <<Cut>> <Command-x> <F2> <Command-Lock-X> event add <<Copy>> <Command-c> <F3> <Command-Lock-C> event add <<Paste>> <Command-v> <F4> <Command-Lock-V> event add <<Clear>> <Clear> # Official bindings # See http://support.apple.com/kb/HT1343 event add <<SelectAll>> <Command-a> event add <<Undo>> <Command-Key-z> <Command-Lock-Key-Z> event add <<Redo>> <Shift-Command-Key-z> <Shift-Command-Lock-Key-z> event add <<NextChar>> <Right> <Control-Key-f> <Control-Lock-Key-F> |
︙ | ︙ | |||
532 533 534 535 536 537 538 539 540 541 542 543 544 545 | proc ::tk::CancelRepeat {} { variable ::tk::Priv after cancel $Priv(afterId) set Priv(afterId) {} } # ::tk::TabToWindow -- # This procedure moves the focus to the given widget. # It sends a <<TraverseOut>> virtual event to the previous focus window, # if any, before changing the focus, and a <<TraverseIn>> event # to the new focus window afterwards. # # Arguments: | > > > > > > > | 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 | proc ::tk::CancelRepeat {} { variable ::tk::Priv after cancel $Priv(afterId) set Priv(afterId) {} } ## ::tk::MouseWheel $w $dir $amount $factor $units proc ::tk::MouseWheel {w dir amount {factor -120.0} {units units}} { $w ${dir}view scroll [expr {$amount/$factor}] $units } # ::tk::TabToWindow -- # This procedure moves the focus to the given widget. # It sends a <<TraverseOut>> virtual event to the previous focus window, # if any, before changing the focus, and a <<TraverseIn>> event # to the new focus window afterwards. # # Arguments: |
︙ | ︙ |
Changes to library/ttk/combobox.tcl.
︙ | ︙ | |||
178 179 180 181 182 183 184 | $cb selection range 0 end $cb icursor end event generate $cb <<ComboboxSelected>> -when mark } ## Scroll -- Mousewheel binding # | | > > > > | | 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 | $cb selection range 0 end $cb icursor end event generate $cb <<ComboboxSelected>> -when mark } ## Scroll -- Mousewheel binding # proc ttk::combobox::Scroll {cb dir {factor 1.0}} { $cb instate disabled { return } set max [llength [$cb cget -values]] set current [$cb current] set d [expr {round($dir/factor)}] if {$d == 0 && $dir != 0} { if {$dir > 0} {set d 1} else {set d -1} } incr current $d if {$max != 0 && $current == $current % $max} { SelectEntry $cb $current } } ## LBSelected $lb -- Activation binding for listbox # Set the combobox value to the currently-selected listbox value |
︙ | ︙ |
Changes to library/ttk/entry.tcl.
︙ | ︙ | |||
78 79 80 81 82 83 84 | bind TEntry <B1-Enter> { ttk::entry::DragIn %W } bind TEntry <ButtonRelease-1> { ttk::entry::Release %W } bind TEntry <<ToggleSelection>> { %W instate {!readonly !disabled} { %W icursor @%x ; focus %W } } | | | < | | | < < < < < | 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | bind TEntry <B1-Enter> { ttk::entry::DragIn %W } bind TEntry <ButtonRelease-1> { ttk::entry::Release %W } bind TEntry <<ToggleSelection>> { %W instate {!readonly !disabled} { %W icursor @%x ; focus %W } } ## Button2 bindings: # Used for scanning and primary transfer. # Note: ButtonRelease-2 # is mapped to <<PasteSelection>> in tk.tcl. # bind TEntry <Button-2> { ttk::entry::ScanMark %W %x } bind TEntry <B2-Motion> { ttk::entry::ScanDrag %W %x } bind TEntry <ButtonRelease-2> { ttk::entry::ScanRelease %W %x } bind TEntry <<PasteSelection>> { ttk::entry::ScanRelease %W %x } ## Keyboard navigation bindings: # bind TEntry <<PrevChar>> { ttk::entry::Move %W prevchar } bind TEntry <<NextChar>> { ttk::entry::Move %W nextchar } bind TEntry <<PrevWord>> { ttk::entry::Move %W prevword } |
︙ | ︙ |
Changes to library/ttk/scrollbar.tcl.
︙ | ︙ | |||
15 16 17 18 19 20 21 | bind TScrollbar <Button-2> { ttk::scrollbar::Jump %W %x %y } bind TScrollbar <B2-Motion> { ttk::scrollbar::Drag %W %x %y } bind TScrollbar <ButtonRelease-2> { ttk::scrollbar::Release %W %x %y } # Redirect scrollwheel bindings to the scrollbar widget # | < < | < < | < < < < < < < < < | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | bind TScrollbar <Button-2> { ttk::scrollbar::Jump %W %x %y } bind TScrollbar <B2-Motion> { ttk::scrollbar::Drag %W %x %y } bind TScrollbar <ButtonRelease-2> { ttk::scrollbar::Release %W %x %y } # Redirect scrollwheel bindings to the scrollbar widget # bind TScrollbar <MouseWheel> [bind Scrollbar <MouseWheel>] bind TScrollbar <Option-MouseWheel> [bind Scrollbar <Option-MouseWheel>] proc ttk::scrollbar::Scroll {w n units} { set cmd [$w cget -command] if {$cmd ne ""} { uplevel #0 $cmd scroll $n $units } } |
︙ | ︙ |
Changes to library/ttk/spinbox.tcl.
︙ | ︙ | |||
78 79 80 81 82 83 84 | ttk::CancelRepeat } ## MouseWheel -- # Mousewheel callback. Turn these into <<Increment>> (-1, up) # or <<Decrement> (+1, down) events. # | | | | | 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | ttk::CancelRepeat } ## MouseWheel -- # Mousewheel callback. Turn these into <<Increment>> (-1, up) # or <<Decrement> (+1, down) events. # proc ttk::spinbox::MouseWheel {w dir {factor 1}} { if {[$w instate disabled]} { return } if {($dir < 0) ^ ($factor < 0)} { event generate $w <<Increment>> } elseif {$dir > 0} { event generate $w <<Decrement>> } } ## SelectAll -- # Select widget contents. # |
︙ | ︙ |
Changes to library/ttk/utils.tcl.
︙ | ︙ | |||
269 270 271 272 273 274 275 | } } ### Mousewheel bindings. # # Platform inconsistencies: # | < < < < < < < < < < < < < < < < < | | < < < < < < < < < < < < < < < < < < | < < | < < | | < | < < < < < < < < < | < < < < < < | | < < < < < < | 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 | } } ### Mousewheel bindings. # # Platform inconsistencies: # # MouseWheel scrolling is accelerated on X11, which is conventional # for Tk and appears to be conventional for other toolkits (although # Gtk+ and Qt do not appear to use as large a factor). # ## ttk::bindMouseWheel $bindtag $command... # Adds basic mousewheel support to $bindtag. # $command will be passed one additional argument # specifying the mousewheel direction (-1: up, +1: down). # proc ttk::bindMouseWheel {bindtag callback} { bind $bindtag <MouseWheel> [append callback { %D -120.0}] bind $bindtag <Option-MouseWheel> [append callback { %D -12.0}] } ## Mousewheel bindings for standard scrollable widgets. # # Usage: [ttk::copyBindings TtkScrollable $bindtag] # # $bindtag should be for a widget that supports the # standard scrollbar protocol. # bind TtkScrollable <MouseWheel> \ { tk::MouseWheel %W y %D } bind TtkScrollable <Option-MouseWheel> \ { tk::MouseWheel %W y %D -12.0 } bind TtkScrollable <Shift-MouseWheel> \ { tk::MouseWheel %W x %D } bind TtkScrollable <Shift-Option-MouseWheel> \ { tk::MouseWheel %W x %D -12.0 } #*EOF* |
Changes to macosx/tkMacOSXMouseEvent.c.
︙ | ︙ | |||
85 86 87 88 89 90 91 92 93 94 95 96 97 98 | */ if (eventWindow) { inTitleBar = viewFrame.size.height < location.y; } button = [theEvent buttonNumber] + Button1; switch (eventType) { case NSRightMouseUp: case NSOtherMouseUp: buttonState &= ~Tk_GetButtonMask(button); break; case NSLeftMouseDragged: case NSRightMouseDragged: | > > > | 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | */ if (eventWindow) { inTitleBar = viewFrame.size.height < location.y; } button = [theEvent buttonNumber] + Button1; if ((button & -2) == Button2) { button ^= 1; /* Swap buttons 2/3 */ } switch (eventType) { case NSRightMouseUp: case NSOtherMouseUp: buttonState &= ~Tk_GetButtonMask(button); break; case NSLeftMouseDragged: case NSRightMouseDragged: |
︙ | ︙ | |||
301 302 303 304 305 306 307 | TKLog(@"UpdatePointer %p x %.1f y %.1f %d", target, global.x, global.y, state); #endif Tk_UpdatePointer(target, global.x, global.y, state); } else { CGFloat delta; | < | < < | | < < | | 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 | TKLog(@"UpdatePointer %p x %.1f y %.1f %d", target, global.x, global.y, state); #endif Tk_UpdatePointer(target, global.x, global.y, state); } else { CGFloat delta; XEvent xEvent; /* * For scroll wheel events we need to send the XEvent here. */ xEvent.type = MouseWheelEvent; xEvent.xbutton.x = win_x; xEvent.xbutton.y = win_y; xEvent.xbutton.x_root = global.x; xEvent.xbutton.y_root = global.y; xEvent.xany.send_event = false; xEvent.xany.display = Tk_Display(target); xEvent.xany.window = Tk_WindowId(target); delta = [theEvent deltaY] * 120; if (delta != 0.0) { xEvent.xbutton.state = state; xEvent.xkey.keycode = (delta > 0) ? ceil(delta) : floor(delta); xEvent.xany.serial = LastKnownRequestProcessed(Tk_Display(tkwin)); Tk_QueueWindowEvent(&xEvent, TCL_QUEUE_TAIL); } delta = [theEvent deltaX] * 120; if (delta != 0.0) { xEvent.xbutton.state = state | ShiftMask; xEvent.xkey.keycode = (delta > 0) ? ceil(delta) : floor(delta); xEvent.xany.serial = LastKnownRequestProcessed(Tk_Display(tkwin)); Tk_QueueWindowEvent(&xEvent, TCL_QUEUE_TAIL); } } return theEvent; } @end |
︙ | ︙ | |||
401 402 403 404 405 406 407 | { unsigned int state; /* * Tk on OSX supports at most 9 buttons. */ | | > > > > > > > | | 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 | { unsigned int state; /* * Tk on OSX supports at most 9 buttons. */ state = (buttonState & 0x079) * Button1Mask; /* Handle swapped buttons 2/3 */ if (buttonState & 0x02) { state |= Button3Mask; } if (buttonState & 0x04) { state |= Button2Mask; } /* Handle buttons 8/9 */ state |= (buttonState & 0x180) * (Button8Mask >> 7); if (keyModifiers & alphaLock) { state |= LockMask; } if (keyModifiers & shiftKey) { state |= ShiftMask; |
︙ | ︙ |
Changes to tests/entry.test.
︙ | ︙ | |||
1446 1447 1448 1449 1450 1451 1452 | } -body { .e insert end "This is quite a long text string, so long that it " .e insert end "runs off the end of the window quite a bit." update .e xview scroll gorp units } -cleanup { destroy .e | | | 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 | } -body { .e insert end "This is quite a long text string, so long that it " .e insert end "runs off the end of the window quite a bit." update .e xview scroll gorp units } -cleanup { destroy .e } -returnCodes error -result {expected floating-point number but got "gorp"} test entry-3.73 {EntryWidgetCmd procedure, "xview" widget command} -setup { entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 pack .e } -body { .e insert end "This is quite a long text string, so long that it " .e insert end "runs off the end of the window quite a bit." update |
︙ | ︙ |
Changes to tests/imgPhoto.test.
︙ | ︙ | |||
1334 1335 1336 1337 1338 1339 1340 | image create photo photo1 -data {{red#a green} {blue#c white#d}} } -body { photo1 data -format {default -colorformat list} } -result {{{255 0 0 170} {0 128 0 255}} {{0 0 255 204} {255 255 255 221}}} # This testcase fails with Tcl < 8.6.7, due to [25842c] test imgPhoto-4.118 {ImgPhotoCmd data: using data for new image results in same image as orignial } -constraints { | | | 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 | image create photo photo1 -data {{red#a green} {blue#c white#d}} } -body { photo1 data -format {default -colorformat list} } -result {{{255 0 0 170} {0 128 0 255}} {{0 0 255 204} {255 255 255 221}}} # This testcase fails with Tcl < 8.6.7, due to [25842c] test imgPhoto-4.118 {ImgPhotoCmd data: using data for new image results in same image as orignial } -constraints { hasTeapotPhoto hasTranspTeapotPhoto needsTcl867 } -setup { image create photo teapot -file $teapotPhotoFile teapot copy teapot -from 50 60 70 80 -shrink image create photo teapotTransp -file $transpTeapotPhotoFile teapotTransp copy teapotTransp -from 100 110 120 130 -shrink image create photo photo1 } -body { |
︙ | ︙ |
Changes to tests/scrollbar.test.
︙ | ︙ | |||
684 685 686 687 688 689 690 | catch {destroy .s} scrollbar .s interp hide {} .s destroy .s list [winfo children .] [interp hidden] } [list {} $l] | | < < < < < < < < < < < < < < | < < < < < < < < < < < < < < | < < < < < < < < < < < < < < | 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 | catch {destroy .s} scrollbar .s interp hide {} .s destroy .s list [winfo children .] [interp hidden] } [list {} $l] test scrollbar-10.1 {<MouseWheel> event on scrollbar} -setup { destroy .t .s } -body { pack [text .t -yscrollcommand {.s set}] -side left for {set i 1} {$i < 100} {incr i} {.t insert end "Line $i\n"} pack [scrollbar .s -command {.t yview}] -fill y -expand 1 -side left update focus -force .s event generate .s <MouseWheel> -delta -120 after 200 {set eventprocessed 1} ; vwait eventprocessed .t index @0,0 } -cleanup { destroy .t .s } -result {5.0} test scrollbar-10.2 {<MouseWheel> event on scrollbar} -setup { destroy .t .s } -body { pack [text .t -xscrollcommand {.s set} -wrap none] -side top for {set i 1} {$i < 100} {incr i} {.t insert end "Char $i "} pack [scrollbar .s -command {.t xview} -orient horizontal] -fill x -expand 1 -side top update focus -force .s event generate .s <Shift-MouseWheel> -delta -120 after 200 {set eventprocessed 1} ; vwait eventprocessed .t index @0,0 } -cleanup { destroy .t .s } -result {1.4} test scrollbar-10.2.3 {<MouseWheel> event on horizontal scrollbar} -setup { destroy .t .s } -body { pack [text .t -xscrollcommand {.s set} -wrap none] -side top for {set i 1} {$i < 100} {incr i} {.t insert end "Char $i "} pack [scrollbar .s -command {.t xview} -orient horizontal] -fill x -expand 1 -side top update focus -force .s event generate .s <MouseWheel> -delta -120 after 200 {set eventprocessed 1} ; vwait eventprocessed .t index @0,0 } -cleanup { destroy .t .s } -result {1.4} test scrollbar-11.1 {bug fix: [011706ec42] Scrollbar unsafe wrt widget destruction} -body { |
︙ | ︙ |
Changes to tests/spinbox.test.
︙ | ︙ | |||
1784 1785 1786 1787 1788 1789 1790 | } -body { .e insert end "This is quite a long text string, so long that it " .e insert end "runs off the end of the window quite a bit." update .e xview scroll gorp units } -cleanup { destroy .e | | | 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 | } -body { .e insert end "This is quite a long text string, so long that it " .e insert end "runs off the end of the window quite a bit." update .e xview scroll gorp units } -cleanup { destroy .e } -returnCodes error -result {expected floating-point number but got "gorp"} test spinbox-3.73 {SpinboxWidgetCmd procedure, "xview" widget command} -setup { spinbox .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 pack .e } -body { .e insert end "This is quite a long text string, so long that it " .e insert end "runs off the end of the window quite a bit." update |
︙ | ︙ |
Changes to tests/textDisp.test.
︙ | ︙ | |||
1898 1899 1900 1901 1902 1903 1904 | list [catch {.t xview scroll a} msg] $msg } {1 {wrong # args: should be ".t xview scroll number pages|pixels|units"}} test textDisp-14.11 {TkTextXviewCmd procedure} { list [catch {.t xview scroll a b c} msg] $msg } {1 {wrong # args: should be ".t xview scroll number pages|pixels|units"}} test textDisp-14.12 {TkTextXviewCmd procedure} { list [catch {.t xview scroll gorp units} msg] $msg | | | 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 | list [catch {.t xview scroll a} msg] $msg } {1 {wrong # args: should be ".t xview scroll number pages|pixels|units"}} test textDisp-14.11 {TkTextXviewCmd procedure} { list [catch {.t xview scroll a b c} msg] $msg } {1 {wrong # args: should be ".t xview scroll number pages|pixels|units"}} test textDisp-14.12 {TkTextXviewCmd procedure} { list [catch {.t xview scroll gorp units} msg] $msg } {1 {expected floating-point number but got "gorp"}} test textDisp-14.13 {TkTextXviewCmd procedure} { .t delete 1.0 end .t insert end xxxxxxxxx\n .t insert end "a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 c0 c1 c2 c3 c4 c5 c6 c7 c8 c9 c0 c1 c2 c3 c4 c5 c6 c7 c8 c9\n" .t insert end "xxxx xxxxxxxxx xxxxxxxxxxxxx" .t xview moveto 0 .t xview scroll 2 pa |
︙ | ︙ | |||
2117 2118 2119 2120 2121 2122 2123 | test textDisp-16.19 {TkTextYviewCmd procedure, "scroll" option} { list [catch {.t yview scroll a} msg] $msg } {1 {wrong # args: should be ".t yview scroll number pages|pixels|units"}} test textDisp-16.20 {TkTextYviewCmd procedure, "scroll" option} { list [catch {.t yview scroll a b c} msg] $msg } {1 {wrong # args: should be ".t yview scroll number pages|pixels|units"}} test textDisp-16.21 {TkTextYviewCmd procedure, "scroll" option} { | | | | | 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 | test textDisp-16.19 {TkTextYviewCmd procedure, "scroll" option} { list [catch {.t yview scroll a} msg] $msg } {1 {wrong # args: should be ".t yview scroll number pages|pixels|units"}} test textDisp-16.20 {TkTextYviewCmd procedure, "scroll" option} { list [catch {.t yview scroll a b c} msg] $msg } {1 {wrong # args: should be ".t yview scroll number pages|pixels|units"}} test textDisp-16.21 {TkTextYviewCmd procedure, "scroll" option} { list [catch {.t yview scroll bogus bogus} msg] $msg } {1 {bad argument "bogus": must be pages, pixels, or units}} test textDisp-16.21.2 {TkTextYviewCmd procedure, "scroll" option} { list [catch {.t yview scroll bogus units} msg] $msg } {1 {expected floating-point number but got "bogus"}} test textDisp-16.22 {TkTextYviewCmd procedure, "scroll" option, back pages} { .t yview 50.0 updateText .t yview scroll -1 pages .t index @0,0 } {42.0} test textDisp-16.22.1 {TkTextYviewCmd procedure, "scroll" option, back pages} { |
︙ | ︙ |
Changes to tests/ttk/scrollbar.test.
︙ | ︙ | |||
67 68 69 70 71 72 73 | pack .tsb -side bottom -anchor s -expand 1 -fill x wm geometry . 200x200 update set w [winfo width .tsb] ; set h [winfo height .tsb] expr {$h < $w} } -result 1 | | < < < < < < < < < < < < < < | < < < < < < < < < < < < < < | < < < < < < < < < < < < < < | 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | pack .tsb -side bottom -anchor s -expand 1 -fill x wm geometry . 200x200 update set w [winfo width .tsb] ; set h [winfo height .tsb] expr {$h < $w} } -result 1 test scrollbar-10.1.1 {<MouseWheel> event on scrollbar} -setup { destroy .t .s } -body { pack [text .t -yscrollcommand {.s set}] -side left for {set i 1} {$i < 100} {incr i} {.t insert end "Line $i\n"} pack [ttk::scrollbar .s -command {.t yview}] -fill y -expand 1 -side left update focus -force .s event generate .s <MouseWheel> -delta -120 after 200 {set eventprocessed 1} ; vwait eventprocessed .t index @0,0 } -cleanup { destroy .t .s } -result {5.0} test scrollbar-10.2.1 {<Shift-MouseWheel> event on horizontal scrollbar} -setup { destroy .t .s } -body { pack [text .t -xscrollcommand {.s set} -wrap none] -side top for {set i 1} {$i < 100} {incr i} {.t insert end "Char $i "} pack [ttk::scrollbar .s -command {.t xview} -orient horizontal] -fill x -expand 1 -side top update focus -force .s event generate .s <Shift-MouseWheel> -delta -120 after 200 {set eventprocessed 1} ; vwait eventprocessed .t index @0,0 } -cleanup { destroy .t .s } -result {1.4} test scrollbar-10.2.2 {<MouseWheel> event on horizontal scrollbar} -setup { destroy .t .s } -body { pack [text .t -xscrollcommand {.s set} -wrap none] -side top for {set i 1} {$i < 100} {incr i} {.t insert end "Char $i "} pack [ttk::scrollbar .s -command {.t xview} -orient horizontal] -fill x -expand 1 -side top update focus -force .s event generate .s <MouseWheel> -delta -120 after 200 {set eventprocessed 1} ; vwait eventprocessed .t index @0,0 } -cleanup { destroy .t .s } -result {1.4} # |
︙ | ︙ |
Changes to tests/util.test.
︙ | ︙ | |||
30 31 32 33 34 35 36 | .l yview scroll a } -returnCodes error -result {wrong # args: should be ".l yview scroll number pages|units"} test util-1.5 {Tk_GetScrollInfo procedure} -body { .l yview scroll a b c } -returnCodes error -result {wrong # args: should be ".l yview scroll number pages|units"} test util-1.6 {Tk_GetScrollInfo procedure} -body { .l yview scroll xyz units | | | 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | .l yview scroll a } -returnCodes error -result {wrong # args: should be ".l yview scroll number pages|units"} test util-1.5 {Tk_GetScrollInfo procedure} -body { .l yview scroll a b c } -returnCodes error -result {wrong # args: should be ".l yview scroll number pages|units"} test util-1.6 {Tk_GetScrollInfo procedure} -body { .l yview scroll xyz units } -returnCodes error -result {expected floating-point number but got "xyz"} test util-1.7 {Tk_GetScrollInfo procedure} -body { .l yview 0 .l yview scroll 2 pages .l nearest 0 } -result 6 test util-1.8 {Tk_GetScrollInfo procedure} -body { .l yview 15 |
︙ | ︙ |
Changes to win/tkWinX.c.
︙ | ︙ | |||
1742 1743 1744 1745 1746 1747 1748 | msg = WM_MBUTTONDOWN; wparam = MK_MBUTTON; break; case Button3: msg = WM_RBUTTONDOWN; wparam = MK_RBUTTON; break; | | | | 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 | msg = WM_MBUTTONDOWN; wparam = MK_MBUTTON; break; case Button3: msg = WM_RBUTTONDOWN; wparam = MK_RBUTTON; break; case Button8: msg = WM_XBUTTONDOWN; wparam = MAKEWPARAM(MK_XBUTTON1, XBUTTON1); break; case Button9: msg = WM_XBUTTONDOWN; wparam = MAKEWPARAM(MK_XBUTTON2, XBUTTON2); break; default: return 0; } |
︙ | ︙ |