[DEV] add remove link with a shortcut

This commit is contained in:
Edouard DUPIN 2014-08-29 23:30:41 +02:00
parent d8ddb85a82
commit 3f7cf66e99
2 changed files with 23 additions and 3 deletions

View File

@ -516,10 +516,25 @@ void ewol::Widget::shortCutAdd(const std::string& _descriptiveString, const std:
m_localShortcut.push_back(tmpElement);
}
void ewol::Widget::shortCutRemove(const std::string& _message) {
auto it(m_localShortcut.begin());
while(it != m_localShortcut.end()) {
if ( *it != nullptr
&& (*it)->message != _message) {
++it;
continue;
}
delete(*it);
*it = nullptr;
m_localShortcut.erase(it);
it = m_localShortcut.begin();
}
}
void ewol::Widget::shortCutClean() {
for (size_t iii=0; iii<m_localShortcut.size(); iii++) {
delete(m_localShortcut[iii]);
m_localShortcut[iii]=nullptr;
for (auto &it : m_localShortcut) {
delete(it);
it = nullptr;
}
m_localShortcut.clear();
}

View File

@ -597,6 +597,11 @@ namespace ewol {
* @brief remove all curent shortCut
*/
virtual void shortCutClean();
/**
* @brief remove a specific shortCut whith his event name
* @param[in] _message renerated event name
*/
virtual void shortCutRemove(const std::string& _message);
public:
/**
* @brief Event on a short-cut of this Widget (in case of return false, the event on the keyevent will arrive in the function @ref onEventKb).