UIObjectView.st
author ca
Fri, 17 Jan 2003 15:52:22 +0100
changeset 1672 5e89f5959780
parent 1581 d7afe06ebbae
child 1705 121213b3d4c9
permissions -rw-r--r--
no longer use InputView
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
156
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 153
diff changeset
     1
"
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 153
diff changeset
     2
 COPYRIGHT (c) 1995 by eXept Software AG
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
     3
	      All Rights Reserved
156
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 153
diff changeset
     4
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 153
diff changeset
     5
 This software is furnished under a license and may be used
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 153
diff changeset
     6
 only in accordance with the terms of that license and with the
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 153
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 153
diff changeset
     8
 be provided or otherwise made available to, or used by, any
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 153
diff changeset
     9
 other person.  No title to or ownership of the software is
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 153
diff changeset
    10
 hereby transferred.
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 153
diff changeset
    11
"
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 153
diff changeset
    12
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 153
diff changeset
    13
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 153
diff changeset
    14
1399
a0687f5e1f54 category changes
Claus Gittinger <cg@exept.de>
parents: 1350
diff changeset
    15
"{ Package: 'stx:libtool2' }"
a0687f5e1f54 category changes
Claus Gittinger <cg@exept.de>
parents: 1350
diff changeset
    16
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
    17
ObjectView subclass:#UIObjectView
1672
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
    18
	instanceVariableNames:'saveSelection undoHistory copiedExtent copiedLayout resizeData
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
    19
		clipChildren selectionHiddenLevel gridParameters
1100
bf884041701f Implement common channels in View.
Stefan Vogel <sv@exept.de>
parents: 1048
diff changeset
    20
		setOfSuperViewsSizeChanged'
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
    21
	classVariableNames:''
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
    22
	poolDictionaries:''
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
    23
	category:'Interface-UIPainter'
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
    24
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
    25
1672
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
    26
Object subclass:#PostEventHandler
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
    27
	instanceVariableNames:'onView'
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
    28
	classVariableNames:''
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
    29
	poolDictionaries:''
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
    30
	privateIn:UIObjectView
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
    31
!
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
    32
1437
daaf701ab6a2 *** empty log message ***
ca
parents: 1427
diff changeset
    33
Object subclass:#ResizeData
daaf701ab6a2 *** empty log message ***
ca
parents: 1427
diff changeset
    34
	instanceVariableNames:'object selector delta'
daaf701ab6a2 *** empty log message ***
ca
parents: 1427
diff changeset
    35
	classVariableNames:''
daaf701ab6a2 *** empty log message ***
ca
parents: 1427
diff changeset
    36
	poolDictionaries:''
daaf701ab6a2 *** empty log message ***
ca
parents: 1427
diff changeset
    37
	privateIn:UIObjectView
daaf701ab6a2 *** empty log message ***
ca
parents: 1427
diff changeset
    38
!
daaf701ab6a2 *** empty log message ***
ca
parents: 1427
diff changeset
    39
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
    40
Object subclass:#UndoHistory
134
d5ab85ec27fd undo history; keep view identifier
ca
parents: 132
diff changeset
    41
	instanceVariableNames:'startIdentifier identifier painter history transaction enabled'
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
    42
	classVariableNames:''
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
    43
	poolDictionaries:''
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
    44
	privateIn:UIObjectView
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
    45
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
    46
54
d0b5a33e6df0 *** empty log message ***
ca
parents: 52
diff changeset
    47
Object subclass:#Transaction
134
d5ab85ec27fd undo history; keep view identifier
ca
parents: 132
diff changeset
    48
	instanceVariableNames:'identifier type text actions'
54
d0b5a33e6df0 *** empty log message ***
ca
parents: 52
diff changeset
    49
	classVariableNames:''
d0b5a33e6df0 *** empty log message ***
ca
parents: 52
diff changeset
    50
	poolDictionaries:''
d0b5a33e6df0 *** empty log message ***
ca
parents: 52
diff changeset
    51
	privateIn:UIObjectView::UndoHistory
d0b5a33e6df0 *** empty log message ***
ca
parents: 52
diff changeset
    52
!
d0b5a33e6df0 *** empty log message ***
ca
parents: 52
diff changeset
    53
128
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
    54
!UIObjectView class methodsFor:'documentation'!
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
    55
156
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 153
diff changeset
    56
copyright
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 153
diff changeset
    57
"
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 153
diff changeset
    58
 COPYRIGHT (c) 1995 by eXept Software AG
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
    59
	      All Rights Reserved
156
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 153
diff changeset
    60
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 153
diff changeset
    61
 This software is furnished under a license and may be used
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 153
diff changeset
    62
 only in accordance with the terms of that license and with the
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 153
diff changeset
    63
 inclusion of the above copyright notice.   This software may not
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 153
diff changeset
    64
 be provided or otherwise made available to, or used by, any
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 153
diff changeset
    65
 other person.  No title to or ownership of the software is
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 153
diff changeset
    66
 hereby transferred.
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 153
diff changeset
    67
"
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 153
diff changeset
    68
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 153
diff changeset
    69
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 153
diff changeset
    70
!
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 153
diff changeset
    71
128
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
    72
documentation
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
    73
"
131
715b3dbba87d selection handling changed
ca
parents: 128
diff changeset
    74
    buildIn view used by the UIPainter; it provides all services for creating, deleting
715b3dbba87d selection handling changed
ca
parents: 128
diff changeset
    75
    moving and changing layouts of painted components on a canvas.
128
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
    76
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
    77
    [see also:]
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
    78
	UIBuilder
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
    79
	UIPainterView
156
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 153
diff changeset
    80
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 153
diff changeset
    81
    [author:]
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
    82
	Claus Atzkern
128
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
    83
"
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
    84
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
    85
! !
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
    86
63
6714daee4b26 checkin from browser
ca
parents: 61
diff changeset
    87
!UIObjectView class methodsFor:'conversion'!
6714daee4b26 checkin from browser
ca
parents: 61
diff changeset
    88
6714daee4b26 checkin from browser
ca
parents: 61
diff changeset
    89
asLayoutFrameFromView:aView
6714daee4b26 checkin from browser
ca
parents: 61
diff changeset
    90
    "convert layout from aView to a frameLayout. On success the frameLayout is
6714daee4b26 checkin from browser
ca
parents: 61
diff changeset
    91
     returned otherwise nil
6714daee4b26 checkin from browser
ca
parents: 61
diff changeset
    92
    "
68
889c3877baf0 layout ....
ca
parents: 67
diff changeset
    93
    |lF lO rF rO tF tO bF bO type layout newLyt|
889c3877baf0 layout ....
ca
parents: 67
diff changeset
    94
889c3877baf0 layout ....
ca
parents: 67
diff changeset
    95
    type   := self layoutType:aView.
889c3877baf0 layout ....
ca
parents: 67
diff changeset
    96
    layout := aView geometryLayout.
889c3877baf0 layout ....
ca
parents: 67
diff changeset
    97
91
86d0c649f95e extent -> layout
Claus Gittinger <cg@exept.de>
parents: 89
diff changeset
    98
    layout isNil ifTrue:[
1581
d7afe06ebbae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1577
diff changeset
    99
        type == #Extent ifTrue:[
d7afe06ebbae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1577
diff changeset
   100
            layout := aView bounds asLayout
d7afe06ebbae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1577
diff changeset
   101
        ]
91
86d0c649f95e extent -> layout
Claus Gittinger <cg@exept.de>
parents: 89
diff changeset
   102
    ].
86d0c649f95e extent -> layout
Claus Gittinger <cg@exept.de>
parents: 89
diff changeset
   103
68
889c3877baf0 layout ....
ca
parents: 67
diff changeset
   104
    (type isNil or:[layout isNil]) ifTrue:[
1581
d7afe06ebbae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1577
diff changeset
   105
        ^ nil
63
6714daee4b26 checkin from browser
ca
parents: 61
diff changeset
   106
    ].
6714daee4b26 checkin from browser
ca
parents: 61
diff changeset
   107
68
889c3877baf0 layout ....
ca
parents: 67
diff changeset
   108
    type == #LayoutFrame ifTrue:[
1581
d7afe06ebbae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1577
diff changeset
   109
        ^ layout copy
68
889c3877baf0 layout ....
ca
parents: 67
diff changeset
   110
    ].
889c3877baf0 layout ....
ca
parents: 67
diff changeset
   111
889c3877baf0 layout ....
ca
parents: 67
diff changeset
   112
    layout isLayout ifFalse:[
1581
d7afe06ebbae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1577
diff changeset
   113
        type == #Rectangle ifTrue:[
d7afe06ebbae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1577
diff changeset
   114
            lO := layout left.
d7afe06ebbae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1577
diff changeset
   115
            tO := layout top.
d7afe06ebbae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1577
diff changeset
   116
            rO := layout right.
d7afe06ebbae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1577
diff changeset
   117
            bO := layout bottom.
d7afe06ebbae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1577
diff changeset
   118
        ] ifFalse:[
d7afe06ebbae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1577
diff changeset
   119
            lO := layout x.
d7afe06ebbae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1577
diff changeset
   120
            tO := layout y.
d7afe06ebbae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1577
diff changeset
   121
            rO := lO + aView extent x.
d7afe06ebbae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1577
diff changeset
   122
            bO := tO + aView extent y.
d7afe06ebbae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1577
diff changeset
   123
        ].
