A ListView displays list information to the user. Each item of the ListView consists of text and pictures, which can be manipulated during application runtime.
ListView property |
Datatype |
Description |
---|---|---|
Integer |
Specifies the ASCII value of the accelerator key assigned for the control. |
|
String |
A description of the control and/or its purpose for use by accessibility tools such as readers for visually impaired users. |
|
String |
A label that briefly describes the control, such as the text in a button or the name of a menu item. |
|
AccessibleRole (enumerated) |
Describes what kind of user interface element the control is. |
|
Boolean |
Specifies whether PowerBuilder arranges icons automatically in large and small icon views. |
|
Long |
Specifies the numeric value of the background color: -2 to 16,777,215. For more information about color, see the section called “RGB” in PowerScript Reference. |
|
Boolean |
Specifies whether the control has a border. Values are: TRUE -- Control has a border. FALSE -- Control does not have a border. |
|
BorderStyle (enumerated) |
Specifies the border style of the control. Values are: StyleBox! StyleLowered! StyleRaised! StyleShadowBox! |
|
Boolean |
Specifies whether PowerBuilder moves the control to the top of the front-to-back order. |
|
Boolean |
Specifies whether the column titles in report view appear as buttons. |
|
CheckBoxes |
Boolean |
Specifies whether the state images are replaced by check boxes. The check boxes are set to unchecked by default. The ListView control processes mouse and keyboard input to toggle the checked state. Values are:
The state of an item's check box can be determined by checking the state picture index for the item: Unchecked = 1 Checked = 2 |
ClassDefinition |
PowerObject |
An object of type PowerObject containing information about the class definition of the object or control. |
Boolean |
Specifies whether the user can delete a ListView item from a ListView control by pressing Delete. |
|
Boolean |
Specifies whether PowerBuilder puts the control automatically into Drag mode. Values are: TRUE -- When the control is clicked, the control is automatically in Drag mode. FALSE -- When the control is clicked, the control is not automatically in Drag mode. You have to manually put the control into Drag mode by using the Drag function. |
|
String |
Specifies the name of the stock icon or the file containing the icon you want to display when the user drags the control (the ICO file). The default icon is a box the size of the control. When the user drags the control, the icon displays when the control is over an area in which the control can be dropped (a valid drop area). When the control is over an area that is not a valid drop area, the No-Drop icon displays. |
|
Boolean |
Specifies whether the user can edit the labels in a control by clicking on a selected item. Note that the item must be selected first, by clicking on it. |
|
Boolean |
Specifies whether the control is enabled (can be clicked). Values are: TRUE -- Control can be clicked. FALSE -- Control cannot be clicked. |
|
Boolean |
Specifies whether users can select multiple items in the list box at one time. Values are: TRUE -- Users can select multiple items by selecting outside all items and dragging to create a rectangle enclosing the desired items; by using Click or Shift+ Click to select a sequential group of items; or by using Ctrl+ Click on multiple items. FALSE -- Users cannot select multiple items. |
|
String |
Specifies the name of the typeface in which the text of the control displays (for example, Arial or Courier). |
|
Boolean |
Specifies whether the user cannot drag items to new positions in a control. |
|
FontCharSet (enumerated) |
Specifies the font character set used for the text in the control. The application must be running on an appropriate version of PowerBuilder under an operating system that supports the selected character set. For a complete list of possible values, see the list of properties for the FontCharSet variable on the Enumerated tab page of the Browser. |
|
FontFamily (enumerated) |
Specifies the font family (type style) used for the text in the control. Values are: AnyFont! Decorative! Modern! Roman! Script! Swiss! |
|
FontPitch (enumerated) |
Specifies the font pitch used for the text in the control. Values are: Default! Fixed! Variable! |
|
FullRowSelect |
Boolean |
Specifies whether an entire row can be selected in report view. Values are:
|
GridLines |
Boolean |
Specifies whether the report view displays gridlines:
|
HeaderDragDrop |
Boolean |
Specifies whether column headers can be dragged to move columns in report view:
|
Integer |
Specifies the height of the control, in PowerBuilder units. |
|
Boolean |
Specifies whether selected text stays selected (highlighted) even when the control does not have focus. Values are: TRUE -- Text does not stay highlighted. FALSE -- Text stays highlighted. |
|
ImeMode |
Integer |
Specifies the input method editor mode. This property is relevant only to applications running on a Japanese version of PowerBuilder. |
Boolean |
Specifies whether the text in the control is italic. Values are: TRUE -- Text is italic. FALSE -- Text is not italic. |
|
String |
Specifies the items in the control. Not updated after initialization. |
|
Integer |
Identifies the picture associated with the item. The picture index itself is associated with a specific icon, bitmap, or cursor. Not updated after initialization. |
|
Boolean |
Specifies whether long labels wrap under the ListView item in a large icon view. Values are: TRUE -- Labels wrap. FALSE -- Labels do not wrap. LabelWrap does not apply to list, report, or small icon views. |
|
Integer |
Specifies the size, in pixels, for the height of the picture used in the large icon view. In a script, this value can be set only before a large picture has been added to the large picture index list. If the large picture height is 0, PowerBuilder uses the height of the first picture added to the large picture index. |
|
Long |
Specifies the color to be transparent when used in a large icon view. This color is used when the picture is added at initialization or with the function AddLargePicture. |
|
String |
Specifies the name of the picture used in large icon view. The picture can be an icon, cursor, or bitmap supplied by the user or a stock picture from the PowerBuilder library. Not updated after initialization. |
|
Integer |
Specifies the size, in pixels, for the width of the picture used in the large icon view. In a script, this value can be set only before a large picture has been added to the large picture index list. If the large picture width is 0, PowerBuilder uses the width of the first picture added to the large picture index. |
|
Boolean |
Specifies that the layout of the control should be a mirror image of the standard layout. Values are: TRUE -- Elements in the control are right justified. FALSE -- Elements in the control are left justified (default). |
|
OneClickActivate |
Boolean |
Specifies whether one click initiates the ItemActivate event:
However, the ItemActivate event is always initiated when an item is double-clicked, even though OneClickActivate = false and TwoClickActivate = false. |
String |
Specifies the name of the stock pointer or the file containing the pointer used for the control. |
|
Boolean |
Specifies that characters should be displayed in right-to-left order. The application must be running on an operating system that supports right-to-left display. Values are: TRUE -- Characters display in right-to-left order. FALSE -- Characters display in left-to-right order (default). |
|
Boolean |
Specifies whether the user can scroll vertically when not all of the items in a control are visible. Values are: TRUE -- Scrolling is enabled. FALSE -- Scrolling is disabled. |
|
Boolean |
Specifies whether column titles appear in a report view. Values are: TRUE -- Titles appear in a report view. FALSE -- Titles do not appear in a report view. |
|
Integer |
Specifies the size, in pixels, for the height of the picture used in the small icon view. In a script, this value can be set only before a small picture has been added to the small picture index list. If the small picture height is 0, PowerBuilder uses the height of the first picture added to the small picture index. |
|
Long |
Specifies the color to be transparent when used in a small icon view. Used when the picture is added at initialization or with the function AddSmallPicture. |
|
String |
Specifies the name of the picture used in small icon view. The picture can be an icon, cursor, or bitmap supplied by the user or a stock picture from the PowerBuilder library. Not updated after initialization. |
|
Integer |
Specifies the size, in pixels, for the width of the picture used in the small icon view. In a script, this value can be set only before a small picture has been added to the small picture index list. If the small picture width is 0, PowerBuilder uses the width of the first picture added to the small picture index. |
|
grSortType |
Specifies whether items are sorted alphabetically based on the item label. Values are: Ascending! Descending! UserDefinedSort! Unsorted! |
|
Integer |
Specifies the size, in pixels, for the height of the state picture. In a script, this value can be set only before a state picture has been added to the state picture index list. If the state picture height is 0, PowerBuilder uses the height of the first picture added to the state picture index list. |
|
Long |
Specifies the color to be transparent when used in a state picture. Used when the picture is added at initialization or with the function AddStatePicture. |
|
String |
Specifies the name of the picture used as the state picture. The picture can be an icon, cursor, or bitmap supplied by the user or a stock picture from the PowerBuilder library. Not updated after initialization. |
|
Integer |
Specifies the size, in pixels, for the width of the state picture. In a script, this value can be set only before a state picture has been added to the state picture index list. If the state picture width is 0, PowerBuilder uses the width of the first picture added to the state picture index list. |
|
Integer |
Specifies the tab value of the control within the window (0 means the user cannot tab to the control). |
|
String |
Specifies the tag value assigned to the control. |
|
Long |
Specifies the numeric value of the color used for text: -2 to 16,777,215. |
|
Integer |
Specifies the size of the text in the control, in points. For backward compatibility, the size is stored as a negative number; for example, 10-point text size is stored as -10. |
|
TrackSelect |
Boolean |
Specifies whether items appear in a different color when the mouse moves over them (hot tracking) and whether an item is selected if the mouse pauses over it. Values are: TRUE -- An item changes color when the mouse moves over it, and an item is selected if the mouse pauses over it. FALSE -- An item does not change color nor is it selected when the mouse moves over or pauses on it. |
TwoClickActivate |
Boolean |
Specifies whether two clicks initiate the ItemActivate event: TRUE -- Clicking twice (one click to select the item, one click to activate) fires the ItemActivate event, causes the item to change color as the mouse moves over it (hot tracking), and causes the mouse to change to a hand cursor when it is over the item. FALSE -- The item does not turn color as the mouse moves over it (assuming that TrackSelect = false) and the mouse does not change to a hand cursor when it is over the item (assuming that OneClickActivate = false). However, the ItemActivate event is always initiated when an item is double-clicked, even though TwoClickActivate = false. |
Boolean |
Specifies whether the text in the control is underlined. Values are: TRUE -- Text is underlined. FALSE -- Text is not underlined. |
|
UnderlineCold |
Boolean |
When the OneClickActivate property is true, this property specifies whether hot tracking (color of items changes when mouse moves over them) is turned on and items not highlighted are underlined. TRUE -- Hot tracking is turned on and nonhighlighted items are underlined. FALSE -- Nonhighlighted items are not underlined. |
UnderlineHot |
Boolean |
When either the OneClickActivate or TwoClickActivate property is true, this property specifies whether hot tracking (color of items changes when mouse moves over them) is turned on and items that are highlighted are underlined. TRUE -- Hot tracking is turned on and highlighted items are underlined. FALSE -- Highlighted items are not underlined. |
ListViewView |
Specifies the layout of the ListBox. Valid values are: ListViewLargeIcon! -- Items are arranged from left to right. Uses large pictures. ListViewSmallIcon! -- Items are arranged from left to right. Uses small pictures. ListViewList! -- Items are arranged from top to bottom. Uses small pictures. ListViewReport! -- Items are arranged from top to bottom. Uses small pictures. Additional columns of information can be associated with each item. At least one column must be created to view data in this view. |
|
Boolean |
Specifies whether the control is visible. Values are: TRUE -- Control is visible. FALSE -- Control is not visible. |
|
Integer |
Specifies the stroke weight of the text in the control; for example, 400 for normal or 700 for bold. |
|
Integer |
Specifies the width of the control, in PowerBuilder units. |
|
Integer |
Specifies the X position (the distance from the left edge of the window), in PowerBuilder units. |
|
Integer |
Specifies the Y position (the distance from the top of the window), in PowerBuilder units. |
ListView event |
Occurs |
---|---|
When the user begins a drag operation with the left mouse button. If the DragAuto property is set to true, the drag begins automatically. If the DragAuto property is set to false, the drag operation must be done programmatically. |
|
When the user starts to edit a ListView item label. Return 1 to prevent setting to the new text. Return 0 to accept the new text. |
|
When the user begins a drag operation with the right mouse button. If the DragAuto property is set to true, the drag begins automatically. If the DragAuto property is set to false, the drag operation must be done programmatically. |
|
When the control is clicked. |
|
When the column is clicked |
|
When the object is created, immediately before the Open event occurs in the window. |
|
When all items in a ListView are deleted. |
|
When a ListView item is deleted. |
|
When the object is destroyed, immediately after the Close event occurs in the window. |
|
When the control is double-clicked. |
|
When a dragged control is dropped on the ListView control. |
|
When a dragged control enters the control, including entering the narrow border around the display area. |
|
When a dragged control leaves the control, including leaving by crossing into the tab page display area. |
|
When a dragged control is within the control but not on a ListView item. |
|
When the user finishes editing a ListView item label. Return 1 to prevent setting to the new text. Return 0 to accept the new text. |
|
Just before the control receives focus (before it is selected and becomes active). |
|
When the user presses the F1 key or drags the context help button (question mark) from the title bar to a menu item or control. |
|
When an item is being inserted. |
|
When an item is double-clicked, or when the item is single-clicked if the property OneClickActivate = true, or when the item is clicked twice if the property TwoClickActivate = true. |
|
When an item has changed. |
|
When an item is changing. Return 1 to prevent the change, or 0 to accept the change. |
|
When the user presses a key. |
|
When the control loses focus (becomes inactive). |
|
When a Windows message occurs that is not a PowerBuilder event. |
|
When the control is right-clicked. |
|
When the control is right-double-clicked. |
|
When two items are compared. Return codes: 1 -- if item 1 > item 2. 0 -- if item 1 = item 2. -1 -- if item 1 < item 2. |
ListView function |
Datatype returned |
Description |
---|---|---|
Integer |
Adds a column to a ListView control report view. |
|
Integer |
Adds an item to a ListView control. |
|
Integer |
Adds an icon, cursor, or bitmap to the large image list. |
|
Integer |
Adds an icon, cursor, or bitmap to the small image list. |
|
Integer |
Adds an icon, cursor, or bitmap to the state image list. |
|
Integer |
Arranges the items in a ListView control large or small icon view. |
|
String |
Returns the name of the control. |
|
Integer |
Deletes a column from a ListView control. |
|
Integer |
Deletes all columns from a ListView control. |
|
Integer |
Deletes an item from a ListView control. |
|
Integer |
Deletes all items from a ListView control. |
|
Integer |
Deletes a specified icon, cursor, or bitmap from the large image list. |
|
Integer |
Deletes all icons, cursors, and bitmaps from the large image list. |
|
Integer |
Deletes a specified icon, cursor, or bitmap from the small image list. |
|
Integer |
Deletes all icons, cursors, and bitmaps from the small image list. |
|
Integer |
Deletes a specified icon, cursor, or bitmap from the state image list. |
|
Integer |
Deletes all icons, cursors, and bitmaps from the large state list. |
|
Integer |
Starts or ends the dragging of a ListView item. |
|
Integer |
Starts editing a specific ListView item label. |
|
Integer |
Searches for the next item that satisfies the specified search criteria. |
|
Integer |
Syntax 1: Does not apply to a ListView control. Syntax 2: Returns the properties of a specified column in a ListView control report view. |
|
Integer |
Creates a reference to a context-specific instance of the specified service. |
|
Integer |
Retrieves information for a specified item. |
|
Integer |
Finds the X and Y coordinates of the upper-left corner of the ListView item. |
|
PowerObject |
Returns a reference to the name of the parent object. |
|
Integer |
Hides the specified ListView item. |
|
Integer |
Inserts a column into a ListView control report view. |
|
Integer |
Inserts an item into a ListView control. |
|
Integer |
Moves a control or object to a specified location. |
|
Integer |
Determines the distance from the left edge of an object to the pointer location. |
|
Integer |
Determines the distance from the top edge of an object to the pointer location. |
|
Boolean |
Adds the event to the end of the event queue of an object. |
|
Integer |
Includes this object in a print job. Only the part visible on the screen is printed. |
|
Integer |
Resizes a control to the specified dimensions. |
|
Integer |
Returns the number of the selected item in a ListView control. |
|
Integer |
Syntax 1: Does not apply to a ListView control. Syntax 2: Sets the properties of a particular column in a ListView control report view. |
|
Integer |
Sets focus for a specified object or control. |
|
Integer |
Sets the values for a given ListView item. |
|
Integer |
Maps a picture index to an overlay picture index. Only four overlay picture indexes are available. |
|
Integer |
Sets the position of the ListView control in the front-to-back order within a window. |
|
Integer |
Controls the automatic redraw of an object after its properties have changed. |
|
Integer |
Makes an object or control visible if it is hidden. If the object is already visible, Show brings it to the top. |
|
Integer |
Sorts the items in a ListView control. |
|
Integer |
Returns the number of columns in a ListView control report view. |
|
Integer |
Returns the number of items in a ListView control. |
|
Integer |
Returns the number of selected items in a ListView control. |
|
Integer |
Triggers a specified event in the control and executes the script for the event. |
|
Object |
Returns the type of the control. |