Class: Fox::FXScrollArea
- Inherits:
-
FXComposite
- Object
- FXObject
- FXId
- FXDrawable
- FXWindow
- FXComposite
- Fox::FXScrollArea
- Defined in:
- rdoc-sources/FXScrollArea.rb,
lib/fox16/core.rb
Overview
The scroll area widget manages a content area and a viewport area through which the content is viewed. When the content area becomes larger than the viewport area, scrollbars are placed to permit viewing of the entire content by scrolling the content. Depending on the mode, scrollbars may be displayed on an as-needed basis, always, or never. Normally, the scroll area’s size and the content’s size are independent; however, it is possible to disable scrolling in the horizontal (vertical) direction. In this case, the content width (height) will influence the width (height) of the scroll area widget. For content which is time-consuming to repaint, continuous scrolling may be turned off.
Scrollbar options
SCROLLERS_NORMAL
-
Show the scrollbars when needed
HSCROLLER_ALWAYS
-
Always show horizontal scrollers
HSCROLLER_NEVER
-
Never show horizontal scrollers
VSCROLLER_ALWAYS
-
Always show vertical scrollers
VSCROLLER_NEVER
-
Never show vertical scrollers
HSCROLLING_ON
-
Horizontal scrolling turned on (default)
HSCROLLING_OFF
-
Horizontal scrolling turned off
VSCROLLING_ON
-
Vertical scrolling turned on (default)
VSCROLLING_OFF
-
Vertical scrolling turned off
SCROLLERS_TRACK
-
Scrollers track continuously for smooth scrolling
SCROLLERS_DONT_TRACK
-
Scrollers don’t track continuously
Direct Known Subclasses
FXBitmapView, FXFoldingList, FXIconList, FXImageView, FXList, FXRulerView, FXScintilla, FXScrollWindow, FXTable, FXText, FXTreeList
Instance Attribute Summary collapse
-
#contentHeight ⇒ Object
readonly
Content height, in pixels [Integer].
-
#contentWidth ⇒ Object
readonly
Content width, in pixels [Integer].
-
#horizontalScrollBar ⇒ Object
readonly
Horizontal scrollbar FXScrollBar.
-
#scrollStyle ⇒ Object
Scroll style [Integer].
-
#verticalScrollBar ⇒ Object
readonly
Vertical scrollbar FXScrollBar.
-
#viewportHeight ⇒ Object
readonly
Viewport height, in pixels [Integer].
-
#viewportWidth ⇒ Object
readonly
Viewport width, in pixels [Integer].
-
#xPosition ⇒ Object
readonly
Current x-position [Integer].
-
#yPosition ⇒ Object
readonly
Current y-position [Integer].
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
-
#horizontalScrollable? ⇒ Boolean
Return
true
if horizontally scrollable. -
#initialize(parent, opts = 0, x = 0, y = 0, width = 0, height = 0) ⇒ FXScrollArea
constructor
Return an initialized FXScrollArea instance.
-
#position ⇒ Object
Get the current position as an array [x, y].
-
#scrollCorner ⇒ Object
Returns a reference to the scroll corner (an FXScrollCorner instance) for this window.
-
#setPosition(x, y) ⇒ Object
Set the current position to (x, y).
-
#verticalScrollable? ⇒ Boolean
Return
true
if vertically scrollable.
Methods inherited from FXComposite
#maxChildHeight, #maxChildWidth
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(parent, opts = 0, x = 0, y = 0, width = 0, height = 0) ⇒ FXScrollArea
Return an initialized FXScrollArea instance.
Parameters:
parent
-
the parent widget for this scroll area Fox::FXComposite
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]
71 72 |
# File 'rdoc-sources/FXScrollArea.rb', line 71 def initialize(parent, opts=0, x=0, y=0, width=0, height=0) # :yields: theScrollArea end |
Instance Attribute Details
#contentHeight ⇒ Object (readonly)
Content height, in pixels [Integer]
42 43 44 |
# File 'rdoc-sources/FXScrollArea.rb', line 42 def contentHeight @contentHeight end |
#contentWidth ⇒ Object (readonly)
Content width, in pixels [Integer]
39 40 41 |
# File 'rdoc-sources/FXScrollArea.rb', line 39 def contentWidth @contentWidth end |
#horizontalScrollBar ⇒ Object (readonly)
Horizontal scrollbar Fox::FXScrollBar
48 49 50 |
# File 'rdoc-sources/FXScrollArea.rb', line 48 def horizontalScrollBar @horizontalScrollBar end |
#scrollStyle ⇒ Object
Scroll style [Integer]
45 46 47 |
# File 'rdoc-sources/FXScrollArea.rb', line 45 def scrollStyle @scrollStyle end |
#verticalScrollBar ⇒ Object (readonly)
Vertical scrollbar Fox::FXScrollBar
51 52 53 |
# File 'rdoc-sources/FXScrollArea.rb', line 51 def verticalScrollBar @verticalScrollBar end |
#viewportHeight ⇒ Object (readonly)
Viewport height, in pixels [Integer]
36 37 38 |
# File 'rdoc-sources/FXScrollArea.rb', line 36 def @viewportHeight end |
#viewportWidth ⇒ Object (readonly)
Viewport width, in pixels [Integer]
33 34 35 |
# File 'rdoc-sources/FXScrollArea.rb', line 33 def @viewportWidth end |
#xPosition ⇒ Object (readonly)
Current x-position [Integer]
54 55 56 |
# File 'rdoc-sources/FXScrollArea.rb', line 54 def xPosition @xPosition end |
#yPosition ⇒ Object (readonly)
Current y-position [Integer]
57 58 59 |
# File 'rdoc-sources/FXScrollArea.rb', line 57 def yPosition @yPosition end |
Instance Method Details
#horizontalScrollable? ⇒ Boolean
Return true
if horizontally scrollable
75 |
# File 'rdoc-sources/FXScrollArea.rb', line 75 def horizontalScrollable?() ; end |
#position ⇒ Object
Get the current position as an array [x, y]
84 |
# File 'rdoc-sources/FXScrollArea.rb', line 84 def position() ; end |
#scrollCorner ⇒ Object
Returns a reference to the scroll corner (an FXScrollCorner instance) for this window.
207 208 209 |
# File 'lib/fox16/core.rb', line 207 def scrollCorner verticalScrollBar.next end |
#setPosition(x, y) ⇒ Object
Set the current position to (x, y)
81 |
# File 'rdoc-sources/FXScrollArea.rb', line 81 def setPosition(x, y) ; end |
#verticalScrollable? ⇒ Boolean
Return true
if vertically scrollable
78 |
# File 'rdoc-sources/FXScrollArea.rb', line 78 def verticalScrollable?() ; end |