Class Fox::FXIconList
In: FXIconList.rb
../lib/fox/iterators.rb
Parent: FXScrollArea

Icon list widget

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
appendHeader    appendItem    appendItem    clearItems    deselectItem    disableItem    each    enableItem    extendSelection    findItem    getHeaderIcon    getHeaderSize    getHeaderText    getItemBigIcon    getItemData    getItemMiniIcon    getItemText    hitItem    insertItem    insertItem    itemAt    itemCurrent?    itemEnabled?    itemSelected?    itemVisible?    killSelection    makeItemVisible    new    prependItem    prependItem    removeHeader    removeItem    replaceItem    replaceItem    retrieveItem    selectInRectangle    selectItem    setCurrentItem    setHeaderIcon    setHeaderSize    setHeaderText    setItemBigIcon    setItemData    setItemMiniIcon    setItemText    sortItems    toggleItem    updateItem   
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]

Included modules
Enumerable
Public Class methods
new(parent, target=nil, selector=0, opts=ICONLIST_NORMAL, x=0, y=0, width=0, height=0) {|theIconList| ...}

Construct icon list

Public Instance methods
appendHeader(text, icon=nil, size=1)

Append header with given text and optional icon.

removeHeader(headerIndex)

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

setHeaderText(headerIndex, text)

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

getHeaderText(headerIndex)

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

setHeaderIcon(headerIndex, icon)

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

getHeaderIcon(headerIndex)

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

setHeaderSize(headerIndex, size)

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

getHeaderSize(headerIndex)

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

retrieveItem(itemIndex)

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

replaceItem(index, item, notify=false)

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.

replaceItem(index, text, bigIcon=nil, miniIcon=nil, data=nil, notify=false)

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.

insertItem(index, item, notify=false)

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.

insertItem(index, text, bigIcon=nil, miniIcon=nil, data=nil, notify=false)

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.

appendItem(item, notify=false)

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.

appendItem(text, bigIcon=nil, miniIcon=nil, data=nil, notify=false)

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.

prependItem(item, notify=false)

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.

prependItem(text, bigIcon=nil, miniIcon=nil, data=nil, notify=false)

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.

removeItem(index, notify=false)

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.

clearItems(notify=false)

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.

itemAt(x, y)

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

findItem(text, start=-1, flags=SEARCH_FORWARD|SEARCH_WRAP)

Search items for item by name, starting from start item; the flags argument controls the search direction, and case sensitivity.

makeItemVisible(index)

Scroll to make item at index visible. Raises IndexError if index is out of bounds.

setItemText(index, text)

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

getItemText(index)

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

setItemBigIcon(index, bigIcon)

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

getItemBigIcon(index)

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

setItemMiniIcon(index, miniIcon)

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

getItemMiniIcon(index)

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

setItemData(index, data)

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

getItemData(index)

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

itemSelected?(index)

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

itemCurrent?(index)

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

itemVisible?(index)

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

itemEnabled?(index)

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

hitItem(index, x, y, ww=1, hh=1)

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

updateItem(index)

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

selectInRectangle(x, y, w, h, notify=false)

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.

enableItem(index)

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

disableItem(index)

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

selectItem(index, notify=false)

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.

deselectItem(index, notify=false)

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.

toggleItem(index, notify=false)

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.

setCurrentItem(index, notify=false)

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.

extendSelection(index, notify=false)

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.

killSelection(notify=false)

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.

sortItems()

Sort items

each() {|anIconItem| ...}

Calls block once for each item in the list, passing a reference to that item as a parameter.