542
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1997 by Claus Gittinger / 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 |
"
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
637
|
17 |
Label subclass:#DSVLabelView
|
|
18 |
instanceVariableNames:'selector argument'
|
542
|
19 |
classVariableNames:''
|
|
20 |
poolDictionaries:''
|
|
21 |
category:'Views-DataSet'
|
|
22 |
!
|
|
23 |
|
|
24 |
!DSVLabelView class methodsFor:'documentation'!
|
|
25 |
|
|
26 |
copyright
|
|
27 |
"
|
|
28 |
COPYRIGHT (c) 1997 by Claus Gittinger / eXept Software AG
|
|
29 |
All Rights Reserved
|
|
30 |
|
|
31 |
This software is furnished under a license and may be used
|
|
32 |
only in accordance with the terms of that license and with the
|
|
33 |
inclusion of the above copyright notice. This software may not
|
|
34 |
be provided or otherwise made available to, or used by, any
|
|
35 |
other person. No title to or ownership of the software is
|
|
36 |
hereby transferred.
|
|
37 |
"
|
|
38 |
|
|
39 |
|
|
40 |
|
|
41 |
|
|
42 |
!
|
|
43 |
|
|
44 |
documentation
|
|
45 |
"
|
|
46 |
shows the labels assigned to the column descriptions. Used by the
|
|
47 |
DataSetView
|
|
48 |
|
|
49 |
[Instance variables:]
|
|
50 |
|
|
51 |
columnView <DSVColumnView> column view which shows the columns
|
|
52 |
|
|
53 |
[author:]
|
|
54 |
Claus Atzkern
|
|
55 |
|
|
56 |
[see also:]
|
|
57 |
DSVColumnView
|
|
58 |
DataSetColumnSpec
|
|
59 |
DataSetColumn
|
|
60 |
DataSetView
|
|
61 |
"
|
|
62 |
|
|
63 |
|
|
64 |
|
|
65 |
! !
|
|
66 |
|
637
|
67 |
!DSVLabelView class methodsFor:'instance creation'!
|
542
|
68 |
|
637
|
69 |
column:aColumn in:aDataSetView
|
|
70 |
"create a new label in a dataSetView
|
|
71 |
"
|
|
72 |
|lbl|
|
562
|
73 |
|
637
|
74 |
lbl := self in:aDataSetView.
|
|
75 |
lbl column:aColumn.
|
|
76 |
^ lbl
|
|
77 |
! !
|
562
|
78 |
|
637
|
79 |
!DSVLabelView methodsFor:'accessing'!
|
562
|
80 |
|
637
|
81 |
backgroundColor:aColor
|
|
82 |
"set the background color
|
|
83 |
"
|
|
84 |
aColor ~~ bgColor ifTrue:[
|
|
85 |
bgColor := aColor on:device.
|
|
86 |
super viewBackground:bgColor.
|
|
87 |
shown ifTrue:[self invalidate]
|
|
88 |
]
|
|
89 |
|
562
|
90 |
|
637
|
91 |
! !
|
|
92 |
|
|
93 |
!DSVLabelView methodsFor:'event handling'!
|
542
|
94 |
|
637
|
95 |
buttonPress:button x:x y:y
|
|
96 |
"button is pressed
|
|
97 |
"
|
|
98 |
(button == 1 and:[selector notNil]) ifTrue:[
|
|
99 |
self level:-2
|
|
100 |
] ifFalse:[
|
|
101 |
super buttonPress:button x:x y:y
|
|
102 |
]
|
542
|
103 |
|
|
104 |
!
|
|
105 |
|
637
|
106 |
buttonRelease:button x:x y:y
|
|
107 |
"button is released; perform action
|
542
|
108 |
"
|
637
|
109 |
|application|
|
542
|
110 |
|
637
|
111 |
selector notNil ifTrue:[
|
|
112 |
self level:1.
|
542
|
113 |
|
637
|
114 |
(x < 0 or:[x > width or:[y < 0 or:[y > height]]]) ifFalse:[
|
|
115 |
(application := self application) notNil ifTrue:[
|
|
116 |
argument notNil ifTrue:[
|
|
117 |
application perform:selector with:argument
|
|
118 |
] ifFalse:[
|
|
119 |
application perform:selector
|
|
120 |
]
|
|
121 |
]
|
542
|
122 |
]
|
|
123 |
].
|
|
124 |
|
|
125 |
! !
|
|
126 |
|
|
127 |
!DSVLabelView methodsFor:'initialize / release'!
|
|
128 |
|
637
|
129 |
column:aColumn
|
|
130 |
|label|
|
542
|
131 |
|
648
|
132 |
fixSize := false.
|
637
|
133 |
label := aColumn label.
|
542
|
134 |
|
637
|
135 |
(selector := aColumn labelActionSelector) notNil ifTrue:[
|
|
136 |
selector numArgs ~~ 0 ifTrue:[
|
|
137 |
(argument := aColumn labelActionArgument) isNil ifTrue:[
|
|
138 |
argument := label
|
|
139 |
]
|
|
140 |
]
|
560
|
141 |
].
|
542
|
142 |
|
637
|
143 |
aColumn labelFont notNil ifTrue:[
|
|
144 |
self font:(aColumn labelFont)
|
|
145 |
].
|
|
146 |
aColumn labelBackgroundColor notNil ifTrue:[
|
|
147 |
self backgroundColor:(aColumn labelBackgroundColor)
|
|
148 |
].
|
|
149 |
aColumn labelForegroundColor notNil ifTrue:[
|
|
150 |
self foregroundColor:(aColumn labelForegroundColor)
|
|
151 |
].
|
|
152 |
self adjust:(aColumn labelAlignment).
|
|
153 |
self label:label.
|
640
|
154 |
self level:1
|
542
|
155 |
! !
|
|
156 |
|
|
157 |
!DSVLabelView class methodsFor:'documentation'!
|
|
158 |
|
|
159 |
version
|
648
|
160 |
^ '$Header: /cvs/stx/stx/libwidg2/DSVLabelView.st,v 1.11 1998-01-05 15:56:01 ca Exp $'
|
542
|
161 |
! !
|