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
FXTreeItemaddItemFirst (FXTreeItem *p, FXTreeItem *item, FXbool notify=FALSE)
FXTreeItemaddItemFirst (FXTreeItem *p, const FXString &text, FXIcon *oi=NULL, FXIcon *ci=NULL, void *ptr=NULL, FXbool notify=FALSE)
FXTreeItemaddItemLast (FXTreeItem *p, FXTreeItem *item, FXbool notify=FALSE)
FXTreeItemaddItemLast (FXTreeItem *p, const FXString &text, FXIcon *oi=NULL, FXIcon *ci=NULL, void *ptr=NULL, FXbool notify=FALSE)
FXTreeItemaddItemAfter (FXTreeItem *other, FXTreeItem *item, FXbool notify=FALSE)
FXTreeItemaddItemAfter (FXTreeItem *other, const FXString &text, FXIcon *oi=NULL, FXIcon *ci=NULL, void *ptr=NULL, FXbool notify=FALSE)
FXTreeItemaddItemBefore (FXTreeItem *other, FXTreeItem *item, FXbool notify=FALSE)
FXTreeItemaddItemBefore (FXTreeItem *other, const FXString &text, FXIcon *oi=NULL, FXIcon *ci=NULL, void *ptr=NULL, FXbool notify=FALSE)
void reparentItem (FXTreeItem *item, FXTreeItem *p)
FXTreeItemmoveItemBefore (FXTreeItem *other, FXTreeItem *item)
FXTreeItemmoveItemAfter (FXTreeItem *other, 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
FXTreeItemgetItemAt (FXint x, FXint y) const
FXTreeItemfindItem (const FXString &text, FXTreeItem *start=NULL, FXuint flags=SEARCH_FORWARD|SEARCH_WRAP) const
void makeItemVisible (FXTreeItem *item)
void setItemText (FXTreeItem *item, const FXString &text)
FXString getItemText (const FXTreeItem *item) const
void setItemOpenIcon (FXTreeItem *item, FXIcon *icon)
FXIcongetItemOpenIcon (const FXTreeItem *item) const
void setItemClosedIcon (FXTreeItem *item, FXIcon *icon)
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
FXbool enableItem (FXTreeItem *item)
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)
FXString getHelpText () 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.

FXTreeItem* FX::FXTreeList::addItemFirst FXTreeItem p,
FXTreeItem item,
FXbool  notify = FALSE
 

Prepend new [possibly subclassed] item as first child of p.

FXTreeItem* FX::FXTreeList::addItemFirst FXTreeItem p,
const FXString text,
FXIcon oi = NULL,
FXIcon ci = NULL,
void *  ptr = NULL,
FXbool  notify = FALSE
 

Prepend new item with given text and optional icon, and user-data pointer as first child of p.

FXTreeItem* FX::FXTreeList::addItemLast FXTreeItem p,
FXTreeItem item,
FXbool  notify = FALSE
 

Append new [possibly subclassed] item as last child of p.

FXTreeItem* FX::FXTreeList::addItemLast FXTreeItem p,
const FXString text,
FXIcon oi = NULL,
FXIcon ci = NULL,
void *  ptr = NULL,
FXbool  notify = FALSE
 

Append new item with given text and optional icon, and user-data pointer as last child of p.

FXTreeItem* FX::FXTreeList::addItemAfter FXTreeItem other,
FXTreeItem item,
FXbool  notify = FALSE
 

Append new [possibly subclassed] item after to other item.

FXTreeItem* FX::FXTreeList::addItemAfter FXTreeItem other,
const FXString text,
FXIcon oi = NULL,
FXIcon ci = NULL,
void *  ptr = NULL,
FXbool  notify = FALSE
 

Append new item with given text and optional icon, and user-data pointer after to other item.

FXTreeItem* FX::FXTreeList::addItemBefore FXTreeItem other,
FXTreeItem item,
FXbool  notify = FALSE
 

Prepend new [possibly subclassed] item prior to other item.

FXTreeItem* FX::FXTreeList::addItemBefore FXTreeItem other,
const FXString text,
FXIcon oi = NULL,
FXIcon ci = NULL,
void *  ptr = NULL,
FXbool  notify = FALSE
 

Prepend new item with given text and optional icon, and user-data pointer prior to other item.

void FX::FXTreeList::reparentItem FXTreeItem item,
FXTreeItem p
 

Reparent item under parent p.

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.

FXTreeItem* FX::FXTreeList::getItemAt FXint  x,
FXint  y
const
 

Get item at x,y, if any.

FXTreeItem* FX::FXTreeList::findItem const FXString text,
FXTreeItem start = NULL,
FXuint  flags = SEARCH_FORWARD|SEARCH_WRAP
const
 

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

void FX::FXTreeList::makeItemVisible FXTreeItem item  ) 
 

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
 

Change item's open icon.

FXIcon* FX::FXTreeList::getItemOpenIcon const FXTreeItem item  )  const
 

Return item's open icon.

void FX::FXTreeList::setItemClosedIcon FXTreeItem item,
FXIcon icon
 

Chance item's closed icon.

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.

FXbool FX::FXTreeList::enableItem FXTreeItem item  ) 
 

Enable item.

FXbool FX::FXTreeList::disableItem FXTreeItem item  ) 
 

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.

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-2004 Jeroen van der Zijp