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