d7afe06ebbae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1577
diff changeset
   124
d7afe06ebbae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1577
diff changeset
   125
        ^ LayoutFrame 
d7afe06ebbae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1577
diff changeset
   126
                leftFraction:0 offset:lO  
d7afe06ebbae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1577
diff changeset
   127
                rightFraction:0 offset:rO
d7afe06ebbae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1577
diff changeset
   128
                topFraction:0 offset:tO 
d7afe06ebbae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1577
diff changeset
   129
                bottomFraction:0 offset:bO
63
6714daee4b26 checkin from browser
ca
parents: 61
diff changeset
   130
    ].
6714daee4b26 checkin from browser
ca
parents: 61
diff changeset
   131
68
889c3877baf0 layout ....
ca
parents: 67
diff changeset
   132
    lF := layout leftFraction.
889c3877baf0 layout ....
ca
parents: 67
diff changeset
   133
    lO := layout leftOffset.
889c3877baf0 layout ....
ca
parents: 67
diff changeset
   134
    tF := layout topFraction.
889c3877baf0 layout ....
ca
parents: 67
diff changeset
   135
    tO := layout topOffset.
889c3877baf0 layout ....
ca
parents: 67
diff changeset
   136
    bF := tF.
889c3877baf0 layout ....
ca
parents: 67
diff changeset
   137
    bO := tO + aView extent y.
889c3877baf0 layout ....
ca
parents: 67
diff changeset
   138
    rF := lF.
889c3877baf0 layout ....
ca
parents: 67
diff changeset
   139
    rO := lO + aView extent x.
889c3877baf0 layout ....
ca
parents: 67
diff changeset
   140
1581
d7afe06ebbae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1577
diff changeset
   141
    newLyt := LayoutFrame 
d7afe06ebbae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1577
diff changeset
   142
                leftFraction:lF offset:lO  
d7afe06ebbae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1577
diff changeset
   143
                rightFraction:rF offset:rO
d7afe06ebbae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1577
diff changeset
   144
                topFraction:tF offset:tO 
d7afe06ebbae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1577
diff changeset
   145
                bottomFraction:bF offset:bO.
68
889c3877baf0 layout ....
ca
parents: 67
diff changeset
   146
