#include <nana/gui.hpp>
#include <nana/gui/widgets/listbox.hpp>
#include <nana/gui/widgets/button.hpp>
#include <nana/gui/widgets/textbox.hpp>
using namespace nana;
{
inline_indicator * indicator_{ nullptr };
index_type pos_ ;
private:
void create(
window wd)
override
{
txt_.events().click([this]
{
indicator_->selected(pos_);
});
txt_.events().mouse_move([this]
{
indicator_->hovered(pos_);
});
{
{
indicator_->modify(pos_, txt_.caption());
}
});
btn_.create(wd);
btn_.caption("Delete");
btn_.events().click([this]
{
auto & lsbox =
dynamic_cast<listbox&
>(indicator_->host());
lsbox.
erase(lsbox.at(pos_));
});
btn_.events().mouse_move([this]
{
indicator_->hovered(pos_);
});
}
void activate(inline_indicator& ind, index_type pos) override
{
indicator_ = &ind;
pos_ = pos;
}
void notify_status(status_type status, bool status_on)
{
switch(status)
{
case status_type::selecting:
break;
case status_type::checking:
break;
}
}
void resize(
const size& dimension)
override
{
auto sz = dimension;
txt_.size(sz);
btn_.move(r);
}
void set(
const value_type& value)
override
{
txt_.caption(value);
}
bool whether_to_draw() const override
{
return false;
}
private:
};
int main()
{
using namespace nana;
lsbox.append_header("column 1");
lsbox.append("Category 1");
lsbox.at(0).inline_factory(0, pat::make_factory<inline_widget>());
lsbox.at(1).inline_factory(1, pat::make_factory<inline_widget>());
fm.show();
}