Controller.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Wed, 06 Sep 2017 10:04:18 +0200
branchjv
changeset 8180 25149dfd68e0
parent 5345 b64a7f6ed325
child 7884 32f3e68c7433
permissions -rw-r--r--
Build files: removed a bunch of make rules for long-dead unsupported systems ...in order to unify and simplify the build. If a need to support this ancient systems arose, these hacks may ni longer be needed (due to new versions of tools) or the hacks would have to be written again (better) or retrieved from SCM (worse). Time will show.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
48194c26a46c Initial revision
claus
parents:
diff changeset
     1
"
48194c26a46c Initial revision
claus
parents:
diff changeset
     2
 COPYRIGHT (c) 1992 by Claus Gittinger
80
eb8373679a9f *** empty log message ***
claus
parents: 54
diff changeset
     3
	      All Rights Reserved
0
48194c26a46c Initial revision
claus
parents:
diff changeset
     4
48194c26a46c Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
48194c26a46c Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
48194c26a46c Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
48194c26a46c Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
48194c26a46c Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
48194c26a46c Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
48194c26a46c Initial revision
claus
parents:
diff changeset
    11
"
3753
e593d6729f4e can now specify if menu action is to be performed by
ca
parents: 3145
diff changeset
    12
"{ Package: 'stx:libview' }"
e593d6729f4e can now specify if menu action is to be performed by
ca
parents: 3145
diff changeset
    13
0
48194c26a46c Initial revision
claus
parents:
diff changeset
    14
Object subclass:#Controller
4208
0a16e323fe6b Remove unused instance variable 'sensor'
Stefan Vogel <sv@exept.de>
parents: 3902
diff changeset
    15
	instanceVariableNames:'model view'
413
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
    16
	classVariableNames:''
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
    17
	poolDictionaries:''
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
    18
	category:'Interface-Support-Controllers'
0
48194c26a46c Initial revision
claus
parents:
diff changeset
    19
!
48194c26a46c Initial revision
claus
parents:
diff changeset
    20
1112
9c5c18330d61 cosmetic
ca
parents: 1073
diff changeset
    21
!Controller class methodsFor:'documentation'!
46
7b331e9012fd *** empty log message ***
claus
parents: 12
diff changeset
    22
7b331e9012fd *** empty log message ***
claus
parents: 12
diff changeset
    23
copyright
7b331e9012fd *** empty log message ***
claus
parents: 12
diff changeset
    24
"
7b331e9012fd *** empty log message ***
claus
parents: 12
diff changeset
    25
 COPYRIGHT (c) 1992 by Claus Gittinger
80
eb8373679a9f *** empty log message ***
claus
parents: 54
diff changeset
    26
	      All Rights Reserved
0
48194c26a46c Initial revision
claus
parents:
diff changeset
    27
46
7b331e9012fd *** empty log message ***
claus
parents: 12
diff changeset
    28
 This software is furnished under a license and may be used
7b331e9012fd *** empty log message ***
claus
parents: 12
diff changeset
    29
 only in accordance with the terms of that license and with the
7b331e9012fd *** empty log message ***
claus
parents: 12
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
7b331e9012fd *** empty log message ***
claus
parents: 12
diff changeset
    31
 be provided or otherwise made available to, or used by, any
7b331e9012fd *** empty log message ***
claus
parents: 12
diff changeset
    32
 other person.  No title to or ownership of the software is
7b331e9012fd *** empty log message ***
claus
parents: 12
diff changeset
    33
 hereby transferred.
7b331e9012fd *** empty log message ***
claus
parents: 12
diff changeset
    34
"
7b331e9012fd *** empty log message ***
claus
parents: 12
diff changeset
    35
!
0
48194c26a46c Initial revision
claus
parents:
diff changeset
    36
46
7b331e9012fd *** empty log message ***
claus
parents: 12
diff changeset
    37
documentation
7b331e9012fd *** empty log message ***
claus
parents: 12
diff changeset
    38
"
7b331e9012fd *** empty log message ***
claus
parents: 12
diff changeset
    39
    Controllers can be used to controll the user-interactions
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
    40
    to a model which is shown in a view.
413
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
    41
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
    42
    For very simple views (and due to the evolution of Smalltalk/X),
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
    43
    many view-classes have the controller function integrated.
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
    44
80
eb8373679a9f *** empty log message ***
claus
parents: 54
diff changeset
    45
    To allow both controller and non-controller operation, events are
413
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
    46
    sent directly to the view, if the view has no controller
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
    47
    (i.e. if its controller instance variable is nil).
413
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
    48
    Otherwise, the controller gets the event message.
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
    49
89
ea2bf46eb669 *** empty log message ***
claus
parents: 86
diff changeset
    50
    For now (vsn 2.10.4) there are only a few view classes using controllers;