889c3877baf0 layout ....
ca
parents: 67
diff changeset
   147
    (    (type == #AlignmentOrigin)
889c3877baf0 layout ....
ca
parents: 67
diff changeset
   148
     and:[layout leftAlignmentFraction ~~ 0
889c3877baf0 layout ....
ca
parents: 67
diff changeset
   149
      or:[layout topAlignmentFraction  ~~ 0]]
889c3877baf0 layout ....
ca
parents: 67
diff changeset
   150
    ) ifTrue:[
1581
d7afe06ebbae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1577
diff changeset
   151
        |svRc prBd dlta|
d7afe06ebbae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1577
diff changeset
   152
d7afe06ebbae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1577
diff changeset
   153
        svRc := aView superView viewRectangle.
d7afe06ebbae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1577
diff changeset
   154
        prBd := aView preferredBounds.
d7afe06ebbae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1577
diff changeset
   155
        dlta := (  ((layout rectangleRelativeTo:svRc preferred:prBd) corner)
d7afe06ebbae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1577
diff changeset
   156
                 - ((newLyt rectangleRelativeTo:svRc preferred:prBd) corner)
d7afe06ebbae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1577
diff changeset
   157
                ) rounded.
d7afe06ebbae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1577
diff changeset
   158
d7afe06ebbae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1577
diff changeset
   159
        newLyt 
d7afe06ebbae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1577
diff changeset
   160
            leftOffset:(lO + dlta x)
d7afe06ebbae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1577
diff changeset
   161
            rightOffset:(rO + dlta x)
d7afe06ebbae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1577
diff changeset
   162
            topOffset:(tO + dlta y)
d7afe06ebbae *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1577
diff changeset
   163
            bottomOffset:(bO + dlta y).
68
889c3877baf0 layout ....
ca
parents: 67
diff changeset
   164
    ].
889c3877baf0 layout ....
ca
parents: 67
diff changeset
   165
  ^ newLyt.
91
86d0c649f95e extent -> layout
Claus Gittinger <cg@exept.de>
parents: 89
diff changeset
   166
86d0c649f95e extent -> layout
Claus Gittinger <cg@exept.de>
parents: 89
diff changeset
   167
    "Modified: 28.3.1997 / 19:52:48 / cg"
63
6714daee4b26 checkin from browser
ca
parents: 61
diff changeset
   168
! !
6714daee4b26 checkin from browser
ca
parents: 61
diff changeset
   169
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   170
!UIObjectView class methodsFor:'defaults'!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   171
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   172
defaultGrid
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   173
    ^ 4 @ 4
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   174
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   175
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   176
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   177
gridShown
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   178
    ^ false
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   179
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   180
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   181
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   182
handleSize
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   183
    "size of blob drawn for handles"
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   184
    ^ 4
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   185
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   186
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   187
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   188
hitDelta
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   189
    ^ 4
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   190
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   191
! !
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   192
175
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   193
!UIObjectView class methodsFor:'handles'!
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   194
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   195
handlesOf:aView do:aBlock
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   196
    |type v h|
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   197
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   198
    type := self layoutType:aView.
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   199
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   200
    (type == #LayoutFrame or:[type == #Rectangle]) ifTrue:[
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   201
	v := self isVerticalResizable:aView.
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   202
	h := self isHorizontalResizable:aView.
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   203
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   204
	h ifTrue:[  aBlock value:(aView leftCenter ) value:#left.
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   205
		    aBlock value:(aView rightCenter) value:#right.
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   206
		 ].
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   207
	v ifTrue:[  aBlock value:(aView topCenter   ) value:#top.
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   208
		    aBlock value:(aView bottomCenter) value:#bottom.
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   209
		 ].
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   210
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   211
	(h and:[v]) ifTrue:[
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   212
	    aBlock value:(aView origin    ) value:#origin.
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   213
	    aBlock value:(aView topRight  ) value:#topRight.
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   214
	    aBlock value:(aView bottomLeft) value:#bottomLeft.
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   215
	    aBlock value:(aView corner    ) value:#corner.
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   216
	  ^ self
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   217
	]
175
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   218
    ].
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   219
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   220
    aBlock value:(aView origin    ) value:#view.
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   221
    aBlock value:(aView topRight  ) value:#view.
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   222
    aBlock value:(aView bottomLeft) value:#view.
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   223
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   224
    type == #Extent ifTrue:[
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   225
	v := self isVerticalResizable:aView.
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   226
	h := self isHorizontalResizable:aView.
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   227
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   228
	v ifTrue:[aBlock value:(aView bottomCenter) value:#bottom].
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   229
	h ifTrue:[aBlock value:(aView rightCenter ) value:#right ].
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   230
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   231
	(h and:[v]) ifTrue:[
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   232
	    aBlock value:(aView corner) value:#corner.
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   233
	  ^ self
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   234
	]
175
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   235
    ].
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   236
    aBlock value:(aView corner) value:#view.
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   237
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   238
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   239
! !
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   240
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   241
!UIObjectView class methodsFor:'queries'!
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   242
175
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   243
isHorizontalResizable:aComponent
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   244
    "returns true if instance is horizontal resizeable
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   245
    "
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   246
    (aComponent isKindOf:ScrollBar) ifTrue:[
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   247
	^ aComponent orientation == #horizontal
175
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   248
    ].
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   249
    (aComponent isKindOf:Scroller) ifTrue:[
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   250
	^ aComponent orientation == #horizontal
175
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   251
    ].
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   252
    (aComponent isKindOf:Slider) ifTrue:[
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   253
	^ aComponent orientation == #horizontal
175
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   254
    ].
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   255
    ^ true
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   256
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   257
!
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   258
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   259
isVerticalResizable:aComponent
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   260
    "returns true if instance is vertical resizeable
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   261
    "
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   262
    (aComponent isKindOf:EditField) ifTrue:[
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   263
	^ false
175
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   264
    ].
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   265
    (aComponent isKindOf:ComboBoxView) ifTrue:[
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   266
	^ false
175
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   267
    ].
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   268
    (aComponent isKindOf:CheckBox) ifTrue:[
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   269
	^ false
175
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   270
    ].
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   271
    (aComponent isKindOf:ScrollBar) ifTrue:[
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   272
	^ aComponent orientation == #vertical
175
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   273
    ].
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   274
    (aComponent isKindOf:Scroller) ifTrue:[
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   275
	^ aComponent orientation == #vertical
175
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   276
    ].
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   277
    (aComponent isKindOf:Slider) ifTrue:[
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   278
	^ aComponent orientation == #vertical
175
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   279
    ].
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   280
    ^ true
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   281
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   282
!
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   283
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   284
layoutType:aView
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   285
    "returns layout type of aView or nil
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   286
    "
113
1854c2e61c4e bug fixes
ca
parents: 100
diff changeset
   287
    |layout spec superView|
1854c2e61c4e bug fixes
ca
parents: 100
diff changeset
   288
1854c2e61c4e bug fixes
ca
parents: 100
diff changeset
   289
    aView notNil ifTrue:[
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   290
	layout := aView geometryLayout.
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   291
	layout notNil ifTrue:[
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   292
	    layout isLayout ifTrue:[
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   293
		layout isLayoutFrame        ifTrue:[ ^ #LayoutFrame ].
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   294
		layout isAlignmentOrigin    ifTrue:[ ^ #AlignmentOrigin ].
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   295
		layout isLayoutOrigin       ifTrue:[ ^ #LayoutOrigin ].
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   296
	    ] ifFalse:[
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   297
		layout isRectangle          ifTrue:[ ^ #Rectangle ].
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   298
		layout isPoint              ifTrue:[ ^ #Point ].
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   299
	    ]
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   300
	] ifFalse:[
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   301
	    (superView := aView superView) notNil ifTrue:[
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   302
		spec := superView specClass.
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   303
		spec canResizeSubComponents ifTrue:[
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   304
		    ^ #Extent
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   305
		]
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   306
	    ]
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   307
	]
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   308
    ].
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   309
    ^ nil
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   310
67
09e9d4b57142 alignmentLayout
Claus Gittinger <cg@exept.de>
parents: 63
diff changeset
   311
    "Modified: 28.2.1997 / 13:02:16 / cg"
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   312
! !
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   313
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   314
!UIObjectView methodsFor:'accessing'!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   315
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   316
gridAlign
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   317
    "returns state of aligning to grid
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   318
    "
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   319
    ^ aligning
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   320
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   321
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   322
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   323
gridAlign:aBool
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   324
    "change state of aligning to grid
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   325
    "
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   326
    aBool ifTrue:[self alignOn]
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   327
	 ifFalse:[self alignOff]
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   328
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   329
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   330
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   331
gridParameters
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   332
    "used by defineGrid, and in a separate method for
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   333
     easier redefinition in subclasses. 
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   334
     Returns the grid parameters in an array of 7 elements,
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   335
     which control the appearance of the grid-pattern.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   336
     the elements are:
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   337
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   338
	bigStepH        number of pixels horizontally between 2 major steps
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   339
	bigStepV        number of pixels vertically between 2 major steps
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   340
	littleStepH     number of pixels horizontally between 2 minor steps
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   341
	littleStepV     number of pixels vertically between 2 minor steps
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   342
	gridAlignH      number of pixels for horizontal grid align (pointer snap)
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   343
	gridAlignV      number of pixels for vertical grid align (pointer snap)
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   344
	docBounds       true, if document boundary should be shown
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   345
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   346
     if littleStepH/V are nil, only bigSteps are drawn.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   347
    "
360
1a4ec4aa2c67 configuration of grid parameters
ca
parents: 353
diff changeset
   348
    gridParameters isNil ifTrue:[
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   349
	gridParameters := #(10 10 nil nil 10 10 false)
360
1a4ec4aa2c67 configuration of grid parameters
ca
parents: 353
diff changeset
   350
    ].
1a4ec4aa2c67 configuration of grid parameters
ca
parents: 353
diff changeset
   351
    ^ gridParameters
1a4ec4aa2c67 configuration of grid parameters
ca
parents: 353
diff changeset
   352
1a4ec4aa2c67 configuration of grid parameters
ca
parents: 353
diff changeset
   353
1a4ec4aa2c67 configuration of grid parameters
ca
parents: 353
diff changeset
   354
!
1a4ec4aa2c67 configuration of grid parameters
ca
parents: 353
diff changeset
   355
1a4ec4aa2c67 configuration of grid parameters
ca
parents: 353
diff changeset
   356
gridParameters:newGridParameters
1a4ec4aa2c67 configuration of grid parameters
ca
parents: 353
diff changeset
   357
    "used by defineGrid, and in a separate method for
1a4ec4aa2c67 configuration of grid parameters
ca
parents: 353
diff changeset
   358
     easier redefinition in subclasses. 
1a4ec4aa2c67 configuration of grid parameters
ca
parents: 353
diff changeset
   359
     Returns the grid parameters in an array of 7 elements,
1a4ec4aa2c67 configuration of grid parameters
ca
parents: 353
diff changeset
   360
     which control the appearance of the grid-pattern.
1a4ec4aa2c67 configuration of grid parameters
ca
parents: 353
diff changeset
   361
     the elements are:
1a4ec4aa2c67 configuration of grid parameters
ca
parents: 353
diff changeset
   362
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   363
	bigStepH        number of pixels horizontally between 2 major steps
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   364
	bigStepV        number of pixels vertically between 2 major steps
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   365
	littleStepH     number of pixels horizontally between 2 minor steps
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   366
	littleStepV     number of pixels vertically between 2 minor steps
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   367
	gridAlignH      number of pixels for horizontal grid align (pointer snap)
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   368
	gridAlignV      number of pixels for vertical grid align (pointer snap)
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   369
	docBounds       true, if document boundary should be shown
360
1a4ec4aa2c67 configuration of grid parameters
ca
parents: 353
diff changeset
   370
1a4ec4aa2c67 configuration of grid parameters
ca
parents: 353
diff changeset
   371
     if littleStepH/V are nil, only bigSteps are drawn.
1a4ec4aa2c67 configuration of grid parameters
ca
parents: 353
diff changeset
   372
    "
1a4ec4aa2c67 configuration of grid parameters
ca
parents: 353
diff changeset
   373
    newGridParameters size == 7 ifTrue:[
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   374
	gridParameters := newGridParameters
360
1a4ec4aa2c67 configuration of grid parameters
ca
parents: 353
diff changeset
   375
    ].
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   376
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   377
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   378
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   379
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   380
gridShown:aBool
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   381
    "change visibility of grid
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   382
    "
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   383
    aBool ifTrue:[self showGrid]
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   384
	 ifFalse:[self hideGrid]
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   385
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   386
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   387
hideGrid
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   388
    "hide grid
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   389
    "
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   390
    gridShown ifTrue:[
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   391
	self withSelectionHiddenDo:[super hideGrid]
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   392
    ]
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   393
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   394
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   395
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   396
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   397
showGrid
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   398
    "show grid
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   399
    "
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   400
    self withSelectionHiddenDo:[super showGrid]
119
39acd704ad51 testMode is now a ValueHolder
ca
parents: 113
diff changeset
   401
! !
39acd704ad51 testMode is now a ValueHolder
ca
parents: 113
diff changeset
   402
1399
a0687f5e1f54 category changes
Claus Gittinger <cg@exept.de>
parents: 1350
diff changeset
   403
!UIObjectView methodsFor:'accessing-behavior'!
119
39acd704ad51 testMode is now a ValueHolder
ca
parents: 113
diff changeset
   404
1100
bf884041701f Implement common channels in View.
Stefan Vogel <sv@exept.de>
parents: 1048
diff changeset
   405
enableStateChanged
bf884041701f Implement common channels in View.
Stefan Vogel <sv@exept.de>
parents: 1048
diff changeset
   406
    "set the modification / test mode
bf884041701f Implement common channels in View.
Stefan Vogel <sv@exept.de>
parents: 1048
diff changeset
   407
    "
1102
abcdd3d5a67b testMode enable/disable
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
   408
    self shown ifTrue:[
1672
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   409
        enableChannel value ifFalse:[
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   410
            saveSelection := selection.
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   411
            self hideSelection.
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   412
            selection := nil.
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   413
        ] ifTrue:[
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   414
            selection := saveSelection.
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   415
            self showSelection
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   416
        ]
1100
bf884041701f Implement common channels in View.
Stefan Vogel <sv@exept.de>
parents: 1048
diff changeset
   417
    ]
bf884041701f Implement common channels in View.
Stefan Vogel <sv@exept.de>
parents: 1048
diff changeset
   418
bf884041701f Implement common channels in View.
Stefan Vogel <sv@exept.de>
parents: 1048
diff changeset
   419
    "Created: / 30.3.1999 / 16:17:24 / stefan"
bf884041701f Implement common channels in View.
Stefan Vogel <sv@exept.de>
parents: 1048
diff changeset
   420
!
bf884041701f Implement common channels in View.
Stefan Vogel <sv@exept.de>
parents: 1048
diff changeset
   421
119
39acd704ad51 testMode is now a ValueHolder
ca
parents: 113
diff changeset
   422
enabled
39acd704ad51 testMode is now a ValueHolder
ca
parents: 113
diff changeset
   423
    ^ enableChannel value
39acd704ad51 testMode is now a ValueHolder
ca
parents: 113
diff changeset
   424
!
39acd704ad51 testMode is now a ValueHolder
ca
parents: 113
diff changeset
   425
39acd704ad51 testMode is now a ValueHolder
ca
parents: 113
diff changeset
   426
enabled:aState
39acd704ad51 testMode is now a ValueHolder
ca
parents: 113
diff changeset
   427
    "set the modification / test mode
39acd704ad51 testMode is now a ValueHolder
ca
parents: 113
diff changeset
   428
    "
1100
bf884041701f Implement common channels in View.
Stefan Vogel <sv@exept.de>
parents: 1048
diff changeset
   429
bf884041701f Implement common channels in View.
Stefan Vogel <sv@exept.de>
parents: 1048
diff changeset
   430
    enableChannel value:aState
bf884041701f Implement common channels in View.
Stefan Vogel <sv@exept.de>
parents: 1048
diff changeset
   431
bf884041701f Implement common channels in View.
Stefan Vogel <sv@exept.de>
parents: 1048
diff changeset
   432
    "Modified: / 30.3.1999 / 16:18:12 / stefan"
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   433
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   434
134
d5ab85ec27fd undo history; keep view identifier
ca
parents: 132
diff changeset
   435
resetModification
d5ab85ec27fd undo history; keep view identifier
ca
parents: 132
diff changeset
   436
    "set modification state to false
d5ab85ec27fd undo history; keep view identifier
ca
parents: 132
diff changeset
   437
    "
d5ab85ec27fd undo history; keep view identifier
ca
parents: 132
diff changeset
   438
    undoHistory resetModification
d5ab85ec27fd undo history; keep view identifier
ca
parents: 132
diff changeset
   439
!
d5ab85ec27fd undo history; keep view identifier
ca
parents: 132
diff changeset
   440
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   441
testMode
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   442
    "returns true if running test
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   443
    "
119
39acd704ad51 testMode is now a ValueHolder
ca
parents: 113
diff changeset
   444
    ^ enableChannel value not
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   445
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   446
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   447
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   448
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   449
testMode:aBoolean
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   450
    "change test mode
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   451
    "
1102
abcdd3d5a67b testMode enable/disable
Claus Gittinger <cg@exept.de>
parents: 1100
diff changeset
   452
    enableChannel value:(aBoolean not)
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   453
! !
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   454
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   455
!UIObjectView methodsFor:'blocked'!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   456
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   457
addObject:anObject
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   458
    "add the argument, anObject to the contents - with redraw
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   459
    "
1112
761e38b891e6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
   460
    self halt:'should not be invoked'
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   461
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   462
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   463
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   464
addObjectWithoutRedraw:anObject
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   465
    "add the argument, anObject to the contents - with redraw
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   466
    "
1112
761e38b891e6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
   467
    self halt:'should not be invoked'
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   468
175
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   469
!
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   470
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   471
startCreate:aPoint
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   472
    self setDefaultActions.
1112
761e38b891e6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
   473
    self halt:'should not be invoked'
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   474
! !
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   475
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   476
!UIObjectView methodsFor:'event handling'!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   477
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   478
elementChangedSize:aView
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   479
    "some element has changed its size; collect them during selectionHiddenLevel 
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   480
     is on
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   481
    "
284
995078a58977 show the selection after mapping the view
ca
parents: 251
diff changeset
   482
    |spv|
995078a58977 show the selection after mapping the view
ca
parents: 251
diff changeset
   483
995078a58977 show the selection after mapping the view
ca
parents: 251
diff changeset
   484
    spv := self findContainerOfView:aView.
995078a58977 show the selection after mapping the view
ca
parents: 251
diff changeset
   485
995078a58977 show the selection after mapping the view
ca
parents: 251
diff changeset
   486
    selectionHiddenLevel ~~ 0 ifTrue:[setOfSuperViewsSizeChanged add:spv]
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   487
			     ifFalse:[spv sizeChanged:nil]
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   488
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   489
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   490
exposeX:x y:y width:w height:h
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   491
    "handle an expose event from device; redraw selection
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   492
    "
175
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   493
    resizeData isNil ifTrue:[
1672
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   494
        super exposeX:x y:y width:w height:h.
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   495
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   496
        "/ handle any expose events (for subcomponents) before
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   497
        "/ redrawing the handles.
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   498
        (self sensor hasExposeEventFor:nil) ifTrue:[^ self].
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   499
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   500
        self selectionDo:[:aComponent |
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   501
            aComponent withAllSubViewsDo:[:v |
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   502
                v realized ifTrue:[
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   503
                    self sensor flushExposeEventsFor:v.
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   504
                    v exposeX:0 y:0 width:v width height:v height.
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   505
                ]
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   506
            ].
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   507
            self showSelected:aComponent
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   508
        ]
993
88a214788277 reenabled old showUnselected code.
Claus Gittinger <cg@exept.de>
parents: 967
diff changeset
   509
    ].
88a214788277 reenabled old showUnselected code.
Claus Gittinger <cg@exept.de>
parents: 967
diff changeset
   510
1016
2660d468dc61 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 997
diff changeset
   511
    "Modified: / 9.11.1998 / 12:50:34 / cg"
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   512
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   513
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   514
keyPress:key x:x y:y
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   515
    "any key pressed
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   516
    "
1048
d6d4b7abfdd0 +cursorKeys to move widgets
Claus Gittinger <cg@exept.de>
parents: 1016
diff changeset
   517
    <resource: #keyboard ( #CursorUp #CursorDown #CursorLeft #CursorRight
1222
bcb8b0ec295c collect cursor events for widget move;
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
   518
                           #Delete #BackSpace #Cut #Copy #Paste #Cmdu ) >
bcb8b0ec295c collect cursor events for widget move;
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
   519
bcb8b0ec295c collect cursor events for widget move;
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
   520
    |n sensor|
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   521
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   522
    (key == #Cut or:[key == #Delete or:[key == #BackSpace]]) ifTrue: [
1222
bcb8b0ec295c collect cursor events for widget move;
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
   523
        ^ self deleteSelection
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   524
    ].
78
a0a00603a8b6 keep spec in properties
ca
parents: 76
diff changeset
   525
    key == #Copy  ifTrue:[ ^ self copySelection].
a0a00603a8b6 keep spec in properties
ca
parents: 76
diff changeset
   526
    key == #Paste ifTrue:[ ^ self pasteBuffer].
360
1a4ec4aa2c67 configuration of grid parameters
ca
parents: 353
diff changeset
   527
    key == #Cmdu  ifTrue:[ ^ self undoLast ].           "/ #Undo
1a4ec4aa2c67 configuration of grid parameters
ca
parents: 353
diff changeset
   528
1222
bcb8b0ec295c collect cursor events for widget move;
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
   529
    ( #(CursorUp CursorDown CursorRight CursorLeft)
bcb8b0ec295c collect cursor events for widget move;
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
   530
    includes:key) ifTrue:[
bcb8b0ec295c collect cursor events for widget move;
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
   531
        (sensor := self sensor) isNil ifTrue:[
bcb8b0ec295c collect cursor events for widget move;
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
   532
            n := 1
bcb8b0ec295c collect cursor events for widget move;
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
   533
        ] ifFalse:[
bcb8b0ec295c collect cursor events for widget move;
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
   534
            n := 1 + (sensor compressKeyPressEventsWithKey:key).
bcb8b0ec295c collect cursor events for widget move;
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
   535
            sensor shiftDown ifTrue:[
bcb8b0ec295c collect cursor events for widget move;
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
   536
                n := n * 10.
bcb8b0ec295c collect cursor events for widget move;
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
   537
            ].
bcb8b0ec295c collect cursor events for widget move;
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
   538
        ].
bcb8b0ec295c collect cursor events for widget move;
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
   539
bcb8b0ec295c collect cursor events for widget move;
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
   540
        key == #CursorUp ifTrue:[
bcb8b0ec295c collect cursor events for widget move;
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
   541
            ^ self moveSelectionUp:n
bcb8b0ec295c collect cursor events for widget move;
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
   542
        ].
bcb8b0ec295c collect cursor events for widget move;
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
   543
        key == #CursorDown ifTrue:[
bcb8b0ec295c collect cursor events for widget move;
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
   544
            ^ self moveSelectionDown:n
bcb8b0ec295c collect cursor events for widget move;
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
   545
        ].
bcb8b0ec295c collect cursor events for widget move;
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
   546
        key == #CursorRight ifTrue:[
bcb8b0ec295c collect cursor events for widget move;
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
   547
            ^ self moveSelectionRight:n
bcb8b0ec295c collect cursor events for widget move;
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
   548
        ].
bcb8b0ec295c collect cursor events for widget move;
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
   549
        key == #CursorLeft ifTrue:[
bcb8b0ec295c collect cursor events for widget move;
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
   550
            ^ self moveSelectionLeft:n
bcb8b0ec295c collect cursor events for widget move;
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
   551
        ].
bcb8b0ec295c collect cursor events for widget move;
Claus Gittinger <cg@exept.de>
parents: 1120
diff changeset
   552
    ].
374
421f8a3723f1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 360
diff changeset
   553
    super keyPress:key x:x y:y
421f8a3723f1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 360
diff changeset
   554
1048
d6d4b7abfdd0 +cursorKeys to move widgets
Claus Gittinger <cg@exept.de>
parents: 1016
diff changeset
   555
    "Modified: / 6.3.1999 / 22:47:48 / cg"
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   556
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   557
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   558
processEvent:anEvent
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   559
    "catch expose events for components, and redraw its handles after
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   560
     the redraw when this happens
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   561
    "
1672
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   562
    |evView x y p|
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   563
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   564
    self testMode ifTrue:[^ false].
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   565
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   566
    evView := anEvent view.
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   567
    (evView isNil or:[evView == self]) ifTrue:[
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   568
        ^ false
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   569
    ].
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   570
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   571
    (evView isComponentOf:self) ifFalse:[
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   572
        ^ false
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   573
    ].
1672
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   574
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   575
    anEvent isInputEvent ifFalse:[
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   576
        "/ #isDamage: handled in PostEventHandler
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   577
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   578
"/        (shown and:[anEvent isDamage]) ifTrue:[
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   579
"/            (self isSelected:evView) ifTrue:[
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   580
"/                self showSelected:evView
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   581
"/            ].
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   582
"/        ].
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   583
        ^ false
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   584
    ].
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   585
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   586
    (anEvent isButtonEvent or:[anEvent isKeyEvent])  ifFalse:[
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   587
        ^ true
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   588
    ].
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   589
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   590
    x := anEvent x.
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   591
    y := anEvent y.
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   592
    p := device translatePoint:(x@y) fromView:evView toView:self.
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   593
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   594
    "/ patch the event
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   595
    anEvent x:p x.
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   596
    anEvent y:p y.
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   597
    anEvent view:self.
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   598
    ^ false.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   599
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   600
624
26e7978936fc ignore redraws - components redraw themself.
Claus Gittinger <cg@exept.de>
parents: 543
diff changeset
   601
redrawX:nx y:ny width:nw height:nh
26e7978936fc ignore redraws - components redraw themself.
Claus Gittinger <cg@exept.de>
parents: 543
diff changeset
   602
    "ignore redraws - my components redraw themself
26e7978936fc ignore redraws - components redraw themself.
Claus Gittinger <cg@exept.de>
parents: 543
diff changeset
   603
    "
26e7978936fc ignore redraws - components redraw themself.
Claus Gittinger <cg@exept.de>
parents: 543
diff changeset
   604
!
26e7978936fc ignore redraws - components redraw themself.
Claus Gittinger <cg@exept.de>
parents: 543
diff changeset
   605
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   606
sizeChanged:how
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   607
    "size of a view(s) changed
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   608
    "
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   609
    self withSelectionHiddenDo:[
1672
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   610
        super sizeChanged:how.
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   611
    ].
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   612
! !
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   613
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   614
!UIObjectView methodsFor:'initialization'!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   615
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   616
initialize
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   617
    "setup attributes
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   618
    "
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   619
    super initialize.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   620
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   621
    setOfSuperViewsSizeChanged := IdentitySet new.
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   622
    self setDefaultActions.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   623
134
d5ab85ec27fd undo history; keep view identifier
ca
parents: 132
diff changeset
   624
    undoHistory          := UndoHistory on:self.
1100
bf884041701f Implement common channels in View.
Stefan Vogel <sv@exept.de>
parents: 1048
diff changeset
   625
    self enableChannel:(true asValue).
119
39acd704ad51 testMode is now a ValueHolder
ca
parents: 113
diff changeset
   626
    clipChildren         := true.
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   627
    selectionHiddenLevel := 0.
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   628
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   629
    (self class gridShown) ifTrue:[
1672
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   630
        super showGrid
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   631
    ].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   632
897
43f9bdc12ae4 make certain inputView is on top when restarting from a snapshot
Claus Gittinger <cg@exept.de>
parents: 777
diff changeset
   633
    "Modified: / 20.7.1998 / 18:14:51 / cg"
1100
bf884041701f Implement common channels in View.
Stefan Vogel <sv@exept.de>
parents: 1048
diff changeset
   634
    "Modified: / 30.3.1999 / 16:19:15 / stefan"
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   635
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   636
284
995078a58977 show the selection after mapping the view
ca
parents: 251
diff changeset
   637
map
995078a58977 show the selection after mapping the view
ca
parents: 251
diff changeset
   638
    "make the view visible on the screen and in case of a none empty
995078a58977 show the selection after mapping the view
ca
parents: 251
diff changeset
   639
     selection the selection will be shown.
995078a58977 show the selection after mapping the view
ca
parents: 251
diff changeset
   640
    "
995078a58977 show the selection after mapping the view
ca
parents: 251
diff changeset
   641
    super map.
995078a58977 show the selection after mapping the view
ca
parents: 251
diff changeset
   642
    self showSelection.
995078a58977 show the selection after mapping the view
ca
parents: 251
diff changeset
   643
!
995078a58977 show the selection after mapping the view
ca
parents: 251
diff changeset
   644
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   645
realize
1672
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   646
    |windowGroup|
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   647
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   648
    super realize.
1672
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   649
    windowGroup := self windowGroup.
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   650
    windowGroup  addPreEventHook:self.
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
   651
    windowGroup addPostEventHook:(PostEventHandler new onView:self).
897
43f9bdc12ae4 make certain inputView is on top when restarting from a snapshot
Claus Gittinger <cg@exept.de>
parents: 777
diff changeset
   652
!
43f9bdc12ae4 make certain inputView is on top when restarting from a snapshot
Claus Gittinger <cg@exept.de>
parents: 777
diff changeset
   653
43f9bdc12ae4 make certain inputView is on top when restarting from a snapshot
Claus Gittinger <cg@exept.de>
parents: 777
diff changeset
   654
remap
43f9bdc12ae4 make certain inputView is on top when restarting from a snapshot
Claus Gittinger <cg@exept.de>
parents: 777
diff changeset
   655
    "make the view visible on the screen and in case of a none empty
43f9bdc12ae4 make certain inputView is on top when restarting from a snapshot
Claus Gittinger <cg@exept.de>
parents: 777
diff changeset
   656
     selection the selection will be shown.
43f9bdc12ae4 make certain inputView is on top when restarting from a snapshot
Claus Gittinger <cg@exept.de>
parents: 777
diff changeset
   657
    "
43f9bdc12ae4 make certain inputView is on top when restarting from a snapshot
Claus Gittinger <cg@exept.de>
parents: 777
diff changeset
   658
    super remap.
1112
761e38b891e6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1102
diff changeset
   659
    self halt:'should not be invoked'
897
43f9bdc12ae4 make certain inputView is on top when restarting from a snapshot
Claus Gittinger <cg@exept.de>
parents: 777
diff changeset
   660
43f9bdc12ae4 make certain inputView is on top when restarting from a snapshot
Claus Gittinger <cg@exept.de>
parents: 777
diff changeset
   661
    "Created: / 20.7.1998 / 18:08:48 / cg"
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   662
! !
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   663
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   664
!UIObjectView methodsFor:'misc'!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   665
175
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   666
invertOutlineOf:something
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   667
    "invert outline of an object or collection of objects
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   668
    "
993
88a214788277 reenabled old showUnselected code.
Claus Gittinger <cg@exept.de>
parents: 967
diff changeset
   669
    |wasClipped|
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   670
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   671
    (wasClipped := clipChildren) ifTrue:[
1451
f7c591a04f00 drag resize: wait for expose before continue
ca
parents: 1438
diff changeset
   672
        self clippedByChildren:(clipChildren := false).
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   673
    ].
175
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   674
993
88a214788277 reenabled old showUnselected code.
Claus Gittinger <cg@exept.de>
parents: 967
diff changeset
   675
    self xoring:[
1451
f7c591a04f00 drag resize: wait for expose before continue
ca
parents: 1438
diff changeset
   676
        |p|
f7c591a04f00 drag resize: wait for expose before continue
ca
parents: 1438
diff changeset
   677
f7c591a04f00 drag resize: wait for expose before continue
ca
parents: 1438
diff changeset
   678
        something isCollection ifTrue:[
f7c591a04f00 drag resize: wait for expose before continue
ca
parents: 1438
diff changeset
   679
            something do:[:v |
f7c591a04f00 drag resize: wait for expose before continue
ca
parents: 1438
diff changeset
   680
                |p|
f7c591a04f00 drag resize: wait for expose before continue
ca
parents: 1438
diff changeset
   681
f7c591a04f00 drag resize: wait for expose before continue
ca
parents: 1438
diff changeset
   682
                p := v originRelativeTo:self.
f7c591a04f00 drag resize: wait for expose before continue
ca
parents: 1438
diff changeset
   683
                self displayRectangle:(p extent:v extent).
f7c591a04f00 drag resize: wait for expose before continue
ca
parents: 1438
diff changeset
   684
            ].
f7c591a04f00 drag resize: wait for expose before continue
ca
parents: 1438
diff changeset
   685
        ] ifFalse:[
f7c591a04f00 drag resize: wait for expose before continue
ca
parents: 1438
diff changeset
   686
            |p|
f7c591a04f00 drag resize: wait for expose before continue
ca
parents: 1438
diff changeset
   687
f7c591a04f00 drag resize: wait for expose before continue
ca
parents: 1438
diff changeset
   688
            p := something originRelativeTo:self.
f7c591a04f00 drag resize: wait for expose before continue
ca
parents: 1438
diff changeset
   689
            self displayRectangle:(p extent:something extent).
f7c591a04f00 drag resize: wait for expose before continue
ca
parents: 1438
diff changeset
   690
        ]
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   691
    ].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   692
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   693
    wasClipped ifTrue:[
1451
f7c591a04f00 drag resize: wait for expose before continue
ca
parents: 1438
diff changeset
   694
        self clippedByChildren:(clipChildren := true).
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   695
    ].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   696
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   697
78
a0a00603a8b6 keep spec in properties
ca
parents: 76
diff changeset
   698
minSetOfSuperViews:setOfViews
a0a00603a8b6 keep spec in properties
ca
parents: 76
diff changeset
   699
a0a00603a8b6 keep spec in properties
ca
parents: 76
diff changeset
   700
    setOfViews isCollection ifFalse:[
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   701
	setOfViews notNil ifTrue:[^ Array with:setOfViews]
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   702
			 ifFalse:[^ nil]
72
a5a7054e2b7d *** empty log message ***
ca
parents: 68
diff changeset
   703
    ].
78
a0a00603a8b6 keep spec in properties
ca
parents: 76
diff changeset
   704
  ^ setOfViews select:[:aView|
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   705
	(setOfViews detect:[:v|aView isComponentOf:v] ifNone:nil) isNil
78
a0a00603a8b6 keep spec in properties
ca
parents: 76
diff changeset
   706
    ]
72
a5a7054e2b7d *** empty log message ***
ca
parents: 68
diff changeset
   707
!
a5a7054e2b7d *** empty log message ***
ca
parents: 68
diff changeset
   708
624
26e7978936fc ignore redraws - components redraw themself.
Claus Gittinger <cg@exept.de>
parents: 543
diff changeset
   709
redrawObjectsInVisible:redrawFrame
26e7978936fc ignore redraws - components redraw themself.
Claus Gittinger <cg@exept.de>
parents: 543
diff changeset
   710
    "my objects are views - they redraw themself"
26e7978936fc ignore redraws - components redraw themself.
Claus Gittinger <cg@exept.de>
parents: 543
diff changeset
   711
26e7978936fc ignore redraws - components redraw themself.
Claus Gittinger <cg@exept.de>
parents: 543
diff changeset
   712
    ^ self
26e7978936fc ignore redraws - components redraw themself.
Claus Gittinger <cg@exept.de>
parents: 543
diff changeset
   713
26e7978936fc ignore redraws - components redraw themself.
Claus Gittinger <cg@exept.de>
parents: 543
diff changeset
   714
!
26e7978936fc ignore redraws - components redraw themself.
Claus Gittinger <cg@exept.de>
parents: 543
diff changeset
   715
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   716
setDefaultActions
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   717
    "set default actions
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   718
    "
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   719
    pressAction      := [:pressPoint | self startSelectOrMove:pressPoint].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   720
    shiftPressAction := [:pressPoint | self startSelectMoreOrMove:pressPoint].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   721
    motionAction     := [:movePoint  | nil].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   722
    releaseAction    := [nil].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   723
    keyPressAction   := nil.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   724
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   725
    self cursor:Cursor normal.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   726
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   727
! !
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   728
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   729
!UIObjectView methodsFor:'object moving'!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   730
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   731
doObjectMove:aPoint
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   732
    "move selection
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   733
    "
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   734
    movedObject notNil ifTrue:[
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   735
	self invertOutlineOf:movedObject.
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   736
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   737
	movedObject keysAndValuesDo:[:i :v|
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   738
	    self moveObject:v to:(aPoint - (moveDelta at:i)).
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   739
	].
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   740
	self invertOutlineOf:movedObject.
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   741
    ]
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   742
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   743
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   744
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   745
endObjectMove
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   746
    "cleanup after object(s) move
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   747
    "
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   748
    movedObject notNil ifTrue:[
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   749
	self invertOutlineOf:movedObject.
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   750
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   751
	movedObject size == 1 ifTrue:[
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   752
	    movedObject := movedObject first
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   753
	].
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   754
	self setSelection:movedObject withRedraw:true.
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   755
	movedObject := nil.
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   756
	self setDefaultActions.
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   757
	self layoutChanged.
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   758
    ].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   759
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   760
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   761
moveObject:anObject to:aPoint
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   762
    "move anObject to newOrigin, aPoint
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   763
    "
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   764
    |dX dY org delta|
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   765
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   766
    anObject notNil ifTrue:[
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   767
	org := anObject computeOrigin.
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   768
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   769
	delta := aPoint - org.
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   770
	delta := (self alignToGrid:aPoint) - org.
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   771
	dX := delta x.
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   772
	dY := delta y.
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   773
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   774
	undoHistory withoutTransactionDo:[
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   775
	    self shiftLayout:anObject top:dY bottom:dY left:dX right:dX
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   776
	]
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   777
    ]
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   778
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   779
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   780
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   781
startObjectMoveAt:aPoint
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   782
    "start object(s) move at a point
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   783
    "
128
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
   784
    self startObjectMove:(self selection) at:aPoint.
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
   785
    movedObject := self selection.
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
   786
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
   787
    movedObject isCollection ifFalse:[
1451
f7c591a04f00 drag resize: wait for expose before continue
ca
parents: 1438
diff changeset
   788
        movedObject := Array with:movedObject
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   789
    ].
128
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
   790
    self setSelection:nil withRedraw:true.
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   791
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   792
    moveDelta := movedObject collect:[:aView|
1451
f7c591a04f00 drag resize: wait for expose before continue
ca
parents: 1438
diff changeset
   793
        aPoint - aView computeOrigin
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   794
    ].
175
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   795
    self transaction:#move objects:movedObject do:[:v|self createUndoLayout:v].
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   796
    self invertOutlineOf:movedObject.
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   797
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   798
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   799
startSelectMoreOrMove:aPoint
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   800
    "add/remove to/from selection"
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   801
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   802
    |anObject|
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   803
119
39acd704ad51 testMode is now a ValueHolder
ca
parents: 113
diff changeset
   804
    self enabled ifFalse:[^ self].
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   805
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   806
    anObject := self findObjectAt:aPoint.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   807
    anObject notNil ifTrue:[
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   808
	(self isSelected:anObject) ifTrue:[
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   809
	    self removeFromSelection:anObject
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   810
	] ifFalse:[
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   811
	    self addToSelection:anObject
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   812
	]
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   813
    ]
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   814
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   815
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   816
startSelectOrMove:aPoint
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   817
    "a button is pressed at a point; start moving or selection
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   818
    "
284
995078a58977 show the selection after mapping the view
ca
parents: 251
diff changeset
   819
    |aView b v|
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   820
119
39acd704ad51 testMode is now a ValueHolder
ca
parents: 113
diff changeset
   821
    self enabled ifFalse:[^ self].
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   822
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   823
    aView := self singleSelection.
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   824
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   825
    aView notNil ifTrue:[
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   826
	v := self findContainerOfView:aView.
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   827
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   828
	v specClass canResizeSubComponents ifTrue:[
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   829
	    b := self whichHandleOf:aView isHitBy:aPoint.
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   830
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   831
	    (b notNil and:[b ~~ #view]) ifTrue:[
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   832
		^ self startResizeBorder:b of:aView.
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   833
	    ]
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   834
	].
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   835
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   836
	(self sensor ctrlDown and:[self canChangeLayoutOfView:aView]) ifFalse:[
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   837
	    aView := nil
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   838
	]
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   839
    ].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   840
100
01775d3d8489 startSelectOrMove:aPoint
ca
parents: 99
diff changeset
   841
    aView isNil ifTrue:[
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   842
	(aView := self findObjectAt:aPoint) isNil ifTrue:[
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   843
	    ^ self select:nil
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   844
	].
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   845
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   846
	(self canChangeLayoutOfView:aView) ifFalse:[
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   847
	    ^ self select:aView
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   848
	]
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   849
    ].
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   850
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   851
    (self isSelected:aView) ifFalse:[
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   852
	self select:aView.
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   853
    ].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   854
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   855
    (self numberOfSelections ~~ 1) ifTrue:[
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   856
	releaseAction := [
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   857
	    self setDefaultActions.
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   858
	    self select:aView
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   859
	]
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   860
    ] ifFalse:[
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   861
	releaseAction := [self setDefaultActions]
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   862
    ].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   863
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   864
    "prepare move operation for an object
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   865
    "
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   866
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   867
    motionAction := [:movePoint|
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   868
	(aPoint dist:movePoint) > 8.0 ifTrue:[
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   869
	    self startObjectMoveAt:aPoint
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   870
	]
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   871
    ].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   872
! !
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   873
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   874
!UIObjectView methodsFor:'object resize'!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   875
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   876
actionResize:anObject selector:aSelector
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   877
    "create and initialize action for resize
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   878
    "
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   879
    |selector delta|
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   880
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   881
    delta    := anObject container originRelativeTo:self.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   882
    selector := ('resize:', aSelector, ':') asSymbol.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   883
543
e3f2bf2dfb59 eliminated use of Structure - added private ResizeData class instead
Claus Gittinger <cg@exept.de>
parents: 374
diff changeset
   884
    resizeData := ResizeData new
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   885
		      object:anObject selector:selector delta:delta.
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   886
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   887
"can change cursor dependent on vertical/horizontal resizing
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   888
"
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   889
    oldCursor := cursor.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   890
    self cursor:(Cursor leftHand).
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   891
543
e3f2bf2dfb59 eliminated use of Structure - added private ResizeData class instead
Claus Gittinger <cg@exept.de>
parents: 374
diff changeset
   892
    "Modified: / 2.2.1998 / 13:40:55 / cg"
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   893
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   894
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   895
doDragResize:aPoint
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   896
    "do a widget resize drag
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   897
    "
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   898
    |p object|
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   899
175
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   900
    object := resizeData object.
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   901
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   902
    self invertOutlineOf:object.
175
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   903
    p := (self alignToGrid:aPoint) - (resizeData delta).
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   904
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   905
    self perform:(resizeData selector) with:object with:p.
1451
f7c591a04f00 drag resize: wait for expose before continue
ca
parents: 1438
diff changeset
   906
    Delay waitForSeconds:0.05.
f7c591a04f00 drag resize: wait for expose before continue
ca
parents: 1438
diff changeset
   907
    [self sensor hasExposeEventFor:nil] whileTrue:[
f7c591a04f00 drag resize: wait for expose before continue
ca
parents: 1438
diff changeset
   908
        self windowGroup processExposeEvents
f7c591a04f00 drag resize: wait for expose before continue
ca
parents: 1438
diff changeset
   909
    ].
f7c591a04f00 drag resize: wait for expose before continue
ca
parents: 1438
diff changeset
   910
79
33212fbe9766 resize extent
ca
parents: 78
diff changeset
   911
   "/ object geometryLayout:(object geometryLayout).
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   912
    self invertOutlineOf:object
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   913
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   914
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   915
endResize
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   916
    "cleanup after object resize
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   917
    "
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   918
    |object|
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   919
175
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   920
    object := resizeData object.
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   921
    resizeData := nil.
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   922
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   923
    self invertOutlineOf:object.
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   924
    self setDefaultActions.
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   925
    self elementChangedSize:object.
138
ca
parents: 134
diff changeset
   926
ca
parents: 134
diff changeset
   927
    "/ handle any expose events (for subcomponents) before
ca
parents: 134
diff changeset
   928
    "/ redrawing the handles.
ca
parents: 134
diff changeset
   929
    Delay waitForSeconds:0.05.
ca
parents: 134
diff changeset
   930
    [self sensor hasExposeEventFor:nil] whileTrue:[
1451
f7c591a04f00 drag resize: wait for expose before continue
ca
parents: 1438
diff changeset
   931
        self windowGroup processExposeEvents
138
ca
parents: 134
diff changeset
   932
    ].
ca
parents: 134
diff changeset
   933
128
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
   934
    self setSelection:object withRedraw:true.
225
a40d26ed5e74 change selection behavior caused by new tree view
ca
parents: 208
diff changeset
   935
    self layoutChanged.
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   936
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   937
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   938
startResizeBorder:b of:selection
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   939
    "resize selected view
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   940
    "
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   941
    |object|
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   942
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   943
    object := self singleSelection.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   944
    self actionResize:object selector:b.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   945
72
a5a7054e2b7d *** empty log message ***
ca
parents: 68
diff changeset
   946
    self transaction:#resize selectionDo:[:aView|
1451
f7c591a04f00 drag resize: wait for expose before continue
ca
parents: 1438
diff changeset
   947
        self createUndoLayout:aView
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   948
    ].
128
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
   949
    self setSelection:nil withRedraw:true.
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   950
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   951
    motionAction  := [:movePoint | self doDragResize:movePoint].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   952
    releaseAction := [self endResize].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   953
    self invertOutlineOf:object
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   954
! !
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   955
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   956
!UIObjectView methodsFor:'private handles'!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   957
175
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   958
handlesOf:aComponent do:aTwoArgAction
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   959
    "perform action on each handle of a component
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   960
    "
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   961
    |dlt ext|
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   962
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   963
    dlt := (aComponent originRelativeTo:self) - aComponent origin.
1451
f7c591a04f00 drag resize: wait for expose before continue
ca
parents: 1438
diff changeset
   964
    dlt := dlt - (4@4).
f7c591a04f00 drag resize: wait for expose before continue
ca
parents: 1438
diff changeset
   965
    ext := 8@8.
175
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   966
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   967
    self class handlesOf:aComponent do:[:pnt :wht |
1427
85b9b5da0b8d optimize: undraw selection
ca
parents: 1399
diff changeset
   968
        aTwoArgAction value:(pnt + dlt extent:ext) value:wht
175
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   969
    ]
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   970
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   971
175
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   972
whichHandleOf:aComponent isHitBy:aPoint
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   973
    "returns kind of handle or nil
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   974
    "
175
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   975
    self handlesOf:aComponent do:[:rectangle :what|
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   976
	(rectangle containsPoint:aPoint) ifTrue:[^ what]
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   977
    ].
175
0b0b4d99e3e7 isResizeable
ca
parents: 156
diff changeset
   978
  ^ nil
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   979
! !
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   980
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   981
!UIObjectView methodsFor:'private resizing-subviews'!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   982
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   983
resize:aView bottom:aPoint
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   984
    "resize a views bottom
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   985
    "
134
d5ab85ec27fd undo history; keep view identifier
ca
parents: 132
diff changeset
   986
    undoHistory withoutTransactionDo:[
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   987
	self shiftLayout:aView top:0 bottom:((aPoint y) - (aView computeCorner y))
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   988
    ]
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   989
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   990
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   991
resize:aView bottomLeft:aPoint
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   992
    "resize a views bottom and left
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   993
    "
134
d5ab85ec27fd undo history; keep view identifier
ca
parents: 132
diff changeset
   994
    undoHistory withoutTransactionDo:[
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   995
	self shiftLayout:aView top:0
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   996
			    bottom:((aPoint y) - (aView computeCorner y))
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   997
			      left:((aPoint x) - (aView computeOrigin x))
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
   998
			     right:0
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   999
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1000
    ]
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1001
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1002
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1003
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1004
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1005
resize:aView corner:aPoint
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1006
    "resize a views corner
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1007
    "
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1008
    |delta|
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1009
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1010
    delta := aPoint - aView computeCorner.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1011
134
d5ab85ec27fd undo history; keep view identifier
ca
parents: 132
diff changeset
  1012
    undoHistory withoutTransactionDo:[
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1013
	self shiftLayout:aView top:0 bottom:(delta y) left:0 right:(delta x)
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1014
    ]
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1015
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1016
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1017
resize:aView left:aPoint
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1018
    "resize a views left
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1019
    "
134
d5ab85ec27fd undo history; keep view identifier
ca
parents: 132
diff changeset
  1020
    undoHistory withoutTransactionDo:[
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1021
	self shiftLayout:aView left:((aPoint x) - (aView computeOrigin x)) right:0
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1022
    ]
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1023
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1024
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1025
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1026
resize:aView origin:aPoint
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1027
    "resize a views origin
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1028
    "
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1029
    |delta|
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1030
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1031
    delta := aPoint - aView computeOrigin.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1032
134
d5ab85ec27fd undo history; keep view identifier
ca
parents: 132
diff changeset
  1033
    undoHistory withoutTransactionDo:[
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1034
	self shiftLayout:aView top:(delta y) bottom:0 left:(delta x) right:0
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1035
    ]
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1036
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1037
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1038
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1039
resize:aView right:aPoint
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1040
    "resize a views right
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1041
    "
134
d5ab85ec27fd undo history; keep view identifier
ca
parents: 132
diff changeset
  1042
    undoHistory withoutTransactionDo:[
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1043
	self shiftLayout:aView left:0 right:((aPoint x) - (aView computeCorner x))
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1044
    ]
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1045
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1046
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1047
resize:aView top:aPoint
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1048
    "resize a views top
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1049
    "
134
d5ab85ec27fd undo history; keep view identifier
ca
parents: 132
diff changeset
  1050
    undoHistory withoutTransactionDo:[
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1051
	self shiftLayout:aView top:((aPoint y) - (aView computeOrigin y)) bottom:0
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1052
    ]
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1053
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1054
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1055
resize:aView topRight:aPoint
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1056
    "resize a views top and right
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1057
    "
134
d5ab85ec27fd undo history; keep view identifier
ca
parents: 132
diff changeset
  1058
    undoHistory withoutTransactionDo:[
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1059
	self shiftLayout:aView top:((aPoint y) - (aView computeOrigin y))
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1060
			    bottom:0
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1061
			      left:0
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1062
			     right:((aPoint x) - (aView computeCorner x))
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1063
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1064
    ]
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1065
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1066
! !
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1067
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1068
!UIObjectView methodsFor:'private shift-layout'!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1069
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1070
shiftLayout:aView left:l right:r
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1071
    "shift layout for a view; in case of an open transaction, the undo
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1072
     action is registered
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1073
    "
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1074
    self shiftLayout:aView top:0 bottom:0 left:l right:r
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1075
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1076
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1077
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1078
shiftLayout:aView top:t bottom:b
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1079
    "shift layout for a view; in case of an open transaction, the undo
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1080
     action is registered
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1081
    "
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1082
    self shiftLayout:aView top:t bottom:b left:0 right:0
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1083
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1084
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1085
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1086
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1087
shiftLayout:aView top:t bottom:b left:l right:r
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1088
    "shift layout for a view; in case of an open transaction, the undo
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1089
     action is registered
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1090
    "
79
33212fbe9766 resize extent
ca
parents: 78
diff changeset
  1091
    |type layout oldExt|
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1092
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1093
    type := self class layoutType:aView.
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1094
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1095
    type notNil ifTrue:[
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1096
	self createUndoLayout:aView.
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1097
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1098
	type == #Extent ifTrue:[
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1099
	    oldExt := aView extent.
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1100
	    aView extent:(oldExt + ((r-l) @ (b-t))).
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1101
	    ^ self 
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1102
	].
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1103
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1104
	layout := aView geometryLayout copy.
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1105
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1106
	layout isLayout ifTrue:[
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1107
	    layout leftOffset:(layout leftOffset + l)
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1108
		    topOffset:(layout topOffset  + t).
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1109
                    
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1110
	    type == #LayoutFrame ifTrue:[
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1111
		layout bottomOffset:(layout bottomOffset + b).
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1112
		layout  rightOffset:(layout rightOffset  + r).
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1113
	    ]
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1114
	] ifFalse:[
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1115
	    type == #Rectangle ifTrue:[
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1116
		layout left:(layout left   + l)
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1117
		      right:(layout right  + r)
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1118
			top:(layout top    + t)
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1119
		     bottom:(layout bottom + b).
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1120
	    ] ifFalse:[     "POINT"
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1121
		layout x:(layout x + l) y:(layout y + t).
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1122
	    ]
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1123
	].
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1124
	aView geometryLayout:layout
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1125
    ]
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1126
! !
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1127
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1128
!UIObjectView methodsFor:'searching'!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1129
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1130
findObjectAt:aPoint
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1131
    "find the origin/corner of the currentWidget
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1132
    "
