diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-07-23 21:17:39 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-07-23 21:17:39 (GMT) |
commit | 64efa1daf6914fde585eed65c2ec0f5bf45f097b (patch) | |
tree | 6b9caa655e4a036fc7ff8b328ffcefe7f6b8c33d /generic/tkCanvas.c | |
parent | 41bb9d8273752f7b46aa4658ff4efeb7cc27f2b6 (diff) | |
download | tk-64efa1daf6914fde585eed65c2ec0f5bf45f097b.zip tk-64efa1daf6914fde585eed65c2ec0f5bf45f097b.tar.gz tk-64efa1daf6914fde585eed65c2ec0f5bf45f097b.tar.bz2 |
New intermal macro ALL_BUTTONS and function TkGetButtonMask(), which can be re-used in various places in stead of separate functions.
Diffstat (limited to 'generic/tkCanvas.c')
-rw-r--r-- | generic/tkCanvas.c | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c index 4d260dc..ab648a1 100644 --- a/generic/tkCanvas.c +++ b/generic/tkCanvas.c @@ -4760,26 +4760,7 @@ CanvasBindProc( switch (eventPtr->type) { case ButtonPress: case ButtonRelease: - switch (eventPtr->xbutton.button) { - case Button1: - mask = Button1Mask; - break; - case Button2: - mask = Button2Mask; - break; - case Button3: - mask = Button3Mask; - break; - case Button4: - mask = Button4Mask; - break; - case Button5: - mask = Button5Mask; - break; - default: - mask = 0; - break; - } + mask = TkGetButtonMask(eventPtr->xbutton.button); /* * For button press events, repick the current item using the button @@ -4862,7 +4843,7 @@ PickCurrentItem( * ButtonRelease, or MotionNotify. */ { double coords[2]; - int buttonDown; + unsigned int buttonDown; Tk_Item *prevItemPtr; #ifndef USE_OLD_TAG_SEARCH SearchUids *searchUids = GetStaticUids(); @@ -4875,8 +4856,7 @@ PickCurrentItem( * for windows. */ - buttonDown = canvasPtr->state - & (Button1Mask|Button2Mask|Button3Mask|Button4Mask|Button5Mask); + buttonDown = canvasPtr->state & ALL_BUTTONS; /* * Save information about this event in the canvas. The event in the |