VisualRegion.st
author Claus Gittinger <cg@exept.de>
Fri, 11 Jul 2014 15:31:21 +0200
changeset 3360 4d06d7ba9cb6
parent 3290 093f7f0fadbc
child 3464 85e229581fd1
permissions -rw-r--r--
class: ActiveHelpView changed: #initStyle
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1803
d69cb54a3b56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1342
diff changeset
     1
"
d69cb54a3b56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1342
diff changeset
     2
 COPYRIGHT (c) 1997 by Claus Gittinger
d69cb54a3b56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1342
diff changeset
     3
              All Rights Reserved
d69cb54a3b56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1342
diff changeset
     4
d69cb54a3b56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1342
diff changeset
     5
 This software is furnished under a license and may be used
d69cb54a3b56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1342
diff changeset
     6
 only in accordance with the terms of that license and with the
d69cb54a3b56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1342
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
d69cb54a3b56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1342
diff changeset
     8
 be provided or otherwise made available to, or used by, any
d69cb54a3b56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1342
diff changeset
     9
 other person.  No title to or ownership of the software is
d69cb54a3b56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1342
diff changeset
    10
 hereby transferred.
d69cb54a3b56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1342
diff changeset
    11
"
d69cb54a3b56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1342
diff changeset
    12
"{ Package: 'stx:libview2' }"
d69cb54a3b56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1342
diff changeset
    13
597
daef87563758 intitial checkin
ca
parents:
diff changeset
    14
SimpleView subclass:#VisualRegion
daef87563758 intitial checkin
ca
parents:
diff changeset
    15
	instanceVariableNames:'isElliptical isOpaque'
daef87563758 intitial checkin
ca
parents:
diff changeset
    16
	classVariableNames:''
daef87563758 intitial checkin
ca
parents:
diff changeset
    17
	poolDictionaries:''
daef87563758 intitial checkin
ca
parents:
diff changeset
    18
	category:'Views-Special'
daef87563758 intitial checkin
ca
parents:
diff changeset
    19
!
daef87563758 intitial checkin
ca
parents:
diff changeset
    20
daef87563758 intitial checkin
ca
parents:
diff changeset
    21
!VisualRegion class methodsFor:'documentation'!
daef87563758 intitial checkin
ca
parents:
diff changeset
    22
1803
d69cb54a3b56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1342
diff changeset
    23
copyright
d69cb54a3b56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1342
diff changeset
    24
"
d69cb54a3b56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1342
diff changeset
    25
 COPYRIGHT (c) 1997 by Claus Gittinger
d69cb54a3b56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1342
diff changeset
    26
              All Rights Reserved
d69cb54a3b56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1342
diff changeset
    27
d69cb54a3b56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1342
diff changeset
    28
 This software is furnished under a license and may be used
d69cb54a3b56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1342
diff changeset
    29
 only in accordance with the terms of that license and with the
d69cb54a3b56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1342
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
d69cb54a3b56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1342
diff changeset
    31
 be provided or otherwise made available to, or used by, any
d69cb54a3b56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1342
diff changeset
    32
 other person.  No title to or ownership of the software is
d69cb54a3b56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1342
diff changeset
    33
 hereby transferred.
d69cb54a3b56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1342
diff changeset
    34
"
d69cb54a3b56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1342
diff changeset
    35
!
d69cb54a3b56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1342
diff changeset
    36
597
daef87563758 intitial checkin
ca
parents:
diff changeset
    37
documentation
daef87563758 intitial checkin
ca
parents:
diff changeset
    38
"
daef87563758 intitial checkin
ca
parents:
diff changeset
    39
    VisualRegion is a passive visual component which provides a rectangular or elliptical
daef87563758 intitial checkin
ca
parents:
diff changeset
    40
    shape. It can take an arbitrary border line thicknesses and can be defined as opaque
daef87563758 intitial checkin
ca
parents:
diff changeset
    41
    with a background color or non opaque.
daef87563758 intitial checkin
ca
parents:
diff changeset
    42
1241
414114cfc5cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1186
diff changeset
    43
    Notice:
414114cfc5cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1186
diff changeset
    44
      This is an ST-80 compatibility class, provided to aid porting
414114cfc5cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1186
diff changeset
    45
      of ST-80 or VisualWorks code;
414114cfc5cc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1186
diff changeset
    46
      it may be incomplete or incompatible to the corresponding ST-80 class. 