1672
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
  1133
    |view viewId lastId point|
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1134
1500
36c0b4b268b8 use new translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  1135
    point  := aPoint + (device translatePoint:0@0 fromView:self toView:rootView).
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1136
1500
36c0b4b268b8 use new translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  1137
    viewId := rootView id.
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1138
    [viewId notNil] whileTrue:[
1500
36c0b4b268b8 use new translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  1139
        lastId := viewId.
36c0b4b268b8 use new translatePoint:fromView:toView:
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  1140
        viewId := device viewIdFromPoint:point in:lastId
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1141
    ].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1142
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1143
    view := device viewFromId:lastId.
1672
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
  1144
    view == self ifTrue:[ ^ nil].
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
  1145
    ^ view
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
  1146
"/    view ~~ inputView ifTrue:[^ view].
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
  1147
"/
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
  1148
"/    "/ look for 'hidden' views ...
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
  1149
"/
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
  1150
"/    listOfViews := OrderedCollection new.
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
  1151
"/    self allSubViewsDo:[:aView |
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
  1152
"/        |org|
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
  1153
"/
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
  1154
"/        aView ~~ inputView ifTrue:[
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
  1155
"/            org := device translatePoint:0@0 fromView:aView toView:self.
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
  1156
"/            ((org extent:aView extent) containsPoint:aPoint) ifTrue:[
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
  1157
