LinkButtonController.st
changeset 6143 3ed63f769dc5
parent 3665 a335a284cf82
equal deleted inserted replaced
6142:9b7ea28c1da9 6143:3ed63f769dc5
       
     1 "{ Encoding: utf8 }"
       
     2 
     1 "
     3 "
     2  COPYRIGHT (c) 2009 by eXept Software AG
     4  COPYRIGHT (c) 2009 by eXept Software AG
     3               All Rights Reserved
     5               All Rights Reserved
     4 
     6 
     5  This software is furnished under a license and may be used
     7  This software is furnished under a license and may be used
     8  be provided or otherwise made available to, or used by, any
    10  be provided or otherwise made available to, or used by, any
     9  other person.  No title to or ownership of the software is
    11  other person.  No title to or ownership of the software is
    10  hereby transferred.
    12  hereby transferred.
    11 "
    13 "
    12 "{ Package: 'stx:libwidg2' }"
    14 "{ Package: 'stx:libwidg2' }"
       
    15 
       
    16 "{ NameSpace: Smalltalk }"
    13 
    17 
    14 ButtonController subclass:#LinkButtonController
    18 ButtonController subclass:#LinkButtonController
    15 	instanceVariableNames:'lastX lastY'
    19 	instanceVariableNames:'lastX lastY'
    16 	classVariableNames:''
    20 	classVariableNames:''
    17 	poolDictionaries:''
    21 	poolDictionaries:''
    57 !
    61 !
    58 
    62 
    59 buttonPress:button x:x y:y
    63 buttonPress:button x:x y:y
    60     |action|
    64     |action|
    61 
    65 
       
    66     button == 1 ifFalse:[
       
    67         ^ super buttonPress:button x:x y:y
       
    68     ].
       
    69 
    62     lastX := x.
    70     lastX := x.
    63     lastY := y.
    71     lastY := y.
    64 
    72 
    65     action := view actionAt:(self lastMousePoint).
    73     action := view actionAt:(self lastMousePoint).
    66     action notNil ifTrue:[
    74     action notNil ifTrue:[
    67         action value.
    75         action value.
    68     ].
    76     ].
    69 !
    77 !
    70 
    78 
    71 buttonRelease:button x:x y:y
    79 buttonRelease:button x:x y:y
       
    80     button == 1 ifFalse:[
       
    81         ^ super buttonRelease:button x:x y:y
       
    82     ].
       
    83 
    72     lastX := x.
    84     lastX := x.
    73     lastY := y.
    85     lastY := y.
    74     super buttonRelease:button x:x y:y.
    86     super buttonRelease:button x:x y:y.
    75 !
    87 !
    76 
    88 
    88 ! !
   100 ! !
    89 
   101 
    90 !LinkButtonController class methodsFor:'documentation'!
   102 !LinkButtonController class methodsFor:'documentation'!
    91 
   103 
    92 version
   104 version
    93     ^ '$Header: /cvs/stx/stx/libwidg2/LinkButtonController.st,v 1.4 2009-03-09 14:17:12 cg Exp $'
   105     ^ '$Header$'
    94 ! !
   106 ! !
       
   107