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