Class: Fox::FXScrollBar

Inherits:
FXWindow show all
Defined in:
rdoc-sources/FXScrollBar.rb

Overview

The scroll bar is used when a document has a larger content than may be made visible. The range is the total size of the document, the page is the part of the document which is visible. The size of the scrollbar thumb is adjusted to give feedback of the relative sizes of each. The scroll bar may be manipulated by the left mouse button (normal scrolling), by the middle mouse button (same as the left mouse only the scroll position can jump to the place where the click is made), or by the right mouse button (vernier- or fine-scrolling). Holding down the control key while scrolling with the left or middle mouse button also enables vernier-scrolling mode. The vernier-scrolling mode is very useful for accurate positioning in large documents. Finally, if the mouse sports a wheel, the scroll bar can be manipulated by means of the mouse wheel as well. Holding down the Control-key during wheel motion will cause the scrolling to go faster than normal.

Events

The following messages are sent by FXScrollBar 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_MIDDLEBUTTONPRESS

sent when the middle mouse button goes down; the message data is an FXEvent instance.

SEL_MIDDLEBUTTONRELEASE

sent when the middle mouse button goes up; the message data is an FXEvent instance.

SEL_RIGHTBUTTONPRESS

sent when the right mouse button goes down; the message data is an FXEvent instance.

SEL_RIGHTBUTTONRELEASE

sent when the right mouse button goes up; the message data is an FXEvent instance.

SEL_CHANGED

sent continuously while the scroll bar is moving; the message data is an integer indicating the current position of the scroll bar.

SEL_COMMAND

sent at the end of a scrolling operation, to signal that the scrolling is complete. The message data is an integer indicating the new position of the scroll bar.

Scrollbar styles

SCROLLBAR_HORIZONTAL

Horizontally oriented

SCROLLBAR_VERTICAL

Vertically oriented (the default)

Message identifiers

ID_TIMEWHEEL

x

ID_AUTOINC_LINE

x

ID_AUTODEC_LINE

x

ID_AUTOINC_PAGE

x

ID_AUTODEC_PAGE

x

ID_AUTOINC_PIX

x

ID_AUTODEC_PIX

x

Instance Attribute Summary collapse

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 = SCROLLBAR_VERTICAL, x = 0, y = 0, width = 0, height = 0) ⇒ FXScrollBar

Return an initialized FXScrollBar instance.

Parameters:

p

the parent widget for this scroll bar Fox::FXComposite

target

the initial message target (if any) for this scroll bar Fox::FXObject

selector

the message identifier for this scroll bar [Integer]

opts

the options [Integer]

x

initial x-position, when the LAYOUT_FIX_X layout hint is in effect [Integer]

y

initial y-position, when the LAYOUT_FIX_Y layout hint is in effect [Integer]

width

initial width, when the LAYOUT_FIX_WIDTH layout hint is in effect [Integer]

height

initial height, when the LAYOUT_FIX_HEIGHT layout hint is in effect [Integer]



91
92
# File 'rdoc-sources/FXScrollBar.rb', line 91

def initialize(p, target=nil, selector=0, opts=SCROLLBAR_VERTICAL, x=0, y=0, width=0, height=0) # :yields: theScrollBar
end

Instance Attribute Details

#barSizeObject

Bar size [Integer]



75
76
77
# File 'rdoc-sources/FXScrollBar.rb', line 75

def barSize
  @barSize
end

#borderColorObject

Border color Fox::FXColor



69
70
71
# File 'rdoc-sources/FXScrollBar.rb', line 69

def borderColor
  @borderColor
end

#hiliteColorObject

Highlight color Fox::FXColor



63
64
65
# File 'rdoc-sources/FXScrollBar.rb', line 63

def hiliteColor
  @hiliteColor
end

#lineObject

Scroll increment for line [Integer]



57
58
59
# File 'rdoc-sources/FXScrollBar.rb', line 57

def line
  @line
end

#pageObject

Viewport page size [Integer]



54
55
56
# File 'rdoc-sources/FXScrollBar.rb', line 54

def page
  @page
end

#positionObject

Current scroll position [Integer]



60
61
62
# File 'rdoc-sources/FXScrollBar.rb', line 60

def position
  @position
end

#rangeObject

Content size range [Integer]



51
52
53
# File 'rdoc-sources/FXScrollBar.rb', line 51

def range
  @range
end

#scrollbarStyleObject

Scroll bar style [Integer]



72
73
74
# File 'rdoc-sources/FXScrollBar.rb', line 72

def scrollbarStyle
  @scrollbarStyle
end

#shadowColorObject

Shadow color Fox::FXColor



66
67
68
# File 'rdoc-sources/FXScrollBar.rb', line 66

def shadowColor
  @shadowColor
end