[DEV] correction of stl-port

This commit is contained in:
Edouard DUPIN 2013-11-13 21:52:12 +01:00
parent aff6c5fd38
commit 9a9293a3fc
22 changed files with 137 additions and 137 deletions

2
external/ejson vendored

@ -1 +1 @@
Subproject commit d24b545ba958fa34383020c68f3d7502c3e11332
Subproject commit 666605419cfab90d858f5687659a10e28146d97e

2
external/etk vendored

@ -1 +1 @@
Subproject commit c8dc0b010030a0b04f8f3134df972bb9ad6d89df
Subproject commit b946a5f7c6248e68972290033fffd56da6baefcc

2
external/exml vendored

@ -1 +1 @@
Subproject commit 4d02dd677e3de90a3d4bb8b808e420798a8c7bd1
Subproject commit c24b20b9d20bfa2d648e51152eb8182fb4537f03

View File

@ -318,13 +318,13 @@ bool widget::Button::onEventInput(const ewol::EventInput& _event) {
m_value = (m_value)?false:true;
//EWOL_DEBUG("Generate event : " << eventPressed);
generateEventId(eventPressed);
//EWOL_DEBUG("Generate event : " << eventValue << " val=" << m_value);
generateEventId(eventValue, m_value);
EWOL_CRITICAL("Generate event : " << eventValue << " val=" << m_value << " plop : " << std::to_string(m_value));
generateEventId(eventValue, std::to_string(m_value));
if( false == m_toggleMode
&& true == m_value) {
m_value = false;
//EWOL_DEBUG("Generate event : " << widget::Button::eventValue << " val=" << m_value);
generateEventId(eventValue, m_value);
generateEventId(eventValue, std::to_string(m_value));
}
}
markToRedraw();
@ -459,26 +459,26 @@ bool widget::Button::onSetConfig(const ewol::EConfig& _conf) {
return true;
}
if (_conf.getConfig() == configToggle) {
setToggleMode(_conf.getData().toBool());
setToggleMode(stobool(_conf.getData()));
return true;
}
if (_conf.getConfig() == configLock) {
enum buttonLock tmpLock = lockNone;
if( true == _conf.getData().compareNoCase("true")
|| true == _conf.getData().compareNoCase("1")) {
if( compare_no_case(_conf.getData(), "true") == true
|| compare_no_case(_conf.getData(), "1") == true) {
tmpLock = lockAccess;
} else if( true == _conf.getData().compareNoCase("down")
|| true == _conf.getData().compareNoCase("pressed")) {
} else if( compare_no_case(_conf.getData(), "down") == true
|| compare_no_case(_conf.getData(), "pressed") == true) {
tmpLock = lockWhenPressed;
} else if( true == _conf.getData().compareNoCase("up")
|| true == _conf.getData().compareNoCase("released")) {
} else if( compare_no_case(_conf.getData(), "up") == true
|| compare_no_case(_conf.getData(), "released") == true) {
tmpLock = lockWhenReleased;
}
setLock(tmpLock);
return true;
}
if (_conf.getConfig() == configValue) {
setValue(_conf.getData().toBool());
setValue(stobool(_conf.getData()));
return true;
}
if (_conf.getConfig() == configShaper) {
@ -493,7 +493,7 @@ bool widget::Button::onGetConfig(const char* _config, std::string& _result) cons
return true;
}
if (_config == configToggle) {
if (true == getToggleMode()) {
if (getToggleMode() == true) {
_result = "true";
} else {
_result = "false";
@ -519,7 +519,7 @@ bool widget::Button::onGetConfig(const char* _config, std::string& _result) cons
return true;
}
if (_config == configValue) {
if (true == getValue()) {
if (getValue() == true) {
_result = "true";
} else {
_result = "false";

View File

@ -74,7 +74,7 @@ int32_t widget::ContainerN::subWidgetAddStart(ewol::Widget* _newWidget) {
if (_newWidget!=NULL) {
_newWidget->setUpperWidget(this);
}
m_subWidget.pushFront(_newWidget);
m_subWidget.insert(m_subWidget.begin(), _newWidget);
markToRedraw();
requestUpdateSize();
return _newWidget->getId();
@ -93,7 +93,7 @@ void widget::ContainerN::subWidgetRemove(ewol::Widget* _newWidget) {
if (errorControl == m_subWidget.size()) {
EWOL_CRITICAL("[" << getId() << "] {" << getObjectType() << "} The number of element might have been reduced ... == > it is not the case ==> the herited class must call the \"OnObjectRemove\" function...");
m_subWidget[iii] = NULL;
m_subWidget.erase(iii);
m_subWidget.erase(m_subWidget.begin()+iii);
}
markToRedraw();
requestUpdateSize();
@ -110,7 +110,7 @@ void widget::ContainerN::subWidgetUnLink(ewol::Widget* _newWidget) {
if (_newWidget == m_subWidget[iii]) {
m_subWidget[iii]->removeUpperWidget();
m_subWidget[iii] = NULL;
m_subWidget.erase(iii);
m_subWidget.erase(m_subWidget.begin()+iii);
markToRedraw();
requestUpdateSize();
return;
@ -132,7 +132,7 @@ void widget::ContainerN::subWidgetRemoveAll(void) {
}
} else {
EWOL_WARNING("[" << getId() << "] {" << getObjectType() << "} Must not have null pointer on the subWidget list ...");
m_subWidget.erase(0);
m_subWidget.erase(m_subWidget.begin());
}
errorControl = m_subWidget.size();
}
@ -177,7 +177,7 @@ void widget::ContainerN::onObjectRemove(ewol::EObject* _removeObject) {
if(m_subWidget[iii] == _removeObject) {
EWOL_VERBOSE("[" << getId() << "] {" << getObjectType() << "} remove sizer sub Element [" << iii << "/" << m_subWidget.size()-1 << "] == > destroyed object");
m_subWidget[iii] = NULL;
m_subWidget.erase(iii);
m_subWidget.erase(m_subWidget.begin()+iii);
}
}
}
@ -281,7 +281,7 @@ bool widget::ContainerN::loadXML(exml::Element* _node) {
}
bool invertAdding=false;
tmpAttributeValue = _node->getAttribute("addmode");
if(tmpAttributeValue.compareNoCase("invert")) {
if(compare_no_case(tmpAttributeValue, "invert")) {
invertAdding=true;
}
// parse all the elements :

View File

@ -148,67 +148,69 @@ void widget::ContextMenu::onDraw(void) {
void widget::ContextMenu::onRegenerateDisplay(void) {
// call upper class :
widget::Container::onRegenerateDisplay();
if (true == needRedraw()) {
m_compositing.clear();
m_shaper.clear();
vec2 padding = m_shaper.getPadding();
if (NULL != m_subWidget) {
vec2 tmpSize = m_subWidget->getSize();
vec2 tmpOrigin = m_subWidget->getOrigin();
// display border ...
m_compositing.setColor(m_colorBorder);
switch (m_arrawBorder) {
case markTop:
m_compositing.setPos(vec3(m_arrowPos.x(), m_arrowPos.y(), 0.0f) );
m_compositing.addVertex();
if (m_arrowPos.x() <= tmpOrigin.x() ) {
float laking = m_offset - padding.y();
m_compositing.setPos(vec3(m_arrowPos.x()+laking, m_arrowPos.y()-laking, 0.0f) );
m_compositing.addVertex();
m_compositing.setPos(vec3(m_arrowPos.x(), m_arrowPos.y()-laking, 0.0f) );
m_compositing.addVertex();
} else {
float laking = m_offset - padding.y();
m_compositing.setPos(vec3(m_arrowPos.x()+laking, m_arrowPos.y()-laking, 0.0f) );
m_compositing.addVertex();
m_compositing.setPos(vec3(m_arrowPos.x()-laking, m_arrowPos.y()-laking, 0.0f) );
m_compositing.addVertex();
}
break;
case markButtom:
m_compositing.setPos(vec3(m_arrowPos.x(), m_arrowPos.y(), 0) );
m_compositing.addVertex();
if (m_arrowPos.x() <= tmpOrigin.x() ) {
int32_t laking = m_offset - padding.y();
m_compositing.setPos(vec3(m_arrowPos.x()+laking, m_arrowPos.y()+laking, 0.0f) );
m_compositing.addVertex();
m_compositing.setPos(vec3(m_arrowPos.x(), m_arrowPos.y()+laking, 0.0f) );
m_compositing.addVertex();
} else {
int32_t laking = m_offset - padding.y();
m_compositing.setPos(vec3(m_arrowPos.x()+laking, m_arrowPos.y()+laking, 0.0f) );
m_compositing.addVertex();
m_compositing.setPos(vec3(m_arrowPos.x()-laking, m_arrowPos.y()+laking, 0.0f) );
m_compositing.addVertex();
}
break;
default:
case markRight:
case markLeft:
EWOL_TODO("later");
break;
}
vec2 shaperOrigin = tmpOrigin-padding;
vec2 shaperSize = tmpSize+padding*2.0f;
m_shaper.setOrigin(vec2ClipInt32(shaperOrigin));
m_shaper.setSize(vec2ClipInt32(shaperSize));
m_shaper.setInsidePos(vec2ClipInt32(shaperOrigin+padding));
m_shaper.setInsideSize(vec2ClipInt32(shaperSize-padding*2.0f));
}
if (needRedraw() == false) {
return;
}
m_compositing.clear();
m_shaper.clear();
vec2 padding = m_shaper.getPadding();
if (m_subWidget == NULL) {
return;
}
vec2 tmpSize = m_subWidget->getSize();
vec2 tmpOrigin = m_subWidget->getOrigin();
// display border ...
m_compositing.setColor(m_colorBorder);
switch (m_arrawBorder) {
case markTop:
m_compositing.setPos(vec3(m_arrowPos.x(), m_arrowPos.y(), 0.0f) );
m_compositing.addVertex();
if (m_arrowPos.x() <= tmpOrigin.x() ) {
float laking = m_offset - padding.y();
m_compositing.setPos(vec3(m_arrowPos.x()+laking, m_arrowPos.y()-laking, 0.0f) );
m_compositing.addVertex();
m_compositing.setPos(vec3(m_arrowPos.x(), m_arrowPos.y()-laking, 0.0f) );
m_compositing.addVertex();
} else {
float laking = m_offset - padding.y();
m_compositing.setPos(vec3(m_arrowPos.x()+laking, m_arrowPos.y()-laking, 0.0f) );
m_compositing.addVertex();
m_compositing.setPos(vec3(m_arrowPos.x()-laking, m_arrowPos.y()-laking, 0.0f) );
m_compositing.addVertex();
}
break;
case markButtom:
m_compositing.setPos(vec3(m_arrowPos.x(), m_arrowPos.y(), 0) );
m_compositing.addVertex();
if (m_arrowPos.x() <= tmpOrigin.x() ) {
int32_t laking = m_offset - padding.y();
m_compositing.setPos(vec3(m_arrowPos.x()+laking, m_arrowPos.y()+laking, 0.0f) );
m_compositing.addVertex();
m_compositing.setPos(vec3(m_arrowPos.x(), m_arrowPos.y()+laking, 0.0f) );
m_compositing.addVertex();
} else {
int32_t laking = m_offset - padding.y();
m_compositing.setPos(vec3(m_arrowPos.x()+laking, m_arrowPos.y()+laking, 0.0f) );
m_compositing.addVertex();
m_compositing.setPos(vec3(m_arrowPos.x()-laking, m_arrowPos.y()+laking, 0.0f) );
m_compositing.addVertex();
}
break;
default:
case markRight:
case markLeft:
EWOL_TODO("later");
break;
}
vec2 shaperOrigin = tmpOrigin-padding;
vec2 shaperSize = tmpSize+padding*2.0f;
m_shaper.setOrigin(vec2ClipInt32(shaperOrigin));
m_shaper.setSize(vec2ClipInt32(shaperSize));
m_shaper.setInsidePos(vec2ClipInt32(shaperOrigin+padding));
m_shaper.setInsideSize(vec2ClipInt32(shaperSize-padding*2.0f));
}
bool widget::ContextMenu::onEventInput(const ewol::EventInput& _event) {
@ -256,13 +258,13 @@ bool widget::ContextMenu::onSetConfig(const ewol::EConfig& _conf) {
return true;
}
if (_conf.getConfig() == configArrowMode) {
if(true == _conf.getData().compareNoCase("top")) {
if(compare_no_case(_conf.getData(), "top") == true) {
m_arrawBorder = markTop;
} else if(true == _conf.getData().compareNoCase("right")) {
} else if(compare_no_case(_conf.getData(), "right") == true) {
m_arrawBorder = markRight;
} else if(true == _conf.getData().compareNoCase("buttom")) {
} else if(compare_no_case(_conf.getData(), "buttom") == true) {
m_arrawBorder = markButtom;
} else if(true == _conf.getData().compareNoCase("left")) {
} else if(compare_no_case(_conf.getData(), "left") == true) {
m_arrawBorder = markLeft;
} else {
m_arrawBorder = markNone;

View File

@ -114,8 +114,8 @@ void widget::Entry::calculateMinMaxSize(void) {
void widget::Entry::setValue(const std::string& _newData) {
std::string newData = _newData;
if (newData.size()>m_maxCharacter) {
newData = _newData.extract(0, m_maxCharacter);
EWOL_DEBUG("Limit entry set of data... " << _newData.extract(m_maxCharacter));
newData = std::string(_newData, 0, m_maxCharacter);
EWOL_DEBUG("Limit entry set of data... " << std::string(_newData, m_maxCharacter));
}
// set the value with the check of the RegExp ...
setInternalValue(newData);
@ -191,13 +191,13 @@ void widget::Entry::updateCursorPosition(const vec2& _pos, bool _selection) {
vec2 relPos = relativePosition(_pos);
relPos.setX(relPos.x()-m_displayStartPosition - padding.x());
// try to find the new cursor position :
std::string tmpDisplay = m_data.extract(0, m_displayStartPosition);
std::string tmpDisplay = std::string(m_data, 0, m_displayStartPosition);
int32_t displayHidenSize = m_oObjectText.calculateSize(tmpDisplay).x();
//EWOL_DEBUG("hidenSize : " << displayHidenSize);
int32_t newCursorPosition = -1;
int32_t tmpTextOriginX = padding.x();
for (int32_t iii=0; iii<m_data.size(); iii++) {
tmpDisplay = m_data.extract(0, iii);
tmpDisplay = std::string(m_data, 0, iii);
int32_t tmpWidth = m_oObjectText.calculateSize(tmpDisplay).x() - displayHidenSize;
if (tmpWidth >= relPos.x()-tmpTextOriginX) {
newCursorPosition = iii;
@ -236,7 +236,7 @@ void widget::Entry::removeSelected(void) {
// remove data ...
m_displayCursorPos = pos1;
m_displayCursorPosSelection = pos1;
m_data.remove(pos1, pos2-pos1);
m_data.erase(pos1, pos2-pos1);
markToRedraw();
}
@ -253,7 +253,7 @@ void widget::Entry::copySelectionToClipBoard(enum ewol::clipBoard::clipboardList
pos1 = m_displayCursorPos;
}
// Copy
std::string tmpData = m_data.extract(pos1, pos2);
std::string tmpData = std::string(m_data, pos1, pos2);
ewol::clipBoard::set(_clipboardID, tmpData);
}
@ -365,14 +365,14 @@ bool widget::Entry::onEventEntry(const ewol::EventEntry& _event) {
} else if (_event.getChar() == 0x7F) {
// SUPPR :
if (m_data.size() > 0 && m_displayCursorPos<m_data.size()) {
m_data.remove(m_displayCursorPos, 1);
m_data.erase(m_displayCursorPos, 1);
m_displayCursorPos = etk_max(m_displayCursorPos, 0);
m_displayCursorPosSelection = m_displayCursorPos;
}
} else if (_event.getChar() == 0x08) {
// DEL :
if (m_data.size() > 0 && m_displayCursorPos != 0) {
m_data.remove(m_displayCursorPos-1, 1);
m_data.erase(m_displayCursorPos-1, 1);
m_displayCursorPos--;
m_displayCursorPos = etk_max(m_displayCursorPos, 0);
m_displayCursorPosSelection = m_displayCursorPos;
@ -382,7 +382,7 @@ bool widget::Entry::onEventEntry(const ewol::EventEntry& _event) {
EWOL_INFO("Reject data for entry : '" << _event.getChar() << "'");
} else {
std::string newData = m_data;
newData.add(m_displayCursorPos, _event.getChar());
newData.insert(newData.begin()+m_displayCursorPos, _event.getChar());
setInternalValue(newData);
if (m_data == newData) {
m_displayCursorPos++;
@ -447,9 +447,9 @@ void widget::Entry::onEventClipboard(enum ewol::clipBoard::clipboardListe _clipb
// get current selection / Copy :
std::string tmpData = get(_clipboardID);
// add it on the current display :
if (tmpData.size() >= 0) {
if (tmpData.size() != 0) {
std::string newData = m_data;
newData.add(m_displayCursorPos, &tmpData[0]);
newData.insert(m_displayCursorPos, &tmpData[0]);
setInternalValue(newData);
if (m_data == newData) {
if (m_data.size() == tmpData.size()) {
@ -514,7 +514,7 @@ void widget::Entry::updateTextPosition(void) {
m_displayStartPosition = 0;
} else {
// all can not be set :
std::string tmpDisplay = m_data.extract(0, m_displayCursorPos);
std::string tmpDisplay = std::string(m_data, 0, m_displayCursorPos);
int32_t pixelCursorPos = m_oObjectText.calculateSize(tmpDisplay).x();
// check if the Cussor is visible at 10px nearest the border :
int32_t tmp1 = pixelCursorPos+m_displayStartPosition;
@ -589,7 +589,7 @@ bool widget::Entry::onSetConfig(const ewol::EConfig& _conf) {
return true;
}
if (_conf.getConfig() == configMaxChar) {
setMaxChar(_conf.getData().toInt32());
setMaxChar(stoi(_conf.getData()));
return true;
}
if (_conf.getConfig() == configRegExp) {
@ -616,7 +616,7 @@ bool widget::Entry::onGetConfig(const char* _config, std::string& _result) const
return true;
}
if (_config == configMaxChar) {
_result = std::string(getMaxChar());
_result = std::to_string(getMaxChar());
return true;
}
if (_config == configRegExp) {

View File

@ -95,7 +95,6 @@ namespace widget {
int32_t getMaxChar(void) const {
return m_maxCharacter;
};
private:
etk::RegExp<std::string> m_regExp; //!< regular expression to limit the input of an entry
public:
@ -108,10 +107,9 @@ namespace widget {
* @brief get the regualar expression limitation
* @param The regExp string
*/
const std::string& getRegExp(void) const {
std::string getRegExp(void) const {
return m_regExp.getRegExp();
};
private:
bool m_needUpdateTextPos; //!< text position can have change
int32_t m_displayStartPosition; //!< ofset in pixel of the display of the UString

View File

@ -152,13 +152,13 @@ void widget::Gird::setColNumber(int32_t _colNumber) {
}
} else {
EWOL_WARNING("[" << getId() << "] Must not have null pointer on the subWidget list ...");
m_subWidget.erase(iii);
m_subWidget.erase(m_subWidget.begin()+iii);
}
errorControl = m_subWidget.size();
}
}
// just add the col size:
m_sizeCol.erase(m_sizeCol.size()-1, 0x7FFFFFFF);
m_sizeCol.erase(m_sizeCol.end());
} else {
// just add the col size:
for (int32_t iii=m_sizeCol.size()-1; iii<_colNumber-1 ; iii++) {
@ -209,7 +209,7 @@ void widget::Gird::subWidgetRemoveAll(void) {
}
} else {
EWOL_WARNING("[" << getId() << "] Must not have null pointer on the subWidget list ...");
m_subWidget.erase(0);
m_subWidget.erase(m_subWidget.begin());
}
errorControl = m_subWidget.size();
}
@ -232,14 +232,14 @@ void widget::Gird::subWidgetAdd(int32_t _colId, int32_t _rowId, ewol::Widget* _n
continue;
} else if (m_subWidget[iii].row > prop.row) {
// find a new position;
m_subWidget.insert(iii, prop);
m_subWidget.insert(m_subWidget.begin()+iii, prop);
return;
} else {
if (m_subWidget[iii].col < prop.col) {
continue;
} else if (m_subWidget[iii].col > prop.col) {
// find a new position;
m_subWidget.insert(iii, prop);
m_subWidget.insert(m_subWidget.begin()+iii, prop);
return;
} else {
// The element already exist == > replace it ...
@ -272,7 +272,7 @@ void widget::Gird::subWidgetRemove(ewol::Widget* _newWidget)
if (errorControl == m_subWidget.size()) {
EWOL_CRITICAL("[" << getId() << "] The number of element might have been reduced ... == > it is not the case ==> the herited class must call the \"OnObjectRemove\" function...");
m_subWidget[iii].widget = NULL;
m_subWidget.erase(iii);
m_subWidget.erase(m_subWidget.begin()+iii);
}
return;
}
@ -292,7 +292,7 @@ void widget::Gird::subWidgetRemove(int32_t _colId, int32_t _rowId) {
&& m_subWidget[iii].col == _colId) {
if (m_subWidget[iii].widget == NULL) {
EWOL_WARNING("[" << getId() << "] remove NULL widget");
m_subWidget.erase(iii);
m_subWidget.erase(m_subWidget.begin()+iii);
} else {
// The element already exist == > replace it ...
if (m_subWidget[iii].widget != NULL) {
@ -300,7 +300,7 @@ void widget::Gird::subWidgetRemove(int32_t _colId, int32_t _rowId) {
if (errorControl == m_subWidget.size()) {
EWOL_CRITICAL("[" << getId() << "] The number of element might have been reduced ... == > it is not the case ==> the herited class must call the \"OnObjectRemove\" function...");
m_subWidget[iii].widget = NULL;
m_subWidget.erase(iii);
m_subWidget.erase(m_subWidget.begin()+iii);
}
}
}
@ -317,7 +317,7 @@ void widget::Gird::subWidgetUnLink(ewol::Widget* _newWidget) {
for (int32_t iii=0; iii<m_subWidget.size(); iii++) {
if (_newWidget == m_subWidget[iii].widget) {
m_subWidget[iii].widget = NULL;
m_subWidget.erase(iii);
m_subWidget.erase(m_subWidget.begin()+iii);
return;
}
}
@ -333,7 +333,7 @@ void widget::Gird::subWidgetUnLink(int32_t _colId, int32_t _rowId) {
if( m_subWidget[iii].row == _rowId
&& m_subWidget[iii].col == _colId) {
m_subWidget[iii].widget = NULL;
m_subWidget.erase(iii);
m_subWidget.erase(m_subWidget.begin()+iii);
return;
}
}
@ -389,7 +389,7 @@ void widget::Gird::onObjectRemove(ewol::EObject * _removeObject) {
if(m_subWidget[iii].widget == _removeObject) {
EWOL_VERBOSE("[" << getId() << "]={" << getObjectType() << "} remove sizer sub Element [" << iii << "/" << m_subWidget.size()-1 << "] == > destroyed object");
m_subWidget[iii].widget = NULL;
m_subWidget.erase(iii);
m_subWidget.erase(m_subWidget.begin()+iii);
}
}
if (m_tmpWidget == _removeObject) {

View File

@ -194,7 +194,7 @@ bool widget::Image::loadXML(exml::Element* _node) {
std::string tmpAttributeValue = _node->getAttribute("ratio");
if (tmpAttributeValue.size()!=0) {
if (tmpAttributeValue.compareNoCase("true") == true) {
if (compare_no_case(tmpAttributeValue, "true") == true) {
m_keepRatio = true;
} else if (tmpAttributeValue == "1") {
m_keepRatio = true;
@ -229,7 +229,7 @@ bool widget::Image::onSetConfig(const ewol::EConfig& _conf) {
return true;
}
if (_conf.getConfig() == configRatio) {
setKeepRatio(_conf.getData().toBool());
setKeepRatio(stobool(_conf.getData()));
return true;
}
if (_conf.getConfig() == configSize) {

View File

@ -80,7 +80,7 @@ void widget::List::addOObject(ewol::Compositing* _newObject, int32_t _pos) {
if (_pos < 0 || _pos >= m_listOObject.size() ) {
m_listOObject.push_back(_newObject);
} else {
m_listOObject.insert(_pos, _newObject);
m_listOObject.insert(m_listOObject.begin()+_pos, _newObject);
}
}

View File

@ -160,7 +160,7 @@ bool widget::PopUp::onSetConfig(const ewol::EConfig& _conf) {
return true;
}
if (_conf.getConfig() == configRemoveOnExternClick) {
setRemoveOnExternClick(_conf.getData().toBool());
setRemoveOnExternClick(stobool(_conf.getData()));
return true;
}
if (_conf.getConfig() == configLockExpand) {
@ -168,7 +168,7 @@ bool widget::PopUp::onSetConfig(const ewol::EConfig& _conf) {
return true;
}
if (_conf.getConfig() == configAnimation) {
if (_conf.getData().compareNoCase("increase") == true) {
if (compare_no_case(_conf.getData(), "increase") == true) {
setAnimationMode(animationIncrease);
} else {
setAnimationMode(animationNone);

View File

@ -109,7 +109,7 @@ bool widget::ProgressBar::onSetConfig(const ewol::EConfig& _conf) {
return true;
}
if (_conf.getConfig() == configValue) {
m_value = _conf.getData().toFloat();
m_value = stof(_conf.getData());
return true;
}
return false;

View File

@ -175,8 +175,8 @@ bool widget::Sizer::loadXML(exml::Element* _node) {
}
tmpAttributeValue = _node->getAttribute("mode");
if (tmpAttributeValue.size()!=0) {
if( tmpAttributeValue.compareNoCase("vert")
|| tmpAttributeValue.compareNoCase("vertical")) {
if( compare_no_case(tmpAttributeValue, "vert") == true
|| compare_no_case(tmpAttributeValue, "vertical") == true) {
m_mode = widget::Sizer::modeVert;
} else {
m_mode = widget::Sizer::modeHori;

View File

@ -112,7 +112,7 @@ bool widget::Slider::onEventInput(const ewol::EventInput& _event) {
m_value = etk_max(etk_min(m_value, m_max), m_min);
if (oldValue != m_value) {
EWOL_DEBUG(" new value : " << m_value << " in [" << m_min << ".." << m_max << "]");
generateEventId(ewolEventSliderChange, m_value);
generateEventId(ewolEventSliderChange, std::to_string(m_value));
markToRedraw();
}
return true;

View File

@ -270,9 +270,9 @@ bool widget::WSlider::onSetConfig(const ewol::EConfig& _conf) {
}
if (_conf.getConfig() == configMode) {
enum sladingMode tmpTransition = sladingTransitionHori;
if(true == _conf.getData().compareNoCase("vert")) {
if(compare_no_case(_conf.getData(), "vert") == true) {
tmpTransition = sladingTransitionVert;
} else if(true == _conf.getData().compareNoCase("hori")) {
} else if(compare_no_case(_conf.getData(), "hori") == true) {
tmpTransition = sladingTransitionHori;
}
setTransitionMode(tmpTransition);

View File

@ -719,7 +719,7 @@ bool ewol::Widget::onSetConfig(const ewol::EConfig& _conf) {
return true;
}
if (_conf.getConfig() == ewol::Widget::configHide) {
if(true == _conf.getData().toBool()) {
if(true == stobool(_conf.getData())) {
hide();
} else {
show();
@ -727,7 +727,7 @@ bool ewol::Widget::onSetConfig(const ewol::EConfig& _conf) {
return true;
}
if (_conf.getConfig() == ewol::Widget::configFocus) {
if(true == _conf.getData().toBool()) {
if(true == stobool(_conf.getData())) {
keepFocus();
} else {
//nothing to do ...

View File

@ -244,7 +244,7 @@ void ewol::WidgetManager::addWidgetCreator(const std::string& _name,
return;
}
//Keep name in lower case :
std::string nameLower = _name.toLower();
std::string nameLower = to_lower(_name);
if (true == m_creatorList.exist(nameLower)) {
EWOL_WARNING("Replace Creator of a specify widget : " << nameLower);
m_creatorList[nameLower] = _pointer;
@ -255,7 +255,7 @@ void ewol::WidgetManager::addWidgetCreator(const std::string& _name,
}
ewol::Widget* ewol::WidgetManager::create(const std::string& _name) {
std::string nameLower = _name.toLower();
std::string nameLower = to_lower(_name);
if (true == m_creatorList.exist(nameLower)) {
ewol::WidgetManager::creator_tf pointerFunction = m_creatorList[nameLower];
if (NULL != pointerFunction) {
@ -267,7 +267,7 @@ ewol::Widget* ewol::WidgetManager::create(const std::string& _name) {
}
bool ewol::WidgetManager::exist(const std::string& _name) {
std::string nameLower = _name.toLower();
std::string nameLower = to_lower(_name);
return m_creatorList.exist(nameLower);
}

View File

@ -328,7 +328,7 @@ void widget::WidgetScrooled::addOObject(ewol::Compositing* _newObject, int32_t _
if (_pos < 0 || _pos >= m_listOObject.size() ) {
m_listOObject.push_back(_newObject);
} else {
m_listOObject.insert(_pos, _newObject);
m_listOObject.insert(m_listOObject.begin()+_pos, _newObject);
}
}

View File

@ -68,7 +68,7 @@ ewol::Widget * ewol::Windows::getWidgetAtPos(const vec2& _pos) {
// event go directly on the pop-up
if (0 < m_popUpWidgetList.size()) {
if (NULL == m_popUpWidgetList[m_popUpWidgetList.size()-1]) {
m_popUpWidgetList.popBack();
m_popUpWidgetList.pop_back();
} else {
return m_popUpWidgetList[m_popUpWidgetList.size()-1]->getWidgetAtPos(_pos);
}
@ -200,7 +200,7 @@ void ewol::Windows::onObjectRemove(ewol::EObject* _removeObject) {
if(m_popUpWidgetList[iii] == _removeObject) {
EWOL_DEBUG("Remove Pop-up [" << iii << "] element of the windows == > destroyed object");
m_popUpWidgetList[iii] = NULL;
m_popUpWidgetList.erase(iii);
m_popUpWidgetList.erase(m_popUpWidgetList.begin()+iii);
}
}
}

View File

@ -371,7 +371,7 @@ void widget::FileChooser::onReceiveMessage(const ewol::EMessage& _msg) {
EWOL_DEBUG(" old PATH : \"" << m_folder << "\" + \"" << _msg.getData() << "\"");
m_folder = m_folder + _msg.getData();
EWOL_DEBUG("new PATH : \"" << m_folder << "\"");
m_folder = etk::tool::simplifyPath(m_folder);
m_folder = etk::simplifyPath(m_folder);
setFileName("");
updateCurrentFolder();
} else if (ewolEventFileChooserListFile == _msg.getMessage()) {
@ -395,7 +395,7 @@ void widget::FileChooser::onReceiveMessage(const ewol::EMessage& _msg) {
std::string tmpUserFolder = etk::getUserHomeFolder();
EWOL_DEBUG("new PATH : \"" << tmpUserFolder << "\"");
m_folder = etk::tool::simplifyPath(tmpUserFolder);
m_folder = etk::simplifyPath(tmpUserFolder);
setFileName("");
updateCurrentFolder();

View File

@ -62,7 +62,7 @@ void widget::ParameterList::addOObject(ewol::Compositing* _newObject, int32_t _p
if (_pos < 0 || _pos >= m_listOObject.size() ) {
m_listOObject.push_back(_newObject);
} else {
m_listOObject.insert(_pos, _newObject);
m_listOObject.insert(m_listOObject.begin()+_pos, _newObject);
}
}
@ -188,7 +188,7 @@ bool widget::ParameterList::onEventInput(const ewol::EventInput& _event) {
if (rawID >= 0 && rawID<m_list.size()) {
if (m_list[rawID]!=NULL) {
if (m_list[rawID]->m_refId >= 0) {
generateEventId(ewolEventParameterListSelect, m_list[rawID]->m_refId);
generateEventId(ewolEventParameterListSelect, std::to_string(m_list[rawID]->m_refId));
m_idSelected = rawID;
markToRedraw();
return true;