Screenshot of categorize.
#include <iostream>
#include <nana/gui.hpp>
#include <nana/gui/widgets/categorize.hpp>
class renderer
{
public:
enum state_t {state_normal, state_over, state_pressed};
struct ui_element
{
{
somewhere, item_root, item_name, item_arrow
};
static const size_t npos =
static_cast<size_t>(-1);
size_t index;
ui_element();
};
virtual ~renderer() = 0;
const ui_element&) = 0;
virtual void root_arrow(graph_reference,
const nana::rectangle&, state_t) = 0;
bool has_child, state_t) = 0;
virtual void border(graph_reference) = 0;
};
{
mb.icon(mb.icon_information);
mb<<
"The value of selected is "<<categ.
value<< (
", caption is \"")
<<categ.
widget.caption()<<
"\"";
mb();
}
int main()
{
using namespace nana;
categ.childset("Invalid Category", 0);
categ.insert("First", 0);
categ.insert("Second", 1);
;
categ.childset("Third", 2);
;
categ.childset("Another Child", 2);
;
;
;
categ.events().selected(selected);
;
;
fm.show();
}