Class Fox::FXIconList
In: rdoc-sources/FXIconList.rb
Parent: FXScrollArea

A Icon List Widget displays a list of items, each with a text and optional icon. Icon List can display its items in essentially three different ways; in big-icon mode, the bigger of the two icons is used for each item, and the text is placed underneath the icon. In mini- icon mode, the icons are listed in rows and columns, with the smaller icon preceding the text. Finally, in detail mode the icons are listed in a single column, and all fields of the text are shown under a header control with one button for each subfield. When an item‘s selected state changes, the icon list sends a SEL_SELECTED or SEL_DESELECTED message. A change of the current item is signified by the SEL_CHANGED message. The icon list sends SEL_COMMAND messages when the user clicks on an item, and SEL_CLICKED, SEL_DOUBLECLICKED, and SEL_TRIPLECLICKED when the user clicks once, twice, or thrice, respectively. When items are added, replaced, or removed, the icon list sends messages of the type SEL_INSERTED, SEL_REPLACED, or SEL_DELETED. In each of these cases, the index to the item, if any, is passed in the 3rd argument of the message.

Events

The following messages are sent by FXIconList to its target:

SEL_CHANGED:sent when the current list item changes; the message data is an Integer indicating the index of the current item.
SEL_COMMAND:sent when the current list item changes; the message data is an Integer indicating the index of the current item.
SEL_KEYPRESS:sent when a key goes down; the message data is an FXEvent instance.
SEL_KEYRELEASE:sent when a key goes up; the message data is an FXEvent instance.
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_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_CLICKED:sent when a list item is single-clicked; the message data is an Integer indicating the index of the current item.
SEL_DOUBLECLICKED:sent when a list item is double-clicked; the message data is an Integer indicating the index of the current item.
SEL_TRIPLECLICKED:sent when a list item is triple-clicked; the message data is an Integer indicating the index of the current item.
SEL_SELECTED:sent when a list item is selected; the message data is an Integer indicating the index of the selected item.
SEL_DESELECTED:sent when a list item is deselected; the message data is an Integer indicating the index of the deselected item.
SEL_REPLACED:sent when a list item is about to be replaced; the message data is an Integer indicating the index of the item to be replaced.
SEL_INSERTED:sent after a list item is inserted; the message data is an Integer indicating the index of the item that was inserted.
SEL_DELETED:sent when a list item is about to be removed; the message data is an Integer indicating the index of the item to be removed.

Icon list styles

ICONLIST_EXTENDEDSELECT:Extended selection mode
ICONLIST_SINGLESELECT:At most one selected item
ICONLIST_BROWSESELECT:Always exactly one selected item
ICONLIST_MULTIPLESELECT:Multiple selection mode
ICONLIST_AUTOSIZE:Automatically size item spacing
ICONLIST_DETAILED:List mode
ICONLIST_MINI_ICONS:Mini Icon mode
ICONLIST_BIG_ICONS:Big Icon mode
ICONLIST_ROWS:Row-wise mode
ICONLIST_COLUMNS:Column-wise mode
ICONLIST_NORMAL:same as ICONLIST_EXTENDEDSELECT

Message identifiers

ID_SHOW_DETAILS:x
ID_SHOW_MINI_ICONS:x
ID_SHOW_BIG_ICONS:x
ID_ARRANGE_BY_ROWS:x
ID_ARRANGE_BY_COLUMNS:x
ID_HEADER_CHANGE:x
ID_TIPTIMER:x
ID_LOOKUPTIMER:x
ID_SELECT_ALL:x
ID_DESELECT_ALL:x
ID_SELECT_INVERSE:x

Methods

Attributes

anchorItem  [RW]  Index of anchor item, or -1 if none [Integer]
currentItem  [RW]  Index of current item, or -1 if none [Integer]
cursorItem  [R]  Index of item under the cursor, or -1 if none [Integer]
font  [RW]  Text font [FXFont]
header  [R]  The header control [FXHeader]
helpText  [RW]  Status line help text [String]
itemHeight  [R]  Item height [Integer]
itemSpace  [RW]  Maximum item space (in pixels) for each item [Integer]
itemWidth  [R]  Item width [Integer]
listStyle  [RW]  Icon list style [Integer]
numCols  [R]  Number of columns [Integer]
numHeaders  [R]  The number of header items in the header control [Integer]
numItems  [R]  Number of items [Integer]
numRows  [R]  Number of rows [Integer]
selBackColor  [RW]  Background color for selected item(s) [FXColor]
selTextColor  [RW]  Text color for selected item(s) [FXColor]
textColor  [RW]  Normal text color [FXColor]

Public Class methods

Public Instance methods

Append header with given text and optional icon.

Append a new item with given text and optional bigIcon, miniIcon and user data. If notify is true, a SEL_INSERTED message is sent to the list‘s message target after the item is appended.

Append a new (possibly subclassed) item to the end of the list. If notify is true, a SEL_INSERTED message is sent to the list‘s message target after the item is appended.

Remove all items from list. If notify is true, a SEL_DELETED message is sent to the list‘s message target before each item is removed.

Deselect item at index. If notify is true, a SEL_DESELECTED message is sent to the list‘s message target after the item is deselected. Raises IndexError if index is out of bounds.

Disable item at index. Raises IndexError if index is out of bounds.

Enable item at index. Raises IndexError if index is out of bounds.