"/                listOfViews add:aView.
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
  1158
"/            ]
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
  1159
"/        ]
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
  1160
"/    ].
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
  1161
"/
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
  1162
"/    listOfViews size > 0 ifTrue:[
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
  1163
"/        ^ listOfViews last
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
  1164
"/    ].
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
  1165
"/    ^ nil
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
  1166
"/
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
  1167
"/    "Modified: / 10.10.2001 / 14:05:07 / cg"
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
  1168
"/
5e89f5959780 no longer use InputView
ca
parents: 1581
diff changeset
  1169
"/
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1170
! !
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1171
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1172
!UIObjectView methodsFor:'selections'!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1173
768
2ef5b8bed914 catch expose events when unselecting
ca
parents: 624
diff changeset
  1174
hideSelection
1427
85b9b5da0b8d optimize: undraw selection
ca
parents: 1399
diff changeset
  1175
    "hide the selection - undraw hilights - whatever that is
85b9b5da0b8d optimize: undraw selection
ca
parents: 1399
diff changeset
  1176
    "
85b9b5da0b8d optimize: undraw selection
ca
parents: 1399
diff changeset
  1177
    self showUnselected:selection.
768
2ef5b8bed914 catch expose events when unselecting
ca
parents: 624
diff changeset
  1178
!
2ef5b8bed914 catch expose events when unselecting
ca
parents: 624
diff changeset
  1179
