[comp.lang.smalltalk] ZOOM function on middle mouse button

shin@mcshh.hanse.de (Thomas Braun) (08/11/90)

- BEGIN OF FILE: TERM.CHG --------------------------------------------------
"
 ACTIVATE MIDDLE MOUSE BUTTON FOR ZOOM FUNCTION
 10. August 1990 - Thomas Braun
 This File installs the zoom function [F8] on the
 middle button (if u hv!) :-)
 To load evaluate the following message, where the
 file must be in the current directory. 

 (File pathName: 'term.chg') fileIn; close.

"!
Transcript cr;
            show: 'Filing in TerminalStream changes...'! 

! TerminalStream methods !

middleButton: value
        "Private - Decode middle mouse button down event."
    mouseOffset := Cursor offset.
    mouseTime := Time mouseClockValue.
    value = 16r3 ifTrue: [^ZoomFunction].
    ^SetLoc !

mouseButtonDown
        "Private - Decode all button down events."
    | button value |
    MouseEvent := true.
    button :=
        (value := CurrentEvent value) bitAnd: 16r3.
    button = 16r1 "left button down"
        ifTrue: [^self leftButton: value].
    button = 16r2 "right button down"
        ifTrue: [^self rightButton: value].
    button = 16r3 "middle button down"
        ifTrue: [^self middleButton: value].
    ^SetLoc ! !

Transcript show: ' done.'; cr; cr!

- EOF: TERM.CHG ------------------------------------------------------------