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