simplify implementation of listbox inline widget
This commit is contained in:
parent
cff816f10b
commit
07229e566d
@ -2139,7 +2139,6 @@ namespace nana
|
|||||||
inline_indicator * indicator;
|
inline_indicator * indicator;
|
||||||
index_pair item_pos; //The item index of the inline widget
|
index_pair item_pos; //The item index of the inline widget
|
||||||
std::size_t column_pos;
|
std::size_t column_pos;
|
||||||
::std::string text; //text in UTF-8 encoded
|
|
||||||
};
|
};
|
||||||
|
|
||||||
std::map<pat::detail::abstract_factory_base*, std::deque<std::unique_ptr<inline_pane>>> inline_table, inline_buffered_table;
|
std::map<pat::detail::abstract_factory_base*, std::deque<std::unique_ptr<inline_pane>>> inline_table, inline_buffered_table;
|
||||||
@ -3023,15 +3022,6 @@ namespace nana
|
|||||||
|
|
||||||
if (cells[column_pos_].text != value)
|
if (cells[column_pos_].text != value)
|
||||||
{
|
{
|
||||||
for (auto & pn : panes_)
|
|
||||||
{
|
|
||||||
if (pn.first == pos)
|
|
||||||
{
|
|
||||||
pn.second->text = value;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
cells[column_pos_].text = value;
|
cells[column_pos_].text = value;
|
||||||
|
|
||||||
if (model_cells.size())
|
if (model_cells.size())
|
||||||
@ -3862,19 +3852,9 @@ namespace nana
|
|||||||
|
|
||||||
//To reduce the memory usage, the cells may not be allocated
|
//To reduce the memory usage, the cells may not be allocated
|
||||||
if (cells.size() > column_pos)
|
if (cells.size() > column_pos)
|
||||||
{
|
inline_wdg->inline_ptr->set(cells[column_pos].text);
|
||||||
auto & text = cells[column_pos].text;
|
|
||||||
if (text != inline_wdg->text)
|
|
||||||
{
|
|
||||||
inline_wdg->text = text;
|
|
||||||
inline_wdg->inline_ptr->set(text);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
inline_wdg->text.clear();
|
|
||||||
inline_wdg->inline_ptr->set({});
|
inline_wdg->inline_ptr->set({});
|
||||||
}
|
|
||||||
|
|
||||||
API::show_window(inline_wdg->pane_bottom, visible_state);
|
API::show_window(inline_wdg->pane_bottom, visible_state);
|
||||||
}
|
}
|
||||||
@ -3932,8 +3912,10 @@ namespace nana
|
|||||||
{
|
{
|
||||||
auto & factory = cat.factories[column_pos];
|
auto & factory = cat.factories[column_pos];
|
||||||
if (factory)
|
if (factory)
|
||||||
|
{
|
||||||
return essence_->open_inline(factory.get(), cat.indicators[column_pos].get());
|
return essence_->open_inline(factory.get(), cat.indicators[column_pos].get());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user