LinkButtonController.st
author Claus Gittinger <cg@exept.de>
Fri, 24 Jan 2020 14:42:44 +0100
changeset 6211 c922d4b60f5c
parent 6143 3ed63f769dc5
permissions -rw-r--r--
#UI_ENHANCEMENT by cg class: TerminalView added: #outputEncoding: class: TerminalView class added: #openWithAction:setupTerminalViewWith:onExit: changed: #openWithAction:onExit:
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6143
3ed63f769dc5 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 3665
diff changeset
     1
"{ Encoding: utf8 }"
3ed63f769dc5 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 3665
diff changeset
     2
3663
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
     3
"
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
     4
 COPYRIGHT (c) 2009 by eXept Software AG
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
     5
              All Rights Reserved
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
     6
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
     7
 This software is furnished under a license and may be used
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
     8
 only in accordance with the terms of that license and with the
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
     9
 inclusion of the above copyright notice.   This software may not
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    10
 be provided or otherwise made available to, or used by, any
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    11
 other person.  No title to or ownership of the software is
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    12
 hereby transferred.
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    13
"
3651
8bcfa0ccdaef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
"{ Package: 'stx:libwidg2' }"
8bcfa0ccdaef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
6143
3ed63f769dc5 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 3665
diff changeset
    16
"{ NameSpace: Smalltalk }"
3ed63f769dc5 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 3665
diff changeset
    17
3651
8bcfa0ccdaef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
ButtonController subclass:#LinkButtonController
8bcfa0ccdaef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	instanceVariableNames:'lastX lastY'
8bcfa0ccdaef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
	classVariableNames:''
8bcfa0ccdaef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
	poolDictionaries:''
8bcfa0ccdaef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
	category:'Interface-Support-Controllers'
8bcfa0ccdaef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
!
8bcfa0ccdaef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
3663
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    25
!LinkButtonController class methodsFor:'documentation'!
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    26
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    27
copyright
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    28
"
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    29
 COPYRIGHT (c) 2009 by eXept Software AG
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    30
              All Rights Reserved
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    31
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    32
 This software is furnished under a license and may be used
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    33
 only in accordance with the terms of that license and with the
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    34
 inclusion of the above copyright notice.   This software may not
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    35
 be provided or otherwise made available to, or used by, any
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    36
 other person.  No title to or ownership of the software is
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    37
 hereby transferred.
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    38
"
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    39
!
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    40
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    41
documentation
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    42
"
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    43
    see info in LinkButton
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    44
"
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    45
! !
3651
8bcfa0ccdaef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
3661
010d2b09a8b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3651
diff changeset
    47
!LinkButtonController methodsFor:'accessing'!
010d2b09a8b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3651
diff changeset
    48
010d2b09a8b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3651
diff changeset
    49
lastMousePoint
3663
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    50
    lastX isNil ifTrue:[^ nil].
3661
010d2b09a8b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3651
diff changeset
    51
    ^ lastX @ lastY
010d2b09a8b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3651
diff changeset
    52
! !
010d2b09a8b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3651
diff changeset
    53
3651
8bcfa0ccdaef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
!LinkButtonController methodsFor:'event handling'!
8bcfa0ccdaef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
8bcfa0ccdaef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
buttonMotion:buttonState x:x y:y
3661
010d2b09a8b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3651
diff changeset
    57
    lastX := x.
010d2b09a8b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3651
diff changeset
    58
    lastY := y.
3663
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    59
    view invalidate.
3661
010d2b09a8b2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3651
diff changeset
    60
    super buttonMotion:buttonState x:x y:y.
3651
8bcfa0ccdaef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
!
8bcfa0ccdaef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
8bcfa0ccdaef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
buttonPress:button x:x y:y
3663
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    64
    |action|
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    65
6143
3ed63f769dc5 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 3665
diff changeset
    66
    button == 1 ifFalse:[
3ed63f769dc5 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 3665
diff changeset
    67
        ^ super buttonPress:button x:x y:y
3ed63f769dc5 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 3665
diff changeset
    68
    ].
3ed63f769dc5 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 3665
diff changeset
    69
3651
8bcfa0ccdaef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
    lastX := x.
8bcfa0ccdaef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
    lastY := y.
3665
a335a284cf82 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3663
diff changeset
    72
3663
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    73
    action := view actionAt:(self lastMousePoint).
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    74
    action notNil ifTrue:[
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    75
        action value.
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    76
    ].
3651
8bcfa0ccdaef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
!
8bcfa0ccdaef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
8bcfa0ccdaef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
buttonRelease:button x:x y:y
6143
3ed63f769dc5 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 3665
diff changeset
    80
    button == 1 ifFalse:[
3ed63f769dc5 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 3665
diff changeset
    81
        ^ super buttonRelease:button x:x y:y
3ed63f769dc5 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 3665
diff changeset
    82
    ].
3ed63f769dc5 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 3665
diff changeset
    83
3651
8bcfa0ccdaef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
    lastX := x.
8bcfa0ccdaef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
    lastY := y.
8bcfa0ccdaef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
    super buttonRelease:button x:x y:y.
3663
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    87
!
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    88
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    89
pointerEnter:buttonState x:x y:y
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    90
    lastX := x.
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    91
    lastY := y.
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    92
    view invalidate.
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    93
    super pointerEnter:buttonState x:x y:y.
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    94
!
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    95
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    96
pointerLeave:buttonState 
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    97
    lastX := lastY := nil.
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    98
    view invalidate.
6d3cdd2ba023 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3661
diff changeset
    99
    super pointerLeave:buttonState.
3651
8bcfa0ccdaef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
! !
8bcfa0ccdaef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
8bcfa0ccdaef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
!LinkButtonController class methodsFor:'documentation'!
8bcfa0ccdaef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
8bcfa0ccdaef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
version
6143
3ed63f769dc5 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 3665
diff changeset
   105
    ^ '$Header$'
3651
8bcfa0ccdaef initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
! !
6143
3ed63f769dc5 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 3665
diff changeset
   107