cwidget 0.5.16
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions

cwidget::widgets::tree Class Reference

Inheritance diagram for cwidget::widgets::tree:
cwidget::widgets::widget trackable

List of all members.

Classes

struct  flat_frame

Public Member Functions

void set_root (treeitem *_root, bool showroot=false)
int width_request ()
int height_request (int w)
bool get_cursorvisible ()
point get_cursorloc ()
virtual bool focus_me ()
virtual void paint (const style &st)
 Display this widget.
virtual void dispatch_mouse (short id, int x, int y, int z, mmask_t bstate)
void set_selection (treeiterator to, bool force_to_top=false)
 Directly sets the selection to the given element.
treeiterator get_selection () const
 Retrieve a reference to the currently selected entry in the tree.
treeiterator get_begin ()
 Retrieve an iterator referencing the start of the tree.
treeiterator get_end ()
 Retrieve an iterator referencing the end of the tree.
void search_for (tree_search_func &matches)
void search_for (const std::wstring &s)
void search_back_for (tree_search_func &matches)
void search_back_for (const std::wstring &s)
void set_hierarchical (bool _hierarchical)
bool get_hierarchical ()
void highlight_current ()
 Send a 'highlighted' message to the currently selected item.
void unhighlight_current ()
 Send an 'unhighlighted' message to the currently selected item.
void line_up ()
void line_down ()
void page_up ()
void page_down ()
void jump_to_begin ()
void jump_to_end ()
void level_line_up ()
void level_line_down ()

Static Public Member Functions

static util::ref_ptr< treecreate ()
static util::ref_ptr< treecreate (treeitem *root, bool showroot=false)
static void init_bindings ()

Public Attributes

sigc::signal1< void, treeitem * > selection_changed
 Emitted when the selection moves to a new item.

Static Public Attributes

static config::keybindingsbindings = NULL

Protected Member Functions

void sync_bounds ()
virtual bool handle_key (const config::key &k)
 Handles a keypress in this widget.
 tree (treeitem *_root, bool showroot)

Member Function Documentation

treeiterator cwidget::widgets::tree::get_begin ( ) [inline]

Retrieve an iterator referencing the start of the tree.

treeiterator cwidget::widgets::tree::get_end ( ) [inline]

Retrieve an iterator referencing the end of the tree.

treeiterator cwidget::widgets::tree::get_selection ( ) const [inline]

Retrieve a reference to the currently selected entry in the tree.

This iterator might be invalidated by user interactions and should not be saved.

bool cwidget::widgets::tree::handle_key ( const config::key k) [protected, virtual]

Handles a keypress in this widget.

Parameters:
kthe key that was pressed (see keybindings.h).
Returns:
true if the key was consumed; if false is returned, further processing of the key will be performed.

Reimplemented from cwidget::widgets::widget.

References cwidget::config::keybindings::key_matches(), selection_changed, set_selection(), and cwidget::toplevel::update().

int cwidget::widgets::tree::height_request ( int  w) [virtual]
Parameters:
wthe width of the widget.
Returns:
the desired height of the widget for the given width.

Implements cwidget::widgets::widget.

void cwidget::widgets::tree::highlight_current ( )

Send a 'highlighted' message to the currently selected item.

References selection_changed.

void cwidget::widgets::tree::paint ( const style st) [virtual]

Display this widget.

Parameters:
stthe style environment in which the widget is to be displayed.

Implements cwidget::widgets::widget.

References cwidget::widgets::widget::apply_style(), cwidget::get_style(), and cwidget::widgets::treeitem::paint().

void cwidget::widgets::tree::set_selection ( treeiterator  to,
bool  force_to_top = false 
)

Directly sets the selection to the given element.

Parameters:
toThe element to select.
force_to_topIf true, the element will be placed at the top of the list if the list scrolls.

If the element's parents are not currently expanded, they will be immediately expanded.

References selection_changed, and cwidget::toplevel::update().

Referenced by handle_key().

void cwidget::widgets::tree::unhighlight_current ( )

Send an 'unhighlighted' message to the currently selected item.

References selection_changed.

int cwidget::widgets::tree::width_request ( ) [virtual]
Returns:
the desired width of the widget.

Implements cwidget::widgets::widget.


Member Data Documentation

Emitted when the selection moves to a new item.

The item will be NULL if nothing is selected. The signal will also be emitted when the widget is shown/hidden and when the

Referenced by handle_key(), highlight_current(), set_selection(), and unhighlight_current().


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