597
daef87563758 intitial checkin
ca
parents:
diff changeset
    47
      If you encounter any incompatibilities, please forward a note 
daef87563758 intitial checkin
ca
parents:
diff changeset
    48
      describing the incompatibility verbal (i.e. no code) to the ST/X team.
daef87563758 intitial checkin
ca
parents:
diff changeset
    49
"
daef87563758 intitial checkin
ca
parents:
diff changeset
    50
!
daef87563758 intitial checkin
ca
parents:
diff changeset
    51
daef87563758 intitial checkin
ca
parents:
diff changeset
    52
examples
daef87563758 intitial checkin
ca
parents:
diff changeset
    53
"
1186
eb94ab8ac18c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
    54
    some regions; the blue one has its own cursor,
eb94ab8ac18c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
    55
    the light-grey and red ones havea popupMenu,
eb94ab8ac18c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
    56
    however, the red one is almost completely covered by an invisible inputView
eb94ab8ac18c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
    57
    which provides its own menu (only the far left edge of the red region
eb94ab8ac18c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
    58
    shows the red-menu)
eb94ab8ac18c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
    59
                                                                                [exBegin]
eb94ab8ac18c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
    60
        |top s1 s2 s3 s4 v1 rd i vh|
597
daef87563758 intitial checkin
ca
parents:
diff changeset
    61
daef87563758 intitial checkin
ca
parents:
diff changeset
    62
        top := StandardSystemView new extent:250@250.
daef87563758 intitial checkin
ca
parents:
diff changeset
    63
1186
eb94ab8ac18c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
    64
        rd := true.
597
daef87563758 intitial checkin
ca
parents:
diff changeset
    65
daef87563758 intitial checkin
ca
parents:
diff changeset
    66
        v1 := View origin:25@25 extent:50@50 in:top.
daef87563758 intitial checkin
ca
parents:
diff changeset
    67
        v1 viewBackground:(Color blue).
1186
eb94ab8ac18c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
    68
        v1 cursor:(Cursor thumbsUp).
eb94ab8ac18c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
    69
        vh := ValueHolder new.
eb94ab8ac18c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
    70
        vh onChangeSend:#value to:[ v1 viewBackground:vh value. v1 clear ].
eb94ab8ac18c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
    71
        vh inspect.
597
daef87563758 intitial checkin
ca
parents:
diff changeset
    72
daef87563758 intitial checkin
ca
parents:
diff changeset
    73
        s1 := VisualRegion origin:10@10 extent:30@30 in:top.
daef87563758 intitial checkin
ca
parents:
diff changeset
    74
        s1 lineWidth:0.
daef87563758 intitial checkin
ca
parents:
diff changeset
    75
        s1 viewBackground:(Color gray:90).
daef87563758 intitial checkin
ca
parents:
diff changeset
    76
        s1 isElliptical:rd.
