![]() |
Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members
![]() |
#include <FXTreeList.h>
Public Member Functions | |
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) | |
virtual void | create () |
virtual void | detach () |
virtual void | layout () |
virtual FXint | getDefaultWidth () |
virtual FXint | getDefaultHeight () |
virtual FXint | getContentWidth () |
virtual FXint | getContentHeight () |
virtual void | recalc () |
virtual FXbool | canFocus () const |
virtual void | setFocus () |
virtual void | killFocus () |
FXint | getNumItems () const |
FXint | getNumVisible () const |
void | setNumVisible (FXint nvis) |
FXTreeItem * | getFirstItem () const |
FXTreeItem * | getLastItem () const |
FXint | fillItems (FXTreeItem *father, const FXchar **strings, FXIcon *oi=NULL, FXIcon *ci=NULL, void *ptr=NULL, FXbool notify=false) |
FXint | fillItems (FXTreeItem *father, const FXString &strings, FXIcon *oi=NULL, FXIcon *ci=NULL, void *ptr=NULL, FXbool notify=false) |
FXTreeItem * | insertItem (FXTreeItem *other, FXTreeItem *father, FXTreeItem *item, FXbool notify=false) |
FXTreeItem * | insertItem (FXTreeItem *other, FXTreeItem *father, const FXString &text, FXIcon *oi=NULL, FXIcon *ci=NULL, void *ptr=NULL, FXbool notify=false) |
FXTreeItem * | appendItem (FXTreeItem *father, FXTreeItem *item, FXbool notify=false) |
FXTreeItem * | appendItem (FXTreeItem *father, const FXString &text, FXIcon *oi=NULL, FXIcon *ci=NULL, void *ptr=NULL, FXbool notify=false) |
FXTreeItem * | prependItem (FXTreeItem *father, FXTreeItem *item, FXbool notify=false) |
FXTreeItem * | prependItem (FXTreeItem *father, const FXString &text, FXIcon *oi=NULL, FXIcon *ci=NULL, void *ptr=NULL, FXbool notify=false) |
FXTreeItem * | moveItem (FXTreeItem *other, FXTreeItem *father, FXTreeItem *item) |
FXTreeItem * | extractItem (FXTreeItem *item, FXbool notify=false) |
void | removeItem (FXTreeItem *item, FXbool notify=false) |
void | removeItems (FXTreeItem *fm, FXTreeItem *to, FXbool notify=false) |
void | clearItems (FXbool notify=false) |
FXint | getItemWidth (const FXTreeItem *item) const |
FXint | getItemHeight (const FXTreeItem *item) const |
virtual FXTreeItem * | getItemAt (FXint x, FXint y) const |
FXTreeItem * | findItem (const FXString &name, FXTreeItem *start=NULL, FXuint flags=SEARCH_FORWARD|SEARCH_WRAP) const |
FXTreeItem * | findItemByData (const void *ptr, FXTreeItem *start=NULL, FXuint flags=SEARCH_FORWARD|SEARCH_WRAP) const |
virtual void | makeItemVisible (FXTreeItem *item) |
void | setItemText (FXTreeItem *item, const FXString &text) |
FXString | getItemText (const FXTreeItem *item) const |
void | setItemOpenIcon (FXTreeItem *item, FXIcon *icon, FXbool owned=false) |
FXIcon * | getItemOpenIcon (const FXTreeItem *item) const |
void | setItemClosedIcon (FXTreeItem *item, FXIcon *icon, FXbool owned=false) |
FXIcon * | getItemClosedIcon (const FXTreeItem *item) const |
void | setItemData (FXTreeItem *item, void *ptr) const |
void * | getItemData (const FXTreeItem *item) const |
FXbool | isItemSelected (const FXTreeItem *item) const |
FXbool | isItemCurrent (const FXTreeItem *item) const |
FXbool | isItemVisible (const FXTreeItem *item) const |
FXbool | isItemOpened (const FXTreeItem *item) const |
FXbool | isItemExpanded (const FXTreeItem *item) const |
FXbool | isItemLeaf (const FXTreeItem *item) const |
FXbool | isItemEnabled (const FXTreeItem *item) const |
FXint | hitItem (const FXTreeItem *item, FXint x, FXint y) const |
void | updateItem (FXTreeItem *item) const |
virtual FXbool | enableItem (FXTreeItem *item) |
virtual FXbool | disableItem (FXTreeItem *item) |
virtual FXbool | selectItem (FXTreeItem *item, FXbool notify=false) |
virtual FXbool | deselectItem (FXTreeItem *item, FXbool notify=false) |
virtual FXbool | toggleItem (FXTreeItem *item, FXbool notify=false) |
virtual FXbool | extendSelection (FXTreeItem *item, FXbool notify=false) |
virtual FXbool | killSelection (FXbool notify=false) |
virtual FXbool | openItem (FXTreeItem *item, FXbool notify=false) |
virtual FXbool | closeItem (FXTreeItem *item, FXbool notify=false) |
virtual FXbool | collapseTree (FXTreeItem *tree, FXbool notify=false) |
virtual FXbool | expandTree (FXTreeItem *tree, FXbool notify=false) |
virtual void | setCurrentItem (FXTreeItem *item, FXbool notify=false) |
FXTreeItem * | getCurrentItem () const |
void | setAnchorItem (FXTreeItem *item) |
FXTreeItem * | getAnchorItem () const |
FXTreeItem * | getCursorItem () const |
void | sortItems () |
void | sortRootItems () |
void | sortChildItems (FXTreeItem *item) |
FXTreeListSortFunc | getSortFunc () const |
void | setSortFunc (FXTreeListSortFunc func) |
void | setFont (FXFont *fnt) |
FXFont * | getFont () const |
void | setIndent (FXint in) |
FXint | getIndent () const |
FXColor | getTextColor () const |
void | setTextColor (FXColor clr) |
FXColor | getSelBackColor () const |
void | setSelBackColor (FXColor clr) |
FXColor | getSelTextColor () const |
void | setSelTextColor (FXColor clr) |
FXColor | getLineColor () const |
void | setLineColor (FXColor clr) |
FXuint | getListStyle () const |
void | setListStyle (FXuint style) |
void | setHelpText (const FXString &text) |
const FXString & | getHelpText () const |
virtual void | save (FXStream &store) const |
virtual void | load (FXStream &store) |
virtual | ~FXTreeList () |
Static Public Member Functions | |
static FXint | ascending (const FXTreeItem *, const FXTreeItem *) |
static FXint | descending (const FXTreeItem *, const FXTreeItem *) |
static FXint | ascendingCase (const FXTreeItem *, const FXTreeItem *) |
static FXint | descendingCase (const FXTreeItem *, const FXTreeItem *) |
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] |
virtual FXint FX::FXTreeList::getDefaultWidth | ( | ) | [virtual] |
virtual FXint FX::FXTreeList::getDefaultHeight | ( | ) | [virtual] |
virtual FXint FX::FXTreeList::getContentWidth | ( | ) | [virtual] |
virtual FXint FX::FXTreeList::getContentHeight | ( | ) | [virtual] |
virtual void FX::FXTreeList::recalc | ( | ) | [virtual] |
virtual FXbool FX::FXTreeList::canFocus | ( | ) | const [virtual] |
virtual void FX::FXTreeList::setFocus | ( | ) | [virtual] |
virtual void FX::FXTreeList::killFocus | ( | ) | [virtual] |
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.
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] |
virtual FXbool FX::FXTreeList::expandTree | ( | FXTreeItem * | tree, | |
FXbool | notify = false | |||
) | [virtual] |
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] |
![]() |