Class: Fox::FXRuler

Inherits:
FXFrame show all
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

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

#height, #visual, #width

Attributes inherited from FXId

#app, #userData, #xid

Instance Method Summary collapse

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

#connect

Methods inherited from FXDrawable

#resize

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

#contentSizeObject

Content size [Integer]


59
60
61
# File 'rdoc-sources/FXRuler.rb', line 59

def contentSize
  @contentSize
end

#documentSizeObject

Document size [Integer]


62
63
64
# File 'rdoc-sources/FXRuler.rb', line 62

def documentSize
  @documentSize
end

#edgeSpacingObject

Document size [Integer]


65
66
67
# File 'rdoc-sources/FXRuler.rb', line 65

def edgeSpacing
  @edgeSpacing
end

#fontObject

The text font Fox::FXFont


98
99
100
# File 'rdoc-sources/FXRuler.rb', line 98

def font
  @font
end

#helpTextObject

The status line help text for this ruler [String]


113
114
115
# File 'rdoc-sources/FXRuler.rb', line 113

def helpText
  @helpText
end

#indentFirstObject

First line indent [Integer]


74
75
76
# File 'rdoc-sources/FXRuler.rb', line 74

def indentFirst
  @indentFirst
end

#indentLowerObject

Lower indent [Integer]


77
78
79
# File 'rdoc-sources/FXRuler.rb', line 77

def indentLower
  @indentLower
end

#indentUpperObject

Upper indent [Integer]


80
81
82
# File 'rdoc-sources/FXRuler.rb', line 80

def indentUpper
  @indentUpper
end

#majorTicksObject

Document major ticks [Integer]


86
87
88
# File 'rdoc-sources/FXRuler.rb', line 86

def majorTicks
  @majorTicks
end

#marginLowerObject

Lower document margin [Integer]


68
69
70
# File 'rdoc-sources/FXRuler.rb', line 68

def marginLower
  @marginLower
end

#marginUpperObject

Upper document margin [Integer]


71
72
73
# File 'rdoc-sources/FXRuler.rb', line 71

def marginUpper
  @marginUpper
end

#minorTicksObject

Document minor ticks [Integer]


89
90
91
# File 'rdoc-sources/FXRuler.rb', line 89

def minorTicks
  @minorTicks
end

#numberTicksObject

Document number placement [Integer]


83
84
85
# File 'rdoc-sources/FXRuler.rb', line 83

def numberTicks
  @numberTicks
end

#pixelsPerTickObject

Pixels per tick spacing [Float]


95
96
97
# File 'rdoc-sources/FXRuler.rb', line 95

def pixelsPerTick
  @pixelsPerTick
end

#positionObject

Current position [Integer]


56
57
58
# File 'rdoc-sources/FXRuler.rb', line 56

def position
  @position
end

#rulerAlignmentObject

Ruler alignment [Integer]


107
108
109
# File 'rdoc-sources/FXRuler.rb', line 107

def rulerAlignment
  @rulerAlignment
end

#rulerStyleObject

The ruler style [Integer]


104
105
106
# File 'rdoc-sources/FXRuler.rb', line 104

def rulerStyle
  @rulerStyle
end

#textColorObject

The current text color Fox::FXColor


110
111
112
# File 'rdoc-sources/FXRuler.rb', line 110

def textColor
  @textColor
end

#tinyTicksObject

Document tiny ticks [Integer]


92
93
94
# File 'rdoc-sources/FXRuler.rb', line 92

def tinyTicks
  @tinyTicks
end

#tipTextObject

The tool tip message for this ruler [String]


116
117
118
# File 'rdoc-sources/FXRuler.rb', line 116

def tipText
  @tipText
end

#valueObject

The slider value [Integer]


101
102
103
# File 'rdoc-sources/FXRuler.rb', line 101

def value
  @value
end

Instance Method Details

#documentLowerObject

Return lower edge of document (an integer)


125
# File 'rdoc-sources/FXRuler.rb', line 125

def documentLower; end

#documentUpperObject

Return upper edge of document (an integer)


128
# File 'rdoc-sources/FXRuler.rb', line 128

def documentUpper; end