Added tabbar adding event

Fired when the add button of the tabbar is pressed.
Changing the value of arg.add to false the action can be vetoed.
The value arg.where indicates the position of the new item.
This commit is contained in:
besh81
2018-10-26 17:12:22 +02:00
parent 905c583621
commit bde0d16243
2 changed files with 34 additions and 0 deletions

View File

@@ -751,15 +751,27 @@ namespace nana
if((pos == npos) || (pos >= list_.size()))
{
pos = list_.size();
if(evt_agent_)
if(!evt_agent_->adding(pos))
return false;
this->list_.emplace_back();
}
else
{
if(evt_agent_)
if(!evt_agent_->adding(pos))
return false;
list_.emplace(iterator_at(pos));
}
basis_.active = pos;
if(evt_agent_)
{
evt_agent_->added(pos);
erase(pos);
evt_agent_->activated(pos);
}
return true;