[DEV] this plugin to the new ewol interface

This commit is contained in:
2014-08-27 22:58:21 +02:00
parent a371c09e22
commit 7e6f56a1cd
19 changed files with 82 additions and 161 deletions

View File

@@ -61,6 +61,7 @@ void appl::TextViewer::init(const std::string& _fontName, int32_t _fontSize) {
appl::textPluginManager::connect(*this);
// last created has focus ...
setCurrentSelect();
signalShortcut.bind(shared_from_this(), &appl::TextViewer::onCallbackShortCut);
/*
registerMultiCast(ednMsgBufferId);
@@ -74,11 +75,17 @@ void appl::TextViewer::init(const std::string& _fontName, int32_t _fontSize) {
}
}
appl::TextViewer::~TextViewer() {
appl::textPluginManager::disconnect(*this);
}
void appl::TextViewer::onCallbackShortCut(const std::string& _value) {
if (appl::textPluginManager::onReceiveShortCut(*this, _value) == true) {
return;
}
}
void appl::TextViewer::onCallbackselectNewFile(const std::string& _value) {
// reset scroll:
if (m_buffer != nullptr) {
@@ -672,40 +679,6 @@ void appl::TextViewer::onEventClipboard(enum ewol::context::clipBoard::clipboard
markToRedraw();
}
void appl::TextViewer::onReceiveMessage(const ewol::object::Message& _msg) {
ewol::widget::WidgetScrolled::onReceiveMessage(_msg);
APPL_VERBOSE("receive msg: " << _msg);
// First call plugin
/*
if (appl::textPluginManager::onReceiveMessageViewer(*this, _msg) == true) {
markToRedraw();
return;
}
// If not the last buffer selected, then no event parsing ...
if (isSelectedLast() == false) {
return;
}
if (_msg.getMessage() == appl::MsgSelectGotoLineSelect) {
if (m_buffer == nullptr) {
return;
}
appl::Buffer::Iterator it = m_buffer->countForwardNLines(m_buffer->begin(), etk::string_to_int32_t(_msg.getData()));
select(it, m_buffer->getEndLine(it));
markToRedraw();
return;
}
if (_msg.getMessage() == appl::MsgSelectGotoLine) {
if (m_buffer == nullptr) {
return;
}
appl::Buffer::Iterator it = m_buffer->countForwardNLines(m_buffer->begin(), etk::string_to_int32_t(_msg.getData()));
moveCursor(it);
markToRedraw();
return;
}
*/
}
void appl::TextViewer::onCallbackIsModify() {
markToRedraw();
}