Class | Fox::FXFoldingList |
In: |
rdoc-sources/FXFoldingList.rb
|
Parent: | FXScrollArea |
An FXFoldingList widget resembles an FXTreeList, but it supports a header control to provide each item with multiple columns of text. Subtrees can be collapsed or expanded by double-clicking on an item or by clicking on the optional plus button in front of the item. Each item may have a text and optional open-icon as well as a closed-icon. The items may be connected by optional lines to show the hierarchical relationship. When an item‘s selected state changes, the folding list emits a SEL_SELECTED or SEL_DESELECTED message. If an item is opened or closed, a message of type SEL_OPENED or SEL_CLOSED is sent. When the subtree under an item is expanded, a SEL_EXPANDED or SEL_COLLAPSED message is issued. A change of the current item is signified by the SEL_CHANGED message. In addition, the folding 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 or removed, the folding list sends messages of the type SEL_INSERTED or SEL_DELETED. In each of these cases, a pointer to the item, if any, is passed in the 3rd argument of the message.
The following messages are sent by FXFoldingList to its target:
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_COMMAND: | sent when a list item is clicked on; the message data is a reference to the item (an FXFoldingItem instance). |
SEL_CLICKED: | sent when the left mouse button is single-clicked in the list; the message data is a reference to the item clicked (an FXFoldingItem instance) or nil if no item was clicked. |
SEL_DOUBLECLICKED: | sent when the left mouse button is double-clicked in the list; the message data is a reference to the item clicked (an FXFoldingItem instance) or nil if no item was clicked. |
SEL_TRIPLECLICKED: | sent when the left mouse button is triple-clicked in the list; the message data is a reference to the item clicked (an FXFoldingItem instance) or nil if no item was clicked. |
SEL_OPENED: | sent when an item is opened; the message data is a reference to the item (an FXFoldingItem instance). |
SEL_CLOSED: | sent when an item is closed; the message data is a reference to the item (an FXFoldingItem instance). |
SEL_EXPANDED: | sent when a sub-tree is expanded; the message data is a reference to the root item for the sub-tree (an FXFoldingItem instance). |
SEL_COLLAPSED: | sent when a sub-tree is collapsed; the message data is a reference to the root item for the sub-tree (an FXFoldingItem instance). |
SEL_SELECTED: | sent when an item is selected; the message data is a reference to the item (an FXFoldingItem instance). |
SEL_DESELECTED: | sent when an item is deselected; the message data is a reference to the item (an FXFoldingItem instance). |
SEL_CHANGED: | sent when the current item changes; the message data is a reference to the current item (an FXFoldingItem instance). |
SEL_INSERTED: | sent after an item is added to the list; the message data is a reference to the item (an FXFoldingItem instance). |
SEL_DELETED: | sent before an item is removed from the list; the message data is a reference to the item (an FXFoldingItem instance). |
FOLDINGLIST_EXTENDEDSELECT: | Extended selection mode allows for drag-selection of ranges of items |
FOLDINGLIST_SINGLESELECT: | Single selection mode allows up to one item to be selected |
FOLDINGLIST_BROWSESELECT: | Browse selection mode enforces one single item to be selected at all times |
FOLDINGLIST_MULTIPLESELECT: | Multiple selection mode is used for selection of individual items |
FOLDINGLIST_AUTOSELECT: | Automatically select under cursor |
FOLDINGLIST_SHOWS_LINES: | Lines shown |
FOLDINGLIST_SHOWS_BOXES: | Boxes to expand shown |
FOLDINGLIST_ROOT_BOXES: | Display root boxes also |
FOLDINGLIST_NORMAL: | same as FOLDINGLIST_EXTENDEDSELECT |
anchorItem | [RW] | Anchor item, if any [FXFoldingItem] |
currentItem | [RW] | Current item, if any [FXFoldingItem] |
cursorItem | [R] | Item under the cursor, if any [FXFoldingItem] |
firstItem | [R] | First root-level item [FXFoldingItem] |
font | [RW] | Text font [FXFont] |
header | [R] | Header control [FXHeader] |
helpText | [RW] | Status line help text for this list [String] |
indent | [RW] | Parent-child indent amount, in pixels [Integer] |
lastItem | [R] | Last root-level item [FXFoldingItem] |
lineColor | [RW] | Line color [FXColor] |
listStyle | [RW] | List style [Integer] |
numHeaders | [R] | Number of header items [Integer] |
numItems | [R] | Number of items [Integer] |
numVisible | [RW] | Number of visible items [Integer] |
selBackColor | [RW] | Selected text background color [FXColor] |
selTextColor | [RW] | Selected text color [FXColor] |
textColor | [RW] | Normal text color [FXColor] |
Return an initialized FXFoldingList instance; the folding list is initially empty.
p: | the parent window for this folding list [FXComposite] |
target: | the message target, if any, for this folding list [FXObject] |
selector: | the message identifier for this folding list [Integer] |
opts: | folding list options [Integer] |
x: | initial x-position [Integer] |
y: | initial y-position [Integer] |
width: | initial width [Integer] |
height: | initial height [Integer] |
Append a new item with given text and optional openIcon, closedIcon and user data as last child of father. Returns a reference to the newly added item (an FXFoldingItem instance). If notify is true, a SEL_INSERTED message is sent to the list‘s message target after the item is added.
Append (possibly subclassed) item as last child of father.. Returns a reference to the newly added item (an FXFoldingItem instance). If notify is true, a SEL_INSERTED message is sent to the list‘s message target after the item is added.
Remove all items from the list. If notify is true, a SEL_DELETED message is sent to the list‘s message target before each item is removed.
Close item. If notify is true, a SEL_CLOSED message is sent to the list‘s message target after the item is closed.
Collapse sub-tree rooted at tree. If notify is true, a SEL_COLLAPSED message is sent to the list‘s message target after the sub-tree is collapsed.
Deselect item. If notify is true, a SEL_DESELECTED message is sent to the list‘s message target after the item is deselected.
Expand sub-tree rooted at tree. If notify is true, a SEL_EXPANDED message is sent to the list‘s message target after the sub-tree is expanded.
Extend selection from anchor item to item. If notify is true, a series of SEL_SELECTED and SEL_DESELECTED messages may be sent to the list‘s message target, indicating the changes.
Extract item and return a reference to it (without destroying it). If notify is true, a SEL_CHANGED message may be sent to the folding list‘s message target if the current item changes. If the selection changes, SEL_SELECTED and SEL_DESELECTED messages may also be sent to the message target.
Fill list by appending items from array of strings and return the number of items created. If notify is true, a SEL_INSERTED message is sent to the list‘s message target after each item is added.
Search items by name, beginning from item start. If the start item is nil the search will start at the first, top-most 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. Returns nil if no matching item is found.
Search items by associated user data, beginning from item start. If the start item is nil the search will start at the first, top-most 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. Returns nil if no matching item is found.
Insert item with given text and optional icons, and user-data pointer under father before other item.. Returns a reference to the newly added item (an FXFoldingItem instance). If notify is true, a SEL_INSERTED message is sent to the list‘s message target after the item is added.
Insert a (possibly subclassed) item under father, before other. Returns a reference to the newly added item (an FXFoldingItem instance). If notify is true, a SEL_INSERTED message is sent to the list‘s message target after the item is added.
Deselect all items. If notify is true, SEL_DESELECTED messages will be sent to the list‘s message target indicating the affected items.
Open item. If notify is true, a SEL_OPENED message is sent to the list‘s message target after the item is opened.
Prepend (possibly subclassed) item as first child of father. Returns a reference to the newly added item (an FXFoldingItem instance). If notify is true, a SEL_INSERTED message is sent to the list‘s message target after the item is added.
Prepend a new item with given text and optional icons and user data as first child of father. Returns a reference to the newly added item (an FXFoldingItem instance). If notify is true, a SEL_INSERTED message is sent to the list‘s message target after the item is added.
Remove item. If notify is true, a SEL_DELETED message is sent to the list‘s message target before the item is removed.
Remove items in range [fromItem, toItem] inclusively. If notify is true, a SEL_DELETED message is sent to the list‘s message target before each item is removed.
Select item. If notify is true, a SEL_SELECTED message is sent to the list‘s message target after the item is selected.
Change current item. If notify is true, a SEL_CHANGED message is sent to the list‘s message target after the current item changes.
Change item‘s closed icon, deleting old icon if it was owned. If owned is true, mark icn as owned by this folding item.
Change item‘s open icon, deleting old icon if it was owned. If owned is true, mark icn as owned by this folding item.