128
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1180
moveableSelection
131
715b3dbba87d selection handling changed
ca
parents: 128
diff changeset
  1181
    "checks whether the selection is not empty and all selected instances
715b3dbba87d selection handling changed
ca
parents: 128
diff changeset
  1182
     can be moved. If true the selection is returned otherwise nil
128
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1183
    "
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1184
    |coll|
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1185
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1186
    self hasSelection ifTrue:[
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1187
	(self canMove:(coll := self selection)) ifTrue:[
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1188
	    ^ coll
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1189
	]
128
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1190
    ].
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1191
  ^ nil
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1192
!
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1193
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1194
numberOfSelections
131
715b3dbba87d selection handling changed
ca
parents: 128
diff changeset
  1195
    "return the number of selected instances
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1196
    "
128
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1197
    |coll size|
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1198
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1199
    coll := self selection.
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1200
    size := coll size.
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1201
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1202
    (size ~~ 0 or:[coll isNil]) ifTrue:[^ size].
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1203
  ^ 1
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1204
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1205
149
e652608690b1 help ...
ca
parents: 145
diff changeset
  1206
selection:something
e652608690b1 help ...
ca
parents: 145
diff changeset
  1207
    "change selection to something
e652608690b1 help ...
ca
parents: 145
diff changeset
  1208
    "
