diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/bind.n | 71 | ||||
-rw-r--r-- | doc/event.n | 18 |
2 files changed, 76 insertions, 13 deletions
@@ -1,14 +1,15 @@ '\" '\" Copyright (c) 1990 The Regents of the University of California. '\" Copyright (c) 1994-1996 Sun Microsystems, Inc. +'\" Copyright (c) 1998 by Scriptics Corporation. '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: bind.n,v 1.2 1998/09/14 18:22:54 stanton Exp $ +'\" RCS: @(#) $Id: bind.n,v 1.3 1998/10/10 00:30:35 rjohnson Exp $ '\" .so man.macros -.TH bind n 4.1 Tk "Tk Built-In Commands" +.TH bind n 8.0 Tk "Tk Built-In Commands" .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME @@ -158,20 +159,59 @@ time and space requirement. .SH "EVENT TYPES" .PP The \fItype\fR field may be any of the standard X event types, with a -few extra abbreviations. Below is a list of all the valid types; -where two names appear together, they are synonyms. +few extra abbreviations. The \fItype\fR field will also accept a +couple non-standard X event types that were added to better support +the Macintosh and Windows platforms. Below is a list of all the valid +types; where two names appear together, they are synonyms. .DS C .ta 5c 10c -\fBButtonPress, Button Expose Map -ButtonRelease FocusIn Motion -Circulate FocusOut Property +\fBActivate Enter Map +ButtonPress, Button Expose Motion +.VS +ButtonRelease FocusIn MouseWheel +.VE +Circulate FocusOut Property Colormap Gravity Reparent Configure KeyPress, Key Unmap -Destroy KeyRelease Visibility -Enter Leave Activate -Deactivate\fR +Deactivate KeyRelease Visibility +Destroy Leave\fR .DE .PP +.VS +Most of the above events have the same fields and behaviors as events +in the X Windowing system. You can find more detailed descriptions of +these events in any X window programming book. A couple of the events +are extensions to the X event system to support features unique to the +Macintosh and Windows platforms. We provide a little more detail on +these events here. These include: +.IP \fBActivate\fR 5 +.IP \fBDeactivate\fR 5 +These two events are sent to every sub-window of a toplevel when they +change state. In addition to the focus Window, the Macintosh platform +and Windows platforms have a notion of an active window (which often +has but is not required to have the focus). On the Macintosh, widgets +in the active window have a different appearance than widgets in +deactive windows. The \fBActivate\fR event is sent to all the +sub-windows in a toplevel when it changes from being deactive to +active. Likewise, the \fBDeactive\fR event is sent when the window's +state changes from active to deactive. There are no useful percent +substitutions you would make when binding to these events. +.IP \fBMouseWheel\fR 5 +Some mice on the Windows platform support a mouse wheel which is used +for scrolling documents without using the scrollbars. By rolling the +wheel, the system will generate \fBMouseWheel\fR events that the +application can use to scroll. Like \fBKey\fR events the event is +always routed to the window that currently has focus. When the event +is received you can use the \fB%D\fR substitution to get the +\fIdelta\fR field for the event which is a integer value of motion +that the mouse wheel has moved. The smallest value for which the +system will report is defined by the OS. On Windows 95 & 98 machines +this value is at least 120 before it is reported. However, higher +resolution devices may be available in the future. The sign of the +value determines which direction your widget should scroll. Positive +values should scroll up and negative values should scroll down. +.VE +.PP The last part of a long event specification is \fIdetail\fR. In the case of a \fBButtonPress\fR or \fBButtonRelease\fR event, it is the number of a button (1-5). If a button number is given, then only an @@ -258,7 +298,7 @@ The \fIfocus\fR field from the event (\fB0\fR or \fB1\fR). Valid only for \fBEnter\fR and \fBLeave\fR events. .IP \fB%h\fR 5 .VS -The \fIheight\fR field from the event. Valid only for \fBConfigure\fR and +The \fIheight\fR field from the event. Valid for the \fBConfigure\fR and \fBExpose\fR events. .VE .IP \fB%k\fR 5 @@ -308,6 +348,15 @@ Valid only for \fBKeyPress\fR and \fBKeyRelease\fR events. .IP \fB%B\fR 5 The \fIborder_width\fR field from the event. Valid only for \fBConfigure\fR events. +.VS +.IP \fB%D\fR 5 +This reports the \fIdelta\fR value of a \fBMouseWheel\fR event. The +\fIdelta\fR value represents the rotation units the mouse wheel has +been moved. On Windows 95 & 98 systems the smallest value for the +delta is 120. Future systems may support higher resolution values for +the delta. The sign of the value represents the direction the mouse +wheel was scrolled. +.VE .IP \fB%E\fR 5 The \fIsend_event\fR field from the event. Valid for all event types. .IP \fB%K\fR 5 diff --git a/doc/event.n b/doc/event.n index 0f1ac60..b6e4854 100644 --- a/doc/event.n +++ b/doc/event.n @@ -1,13 +1,14 @@ '\" '\" Copyright (c) 1996 Sun Microsystems, Inc. +'\" Copyright (c) 1998 by Scriptics Corporation. '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: event.n,v 1.2 1998/09/14 18:22:55 stanton Exp $ +'\" RCS: @(#) $Id: event.n,v 1.3 1998/10/10 00:30:35 rjohnson Exp $ '\" .so man.macros -.TH event n 4.4 Tk "Tk Built-In Commands" +.TH event n 8.0 Tk "Tk Built-In Commands" .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME @@ -105,6 +106,19 @@ Corresponds to the \fB%b\fR substitution for binding scripts. for the event. Valid for \fBExpose\fR events. Corresponds to the \fB%c\fR substitution for binding scripts. .TP +\fB\-delta\fI number\fR +.VS +\fINumber\fR must be an integer; it specifies the \fIdelta\fR field +for the \fBMouseWheel\fR event. The \fIdelta\fR refers to the +direction and magnitude the mouse wheel was rotated. Note the value +is not a screen distance but are units of motion in the mouse wheel. +Typically these values are multiples of 120. For example, 120 should +scroll the text widget up 4 lines and -240 would scroll the text +widget down 8 lines. Of course, other widgets may define different +behaviors for mouse wheel motion. This field corresponds to the +\fB%D\fR substitution for binding scripts. +.VE +.TP \fB\-detail\fI detail\fR \fIDetail\fR specifies the \fIdetail\fR field for the event and must be one of the following: |