Attachment "tk8.5a0.patch" to
ticket [845248ff]
added by
nobody
2003-11-19 23:55:14.
diff -b -c --exclude=Debug --exclude=Release --exclude=buildall.vc.bat -r tk8.5a0/generic/tk.h tk8.5a0-mod/generic/tk.h
*** tk8.5a0/generic/tk.h Fri Mar 07 08:05:31 2003
--- tk8.5a0-mod/generic/tk.h Wed Nov 19 16:11:21 2003
***************
*** 654,667 ****
#define ActivateNotify (LASTEvent + 1)
#define DeactivateNotify (LASTEvent + 2)
#define MouseWheelEvent (LASTEvent + 3)
- #define TK_LASTEVENT (LASTEvent + 4)
#define MouseWheelMask (1L << 28)
#define ActivateMask (1L << 29)
#define VirtualEventMask (1L << 30)
- #define TK_LASTEVENT (LASTEvent + 4)
/*
* A virtual event shares most of its fields with the XKeyEvent and
--- 654,668 ----
#define ActivateNotify (LASTEvent + 1)
#define DeactivateNotify (LASTEvent + 2)
#define MouseWheelEvent (LASTEvent + 3)
#define MouseWheelMask (1L << 28)
#define ActivateMask (1L << 29)
#define VirtualEventMask (1L << 30)
+ #define HelpEvent (LASTEvent+5)
+ #define HelpMask (1L << 31)
+ #define TK_LASTEVENT (LASTEvent + 5)
/*
* A virtual event shares most of its fields with the XKeyEvent and
diff -b -c --exclude=Debug --exclude=Release --exclude=buildall.vc.bat -r tk8.5a0/generic/tkBind.c tk8.5a0-mod/generic/tkBind.c
*** tk8.5a0/generic/tkBind.c Tue Apr 15 07:12:24 2003
--- tk8.5a0-mod/generic/tkBind.c Tue Nov 18 16:48:25 2003
***************
*** 511,516 ****
--- 511,517 ----
{"Create", CreateNotify, SubstructureNotifyMask},
{"MapRequest", MapRequest, SubstructureRedirectMask},
{"ResizeRequest", ResizeRequest, ResizeRedirectMask},
+ {"Help", HelpEvent, HelpMask},
{(char *) NULL, 0, 0}
};
static Tcl_HashTable eventTable;
diff -b -c --exclude=Debug --exclude=Release --exclude=buildall.vc.bat -r tk8.5a0/generic/tkEvent.c tk8.5a0-mod/generic/tkEvent.c
*** tk8.5a0/generic/tkEvent.c Sat Jul 19 07:22:40 2003
--- tk8.5a0-mod/generic/tkEvent.c Tue Nov 18 17:02:16 2003
***************
*** 119,125 ****
VirtualEventMask, /* VirtualEvents */
ActivateMask, /* ActivateNotify */
ActivateMask, /* DeactivateNotify */
! MouseWheelMask /* MouseWheelEvent */
};
--- 119,126 ----
VirtualEventMask, /* VirtualEvents */
ActivateMask, /* ActivateNotify */
ActivateMask, /* DeactivateNotify */
! MouseWheelMask, /* MouseWheelEvent */
! HelpMask /* HelpEvent */
};
Only in tk8.5a0/library/demos: widget
Only in tk8.5a0-mod/library/demos: widget.tcl
Only in tk8.5a0-mod/win: nmakehlp.exe
Only in tk8.5a0-mod/win: nmakehlp.obj
diff -b -c --exclude=Debug --exclude=Release --exclude=buildall.vc.bat -r tk8.5a0/win/tkWinCursor.c tk8.5a0-mod/win/tkWinCursor.c
*** tk8.5a0/win/tkWinCursor.c Sat Jul 26 07:17:09 2003
--- tk8.5a0-mod/win/tkWinCursor.c Wed Nov 19 13:51:09 2003
***************
*** 245,250 ****
--- 245,254 ----
TkpSetCursor(cursor)
TkpCursor cursor;
{
+ /* the hcursor_idc_help test is necessary for the CONTEXTUAL HELP to work
+ by using wm attributes $window -contextualhelp */
+
+ static HCURSOR hcursor_idc_help=NULL;
HCURSOR hcursor;
TkWinCursor *winCursor = (TkWinCursor *) cursor;
***************
*** 254,259 ****
--- 258,265 ----
hcursor = winCursor->winCursor;
}
+ if(hcursor_idc_help==NULL) hcursor_idc_help=LoadCursor(NULL,IDC_HELP);
+ if(GetCursor()==hcursor_idc_help) return;
if (hcursor != NULL) {
SetCursor(hcursor);
}
diff -b -c --exclude=Debug --exclude=Release --exclude=buildall.vc.bat -r tk8.5a0/win/tkWinWm.c tk8.5a0-mod/win/tkWinWm.c
*** tk8.5a0/win/tkWinWm.c Wed Mar 12 08:05:55 2003
--- tk8.5a0-mod/win/tkWinWm.c Tue Nov 18 16:13:31 2003
***************
*** 2650,2656 ****
"window"
" ?-disabled ?bool??"
" ?-toolwindow ?bool??"
! " ?-topmost ?bool??");
return TCL_ERROR;
}
exStyle = wmPtr->exStyleConfig;
--- 2650,2657 ----
"window"
" ?-disabled ?bool??"
" ?-toolwindow ?bool??"
! " ?-topmost ?bool??"
! " ?-contexthelp ?bool??");
return TCL_ERROR;
}
exStyle = wmPtr->exStyleConfig;
***************
*** 2662,2667 ****
--- 2663,2670 ----
Tcl_AppendResult(interp, " -toolwindow ", buf, (char *) NULL);
sprintf(buf, "%d", ((exStyle & WS_EX_TOPMOST) != 0));
Tcl_AppendResult(interp, " -topmost ", buf, (char *) NULL);
+ sprintf(buf, "%d", ((exStyle & WS_EX_CONTEXTHELP) != 0));
+ Tcl_AppendResult(interp, " -contexthelp ", buf, (char *) NULL);
return TCL_OK;
}
for (i = 3; i < objc; i += 2) {
***************
*** 2690,2695 ****
--- 2693,2701 ----
(char *) NULL);
return TCL_ERROR;
}
+ } else if (strncmp(string, "-contexthelp", length) == 0){
+ stylePtr = &exStyle;
+ styleBit = WS_EX_CONTEXTHELP;
} else {
goto configArgs;
}
diff -b -c --exclude=Debug --exclude=Release --exclude=buildall.vc.bat -r tk8.5a0/win/tkWinX.c tk8.5a0-mod/win/tkWinX.c
*** tk8.5a0/win/tkWinX.c Thu Dec 12 19:54:06 2002
--- tk8.5a0-mod/win/tkWinX.c Tue Nov 18 17:01:39 2003
***************
*** 775,780 ****
--- 775,781 ----
case WM_KEYDOWN:
case WM_KEYUP:
case WM_MOUSEWHEEL:
+ case WM_HELP:
GenerateXEvent(hwnd, message, wParam, lParam);
return 1;
case WM_MENUCHAR:
***************
*** 914,919 ****
--- 915,921 ----
* mouse event in that the message is sent to the window
* that has focus.
*/
+ case WM_HELP:
case WM_CHAR:
case WM_SYSKEYDOWN:
***************
*** 968,973 ****
--- 970,984 ----
event.xany.send_event = -1;
event.xkey.keycode = (short) HIWORD(wParam);
break;
+ case WM_HELP:
+ /*
+ * We have invented a new X event type to handle
+ * this event. It still uses the KeyPress struct.
+ */
+
+ event.type = HelpEvent;
+ event.xany.send_event = -1;
+ break;
case WM_SYSKEYDOWN:
case WM_KEYDOWN:
/*