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

HbListBox()

Creates a new HbListBox object

Syntax

HbListBox():new( <nTop>     , ;
                 <nLeft>    , ;
                 <nBottom>  , ;
                 <nRight>   , ;
                [<lDropDown>] ) --> oHbListBox

Arguments

<nTop>, <nLeft>, <nBottom>, <nRight>
These numeric parameters indicate the screen coordinates for the upper left and lower right corner of the list box output. The range for rows on the screen is 0 to MaxRow(), and for columns it is 0 to MaxCol(). The coordinate 0,0 is the upper left corner of the screen.
<lDropDown>
This parameter defaults to .F. (false), indicating that the list box is displayed as a multi-line list box. When set to .F. (true) a drop-down list box is displayed in a single line on the screen.

Return

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

Description

Objects of the HbListBox class are used in text mode applications to display a list of items and let the user select one of them. HbListBox objects are designed to be integrated into the standard Get system and are usually created with the @...GET LISTBOX command. This command creates a Get() object and an associated HbListBox object. Selecting a single item from the list box is then accomplished by the READ command.

When a HbListBox object is created with the :new() method, instead of the @...GET LISTBOX command, it must be filled with items using method :addItem().

Instance Variables

:bottom
Numeric bottom row coordinate of the list box display.
:buffer
Numeric ordinal position of the selected item.
:capCol
Numeric column position of the caption.
:capRow
Numeric row position of the caption.
:caption
Character string defining the caption.
:cargo
Instance variable for user-defined purposes.
:coldBox
Box string for border when list box has no input focus.
:colorSpec
Color string for display and selecting.
:dropDown
Logical value indicating a drop-down list box.
:fBlock
Code block evaluated when input focus changes.
:hasFocus
Indicates if the HbListBox object has input focus.
:hotBox
Box string for border when list box has input focus.
:isOpen
Indicates if a drop-down list box is dropped down, or open.
:itemCount
Numeric value indicating the total number of items in the list box.
:left
Numeric left column coordinate of the list box display.
:message
Character string to be displayed as message when the list box receives input focus.
:right
Numeric right column coordinate of the list box display.
:sBlock
Code block evaluated when the selected item changes.
:style
Character string defining drop-down button.
:top
Numeric top row coordinate of the list box display.
:topItem
Numeric ordinal position of the first visible list box item.
:typeOut
Logical value indicating if a list box is empty.
:vScroll
Optional vertical ScrollBar object.

Methods

:addItem( <cText>, [<xValue>] ) --> self
Adds a new item to a list box.
:close() --> self
Closes an open drop-down list box.
:delItem( <nItemPos> ) --> self
Removes a list box item from a HbListBox object.
:display() --> self
Displays the list box on the screen.
:findText( ... ) --> nItemPos
Determines the position of an item within a list
:getData( <nItemPos> ) --> xValue
Retrieves the data associated with a list box item.
:getItem( <nItemPos> ) --> aItem
Retrieves a list box item.
:getText( <nItemPos> ) --> cText
Retrieves the textual information of a list box item.
:hitTest( <nMouseRow>, <nMouseCol> ) --> nHitCode
Tests if a list box is hit by the mouse cursor.
:insItem( <nItemPos>, <cText>, [<xValue>] ) --> self
Inserts a new item into a list box.
:killFocus() --> self
Removes input focus from the HbListBox object.
:nextItem() --> self
Selects the next item in the list box.
:open() --> self
Opens an drop-down list box.
:prevItem() --> self
Selects the previous item in the list box.
:scroll( <nMode> ) --> self
Scrolls items in the list box.
:select( [<nItemPos>] ) --> nCurrentItemPos
Queries or changes the selected item in a list box.
:setData( <nItemPos>, <xValue> ) --> self
Changes the data associated with a list box item
:setFocus() --> self
Gives input focus to the HbListBox object.
:setItem( <nItemPos>, <aItem> ) --> self
Replaces an item in a list box.
:setText( <nItemPos>, <cText> ) --> self
Changes the textual information of a list box item.

Info

See also:@...GET, @...GET LISTBOX, Get(), READ, ReadModal(), ReadVar(), Valtype(), SetColor()
Category: Object functions , Get system
Header:box.ch, button.ch
Source:rtl\listbox.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