eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'Ruler':

Home

everywhere
www.exept.de
for:
[back]

Class: Ruler


Inheritance:

   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

Description:


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


Instance protocol:

accessing
o  heightOfContents

o  metric: aSymbol
set the metric. The argument may be either #inch or #mm

o  paperHeightInch: inches
set the width of the document

o  paperHeightMM: millis
set the width of the document

o  paperWidthInch: inches
set the width of the document

o  paperWidthMM: millis
set the width of the document

o  scale: aFactor
set the scale factor. 1 is identity.

o  showUnit: aBoolean
set/clear the showUnit flag. If false, the unit string
(i.e. 'inch' or 'mm') is not schown. Default is true.

o  viewOrigin: origin

o  widthOfContents

initialization
o  initialize

o  reinitialize

metric conversions
o  inchToPixel: inches
convert inches to screen pixels

o  millimeterToPixel: mm
convert mms to screen pixels

redrawing
o  redraw
redraw the scale


Examples:



    |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.

ST/X 6.1.1; WebServer 1.620 at exept:8081; Tue, 22 May 2012 21:58:56 GMT