cwidget  0.5.17
Public Member Functions | Protected Member Functions | Friends | List of all members
cwidget::widgets::treeitem Class Referenceabstract
Inheritance diagram for cwidget::widgets::treeitem:
cwidget::widgets::layout_item cwidget::widgets::layout_item::layout_line cwidget::widgets::staticitem cwidget::widgets::subtree< childtype, default_sorter > cwidget::widgets::subtree< treeitem > cwidget::widgets::subtree_generic

Public Member Functions

 treeitem (bool _selectable=true)
 
virtual void paint (tree *win, int y, bool hierarchical, const style &st)=0
 Display this item and this item only (does not descend to the children of the item, if any). More...
 
void paint (tree *win, int y, bool hierarchical, const std::wstring &str, int depth_shift=2)
 Display the given text as the label of this item at the given shifted depth. More...
 
virtual const wchar_t * tag ()=0
 
virtual const wchar_t * label ()=0
 
int get_depth ()
 
bool get_selectable ()
 
virtual style get_normal_style ()
 
virtual style get_highlight_style ()
 
virtual void sort (sortpolicy &sort_method)
 
virtual void sort ()
 
virtual bool dispatch_key (const config::key &k, tree *owner)
 
virtual void dispatch_mouse (short id, int x, mmask_t bstate, tree *owner)
 
virtual tree_levelrefbegin ()
 
virtual tree_levelrefend ()
 
virtual bool has_visible_children ()
 
virtual bool has_children ()
 
virtual bool matches (const std::wstring &s) const
 
virtual void expand ()
 
virtual void expand_all ()
 
virtual void collapse_all ()
 

Public Attributes

sigc::signal1< void, boolhighlighted_changed
 A signal emitted when the tree-item is highlighted or unhighlighted. More...
 

Protected Member Functions

virtual void set_depth (int _depth)
 
virtual void set_selectable (bool _selectable)
 

Friends

template<class childtype , class sorter >
class subtree
 

Member Function Documentation

◆ paint() [1/2]

virtual void cwidget::widgets::treeitem::paint ( tree win,
int  y,
bool  hierarchical,
const style st 
)
pure virtual

Display this item and this item only (does not descend to the children of the item, if any).

The current style of the corresponding tree widget will be initialized using get_normal_style() and/or get_highlight_style() prior to the invocation of this method.

Parameters
winthe tree in which to paint this item
ythe y location at which to paint this item
hierarchicalif true, paint this item as an entry in a 'hierarchical' tree.
stthe style with which this item is being displayed.

Implemented in cwidget::widgets::layout_item, cwidget::widgets::layout_item::layout_line, and cwidget::widgets::staticitem.

Referenced by cwidget::widgets::tree::paint().

◆ paint() [2/2]

void cwidget::widgets::treeitem::paint ( tree win,
int  y,
bool  hierarchical,
const std::wstring &  str,
int  depth_shift = 2 
)

Display the given text as the label of this item at the given shifted depth.

Parameters
winthe tree in which to paint this item
ythe y location at which to paint this item
hierarchicalif true, paint this item as an entry in a 'hierarchical' tree
stthe style with which this item is to be displayed.

Member Data Documentation

◆ highlighted_changed

sigc::signal1<void, bool> cwidget::widgets::treeitem::highlighted_changed

A signal emitted when the tree-item is highlighted or unhighlighted.

This used to be a pair of virtual methods, but I found that I was constantly overriding them to just invoke a signal. This approach has more runtime overhead, but should make it a lot easier to code up new tree items.Causes this tree-item to become highlighted.

Referenced by cwidget::widgets::tree::set_selection(), and cwidget::widgets::tree::unhighlight_current().


The documentation for this class was generated from the following file: