xHarbour Reference Documentation > Class Reference (textmode) xHarbour Developers Network  

HbScrollBar()

Creates a new HbScrollBar object.

Syntax

HbScrollBar():new( <nTop>    , ;
                   <nBottom> , ;
                   <nCol>    , ;
                  [<bScroll>], ;
                  [<nType>]    ) --> oHbScrollBarVertical
or

HbScrollBar():new( <nLeft>   , ;
                   <nRight>  , ;
                   <nRow>    , ;
                  [<bScroll>], ;
                   <nType>     ) --> oHbScrollBarHorizontal

Arguments

<nTop>, <nBottom> and <nCol>
These numeric parameters are the top and bottom row coordinates plus the screen column of a vertical scroll bar. If <nType> is not specified, a vertical scroll bar is created by default. <nTop> is assigned to oHbScrollBar:start, <nBottom> to oHbScrollBar:end and <nCol> to oHbScrollBar:offset.
<nLeft>, <nRight> and <nRow>
These numeric parameters are the left and right colum coordinates plus the screen row of a horizontal scroll bar. Set <nType> to 2 to create a horizontal scroll bar. <nLeft> is assigned to oHbScrollBar:start, <nRight> to oHbScrollBar:end and <nRow> to oHbScrollBar:offset.
<bScroll>
Optionally, a code block can be passed. It is evaluated each time the state of the scroll bar changes. It is assigned to oHbScrollBar:sBlock.
<nType>
This parameter defaults to 1, which creates a vertical scroll bar. Setting <nType> to 2 creates a horizontal scroll bar. <nType> is assigned to oHbScrollBar:orient.

Return

Function HbScrollBar() returns a new HbScrollBar object and method :new() initializes the object.

Description

Objects of the HbScrollBar class are used in text mode applications to display a scroll bar. They are usually created with the SCROLLBAR option of the extended @...GET LISTBOX command and are displayed in the border of a HbListBox() object.

Instance variables

:barLength
Numeric height/width of a vertical/horizontal scroll bar.
:cargo
Instance variable for user-defined purposes.
:colorSpec
Color string for scrol bar display.
:current
Numeric value indicating the current item the scroll bar refers to.
:end
Numeric screen position of the scroll bar's Next arrow.
:offset
Numeric screen position of the scroll bar.
:orient
Indicates vertical/horizontal orientation of the scroll bar.
:sBlock
Code block evaluated when the scroll bar's state changes.
:start
Numeric screen position of the scroll bar's Previous arrow.
:style
Indicates characters used by the ScrollBar:display() method
:thumbPos
Numeric relative position of the scroll bar thumb
:total
Total number of items the scroll bar refers to.

Methods

:display() --> self
Displays a scroll bar, including its thumb and arrows, on the screen
:update() --> lIsUpdated
Updates the thumb position of a scroll bar on the screen
:hitTest( <nRow>, <nCol> ) --> nHitCode
Tests if a scroll bar is hit by the mouse cursor.

Info

See also:@...GET, @...GET LISTBOX, Get(), READ, ReadModal(), ReadVar(), Valtype(), SetColor()
Category: Object functions , Get system
Header:button.ch
Source:rtl\scrollbr.prg
LIB:lib\xhb.lib
DLL:dll\xhbdll.dll


Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe