[DEV] add value set config in entry element
This commit is contained in:
parent
f3d7d3a6e6
commit
ab979adf2a
@ -27,6 +27,7 @@ namespace ewol {
|
|||||||
*/
|
*/
|
||||||
class Button : public ewol::Widget {
|
class Button : public ewol::Widget {
|
||||||
public:
|
public:
|
||||||
|
//! @not-in-doc
|
||||||
static void init(ewol::widget::Manager& _widgetManager);
|
static void init(ewol::widget::Manager& _widgetManager);
|
||||||
// Event list of properties
|
// Event list of properties
|
||||||
static const char* const eventPressed;
|
static const char* const eventPressed;
|
||||||
|
@ -45,6 +45,7 @@ const char* const ewol::widget::Entry::configRegExp = "regExp";
|
|||||||
const char* const ewol::widget::Entry::configColorFg = "color";
|
const char* const ewol::widget::Entry::configColorFg = "color";
|
||||||
const char* const ewol::widget::Entry::configColorBg = "background";
|
const char* const ewol::widget::Entry::configColorBg = "background";
|
||||||
const char* const ewol::widget::Entry::configEmptyMessage = "emptytext";
|
const char* const ewol::widget::Entry::configEmptyMessage = "emptytext";
|
||||||
|
const char* const ewol::widget::Entry::configValue = "value";
|
||||||
|
|
||||||
ewol::widget::Entry::Entry(std::string _newData) :
|
ewol::widget::Entry::Entry(std::string _newData) :
|
||||||
m_shaper("THEME:GUI:widgetEntry.conf"),
|
m_shaper("THEME:GUI:widgetEntry.conf"),
|
||||||
@ -77,6 +78,7 @@ ewol::widget::Entry::Entry(std::string _newData) :
|
|||||||
registerConfig(configColorFg, "color", NULL, "Color of the text displayed");
|
registerConfig(configColorFg, "color", NULL, "Color of the text displayed");
|
||||||
registerConfig(configColorBg, "color", NULL, "Color of the text selected");
|
registerConfig(configColorBg, "color", NULL, "Color of the text selected");
|
||||||
registerConfig(configEmptyMessage, "string", NULL, "Text that is displayed when the Entry is empty (decorated text)");
|
registerConfig(configEmptyMessage, "string", NULL, "Text that is displayed when the Entry is empty (decorated text)");
|
||||||
|
registerConfig(configValue, "string", NULL, "Value display in the entry (decorated text)");
|
||||||
|
|
||||||
setValue(_newData);
|
setValue(_newData);
|
||||||
markToRedraw();
|
markToRedraw();
|
||||||
@ -123,7 +125,7 @@ void ewol::widget::Entry::setValue(const std::string& _newData) {
|
|||||||
if (m_data == newData) {
|
if (m_data == newData) {
|
||||||
m_displayCursorPos = m_data.size();
|
m_displayCursorPos = m_data.size();
|
||||||
m_displayCursorPosSelection = m_displayCursorPos;
|
m_displayCursorPosSelection = m_displayCursorPos;
|
||||||
EWOL_DEBUG("Set ... " << newData);
|
EWOL_VERBOSE("Set : '" << newData << "'");
|
||||||
}
|
}
|
||||||
markToRedraw();
|
markToRedraw();
|
||||||
}
|
}
|
||||||
@ -609,6 +611,10 @@ bool ewol::widget::Entry::onSetConfig(const ewol::object::Config& _conf) {
|
|||||||
setEmptyText(_conf.getData());
|
setEmptyText(_conf.getData());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if (_conf.getConfig() == configValue) {
|
||||||
|
setValue(_conf.getData());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -636,6 +642,10 @@ bool ewol::widget::Entry::onGetConfig(const char* _config, std::string& _result)
|
|||||||
_result = getEmptyText();
|
_result = getEmptyText();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if (_config == configValue) {
|
||||||
|
_result = getValue();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,6 +43,7 @@ namespace ewol {
|
|||||||
static const char* const configColorFg;
|
static const char* const configColorFg;
|
||||||
static const char* const configColorBg;
|
static const char* const configColorBg;
|
||||||
static const char* const configEmptyMessage;
|
static const char* const configEmptyMessage;
|
||||||
|
static const char* const configValue;
|
||||||
public:
|
public:
|
||||||
static void init(ewol::widget::Manager& _widgetManager);
|
static void init(ewol::widget::Manager& _widgetManager);
|
||||||
private:
|
private:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user