![]() |
Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members
![]() |
#include <FXTreeList.h>
A Tree List Widget organizes items in a hierarchical, tree-like fashion.
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 treelist 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 tree 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 tree 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.
See also:
FX::FXTreeList::FXTreeList | ( | FXComposite * | p, |
FXObject * | tgt = NULL , |
||
FXSelector | sel = 0 , |
||
FXuint | opts = TREELIST_NORMAL , |
||
FXint | x = 0 , |
||
FXint | y = 0 , |
||
FXint | w = 0 , |
||
FXint | h = 0 |
||
) |
Construct a new, initially empty tree list.
virtual FX::FXTreeList::~FXTreeList | ( | ) | [virtual] |
Destructor.
static FXint FX::FXTreeList::ascending | ( | const FXTreeItem * | , |
const FXTreeItem * | |||
) | [static] |
Reimplemented in FX::FXDirList.
static FXint FX::FXTreeList::descending | ( | const FXTreeItem * | , |
const FXTreeItem * | |||
) | [static] |
Reimplemented in FX::FXDirList.
static FXint FX::FXTreeList::ascendingCase | ( | const FXTreeItem * | , |
const FXTreeItem * | |||
) | [static] |
Reimplemented in FX::FXDirList.
static FXint FX::FXTreeList::descendingCase | ( | const FXTreeItem * | , |
const FXTreeItem * | |||
) | [static] |
Reimplemented in FX::FXDirList.
virtual void FX::FXTreeList::create | ( | ) | [virtual] |
virtual void FX::FXTreeList::detach | ( | ) | [virtual] |
virtual void FX::FXTreeList::layout | ( | ) | [virtual] |
Perform layout.
Reimplemented from FX::FXScrollArea.
virtual FXint FX::FXTreeList::getDefaultWidth | ( | ) | [virtual] |
Return default width.
Reimplemented from FX::FXScrollArea.
virtual FXint FX::FXTreeList::getDefaultHeight | ( | ) | [virtual] |
Return default height.
Reimplemented from FX::FXScrollArea.
virtual FXint FX::FXTreeList::getContentWidth | ( | ) | [virtual] |
Compute and return content width.
Reimplemented from FX::FXScrollArea.
virtual FXint FX::FXTreeList::getContentHeight | ( | ) | [virtual] |
Return content height.
Reimplemented from FX::FXScrollArea.
virtual void FX::FXTreeList::recalc | ( | ) | [virtual] |
Recalculate layout.
Reimplemented from FX::FXWindow.
virtual bool FX::FXTreeList::canFocus | ( | ) | const [virtual] |
Tree list can receive focus.
Reimplemented from FX::FXWindow.
virtual void FX::FXTreeList::setFocus | ( | ) | [virtual] |
Move the focus to this window.
Reimplemented from FX::FXWindow.
virtual void FX::FXTreeList::killFocus | ( | ) | [virtual] |
Remove the focus from this window.
Reimplemented from FX::FXWindow.
FXint FX::FXTreeList::getNumItems | ( | ) | const |
Return number of items.
FXint FX::FXTreeList::getNumVisible | ( | ) | const [inline] |
Return number of visible items.
void FX::FXTreeList::setNumVisible | ( | FXint | nvis | ) |
Change number of visible items.
FXTreeItem* FX::FXTreeList::getFirstItem | ( | ) | const [inline] |
Return first root item.
FXTreeItem* FX::FXTreeList::getLastItem | ( | ) | const [inline] |
Return last root item.
FXint FX::FXTreeList::fillItems | ( | FXTreeItem * | father, |
const FXchar ** | strings, | ||
FXIcon * | oi = NULL , |
||
FXIcon * | ci = NULL , |
||
void * | ptr = NULL , |
||
FXbool | notify = FALSE |
||
) |
Fill tree list by appending items from array of strings.
FXint FX::FXTreeList::fillItems | ( | FXTreeItem * | father, |
const FXString & | strings, | ||
FXIcon * | oi = NULL , |
||
FXIcon * | ci = NULL , |
||
void * | ptr = NULL , |
||
FXbool | notify = FALSE |
||
) |
Fill tree list by appending items from newline separated strings.
FXTreeItem* FX::FXTreeList::insertItem | ( | FXTreeItem * | other, |
FXTreeItem * | father, | ||
FXTreeItem * | item, | ||
FXbool | notify = FALSE |
||
) |
Insert [possibly subclassed] item under father before other item.
FXTreeItem* FX::FXTreeList::insertItem | ( | FXTreeItem * | other, |
FXTreeItem * | father, | ||
const FXString & | text, | ||
FXIcon * | oi = NULL , |
||
FXIcon * | ci = NULL , |
||
void * | ptr = NULL , |
||
FXbool | notify = FALSE |
||
) |
Insert item with given text and optional icons, and user-data pointer under father before other item.
FXTreeItem* FX::FXTreeList::appendItem | ( | FXTreeItem * | father, |
FXTreeItem * | item, | ||
FXbool | notify = FALSE |
||
) |
Append [possibly subclassed] item as last child of father.
FXTreeItem* FX::FXTreeList::appendItem | ( | FXTreeItem * | father, |
const FXString & | text, | ||
FXIcon * | oi = NULL , |
||
FXIcon * | ci = NULL , |
||
void * | ptr = NULL , |
||
FXbool | notify = FALSE |
||
) |
Append item with given text and optional icons, and user-data pointer as last child of father.
FXTreeItem* FX::FXTreeList::prependItem | ( | FXTreeItem * | father, |
FXTreeItem * | item, | ||
FXbool | notify = FALSE |
||
) |
Prepend [possibly subclassed] item as first child of father.
FXTreeItem* FX::FXTreeList::prependItem | ( | FXTreeItem * | father, |
const FXString & | text, | ||
FXIcon * | oi = NULL , |
||
FXIcon * | ci = NULL , |
||
void * | ptr = NULL , |
||
FXbool | notify = FALSE |
||
) |
Prepend item with given text and optional icons, and user-data pointer as first child of father.
FXTreeItem* FX::FXTreeList::moveItem | ( | FXTreeItem * | other, |
FXTreeItem * | father, | ||
FXTreeItem * | item | ||
) |
Move item under father before other item.
FXTreeItem* FX::FXTreeList::extractItem | ( | FXTreeItem * | item, |
FXbool | notify = FALSE |
||
) |
Extract item.
void FX::FXTreeList::removeItem | ( | FXTreeItem * | item, |
FXbool | notify = FALSE |
||
) |
Remove item.
void FX::FXTreeList::removeItems | ( | FXTreeItem * | fm, |
FXTreeItem * | to, | ||
FXbool | notify = FALSE |
||
) |
Remove items in range [fm, to] inclusively.
void FX::FXTreeList::clearItems | ( | FXbool | notify = FALSE | ) |
Remove all items from list.
FXint FX::FXTreeList::getItemWidth | ( | const FXTreeItem * | item | ) | const [inline] |
Return item width.
FXint FX::FXTreeList::getItemHeight | ( | const FXTreeItem * | item | ) | const [inline] |
Return item height.
virtual FXTreeItem* FX::FXTreeList::getItemAt | ( | FXint | x, |
FXint | y | ||
) | const [virtual] |
Get item at x,y, if any.
FXTreeItem* FX::FXTreeList::findItem | ( | const FXString & | name, |
FXTreeItem * | start = NULL , |
||
FXuint | flags = SEARCH_FORWARD|SEARCH_WRAP |
||
) | const |
Search items by name, beginning from item start.
If the start item is NULL 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. Return NULL if no matching item is found.
FXTreeItem* FX::FXTreeList::findItemByData | ( | const void * | ptr, |
FXTreeItem * | start = NULL , |
||
FXuint | flags = SEARCH_FORWARD|SEARCH_WRAP |
||
) | const |
Search items by associated user data, beginning from item start.
If the start item is NULL 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.
virtual void FX::FXTreeList::makeItemVisible | ( | FXTreeItem * | item | ) | [virtual] |
Scroll to make item visible.
void FX::FXTreeList::setItemText | ( | FXTreeItem * | item, |
const FXString & | text | ||
) |
Change item's text.
FXString FX::FXTreeList::getItemText | ( | const FXTreeItem * | item | ) | const |
Return item's text.
void FX::FXTreeList::setItemOpenIcon | ( | FXTreeItem * | item, |
FXIcon * | icon, | ||
FXbool | owned = FALSE |
||
) |
Change item's open icon.
FXIcon* FX::FXTreeList::getItemOpenIcon | ( | const FXTreeItem * | item | ) | const |
Return item's open icon, deleting the old icon if it was owned.
void FX::FXTreeList::setItemClosedIcon | ( | FXTreeItem * | item, |
FXIcon * | icon, | ||
FXbool | owned = FALSE |
||
) |
Chance item's closed icon, deleting the old icon if it was owned.
FXIcon* FX::FXTreeList::getItemClosedIcon | ( | const FXTreeItem * | item | ) | const |
Return item's closed icon.
void FX::FXTreeList::setItemData | ( | FXTreeItem * | item, |
void * | ptr | ||
) | const |
Change item user-data pointer.
void* FX::FXTreeList::getItemData | ( | const FXTreeItem * | item | ) | const |
Return item user-data pointer.
FXbool FX::FXTreeList::isItemSelected | ( | const FXTreeItem * | item | ) | const |
Return TRUE if item is selected.
FXbool FX::FXTreeList::isItemCurrent | ( | const FXTreeItem * | item | ) | const |
Return TRUE if item is current.
FXbool FX::FXTreeList::isItemVisible | ( | const FXTreeItem * | item | ) | const |
Return TRUE if item is visible.
FXbool FX::FXTreeList::isItemOpened | ( | const FXTreeItem * | item | ) | const |
Return TRUE if item opened.
FXbool FX::FXTreeList::isItemExpanded | ( | const FXTreeItem * | item | ) | const |
Return TRUE if item expanded.
FXbool FX::FXTreeList::isItemLeaf | ( | const FXTreeItem * | item | ) | const |
Return TRUE if item is a leaf-item, i.e. has no children.
FXbool FX::FXTreeList::isItemEnabled | ( | const FXTreeItem * | item | ) | const |
Return TRUE if item is enabled.
FXint FX::FXTreeList::hitItem | ( | const FXTreeItem * | item, |
FXint | x, | ||
FXint | y | ||
) | const |
Return item hit code: 0 outside, 1 icon, 2 text, 3 box.
void FX::FXTreeList::updateItem | ( | FXTreeItem * | item | ) | const |
Repaint item.
virtual FXbool FX::FXTreeList::enableItem | ( | FXTreeItem * | item | ) | [virtual] |
Enable item.
virtual FXbool FX::FXTreeList::disableItem | ( | FXTreeItem * | item | ) | [virtual] |
Disable item.
virtual FXbool FX::FXTreeList::selectItem | ( | FXTreeItem * | item, |
FXbool | notify = FALSE |
||
) | [virtual] |
Select item.
virtual FXbool FX::FXTreeList::deselectItem | ( | FXTreeItem * | item, |
FXbool | notify = FALSE |
||
) | [virtual] |
Deselect item.
virtual FXbool FX::FXTreeList::toggleItem | ( | FXTreeItem * | item, |
FXbool | notify = FALSE |
||
) | [virtual] |
Toggle item selection.
virtual FXbool FX::FXTreeList::extendSelection | ( | FXTreeItem * | item, |
FXbool | notify = FALSE |
||
) | [virtual] |
Extend selection from anchor item to item.
virtual FXbool FX::FXTreeList::killSelection | ( | FXbool | notify = FALSE | ) | [virtual] |
Deselect all items.
virtual FXbool FX::FXTreeList::openItem | ( | FXTreeItem * | item, |
FXbool | notify = FALSE |
||
) | [virtual] |
Open item.
virtual FXbool FX::FXTreeList::closeItem | ( | FXTreeItem * | item, |
FXbool | notify = FALSE |
||
) | [virtual] |
Close item.
virtual FXbool FX::FXTreeList::collapseTree | ( | FXTreeItem * | tree, |
FXbool | notify = FALSE |
||
) | [virtual] |
Collapse tree.
Reimplemented in FX::FXDirList.
virtual FXbool FX::FXTreeList::expandTree | ( | FXTreeItem * | tree, |
FXbool | notify = FALSE |
||
) | [virtual] |
Expand tree.
Reimplemented in FX::FXDirList.
virtual void FX::FXTreeList::setCurrentItem | ( | FXTreeItem * | item, |
FXbool | notify = FALSE |
||
) | [virtual] |
Change current item.
FXTreeItem* FX::FXTreeList::getCurrentItem | ( | ) | const [inline] |
Return current item, if any.
void FX::FXTreeList::setAnchorItem | ( | FXTreeItem * | item | ) |
Change anchor item.
FXTreeItem* FX::FXTreeList::getAnchorItem | ( | ) | const [inline] |
Return anchor item, if any.
FXTreeItem* FX::FXTreeList::getCursorItem | ( | ) | const [inline] |
Return item under cursor, if any.
void FX::FXTreeList::sortItems | ( | ) |
Sort all items recursively.
void FX::FXTreeList::sortRootItems | ( | ) |
Sort root items.
void FX::FXTreeList::sortChildItems | ( | FXTreeItem * | item | ) |
Sort children of item.
FXTreeListSortFunc FX::FXTreeList::getSortFunc | ( | ) | const [inline] |
Return sort function.
void FX::FXTreeList::setSortFunc | ( | FXTreeListSortFunc | func | ) | [inline] |
Change sort function.
void FX::FXTreeList::setFont | ( | FXFont * | fnt | ) |
Change text font.
FXFont* FX::FXTreeList::getFont | ( | ) | const [inline] |
Return text font.
void FX::FXTreeList::setIndent | ( | FXint | in | ) |
Change parent-child indent amount.
FXint FX::FXTreeList::getIndent | ( | ) | const [inline] |
Return parent-child indent amount.
FXColor FX::FXTreeList::getTextColor | ( | ) | const [inline] |
Return normal text color.
void FX::FXTreeList::setTextColor | ( | FXColor | clr | ) |
Change normal text color.
FXColor FX::FXTreeList::getSelBackColor | ( | ) | const [inline] |
Return selected text background.
void FX::FXTreeList::setSelBackColor | ( | FXColor | clr | ) |
Change selected text background.
FXColor FX::FXTreeList::getSelTextColor | ( | ) | const [inline] |
Return selected text color.
void FX::FXTreeList::setSelTextColor | ( | FXColor | clr | ) |
Change selected text color.
FXColor FX::FXTreeList::getLineColor | ( | ) | const [inline] |
Return line color.
void FX::FXTreeList::setLineColor | ( | FXColor | clr | ) |
Change line color.
FXuint FX::FXTreeList::getListStyle | ( | ) | const |
Return list style.
void FX::FXTreeList::setListStyle | ( | FXuint | style | ) |
Change list style.
void FX::FXTreeList::setHelpText | ( | const FXString & | text | ) |
Set the status line help text for this list.
const FXString& FX::FXTreeList::getHelpText | ( | ) | const [inline] |
Get the status line help text for this list.
virtual void FX::FXTreeList::save | ( | FXStream & | store | ) | const [virtual] |
virtual void FX::FXTreeList::load | ( | FXStream & | store | ) | [virtual] |
![]() |