summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-08-13 09:37:44 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-08-13 09:37:44 (GMT)
commitd106de20251ecb16639362c8baade84faaa7c2c6 (patch)
tree73b262dd9fbe4420ffcd7396fd1f0b5f92032dc2
parentaf4685dea35f639d3f27732345f50c4a0aa67186 (diff)
parent2dc42aa8807ae45d9d238ace0f30c753aa0d016b (diff)
downloadtk-d106de20251ecb16639362c8baade84faaa7c2c6.zip
tk-d106de20251ecb16639362c8baade84faaa7c2c6.tar.gz
tk-d106de20251ecb16639362c8baade84faaa7c2c6.tar.bz2
Merge 8.7
-rw-r--r--generic/tkCanvas.c6
-rw-r--r--generic/tkEntry.c24
-rw-r--r--generic/tkEvent.c7
-rw-r--r--generic/tkInt.h5
-rw-r--r--generic/tkTextTag.c4
-rw-r--r--generic/ttk/ttkTreeview.c2
-rw-r--r--macosx/tkMacOSXEntry.c23
-rw-r--r--win/tkWinFont.c2
8 files changed, 36 insertions, 37 deletions
diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c
index 1c70055..1c18d34 100644
--- a/generic/tkCanvas.c
+++ b/generic/tkCanvas.c
@@ -1036,7 +1036,7 @@ CanvasWidgetCmd(
result = TCL_ERROR;
goto done;
}
- if (mask & (unsigned) ~(ButtonMotionMask|Button1MotionMask
+ if (mask & ~(unsigned long)(ButtonMotionMask|Button1MotionMask
|Button2MotionMask|Button3MotionMask|Button4MotionMask
|Button5MotionMask|ButtonPressMask|ButtonReleaseMask
|EnterWindowMask|LeaveWindowMask|KeyPressMask
@@ -5079,7 +5079,7 @@ CanvasBindProc(
XEvent *eventPtr) /* Pointer to X event that just happened. */
{
TkCanvas *canvasPtr = clientData;
- unsigned int mask;
+ unsigned long mask;
Tcl_Preserve(canvasPtr);
@@ -5175,7 +5175,7 @@ PickCurrentItem(
* ButtonRelease, or MotionNotify. */
{
double coords[2];
- unsigned int buttonDown;
+ unsigned long buttonDown;
Tk_Item *prevItemPtr;
SearchUids *searchUids = GetStaticUids();
diff --git a/generic/tkEntry.c b/generic/tkEntry.c
index 40409e2..133761e 100644
--- a/generic/tkEntry.c
+++ b/generic/tkEntry.c
@@ -1541,17 +1541,15 @@ EntryWorldChanged(
*
* TkpDrawEntryBorderAndFocus --
*
- * This function redraws the border of an entry widget. It overrides the
- * generic border drawing code if the entry widget parameters are such
- * that the native widget drawing is a good fit. This version just
- * returns 0, so platforms that don't do special native drawing don't
- * have to implement it.
+ * Stub function for Tk on platforms other than Aqua
+ * (Windows and X11), which do not draw native entry borders.
+ * See macosx/tkMacOSXEntry.c for function definition in Tk Aqua.
*
* Results:
- * 1 if it has drawn the border, 0 if not.
+ * Returns 0.
*
* Side effects:
- * May draw the entry border into pixmap.
+ * None.
*
*--------------------------------------------------------------
*/
@@ -1570,17 +1568,15 @@ TkpDrawEntryBorderAndFocus(
*
* TkpDrawSpinboxButtons --
*
- * This function redraws the buttons of an spinbox widget. It overrides
- * the generic button drawing code if the spinbox widget parameters are
- * such that the native widget drawing is a good fit. This version just
- * returns 0, so platforms that don't do special native drawing don't
- * have to implement it.
+ * Stub function for Tk on platforms other than Aqua
+ * (Windows and X11), which do not draw native spinbox buttons.
+ * See macosx/tkMacOSXEntry.c for function definition in Tk Aqua.
*
* Results:
- * 1 if it has drawn the border, 0 if not.
+ * Returns 0.
*
* Side effects:
- * May draw the entry border into pixmap.
+ * None.
*
*--------------------------------------------------------------
*/
diff --git a/generic/tkEvent.c b/generic/tkEvent.c
index 98b5f74..19d01b6 100644
--- a/generic/tkEvent.c
+++ b/generic/tkEvent.c
@@ -535,11 +535,12 @@ RefreshKeyboardMappingIfNeeded(
*----------------------------------------------------------------------
*/
-static const unsigned int buttonMasks[] = {
- 0, Button1Mask, Button2Mask, Button3Mask, Button4Mask, Button5Mask, Button6Mask, Button7Mask, Button8Mask, Button9Mask
+static const unsigned long buttonMasks[] = {
+ 0, Button1Mask, Button2Mask, Button3Mask, Button4Mask, Button5Mask,
+ Button6Mask, Button7Mask, Button8Mask, Button9Mask
};
-unsigned int
+unsigned long
TkGetButtonMask(
unsigned int button)
{
diff --git a/generic/tkInt.h b/generic/tkInt.h
index 334464b..438a944 100644
--- a/generic/tkInt.h
+++ b/generic/tkInt.h
@@ -998,10 +998,11 @@ typedef struct TkpClipMask {
*/
#define ALL_BUTTONS \
- (Button1Mask|Button2Mask|Button3Mask|Button4Mask|Button5Mask|Button6Mask|Button7Mask|Button8Mask|Button9Mask)
+ (Button1Mask|Button2Mask|Button3Mask|Button4Mask|Button5Mask \
+ |Button6Mask|Button7Mask|Button8Mask|Button9Mask)
-MODULE_SCOPE unsigned int TkGetButtonMask(unsigned int);
+MODULE_SCOPE unsigned long TkGetButtonMask(unsigned int);
/*
* Object types not declared in tkObj.c need to be mentioned here so they can
diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c
index 4720489..7b89fd9 100644
--- a/generic/tkTextTag.c
+++ b/generic/tkTextTag.c
@@ -292,7 +292,7 @@ TkTextTagCmd(
if (mask == 0) {
return TCL_ERROR;
}
- if (mask & (unsigned long) ~(ButtonMotionMask|Button1MotionMask
+ if (mask & ~(unsigned long)(ButtonMotionMask|Button1MotionMask
|Button2MotionMask|Button3MotionMask|Button4MotionMask
|Button5MotionMask|ButtonPressMask|ButtonReleaseMask
|EnterWindowMask|LeaveWindowMask|KeyPressMask
@@ -1491,7 +1491,7 @@ TkTextBindProc(
unsigned int oldState;
oldState = eventPtr->xbutton.state;
- eventPtr->xbutton.state &= ~ALL_BUTTONS;
+ eventPtr->xbutton.state &= ~(unsigned long)ALL_BUTTONS;
if (!(textPtr->flags & DESTROYED)) {
TkTextPickCurrent(textPtr, eventPtr);
}
diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c
index 5b5375c..822a4a6 100644
--- a/generic/ttk/ttkTreeview.c
+++ b/generic/ttk/ttkTreeview.c
@@ -921,7 +921,7 @@ static void DragColumn(Treeview *tv, int i, int delta)
static TreeItem *IdentifyItem(Treeview *tv, int y); /*forward*/
-static const unsigned int TreeviewBindEventMask =
+static const unsigned long TreeviewBindEventMask =
KeyPressMask|KeyReleaseMask
| ButtonPressMask|ButtonReleaseMask
| PointerMotionMask|ButtonMotionMask
diff --git a/macosx/tkMacOSXEntry.c b/macosx/tkMacOSXEntry.c
index a1c5d60..7915f6f 100644
--- a/macosx/tkMacOSXEntry.c
+++ b/macosx/tkMacOSXEntry.c
@@ -124,16 +124,17 @@ TkpDrawEntryBorderAndFocus(
int incDecWidth;
/*
- * Temporarily change the width of the widget so that the same code can
- * be used for drawing the Entry portion of the Spinbox as is used to
- * draw an ordinary Entry. The width must be restored before
- * returning.
+ * If native spinbox buttons are going to be drawn, then temporarily
+ * change the width of the widget so that the same code can be used
+ * for drawing the Entry portion of the Spinbox as is used to draw
+ * an ordinary Entry. The width must be restored before returning.
*/
oldWidth = Tk_Width(tkwin);
- ComputeIncDecParameters(Tk_Height(tkwin) - 2 * MAC_OSX_FOCUS_WIDTH,
- &incDecWidth);
- Tk_Width(tkwin) -= incDecWidth + 1;
+ if (ComputeIncDecParameters(Tk_Height(tkwin) - 2 * MAC_OSX_FOCUS_WIDTH,
+ &incDecWidth) != 0) {
+ Tk_Width(tkwin) -= incDecWidth + 1;
+ }
}
/*
@@ -186,10 +187,10 @@ TkpDrawEntryBorderAndFocus(
* have to implement it.
*
* Results:
- * 1 if it has drawn the border, 0 if not.
+ * 1 if it has drawn the buttons, 0 if not.
*
* Side effects:
- * May draw the entry border into pixmap.
+ * May draw the buttons into pixmap.
*
*--------------------------------------------------------------
*/
@@ -258,9 +259,9 @@ TkpDrawSpinboxButtons(
*/
bgGC = Tk_GCForColor(sbPtr->entry.highlightBgColorPtr, d);
- rects[0].x = bounds.origin.x;
+ rects[0].x = Tk_Width(tkwin) - incDecWidth - 1;
rects[0].y = 0;
- rects[0].width = Tk_Width(tkwin);
+ rects[0].width = incDecWidth + 1;
rects[0].height = Tk_Height(tkwin);
XFillRectangles(Tk_Display(tkwin), d, bgGC, rects, 1);
diff --git a/win/tkWinFont.c b/win/tkWinFont.c
index 62c33ce..948ca10 100644
--- a/win/tkWinFont.c
+++ b/win/tkWinFont.c
@@ -2177,7 +2177,7 @@ FontMapInsert(
* None.
*
* Side effects:
- * Mempry allocated.
+ * Memory allocated.
*
*-------------------------------------------------------------------------
*/