9 other person. No title to or ownership of the software is |
9 other person. No title to or ownership of the software is |
10 hereby transferred. |
10 hereby transferred. |
11 " |
11 " |
12 |
12 |
13 Ruler subclass:#TextRuler |
13 Ruler subclass:#TextRuler |
14 instanceVariableNames:'leftMargin rightMargin tabStops tabTypes moving' |
14 instanceVariableNames:'leftMargin rightMargin tabSpec moving' |
15 classVariableNames:'LeftAlignForm RightAlignForm |
15 classVariableNames:'LeftAlignForm RightAlignForm |
16 AlignForm CenterForm LeftMarginForm |
16 AlignForm CenterForm LeftMarginForm |
17 RightMarginForm LeftTabForm RightTabForm |
17 RightMarginForm LeftTabForm RightTabForm |
18 CenterTabForm DecimalTabForm' |
18 CenterTabForm DecimalTabForm' |
19 poolDictionaries:'' |
19 poolDictionaries:'' |
24 COPYRIGHT (c) 1991 by Claus Gittinger |
24 COPYRIGHT (c) 1991 by Claus Gittinger |
25 All Rights Reserved |
25 All Rights Reserved |
26 |
26 |
27 a Ruler for page layout showing tabs., margins etc. |
27 a Ruler for page layout showing tabs., margins etc. |
28 |
28 |
29 $Header: /cvs/stx/stx/libwidg2/TextRuler.st,v 1.6 1994-08-05 01:24:10 claus Exp $ |
29 $Header: /cvs/stx/stx/libwidg2/TextRuler.st,v 1.7 1994-08-23 23:44:32 claus Exp $ |
30 written oct 91 by claus |
30 written oct 91 by claus |
31 '! |
31 '! |
32 |
32 |
33 !TextRuler class methodsFor:'defaults'! |
33 !TextRuler class methodsFor:'defaults'! |
34 |
34 |
351 form := self class leftMarginForm. |
351 form := self class leftMarginForm. |
352 self displayOpaqueForm:form x:(x - (form width // 2)) |
352 self displayOpaqueForm:form x:(x - (form width // 2)) |
353 y:(top - form height). |
353 y:(top - form height). |
354 x := (self inchToPixel:rightMargin) rounded. |
354 x := (self inchToPixel:rightMargin) rounded. |
355 form := self class rightMarginForm. |
355 form := self class rightMarginForm. |
356 self displayOpaqueForm:form x:(x - (form width // 2)) |
356 self displayOpaqueForm:form |
357 y:(top - form height). |
357 x:(x - (form width // 2)) |
358 |
358 y:(top - form height). |
|
359 |
|
360 tabStops := tabSpec positions. |
|
361 tabAlign := tabSpec align. |
359 tabStops notNil ifTrue:[ |
362 tabStops notNil ifTrue:[ |
360 1 to:tabStops size do:[:tabNr | |
363 1 to:tabStops size do:[:tabNr | |
361 tab := tabStops at:tabNr. |
364 tab := tabStops at:tabNr. |
362 type := tabTypes at:tabNr. |
365 type := tabAlign at:tabNr. |
363 x := (self inchToPixel:tab) rounded. |
366 x := (tabSpec positionOfTab:tabNr on:self) rounded. |
364 (type == #left) ifTrue:[ |
367 (type == #left) ifTrue:[ |
365 form := self class leftTabForm |
368 form := self class leftTabForm |
366 ] ifFalse:[ |
369 ] ifFalse:[ |
367 (type == #right) ifTrue:[ |
370 (type == #right) ifTrue:[ |
368 form := self class rightTabForm |
371 form := self class rightTabForm |