StrokingWrapper.st
author Claus Gittinger <cg@exept.de>
Wed, 29 May 1996 00:43:47 +0200
changeset 279 bf069aab8a8c
parent 273 f76fb9098814
child 280 39e270e5aa30
permissions -rw-r--r--
checkin from browser
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
 COPYRIGHT (c) 1996 by Claus Gittinger
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
              All Rights Reserved
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 hereby transferred.
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
279
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
    14
Wrapper subclass:#TranslatingWrapper
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
    15
	instanceVariableNames:'origin'
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
	classVariableNames:''
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	poolDictionaries:''
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	category:'Graphics-Display Objects'
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
!
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
279
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
    21
!TranslatingWrapper class methodsFor:'documentation'!
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
copyright
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
"
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
 COPYRIGHT (c) 1996 by Claus Gittinger
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
              All Rights Reserved
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
 This software is furnished under a license and may be used
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
 only in accordance with the terms of that license and with the
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
 be provided or otherwise made available to, or used by, any
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 other person.  No title to or ownership of the software is
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 hereby transferred.
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
"
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
!
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
documentation
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
"
279
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
    40
    a wrapper which shifts the origin of its wrapped component.
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
    41
    This allows the wrapped thingy to think & draw in its own 0/0 based
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
    42
    coordinates.
254
Claus Gittinger <cg@exept.de>
parents: 253
diff changeset
    43
265
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
    44
    Notice: 
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
    45
        this class was implemented using protocol information
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
    46
        from alpha testers and from the Hopkins/Horan book.
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
    47
        - it may not be complete or compatible to the corresponding ST-80 class. 
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
    48
        If you encounter any incompatibilities, please forward a note 
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
    49
        describing the incompatibility verbal (i.e. no code) to the ST/X team.
45c83acd7562 comments
Claus Gittinger <cg@exept.de>
parents: 263
diff changeset
    50
248
266a7ec53d9f more examples & comments
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
    51
    [see also:]
279
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
    52
        Wrapper 
248
266a7ec53d9f more examples & comments
Claus Gittinger <cg@exept.de>
parents: 246
diff changeset
    53
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
    [author:]
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
        Claus Gittinger
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
"
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
!
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
examples
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
"
279
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
    61
  some components without translatingWrapper
273
f76fb9098814 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    62
                                                                        [exBegin]
f76fb9098814 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    63
    |t s v e component|
f76fb9098814 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    64
f76fb9098814 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    65
    t := StandardSystemView extent:250@200.
f76fb9098814 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    66
    s := HVScrollableView for:View miniScroller:true in:t.
f76fb9098814 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    67
    s origin:0.0@0.0 corner:1.0@1.0.
f76fb9098814 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    68
    v := s scrolledView.
f76fb9098814 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    69
f76fb9098814 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    70
    e := Rectangle origin:10@10 corner:90@90.
f76fb9098814 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    71
    component := FillingWrapper on:e.
f76fb9098814 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    72
    component foregroundColor:Color red.
f76fb9098814 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    73
    v addComponent:component.
f76fb9098814 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    74
f76fb9098814 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    75
    e := EllipticalArc boundingBox:(10@10 corner:90@90)
f76fb9098814 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    76
                     startAngle:0 sweepAngle:360.
f76fb9098814 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    77
    component := StrokingWrapper on:e.
f76fb9098814 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    78
    component lineWidth:5.
f76fb9098814 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    79
    v addComponent:component.
f76fb9098814 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    80
f76fb9098814 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    81
    e := Arrow from:100@100 to:150@250.
f76fb9098814 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    82
    component := StrokingWrapper on:e.
f76fb9098814 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    83
    component lineWidth:2.
f76fb9098814 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    84
    v addComponent:component.
f76fb9098814 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
    85
279
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
    86
    t open
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
    87
                                                                        [exEnd]
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
    88
  the same components WITH translatingWrappers
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
    89
                                                                        [exBegin]
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
    90
    |t s v e component|
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
    91
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
    92
    t := StandardSystemView extent:250@200.
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
    93
    s := HVScrollableView for:View miniScroller:true in:t.
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
    94
    s origin:0.0@0.0 corner:1.0@1.0.
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
    95
    v := s scrolledView.
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
    96
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
    97
    e := Rectangle origin:0@0 corner:80@80.
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
    98
    component := FillingWrapper on:e.
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
    99
    component foregroundColor:Color red.
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   100
    v addComponent:(TranslatingWrapper on:component at:10@10).
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   101
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   102
    e := EllipticalArc boundingBox:(0@0 corner:80@80)
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   103
                     startAngle:0 sweepAngle:360.
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   104
    component := StrokingWrapper on:e.
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   105
    component lineWidth:5.
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   106
    v addComponent:(TranslatingWrapper on:component at:10@10).
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   107
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   108
    e := Arrow from:0@0 to:50@150.
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   109
    component := StrokingWrapper on:e.
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   110
    component lineWidth:2.
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   111
    v addComponent:(TranslatingWrapper on:component at:100@100).
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   112
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   113
    v addComponent:(TranslatingWrapper on:(Image fromFile:'SBrowser.xbm') at:0@100).
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   114
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   115
    t open
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   116
                                                                        [exEnd]
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   117
                                                                        [exBegin]
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   118
    |t s v e component|
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   119
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   120
    t := StandardSystemView extent:250@200.
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   121
    s := HVScrollableView for:View miniScroller:true in:t.
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   122
    s origin:0.0@0.0 corner:1.0@1.0.
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   123
    v := s scrolledView.
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   124
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   125
    e := LabelAndIcon icon:(Image fromFile:'bitmaps/SBrowser.xbm')
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   126
                     string:'hello'.
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   127
    v addComponent:(TranslatingWrapper on:e at:10@10).
