Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FX::FXTreeList Class Reference

A Tree List Widget organizes items in a hierarchical, tree-like fashion. More...

#include <FXTreeList.h>

Inheritance diagram for FX::FXTreeList:

FX::FXScrollArea FX::FXComposite FX::FXWindow FX::FXDrawable FX::FXId FX::FXObject FX::FXDirList List of all members.

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)
FXTreeItemgetFirstItem () const
FXTreeItemgetLastItem () 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)
FXTreeIteminsertItem (FXTreeItem *other, FXTreeItem *father, FXTreeItem *item, FXbool notify=FALSE)
FXTreeIteminsertItem (FXTreeItem *other, FXTreeItem *father, const FXString &text, FXIcon *oi=NULL, FXIcon *ci=NULL, void *ptr=NULL, FXbool notify=FALSE)
FXTreeItemappendItem (FXTreeItem *father, FXTreeItem *item, FXbool notify=FALSE)
FXTreeItemappendItem (FXTreeItem *father, const FXString &text, FXIcon *oi=NULL, FXIcon *ci=NULL, void *ptr=NULL, FXbool notify=FALSE)
FXTreeItemprependItem (FXTreeItem *father, FXTreeItem *item, FXbool notify=FALSE)
FXTreeItemprependItem (FXTreeItem *father, const FXString &text, FXIcon *oi=NULL, FXIcon *ci=NULL, void *ptr=NULL, FXbool notify=FALSE)
FXTreeItemmoveItem (FXTreeItem *other, FXTreeItem *father, FXTreeItem *item)
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 FXTreeItemgetItemAt (FXint x, FXint y) const
FXTreeItemfindItem (const FXString &name, FXTreeItem *start=NULL, FXuint flags=SEARCH_FORWARD|SEARCH_WRAP) const
FXTreeItemfindItemByData (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)
FXIcongetItemOpenIcon (const FXTreeItem *item) const
void setItemClosedIcon (FXTreeItem *item, FXIcon *icon, FXbool owned=FALSE)
FXIcongetItemClosedIcon (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)
FXTreeItemgetCurrentItem () const
void setAnchorItem (FXTreeItem *item)
FXTreeItemgetAnchorItem () const
FXTreeItemgetCursorItem () const
void sortItems ()
void sortRootItems ()
void sortChildItems (FXTreeItem *item)
FXTreeListSortFunc getSortFunc () const
void setSortFunc (FXTreeListSortFunc func)
void setFont (FXFont *fnt)
FXFontgetFont () 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 FXStringgetHelpText () const
virtual void save (FXStream &store) const
virtual void load (FXStream &store)
virtual ~FXTreeList ()

Static Public Member Functions

FXint ascending (const FXTreeItem *, const FXTreeItem *)
FXint descending (const FXTreeItem *, const FXTreeItem *)
FXint ascendingCase (const FXTreeItem *, const FXTreeItem *)
FXint descendingCase (const FXTreeItem *, const FXTreeItem *)

Detailed Description

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:


Constructor & Destructor Documentation

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.


Member Function Documentation

virtual void FX::FXTreeList::create  )  [virtual]
 

Create server-side resources.

Reimplemented from FX::FXComposite.

Reimplemented in FX::FXDirList.

virtual void FX::FXTreeList::detach  )  [virtual]
 

Detach server-side resources.

Reimplemented from FX::FXComposite.

Reimplemented in FX::FXDirList.

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 FXbool 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.

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. 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.

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]
 

Save object to a stream.

Reimplemented from FX::FXWindow.

Reimplemented in FX::FXDirList.

virtual void FX::FXTreeList::load FXStream store  )  [virtual]
 

Load object from a stream.

Reimplemented from FX::FXWindow.

Reimplemented in FX::FXDirList.

Copyright © 1997-2005 Jeroen van der Zijp