e652608690b1 help ...
ca
parents: 145
diff changeset
  1209
    self select:something
e652608690b1 help ...
ca
parents: 145
diff changeset
  1210
!
e652608690b1 help ...
ca
parents: 145
diff changeset
  1211
128
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1212
selectionDo:aBlock
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1213
    "apply block to every selected object
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1214
    "
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1215
    self forEach:(self selection) do:aBlock
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1216
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1217
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1218
!
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1219
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1220
showSelection
128
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1221
    "show the selection - draw handles
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1222
    "
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1223
    selectionHiddenLevel == 0 ifTrue:[
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1224
	self selectionDo:[:el| self showSelected:el ]
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1225
    ].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1226
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1227
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1228
singleSelection
131
715b3dbba87d selection handling changed
ca
parents: 128
diff changeset
  1229
    "checks whether one element is selected; in this case the element is
715b3dbba87d selection handling changed
ca
parents: 128
diff changeset
  1230
     returned otherwise nil
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1231
    "
128
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1232
    |coll|
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1233
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1234
    (coll := self selection) isCollection ifFalse:[
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1235
	^ coll
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1236
    ].
128
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1237
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1238
    coll size == 1 ifTrue:[ ^ coll first].
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1239
  ^ nil
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1240
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1241
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1242
singleSelectionDo:aBlock
131
715b3dbba87d selection handling changed
ca
parents: 128
diff changeset
  1243
    "checks whether one element is selected; in this case the block
