[DEV] change default Instance
This commit is contained in:
parent
5a924f7c9d
commit
3f0febce28
@ -131,7 +131,7 @@ appl::Buffer::Buffer() :
|
||||
m_highlight(nullptr) {
|
||||
addObjectType("appl::Buffer");
|
||||
static int32_t bufferBaseId = 0;
|
||||
m_fileName = "No Name " + std::to_string(bufferBaseId);
|
||||
m_fileName = "No Name " + etk::to_string(bufferBaseId);
|
||||
bufferBaseId++;
|
||||
addEventId(eventIsModify);
|
||||
addEventId(eventIsSave);
|
||||
|
@ -88,7 +88,7 @@ void BufferView::insertAlphabetic(appl::dataBufferStruct* _dataStruct, bool _sel
|
||||
if (m_list[iii] == nullptr) {
|
||||
continue;
|
||||
}
|
||||
if (std::tolower(m_list[iii]->m_bufferName.getNameFile()) > std::tolower(_dataStruct->m_bufferName.getNameFile())) {
|
||||
if (etk::tolower(m_list[iii]->m_bufferName.getNameFile()) > etk::tolower(_dataStruct->m_bufferName.getNameFile())) {
|
||||
m_list.insert(m_list.begin() + iii, _dataStruct);
|
||||
_dataStruct = nullptr;
|
||||
if (_selectNewPosition == true) {
|
||||
|
@ -40,11 +40,11 @@
|
||||
namespace appl {
|
||||
std::string getVersion() {
|
||||
#define FIRST_YEAR (2010)
|
||||
std::string tmpOutput = std::to_string(date::getYear()-FIRST_YEAR);
|
||||
std::string tmpOutput = etk::to_string(date::getYear()-FIRST_YEAR);
|
||||
tmpOutput += ".";
|
||||
tmpOutput += std::to_string(date::getMonth());
|
||||
tmpOutput += etk::to_string(date::getMonth());
|
||||
tmpOutput += ".";
|
||||
tmpOutput += std::to_string(date::getDay());
|
||||
tmpOutput += etk::to_string(date::getDay());
|
||||
return tmpOutput;
|
||||
}
|
||||
|
||||
@ -409,10 +409,10 @@ void MainWindows::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
m_bufferManager->open(_msg.getData());
|
||||
} else if (_msg.getMessage() == ednMsgGuiSave) {
|
||||
APPL_DEBUG("Request saving the file : " << _msg.getData());
|
||||
if (std::tolower(_msg.getData()) == "current") {
|
||||
if (etk::tolower(_msg.getData()) == "current") {
|
||||
appl::WorkerSaveFile::create("", false);
|
||||
return;
|
||||
} else if (std::tolower(_msg.getData()) == "all") {
|
||||
} else if (etk::tolower(_msg.getData()) == "all") {
|
||||
appl::WorkerSaveAllFile::create();
|
||||
return;
|
||||
} else {
|
||||
|
@ -50,9 +50,9 @@ void appl::widget::Search::init() {
|
||||
registerOnEventNameWidget(shared_from_this(), "SEARCH:wrap", "value", l_eventWrapCb);
|
||||
registerOnEventNameWidget(shared_from_this(), "SEARCH:up-down", "value", l_eventForwardCb);
|
||||
// set default properties
|
||||
setConfigNamed("SEARCH:case", "value", std::to_string(m_caseSensitive));
|
||||
setConfigNamed("SEARCH:wrap", "value", std::to_string(m_wrap));
|
||||
setConfigNamed("SEARCH:up-down", "value", std::to_string(m_forward));
|
||||
setConfigNamed("SEARCH:case", "value", etk::to_string(m_caseSensitive));
|
||||
setConfigNamed("SEARCH:wrap", "value", etk::to_string(m_wrap));
|
||||
setConfigNamed("SEARCH:up-down", "value", etk::to_string(m_forward));
|
||||
// get widget
|
||||
m_searchEntry = std::dynamic_pointer_cast<ewol::widget::Entry>(getWidgetNamed("SEARCH:search-entry"));
|
||||
m_replaceEntry = std::dynamic_pointer_cast<ewol::widget::Entry>(getWidgetNamed("SEARCH:replace-entry"));
|
||||
@ -124,22 +124,22 @@ void appl::widget::Search::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
ewol::widget::Composer::onReceiveMessage(_msg);
|
||||
APPL_INFO("Search receive message : " << _msg);
|
||||
if ( _msg.getMessage() == l_eventSearchEntry) {
|
||||
m_searchData = to_u32string(_msg.getData());
|
||||
m_searchData = etk::to_u32string(_msg.getData());
|
||||
} else if ( _msg.getMessage() == l_eventSearchEntryEnter
|
||||
|| _msg.getMessage() == l_eventSearchBt) {
|
||||
find();
|
||||
} else if ( _msg.getMessage() == l_eventReplaceEntry) {
|
||||
m_replaceData = to_u32string(_msg.getData());
|
||||
m_replaceData = etk::to_u32string(_msg.getData());
|
||||
} else if ( _msg.getMessage() == l_eventReplaceEntryEnter
|
||||
|| _msg.getMessage() == l_eventReplaceBt) {
|
||||
replace();
|
||||
find();
|
||||
} else if ( _msg.getMessage() == l_eventCaseCb) {
|
||||
m_caseSensitive = std::stob(_msg.getData());
|
||||
m_caseSensitive = etk::string_to_bool(_msg.getData());
|
||||
} else if ( _msg.getMessage() == l_eventWrapCb) {
|
||||
m_wrap = std::stob(_msg.getData());
|
||||
m_wrap = etk::string_to_bool(_msg.getData());
|
||||
} else if ( _msg.getMessage() == l_eventForwardCb) {
|
||||
m_forward = std::stob(_msg.getData());
|
||||
m_forward = etk::string_to_bool(_msg.getData());
|
||||
} else if ( _msg.getMessage() == l_eventHideBt) {
|
||||
hide();
|
||||
} else if ( _msg.getMessage() == ednMsgGuiSearch) {
|
||||
|
@ -62,7 +62,7 @@ uint32_t appl::TagFileList::getNuberOfRaw() {
|
||||
bool appl::TagFileList::getElement(int32_t _colomn, int32_t _raw, std::string& _myTextToWrite, etk::Color<>& _fg, etk::Color<>& _bg) {
|
||||
if (_raw >= 0 && (size_t)_raw < m_list.size() && nullptr != m_list[_raw]) {
|
||||
if (0 == _colomn) {
|
||||
_myTextToWrite = std::to_string(m_list[_raw]->fileLine);
|
||||
_myTextToWrite = etk::to_string(m_list[_raw]->fileLine);
|
||||
} else {
|
||||
_myTextToWrite = m_list[_raw]->filename;
|
||||
}
|
||||
@ -99,7 +99,7 @@ bool appl::TagFileList::onItemEvent(int32_t _IdInput, enum ewol::key::status _ty
|
||||
if( m_selectedLine >= 0
|
||||
&& m_selectedLine < (int64_t)m_list.size()
|
||||
&& nullptr != m_list[m_selectedLine] ) {
|
||||
generateEventId(event, std::to_string(m_list[_raw]->fileLine)+":"+m_list[m_selectedLine]->filename);
|
||||
generateEventId(event, etk::to_string(m_list[_raw]->fileLine)+":"+m_list[m_selectedLine]->filename);
|
||||
} else {
|
||||
generateEventId(applEventCtagsListUnSelect);
|
||||
}
|
||||
|
@ -649,7 +649,7 @@ void appl::TextViewer::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
if (m_buffer == nullptr) {
|
||||
return;
|
||||
}
|
||||
appl::Buffer::Iterator it = m_buffer->countForwardNLines(m_buffer->begin(), std::stoi(_msg.getData()));
|
||||
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;
|
||||
@ -658,7 +658,7 @@ void appl::TextViewer::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
if (m_buffer == nullptr) {
|
||||
return;
|
||||
}
|
||||
appl::Buffer::Iterator it = m_buffer->countForwardNLines(m_buffer->begin(), std::stoi(_msg.getData()));
|
||||
appl::Buffer::Iterator it = m_buffer->countForwardNLines(m_buffer->begin(), etk::string_to_int32_t(_msg.getData()));
|
||||
moveCursor(it);
|
||||
markToRedraw();
|
||||
return;
|
||||
|
@ -88,7 +88,7 @@ namespace appl {
|
||||
bool replace(const std::string& _data, const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _posEnd);
|
||||
bool replace(const std::string& _data);
|
||||
bool replace(const std::u32string& _data) {
|
||||
return replace(std::to_string(_data));
|
||||
return replace(etk::to_string(_data));
|
||||
}
|
||||
/**
|
||||
* @brief Remove selected data ...
|
||||
|
@ -112,7 +112,7 @@ void appl::TextPluginCtags::jumpFile(const std::string& _filename, int64_t _line
|
||||
m_bufferManager->open(_filename);
|
||||
}
|
||||
sendMultiCast(appl::MsgSelectChange, _filename);
|
||||
sendMultiCast(appl::MsgSelectGotoLineSelect, std::to_string(_lineId));
|
||||
sendMultiCast(appl::MsgSelectGotoLineSelect, etk::to_string(_lineId));
|
||||
}
|
||||
|
||||
void appl::TextPluginCtags::loadTagFile() {
|
||||
|
@ -18,45 +18,36 @@
|
||||
|
||||
class myParamGlobal : public ewol::Object {
|
||||
public:
|
||||
static const char * const configEOL;
|
||||
static const char * const configAutoIndent;
|
||||
static const char * const configShowTabChar;
|
||||
static const char * const configShowSpaceChar;
|
||||
ewol::object::Param<bool> m_displayEOL;
|
||||
ewol::object::Param<bool> m_AutoIndent;
|
||||
ewol::object::Param<bool> m_displayTabChar;
|
||||
ewol::object::Param<bool> m_displaySpaceChar;
|
||||
public :
|
||||
bool m_displayEOL;
|
||||
bool m_AutoIndent;
|
||||
bool m_displayTabChar;
|
||||
bool m_displaySpaceChar;
|
||||
public :
|
||||
myParamGlobal() {
|
||||
myParamGlobal() :
|
||||
m_displayEOL(*this, "eol", false, "Display end of line character"),
|
||||
m_AutoIndent(*this, "auto-indent", true, "Auto indent when create new line"),
|
||||
m_displayTabChar(*this, "display-tab", true, "Display the Tab char"),
|
||||
m_displaySpaceChar(*this, "display-space", true, "Display the space char") {
|
||||
m_static = true; // Note : set the object static notification( Must be set or assert at the end of process)
|
||||
setName("edn_global_param");
|
||||
m_displayEOL=false;
|
||||
m_AutoIndent = true;
|
||||
m_displayTabChar = true;
|
||||
m_displaySpaceChar = true;
|
||||
registerConfig(configEOL, "bool", nullptr, "Display end of line character");
|
||||
registerConfig(configAutoIndent, "bool", nullptr, "Auto indent when create new line");
|
||||
registerConfig(configShowTabChar, "bool", nullptr, "Display the Tab char");
|
||||
registerConfig(configShowSpaceChar, "bool", nullptr, "Display the space char");
|
||||
}
|
||||
|
||||
/*
|
||||
bool onSetConfig(const ewol::object::Config& _conf) {
|
||||
// Not set the EObject node parameter (name == > not change ...)
|
||||
if (_conf.getConfig() == configEOL) {
|
||||
m_displayEOL = std::stob(_conf.getData());
|
||||
m_displayEOL = etk::string_to_bool(_conf.getData());
|
||||
return true;
|
||||
}
|
||||
if (_conf.getConfig() == configAutoIndent) {
|
||||
m_AutoIndent = std::stob(_conf.getData());
|
||||
m_AutoIndent = etk::string_to_bool(_conf.getData());
|
||||
return true;
|
||||
}
|
||||
if (_conf.getConfig() == configShowTabChar) {
|
||||
m_displayTabChar = std::stob(_conf.getData());
|
||||
m_displayTabChar = etk::string_to_bool(_conf.getData());
|
||||
return true;
|
||||
}
|
||||
if (_conf.getConfig() == configShowSpaceChar) {
|
||||
m_displaySpaceChar = std::stob(_conf.getData());
|
||||
m_displaySpaceChar = etk::string_to_bool(_conf.getData());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@ -97,12 +88,9 @@ class myParamGlobal : public ewol::Object {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
};
|
||||
|
||||
const char * const myParamGlobal::configEOL = "eol";
|
||||
const char * const myParamGlobal::configAutoIndent = "auto-indent";
|
||||
const char * const myParamGlobal::configShowTabChar = "display-tab";
|
||||
const char * const myParamGlobal::configShowSpaceChar = "display-space";
|
||||
|
||||
static myParamGlobal& l_obj() {
|
||||
static myParamGlobal s_obj;
|
||||
|
Loading…
x
Reference in New Issue
Block a user