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