Class: Fox::FXRuler
- Defined in:
- rdoc-sources/FXRuler.rb
Overview
The ruler widget is placed alongside a document to measure position and size of entities within the document, such as margins, paragraph indents, and tickmarks. The ruler widget sends a SEL_CHANGED
message when the indentation or margins are interactively changed by the user. If the document size exceeds the available space, it is possible to scroll the document using setPosition(). When the document size is less than the available space, the alignment options can be used to center, left-adjust, or right-adjust the document. Finally, a special option exists to stretch the document to the available space, that is to say, the document will always be fitten with given left and right edges substracted from the available space.
Events
The following messages are sent by FXRuler to its target:
SEL_LEFTBUTTONPRESS
-
sent when the left mouse button goes down; the message data is an FXEvent instance.
SEL_LEFTBUTTONRELEASE
-
sent when the left mouse button goes up; the message data is an FXEvent instance.
SEL_CHANGED
-
sent whenever something about the ruler changes
Ruler options
RULER_NORMAL
-
Default appearance (default)
RULER_HORIZONTAL
-
Ruler is horizontal (default)
RULER_VERTICAL
-
Ruler is vertical
RULER_TICKS_OFF
-
Tick marks off (default)
RULER_TICKS_TOP
-
Ticks on the top (if horizontal)
RULER_TICKS_BOTTOM
-
Ticks on the bottom (if horizontal)
RULER_TICKS_LEFT
-
Ticks on the left (if vertical)
RULER_TICKS_RIGHT
-
Ticks on the right (if vertical)
RULER_TICKS_CENTER
-
Tickmarks centered
RULER_NUMBERS
-
Show numbers
RULER_ARROW
-
Draw small arrow for cursor position
RULER_MARKERS
-
Draw markers for indentation settings
RULER_METRIC
-
Metric subdivision (default)
RULER_ENGLISH
-
English subdivision
RULER_MARGIN_ADJUST
-
Allow margin adjustment
RULER_ALIGN_CENTER
-
Center document horizontally
RULER_ALIGN_LEFT
-
Align document to the left
RULER_ALIGN_RIGHT
-
Align document to the right
RULER_ALIGN_TOP
-
Align document to the top
RULER_ALIGN_BOTTOM
-
Align document to the bottom
RULER_ALIGN_STRETCH
-
Stretch document to fit horizontally
RULER_ALIGN_NORMAL
-
Normally, document is centered both ways
Message identifiers:
ID_ARROW
-
write me
Instance Attribute Summary collapse
-
#contentSize ⇒ Object
Content size [Integer].
-
#documentSize ⇒ Object
Document size [Integer].
-
#edgeSpacing ⇒ Object
Document size [Integer].
-
#font ⇒ Object
The text font FXFont.
-
#helpText ⇒ Object
The status line help text for this ruler [String].
-
#indentFirst ⇒ Object
First line indent [Integer].
-
#indentLower ⇒ Object
Lower indent [Integer].
-
#indentUpper ⇒ Object
Upper indent [Integer].
-
#majorTicks ⇒ Object
Document major ticks [Integer].
-
#marginLower ⇒ Object
Lower document margin [Integer].
-
#marginUpper ⇒ Object
Upper document margin [Integer].
-
#minorTicks ⇒ Object
Document minor ticks [Integer].
-
#numberTicks ⇒ Object
Document number placement [Integer].
-
#pixelsPerTick ⇒ Object
Pixels per tick spacing [Float].
-
#position ⇒ Object
Current position [Integer].
-
#rulerAlignment ⇒ Object
Ruler alignment [Integer].
-
#rulerStyle ⇒ Object
The ruler style [Integer].
-
#textColor ⇒ Object
The current text color FXColor.
-
#tinyTicks ⇒ Object
Document tiny ticks [Integer].
-
#tipText ⇒ Object
The tool tip message for this ruler [String].
-
#value ⇒ Object
The slider value [Integer].
Attributes inherited from FXFrame
#baseColor, #borderColor, #borderWidth, #frameStyle, #hiliteColor, #padBottom, #padLeft, #padRight, #padTop, #shadowColor
Attributes inherited from FXWindow
#accelTable, #backColor, #defaultCursor, #dragCursor, #first, #focus, #key, #last, #layoutHints, #next, #numChildren, #owner, #parent, #prev, #root, #selector, #shell, #target, #x, #y
Attributes inherited from FXDrawable
Attributes inherited from FXId
Instance Method Summary collapse
-
#documentLower ⇒ Object
Return lower edge of document (an integer).
-
#documentUpper ⇒ Object
Return upper edge of document (an integer).
-
#initialize(p, target = nil, selector = 0, opts = RULER_NORMAL, x = 0, y = 0, width = 0, height = 0, padLeft = DEFAULT_PAD, padRight = DEFAULT_PAD, padTop = DEFAULT_PAD, padBottom = DEFAULT_PAD) ⇒ FXRuler
constructor
Return an initialized FXRuler instance.
Methods inherited from FXWindow
#acceptDrop, #acquireClipboard, #acquireSelection, #active?, #addHotKey, after?, #after?, before?, #before?, #beginDrag, #canFocus?, #changeFocus, #childAtIndex, #childOf?, #children, #clearDragRectangle, #clearShape, colorType, colorTypeName, commonAncestor, #composeContext, #composite?, #contains?, #containsChild?, #create, #createComposeContext, #cursorPosition, #default?, #defaultHeight, #defaultWidth, deleteType, deleteTypeName, #destroy, #destroyComposeContext, #detach, #didAccept, #disable, #doesSaveUnder?, #dragging?, #dropDisable, #dropEnable, #dropEnabled?, #dropFinished, #dropTarget?, #each_child, #each_child_recursive, #enable, #enabled?, #endDrag, #forceRefresh, #getChildAt, #getDNDData, #getHeightForWidth, #getWidthForHeight, #grab, #grabKeyboard, #grabbed?, #grabbedKeyboard?, #handleDrag, #hasClipboard?, #hasFocus?, #hasSelection?, #height, #height=, #hide, imageType, #inFocusChain?, #indexOfChild, #initial?, #inquireDNDAction, #inquireDNDTypes, #killFocus, #layout, #linkAfter, #linkBefore, #lower, #move, octetType, octetTypeName, #offeredDNDType?, #raiseWindow, #recalc, #releaseClipboard, #releaseSelection, #remHotKey, #removeChild, #repaint, #reparent, #resize, #scroll, #setCursorPosition, #setDNDData, #setDefault, #setDragRectangle, #setFocus, #setInitial, #setShape, #shell?, #show, #shown?, stringType, textType, textTypeName, #tr, #translateCoordinatesFrom, #translateCoordinatesTo, #underCursor?, #ungrab, #ungrabKeyboard, #update, urilistType, urilistTypeName, utf16Type, utf16TypeName, utf8Type, utf8TypeName, #visible=, #width, #width=
Methods included from Responder2
Methods inherited from FXDrawable
Methods inherited from FXId
#create, #created?, #destroy, #detach, #runOnUiThread
Methods inherited from FXObject
#bind, #handle, #load, #save, subclasses
Constructor Details
#initialize(p, target = nil, selector = 0, opts = RULER_NORMAL, x = 0, y = 0, width = 0, height = 0, padLeft = DEFAULT_PAD, padRight = DEFAULT_PAD, padTop = DEFAULT_PAD, padBottom = DEFAULT_PAD) ⇒ FXRuler
Return an initialized FXRuler instance.
121 122 |
# File 'rdoc-sources/FXRuler.rb', line 121 def initialize(p, target=nil, selector=0, opts=RULER_NORMAL, x=0, y=0, width=0, height=0, padLeft=DEFAULT_PAD, padRight=DEFAULT_PAD, padTop=DEFAULT_PAD, padBottom=DEFAULT_PAD) # :yields: theRuler end |
Instance Attribute Details
#contentSize ⇒ Object
Content size [Integer]
59 60 61 |
# File 'rdoc-sources/FXRuler.rb', line 59 def contentSize @contentSize end |
#documentSize ⇒ Object
Document size [Integer]
62 63 64 |
# File 'rdoc-sources/FXRuler.rb', line 62 def documentSize @documentSize end |
#edgeSpacing ⇒ Object
Document size [Integer]
65 66 67 |
# File 'rdoc-sources/FXRuler.rb', line 65 def edgeSpacing @edgeSpacing end |
#font ⇒ Object
The text font Fox::FXFont
98 99 100 |
# File 'rdoc-sources/FXRuler.rb', line 98 def font @font end |
#helpText ⇒ Object
The status line help text for this ruler [String]
113 114 115 |
# File 'rdoc-sources/FXRuler.rb', line 113 def helpText @helpText end |
#indentFirst ⇒ Object
First line indent [Integer]
74 75 76 |
# File 'rdoc-sources/FXRuler.rb', line 74 def indentFirst @indentFirst end |
#indentLower ⇒ Object
Lower indent [Integer]
77 78 79 |
# File 'rdoc-sources/FXRuler.rb', line 77 def indentLower @indentLower end |
#indentUpper ⇒ Object
Upper indent [Integer]
80 81 82 |
# File 'rdoc-sources/FXRuler.rb', line 80 def indentUpper @indentUpper end |
#majorTicks ⇒ Object
Document major ticks [Integer]
86 87 88 |
# File 'rdoc-sources/FXRuler.rb', line 86 def majorTicks @majorTicks end |
#marginLower ⇒ Object
Lower document margin [Integer]
68 69 70 |
# File 'rdoc-sources/FXRuler.rb', line 68 def marginLower @marginLower end |
#marginUpper ⇒ Object
Upper document margin [Integer]
71 72 73 |
# File 'rdoc-sources/FXRuler.rb', line 71 def marginUpper @marginUpper end |
#minorTicks ⇒ Object
Document minor ticks [Integer]
89 90 91 |
# File 'rdoc-sources/FXRuler.rb', line 89 def minorTicks @minorTicks end |
#numberTicks ⇒ Object
Document number placement [Integer]
83 84 85 |
# File 'rdoc-sources/FXRuler.rb', line 83 def numberTicks @numberTicks end |
#pixelsPerTick ⇒ Object
Pixels per tick spacing [Float]
95 96 97 |
# File 'rdoc-sources/FXRuler.rb', line 95 def pixelsPerTick @pixelsPerTick end |
#position ⇒ Object
Current position [Integer]
56 57 58 |
# File 'rdoc-sources/FXRuler.rb', line 56 def position @position end |
#rulerAlignment ⇒ Object
Ruler alignment [Integer]
107 108 109 |
# File 'rdoc-sources/FXRuler.rb', line 107 def rulerAlignment @rulerAlignment end |
#rulerStyle ⇒ Object
The ruler style [Integer]
104 105 106 |
# File 'rdoc-sources/FXRuler.rb', line 104 def rulerStyle @rulerStyle end |
#textColor ⇒ Object
The current text color Fox::FXColor
110 111 112 |
# File 'rdoc-sources/FXRuler.rb', line 110 def textColor @textColor end |
#tinyTicks ⇒ Object
Document tiny ticks [Integer]
92 93 94 |
# File 'rdoc-sources/FXRuler.rb', line 92 def tinyTicks @tinyTicks end |
#tipText ⇒ Object
The tool tip message for this ruler [String]
116 117 118 |
# File 'rdoc-sources/FXRuler.rb', line 116 def tipText @tipText end |
#value ⇒ Object
The slider value [Integer]
101 102 103 |
# File 'rdoc-sources/FXRuler.rb', line 101 def value @value end |
Instance Method Details
#documentLower ⇒ Object
Return lower edge of document (an integer)
125 |
# File 'rdoc-sources/FXRuler.rb', line 125 def documentLower; end |
#documentUpper ⇒ Object
Return upper edge of document (an integer)
128 |
# File 'rdoc-sources/FXRuler.rb', line 128 def documentUpper; end |