273
f76fb9098814 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   128
f76fb9098814 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   129
    t open
f76fb9098814 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   130
                                                                        [exEnd]
f76fb9098814 fixed bounds computation
Claus Gittinger <cg@exept.de>
parents: 265
diff changeset
   131
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
"
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
! !
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
279
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   135
!TranslatingWrapper class methodsFor:'instance creation'!
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
279
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   137
on:aComponent at:originPoint
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   138
    "create and return a translatingWrapper, which positions
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   139
     aComponent at some originPoint"
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
279
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   141
    ^ (self on:aComponent) translation:originPoint
262
55b430276719 added lineStyle/capStyle & joinStyle
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
   142
279
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   143
    "Created: 26.5.1996 / 16:07:29 / cg"
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   144
    "Modified: 26.5.1996 / 16:12:28 / cg"
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   145
! !
262
55b430276719 added lineStyle/capStyle & joinStyle
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
   146
279
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   147
!TranslatingWrapper methodsFor:'accessing'!
262
55b430276719 added lineStyle/capStyle & joinStyle
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
   148
279
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   149
translation
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   150
    "return the origin offset"
262
55b430276719 added lineStyle/capStyle & joinStyle
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
   151
279
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   152
    ^ origin
262
55b430276719 added lineStyle/capStyle & joinStyle
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
   153
279
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   154
    "Modified: 26.5.1996 / 16:06:32 / cg"
262
55b430276719 added lineStyle/capStyle & joinStyle
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
   155
!
55b430276719 added lineStyle/capStyle & joinStyle
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
   156
279
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   157
translation:originPoint
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   158
    "set the origin offset"
262
55b430276719 added lineStyle/capStyle & joinStyle
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
   159
279
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   160
    origin := originPoint
262
55b430276719 added lineStyle/capStyle & joinStyle
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
   161
279
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   162
    "Modified: 26.5.1996 / 16:06:32 / cg"
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   163
    "Created: 26.5.1996 / 16:07:47 / cg"
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   164
! !
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   165
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   166
!TranslatingWrapper methodsFor:'accessing - bounds'!
262
55b430276719 added lineStyle/capStyle & joinStyle
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
   167
279
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   168
bounds
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   169
    ^ component bounds + origin
262
55b430276719 added lineStyle/capStyle & joinStyle
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
   170
279
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   171
    "Created: 26.5.1996 / 16:13:05 / cg"
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   172
    "Modified: 26.5.1996 / 16:44:26 / cg"
262
55b430276719 added lineStyle/capStyle & joinStyle
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
   173
!
55b430276719 added lineStyle/capStyle & joinStyle
Claus Gittinger <cg@exept.de>
parents: 254
diff changeset
   174
279
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   175
bounds:newBounds
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   176
    component bounds:(newBounds - origin).
246
9f80dbcbcd34 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 245
diff changeset
   177
279
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   178
    "Created: 26.5.1996 / 16:44:16 / cg"
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   179
!
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   180
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   181
preferredBounds
279
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   182
    ^ component preferredBounds + origin
246
9f80dbcbcd34 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 245
diff changeset
   183
279
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   184
    "Modified: 26.5.1996 / 16:44:26 / cg"
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   185
    "Created: 26.5.1996 / 16:44:53 / cg"
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   186
! !
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
279
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   188
!TranslatingWrapper methodsFor:'displaying'!
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   189
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   190
displayOn:aGC
279
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   191
    |oldTranslation oldPaint oldBgPaint|
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
279
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   193
    oldTranslation := aGC translation.
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   194
    oldPaint := aGC paint.
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   195
    oldBgPaint := aGC backgroundPaint.
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   196
279
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   197
    aGC translation:(origin + aGC translation).
263
091fa4a2f558 fixed doubleDash bgColor
Claus Gittinger <cg@exept.de>
parents: 262
diff changeset
   198
    aGC paint:fgColor on:bgColor.
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
279
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   200
    component displayOn:aGC.
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
279
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   202
    aGC translation:oldTranslation.
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   203
    aGC paint:oldPaint on:oldBgPaint.
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
279
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   205
    "Created: 26.5.1996 / 15:27:54 / cg"
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   206
    "Modified: 26.5.1996 / 16:13:44 / cg"
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   207
! !
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   208
279
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   209
!TranslatingWrapper methodsFor:'testing'!
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   210
279
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   211
containsPoint:aPoint
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   212
    ^ component containsPoint:(aPoint - origin)
246
9f80dbcbcd34 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 245
diff changeset
   213
279
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   214
    "Created: 26.5.1996 / 16:48:14 / cg"
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   215
!
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   216
279
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   217
intersects:aRectangle
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   218
    ^ component intersects:(aRectangle - origin)
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   219
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   220
    "Created: 26.5.1996 / 16:48:33 / cg"
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   221
! !
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   222
279
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   223
!TranslatingWrapper class methodsFor:'documentation'!
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   224
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   225
version
279
bf069aab8a8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 273
diff changeset
   226
    ^ '$Header: /cvs/stx/stx/libview2/StrokingWrapper.st,v 1.10 1996-05-28 22:43:43 cg Exp $'
245
8d7f9a8d2c78 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   227
! !