1186
eb94ab8ac18c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
    77
        s1 middleButtonMenu:(PopUpMenu labels:#('foo' 'bar')).
597
daef87563758 intitial checkin
ca
parents:
diff changeset
    78
daef87563758 intitial checkin
ca
parents:
diff changeset
    79
        s2 := VisualRegion origin:60@10 extent:30@30 in:top.
1186
eb94ab8ac18c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
    80
        s2 viewBackground:(Color green).
597
daef87563758 intitial checkin
ca
parents:
diff changeset
    81
        s2 lineWidth:1.
daef87563758 intitial checkin
ca
parents:
diff changeset
    82
        s2 isElliptical:rd.
daef87563758 intitial checkin
ca
parents:
diff changeset
    83
daef87563758 intitial checkin
ca
parents:
diff changeset
    84
        s3 := VisualRegion origin:10@60 extent:100@30 in:top.
daef87563758 intitial checkin
ca
parents:
diff changeset
    85
        s3 viewBackground:(Color gray:70).
daef87563758 intitial checkin
ca
parents:
diff changeset
    86
        s3 lineWidth:0.
daef87563758 intitial checkin
ca
parents:
diff changeset
    87
        s3 isOpaque:false.
daef87563758 intitial checkin
ca
parents:
diff changeset
    88
        s3 isElliptical:rd.
daef87563758 intitial checkin
ca
parents:
diff changeset
    89
1186
eb94ab8ac18c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
    90
        s4 := VisualRegion origin:60@60 extent:60@30 in:top.
eb94ab8ac18c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
    91
        s4 viewBackground:(Color red).
eb94ab8ac18c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
    92
        s4 lineWidth:3.
597
daef87563758 intitial checkin
ca
parents:
diff changeset
    93
        s4 isOpaque:false.
daef87563758 intitial checkin
ca
parents:
diff changeset
    94
        s4 isElliptical:rd.
1186
eb94ab8ac18c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
    95
        s4 middleButtonMenu:(PopUpMenu labels:#('foo1' 'bar1')).
eb94ab8ac18c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
    96
eb94ab8ac18c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
    97
        i := InputView origin:70@60 extent:60@30 in:top.
eb94ab8ac18c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
    98
        i middleButtonMenu:(PopUpMenu labels:#('foo2' 'bar2')).
597
daef87563758 intitial checkin
ca
parents:
diff changeset
    99
daef87563758 intitial checkin
ca
parents:
diff changeset
   100
        top open
1186
eb94ab8ac18c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1184
diff changeset
   101
                                                                                [exEnd]
597
daef87563758 intitial checkin
ca
parents:
diff changeset
   102
"
daef87563758 intitial checkin
ca
parents:
diff changeset
   103
! !
daef87563758 intitial checkin
ca
parents:
diff changeset
   104
daef87563758 intitial checkin
ca
parents:
diff changeset
   105
!VisualRegion methodsFor:'accessing'!
daef87563758 intitial checkin
ca
parents:
diff changeset
   106
daef87563758 intitial checkin
ca
parents:
diff changeset
   107
isElliptical
daef87563758 intitial checkin
ca
parents:
diff changeset
   108
    "get the outline of the region; elliptical or rectangle
daef87563758 intitial checkin
ca
parents:
diff changeset
   109
    "
daef87563758 intitial checkin
ca
parents:
diff changeset
   110
  ^ isElliptical
daef87563758 intitial checkin
ca
parents:
diff changeset
   111
daef87563758 intitial checkin
ca
parents:
diff changeset
   112
!
daef87563758 intitial checkin
ca
parents:
diff changeset
   113
daef87563758 intitial checkin
ca
parents:
diff changeset
   114
isElliptical:aBoolean
daef87563758 intitial checkin
ca
parents:
diff changeset
   115
    "set the outline of the region; elliptical or rectangle
daef87563758 intitial checkin
ca
parents:
diff changeset
   116
    "
daef87563758 intitial checkin
ca
parents:
diff changeset
   117
    (isElliptical ~~ aBoolean) ifTrue:[
daef87563758 intitial checkin
ca
parents:
diff changeset
   118
        isElliptical := aBoolean.
daef87563758 intitial checkin
ca
parents:
diff changeset
   119
        self layoutChanged
daef87563758 intitial checkin
ca
parents:
diff changeset
   120
    ].
daef87563758 intitial checkin
ca
parents:
diff changeset
   121
!
daef87563758 intitial checkin
ca
parents:
diff changeset
   122
daef87563758 intitial checkin
ca
parents:
diff changeset
   123
isOpaque
daef87563758 intitial checkin
ca
parents:
diff changeset
   124
    "get opaque mode concerning the inner background of the region
daef87563758 intitial checkin
ca
parents:
diff changeset
   125
    "
daef87563758 intitial checkin
ca
parents:
diff changeset
   126
  ^ isOpaque
daef87563758 intitial checkin
ca
parents:
diff changeset
   127
daef87563758 intitial checkin
ca
parents:
diff changeset
   128
daef87563758 intitial checkin
ca
parents:
diff changeset
   129
!
daef87563758 intitial checkin
ca
parents:
diff changeset
   130
daef87563758 intitial checkin
ca
parents:
diff changeset
   131
isOpaque:aBoolean
daef87563758 intitial checkin
ca
parents:
diff changeset
   132
    "set opaque mode concerning the inner background of the region
daef87563758 intitial checkin
ca
parents:
diff changeset
   133
    "
daef87563758 intitial checkin
ca
parents:
diff changeset
   134
    (isOpaque ~~ aBoolean) ifTrue:[
daef87563758 intitial checkin
ca
parents:
diff changeset
   135
        isOpaque := aBoolean.
daef87563758 intitial checkin
ca
parents:
diff changeset
   136
        self layoutChanged
daef87563758 intitial checkin
ca
parents:
diff changeset
   137
    ].
daef87563758 intitial checkin
ca
parents:
diff changeset
   138
daef87563758 intitial checkin
ca
parents:
diff changeset
   139
daef87563758 intitial checkin
ca
parents:
diff changeset
   140
!
daef87563758 intitial checkin
ca
parents:
diff changeset
   141
daef87563758 intitial checkin
ca
parents:
diff changeset
   142
lineWidth:aNumber
3290
093f7f0fadbc class: VisualRegion
Stefan Vogel <sv@exept.de>
parents: 1931
diff changeset
   143
    "set the border drawing width in pixels"
093f7f0fadbc class: VisualRegion
Stefan Vogel <sv@exept.de>
parents: 1931
diff changeset
   144
093f7f0fadbc class: VisualRegion
Stefan Vogel <sv@exept.de>
parents: 1931
diff changeset
   145
    gc lineWidth ~~ aNumber ifTrue:[
597
daef87563758 intitial checkin
ca
parents:
diff changeset
   146
        super lineWidth:aNumber.
daef87563758 intitial checkin
ca
parents:
diff changeset
   147
        self layoutChanged
daef87563758 intitial checkin
ca
parents:
diff changeset
   148
    ]
daef87563758 intitial checkin
ca
parents:
diff changeset
   149
!
daef87563758 intitial checkin
ca
parents:
diff changeset
   150
daef87563758 intitial checkin
ca
parents:
diff changeset
   151
setLineWidth:aNumber
daef87563758 intitial checkin
ca
parents:
diff changeset
   152
    "set the line drawing width in pixels without recomputation of the shape
daef87563758 intitial checkin
ca
parents:
diff changeset
   153
    "
daef87563758 intitial checkin
ca
parents:
diff changeset
   154
    super lineWidth:aNumber
daef87563758 intitial checkin
ca
parents:
diff changeset
   155
daef87563758 intitial checkin
ca
parents:
diff changeset
   156
! !
daef87563758 intitial checkin
ca
parents:
diff changeset
   157
daef87563758 intitial checkin
ca
parents:
diff changeset
   158
!VisualRegion methodsFor:'change & update'!
daef87563758 intitial checkin
ca
parents:
diff changeset
   159
daef87563758 intitial checkin
ca
parents:
diff changeset
   160
sizeChanged:how
daef87563758 intitial checkin
ca
parents:
diff changeset
   161
    "must compute a new shape, when size is changed
daef87563758 intitial checkin
ca
parents:
diff changeset
   162
    "
daef87563758 intitial checkin
ca
parents:
diff changeset
   163
    self computeShape.
daef87563758 intitial checkin
ca
parents:
diff changeset
   164
    super sizeChanged:how
daef87563758 intitial checkin
ca
parents:
diff changeset
   165
daef87563758 intitial checkin
ca
parents:
diff changeset
   166
daef87563758 intitial checkin
ca
parents:
diff changeset
   167
! !
daef87563758 intitial checkin
ca
parents:
diff changeset
   168
daef87563758 intitial checkin
ca
parents:
diff changeset
   169
!VisualRegion methodsFor:'initialization'!
daef87563758 intitial checkin
ca
parents:
diff changeset
   170
daef87563758 intitial checkin
ca
parents:
diff changeset
   171
initialize
daef87563758 intitial checkin
ca
parents:
diff changeset
   172
    "setup default configuration
daef87563758 intitial checkin
ca
parents:
diff changeset
   173
    "
daef87563758 intitial checkin
ca
parents:
diff changeset
   174
    super initialize.
daef87563758 intitial checkin
ca
parents:
diff changeset
   175
    isElliptical := false.
daef87563758 intitial checkin
ca
parents:
diff changeset
   176
    isOpaque     := true.
daef87563758 intitial checkin
ca
parents:
diff changeset
   177
    self computeShape
daef87563758 intitial checkin
ca
parents:
diff changeset
   178
daef87563758 intitial checkin
ca
parents:
diff changeset
   179
daef87563758 intitial checkin
ca
parents:
diff changeset
   180
! !
daef87563758 intitial checkin
ca
parents:
diff changeset
   181
daef87563758 intitial checkin
ca
parents:
diff changeset
   182
!VisualRegion methodsFor:'private'!
daef87563758 intitial checkin
ca
parents:
diff changeset
   183
daef87563758 intitial checkin
ca
parents:
diff changeset
   184
layoutChanged
daef87563758 intitial checkin
ca
parents:
diff changeset
   185
    "recompute shape and change to invalidate
daef87563758 intitial checkin
ca
parents:
diff changeset
   186
    "
daef87563758 intitial checkin
ca
parents:
diff changeset
   187
    self computeShape.
1931
3eeab6c26ca9 invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents: 1803
diff changeset
   188
    self invalidate 
597
daef87563758 intitial checkin
ca
parents:
diff changeset
   189
954
e59f70e01541 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   190
    "Modified: / 6.6.1998 / 19:52:41 / cg"
597
daef87563758 intitial checkin
ca
parents:
diff changeset
   191
! !
daef87563758 intitial checkin
ca
parents:
diff changeset
   192
daef87563758 intitial checkin
ca
parents:
diff changeset
   193
!VisualRegion methodsFor:'queries'!
daef87563758 intitial checkin
ca
parents:
diff changeset
   194
daef87563758 intitial checkin
ca
parents:
diff changeset
   195
specClass
daef87563758 intitial checkin
ca
parents:
diff changeset
   196
    ^ RegionSpec
daef87563758 intitial checkin
ca
parents:
diff changeset
   197
daef87563758 intitial checkin
ca
parents:
diff changeset
   198
daef87563758 intitial checkin
ca
parents:
diff changeset
   199
! !
daef87563758 intitial checkin
ca
parents:
diff changeset
   200
daef87563758 intitial checkin
ca
parents:
diff changeset
   201
!VisualRegion methodsFor:'shape computation'!
daef87563758 intitial checkin
ca
parents:
diff changeset
   202
daef87563758 intitial checkin
ca
parents:
diff changeset
   203
computeShape
daef87563758 intitial checkin
ca
parents:
diff changeset
   204
    "computes 2 forms, one for the border, the other for the inside area. The border
daef87563758 intitial checkin
ca
parents:
diff changeset
   205
     form is borderwidth*2 pixels larger. Each form gets filled with an ellipse of
daef87563758 intitial checkin
ca
parents:
diff changeset
   206
     1-pixels, to define the shapes (take a look at the XShape spec, for more info)
daef87563758 intitial checkin
ca
parents:
diff changeset
   207
    "
daef87563758 intitial checkin
ca
parents:
diff changeset
   208
    isElliptical ifTrue:[
3290
093f7f0fadbc class: VisualRegion
Stefan Vogel <sv@exept.de>
parents: 1931
diff changeset
   209
        self makeRoundViewShapeWithBorder:gc lineWidth opaque:isOpaque.
597
daef87563758 intitial checkin
ca
parents:
diff changeset
   210
    ] ifFalse:[
1342
acb9e9fe0cb1 fixed round shaped transparent views (Region)
Claus Gittinger <cg@exept.de>
parents: 1241
diff changeset
   211
        isOpaque ifFalse:[
3290
093f7f0fadbc class: VisualRegion
Stefan Vogel <sv@exept.de>
parents: 1931
diff changeset
   212
            self makeTransparentRectangularViewShapeWithBorder:gc lineWidth
1342
acb9e9fe0cb1 fixed round shaped transparent views (Region)
Claus Gittinger <cg@exept.de>
parents: 1241
diff changeset
   213
        ] ifTrue:[
acb9e9fe0cb1 fixed round shaped transparent views (Region)
Claus Gittinger <cg@exept.de>
parents: 1241
diff changeset
   214
            self borderShape:nil.
acb9e9fe0cb1 fixed round shaped transparent views (Region)
Claus Gittinger <cg@exept.de>
parents: 1241
diff changeset
   215
            self viewShape:nil.
3290
093f7f0fadbc class: VisualRegion
Stefan Vogel <sv@exept.de>
parents: 1931
diff changeset
   216
            self borderWidth:gc lineWidth.
1342
acb9e9fe0cb1 fixed round shaped transparent views (Region)
Claus Gittinger <cg@exept.de>
parents: 1241
diff changeset
   217
        ]
597
daef87563758 intitial checkin
ca
parents:
diff changeset
   218
    ].
daef87563758 intitial checkin
ca
parents:
diff changeset
   219
1183
8dff9008b5c7 use common roundShape computer
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   220
"/    |border shape extent form|
8dff9008b5c7 use common roundShape computer
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   221
"/
8dff9008b5c7 use common roundShape computer
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   222
"/    extent := self extent.
8dff9008b5c7 use common roundShape computer
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   223
"/    border := Form extent:extent.
8dff9008b5c7 use common roundShape computer
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   224
"/    shape  := Form extent:extent.
8dff9008b5c7 use common roundShape computer
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   225
"/
8dff9008b5c7 use common roundShape computer
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   226
"/    isElliptical ifTrue:[
8dff9008b5c7 use common roundShape computer
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   227
"/        border fillArcX:0 y:0 
8dff9008b5c7 use common roundShape computer
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   228
"/                  width:(border width)
8dff9008b5c7 use common roundShape computer
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   229
"/                 height:(border height)
8dff9008b5c7 use common roundShape computer
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   230
"/                   from:0
8dff9008b5c7 use common roundShape computer
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   231
"/                  angle:360.
8dff9008b5c7 use common roundShape computer
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   232
"/    ] ifFalse:[
8dff9008b5c7 use common roundShape computer
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   233
"/        border fillRectangleX:0 y:0
8dff9008b5c7 use common roundShape computer
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   234
"/                        width:(border width)
8dff9008b5c7 use common roundShape computer
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   235
"/                       height:(border height)
8dff9008b5c7 use common roundShape computer
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   236
"/    ].
8dff9008b5c7 use common roundShape computer
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   237
"/
8dff9008b5c7 use common roundShape computer
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   238
"/    isOpaque ifFalse:[
8dff9008b5c7 use common roundShape computer
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   239
"/        form := border.
8dff9008b5c7 use common roundShape computer
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   240
"/        border foreground:(Color colorId:0).
8dff9008b5c7 use common roundShape computer
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   241
"/    ] ifTrue:[
8dff9008b5c7 use common roundShape computer
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   242
"/        form := shape.
8dff9008b5c7 use common roundShape computer
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   243
"/        shape foreground:(Color colorId:1).
8dff9008b5c7 use common roundShape computer
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   244
"/    ].
8dff9008b5c7 use common roundShape computer
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   245
"/
8dff9008b5c7 use common roundShape computer
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   246
"/    isElliptical ifTrue:[
8dff9008b5c7 use common roundShape computer
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   247
"/        form fillArcX:lineWidth y:lineWidth 
8dff9008b5c7 use common roundShape computer
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   248
"/                width:(border  width) - (lineWidth * 2)
8dff9008b5c7 use common roundShape computer
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   249
"/               height:(border height) - (lineWidth * 2)
8dff9008b5c7 use common roundShape computer
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   250
"/                 from:0
8dff9008b5c7 use common roundShape computer
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   251
"/                angle:360.
8dff9008b5c7 use common roundShape computer
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   252
"/    ] ifFalse:[
8dff9008b5c7 use common roundShape computer
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   253
"/        form fillRectangleX:lineWidth y:lineWidth
8dff9008b5c7 use common roundShape computer
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   254
"/                      width:(border  width) - (lineWidth * 2)
8dff9008b5c7 use common roundShape computer
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   255
"/                     height:(border height) - (lineWidth * 2).
8dff9008b5c7 use common roundShape computer
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   256
"/    ].
8dff9008b5c7 use common roundShape computer
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   257
"/    self borderShape:border.
8dff9008b5c7 use common roundShape computer
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   258
"/    self viewShape:shape.
597
daef87563758 intitial checkin
ca
parents:
diff changeset
   259
1183
8dff9008b5c7 use common roundShape computer
Claus Gittinger <cg@exept.de>
parents: 954
diff changeset
   260
    "Modified: / 5.6.1999 / 21:28:54 / cg"
597
daef87563758 intitial checkin
ca
parents:
diff changeset
   261
! !
daef87563758 intitial checkin
ca
parents:
diff changeset
   262
daef87563758 intitial checkin
ca
parents:
diff changeset
   263
!VisualRegion class methodsFor:'documentation'!
daef87563758 intitial checkin
ca
parents:
diff changeset
   264
daef87563758 intitial checkin
ca
parents:
diff changeset
   265
version
3290
093f7f0fadbc class: VisualRegion
Stefan Vogel <sv@exept.de>
parents: 1931
diff changeset
   266
    ^ '$Header: /cvs/stx/stx/libview2/VisualRegion.st,v 1.10 2014-02-18 17:18:21 stefan Exp $'
597
daef87563758 intitial checkin
ca
parents:
diff changeset
   267
! !
3290
093f7f0fadbc class: VisualRegion
Stefan Vogel <sv@exept.de>
parents: 1931
diff changeset
   268