715b3dbba87d selection handling changed
ca
parents: 128
diff changeset
  1244
     with argument the selected instance will be processed
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1245
    "
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1246
    |view|
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1247
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1248
    (view := self singleSelection) notNil ifTrue:[
1120
230fe13c4e51 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1112
diff changeset
  1249
	aBlock value:view
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1250
    ]
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1251
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1252
1230
23e5d0c133e8 added exchangeLayouts function
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  1253
twoElementSelection
23e5d0c133e8 added exchangeLayouts function
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  1254
    "checks whether exactly two elements are selected; 
23e5d0c133e8 added exchangeLayouts function
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  1255
     in this case, return the selection collection.
23e5d0c133e8 added exchangeLayouts function
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  1256
     otherwise return nil
23e5d0c133e8 added exchangeLayouts function
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  1257
    "
23e5d0c133e8 added exchangeLayouts function
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  1258
    |coll|
23e5d0c133e8 added exchangeLayouts function
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  1259
23e5d0c133e8 added exchangeLayouts function
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  1260
    (coll := self selection) isCollection ifFalse:[
23e5d0c133e8 added exchangeLayouts function
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  1261
        ^ nil "/ single
23e5d0c133e8 added exchangeLayouts function
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  1262
    ].
23e5d0c133e8 added exchangeLayouts function
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  1263
23e5d0c133e8 added exchangeLayouts function
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  1264
    coll size == 2 ifTrue:[ ^ coll].
23e5d0c133e8 added exchangeLayouts function
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  1265
    ^ nil
23e5d0c133e8 added exchangeLayouts function
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  1266
!
23e5d0c133e8 added exchangeLayouts function
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
  1267
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1268
unselect
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1269
    "clear selection
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1270
    "
128
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1271
    self select:nil
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1272
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1273
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1274
withSelectionHiddenDo:aBlock
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1275
    "apply block with selection hidden (no handles)
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1276
    "
78
a0a00603a8b6 keep spec in properties
ca
parents: 76
diff changeset
  1277
    |coll|
a0a00603a8b6 keep spec in properties
ca
parents: 76
diff changeset
  1278
138
ca
parents: 134
diff changeset
  1279
    selectionHiddenLevel == 0 ifTrue:[
1555
4ecde43a73d6 #valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents: 1521
diff changeset
  1280
        self hideSelection.
4ecde43a73d6 #valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents: 1521
diff changeset
  1281
        device flush.
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1282
    ].
138
ca
parents: 134
diff changeset
  1283
    selectionHiddenLevel := selectionHiddenLevel + 1.
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1284
1555
4ecde43a73d6 #valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents: 1521
diff changeset
  1285
    aBlock ensure:[
4ecde43a73d6 #valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents: 1521
diff changeset
  1286
        selectionHiddenLevel == 1 ifTrue:[
4ecde43a73d6 #valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents: 1521
diff changeset
  1287
            setOfSuperViewsSizeChanged notEmpty ifTrue:[
4ecde43a73d6 #valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents: 1521
diff changeset
  1288
                coll := self minSetOfSuperViews:setOfSuperViewsSizeChanged.
4ecde43a73d6 #valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents: 1521
diff changeset
  1289
                coll do:[:aView| aView sizeChanged:nil].
4ecde43a73d6 #valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents: 1521
diff changeset
  1290
                setOfSuperViewsSizeChanged := IdentitySet new
4ecde43a73d6 #valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents: 1521
diff changeset
  1291
            ].
4ecde43a73d6 #valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents: 1521
diff changeset
  1292
            selectionHiddenLevel := 0.
4ecde43a73d6 #valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents: 1521
diff changeset
  1293
            self selectionDo:[:aView| self showSelected:aView].
4ecde43a73d6 #valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents: 1521
diff changeset
  1294
        ] ifFalse:[
4ecde43a73d6 #valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents: