UIObjectView.st
author ca
Tue, 27 May 1997 15:16:55 +0200
changeset 132 8649766ce095
parent 131 715b3dbba87d
child 134 d5ab85ec27fd
permissions -rw-r--r--
catch expose events for all subviews associated with a selected instance
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
     1
ObjectView subclass:#UIObjectView
123
421d412e797b keep old selection before starting test and
ca
parents: 119
diff changeset
     2
	instanceVariableNames:'saveSelection inputView enableChannel undoHistory copiedExtent
421d412e797b keep old selection before starting test and
ca
parents: 119
diff changeset
     3
		copiedLayout actionData createClass clipChildren
421d412e797b keep old selection before starting test and
ca
parents: 119
diff changeset
     4
		selectionHiddenLevel setOfSuperViewsSizeChanged'
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
     5
	classVariableNames:''
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
     6
	poolDictionaries:''
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
     7
	category:'Interface-UIPainter'
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
     8
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
     9
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
    10
Object subclass:#UndoHistory
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
    11
	instanceVariableNames:'history transaction enabled'
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
    12
	classVariableNames:''
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
    13
	poolDictionaries:''
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
    14
	privateIn:UIObjectView
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
    15
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
    16
54
d0b5a33e6df0 *** empty log message ***
ca
parents: 52
diff changeset
    17
Object subclass:#Transaction
d0b5a33e6df0 *** empty log message ***
ca
parents: 52
diff changeset
    18
	instanceVariableNames:'type text actions'
d0b5a33e6df0 *** empty log message ***
ca
parents: 52
diff changeset
    19
	classVariableNames:''
d0b5a33e6df0 *** empty log message ***
ca
parents: 52
diff changeset
    20
	poolDictionaries:''
d0b5a33e6df0 *** empty log message ***
ca
parents: 52
diff changeset
    21
	privateIn:UIObjectView::UndoHistory
d0b5a33e6df0 *** empty log message ***
ca
parents: 52
diff changeset
    22
!
d0b5a33e6df0 *** empty log message ***
ca
parents: 52
diff changeset
    23
128
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
    24
!UIObjectView class methodsFor:'documentation'!
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
    25
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
    26
documentation
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
    27
"
131
715b3dbba87d selection handling changed
ca
parents: 128
diff changeset
    28
    buildIn view used by the UIPainter; it provides all services for creating, deleting
715b3dbba87d selection handling changed
ca
parents: 128
diff changeset
    29
    moving and changing layouts of painted components on a canvas.
128
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
    30
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
    31
    [see also:]
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
    32
        UIBuilder
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
    33
        UIPainterView
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
    34
"
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
    35
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
    36
! !
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
    37
63
6714daee4b26 checkin from browser
ca
parents: 61
diff changeset
    38
!UIObjectView class methodsFor:'conversion'!
6714daee4b26 checkin from browser
ca
parents: 61
diff changeset
    39
6714daee4b26 checkin from browser
ca
parents: 61
diff changeset
    40
asLayoutFrameFromView:aView
6714daee4b26 checkin from browser
ca
parents: 61
diff changeset
    41
    "convert layout from aView to a frameLayout. On success the frameLayout is
6714daee4b26 checkin from browser
ca
parents: 61
diff changeset
    42
     returned otherwise nil
6714daee4b26 checkin from browser
ca
parents: 61
diff changeset
    43
    "
68
889c3877baf0 layout ....
ca
parents: 67
diff changeset
    44
    |lF lO rF rO tF tO bF bO type layout newLyt|
889c3877baf0 layout ....
ca
parents: 67
diff changeset
    45
889c3877baf0 layout ....
ca
parents: 67
diff changeset
    46
    type   := self layoutType:aView.
889c3877baf0 layout ....
ca
parents: 67
diff changeset
    47
    layout := aView geometryLayout.
889c3877baf0 layout ....
ca
parents: 67
diff changeset
    48
91
86d0c649f95e extent -> layout
Claus Gittinger <cg@exept.de>
parents: 89
diff changeset
    49
    layout isNil ifTrue:[
86d0c649f95e extent -> layout
Claus Gittinger <cg@exept.de>
parents: 89
diff changeset
    50
        type == #Extent ifTrue:[
86d0c649f95e extent -> layout
Claus Gittinger <cg@exept.de>
parents: 89
diff changeset
    51
            layout := aView bounds asLayout
86d0c649f95e extent -> layout
Claus Gittinger <cg@exept.de>
parents: 89
diff changeset
    52
        ]
86d0c649f95e extent -> layout
Claus Gittinger <cg@exept.de>
parents: 89
diff changeset
    53
    ].
86d0c649f95e extent -> layout
Claus Gittinger <cg@exept.de>
parents: 89
diff changeset
    54
68
889c3877baf0 layout ....
ca
parents: 67
diff changeset
    55
    (type isNil or:[layout isNil]) ifTrue:[
63
6714daee4b26 checkin from browser
ca
parents: 61
diff changeset
    56
        ^ nil
6714daee4b26 checkin from browser
ca
parents: 61
diff changeset
    57
    ].
6714daee4b26 checkin from browser
ca
parents: 61
diff changeset
    58
68
889c3877baf0 layout ....
ca
parents: 67
diff changeset
    59
    type == #LayoutFrame ifTrue:[
889c3877baf0 layout ....
ca
parents: 67
diff changeset
    60
        ^ layout copy
889c3877baf0 layout ....
ca
parents: 67
diff changeset
    61
    ].
889c3877baf0 layout ....
ca
parents: 67
diff changeset
    62
889c3877baf0 layout ....
ca
parents: 67
diff changeset
    63
    layout isLayout ifFalse:[
889c3877baf0 layout ....
ca
parents: 67
diff changeset
    64
        type == #Rectangle ifTrue:[
63
6714daee4b26 checkin from browser
ca
parents: 61
diff changeset
    65
            lO := layout left.
6714daee4b26 checkin from browser
ca
parents: 61
diff changeset
    66
            tO := layout top.
6714daee4b26 checkin from browser
ca
parents: 61
diff changeset
    67
            rO := layout right.
6714daee4b26 checkin from browser
ca
parents: 61
diff changeset
    68
            bO := layout bottom.
6714daee4b26 checkin from browser
ca
parents: 61
diff changeset
    69
        ] ifFalse:[
6714daee4b26 checkin from browser
ca
parents: 61
diff changeset
    70
            lO := layout x.
6714daee4b26 checkin from browser
ca
parents: 61
diff changeset
    71
            tO := layout y.
6714daee4b26 checkin from browser
ca
parents: 61
diff changeset
    72
            rO := lO + aView extent x.
6714daee4b26 checkin from browser
ca
parents: 61
diff changeset
    73
            bO := tO + aView extent y.
6714daee4b26 checkin from browser
ca
parents: 61
diff changeset
    74
        ].
68
889c3877baf0 layout ....
ca
parents: 67
diff changeset
    75
889c3877baf0 layout ....
ca
parents: 67
diff changeset
    76
        ^ LayoutFrame leftFraction:0 offset:lO  rightFraction:0 offset:rO
889c3877baf0 layout ....
ca
parents: 67
diff changeset
    77
                       topFraction:0 offset:tO bottomFraction:0 offset:bO
63
6714daee4b26 checkin from browser
ca
parents: 61
diff changeset
    78
    ].
6714daee4b26 checkin from browser
ca
parents: 61
diff changeset
    79
68
889c3877baf0 layout ....
ca
parents: 67
diff changeset
    80
    lF := layout leftFraction.
889c3877baf0 layout ....
ca
parents: 67
diff changeset
    81
    lO := layout leftOffset.
889c3877baf0 layout ....
ca
parents: 67
diff changeset
    82
    tF := layout topFraction.
889c3877baf0 layout ....
ca
parents: 67
diff changeset
    83
    tO := layout topOffset.
889c3877baf0 layout ....
ca
parents: 67
diff changeset
    84
    bF := tF.
889c3877baf0 layout ....
ca
parents: 67
diff changeset
    85
    bO := tO + aView extent y.
889c3877baf0 layout ....
ca
parents: 67
diff changeset
    86
    rF := lF.
