245
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1996 by Claus Gittinger
|
|
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 |
"
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
Object subclass:#VisualComponent
|
|
16 |
instanceVariableNames:'bounds fgColor bgColor'
|
|
17 |
classVariableNames:''
|
|
18 |
poolDictionaries:''
|
|
19 |
category:'Graphics-Display Objects'
|
|
20 |
!
|
|
21 |
|
|
22 |
!VisualComponent class methodsFor:'documentation'!
|
|
23 |
|
|
24 |
copyright
|
|
25 |
"
|
|
26 |
COPYRIGHT (c) 1996 by Claus Gittinger
|
|
27 |
All Rights Reserved
|
|
28 |
|
|
29 |
This software is furnished under a license and may be used
|
|
30 |
only in accordance with the terms of that license and with the
|
|
31 |
inclusion of the above copyright notice. This software may not
|
|
32 |
be provided or otherwise made available to, or used by, any
|
|
33 |
other person. No title to or ownership of the software is
|
|
34 |
hereby transferred.
|
|
35 |
"
|
|
36 |
|
|
37 |
|
|
38 |
!
|
|
39 |
|
|
40 |
documentation
|
|
41 |
"
|
246
|
42 |
abstract superclass for all kinds of visual components.
|
|
43 |
This is still being constructed - not yet finished.
|
245
|
44 |
|
|
45 |
[author:]
|
|
46 |
Claus Gittinger
|
|
47 |
"
|
|
48 |
|
|
49 |
! !
|
|
50 |
|
|
51 |
!VisualComponent class methodsFor:'instance creation'!
|
|
52 |
|
|
53 |
new
|
|
54 |
^ self basicNew initialize
|
|
55 |
! !
|
|
56 |
|
|
57 |
!VisualComponent methodsFor:'accessing'!
|
|
58 |
|
|
59 |
bounds
|
246
|
60 |
"return my bounds"
|
|
61 |
|
245
|
62 |
^ bounds
|
|
63 |
|
|
64 |
"Created: 8.5.1996 / 23:35:19 / cg"
|
246
|
65 |
"Modified: 9.5.1996 / 00:12:00 / cg"
|
245
|
66 |
!
|
|
67 |
|
246
|
68 |
bounds:aRectangle
|
|
69 |
"set my bounds"
|
|
70 |
|
|
71 |
bounds := aRectangle
|
245
|
72 |
|
|
73 |
"Created: 8.5.1996 / 23:36:07 / cg"
|
246
|
74 |
"Modified: 9.5.1996 / 00:13:12 / cg"
|
245
|
75 |
!
|
|
76 |
|
|
77 |
preferredBounds
|
246
|
78 |
"return my preferredBounds"
|
|
79 |
|
245
|
80 |
^ 100@100
|
|
81 |
|
|
82 |
"Created: 8.5.1996 / 23:36:29 / cg"
|
246
|
83 |
"Modified: 9.5.1996 / 00:13:22 / cg"
|
245
|
84 |
! !
|
|
85 |
|
|
86 |
!VisualComponent methodsFor:'accessing - look'!
|
|
87 |
|
|
88 |
backgroundColor:aColor
|
246
|
89 |
"set my backgroundColor"
|
|
90 |
|
245
|
91 |
bgColor := aColor
|
|
92 |
|
|
93 |
"Created: 8.5.1996 / 23:47:11 / cg"
|
246
|
94 |
"Modified: 9.5.1996 / 00:13:33 / cg"
|
245
|
95 |
!
|
|
96 |
|
|
97 |
foregroundColor:aColor
|
246
|
98 |
"set my foregroundColor"
|
|
99 |
|
245
|
100 |
fgColor := aColor
|
|
101 |
|
|
102 |
"Created: 8.5.1996 / 23:47:05 / cg"
|
246
|
103 |
"Modified: 9.5.1996 / 00:13:39 / cg"
|
245
|
104 |
! !
|
|
105 |
|
|
106 |
!VisualComponent methodsFor:'event handling'!
|
|
107 |
|
|
108 |
buttonPress:button x:x y:y
|
246
|
109 |
"button was pressed over me - ignored here"
|
245
|
110 |
|
246
|
111 |
"Modified: 9.5.1996 / 00:14:08 / cg"
|
245
|
112 |
!
|
|
113 |
|
|
114 |
buttonRelease:button x:x y:y
|
246
|
115 |
"button was released over me - ignored here"
|
245
|
116 |
|
|
117 |
"Created: 8.5.1996 / 23:38:30 / cg"
|
246
|
118 |
"Modified: 9.5.1996 / 00:14:04 / cg"
|
245
|
119 |
!
|
|
120 |
|
|
121 |
keyPress:key x:x y:y
|
246
|
122 |
"key was pressed over me - ignored here"
|
245
|
123 |
|
|
124 |
"Created: 8.5.1996 / 23:46:03 / cg"
|
246
|
125 |
"Modified: 9.5.1996 / 00:14:14 / cg"
|
245
|
126 |
!
|
|
127 |
|
|
128 |
keyRelease:key x:x y:y
|
246
|
129 |
"key was released over me - ignored here"
|
245
|
130 |
|
|
131 |
"Created: 8.5.1996 / 23:46:07 / cg"
|
246
|
132 |
"Modified: 9.5.1996 / 00:14:19 / cg"
|
245
|
133 |
! !
|
|
134 |
|
|
135 |
!VisualComponent methodsFor:'initialization'!
|
|
136 |
|
|
137 |
initialize
|
|
138 |
fgColor := Color black.
|
|
139 |
bgColor := Color white.
|
|
140 |
|
|
141 |
"Created: 8.5.1996 / 23:49:54 / cg"
|
|
142 |
! !
|
|
143 |
|
|
144 |
!VisualComponent class methodsFor:'documentation'!
|
|
145 |
|
|
146 |
version
|
246
|
147 |
^ '$Header: /cvs/stx/stx/libview2/Attic/VComponent.st,v 1.2 1996-05-08 22:14:40 cg Exp $'
|
245
|
148 |
! !
|