Nana C++ Library. Reference for users.
What we need to use nana
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
nana::drawerbase::treebox::item_proxy Class Reference

A proxy for accessing the node. The key string is case sensitive. More...

Inheritance diagram for nana::drawerbase::treebox::item_proxy:
std::iterator< std::input_iterator_tag, item_proxy >

Public Member Functions

 item_proxy ()=default
 The default constructor creates an end iterator. More...
 
 item_proxy (trigger *, trigger::node_type *)
 
item_proxy append (const ::std::string &key,::std::string name)
 Append a child. More...
 
template<typename T >
item_proxy append (const ::std::string &key,::std::string name, T &&t)
 Append a child with a specified value (user object.). More...
 
bool empty () const
 Return true if the proxy does not refer to a node, as an end iterator. More...
 
std::size_t level () const
 Return the distance between the ROOT node and this node. More...
 
bool checked () const
 Return the check state. More...
 
item_proxycheck (bool)
 Set the check state, and it returns itself. More...
 
item_proxyclear ()
 Clears the child nodes. More...
 
bool expanded () const
 Return true when the node is expanded. More...
 
item_proxyexpand (bool)
 Expand/Shrink children of the node, and returns itself. More...
 
bool selected () const
 Return true when the node is selected. More...
 
item_proxyselect (bool)
 Select the node, and returns itself.. More...
 
const ::std::stringicon () const
 Return the icon. More...
 
item_proxyicon (const ::std::string &id)
 Set the icon, and returns itself.. More...
 
const ::std::stringtext () const
 Return the text. More...
 
item_proxytext (const ::std::string &)
 Set the text, and returns itself. More...
 
item_proxykey (const ::std::string &s)
 Set a new key, and returns itself.. More...
 
const ::std::stringkey () const
 Return the key. More...
 
std::size_t size () const
 Returns the number of child nodes. More...
 
item_proxy child () const
 Return the first child of the node. More...
 
item_proxy owner () const
 Return the owner of the node. More...
 
item_proxy sibling () const
 Return the sibling of the node. More...
 
item_proxy begin () const
 Return the first child of the node. More...
 
item_proxy end () const
 An end node. More...
 
item_proxy visit_recursively (std::function< bool(item_proxy)> action)
 Makes an action for each sub item recursively, returns the item that stops the action where action returns false. More...
 
bool operator== (const ::std::string &s) const
 Compare the text of node with s. More...
 
bool operator== (const char *s) const
 Compare the text of node with s. More...
 
bool operator== (const wchar_t *s) const
 Compare the text of node with s. More...
 
item_proxyoperator= (const item_proxy &)
 Behavior of Iterator. More...
 
item_proxyoperator++ ()
 Behavior of Iterator. More...
 
item_proxy operator++ (int)
 Behavior of Iterator. More...
 
item_proxyoperator* ()
 Behavior of Iterator. More...
 
const item_proxyoperator* () const
 Behavior of Iterator. More...
 
item_proxyoperator-> ()
 Behavior of Iterator. More...
 
const item_proxyoperator-> () const
 Behavior of Iterator. More...
 
bool operator== (const item_proxy &) const
 Behavior of Iterator. More...
 
bool operator!= (const item_proxy &) const
 Behavior of Iterator. More...
 
template<typename T >
const T * value_ptr () const
 
template<typename T >
const T & value () const
 
template<typename T >
item_proxyvalue (T &&t)
 
trigger::node_type_m_node () const
 

Detailed Description

A proxy for accessing the node. The key string is case sensitive.

Examples:
widget_show.cpp, and widget_show2.cpp.

Constructor & Destructor Documentation

nana::drawerbase::treebox::item_proxy::item_proxy ( )
default

The default constructor creates an end iterator.

nana::drawerbase::treebox::item_proxy::item_proxy ( trigger trg,
trigger::node_type node 
)

Member Function Documentation

trigger::node_type * nana::drawerbase::treebox::item_proxy::_m_node ( ) const
item_proxy nana::drawerbase::treebox::item_proxy::append ( const ::std::string key,
::std::string  name 
)

Append a child.

template<typename T >
item_proxy nana::drawerbase::treebox::item_proxy::append ( const ::std::string key,
::std::string  name,
T &&  t 
)
inline

Append a child with a specified value (user object.).

item_proxy nana::drawerbase::treebox::item_proxy::begin ( ) const