889c3877baf0 layout ....
ca
parents: 67
diff changeset
    87
    rO := lO + aView extent x.
889c3877baf0 layout ....
ca
parents: 67
diff changeset
    88
889c3877baf0 layout ....
ca
parents: 67
diff changeset
    89
    newLyt := LayoutFrame leftFraction:lF offset:lO  rightFraction:rF offset:rO
889c3877baf0 layout ....
ca
parents: 67
diff changeset
    90
                           topFraction:tF offset:tO bottomFraction:bF offset:bO.
889c3877baf0 layout ....
ca
parents: 67
diff changeset
    91
889c3877baf0 layout ....
ca
parents: 67
diff changeset
    92
    (    (type == #AlignmentOrigin)
889c3877baf0 layout ....
ca
parents: 67
diff changeset
    93
     and:[layout leftAlignmentFraction ~~ 0
889c3877baf0 layout ....
ca
parents: 67
diff changeset
    94
      or:[layout topAlignmentFraction  ~~ 0]]
889c3877baf0 layout ....
ca
parents: 67
diff changeset
    95
    ) ifTrue:[
889c3877baf0 layout ....
ca
parents: 67
diff changeset
    96
        |svRc prBd dlta|
889c3877baf0 layout ....
ca
parents: 67
diff changeset
    97
889c3877baf0 layout ....
ca
parents: 67
diff changeset
    98
        svRc := aView superView viewRectangle.
889c3877baf0 layout ....
ca
parents: 67
diff changeset
    99
        prBd := aView preferredBounds.
889c3877baf0 layout ....
ca
parents: 67
diff changeset
   100
        dlta := (  ((layout rectangleRelativeTo:svRc preferred:prBd) corner)
889c3877baf0 layout ....
ca
parents: 67
diff changeset
   101
                 - ((newLyt rectangleRelativeTo:svRc preferred:prBd) corner)
889c3877baf0 layout ....
ca
parents: 67
diff changeset
   102
                ) rounded.
889c3877baf0 layout ....
ca
parents: 67
diff changeset
   103
889c3877baf0 layout ....
ca
parents: 67
diff changeset
   104
        newLyt leftOffset:(lO + dlta x).
889c3877baf0 layout ....
ca
parents: 67
diff changeset
   105
        newLyt rightOffset:(rO + dlta x).
889c3877baf0 layout ....
ca
parents: 67
diff changeset
   106
        newLyt topOffset:(tO + dlta y).
889c3877baf0 layout ....
ca
parents: 67
diff changeset
   107
        newLyt bottomOffset:(bO + dlta y).
889c3877baf0 layout ....
ca
parents: 67
diff changeset
   108
    ].
889c3877baf0 layout ....
ca
parents: 67
diff changeset
   109
  ^ newLyt.
91
86d0c649f95e extent -> layout
Claus Gittinger <cg@exept.de>
parents: 89
diff changeset
   110
86d0c649f95e extent -> layout
Claus Gittinger <cg@exept.de>
parents: 89
diff changeset
   111
    "Modified: 28.3.1997 / 19:52:48 / cg"
63
6714daee4b26 checkin from browser
ca
parents: 61
diff changeset
   112
! !
6714daee4b26 checkin from browser
ca
parents: 61
diff changeset
   113
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   114
!UIObjectView class methodsFor:'defaults'!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   115
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   116
defaultGrid
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   117
    ^ 4 @ 4
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   118
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   119
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   120
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   121
gridShown
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   122
    ^ false
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   123
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   124
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   125
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   126
handleSize
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   127
    "size of blob drawn for handles"
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   128
    ^ 4
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   129
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   130
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   131
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   132
hitDelta
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   133
    ^ 4
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   134
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   135
! !
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   136
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   137
!UIObjectView class methodsFor:'queries'!
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   138
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   139
layoutType:aView
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   140
    "returns layout type of aView or nil
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   141
    "
113
1854c2e61c4e bug fixes
ca
parents: 100
diff changeset
   142
    |layout spec superView|
1854c2e61c4e bug fixes
ca
parents: 100
diff changeset
   143
1854c2e61c4e bug fixes
ca
parents: 100
diff changeset
   144
    aView notNil ifTrue:[
1854c2e61c4e bug fixes
ca
parents: 100
diff changeset
   145
        layout := aView geometryLayout.
1854c2e61c4e bug fixes
ca
parents: 100
diff changeset
   146
        layout notNil ifTrue:[
1854c2e61c4e bug fixes
ca
parents: 100
diff changeset
   147
            layout isLayout ifTrue:[
1854c2e61c4e bug fixes
ca
parents: 100
diff changeset
   148
                layout isLayoutFrame        ifTrue:[ ^ #LayoutFrame ].
1854c2e61c4e bug fixes
ca
parents: 100
diff changeset
   149
                layout isAlignmentOrigin    ifTrue:[ ^ #AlignmentOrigin ].
1854c2e61c4e bug fixes
ca
parents: 100
diff changeset
   150
                layout isLayoutOrigin       ifTrue:[ ^ #LayoutOrigin ].
1854c2e61c4e bug fixes
ca
parents: 100
diff changeset
   151
            ] ifFalse:[
1854c2e61c4e bug fixes
ca
parents: 100
diff changeset
   152
                layout isRectangle          ifTrue:[ ^ #Rectangle ].
1854c2e61c4e bug fixes
ca
parents: 100
diff changeset
   153
                layout isPoint              ifTrue:[ ^ #Point ].
1854c2e61c4e bug fixes
ca
parents: 100
diff changeset
   154
            ]
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   155
        ] ifFalse:[
113
1854c2e61c4e bug fixes
ca
parents: 100
diff changeset
   156
            (superView := aView superView) notNil ifTrue:[
1854c2e61c4e bug fixes
ca
parents: 100
diff changeset
   157
                spec := superView specClass.
1854c2e61c4e bug fixes
ca
parents: 100
diff changeset
   158
                spec canResizeSubComponents ifTrue:[
1854c2e61c4e bug fixes
ca
parents: 100
diff changeset
   159
                    ^ #Extent
1854c2e61c4e bug fixes
ca
parents: 100
diff changeset
   160
                ]
1854c2e61c4e bug fixes
ca
parents: 100
diff changeset
   161
            ]
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   162
        ]
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   163
    ].
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   164
    ^ nil
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   165
67
09e9d4b57142 alignmentLayout
Claus Gittinger <cg@exept.de>
parents: 63
diff changeset
   166
    "Modified: 28.2.1997 / 13:02:16 / cg"
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   167
! !
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   168
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   169
!UIObjectView methodsFor:'accessing'!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   170
119
39acd704ad51 testMode is now a ValueHolder
ca
parents: 113
diff changeset
   171
enableChannel
39acd704ad51 testMode is now a ValueHolder
ca
parents: 113
diff changeset
   172
    "returns the channel which keeps false if running test otherwise true
39acd704ad51 testMode is now a ValueHolder
ca
parents: 113
diff changeset
   173
    "
39acd704ad51 testMode is now a ValueHolder
ca
parents: 113
diff changeset
   174
  ^ enableChannel
113
1854c2e61c4e bug fixes
ca
parents: 100
diff changeset
   175
!
1854c2e61c4e bug fixes
ca
parents: 100
diff changeset
   176
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   177
gridAlign
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   178
    "returns state of aligning to grid
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   179
    "
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   180
    ^ aligning
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   181
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   182
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   183
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   184
gridAlign:aBool
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   185
    "change state of aligning to grid
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   186
    "
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   187
    aBool ifTrue:[self alignOn]
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   188
         ifFalse:[self alignOff]
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   189
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   190
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   191
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   192
gridParameters
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   193
    "used by defineGrid, and in a separate method for
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   194
     easier redefinition in subclasses. 
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   195
     Returns the grid parameters in an array of 7 elements,
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   196
     which control the appearance of the grid-pattern.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   197
     the elements are:
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   198
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   199
        bigStepH        number of pixels horizontally between 2 major steps
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   200
        bigStepV        number of pixels vertically between 2 major steps
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   201
        littleStepH     number of pixels horizontally between 2 minor steps
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   202
        littleStepV     number of pixels vertically between 2 minor steps
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   203
        gridAlignH      number of pixels for horizontal grid align (pointer snap)
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   204
        gridAlignV      number of pixels for vertical grid align (pointer snap)
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   205
        docBounds       true, if document boundary should be shown
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   206
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   207
     if littleStepH/V are nil, only bigSteps are drawn.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   208
    "
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   209
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   210
    ^ #(10 10 nil nil 10 10 false)
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   211
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   212
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   213
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   214
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   215
gridShown:aBool
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   216
    "change visibility of grid
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   217
    "
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   218
    aBool ifTrue:[self showGrid]
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   219
         ifFalse:[self hideGrid]
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   220
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   221
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   222
hideGrid
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   223
    "hide grid
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   224
    "
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   225
    gridShown ifTrue:[
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   226
        self withSelectionHiddenDo:[super hideGrid]
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   227
    ]
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   228
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   229
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   230
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   231
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   232
showGrid
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   233
    "show grid
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   234
    "
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   235
    self withSelectionHiddenDo:[super showGrid]
119
39acd704ad51 testMode is now a ValueHolder
ca
parents: 113
diff changeset
   236
! !
39acd704ad51 testMode is now a ValueHolder
ca
parents: 113
diff changeset
   237
39acd704ad51 testMode is now a ValueHolder
ca
parents: 113
diff changeset
   238
!UIObjectView methodsFor:'accessing behavior'!
39acd704ad51 testMode is now a ValueHolder
ca
parents: 113
diff changeset
   239
39acd704ad51 testMode is now a ValueHolder
ca
parents: 113
diff changeset
   240
enabled
39acd704ad51 testMode is now a ValueHolder
ca
parents: 113
diff changeset
   241
    ^ enableChannel value
39acd704ad51 testMode is now a ValueHolder
ca
parents: 113
diff changeset
   242
!
39acd704ad51 testMode is now a ValueHolder
ca
parents: 113
diff changeset
   243
39acd704ad51 testMode is now a ValueHolder
ca
parents: 113
diff changeset
   244
enabled:aState
39acd704ad51 testMode is now a ValueHolder
ca
parents: 113
diff changeset
   245
    "set the modification / test mode
39acd704ad51 testMode is now a ValueHolder
ca
parents: 113
diff changeset
   246
    "
39acd704ad51 testMode is now a ValueHolder
ca
parents: 113
diff changeset
   247
    (aState == enableChannel value) ifFalse:[
123
421d412e797b keep old selection before starting test and
ca
parents: 119
diff changeset
   248
        aState ifFalse:[
131
715b3dbba87d selection handling changed
ca
parents: 128
diff changeset
   249
            saveSelection := self selection.
715b3dbba87d selection handling changed
ca
parents: 128
diff changeset
   250
            self select:nil.
128
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
   251
            enableChannel value:aState.
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
   252
            inputView unrealize.
119
39acd704ad51 testMode is now a ValueHolder
ca
parents: 113
diff changeset
   253
        ] ifTrue:[
39acd704ad51 testMode is now a ValueHolder
ca
parents: 113
diff changeset
   254
            inputView raise.
123
421d412e797b keep old selection before starting test and
ca
parents: 119
diff changeset
   255
            inputView realize.
128
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
   256
            enableChannel value:aState.
123
421d412e797b keep old selection before starting test and
ca
parents: 119
diff changeset
   257
            self select:saveSelection.
421d412e797b keep old selection before starting test and
ca
parents: 119
diff changeset
   258
        ]
119
39acd704ad51 testMode is now a ValueHolder
ca
parents: 113
diff changeset
   259
    ]
39acd704ad51 testMode is now a ValueHolder
ca
parents: 113
diff changeset
   260
39acd704ad51 testMode is now a ValueHolder
ca
parents: 113
diff changeset
   261
39acd704ad51 testMode is now a ValueHolder
ca
parents: 113
diff changeset
   262
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   263
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   264
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   265
testMode
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   266
    "returns true if running test
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   267
    "
119
39acd704ad51 testMode is now a ValueHolder
ca
parents: 113
diff changeset
   268
    ^ enableChannel value not
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   269
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   270
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   271
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   272
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   273
testMode:aBoolean
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   274
    "change test mode
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   275
    "
119
39acd704ad51 testMode is now a ValueHolder
ca
parents: 113
diff changeset
   276
    self enabled:(aBoolean not)
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   277
! !
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   278
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   279
!UIObjectView methodsFor:'blocked'!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   280
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   281
addObject:anObject
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   282
    "add the argument, anObject to the contents - with redraw
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   283
    "
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   284
    self halt
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   285
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   286
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   287
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   288
addObjectWithoutRedraw:anObject
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   289
    "add the argument, anObject to the contents - with redraw
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   290
    "
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   291
    self halt
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   292
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   293
! !
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   294
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   295
!UIObjectView methodsFor:'event handling'!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   296
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   297
elementChangedSize:aView
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   298
    "some element has changed its size; collect them during selectionHiddenLevel 
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   299
     is on
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   300
    "
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   301
    selectionHiddenLevel ~~ 0 ifTrue:[
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   302
        setOfSuperViewsSizeChanged add:aView superView
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   303
    ] ifFalse:[
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   304
        aView superView sizeChanged:nil
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   305
    ]
60
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
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   308
exposeX:x y:y width:w height:h
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   309
    "handle an expose event from device; redraw selection
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   310
    "
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   311
    super exposeX:x y:y width:w height:h.
132
8649766ce095 catch expose events for all subviews associated with
ca
parents: 131
diff changeset
   312
8649766ce095 catch expose events for all subviews associated with
ca
parents: 131
diff changeset
   313
"
8649766ce095 catch expose events for all subviews associated with
ca
parents: 131
diff changeset
   314
catch expose events for all subviews associated with
8649766ce095 catch expose events for all subviews associated with
ca
parents: 131
diff changeset
   315
a selected instance
8649766ce095 catch expose events for all subviews associated with
ca
parents: 131
diff changeset
   316
"
8649766ce095 catch expose events for all subviews associated with
ca
parents: 131
diff changeset
   317
8649766ce095 catch expose events for all subviews associated with
ca
parents: 131
diff changeset
   318
    self selectionDo:[:aComponent |
8649766ce095 catch expose events for all subviews associated with
ca
parents: 131
diff changeset
   319
        aComponent withAllSubViewsDo:[:v |
8649766ce095 catch expose events for all subviews associated with
ca
parents: 131
diff changeset
   320
            self sensor flushExposeEventsFor:v.
8649766ce095 catch expose events for all subviews associated with
ca
parents: 131
diff changeset
   321
            v exposeX:0 y:0 width:9999 height:9999.
8649766ce095 catch expose events for all subviews associated with
ca
parents: 131
diff changeset
   322
        ].
8649766ce095 catch expose events for all subviews associated with
ca
parents: 131
diff changeset
   323
8649766ce095 catch expose events for all subviews associated with
ca
parents: 131
diff changeset
   324
        self showSelected:aComponent
8649766ce095 catch expose events for all subviews associated with
ca
parents: 131
diff changeset
   325
    ]
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   326
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   327
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   328
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   329
keyPress:key x:x y:y
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   330
    "any key pressed
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   331
    "
78
a0a00603a8b6 keep spec in properties
ca
parents: 76
diff changeset
   332
    <resource: #keyboard ( #Delete #BackSpace #Cut #Copy #Paste ) >
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   333
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   334
    (key == #Cut or:[key == #Delete or:[key == #BackSpace]]) ifTrue: [
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   335
        ^ self deleteSelection
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   336
    ].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   337
78
a0a00603a8b6 keep spec in properties
ca
parents: 76
diff changeset
   338
    key == #Copy  ifTrue:[ ^ self copySelection].
a0a00603a8b6 keep spec in properties
ca
parents: 76
diff changeset
   339
    key == #Paste ifTrue:[ ^ self pasteBuffer].
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   340
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   341
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   342
processEvent:anEvent
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   343
    "catch expose events for components, and redraw its handles after
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   344
     the redraw when this happens
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   345
    "
128
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
   346
    (anEvent type == #damage and:[self isSelected:(anEvent view)]) ifTrue:[
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
   347
        self showSelected:(anEvent view)
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   348
    ].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   349
    ^ false.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   350
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   351
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   352
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   353
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   354
sizeChanged:how
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   355
    "size of a view(s) changed
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   356
    "
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   357
    self withSelectionHiddenDo:[
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   358
        super sizeChanged:how
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   359
    ]
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
!UIObjectView methodsFor:'initialization'!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   365
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   366
initialize
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   367
    "setup attributes
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   368
    "
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   369
    super initialize.
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
    "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
   372
     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
   373
     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
   374
     is always on top
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   375
    "
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   376
    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
   377
    setOfSuperViewsSizeChanged := IdentitySet new.
60
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
    inputView eventReceiver:self.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   380
    inputView enableButtonEvents.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   381
    inputView enableButtonMotionEvents.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   382
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   383
    self setDefaultActions.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   384
119
39acd704ad51 testMode is now a ValueHolder
ca
parents: 113
diff changeset
   385
    undoHistory          := UndoHistory new.
39acd704ad51 testMode is now a ValueHolder
ca
parents: 113
diff changeset
   386
    enableChannel        := true asValue.
39acd704ad51 testMode is now a ValueHolder
ca
parents: 113
diff changeset
   387
    clipChildren         := true.
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   388
    selectionHiddenLevel := 0.
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   389
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   390
    (self class gridShown) ifTrue:[
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   391
        super showGrid
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   392
    ].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   393
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   394
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   395
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   396
realize
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   397
    super realize.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   398
    self windowGroup postEventHook:self
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   399
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   400
! !
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   401
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   402
!UIObjectView methodsFor:'misc'!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   403
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   404
cursor:aCursor
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   405
    "set cursor
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   406
    "
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   407
    inputView realized ifTrue:[
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   408
        inputView cursor:aCursor
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   409
    ].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   410
    super cursor:aCursor
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   411
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   412
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   413
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   414
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   415
invertOutlineOf:anObject
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   416
    "invert outline of an object
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   417
    "
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   418
    |wasClipped delta|
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   419
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   420
    (wasClipped := clipChildren) ifTrue:[
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   421
        self clippedByChildren:(clipChildren := false).
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   422
    ].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   423
    delta := (anObject originRelativeTo:self) - anObject origin.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   424
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   425
    self xoring:[
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   426
        self displayRectangle:((anObject origin + delta) extent:anObject extent).
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   427
    ].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   428
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   429
    wasClipped ifTrue:[
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   430
        self clippedByChildren:(clipChildren := true).
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   431
    ].
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
    "Modified: 5.9.1995 / 12:25:25 / claus"
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
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   437
78
a0a00603a8b6 keep spec in properties
ca
parents: 76
diff changeset
   438
minSetOfSuperViews:setOfViews
a0a00603a8b6 keep spec in properties
ca
parents: 76
diff changeset
   439
a0a00603a8b6 keep spec in properties
ca
parents: 76
diff changeset
   440
    setOfViews isCollection ifFalse:[
a0a00603a8b6 keep spec in properties
ca
parents: 76
diff changeset
   441
        setOfViews notNil ifTrue:[^ Array with:setOfViews]
a0a00603a8b6 keep spec in properties
ca
parents: 76
diff changeset
   442
                         ifFalse:[^ nil]
72
a5a7054e2b7d *** empty log message ***
ca
parents: 68
diff changeset
   443
    ].
a5a7054e2b7d *** empty log message ***
ca
parents: 68
diff changeset
   444
78
a0a00603a8b6 keep spec in properties
ca
parents: 76
diff changeset
   445
  ^ setOfViews select:[:aView|
a0a00603a8b6 keep spec in properties
ca
parents: 76
diff changeset
   446
        (setOfViews detect:[:v|aView isComponentOf:v] ifNone:nil) isNil
a0a00603a8b6 keep spec in properties
ca
parents: 76
diff changeset
   447
    ]
72
a5a7054e2b7d *** empty log message ***
ca
parents: 68
diff changeset
   448
!
a5a7054e2b7d *** empty log message ***
ca
parents: 68
diff changeset
   449
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   450
setDefaultActions
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   451
    "set default actions
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   452
    "
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   453
    pressAction      := [:pressPoint | self startSelectOrMove:pressPoint].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   454
    shiftPressAction := [:pressPoint | self startSelectMoreOrMove:pressPoint].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   455
    motionAction     := [:movePoint  | nil].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   456
    releaseAction    := [nil].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   457
    keyPressAction   := nil.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   458
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   459
    self cursor:Cursor normal.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   460
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:'object creation'!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   464
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   465
actionCreate:anObject frame:aFrame delta:aDelta
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   466
    "create and initialize action data
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   467
    "
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   468
    |extent x y selectors values|
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   469
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   470
"minimum extent
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   471
"
82
99dc76d66eab checkin from browser
ca
parents: 79
diff changeset
   472
    (anObject specClass supportsSubComponents) ifTrue:[
84
da0459487089 instance creation within a widget
ca
parents: 82
diff changeset
   473
        extent := 25@25
82
99dc76d66eab checkin from browser
ca
parents: 79
diff changeset
   474
    ] ifFalse:[
99dc76d66eab checkin from browser
ca
parents: 79
diff changeset
   475
        extent := self extent.
99dc76d66eab checkin from browser
ca
parents: 79
diff changeset
   476
        x := extent x // 3.
99dc76d66eab checkin from browser
ca
parents: 79
diff changeset
   477
        y := extent y // 3.
99dc76d66eab checkin from browser
ca
parents: 79
diff changeset
   478
        extent := anObject preferredExtent.
99dc76d66eab checkin from browser
ca
parents: 79
diff changeset
   479
99dc76d66eab checkin from browser
ca
parents: 79
diff changeset
   480
        (extent x > x) ifTrue:[extent x:x].
99dc76d66eab checkin from browser
ca
parents: 79
diff changeset
   481
        (extent y > y) ifTrue:[extent y:y].
99dc76d66eab checkin from browser
ca
parents: 79
diff changeset
   482
    ].
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   483
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   484
"setup structure
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   485
"
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   486
    selectors := #( object frame delta vertical horizontal minExtent ).
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   487
    values    := Array new:(selectors size).
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   488
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   489
    values at:1 put:anObject.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   490
    values at:2 put:aFrame.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   491
    values at:3 put:aDelta.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   492
    values at:4 put:(self isVerticalResizable:anObject).
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   493
    values at:5 put:(self isHorizontalResizable:anObject).
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   494
    values at:6 put:extent.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   495
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   496
    actionData := Structure newWith:selectors values:values.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   497
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
"can change cursor dependent on vertical/horizontal resizing
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   500
"
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   501
    oldCursor := cursor.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   502
    self cursor:(Cursor leftHand).
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   503
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   504
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
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   507
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   508
createWidgetWithClass:aClass
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   509
    "prepare to create new widgets
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   510
    "
89
35c5711729c2 so far so good
ca
parents: 84
diff changeset
   511
    aClass notNil ifTrue:[
35c5711729c2 so far so good
ca
parents: 84
diff changeset
   512
        createClass := aClass.
35c5711729c2 so far so good
ca
parents: 84
diff changeset
   513
        pressAction := [:aPoint| self startCreate:aPoint].
35c5711729c2 so far so good
ca
parents: 84
diff changeset
   514
        self cursor:Cursor origin.
35c5711729c2 so far so good
ca
parents: 84
diff changeset
   515
    ]
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   516
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   517
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   518
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   519
doDragCreate:aPoint
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   520
    "do a widget create drag
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
    |frame object extent minimum|
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   523
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   524
    frame   := actionData frame.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   525
    frame corner:((self alignToGrid:aPoint) - (actionData delta)).
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   526
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   527
    object  := actionData object.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   528
    minimum := actionData minExtent.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   529
    extent  := frame extent.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   530
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   531
    ((extent x < minimum x) or:[actionData horizontal not]) ifTrue:[
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   532
        extent x:(minimum x)
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
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   535
    ((extent y < minimum y) or:[actionData vertical not]) ifTrue:[
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   536
        extent y:(minimum y)
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   537
    ].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   538
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   539
    frame extent:extent.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   540
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   541
    self invertOutlineOf:object.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   542
    object origin:(frame origin) extent:(frame extent).
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   543
    self invertOutlineOf:object.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   544
!
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
endCreate
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   547
    "end a widget create drag
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   548
    "
89
35c5711729c2 so far so good
ca
parents: 84
diff changeset
   549
    |object specClass|
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   550
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   551
    object := actionData object.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   552
    self invertOutlineOf:object.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   553
    inputView raise.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   554
89
35c5711729c2 so far so good
ca
parents: 84
diff changeset
   555
    self setupInitialLayoutFor:object.
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   556
    self select:object.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   557
    actionData := nil.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   558
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   559
    self setDefaultActions.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   560
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
78
a0a00603a8b6 keep spec in properties
ca
parents: 76
diff changeset
   563
initializeCreatedObject:anObject
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   564
    self subclassResponsibility
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   565
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   566
89
35c5711729c2 so far so good
ca
parents: 84
diff changeset
   567
setupInitialLayoutFor:anObject
35c5711729c2 so far so good
ca
parents: 84
diff changeset
   568
    "setup initial layout for an object; !!!! some kludge !!!!
35c5711729c2 so far so good
ca
parents: 84
diff changeset
   569
    "
35c5711729c2 so far so good
ca
parents: 84
diff changeset
   570
    |spec topSpec|
35c5711729c2 so far so good
ca
parents: 84
diff changeset
   571
35c5711729c2 so far so good
ca
parents: 84
diff changeset
   572
    topSpec := anObject superView specClass basicNew.
35c5711729c2 so far so good
ca
parents: 84
diff changeset
   573
35c5711729c2 so far so good
ca
parents: 84
diff changeset
   574
    topSpec class isLayoutContainer ifFalse:[
35c5711729c2 so far so good
ca
parents: 84
diff changeset
   575
35c5711729c2 so far so good
ca
parents: 84
diff changeset
   576
"/ ... KLUDGE ....
35c5711729c2 so far so good
ca
parents: 84
diff changeset
   577
35c5711729c2 so far so good
ca
parents: 84
diff changeset
   578
        spec := anObject specClass.
35c5711729c2 so far so good
ca
parents: 84
diff changeset
   579
35c5711729c2 so far so good
ca
parents: 84
diff changeset
   580
        (    spec == ViewSpec
35c5711729c2 so far so good
ca
parents: 84
diff changeset
   581
         or:[spec == SubCanvasSpec
35c5711729c2 so far so good
ca
parents: 84
diff changeset
   582
         or:[spec == TextEditorSpec
35c5711729c2 so far so good
ca
parents: 84
diff changeset
   583
         or:[spec == SequenceViewSpec]]]
35c5711729c2 so far so good
ca
parents: 84
diff changeset
   584
        ) ifTrue:[
35c5711729c2 so far so good
ca
parents: 84
diff changeset
   585
            anObject geometryLayout:(anObject bounds asLayout).
35c5711729c2 so far so good
ca
parents: 84
diff changeset
   586
          ^ self
35c5711729c2 so far so good
ca
parents: 84
diff changeset
   587
        ]
35c5711729c2 so far so good
ca
parents: 84
diff changeset
   588
    ].
35c5711729c2 so far so good
ca
parents: 84
diff changeset
   589
    topSpec setupInitialLayoutFor:anObject.
35c5711729c2 so far so good
ca
parents: 84
diff changeset
   590
35c5711729c2 so far so good
ca
parents: 84
diff changeset
   591
!
35c5711729c2 so far so good
ca
parents: 84
diff changeset
   592
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   593
startCreate:aPoint
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   594
    "start a widget create
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   595
    "
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   596
    |widget object start frame delta|
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   597
131
715b3dbba87d selection handling changed
ca
parents: 128
diff changeset
   598
    self select:nil.
89
35c5711729c2 so far so good
ca
parents: 84
diff changeset
   599
    widget := self findContainerViewAt:aPoint.
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   600
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   601
    motionAction  := [:movePoint| self doDragCreate:movePoint].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   602
    releaseAction := [ self endCreate].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   603
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   604
    object := createClass new.
76
c9c4254a9ee5 *** empty log message ***
ca
parents: 72
diff changeset
   605
    (widget isKindOf:ScrollableView) ifTrue:[
c9c4254a9ee5 *** empty log message ***
ca
parents: 72
diff changeset
   606
        widget scrolledView:object
c9c4254a9ee5 *** empty log message ***
ca
parents: 72
diff changeset
   607
    ] ifFalse:[
c9c4254a9ee5 *** empty log message ***
ca
parents: 72
diff changeset
   608
        widget addSubView:object.
c9c4254a9ee5 *** empty log message ***
ca
parents: 72
diff changeset
   609
    ].
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   610
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   611
    start := self alignToGrid:aPoint.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   612
    delta := widget originRelativeTo:self.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   613
    frame := Rectangle origin:(start - delta) corner:start.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   614
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   615
    object origin:(frame origin).
78
a0a00603a8b6 keep spec in properties
ca
parents: 76
diff changeset
   616
    self initializeCreatedObject:object.
82
99dc76d66eab checkin from browser
ca
parents: 79
diff changeset
   617
    self actionCreate:object frame:frame delta:delta.
99dc76d66eab checkin from browser
ca
parents: 79
diff changeset
   618
    object extent:(actionData minExtent).
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   619
    object realize.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   620
    self invertOutlineOf:object.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   621
! !
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   622
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   623
!UIObjectView methodsFor:'object moving'!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   624
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   625
doObjectMove:aPoint
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   626
    "move selection
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
    movedObject notNil ifTrue:[
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   629
        movedObject keysAndValuesDo:[:nr :aView|
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   630
            self invertOutlineOf:aView.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   631
            self moveObject:aView to:(aPoint - (moveDelta at:nr)).
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   632
            self invertOutlineOf:aView.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   633
        ]
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   634
    ]
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
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   637
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   638
endObjectMove
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   639
    "cleanup after object(s) move
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   640
    "
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   641
    movedObject notNil ifTrue:[
128
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
   642
        movedObject do:[:aView|self invertOutlineOf:aView].
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
   643
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
   644
        movedObject size == 1 ifTrue:[
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
   645
            movedObject := movedObject first
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   646
        ].
128
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
   647
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
   648
        self setSelection:movedObject withRedraw:true.
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   649
        movedObject := nil.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   650
        self setDefaultActions.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   651
        self changed:#layout.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   652
    ].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   653
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   654
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   655
moveObject:anObject to:aPoint
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   656
    "move anObject to newOrigin, aPoint
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
    |dX dY org delta|
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   659
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   660
    anObject notNil ifTrue:[
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   661
        org := anObject computeOrigin.
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
        delta := aPoint - org.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   664
        delta := (self alignToGrid:aPoint) - org.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   665
        dX := delta x.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   666
        dY := delta y.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   667
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   668
        undoHistory disabledTransitionDo:[
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   669
            self shiftLayout:anObject top:dY bottom:dY left:dX right:dX
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   670
        ]
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   671
    ]
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   672
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   673
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   674
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   675
startObjectMoveAt:aPoint
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   676
    "start object(s) move at a point
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   677
    "
128
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
   678
    self startObjectMove:(self selection) at:aPoint.
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
   679
    movedObject := self selection.
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
   680
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
   681
    movedObject isCollection ifFalse:[
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
   682
        movedObject := Array with:movedObject
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   683
    ].
128
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
   684
    self setSelection:nil withRedraw:true.
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   685
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   686
    moveDelta := movedObject collect:[:aView|
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   687
        aPoint - aView computeOrigin
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   688
    ].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   689
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   690
    self transaction:#move objects:movedObject do:[:aView|
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   691
        self invertOutlineOf:aView.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   692
        self undoLayoutView:aView
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
!
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
startSelectMoreOrMove:aPoint
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   698
    "add/remove to/from 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
    |anObject|
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   701
119
39acd704ad51 testMode is now a ValueHolder
ca
parents: 113
diff changeset
   702
    self enabled ifFalse:[^ self].
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   703
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   704
    anObject := self findObjectAt:aPoint.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   705
    anObject notNil ifTrue:[
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   706
        (self isSelected:anObject) ifTrue:[
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   707
            self removeFromSelection:anObject
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   708
        ] ifFalse:[
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   709
            self addToSelection:anObject
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
    ]
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   712
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   713
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   714
startSelectOrMove:aPoint
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   715
    "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
   716
    "
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   717
    |aView b|
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   718
119
39acd704ad51 testMode is now a ValueHolder
ca
parents: 113
diff changeset
   719
    self enabled ifFalse:[^ self].
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   720
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   721
    aView := self singleSelection.
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   722
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   723
    aView notNil ifTrue:[
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   724
        (aView superView specClass canResizeSubComponents) ifTrue:[
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   725
            b := self whichHandleOf:aView isHitBy:aPoint.
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   726
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   727
            (b notNil and:[b ~~ #view]) ifTrue:[
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   728
                ^ self startResizeBorder:b of:aView.
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   729
            ]
100
01775d3d8489 startSelectOrMove:aPoint
ca
parents: 99
diff changeset
   730
        ].
01775d3d8489 startSelectOrMove:aPoint
ca
parents: 99
diff changeset
   731
01775d3d8489 startSelectOrMove:aPoint
ca
parents: 99
diff changeset
   732
        (self sensor ctrlDown and:[self canMove:aView]) ifFalse:[
01775d3d8489 startSelectOrMove:aPoint
ca
parents: 99
diff changeset
   733
            aView := nil
60
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
    ].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   736
100
01775d3d8489 startSelectOrMove:aPoint
ca
parents: 99
diff changeset
   737
    aView isNil ifTrue:[
01775d3d8489 startSelectOrMove:aPoint
ca
parents: 99
diff changeset
   738
        (aView := self findObjectAt:aPoint) isNil ifTrue:[
131
715b3dbba87d selection handling changed
ca
parents: 128
diff changeset
   739
            ^ self select:nil
100
01775d3d8489 startSelectOrMove:aPoint
ca
parents: 99
diff changeset
   740
        ].
01775d3d8489 startSelectOrMove:aPoint
ca
parents: 99
diff changeset
   741
01775d3d8489 startSelectOrMove:aPoint
ca
parents: 99
diff changeset
   742
        (self canMove:aView) ifFalse:[
128
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
   743
            ^ self select:aView
100
01775d3d8489 startSelectOrMove:aPoint
ca
parents: 99
diff changeset
   744
        ]
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   745
    ].
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   746
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   747
    (self isSelected:aView) ifFalse:[
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   748
        self select:aView.
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   749
    ].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   750
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   751
    (self numberOfSelections ~~ 1) ifTrue:[
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   752
        releaseAction := [
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   753
            self setDefaultActions.
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   754
            self select:aView
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   755
        ]
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   756
    ] ifFalse:[
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   757
        releaseAction := [self setDefaultActions]
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   758
    ].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   759
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   760
    "prepare move operation for an object
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   761
    "
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   762
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   763
    motionAction := [:movePoint|
72
a5a7054e2b7d *** empty log message ***
ca
parents: 68
diff changeset
   764
        (aPoint dist:movePoint) > 8.0 ifTrue:[
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   765
            self startObjectMoveAt:aPoint
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   766
        ]
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
! !
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   769
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   770
!UIObjectView methodsFor:'object resize'!
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
actionResize:anObject selector:aSelector
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   773
    "create and initialize action for resize
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   774
    "
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   775
    |selector delta|
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   776
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   777
    delta    := anObject container originRelativeTo:self.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   778
    selector := ('resize:', aSelector, ':') asSymbol.
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
    actionData := Structure with:(#object->anObject)
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   781
                            with:(#selector->selector)
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   782
                            with:(#delta->delta).
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   783
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   784
"can change cursor dependent on vertical/horizontal resizing
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   785
"
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   786
    oldCursor := cursor.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   787
    self cursor:(Cursor leftHand).
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   788
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   789
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   790
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   791
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   792
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   793
doDragResize:aPoint
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   794
    "do a widget resize drag
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   795
    "
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   796
    |p object|
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   797
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   798
    object := actionData object.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   799
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   800
    self invertOutlineOf:object.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   801
    p := (self alignToGrid:aPoint) - (actionData delta).
79
33212fbe9766 resize extent
ca
parents: 78
diff changeset
   802
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   803
    self perform:(actionData selector) with:object with:p.
79
33212fbe9766 resize extent
ca
parents: 78
diff changeset
   804
   "/ object geometryLayout:(object geometryLayout).
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   805
    self invertOutlineOf:object
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   806
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   807
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   808
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   809
endResize
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   810
    "cleanup after object resize
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   811
    "
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   812
    |object|
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   813
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   814
    object := actionData object.
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   815
    actionData := nil.
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   816
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   817
    self invertOutlineOf:object.
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   818
    self setDefaultActions.
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   819
    self elementChangedSize:object.
128
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
   820
    self setSelection:object withRedraw:true.
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   821
    self changed:#layout.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   822
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   823
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   824
startResizeBorder:b of:selection
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   825
    "resize selected view
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   826
    "
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   827
    |object|
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
    object := self singleSelection.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   830
    self actionResize:object selector:b.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   831
72
a5a7054e2b7d *** empty log message ***
ca
parents: 68
diff changeset
   832
    self transaction:#resize selectionDo:[:aView|
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   833
        self undoLayoutView:aView
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   834
    ].
128
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
   835
    self setSelection:nil withRedraw:true.
60
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
    motionAction  := [:movePoint | self doDragResize:movePoint].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   838
    releaseAction := [self endResize].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   839
    self invertOutlineOf:object
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   840
! !
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
!UIObjectView methodsFor:'private handles'!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   843
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   844
handlesOf:aView do:aBlock
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   845
    |dlta type v h|
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   846
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   847
    dlta := (aView originRelativeTo:self) - aView origin.
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   848
    type := self class layoutType:aView.
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   849
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   850
    (type == #LayoutFrame or:[type == #Rectangle]) ifTrue:[
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   851
        v := self isVerticalResizable:aView.
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   852
        h := self isHorizontalResizable:aView.
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   853
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   854
        h ifTrue:[  aBlock value:(aView leftCenter   + dlta) value:#left.
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   855
                    aBlock value:(aView rightCenter  + dlta) value:#right.
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   856
                 ].
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   857
        v ifTrue:[  aBlock value:(aView topCenter    + dlta) value:#top.
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   858
                    aBlock value:(aView bottomCenter + dlta) value:#bottom.
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   859
                 ].
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   860
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   861
        (h and:[v]) ifTrue:[
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   862
            aBlock value:(aView origin     + dlta) value:#origin.
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   863
            aBlock value:(aView topRight   + dlta) value:#topRight.
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   864
            aBlock value:(aView bottomLeft + dlta) value:#bottomLeft.
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   865
            aBlock value:(aView corner     + dlta) value:#corner.
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   866
          ^ self
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   867
        ]
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   868
    ].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   869
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   870
    aBlock value:(aView origin     + dlta) value:#view.
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   871
    aBlock value:(aView topRight   + dlta) value:#view.
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   872
    aBlock value:(aView bottomLeft + dlta) value:#view.
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   873
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   874
    type == #Extent ifTrue:[
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   875
        v := self isVerticalResizable:aView.
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   876
        h := self isHorizontalResizable:aView.
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   877
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   878
        v ifTrue:[aBlock value:(aView bottomCenter + dlta) value:#bottom].
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   879
        h ifTrue:[aBlock value:(aView rightCenter  + dlta) value:#right ].
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   880
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   881
        (h and:[v]) ifTrue:[
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   882
            aBlock value:(aView corner + dlta) value:#corner.
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   883
          ^ self
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   884
        ]
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   885
    ].
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   886
    aBlock value:(aView corner + dlta) value:#view.
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   887
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   888
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   889
showSelected:aComponent
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   890
    "show object selected
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   891
    "
132
8649766ce095 catch expose events for all subviews associated with
ca
parents: 131
diff changeset
   892
    |wasClipped delta|
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   893
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   894
    self paint:Color black.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   895
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   896
    (wasClipped := clipChildren) ifTrue:[
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   897
        self clippedByChildren:(clipChildren := false). 
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
    self handlesOf:aComponent do:[:pnt :what |
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   901
        what == #view ifTrue:[self displayRectangle:(pnt - (4@4) extent:7@7)]
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   902
                     ifFalse:[self    fillRectangle:(pnt - (4@4) extent:7@7)]
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   903
    ].
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
    wasClipped ifTrue:[
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   906
        self clippedByChildren:(clipChildren := true).
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   907
    ].
132
8649766ce095 catch expose events for all subviews associated with
ca
parents: 131
diff changeset
   908
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   909
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   910
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   911
showUnselected:aComponent
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   912
    "show object unselected
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   913
    "
132
8649766ce095 catch expose events for all subviews associated with
ca
parents: 131
diff changeset
   914
    |wasClipped delta r|
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   915
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   916
    (wasClipped := clipChildren) ifTrue:[
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   917
        self clippedByChildren:(clipChildren := false). 
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   918
    ].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   919
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   920
    self handlesOf:aComponent do:[:pnt :what |
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   921
        self clearRectangle:(pnt - (4@4) extent:7@7).
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   922
    ].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   923
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   924
    wasClipped ifTrue:[
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   925
        self clippedByChildren:(clipChildren := true). 
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   926
    ].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   927
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   928
    "/ must redraw all components which are affected b the handles
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   929
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   930
    r := (aComponent originRelativeTo:self) - (4@4)
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   931
             extent:(aComponent extent + (4@4)).
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   932
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   933
    subViews do:[:anotherComponent |
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   934
        |absOrg absFrame|
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   935
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   936
        anotherComponent ~~ inputView ifTrue:[
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   937
            absOrg := anotherComponent originRelativeTo:self.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   938
            absFrame := absOrg extent:(anotherComponent extent).
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   939
            (absFrame intersects:r) ifTrue:[
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   940
                anotherComponent withAllSubViewsDo:[:v |
95
c20189d75ec3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 91
diff changeset
   941
                    v shown ifTrue:[
132
8649766ce095 catch expose events for all subviews associated with
ca
parents: 131
diff changeset
   942
                        v fill:v viewBackground.
95
c20189d75ec3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 91
diff changeset
   943
                        v exposeX:0 y:0 width:9999 height:9999.
c20189d75ec3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 91
diff changeset
   944
                    ]
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   945
                ]
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   946
            ]
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   947
        ]
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   948
    ]
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   949
95
c20189d75ec3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 91
diff changeset
   950
    "Modified: 8.4.1997 / 00:32:26 / cg"
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   951
!
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
whichHandleOf:aView isHitBy:aPoint
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   954
    "returns kind of handle or nil
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   955
    "
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   956
    |bounds|
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   957
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   958
    self handlesOf:aView do:[:pnt :what |
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   959
        ((pnt - (4@4) extent:7@7) containsPoint:aPoint) ifTrue:[
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   960
            ^ what
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   961
        ].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   962
    ].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   963
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   964
    ^ nil
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   965
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   966
    "Modified: 5.9.1995 / 14:39:34 / claus"
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   967
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   968
! !
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   969
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   970
!UIObjectView methodsFor:'private resizing-subviews'!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   971
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   972
resize:aView bottom:aPoint
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   973
    "resize a views bottom
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   974
    "
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   975
    undoHistory disabledTransitionDo:[
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   976
        self shiftLayout:aView top:0 bottom:((aPoint y) - (aView computeCorner y))
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   977
    ]
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   978
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   979
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   980
resize:aView bottomLeft:aPoint
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   981
    "resize a views bottom and left
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   982
    "
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   983
    undoHistory disabledTransitionDo:[
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   984
        self shiftLayout:aView top:0
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   985
                            bottom:((aPoint y) - (aView computeCorner y))
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   986
                              left:((aPoint x) - (aView computeOrigin x))
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   987
                             right:0
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   988
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   989
    ]
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   990
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   991
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   992
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   993
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   994
resize:aView corner:aPoint
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   995
    "resize a views corner
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
   996
    "
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   997
    |delta|
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   998
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
   999
    delta := aPoint - aView computeCorner.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1000
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1001
    undoHistory disabledTransitionDo:[
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1002
        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
  1003
    ]
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1004
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1005
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1006
resize:aView left:aPoint
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1007
    "resize a views left
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1008
    "
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1009
    undoHistory disabledTransitionDo:[
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1010
        self shiftLayout:aView left:((aPoint x) - (aView computeOrigin x)) right:0
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1011
    ]
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1012
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1013
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1014
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1015
resize:aView origin:aPoint
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1016
    "resize a views origin
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1017
    "
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1018
    |delta|
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1019
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1020
    delta := aPoint - aView computeOrigin.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1021
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1022
    undoHistory disabledTransitionDo:[
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1023
        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
  1024
    ]
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1025
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1026
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1027
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1028
resize:aView right:aPoint
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1029
    "resize a views right
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1030
    "
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1031
    undoHistory disabledTransitionDo:[
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1032
        self shiftLayout:aView left:0 right:((aPoint x) - (aView computeCorner x))
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1033
    ]
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1034
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1035
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1036
resize:aView top:aPoint
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1037
    "resize a views top
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1038
    "
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1039
    undoHistory disabledTransitionDo:[
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1040
        self shiftLayout:aView top:((aPoint y) - (aView computeOrigin y)) bottom:0
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1041
    ]
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
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1044
resize:aView topRight:aPoint
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1045
    "resize a views top and right
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1046
    "
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1047
    undoHistory disabledTransitionDo:[
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1048
        self shiftLayout:aView top:((aPoint y) - (aView computeOrigin y))
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1049
                            bottom:0
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1050
                              left:0
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1051
                             right:((aPoint x) - (aView computeCorner x))
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1052
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1053
    ]
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1054
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1055
! !
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1056
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1057
!UIObjectView methodsFor:'private shift-layout'!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1058
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1059
shiftLayout:aView left:l right:r
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1060
    "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
  1061
     action is registered
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
    self shiftLayout:aView top:0 bottom:0 left:l right:r
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1064
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1065
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1066
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1067
shiftLayout:aView top:t bottom:b
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1068
    "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
  1069
     action is registered
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1070
    "
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1071
    self shiftLayout:aView top:t bottom:b left:0 right:0
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1072
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1073
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1074
!
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
shiftLayout:aView top:t bottom:b left:l right:r
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1077
    "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
  1078
     action is registered
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1079
    "
79
33212fbe9766 resize extent
ca
parents: 78
diff changeset
  1080
    |type layout oldExt|
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1081
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1082
    type := self class layoutType:aView.
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1083
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1084
    type notNil ifTrue:[
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1085
        self undoLayoutView:aView.
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1086
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1087
        type == #Extent ifTrue:[
79
33212fbe9766 resize extent
ca
parents: 78
diff changeset
  1088
            oldExt := aView extent.
33212fbe9766 resize extent
ca
parents: 78
diff changeset
  1089
            aView extent:(oldExt + ((r-l) @ (b-t))).
33212fbe9766 resize extent
ca
parents: 78
diff changeset
  1090
            ^ self 
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1091
        ].
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1092
78
a0a00603a8b6 keep spec in properties
ca
parents: 76
diff changeset
  1093
        layout := aView geometryLayout copy.
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1094
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1095
        layout isLayout ifTrue:[
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1096
            layout leftOffset:(layout leftOffset + l)
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1097
                    topOffset:(layout topOffset  + t).
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1098
                    
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1099
            type == #LayoutFrame ifTrue:[
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1100
                layout bottomOffset:(layout bottomOffset + b).
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1101
                layout  rightOffset:(layout rightOffset  + r).
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1102
            ]
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1103
        ] ifFalse:[
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1104
            type == #Rectangle ifTrue:[
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1105
                layout left:(layout left   + l)
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1106
                      right:(layout right  + r)
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1107
                        top:(layout top    + t)
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1108
                     bottom:(layout bottom + b).
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1109
            ] ifFalse:[     "POINT"
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1110
                layout x:(layout x + l) y:(layout y + t).
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1111
            ]
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1112
        ].
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1113
        aView geometryLayout:layout
60
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
! !
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1116
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1117
!UIObjectView methodsFor:'searching'!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1118
89
35c5711729c2 so far so good
ca
parents: 84
diff changeset
  1119
findContainerViewAt:aPoint
35c5711729c2 so far so good
ca
parents: 84
diff changeset
  1120
    "find container view responds to aPoint.
35c5711729c2 so far so good
ca
parents: 84
diff changeset
  1121
    "
35c5711729c2 so far so good
ca
parents: 84
diff changeset
  1122
    ^ self subclassResponsibility
35c5711729c2 so far so good
ca
parents: 84
diff changeset
  1123
35c5711729c2 so far so good
ca
parents: 84
diff changeset
  1124
35c5711729c2 so far so good
ca
parents: 84
diff changeset
  1125
!
35c5711729c2 so far so good
ca
parents: 84
diff changeset
  1126
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1127
findObjectAt:aPoint
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1128
    "find the origin/corner of the currentWidget
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
    |view viewId lastId point listOfViews|
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1131
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1132
    viewId := rootView id.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1133
    point  := aPoint + (device translatePoint:0@0 from:(self id) to:viewId).
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1134
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1135
    inputView lower.
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
    [viewId notNil] whileTrue:[
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1138
        lastId := viewId.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1139
        viewId := device viewIdFromPoint:point in:lastId
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1140
    ].
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
    inputView raise.
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
    view := device viewFromId:lastId.
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
    view ~~ inputView ifTrue:[^ view].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1147
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1148
    "/ look for 'hidden' views ...
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1149
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1150
    listOfViews := OrderedCollection new.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1151
    self allSubViewsDo:[:aView |
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1152
        |org|
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1153
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1154
        aView ~~ inputView ifTrue:[
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1155
            org := device translatePoint:0@0 from:(aView id) to:self id.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1156
            ((org extent:aView extent) containsPoint:aPoint) ifTrue:[
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1157
                listOfViews add:aView.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1158
            ]
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1159
        ]
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1160
    ].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1161
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1162
    listOfViews size > 0 ifTrue:[
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1163
        ^ listOfViews last
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1164
    ].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1165
    ^ nil
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1166
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1167
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1168
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1169
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1170
isPoint:aPoint containedIn:aView
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1171
    "checks whether a point is covered by a view.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1172
    "
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1173
    |p|
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1174
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1175
    p := device translatePoint:aPoint from:inputView id to:aView id.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1176
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1177
    (p x >= 0 and:[p y >= 0]) ifTrue:[
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1178
        p := aView extent - p.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1179
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1180
        (p x >= 0 and:[p y >= 0]) ifTrue:[
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1181
            ^ true
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1182
        ]
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1183
    ].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1184
    ^ false
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
whichBorderOf:aView isHitBy:aPoint
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1188
    |p r bw org|
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
    bw := aView borderWidth.
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1191
    p := aPoint - (aView superView originRelativeTo:self).
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
    r := Rectangle origin:(aView origin)
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1194
                   extent:(aView width @ bw).
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1195
    (r containsPoint:p) ifTrue:[^ #top:].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1196
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1197
    r origin:(aView left @ (aView bottom + bw)) extent:(aView width @ bw).
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1198
    (r containsPoint:p) ifTrue:[^ #bottom:].
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
    r top:(aView top).
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1201
    r extent:(bw @ aView height).
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1202
    (r containsPoint:p) ifTrue:[^ #left:].
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
    r origin:((aView right + bw) @ aView top).
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1205
    (r containsPoint:p) ifTrue:[^ #right:].
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
    ^ nil
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
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
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1212
!UIObjectView methodsFor:'selections'!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1213
128
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1214
moveableSelection
131
715b3dbba87d selection handling changed
ca
parents: 128
diff changeset
  1215
    "checks whether the selection is not empty and all selected instances
715b3dbba87d selection handling changed
ca
parents: 128
diff changeset
  1216
     can be moved. If true the selection is returned otherwise nil
128
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1217
    "
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1218
    |coll|
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1219
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1220
    self hasSelection ifTrue:[
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1221
        (self canMove:(coll := self selection)) ifTrue:[
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1222
            ^ coll
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1223
        ]
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1224
    ].
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1225
  ^ nil
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1226
!
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1227
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1228
numberOfSelections
131
715b3dbba87d selection handling changed
ca
parents: 128
diff changeset
  1229
    "return the number of selected instances
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1230
    "
128
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1231
    |coll size|
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1232
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1233
    coll := self selection.
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1234
    size := coll size.
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1235
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1236
    (size ~~ 0 or:[coll isNil]) ifTrue:[^ size].
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1237
  ^ 1
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1238
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1239
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1240
select:something
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1241
    "change selection to something
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1242
    "
128
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1243
    (self enabled and:[something ~= self selection]) ifTrue:[
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1244
        self setSelection:something withRedraw:true.
113
1854c2e61c4e bug fixes
ca
parents: 100
diff changeset
  1245
        self selectionChanged
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1246
    ]
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1247
113
1854c2e61c4e bug fixes
ca
parents: 100
diff changeset
  1248
1854c2e61c4e bug fixes
ca
parents: 100
diff changeset
  1249
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1250
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1251
113
1854c2e61c4e bug fixes
ca
parents: 100
diff changeset
  1252
selectionChanged
1854c2e61c4e bug fixes
ca
parents: 100
diff changeset
  1253
    "called whenever the selection changed
1854c2e61c4e bug fixes
ca
parents: 100
diff changeset
  1254
    "
1854c2e61c4e bug fixes
ca
parents: 100
diff changeset
  1255
    self subclassResponsibility
1854c2e61c4e bug fixes
ca
parents: 100
diff changeset
  1256
1854c2e61c4e bug fixes
ca
parents: 100
diff changeset
  1257
!
1854c2e61c4e bug fixes
ca
parents: 100
diff changeset
  1258
128
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1259
selectionDo:aBlock
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1260
    "apply block to every selected object
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1261
    "
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1262
    self forEach:(self selection) do:aBlock
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1263
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1264
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1265
!
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1266
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1267
showSelection
128
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1268
    "show the selection - draw handles
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1269
    "
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1270
    selectionHiddenLevel == 0 ifTrue:[
128
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1271
        self selectionDo:[:el| self showSelected:el ]
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1272
    ].
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1273
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1274
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1275
singleSelection
131
715b3dbba87d selection handling changed
ca
parents: 128
diff changeset
  1276
    "checks whether one element is selected; in this case the element is
715b3dbba87d selection handling changed
ca
parents: 128
diff changeset
  1277
     returned otherwise nil
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1278
    "
128
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1279
    |coll|
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1280
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1281
    (coll := self selection) isCollection ifFalse:[
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1282
        ^ coll
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1283
    ].
128
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1284
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1285
    coll size == 1 ifTrue:[ ^ coll first].
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1286
  ^ nil
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1287
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1288
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1289
singleSelectionDo:aBlock
131
715b3dbba87d selection handling changed
ca
parents: 128
diff changeset
  1290
    "checks whether one element is selected; in this case the block
715b3dbba87d selection handling changed
ca
parents: 128
diff changeset
  1291
     with argument the selected instance will be processed
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1292
    "
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1293
    |view|
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1294
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1295
    (view := self singleSelection) notNil ifTrue:[
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1296
        aBlock value:view
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
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1300
unselect
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1301
    "clear selection
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1302
    "
128
9779b7459a1c selection and update from selection
ca
parents: 123
diff changeset
  1303
    self select:nil
60
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1304
!
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1305
7542ab7fbbfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 59
diff changeset
  1306
withSelectionHiddenDo:aBlock
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1307
    "apply block with selection hidden (no handles)
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1308
    "
78
a0a00603a8b6 keep spec in properties
ca
parents: 76
diff changeset
  1309
    |coll|
a0a00603a8b6 keep spec in properties
ca
parents: 76
diff changeset
  1310
61
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1311
    selectionHiddenLevel := selectionHiddenLevel + 1.
85ef247db6b1 so far so good ...
ca
parents: 60
diff changeset
  1312
85ef247db6b1 so far so good ...
ca
parents: 60
di