38
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1994 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 |
|
49
|
13 |
SimpleView subclass:#TabSpecRuler
|
200
|
14 |
instanceVariableNames:'tabSpec titleEntry handleStyle'
|
|
15 |
classVariableNames:'DefaultHandleStyle'
|
|
16 |
poolDictionaries:''
|
|
17 |
category:'Views-Misc'
|
29
|
18 |
!
|
|
19 |
|
|
20 |
!TabSpecRuler class methodsFor:'documentation'!
|
|
21 |
|
38
|
22 |
copyright
|
|
23 |
"
|
|
24 |
COPYRIGHT (c) 1994 by Claus Gittinger
|
|
25 |
All Rights Reserved
|
|
26 |
|
|
27 |
This software is furnished under a license and may be used
|
|
28 |
only in accordance with the terms of that license and with the
|
|
29 |
inclusion of the above copyright notice. This software may not
|
|
30 |
be provided or otherwise made available to, or used by, any
|
|
31 |
other person. No title to or ownership of the software is
|
|
32 |
hereby transferred.
|
|
33 |
"
|
|
34 |
!
|
|
35 |
|
36
|
36 |
documentation
|
|
37 |
"
|
200
|
38 |
this class is not yet finished.
|
|
39 |
|
|
40 |
It shows the tabulator positions of a TabulatorSpecification
|
|
41 |
(as shown in a FileBrowser, when the longList is enabled).
|
|
42 |
|
|
43 |
[see also:]
|
|
44 |
TabulatorSpecification
|
|
45 |
Ruler
|
|
46 |
ListView
|
36
|
47 |
"
|
|
48 |
!
|
|
49 |
|
29
|
50 |
examples
|
|
51 |
"
|
36
|
52 |
|top head spec|
|
29
|
53 |
|
36
|
54 |
top := View new.
|
|
55 |
top extent:300@100.
|
29
|
56 |
|
36
|
57 |
head := TabSpecRuler in:top.
|
|
58 |
head width:1.0.
|
|
59 |
head level:1.
|
29
|
60 |
|
36
|
61 |
spec := TabulatorSpecification new.
|
|
62 |
spec unit:#inch.
|
|
63 |
spec positions:#(0 1 2.5 3.5 4 5 ).
|
|
64 |
spec align: #(#left #left #right #right #center #decimal ).
|
29
|
65 |
|
36
|
66 |
head tabulatorSpecification:spec.
|
|
67 |
top open.
|
29
|
68 |
"
|
|
69 |
|
|
70 |
! !
|
|
71 |
|
|
72 |
!TabSpecRuler class methodsFor:'defaults'!
|
|
73 |
|
|
74 |
updateStyleCache
|
|
75 |
DefaultHandleStyle := StyleSheet at:'tabRulerHandleStyle'.
|
|
76 |
|
|
77 |
! !
|
|
78 |
|
200
|
79 |
!TabSpecRuler methodsFor:'accessing'!
|
29
|
80 |
|
200
|
81 |
tabulatorSpecification:aTabSpec
|
|
82 |
"set my tabulator specification"
|
29
|
83 |
|
200
|
84 |
tabSpec := aTabSpec
|
29
|
85 |
|
200
|
86 |
"Modified: 4.6.1996 / 22:34:31 / cg"
|
29
|
87 |
! !
|
|
88 |
|
|
89 |
!TabSpecRuler methodsFor:'initialization'!
|
|
90 |
|
|
91 |
initStyle
|
|
92 |
super initStyle.
|
|
93 |
|
|
94 |
handleStyle := DefaultHandleStyle
|
|
95 |
!
|
|
96 |
|
|
97 |
initialize
|
|
98 |
super initialize.
|
|
99 |
|
|
100 |
self height:(font height + (2 * font descent)).
|
|
101 |
|
|
102 |
"
|
|
103 |
TabSpecRuler new open
|
|
104 |
"
|
|
105 |
! !
|
|
106 |
|
200
|
107 |
!TabSpecRuler methodsFor:'redrawing'!
|
|
108 |
|
|
109 |
drawHandleAtX:x type:handleType
|
|
110 |
"redraw a tabulator handle"
|
|
111 |
|
|
112 |
self displayLineFromX:x y:0 toX:x y:height - 1
|
|
113 |
|
|
114 |
"Modified: 4.6.1996 / 22:35:22 / cg"
|
|
115 |
!
|
29
|
116 |
|
200
|
117 |
redraw
|
|
118 |
"redraw the handles from by tabSpec"
|
|
119 |
|
|
120 |
|x|
|
|
121 |
|
|
122 |
tabSpec isNil ifTrue:[^ self].
|
|
123 |
1 to:tabSpec size do:[:i |
|
|
124 |
x := tabSpec positionOfTab:i on:self.
|
|
125 |
x := x rounded.
|
|
126 |
|
|
127 |
self paint:Black.
|
|
128 |
self drawHandleAtX:x type:(tabSpec typeOfTab:i).
|
|
129 |
]
|
29
|
130 |
! !
|
|
131 |
|
200
|
132 |
!TabSpecRuler class methodsFor:'documentation'!
|
|
133 |
|
|
134 |
version
|
|
135 |
^ '$Header: /cvs/stx/stx/libwidg2/TabSpecRuler.st,v 1.7 1996-06-04 20:36:22 cg Exp $'
|
|
136 |
! !
|