Extend selection from anchor index to index. If notify is true, a series of SEL_SELECTED and SEL_DESELECTED messages are sent to the list‘s message target as the selected-state of different items changes. Raises IndexError if index is out of bounds.

Extract item from list and return a reference to the item. If notify is true, a SEL_DELETED message is sent to the list‘s message target before the item is extracted from the list. Raises IndexError if index is out of bounds.

Fill list by appending items from array of strings, and return the number of items appended.

Search items by text, beginning from item start. If the start item is -1 the search will start at the first item in the list. Flags may be SEARCH_FORWARD or SEARCH_BACKWARD to control the search direction; this can be combined with SEARCH_NOWRAP or SEARCH_WRAP to control whether the search wraps at the start or end of the list. The option SEARCH_IGNORECASE causes a case-insensitive match. Finally, passing SEARCH_PREFIX causes searching for a prefix of the item name. Return -1 if no matching item is found.

Search items by associated user data, beginning from item start. If the start item is -1 the search will start at the first item in the list. Flags may be SEARCH_FORWARD or SEARCH_BACKWARD to control the search direction; this can be combined with SEARCH_NOWRAP or SEARCH_WRAP to control whether the search wraps at the start or end of the list.

Return icon of header at headerIndex. Raises IndexError if headerIndex is out of bounds.

Return size of header at headerIndex. Raises IndexError if headerIndex is out of bounds.

Return text of header at headerIndex. Raises IndexError if headerIndex is out of bounds.

Return the item at the given index. Raises IndexError if index is out of bounds.

Return index of item at (x, y), or -1 if none

Return big icon for item at index. Raises IndexError if index is out of bounds.

Return user data for item at index. Raises IndexError if index is out of bounds.

Return mini icon for item at index. Raises IndexError if index is out of bounds.

Return text for item at index. Raises IndexError if index is out of bounds.

Return item hit code: 0 outside, 1 icon, 2 text. Raises IndexError if index is out of bounds.

Insert a new (possibly subclassed) item at the given index. If notify is true, a SEL_INSERTED message is sent to the list‘s message target after the item is inserted. Raises IndexError if index is out of bounds.

Insert item at index with given text, bigIcon, miniIcon and user data. If notify is true, a SEL_INSERTED message is sent to the list‘s message target after the item is inserted. Raises IndexError if index is out of bounds.

Return true if item at index is the current item. Raises IndexError if index is out of bounds.

Return true if item at index is enabled. Raises IndexError if index is out of bounds.

Return true if item at index is selected. Raises IndexError if index is out of bounds.

Return true if item at index is visible. Raises IndexError if index is out of bounds.

Deselect all items. If notify is true, a SEL_DESELECTED message is sent to the list‘s message target for all the items that were selected before killSelection was called.

Scroll to bring item into view. The argument is either a reference to an FXIconItem instance, or the integer index of an item in the list. For the latter case, makeItemVisible raises IndexError if the index is out of bounds.

Move item from oldIndex to newIndex and return the new index of the item.. If notify is true and this move causes the current item to change, a SEL_CHANGED message is sent to the list‘s message target to indicate this change in the current item. Raises IndexError if either oldIndex or newIndex is out of bounds.

Prepend a new item with given text and optional bigIcon, miniIcon and user data. If notify is true, a SEL_INSERTED message is sent to the list‘s message target after the item is prepended.

Prepend a new (possibly subclassed) item to the beginning of the list. If notify is true, a SEL_INSERTED message is sent to the list‘s message target after the item is prepended.

Remove header at headerIndex. Raises IndexError if headerIndex is out of bounds.

Remove item at index from the list. If notify is true, a SEL_DELETED message is sent to the list‘s message target before the item is removed. Raises IndexError if index is out of bounds.

Select items in rectangle. If notify is true, a SEL_SELECTED message is sent to the list‘s message target after each previously unselected item is selected.

Select item at index. If notify is true, a SEL_SELECTED message is sent to the list‘s message target after the item is selected. Raises IndexError if index is out of bounds.

Change current item index. If notify is true, a SEL_CHANGED message is sent to the list‘s message target after the current item changes. Raises IndexError if index is out of bounds.

Change icon of header at headerIndex. Raises IndexError if headerIndex is out of bounds.

Change size of header at headerIndex. Raises IndexError if headerIndex is out of bounds.

Change text of header at headerIndex. Raises IndexError if headerIndex is out of bounds.

Set headers from an array of strings.

Replace the item at index with a (possibly subclassed) item. If notify is true, a SEL_REPLACED message is sent to the list‘s message target before the item is replaced. Raises IndexError if index is out of bounds.

Replace item text, bigIcon, miniIcon and user data for the item at index. If notify is true, a SEL_REPLACED message is sent to the list‘s message target before the item is replaced. Raises IndexError if index is out of bounds.

Change big icon for item at index. Raises IndexError if index is out of bounds.

Change user data for item at index. Raises IndexError if index is out of bounds.

Change mini icon for item at index. Raises IndexError if index is out of bounds.

Change text for item at index. Raises IndexError if index is out of bounds.

Sort items

Toggle item at index. If notify is true, either a SEL_SELECTED or SEL_DESELECTED message is sent to the list‘s message target to indicate the item‘s new state. Raises IndexError if index is out of bounds.

Repaint item at index. Raises IndexError if index is out of bounds.

[Validate]