|
|
Class: Ruler
Object
|
+--GraphicsContext
|
+--DeviceGraphicsContext
|
+--GraphicsMedium
|
+--DisplaySurface
|
+--SimpleView
|
+--Ruler
|
+--TextRuler
- Package:
- stx:libwidg2
- Category:
- Views-Misc
- Version:
- rev:
1.28
date: 2002-10-31 21:49:29
- user: cg
- file: Ruler.st directory: libwidg2
- module: stx stc-classLibrary: libwidg2
a shows some unit scale; See example use in DrawTool.
instance variables:
fgColor <Color> color to draw text and marks with
metric <Symbol> inch or mm
paperWidth <Number> width of paper
paperHeight <Number> height of paper
scale <Number> scale factor for zoom
showUnit <Boolean> if true, a unit string is displayed
accessing
-
heightOfContents
-
-
metric: aSymbol
-
set the metric. The argument may be either #inch or #mm
-
paperHeightInch: inches
-
set the width of the document
-
paperHeightMM: millis
-
set the width of the document
-
paperWidthInch: inches
-
set the width of the document
-
paperWidthMM: millis
-
set the width of the document
-
scale: aFactor
-
set the scale factor. 1 is identity.
-
showUnit: aBoolean
-
set/clear the showUnit flag. If false, the unit string
(i.e. 'inch' or 'mm') is not schown. Default is true.
-
viewOrigin: origin
-
-
widthOfContents
-
initialization
-
initialize
-
-
reinitialize
-
metric conversions
-
inchToPixel: inches
-
convert inches to screen pixels
-
millimeterToPixel: mm
-
convert mms to screen pixels
redrawing
-
redraw
-
redraw the scale
|top ruler|
top := StandardSystemView new.
ruler := Ruler origin:0.0@0.0 corner:1.0@30 in:top.
top open
|
defining paperWidth:
|top ruler|
top := StandardSystemView new.
ruler := Ruler origin:0.0@0.0 corner:1.0@30 in:top.
ruler paperWidthInch:5.
top open
|
hide unit string:
|top ruler|
top := StandardSystemView new.
ruler := Ruler origin:0.0@0.0 corner:1.0@30 in:top.
ruler showUnit:false.
top open
|
both horizontal and vertical rulers (as in DrawTool):
|top hRuler vRuler|
top := StandardSystemView new.
hRuler := Ruler origin:30@0.0 corner:1.0@30 in:top.
vRuler := VerticalRuler origin:0.0@30 corner:30@1.0 in:top.
vRuler showUnit:false.
top open
|
with some 3D effects:
|top hRuler vRuler|
top := StandardSystemView new.
hRuler := Ruler origin:30@0.0 corner:1.0@30 in:top.
vRuler := VerticalRuler origin:0.0@30 corner:30@1.0 in:top.
vRuler showUnit:false.
hRuler level:1.
vRuler level:1.
top open
|
see the DrawTool, for how to make it scroll in sync with some
other view.
|