ea2bf46eb669 *** empty log message ***
claus
parents: 86
diff changeset
    51
    however, over time, more will be converted, since separating the controller
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
    52
    offers much more flexibility
127
98b0725782bd *** empty log message ***
claus
parents: 125
diff changeset
    53
    (although view initialization becomes a bit more complex).
46
7b331e9012fd *** empty log message ***
claus
parents: 12
diff changeset
    54
413
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
    55
    Over time, expect the buttonPress/Release/Motion and keyPress/Release
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
    56
    methods to vanish from the view classes and corresponding controllers to
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
    57
    be appearing.
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
    58
    This migration should be backward compatible.
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
    59
681
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
    60
    Device coordinates vs. Logical coordinates:
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
    61
	if the view has a non-identity transformation (for example: drawing
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
    62
	in millimeters or inches), the application/controller may or may not
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
    63
	be interested in device coordinates in button/key events.
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
    64
	Most are not, these will receive logical coordinates transparently
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
    65
	in theyr button/key-Press/Release/Motion methods.
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
    66
	Those which are interested should redefine the corresponding
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
    67
	device-Key/Button-Press/Release/Motion methods.
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
    68
	Of course, it is always possible to map between device and logical
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
    69
	coordinates, using `view transformation applyTo/applyInverseTo:',
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
    70
	if both coordinates are required (which is unlikely).
681
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
    71
612
8758d0c9933e documentation
Claus Gittinger <cg@exept.de>
parents: 509
diff changeset
    72
    [Instance variables:]
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
    73
	view        <View>               the view I control
413
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
    74
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
    75
	model       <Model>              the model which is to be worked on
612
8758d0c9933e documentation
Claus Gittinger <cg@exept.de>
parents: 509
diff changeset
    76
681
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
    77
612
8758d0c9933e documentation
Claus Gittinger <cg@exept.de>
parents: 509
diff changeset
    78
    [author:]
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
    79
	Claus Gittinger
612
8758d0c9933e documentation
Claus Gittinger <cg@exept.de>
parents: 509
diff changeset
    80
8758d0c9933e documentation
Claus Gittinger <cg@exept.de>
parents: 509
diff changeset
    81
    [see also:]
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
    82
	View Model WindowGroup
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
    83
	WindowEvent DeviceWorkstation
46
7b331e9012fd *** empty log message ***
claus
parents: 12
diff changeset
    84
"
7b331e9012fd *** empty log message ***
claus
parents: 12
diff changeset
    85
! !
0
48194c26a46c Initial revision
claus
parents:
diff changeset
    86
1112
9c5c18330d61 cosmetic
ca
parents: 1073
diff changeset
    87
!Controller class methodsFor:'instance creation'!
89
ea2bf46eb669 *** empty log message ***
claus
parents: 86
diff changeset
    88
ea2bf46eb669 *** empty log message ***
claus
parents: 86
diff changeset
    89
new
ea2bf46eb669 *** empty log message ***
claus
parents: 86
diff changeset
    90
    ^ self basicNew initialize
ea2bf46eb669 *** empty log message ***
claus
parents: 86
diff changeset
    91
! !
ea2bf46eb669 *** empty log message ***
claus
parents: 86
diff changeset
    92
3880
c4c8268a2d9f method category rename
Claus Gittinger <cg@exept.de>
parents: 3753
diff changeset
    93
!Controller methodsFor:'Compatibility-ST80'!
2934
33b1988133d3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
    94
33b1988133d3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
    95
blueButtonActivity
33b1988133d3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
    96
    "actually, this should be called 'rightButtonActivity'.
33b1988133d3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
    97
     But for ST-80 compatibility ...."
33b1988133d3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
    98
33b1988133d3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
    99
    ^ self
33b1988133d3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2481
diff changeset
   100
!
99
c40b8a508283 *** empty log message ***
claus
parents: 92
diff changeset
   101
413
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   102
controlInitialize
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   103
    ^ self
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   104
!
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   105
99
c40b8a508283 *** empty log message ***
claus
parents: 92
diff changeset
   106
open
c40b8a508283 *** empty log message ***
claus
parents: 92
diff changeset
   107
    "open my view"
c40b8a508283 *** empty log message ***
claus
parents: 92
diff changeset
   108
c40b8a508283 *** empty log message ***
claus
parents: 92
diff changeset
   109
    view open
1434
136173f28066 set the sensor; dont change models deps in view:
Claus Gittinger <cg@exept.de>
parents: 1394
diff changeset
   110
!
136173f28066 set the sensor; dont change models deps in view:
Claus Gittinger <cg@exept.de>
parents: 1394
diff changeset
   111
136173f28066 set the sensor; dont change models deps in view:
Claus Gittinger <cg@exept.de>
parents: 1394
diff changeset
   112
poll
136173f28066 set the sensor; dont change models deps in view:
Claus Gittinger <cg@exept.de>
parents: 1394
diff changeset
   113
    "ST-80 compatibility - ignored here"
136173f28066 set the sensor; dont change models deps in view:
Claus Gittinger <cg@exept.de>
parents: 1394
diff changeset
   114
136173f28066 set the sensor; dont change models deps in view:
Claus Gittinger <cg@exept.de>
parents: 1394
diff changeset
   115
    "Created: 6.3.1997 / 15:29:45 / cg"
413
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   116
!
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   117
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   118
redButtonActivity
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   119
    "actually, this should be called 'leftButtonActivity'.
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   120
     But for ST-80 compatibility ...."
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   121
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   122
    ^ self
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   123
!
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   124
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   125
yellowButtonActivity
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   126
    "actually, this should be called 'middleButtonActivity'.
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   127
     But for ST-80 compatibility ...."
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   128
1112
9c5c18330d61 cosmetic
ca
parents: 1073
diff changeset
   129
    |menu actionSelector menuPerformer prevReceiver|
413
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   130
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   131
    "
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   132
     ST/X style static menus - going to be obsoleted ...
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   133
    "
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   134
    (menu := view middleButtonMenu) notNil ifTrue:[
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   135
	menu showAtPointer.
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   136
	^ self
472
621c17076f00 static menus override dynamic ones (is this good ?)
Claus Gittinger <cg@exept.de>
parents: 469
diff changeset
   137
    ].
621c17076f00 static menus override dynamic ones (is this good ?)
Claus Gittinger <cg@exept.de>
parents: 469
diff changeset
   138
621c17076f00 static menus override dynamic ones (is this good ?)
Claus Gittinger <cg@exept.de>
parents: 469
diff changeset
   139
    menu := self yellowButtonMenu.
621c17076f00 static menus override dynamic ones (is this good ?)
Claus Gittinger <cg@exept.de>
parents: 469
diff changeset
   140
    menu notNil ifTrue:[
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   141
	menuPerformer := self menuPerformer.
472
621c17076f00 static menus override dynamic ones (is this good ?)
Claus Gittinger <cg@exept.de>
parents: 469
diff changeset
   142
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   143
	"
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   144
	 a temporary kludge:
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   145
	     pass myself as receiver, the menuPerformer as performer;
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   146
	     the menu will send its messages to either the
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   147
	     menuPerformer or me (its receiver).
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   148
	     This allows for the ST-80 behavior, where some messages
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   149
	     go to the model, others to the view
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   150
	     (copy/cut/paste).
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   151
	"
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   152
	(prevReceiver := menu receiver) isNil ifTrue:[
1259
60af09384d13 pass myself AND the menuPerformer to the popupMenu.
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   153
"/                menu receiver:menuPerformer.
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   154
	    menu menuPerformer:menuPerformer.
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   155
	    menu receiver:self.
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   156
	].
1259
60af09384d13 pass myself AND the menuPerformer to the popupMenu.
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   157
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   158
	"
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   159
	 Launch the menu. It is supposed
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   160
	 to return an actionSelector.
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   161
	"
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   162
	actionSelector := view startUpMenu:menu.
472
621c17076f00 static menus override dynamic ones (is this good ?)
Claus Gittinger <cg@exept.de>
parents: 469
diff changeset
   163
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   164
	actionSelector notNil notNil ifTrue:[
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   165
	    actionSelector isSymbol ifTrue:[
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   166
		menuPerformer perform:actionSelector
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   167
	    ] ifFalse:[
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   168
		(actionSelector isArray
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   169
		and:[actionSelector size == 2
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   170
		and:[(actionSelector at:1) isSymbol]]) ifTrue:[
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   171
		    menuPerformer
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   172
			perform:(actionSelector at:1)
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   173
			with:(actionSelector at:2)
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   174
		]
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   175
	    ]
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   176
	].
1112
9c5c18330d61 cosmetic
ca
parents: 1073
diff changeset
   177
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   178
	menu receiver:prevReceiver.
1112
9c5c18330d61 cosmetic
ca
parents: 1073
diff changeset
   179
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   180
	^ self
472
621c17076f00 static menus override dynamic ones (is this good ?)
Claus Gittinger <cg@exept.de>
parents: 469
diff changeset
   181
    ].
621c17076f00 static menus override dynamic ones (is this good ?)
Claus Gittinger <cg@exept.de>
parents: 469
diff changeset
   182
1259
60af09384d13 pass myself AND the menuPerformer to the popupMenu.
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   183
    "Modified: 21.1.1997 / 15:45:48 / cg"
413
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   184
! !
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   185
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   186
!Controller methodsFor:'accessing'!
48194c26a46c Initial revision
claus
parents:
diff changeset
   187
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   188
menuHolder
245
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   189
    "by default, the model has to provide the menu"
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   190
1036
e4b2a5b5b0df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   191
    model isNil ifTrue:[
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   192
	^ view menuHolder
1036
e4b2a5b5b0df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   193
    ].
245
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   194
    ^ model
1036
e4b2a5b5b0df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   195
e4b2a5b5b0df checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1012
diff changeset
   196
    "Modified: 22.8.1996 / 09:11:43 / cg"
245
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   197
!
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   198
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   199
menuPerformer
245
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   200
    "by default, the model is performing menu actions"
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   201
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   202
    model isNil ifTrue:[^ view].
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   203
    ^ model
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   204
!
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   205
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   206
model
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   207
    "return my model"
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   208
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   209
    ^ model
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   210
!
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   211
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   212
model:aModel
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   213
    "set my model"
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   214
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   215
    model := aModel.
1394
f40e168c528c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1259
diff changeset
   216
f40e168c528c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1259
diff changeset
   217
    "Modified: 28.2.1997 / 19:52:50 / cg"
245
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   218
!
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   219
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   220
sensor
245
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   221
    "return my views sensor"
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   222
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   223
    ^ view sensor
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   224
!
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   225
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   226
view
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   227
    "return my view"
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   228
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   229
    ^ view
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   230
!
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   231
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   232
view:aView
48194c26a46c Initial revision
claus
parents:
diff changeset
   233
    "set my view"
48194c26a46c Initial revision
claus
parents:
diff changeset
   234
48194c26a46c Initial revision
claus
parents:
diff changeset
   235
    view := aView.
1434
136173f28066 set the sensor; dont change models deps in view:
Claus Gittinger <cg@exept.de>
parents: 1394
diff changeset
   236
136173f28066 set the sensor; dont change models deps in view:
Claus Gittinger <cg@exept.de>
parents: 1394
diff changeset
   237
    "Modified: 6.3.1997 / 15:31:48 / cg"
80
eb8373679a9f *** empty log message ***
claus
parents: 54
diff changeset
   238
! !
eb8373679a9f *** empty log message ***
claus
parents: 54
diff changeset
   239
86
032006651226 *** empty log message ***
claus
parents: 80
diff changeset
   240
!Controller methodsFor:'event handling'!
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   241
245
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   242
buttonMotion:buttonMask x:x y:y
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   243
    "mouse was moved with button pressed in my view; nothing done here"
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   244
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   245
    ^ self
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   246
!
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   247
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   248
buttonMultiPress:button x:x y:y
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   249
    "a mouse button was pressed again shortly after in my view"
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   250
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   251
    ^ self buttonPress:button x:x y:y
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   252
!
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   253
80
eb8373679a9f *** empty log message ***
claus
parents: 54
diff changeset
   254
buttonPress:button x:x y:y
92
7edb04821bef added redefinable startUp method
claus
parents: 89
diff changeset
   255
    "a mouse button was pressed in my view.
7edb04821bef added redefinable startUp method
claus
parents: 89
diff changeset
   256
     Translate buttonPress events into similar ST-80 type
7edb04821bef added redefinable startUp method
claus
parents: 89
diff changeset
   257
     event messages. This method and/or these ST-80 methods
7edb04821bef added redefinable startUp method
claus
parents: 89
diff changeset
   258
     can be redefined in subclasses"
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   259
5345
b64a7f6ed325 preps for right-menu on buttonRelease
Claus Gittinger <cg@exept.de>
parents: 5007
diff changeset
   260
    (button == 1) ifTrue:[
b64a7f6ed325 preps for right-menu on buttonRelease
Claus Gittinger <cg@exept.de>
parents: 5007
diff changeset
   261
        self redButtonActivity    "/ select button
80
eb8373679a9f *** empty log message ***
claus
parents: 54
diff changeset
   262
    ].
5345
b64a7f6ed325 preps for right-menu on buttonRelease
Claus Gittinger <cg@exept.de>
parents: 5007
diff changeset
   263
    (button == 2) ifTrue:[
b64a7f6ed325 preps for right-menu on buttonRelease
Claus Gittinger <cg@exept.de>
parents: 5007
diff changeset
   264
        self yellowButtonActivity "/ menu button
80
eb8373679a9f *** empty log message ***
claus
parents: 54
diff changeset
   265
    ].
eb8373679a9f *** empty log message ***
claus
parents: 54
diff changeset
   266
    (button == 3) ifTrue:[
5345
b64a7f6ed325 preps for right-menu on buttonRelease
Claus Gittinger <cg@exept.de>
parents: 5007
diff changeset
   267
        self blueButtonActivity   "/ window frame button
80
eb8373679a9f *** empty log message ***
claus
parents: 54
diff changeset
   268
    ]
eb8373679a9f *** empty log message ***
claus
parents: 54
diff changeset
   269
!
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   270
245
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   271
buttonRelease:button x:x y:y
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   272
    "a mouse button was released in my view; nothing done here"
118
25e775072a89 *** empty log message ***
claus
parents: 109
diff changeset
   273
245
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   274
    ^ self
118
25e775072a89 *** empty log message ***
claus
parents: 109
diff changeset
   275
!
25e775072a89 *** empty log message ***
claus
parents: 109
diff changeset
   276
245
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   277
deviceButtonMotion:state x:x y:y
153
claus
parents: 141
diff changeset
   278
    "this is the low-level (untransformed) event as received
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   279
     from the device (i.e. coordinates are in device coordinates).
153
claus
parents: 141
diff changeset
   280
     If there is a transformation, apply the inverse
681
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   281
     and send a buttonMotion with the logical coordinates.
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   282
1073
75fafd486819 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1054
diff changeset
   283
     Controllers which are interested in deviceCoordinates should
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   284
     redefine this method -
1073
75fafd486819 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1054
diff changeset
   285
     those which are interested in logical coordinates
681
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   286
     should redefine #buttonMotion:x:y:"
153
claus
parents: 141
diff changeset
   287
claus
parents: 141
diff changeset
   288
    |lx ly trans|
claus
parents: 141
diff changeset
   289
claus
parents: 141
diff changeset
   290
    lx := x.
claus
parents: 141
diff changeset
   291
    ly := y.
claus
parents: 141
diff changeset
   292
    (trans := view transformation) notNil ifTrue:[
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   293
	lx := trans applyInverseToX:lx.
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   294
	ly := trans applyInverseToY:ly.
153
claus
parents: 141
diff changeset
   295
    ].
245
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   296
    self buttonMotion:state x:lx y:ly
681
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   297
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   298
    "Modified: 13.5.1996 / 11:24:11 / cg"
1073
75fafd486819 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1054
diff changeset
   299
    "Modified: 14.10.1996 / 22:23:56 / stefan"
681
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   300
!
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   301
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   302
deviceButtonMultiPress:button x:x y:y
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   303
    "this is the low-level (untransformed) event as received
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   304
     from the device (i.e. coordinates are in device coordinates).
681
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   305
     If there is a transformation, apply the inverse
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   306
     and send a buttonMultiPress with the logical coordinates.
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   307
1073
75fafd486819 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1054
diff changeset
   308
     Controllers which are interested in deviceCoordinates should
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   309
     redefine this method -
1073
75fafd486819 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1054
diff changeset
   310
     those which are interested in logical coordinates
681
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   311
     should redefine #buttonMultiPress:x:y:"
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   312
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   313
    |lx ly trans|
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   314
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   315
    lx := x.
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   316
    ly := y.
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   317
    (trans := view transformation) notNil ifTrue:[
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   318
	lx := trans applyInverseToX:lx.
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   319
	ly := trans applyInverseToY:ly.
681
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   320
    ].
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   321
    self buttonMultiPress:button x:lx y:ly
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   322
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   323
    "Modified: 13.5.1996 / 11:23:54 / cg"
1073
75fafd486819 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1054
diff changeset
   324
    "Modified: 14.10.1996 / 22:24:06 / stefan"
245
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   325
!
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   326
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   327
deviceButtonPress:button x:x y:y
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   328
    "this is the low-level (untransformed) event as received
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   329
     from the device (i.e. coordinates are in device coordinates).
245
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   330
     If there is a transformation, apply the inverse
681
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   331
     and send a buttonPress with the logical coordinates.
245
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   332
1073
75fafd486819 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1054
diff changeset
   333
     Controllers which are interested in deviceCoordinates should
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   334
     redefine this method -
1073
75fafd486819 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1054
diff changeset
   335
     those which are interested in logical coordinates
681
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   336
     should redefine #buttonPress:x:y:"
245
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   337
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   338
    |lx ly trans|
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   339
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   340
    lx := x.
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   341
    ly := y.
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   342
    (trans := view transformation) notNil ifTrue:[
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   343
	lx := trans applyInverseToX:lx.
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   344
	ly := trans applyInverseToY:ly.
681
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   345
    ].
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   346
    self buttonPress:button x:lx y:ly
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   347
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   348
    "Modified: 13.5.1996 / 11:24:23 / cg"
1073
75fafd486819 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1054
diff changeset
   349
    "Modified: 14.10.1996 / 22:24:17 / stefan"
681
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   350
!
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   351
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   352
deviceButtonRelease:button x:x y:y
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   353
    "this is the low-level (untransformed) event as received
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   354
     from the device (i.e. coordinates are in device coordinates).
681
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   355
     If there is a transformation, apply the inverse
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   356
     and send a buttonRelease with the logical coordinates.
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   357
1073
75fafd486819 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1054
diff changeset
   358
     Controllers which are interested in deviceCoordinates should
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   359
     redefine this method -
1073
75fafd486819 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1054
diff changeset
   360
     those which are interested in logical coordinates
681
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   361
     should redefine #buttonRelease:x:y:"
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   362
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   363
    |lx ly trans|
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   364
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   365
    lx := x.
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   366
    ly := y.
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   367
    (trans := view transformation) notNil ifTrue:[
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   368
	lx := trans applyInverseToX:lx.
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   369
	ly := trans applyInverseToY:ly.
245
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   370
    ].
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   371
    self buttonRelease:button x:lx y:ly
681
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   372
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   373
    "Modified: 13.5.1996 / 11:24:33 / cg"
1073
75fafd486819 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1054
diff changeset
   374
    "Modified: 14.10.1996 / 22:24:28 / stefan"
153
claus
parents: 141
diff changeset
   375
!
claus
parents: 141
diff changeset
   376
claus
parents: 141
diff changeset
   377
deviceKeyPress:key x:x y:y
claus
parents: 141
diff changeset
   378
    "this is the low-level (untransformed) event as received
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   379
     from the device (i.e. coordinates are in device coordinates).
153
claus
parents: 141
diff changeset
   380
     If there is a transformation, apply the inverse
681
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   381
     and send a keyPress with the logical coordinates.
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   382
1073
75fafd486819 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1054
diff changeset
   383
     Controllers which are interested in deviceCoordinates should
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   384
     redefine this method -
1073
75fafd486819 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1054
diff changeset
   385
     those which are interested in logical coordinates
681
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   386
     should redefine #keyPress:x:y:"
153
claus
parents: 141
diff changeset
   387
claus
parents: 141
diff changeset
   388
    |lx ly trans|
claus
parents: 141
diff changeset
   389
claus
parents: 141
diff changeset
   390
    lx := x.
claus
parents: 141
diff changeset
   391
    ly := y.
claus
parents: 141
diff changeset
   392
    (trans := view transformation) notNil ifTrue:[
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   393
	lx := trans applyInverseToX:lx.
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   394
	ly := trans applyInverseToY:ly.
153
claus
parents: 141
diff changeset
   395
    ].
claus
parents: 141
diff changeset
   396
    self keyPress:key x:lx y:ly
681
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   397
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   398
    "Modified: 13.5.1996 / 11:24:43 / cg"
1073
75fafd486819 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1054
diff changeset
   399
    "Modified: 14.10.1996 / 22:24:36 / stefan"
153
claus
parents: 141
diff changeset
   400
!
claus
parents: 141
diff changeset
   401
claus
parents: 141
diff changeset
   402
deviceKeyRelease:key x:x y:y
claus
parents: 141
diff changeset
   403
    "this is the low-level (untransformed) event as received
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   404
     from the device (i.e. coordinates are in device coordinates).
153
claus
parents: 141
diff changeset
   405
     If there is a transformation, apply the inverse
681
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   406
     and send a keyRelease with the logical coordinates.
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   407
1073
75fafd486819 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1054
diff changeset
   408
     Controllers which are interested in deviceCoordinates should
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   409
     redefine this method -
1073
75fafd486819 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1054
diff changeset
   410
     those which are interested in logical coordinates
681
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   411
     should redefine #keyRelease:x:y:"
153
claus
parents: 141
diff changeset
   412
claus
parents: 141
diff changeset
   413
    |lx ly trans|
claus
parents: 141
diff changeset
   414
claus
parents: 141
diff changeset
   415
    lx := x.
claus
parents: 141
diff changeset
   416
    ly := y.
claus
parents: 141
diff changeset
   417
    (trans := view transformation) notNil ifTrue:[
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   418
	lx := trans applyInverseToX:lx.
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   419
	ly := trans applyInverseToY:ly.
153
claus
parents: 141
diff changeset
   420
    ].
claus
parents: 141
diff changeset
   421
    self keyRelease:key x:lx y:ly
681
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   422
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   423
    "Modified: 13.5.1996 / 11:24:51 / cg"
1073
75fafd486819 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1054
diff changeset
   424
    "Modified: 14.10.1996 / 22:24:46 / stefan"
153
claus
parents: 141
diff changeset
   425
!
claus
parents: 141
diff changeset
   426
245
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   427
devicePointerEnter:state x:x y:y
153
claus
parents: 141
diff changeset
   428
    "this is the low-level (untransformed) event as received
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   429
     from the device (i.e. coordinates are in device coordinates).
153
claus
parents: 141
diff changeset
   430
     If there is a transformation, apply the inverse
681
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   431
     and send a pointerEnter with the logical coordinates.
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   432
1073
75fafd486819 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1054
diff changeset
   433
     Controllers which are interested in deviceCoordinates should
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   434
     redefine this method -
1073
75fafd486819 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1054
diff changeset
   435
     those which are interested in logical coordinates
681
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   436
     should redefine #pointerEnter:x:y:"
153
claus
parents: 141
diff changeset
   437
claus
parents: 141
diff changeset
   438
    |lx ly trans|
claus
parents: 141
diff changeset
   439
claus
parents: 141
diff changeset
   440
    lx := x.
claus
parents: 141
diff changeset
   441
    ly := y.
claus
parents: 141
diff changeset
   442
    (trans := view transformation) notNil ifTrue:[
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   443
	lx := trans applyInverseToX:lx.
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   444
	ly := trans applyInverseToY:ly.
153
claus
parents: 141
diff changeset
   445
    ].
245
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   446
    self pointerEnter:state x:lx y:ly
681
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   447
bf6770d3d032 comments
Claus Gittinger <cg@exept.de>
parents: 612
diff changeset
   448
    "Modified: 13.5.1996 / 11:24:59 / cg"
1073
75fafd486819 Rename misspelled "interrest" to "interest".
Stefan Vogel <sv@exept.de>
parents: 1054
diff changeset
   449
    "Modified: 14.10.1996 / 22:24:54 / stefan"
245
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   450
!
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   451
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   452
focusIn
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   453
    "my view got the keyboard focus; nothing done here"
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   454
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   455
    ^ self
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   456
!
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   457
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   458
focusOut
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   459
    "my view lost keyboard focus; nothing done here"
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   460
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   461
    ^ self
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   462
!
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   463
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   464
keyPress:key x:x y:y
416
0f08407c955e use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents: 413
diff changeset
   465
    "key was pressed in my view; nothing done here,
0f08407c955e use sensor shiftDown (instead of device shiftDown)
Claus Gittinger <cg@exept.de>
parents: 413
diff changeset
   466
     except for Tab keys."
245
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   467
509
3e4d2800717a resources
Claus Gittinger <cg@exept.de>
parents: 502
diff changeset
   468
    <resource: #keyboard (#Tab #FocusNext #FocusPrevious)>
3e4d2800717a resources
Claus Gittinger <cg@exept.de>
parents: 502
diff changeset
   469
2481
5581242ddb7d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1744
diff changeset
   470
    |windowGroup action|
413
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   471
502
0df8d2b173e4 focusKey handling now done here & in TopView
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
   472
    windowGroup := view windowGroup.
2481
5581242ddb7d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1744
diff changeset
   473
    windowGroup notNil ifTrue:[
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   474
	action := key.
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   475
	key == #Tab ifTrue:[
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   476
	    (view tabRequiresControl not
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   477
	    or:[ view sensor ctrlDown ]) ifTrue:[
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   478
		view graphicsDevice shiftDown ifTrue:[
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   479
		    action := #FocusPrevious.
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   480
		] ifFalse:[
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   481
		    action := #FocusNext.
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   482
		]
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   483
	    ]
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   484
	].
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   485
	action == #FocusNext ifTrue:[
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   486
	    windowGroup focusNext.
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   487
	].
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   488
	action == #FocusPrevious ifTrue:[
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   489
	    windowGroup focusPrevious.
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   490
	].
413
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   491
    ].
245
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   492
    ^ self
413
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   493
744
db883c9b74b8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 681
diff changeset
   494
    "Modified: 28.5.1996 / 20:21:41 / cg"
245
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   495
!
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   496
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   497
keyRelease:key x:x y:y
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   498
    "key was released in my view; nothing done here"
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   499
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   500
    ^ self
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   501
!
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   502
4857
bbfc8b071b46 delegate mouse wheel events
Stefan Vogel <sv@exept.de>
parents: 4208
diff changeset
   503
mouseWheelMotion:event x:x y:y amount:amount deltaTime:deltaTime
bbfc8b071b46 delegate mouse wheel events
Stefan Vogel <sv@exept.de>
parents: 4208
diff changeset
   504
    "a mouse wheel was turned - nothing done here"
bbfc8b071b46 delegate mouse wheel events
Stefan Vogel <sv@exept.de>
parents: 4208
diff changeset
   505
bbfc8b071b46 delegate mouse wheel events
Stefan Vogel <sv@exept.de>
parents: 4208
diff changeset
   506
    ^ self.
bbfc8b071b46 delegate mouse wheel events
Stefan Vogel <sv@exept.de>
parents: 4208
diff changeset
   507
!
bbfc8b071b46 delegate mouse wheel events
Stefan Vogel <sv@exept.de>
parents: 4208
diff changeset
   508
245
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   509
pointerEnter:state x:x y:y
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   510
    "mouse pointer entered my view; nothing done here"
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   511
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   512
    ^ self
153
claus
parents: 141
diff changeset
   513
!
claus
parents: 141
diff changeset
   514
245
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   515
pointerLeave:state
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   516
    "mouse pointer left my view; nothing done here"
153
claus
parents: 141
diff changeset
   517
245
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   518
    ^ self
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   519
! !
153
claus
parents: 141
diff changeset
   520
3884
dc9ea4cfc963 method category rename
Claus Gittinger <cg@exept.de>
parents: 3880
diff changeset
   521
!Controller methodsFor:'initialization & release'!
413
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   522
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   523
initialize
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   524
    "initialize the controller; subclasses should redefine
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   525
     this and include a super initialize for proper initialization."
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   526
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   527
    ^ self
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   528
!
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   529
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   530
release
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   531
    "close down the controller; this is sent when the view is destroyed.
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   532
     Can be redefined in subclasses to do some cleanup action. However,
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   533
     these redefined methods should do a super release."
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   534
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   535
    view notNil ifTrue:[view controller:nil].
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   536
    view := nil.
1744
0c992e0ea53b oops - release must send a super release also
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   537
    model := nil.
0c992e0ea53b oops - release must send a super release also
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   538
    super release.
0c992e0ea53b oops - release must send a super release also
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   539
0c992e0ea53b oops - release must send a super release also
Claus Gittinger <cg@exept.de>
parents: 1434
diff changeset
   540
    "Modified: 11.6.1997 / 13:18:09 / cg"
413
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   541
!
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   542
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   543
startUp
413
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   544
    "startup the controller; this is sent when the view realizes,
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   545
     right before it becomes visible.
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   546
     Can be redefined in subclasses to do some startup action."
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   547
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   548
    self controlInitialize.
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   549
! !
2bd84440febd forward Tab to the views windowGroup (if any)
Claus Gittinger <cg@exept.de>
parents: 252
diff changeset
   550
245
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   551
!Controller methodsFor:'menus'!
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   552
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   553
yellowButtonMenu
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   554
    "actually, this should be called 'middleButtonMenu'.
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   555
     But for ST-80 compatibility ...."
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   556
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   557
    |sym menuHolder m|
153
claus
parents: 141
diff changeset
   558
245
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   559
    menuHolder := self menuHolder.
153
claus
parents: 141
diff changeset
   560
245
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   561
    "
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   562
     try ST-80 style menus first:
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   563
     if there is a model, and a menuMessage is defined,
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   564
     ask model for the menu and launch that if non-nil.
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   565
    "
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   566
    (menuHolder notNil
245
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   567
    and:[(sym := view menuMessage) notNil
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   568
    and:[sym isSymbol]]) ifTrue:[
5007
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   569
	"
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   570
	 ask menuHolder (model) for the menu
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   571
	"
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   572
	(menuHolder respondsTo:sym) ifTrue:[
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   573
	    ^ menuHolder perform:sym.
bfac35f480d6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4857
diff changeset
   574
	]
153
claus
parents: 141
diff changeset
   575
    ].
245
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   576
    ^ nil
1054
b7e7ed0c35f6 dont ask valueHolders for a menu ...
Claus Gittinger <cg@exept.de>
parents: 1037
diff changeset
   577
b7e7ed0c35f6 dont ask valueHolders for a menu ...
Claus Gittinger <cg@exept.de>
parents: 1037
diff changeset
   578
    "Modified: 14.9.1996 / 13:19:34 / cg"
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   579
! !
245
86a1f74b2306 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 222
diff changeset
   580
1112
9c5c18330d61 cosmetic
ca
parents: 1073
diff changeset
   581
!Controller class methodsFor:'documentation'!
252
87bbc0f751d7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 245
diff changeset
   582
87bbc0f751d7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 245
diff changeset
   583
version
5345
b64a7f6ed325 preps for right-menu on buttonRelease
Claus Gittinger <cg@exept.de>
parents: 5007
diff changeset
   584
    ^ '$Header: /cvs/stx/stx/libview/Controller.st,v 1.57 2009-09-15 19:01:57 cg Exp $'
252
87bbc0f751d7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 245
diff changeset
   585
! !