author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Mon, 23 Jun 2014 21:38:44 +0100 | |
branch | delegated_gc_jv |
changeset 6528 | 62c1dbef0b84 |
parent 5468 | 1ec468c66fa4 |
child 6530 | b4c269c96b08 |
permissions | -rw-r--r-- |
5464 | 1 |
" |
2 |
COPYRIGHT (c) 2009 by eXept Software AG |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
5433 | 12 |
"{ Package: 'stx:libview' }" |
13 |
||
14 |
AbstractBorder subclass:#RoundButtonBorder |
|
15 |
instanceVariableNames:'color' |
|
16 |
classVariableNames:'' |
|
17 |
poolDictionaries:'' |
|
18 |
category:'Graphics-Support' |
|
19 |
! |
|
20 |
||
21 |
!RoundButtonBorder class methodsFor:'documentation'! |
|
22 |
||
5464 | 23 |
copyright |
24 |
" |
|
25 |
COPYRIGHT (c) 2009 by eXept Software AG |
|
26 |
All Rights Reserved |
|
27 |
||
28 |
This software is furnished under a license and may be used |
|
29 |
only in accordance with the terms of that license and with the |
|
30 |
inclusion of the above copyright notice. This software may not |
|
31 |
be provided or otherwise made available to, or used by, any |
|
32 |
other person. No title to or ownership of the software is |
|
33 |
hereby transferred. |
|
34 |
" |
|
35 |
! |
|
36 |
||
5433 | 37 |
documentation |
38 |
" |
|
39 |
experimental |
|
40 |
||
5468 | 41 |
|v b| |
42 |
||
43 |
v := View new extent:100@100; openAndWait. |
|
44 |
b := RoundButtonBorder new. |
|
45 |
b width:1 color:(Color rgbValue:16r707070). |
|
46 |
b displayOn:v forDisplayBox:((0@0 corner:v extent) insetBy:10). |
|
47 |
Delay waitForSeconds:3. |
|
48 |
||
49 |
b width:1 color:(Color rgbValue:16r2C628B). |
|
50 |
b displayOn:v forDisplayBox:((0@0 corner:v extent) insetBy:10). |
|
51 |
Delay waitForSeconds:3. |
|
52 |
||
53 |
b width:1 color:(Color rgbValue:16r3C7FB1). |
|
54 |
b displayOn:v forDisplayBox:((0@0 corner:v extent) insetBy:10). |
|
55 |
||
5433 | 56 |
[author:] |
57 |
Claus Gittinger |
|
58 |
" |
|
59 |
! ! |
|
60 |
||
61 |
!RoundButtonBorder methodsFor:'accessing'! |
|
62 |
||
63 |
color |
|
64 |
"the color of the border" |
|
65 |
||
66 |
^ color |
|
67 |
! |
|
68 |
||
69 |
color:aColor |
|
70 |
"set the color of the border" |
|
71 |
||
72 |
width ~~ 0 ifTrue:[ |
|
73 |
self assert:aColor notNil. |
|
74 |
]. |
|
75 |
color := aColor |
|
76 |
! |
|
77 |
||
78 |
width |
|
79 |
^ 2 |
|
80 |
! ! |
|
81 |
||
82 |
!RoundButtonBorder methodsFor:'displaying'! |
|
83 |
||
84 |
displayOn:aGC forDisplayBox:aRectangle |
|
85 |
|oldPaint left top w h| |
|
86 |
||
87 |
color isNil ifTrue:[ ^ self]. |
|
88 |
||
89 |
oldPaint := aGC paint. |
|
90 |
aGC paint:color. |
|
91 |
left := aRectangle left. |
|
92 |
top := aRectangle top. |
|
93 |
w := aRectangle width. |
|
94 |
h := aRectangle height. |
|
95 |
||
96 |
aGC displayRectangleX:left y:top width:w height:h. |
|
97 |
||
98 |
aGC paint:color slightlyLightened. |
|
99 |
aGC displayPointX:left+2 y:top. |
|
100 |
aGC displayPointX:left+1 y:top+1. |
|
101 |
aGC displayPointX:left y:top+2. |
|
102 |
||
103 |
aGC displayPointX:left+2 y:top+h-1. |
|
104 |
aGC displayPointX:left+1 y:top+h-2. |
|
105 |
aGC displayPointX:left y:top+h-3. |
|
106 |
||
107 |
aGC displayPointX:left+w-3 y:top. |
|
108 |
aGC displayPointX:left+w-2 y:top+1. |
|
109 |
aGC displayPointX:left+w-1 y:top+2. |
|
110 |
||
111 |
aGC displayPointX:left+w-3 y:top+h-1. |
|
112 |
aGC displayPointX:left+w-2 y:top+h-2. |
|
113 |
aGC displayPointX:left+w-1 y:top+h-3. |
|
114 |
||
115 |
aGC paint:color lightened. |
|
116 |
aGC displayPointX:left+1 y:top. |
|
117 |
aGC displayPointX:left y:top+1. |
|
118 |
||
119 |
aGC displayPointX:left+1 y:top+h-1. |
|
120 |
aGC displayPointX:left y:top+h-2. |
|
121 |
||
122 |
aGC displayPointX:left+w-2 y:top. |
|
123 |
aGC displayPointX:left+w-1 y:top+1. |
|
124 |
||
125 |
aGC displayPointX:left+w-2 y:top+h-1. |
|
126 |
aGC displayPointX:left+w-1 y:top+h-2. |
|
127 |
||
128 |
aGC paint:(aGC container ? aGC) viewBackground. |
|
129 |
aGC displayPointX:left y:top. |
|
130 |
aGC displayPointX:left+w-1 y:top. |
|
131 |
||
132 |
aGC displayPointX:left y:top+h-1. |
|
133 |
aGC displayPointX:left+w-1 y:top+h-1. |
|
134 |
||
135 |
aGC paint:oldPaint. |
|
136 |
||
137 |
" |
|
138 |
|v b| |
|
139 |
||
140 |
v := View new openAndWait. |
|
141 |
b := RoundButtonBorder width:2 color:Color grey. |
|
142 |
b displayOn:v forDisplayBox:(0@0 corner:v extent). |
|
143 |
" |
|
144 |
! ! |
|
145 |
||
146 |
!RoundButtonBorder class methodsFor:'documentation'! |
|
147 |
||
148 |
version_CVS |
|
5468 | 149 |
^ '$Header: /cvs/stx/stx/libview/RoundButtonBorder.st,v 1.4 2009-11-05 13:55:59 cg Exp $' |
5433 | 150 |
! ! |
6528
62c1dbef0b84
Class order in project definition fixed so it passes project checker checks.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
5468
diff
changeset
|
151 |