Return the first child of the node.

item_proxy & nana::drawerbase::treebox::item_proxy::check ( bool  ck)

Set the check state, and it returns itself.

bool nana::drawerbase::treebox::item_proxy::checked ( ) const

Return the check state.

item_proxy nana::drawerbase::treebox::item_proxy::child ( ) const

Return the first child of the node.

item_proxy & nana::drawerbase::treebox::item_proxy::clear ( )

Clears the child nodes.

bool nana::drawerbase::treebox::item_proxy::empty ( ) const

Return true if the proxy does not refer to a node, as an end iterator.

item_proxy nana::drawerbase::treebox::item_proxy::end ( ) const

An end node.

item_proxy & nana::drawerbase::treebox::item_proxy::expand ( bool  exp)

Expand/Shrink children of the node, and returns itself.

Todo:
change to expand ??
bool nana::drawerbase::treebox::item_proxy::expanded ( ) const

Return true when the node is expanded.

Todo:
change to expanded ??
Examples:
folder_tree_std.cpp.
const std::string & nana::drawerbase::treebox::item_proxy::icon ( ) const

Return the icon.

item_proxy& nana::drawerbase::treebox::item_proxy::icon ( const ::std::string id)

Set the icon, and returns itself..

item_proxy& nana::drawerbase::treebox::item_proxy::key ( const ::std::string s)

Set a new key, and returns itself..

const std::string & nana::drawerbase::treebox::item_proxy::key ( ) const

Return the key.

std::size_t nana::drawerbase::treebox::item_proxy::level ( ) const

Return the distance between the ROOT node and this node.

Returns
only available when empty() is false.
bool nana::drawerbase::treebox::item_proxy::operator!= ( const item_proxy rhs) const

Behavior of Iterator.

item_proxy & nana::drawerbase::treebox::item_proxy::operator* ( )

Behavior of Iterator.

const item_proxy & nana::drawerbase::treebox::item_proxy::operator* ( ) const

Behavior of Iterator.

item_proxy & nana::drawerbase::treebox::item_proxy::operator++ ( )

Behavior of Iterator.

item_proxy nana::drawerbase::treebox::item_proxy::operator++ ( int  )

Behavior of Iterator.

item_proxy * nana::drawerbase::treebox::item_proxy::operator-> ( )

Behavior of Iterator.

const item_proxy * nana::drawerbase::treebox::item_proxy::operator-> ( ) const

Behavior of Iterator.

item_proxy & nana::drawerbase::treebox::item_proxy::operator= ( const item_proxy r)

Behavior of Iterator.

bool nana::drawerbase::treebox::item_proxy::operator== ( const ::std::string s) const

Compare the text of node with s.

bool nana::drawerbase::treebox::item_proxy::operator== ( const char *  s) const

Compare the text of node with s.

bool nana::drawerbase::treebox::item_proxy::operator== ( const wchar_t *  s) const

Compare the text of node with s.

bool nana::drawerbase::treebox::item_proxy::operator== ( const item_proxy rhs) const

Behavior of Iterator.

item_proxy nana::drawerbase::treebox::item_proxy::owner ( ) const

Return the owner of the node.

item_proxy & nana::drawerbase::treebox::item_proxy::select ( bool  s)

Select the node, and returns itself..

bool nana::drawerbase::treebox::item_proxy::selected ( ) const

Return true when the node is selected.

Examples:
file_explorer.cpp.
item_proxy nana::drawerbase::treebox::item_proxy::sibling ( ) const

Return the sibling of the node.

std::size_t nana::drawerbase::treebox::item_proxy::size ( ) const

Returns the number of child nodes.

const std::string & nana::drawerbase::treebox::item_proxy::text ( ) const

Return the text.

item_proxy& nana::drawerbase::treebox::item_proxy::text ( const ::std::string )

Set the text, and returns itself.

template<typename T >
const T& nana::drawerbase::treebox::item_proxy::value ( ) const
inline
template<typename T >
item_proxy& nana::drawerbase::treebox::item_proxy::value ( T &&  t)
inline
template<typename T >
const T* nana::drawerbase::treebox::item_proxy::value_ptr ( ) const
inline
item_proxy nana::drawerbase::treebox::item_proxy::visit_recursively ( std::function< bool(item_proxy)>  action)

Makes an action for each sub item recursively, returns the item that stops the action where action returns false.