summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-06-02 21:53:36 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-06-02 21:53:36 (GMT)
commitaece2cd3b73de00ea4f32057a9988d12714627a5 (patch)
tree127db38dc7335df2dbff7366b918085d741e8fe7 /win
parentfc690ad0b1edaef87a428dabe07e27f15bd2473d (diff)
parentc0f2471d203026409e33969ccdb40cf06ff0f99c (diff)
downloadtk-aece2cd3b73de00ea4f32057a9988d12714627a5.zip
tk-aece2cd3b73de00ea4f32057a9988d12714627a5.tar.gz
tk-aece2cd3b73de00ea4f32057a9988d12714627a5.tar.bz2
Merge 8.7
Diffstat (limited to 'win')
-rw-r--r--win/rules.vc23
-rw-r--r--win/tkWinFont.c16
-rw-r--r--win/tkWinKey.c5
-rw-r--r--win/tkWinMenu.c25
-rw-r--r--win/tkWinPort.h7
-rw-r--r--win/tkWinX.c146
-rw-r--r--win/ttkWinXPTheme.c2
7 files changed, 122 insertions, 102 deletions
diff --git a/win/rules.vc b/win/rules.vc
index ecaaa00..bb78cb5 100644
--- a/win/rules.vc
+++ b/win/rules.vc
@@ -302,7 +302,7 @@ TCLDIR = $(_INSTALLDIR)\..
_TCLDIR = $(_INSTALLDIR)\..
_TCL_H = $(_TCLDIR)\include\tcl.h
-!else # exist(...) && ! $(NEED_TCL_SOURCE)
+!else # exist(...) && !$(NEED_TCL_SOURCE)
!if [echo _TCLDIR = \> nmakehlp.out] \
|| [nmakehlp -L generic\tcl.h >> nmakehlp.out]
@@ -313,7 +313,7 @@ TCLINSTALL = 0
TCLDIR = $(_TCLDIR)
_TCL_H = $(_TCLDIR)\generic\tcl.h
-!endif # exist(...) && ! $(NEED_TCL_SOURCE)
+!endif # exist(...) && !$(NEED_TCL_SOURCE)
!endif # TCLDIR
@@ -537,7 +537,7 @@ NMAKEHLPC = nmakehlp.c
!if exist("$(_TCLDIR)\lib\nmake\nmakehlp.c")
NMAKEHLPC = $(_TCLDIR)\lib\nmake\nmakehlp.c
!endif
-!else # ! $(TCLINSTALL)
+!else # !$(TCLINSTALL)
!if exist("$(_TCLDIR)\win\nmakehlp.c")
NMAKEHLPC = $(_TCLDIR)\win\nmakehlp.c
!endif
@@ -685,8 +685,9 @@ LINKERFLAGS = $(LINKERFLAGS) -ltcg
# CONFIG_CHECK - 1 -> check current build configuration against Tcl
# configuration (ignored for Tcl itself)
# _USE_64BIT_TIME_T - forces a build using 64-bit time_t for 32-bit build
-# (CRT library should support this)
+# (CRT library should support this, not needed for Tcl 9.x)
# TCL_UTF_MAX=4 - forces a build allowing 4-byte UTF-8 sequences internally.
+# (Not needed for Tcl 9.x)
# Further, LINKERFLAGS are modified based on above.
# Default values for all the above
@@ -755,6 +756,7 @@ TCL_THREADS = 1
USE_THREAD_ALLOC= 1
!endif
+!if "$(TCL_MAJOR_VERSION)" == "8"
!if [nmakehlp -f $(OPTS) "time64bit"]
!message *** Force 64-bit time_t
_USE_64BIT_TIME_T = 1
@@ -764,6 +766,7 @@ _USE_64BIT_TIME_T = 1
!message *** Force allowing 4-byte UTF-8 sequences internally
TCL_UTF_MAX = 4
!endif
+!endif
# Yes, it's weird that the "symbols" option controls DEBUG and
# the "pdbs" option controls SYMBOLS. That's historical.
@@ -1112,7 +1115,7 @@ TCLSTUBLIBNAME = $(STUBPREFIX)$(VERSION).lib
TCLSTUBLIB = $(OUT_DIR)\$(TCLSTUBLIBNAME)
TCL_INCLUDES = -I"$(WIN_DIR)" -I"$(GENERICDIR)"
-!else # ! $(DOING_TCL)
+!else # !$(DOING_TCL)
!if $(TCLINSTALL) # Building against an installed Tcl
@@ -1334,7 +1337,7 @@ OPTDEFINES = $(OPTDEFINES) /DTCL_NO_DEPRECATED
!if $(USE_STUBS)
# Note we do not define USE_TCL_STUBS even when building tk since some
# test targets in tk do not use stubs
-!if ! $(DOING_TCL)
+!if !$(DOING_TCL)
USE_STUBS_DEFS = /DUSE_TCL_STUBS /DUSE_TCLOO_STUBS
!if $(NEED_TK)
USE_STUBS_DEFS = $(USE_STUBS_DEFS) /DUSE_TK_STUBS
@@ -1358,6 +1361,7 @@ OPTDEFINES = $(OPTDEFINES) /DTCL_CFG_DO64BIT
OPTDEFINES = $(OPTDEFINES) /DNO_STRTOI64=1
!endif
+!if "$(TCL_MAJOR_VERSION)" == "8"
!if "$(_USE_64BIT_TIME_T)" == "1"
OPTDEFINES = $(OPTDEFINES) /D_USE_64BIT_TIME_T=1
!endif
@@ -1367,6 +1371,7 @@ OPTDEFINES = $(OPTDEFINES) /DTCL_UTF_MAX=4
# _ATL_XP_TARGETING - Newer SDK's need this to build for XP
COMPILERFLAGS = /D_ATL_XP_TARGETING
+!endif
# Like the TEA system only set this non empty for non-Tk extensions
# Note: some extensions use PACKAGE_NAME and others use PACKAGE_TCLNAME
@@ -1767,13 +1772,13 @@ $<
# When building an extension, certain configuration options should
# match the ones used when Tcl was built. Here we check and
# warn on a mismatch.
-!if ! $(DOING_TCL)
+!if !$(DOING_TCL)
!if $(TCLINSTALL) # Building against an installed Tcl
!if exist("$(_TCLDIR)\lib\nmake\tcl.nmake")
TCLNMAKECONFIG = "$(_TCLDIR)\lib\nmake\tcl.nmake"
!endif
-!else # ! $(TCLINSTALL) - building against Tcl source
+!else # !$(TCLINSTALL) - building against Tcl source
!if exist("$(OUT_DIR)\tcl.nmake")
TCLNMAKECONFIG = "$(OUT_DIR)\tcl.nmake"
!endif
@@ -1796,7 +1801,7 @@ TCLNMAKECONFIG = "$(OUT_DIR)\tcl.nmake"
!endif # TCLNMAKECONFIG
-!endif # ! $(DOING_TCL)
+!endif # !$(DOING_TCL)
#----------------------------------------------------------
diff --git a/win/tkWinFont.c b/win/tkWinFont.c
index 286a7a9..75578de 100644
--- a/win/tkWinFont.c
+++ b/win/tkWinFont.c
@@ -215,8 +215,8 @@ static int LoadFontRanges(HDC hdc, HFONT hFont,
USHORT **startCount, USHORT **endCount,
int *symbolPtr);
static void MultiFontTextOut(HDC hdc, WinFont *fontPtr,
- const char *source, int numBytes, int x, int y,
- double angle);
+ const char *source, int numBytes,
+ double x, double y, double angle);
static void ReleaseFont(WinFont *fontPtr);
static inline void ReleaseSubFont(SubFont *subFontPtr);
static int SeenName(const char *name, Tcl_DString *dsPtr);
@@ -1292,11 +1292,11 @@ TkDrawAngledChars(
*/
PatBlt(dcMem, 0, 0, size.cx, size.cy, BLACKNESS);
- MultiFontTextOut(dc, fontPtr, source, numBytes, (int)x, (int)y, angle);
+ MultiFontTextOut(dc, fontPtr, source, numBytes, x, y, angle);
BitBlt(dc, (int)x, (int)y - tm.tmAscent, size.cx, size.cy, dcMem,
0, 0, 0xEA02E9);
PatBlt(dcMem, 0, 0, size.cx, size.cy, WHITENESS);
- MultiFontTextOut(dc, fontPtr, source, numBytes, (int)x, (int)y, angle);
+ MultiFontTextOut(dc, fontPtr, source, numBytes, x, y, angle);
BitBlt(dc, (int)x, (int)y - tm.tmAscent, size.cx, size.cy, dcMem,
0, 0, 0x8A0E06);
@@ -1313,7 +1313,7 @@ TkDrawAngledChars(
SetTextAlign(dc, TA_LEFT | TA_BASELINE);
SetTextColor(dc, gc->foreground);
SetBkMode(dc, TRANSPARENT);
- MultiFontTextOut(dc, fontPtr, source, numBytes, (int)x, (int)y, angle);
+ MultiFontTextOut(dc, fontPtr, source, numBytes, x, y, angle);
} else {
HBITMAP oldBitmap, bitmap;
HDC dcMem;
@@ -1426,7 +1426,7 @@ MultiFontTextOut(
* following string. */
const char *source, /* Potentially multilingual UTF-8 string. */
int numBytes, /* Length of string in bytes. */
- int x, int y, /* Coordinates at which to place origin of
+ double x, double y, /* Coordinates at which to place origin of
* string when drawing. */
double angle)
{
@@ -1438,6 +1438,7 @@ MultiFontTextOut(
const char *p, *end, *next;
SubFont *lastSubFontPtr, *thisSubFontPtr;
TEXTMETRICW tm;
+ double sinA = sin(angle * PI/180.0), cosA = cos(angle * PI/180.0);
lastSubFontPtr = &fontPtr->subFontArray[0];
oldFont = SelectFont(hdc, fontPtr, lastSubFontPtr, angle);
@@ -1467,7 +1468,8 @@ MultiFontTextOut(
(WCHAR *)Tcl_DStringValue(&runString),
Tcl_DStringLength(&runString) >> familyPtr->isWideFont,
&size);
- x += size.cx;
+ x += cosA*size.cx;
+ y -= sinA*size.cx;
Tcl_DStringFree(&runString);
}
lastSubFontPtr = thisSubFontPtr;
diff --git a/win/tkWinKey.c b/win/tkWinKey.c
index da56c5c..2c20b64 100644
--- a/win/tkWinKey.c
+++ b/win/tkWinKey.c
@@ -103,9 +103,10 @@ TkpGetString(
Tcl_DStringInit(dsPtr);
if (keyEv->send_event == -1) {
- if (keyEv->nbytes > 0) {
+ TkKeyEvent *ev = (TkKeyEvent *)keyEv;
+ if (ev->nbytes > 0) {
Tcl_ExternalToUtfDString(TkWinGetKeyInputEncoding(),
- keyEv->trans_chars, keyEv->nbytes, dsPtr);
+ ev->trans_chars, ev->nbytes, dsPtr);
}
} else if (keyEv->send_event == -3) {
diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c
index 1887f73..0b6efcf 100644
--- a/win/tkWinMenu.c
+++ b/win/tkWinMenu.c
@@ -511,6 +511,7 @@ GetEntryText(
: Tcl_GetString(mePtr->accelPtr);
const char *p, *next;
Tcl_DString itemString;
+ int ch;
/*
* We have to construct the string with an ampersand preceeding the
@@ -527,7 +528,7 @@ GetEntryText(
if (*p == '&') {
Tcl_DStringAppend(&itemString, "&", 1);
}
- next = Tcl_UtfNext(p);
+ next = p + TkUtfToUniChar(p, &ch);
Tcl_DStringAppend(&itemString, p, (int) (next - p));
}
if (mePtr->accelLength > 0) {
@@ -536,7 +537,7 @@ GetEntryText(
if (*p == '&') {
Tcl_DStringAppend(&itemString, "&", 1);
}
- next = Tcl_UtfNext(p);
+ next = p + TkUtfToUniChar(p, &ch);
Tcl_DStringAppend(&itemString, p, (int) (next - p));
}
}
@@ -1269,7 +1270,7 @@ TkWinHandleMenuEvent(
for (i = 0; i < menuPtr->numEntries; i++) {
underline = menuPtr->entries[i]->underline;
labelPtr = menuPtr->entries[i]->labelPtr;
- if ((underline != TCL_AUTO_LENGTH) && (labelPtr != NULL)) {
+ if ((underline != TCL_INDEX_NONE) && (labelPtr != NULL)) {
/*
* Ensure we don't exceed the label length, then check
*/
@@ -2134,10 +2135,11 @@ DrawMenuUnderline(
len = Tcl_GetCharLength(mePtr->labelPtr);
if (mePtr->underline < len) {
const char *label, *start, *end;
+ int ch;
label = Tcl_GetString(mePtr->labelPtr);
start = Tcl_UtfAtIndex(label, mePtr->underline);
- end = Tcl_UtfNext(start);
+ end = start + TkUtfToUniChar(start, &ch);
Tk_UnderlineChars(menuPtr->display, d,
gc, tkfont, label, x + mePtr->indicatorSpace,
y + (height + fmPtr->ascent - fmPtr->descent) / 2,
@@ -2229,17 +2231,16 @@ TkWinMenuKeyObjCmd(
virtualKey = XKeysymToKeycode(winPtr->display, keySym);
scanCode = MapVirtualKeyW(virtualKey, 0);
if (0 != scanCode) {
- XKeyEvent xkey = eventPtr->xkey;
+ TkKeyEvent xkey;
+ memcpy(&xkey, eventPtr, sizeof(xkey));
CallWindowProcW(DefWindowProcW, Tk_GetHWND(Tk_WindowId(tkwin)),
WM_SYSKEYDOWN, virtualKey,
(int) ((scanCode << 16) | (1 << 29)));
- if (xkey.nbytes > 0) {
- for (i = 0; i < xkey.nbytes; i++) {
- CallWindowProcW(DefWindowProcW,
- Tk_GetHWND(Tk_WindowId(tkwin)), WM_SYSCHAR,
- xkey.trans_chars[i],
- (int) ((scanCode << 16) | (1 << 29)));
- }
+ for (i = 0; i < xkey.nbytes; i++) {
+ CallWindowProcW(DefWindowProcW,
+ Tk_GetHWND(Tk_WindowId(tkwin)), WM_SYSCHAR,
+ xkey.trans_chars[i],
+ (int) ((scanCode << 16) | (1 << 29)));
}
}
}
diff --git a/win/tkWinPort.h b/win/tkWinPort.h
index 11ecf21..880c952 100644
--- a/win/tkWinPort.h
+++ b/win/tkWinPort.h
@@ -129,4 +129,11 @@
#define TkpCreateNativeBitmap(display, source) None
#define TkpGetNativeAppBitmap(display, name, w, h) None
+/*
+ * Other functions not used under Windows
+ */
+
+#define TkpWillDrawWidget(tkwin) 1
+#define TkpRedrawWidget(tkwin)
+
#endif /* _WINPORT */
diff --git a/win/tkWinX.c b/win/tkWinX.c
index 34fabc9..661ad29 100644
--- a/win/tkWinX.c
+++ b/win/tkWinX.c
@@ -94,7 +94,7 @@ static Tcl_ThreadDataKey dataKey;
static void GenerateXEvent(HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam);
static unsigned int GetState(UINT message, WPARAM wParam, LPARAM lParam);
-static void GetTranslatedKey(XKeyEvent *xkey, UINT type);
+static void GetTranslatedKey(TkKeyEvent *xkey, UINT type);
static void UpdateInputLanguage(int charset);
static int HandleIMEComposition(HWND hwnd, LPARAM lParam);
@@ -981,7 +981,7 @@ GenerateXEvent(
WPARAM wParam,
LPARAM lParam)
{
- XEvent event;
+ union {XEvent x; TkKeyEvent key;} event;
TkWindow *winPtr;
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
@@ -1007,33 +1007,33 @@ GenerateXEvent(
return;
}
- memset(&event, 0, sizeof(XEvent));
- event.xany.serial = winPtr->display->request++;
- event.xany.send_event = False;
- event.xany.display = winPtr->display;
- event.xany.window = winPtr->window;
+ memset(&event.x, 0, sizeof(XEvent));
+ event.x.xany.serial = winPtr->display->request++;
+ event.x.xany.send_event = False;
+ event.x.xany.display = winPtr->display;
+ event.x.xany.window = winPtr->window;
switch (message) {
case WM_PAINT: {
PAINTSTRUCT ps;
- event.type = Expose;
+ event.x.type = Expose;
BeginPaint(hwnd, &ps);
- event.xexpose.x = ps.rcPaint.left;
- event.xexpose.y = ps.rcPaint.top;
- event.xexpose.width = ps.rcPaint.right - ps.rcPaint.left;
- event.xexpose.height = ps.rcPaint.bottom - ps.rcPaint.top;
+ event.x.xexpose.x = ps.rcPaint.left;
+ event.x.xexpose.y = ps.rcPaint.top;
+ event.x.xexpose.width = ps.rcPaint.right - ps.rcPaint.left;
+ event.x.xexpose.height = ps.rcPaint.bottom - ps.rcPaint.top;
EndPaint(hwnd, &ps);
- event.xexpose.count = 0;
+ event.x.xexpose.count = 0;
break;
}
case WM_CLOSE:
- event.type = ClientMessage;
- event.xclient.message_type =
+ event.x.type = ClientMessage;
+ event.x.xclient.message_type =
Tk_InternAtom((Tk_Window) winPtr, "WM_PROTOCOLS");
- event.xclient.format = 32;
- event.xclient.data.l[0] =
+ event.x.xclient.format = 32;
+ event.x.xclient.data.l[0] =
Tk_InternAtom((Tk_Window) winPtr, "WM_DELETE_WINDOW");
break;
@@ -1069,10 +1069,10 @@ GenerateXEvent(
return;
}
- event.xany.window = winPtr->window;
- event.type = (message == WM_SETFOCUS) ? FocusIn : FocusOut;
- event.xfocus.mode = NotifyNormal;
- event.xfocus.detail = NotifyNonlinear;
+ event.x.xany.window = winPtr->window;
+ event.x.type = (message == WM_SETFOCUS) ? FocusIn : FocusOut;
+ event.x.xfocus.mode = NotifyNormal;
+ event.x.xfocus.detail = NotifyNonlinear;
/*
* Destroy the caret if we own it. If we are moving to another Tk
@@ -1094,10 +1094,10 @@ GenerateXEvent(
return;
}
- event.type = SelectionClear;
- event.xselectionclear.selection =
+ event.x.type = SelectionClear;
+ event.x.xselectionclear.selection =
Tk_InternAtom((Tk_Window)winPtr, "CLIPBOARD");
- event.xselectionclear.time = TkpGetMS();
+ event.x.xselectionclear.time = TkpGetMS();
break;
case WM_MOUSEWHEEL:
@@ -1126,15 +1126,15 @@ GenerateXEvent(
* Set up the common event fields.
*/
- event.xbutton.root = RootWindow(winPtr->display, winPtr->screenNum);
- event.xbutton.subwindow = None;
- event.xbutton.x = clientPoint.x;
- event.xbutton.y = clientPoint.y;
- event.xbutton.x_root = root.point.x;
- event.xbutton.y_root = root.point.y;
- event.xbutton.state = state;
- event.xbutton.time = time;
- event.xbutton.same_screen = True;
+ event.x.xbutton.root = RootWindow(winPtr->display, winPtr->screenNum);
+ event.x.xbutton.subwindow = None;
+ event.x.xbutton.x = clientPoint.x;
+ event.x.xbutton.y = clientPoint.y;
+ event.x.xbutton.x_root = root.point.x;
+ event.x.xbutton.y_root = root.point.y;
+ event.x.xbutton.state = state;
+ event.x.xbutton.time = time;
+ event.x.xbutton.same_screen = True;
/*
* Now set up event specific fields.
@@ -1166,10 +1166,10 @@ GenerateXEvent(
* TkpGetString. [Bug 1118340].
*/
- event.type = MouseWheelEvent;
- event.xany.send_event = -1;
- event.xkey.nbytes = 0;
- event.xkey.keycode = tsdPtr->vWheelAcc / WHEEL_DELTA * WHEEL_DELTA;
+ event.x.type = MouseWheelEvent;
+ event.x.xany.send_event = -1;
+ event.key.nbytes = 0;
+ event.x.xkey.keycode = tsdPtr->vWheelAcc / WHEEL_DELTA * WHEEL_DELTA;
tsdPtr->vWheelAcc = tsdPtr->vWheelAcc % WHEEL_DELTA;
break;
}
@@ -1198,11 +1198,11 @@ GenerateXEvent(
* TkpGetString. [Bug 1118340].
*/
- event.type = MouseWheelEvent;
- event.xany.send_event = -1;
- event.xkey.nbytes = 0;
- event.xkey.state |= ShiftMask;
- event.xkey.keycode = tsdPtr->hWheelAcc / WHEEL_DELTA * WHEEL_DELTA;
+ event.x.type = MouseWheelEvent;
+ event.x.xany.send_event = -1;
+ event.key.nbytes = 0;
+ event.x.xkey.state |= ShiftMask;
+ event.x.xkey.keycode = tsdPtr->hWheelAcc / WHEEL_DELTA * WHEEL_DELTA;
tsdPtr->hWheelAcc = tsdPtr->hWheelAcc % WHEEL_DELTA;
break;
}
@@ -1216,10 +1216,10 @@ GenerateXEvent(
* MBCS characters that came from the TranslateMessage call.
*/
- event.type = KeyPress;
- event.xany.send_event = -1;
- event.xkey.keycode = wParam;
- GetTranslatedKey(&event.xkey, (message == WM_KEYDOWN) ? WM_CHAR :
+ event.x.type = KeyPress;
+ event.x.xany.send_event = -1;
+ event.x.xkey.keycode = wParam;
+ GetTranslatedKey(&event.key, (message == WM_KEYDOWN) ? WM_CHAR :
WM_SYSCHAR);
break;
@@ -1231,9 +1231,9 @@ GenerateXEvent(
* WM_CHAR messages which will follow.
*/
- event.type = KeyRelease;
- event.xkey.keycode = wParam;
- event.xkey.nbytes = 0;
+ event.x.type = KeyRelease;
+ event.x.xkey.keycode = wParam;
+ event.key.nbytes = 0;
break;
case WM_CHAR:
@@ -1267,9 +1267,9 @@ GenerateXEvent(
* character.
*/
- event.type = KeyPress;
- event.xany.send_event = -1;
- event.xkey.keycode = 0;
+ event.x.type = KeyPress;
+ event.x.xany.send_event = -1;
+ event.x.xkey.keycode = 0;
if ((int)wParam & 0xff00) {
int ch1 = wParam & 0xffff;
@@ -1282,12 +1282,12 @@ GenerateXEvent(
(ch1 & 0x3ff) | 0x10000;
tsdPtr->surrogateBuffer = 0;
}
- event.xany.send_event = -3;
- event.xkey.nbytes = 0;
- event.xkey.keycode = ch1;
+ event.x.xany.send_event = -3;
+ event.key.nbytes = 0;
+ event.x.xkey.keycode = ch1;
} else {
- event.xkey.nbytes = 1;
- event.xkey.trans_chars[0] = (char) wParam;
+ event.key.nbytes = 1;
+ event.key.trans_chars[0] = (char) wParam;
if (IsDBCSLeadByte((BYTE) wParam)) {
MSG msg;
@@ -1296,22 +1296,22 @@ GenerateXEvent(
PM_NOREMOVE) != 0)
&& (msg.message == WM_CHAR)) {
GetMessageW(&msg, NULL, WM_CHAR, WM_CHAR);
- event.xkey.nbytes = 2;
- event.xkey.trans_chars[1] = (char) msg.wParam;
+ event.key.nbytes = 2;
+ event.key.trans_chars[1] = (char) msg.wParam;
}
}
}
- Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL);
- event.type = KeyRelease;
+ Tk_QueueWindowEvent(&event.x, TCL_QUEUE_TAIL);
+ event.x.type = KeyRelease;
break;
case WM_UNICHAR: {
- event.type = KeyPress;
- event.xany.send_event = -3;
- event.xkey.keycode = wParam;
- event.xkey.nbytes = 0;
- Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL);
- event.type = KeyRelease;
+ event.x.type = KeyPress;
+ event.x.xany.send_event = -3;
+ event.x.xkey.keycode = wParam;
+ event.key.nbytes = 0;
+ Tk_QueueWindowEvent(&event.x, TCL_QUEUE_TAIL);
+ event.x.type = KeyRelease;
break;
}
@@ -1332,7 +1332,7 @@ GenerateXEvent(
* Post the translated event to the main Tk event queue.
*/
- Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL);
+ Tk_QueueWindowEvent(&event.x, TCL_QUEUE_TAIL);
}
/*
@@ -1434,7 +1434,7 @@ GetState(
static void
GetTranslatedKey(
- XKeyEvent *xkey,
+ TkKeyEvent *xkey,
UINT type)
{
MSG msg;
@@ -1457,7 +1457,7 @@ GetTranslatedKey(
*/
if ((msg.message == WM_CHAR) && (msg.lParam & 0x20000000)) {
- xkey->state = 0;
+ xkey->keyEvent.state = 0;
}
xkey->trans_chars[xkey->nbytes++] = (char) msg.wParam;
@@ -1516,7 +1516,11 @@ UpdateInputLanguage(
return;
}
- sprintf(codepage, "cp%d", charsetInfo.ciACP);
+ if (charsetInfo.ciACP == CP_UTF8) {
+ strcpy(codepage, "utf-8");
+ } else {
+ sprintf(codepage, "cp%d", charsetInfo.ciACP);
+ }
if ((encoding = Tcl_GetEncoding(NULL, codepage)) == NULL) {
/*
diff --git a/win/ttkWinXPTheme.c b/win/ttkWinXPTheme.c
index fec0450..26807f7 100644
--- a/win/ttkWinXPTheme.c
+++ b/win/ttkWinXPTheme.c
@@ -506,7 +506,7 @@ static void GenericElementSize(
if (!(elementData->info->flags & IGNORE_THEMESIZE)) {
result = elementData->procs->GetThemePartSize(
elementData->hTheme,
- elementData->hDC,
+ NULL,
elementData->info->partId,
Ttk_StateTableLookup(elementData->info->statemap, 0),
NULL /*RECT *prc*/,