[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

@@ -236,9 +236,6 @@ void MainWindows::init() {
shortCutAdd("ctrl+q", "menu:close");
shortCutAdd("ctrl+shift+q", "menu:close-all");
shortCutAdd("ctrl+z", "menu:undo");
shortCutAdd("ctrl+shift+z", "menu:redo");
shortCutAdd("ctrl+l", "menu:goto-line");
shortCutAdd("ctrl+f", "menu:search");
@@ -280,24 +277,6 @@ void MainWindows::onCallbackMenuEvent(const std::string& _value) {
appl::WorkerSaveFile::create("", true);
} else if (_value == "menu:property") {
displayProperty();
} else if (_value == "menu:undo") {
APPL_TODO("Event from Menu : " << _value);
} else if (_value == "menu:redo") {
APPL_TODO("Event from Menu : " << _value);
} else if (_value == "menu:copy") {
APPL_TODO("Event from Menu : " << _value);
} else if (_value == "menu:cut") {
APPL_TODO("Event from Menu : " << _value);
} else if (_value == "menu:past") {
APPL_TODO("Event from Menu : " << _value);
} else if (_value == "menu:remove") {
APPL_TODO("Event from Menu : " << _value);
} else if (_value == "menu:select-all") {
APPL_TODO("Event from Menu : " << _value);
} else if (_value == "menu:select-none") {
APPL_TODO("Event from Menu : " << _value);
} else if (_value == "menu:goto-line") {
APPL_TODO("Event from Menu : " << _value);
} else if (_value == "menu:search") {
if (m_widgetSearch == nullptr) {
return;

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();
}

View File

@@ -63,7 +63,6 @@ namespace appl {
public: // Derived function
virtual bool calculateMinSize();
virtual void onRegenerateDisplay();
virtual void onReceiveMessage(const ewol::object::Message& _msg);
virtual bool onEventInput(const ewol::event::Input& _event);
virtual bool onEventEntry(const ewol::event::Entry& _event);
virtual void onEventClipboard(enum ewol::context::clipBoard::clipboardListe _clipboardID);
@@ -391,6 +390,7 @@ namespace appl {
* @brief Register of the arrival of a Multicast message
* @param[in] _messageId Event Id waiting for...
*/
// TODO : Remove
void ext_registerMultiCast(const char* const _messageId) {
//registerMultiCast(_messageId);
}
@@ -400,14 +400,13 @@ namespace appl {
* @param[in] _generateEventId Event generic of the element
* @param[in] _data Associate data wit the event
*/
virtual void ext_shortCutAdd(const char * _descriptiveString,
const char * _generateEventId,
std::string _data="",
bool _broadcast=false) {
//shortCutAdd(_descriptiveString, _generateEventId, _data, _broadcast);
virtual void ext_shortCutAdd(const std::string& _descriptiveString,
const std::string& _generateEventName) {
shortCutAdd(_descriptiveString, _generateEventName);
}
private: // callback fundtions
void onCallbackIsModify();
void onCallbackShortCut(const std::string& _value);
void onCallbackSelectChange();
void onCallbackselectNewFile(const std::string& _value);
};