[DEBUG] correction diplay of entry first view
This commit is contained in:
parent
836172f749
commit
7567856323
@ -43,8 +43,6 @@ const char * const ewol::widget::Entry::eventModify = "modify";
|
|||||||
|
|
||||||
const char* const ewol::widget::Entry::configMaxChar = "max";
|
const char* const ewol::widget::Entry::configMaxChar = "max";
|
||||||
const char* const ewol::widget::Entry::configRegExp = "regExp";
|
const char* const ewol::widget::Entry::configRegExp = "regExp";
|
||||||
const char* const ewol::widget::Entry::configColorFg = "color";
|
|
||||||
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";
|
const char* const ewol::widget::Entry::configValue = "value";
|
||||||
|
|
||||||
@ -58,11 +56,8 @@ ewol::widget::Entry::Entry(std::string _newData) :
|
|||||||
m_displayCursor(false),
|
m_displayCursor(false),
|
||||||
m_displayCursorPos(0),
|
m_displayCursorPos(0),
|
||||||
m_displayCursorPosSelection(0),
|
m_displayCursorPosSelection(0),
|
||||||
m_textColorFg(etk::color::black),
|
|
||||||
m_textColorBg(etk::color::white),
|
|
||||||
m_textWhenNothing("") {
|
m_textWhenNothing("") {
|
||||||
addObjectType("ewol::widget::Entry");
|
addObjectType("ewol::widget::Entry");
|
||||||
m_textColorBg.setA(0xAF);
|
|
||||||
m_colorIdTextFg = m_shaper.requestColor("text-foreground");
|
m_colorIdTextFg = m_shaper.requestColor("text-foreground");
|
||||||
m_colorIdTextBg = m_shaper.requestColor("text-background");
|
m_colorIdTextBg = m_shaper.requestColor("text-background");
|
||||||
m_colorIdCursor = m_shaper.requestColor("text-cursor");
|
m_colorIdCursor = m_shaper.requestColor("text-cursor");
|
||||||
@ -80,8 +75,6 @@ ewol::widget::Entry::Entry(std::string _newData) :
|
|||||||
|
|
||||||
registerConfig(configMaxChar, "int", NULL, "Maximum cgar that can be set on the Entry");
|
registerConfig(configMaxChar, "int", NULL, "Maximum cgar that can be set on the Entry");
|
||||||
registerConfig(configRegExp, "string", NULL, "Control what it is write with a regular expression");
|
registerConfig(configRegExp, "string", NULL, "Control what it is write with a regular expression");
|
||||||
registerConfig(configColorFg, "color", NULL, "Color of the text displayed");
|
|
||||||
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)");
|
registerConfig(configValue, "string", NULL, "Value display in the entry (decorated text)");
|
||||||
|
|
||||||
@ -177,6 +170,7 @@ void ewol::widget::Entry::onRegenerateDisplay(void) {
|
|||||||
tmpSizeText = vec2ClipInt32(tmpSizeText);
|
tmpSizeText = vec2ClipInt32(tmpSizeText);
|
||||||
tmpOriginText = vec2ClipInt32(tmpOriginText);
|
tmpOriginText = vec2ClipInt32(tmpOriginText);
|
||||||
|
|
||||||
|
m_text.reset();
|
||||||
m_text.setClippingWidth(tmpOriginText, tmpSizeText);
|
m_text.setClippingWidth(tmpOriginText, tmpSizeText);
|
||||||
m_text.setPos(tmpOriginText+vec2(m_displayStartPosition,0));
|
m_text.setPos(tmpOriginText+vec2(m_displayStartPosition,0));
|
||||||
if (m_displayCursorPosSelection != m_displayCursorPos) {
|
if (m_displayCursorPosSelection != m_displayCursorPos) {
|
||||||
@ -452,6 +446,7 @@ void ewol::widget::Entry::setInternalValue(const std::string& _newData) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
m_data = _newData;
|
m_data = _newData;
|
||||||
|
markToRedraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ewol::widget::Entry::onEventClipboard(enum ewol::context::clipBoard::clipboardListe _clipboardID) {
|
void ewol::widget::Entry::onEventClipboard(enum ewol::context::clipBoard::clipboardListe _clipboardID) {
|
||||||
@ -582,16 +577,6 @@ void ewol::widget::Entry::setRegExp(const std::string& _expression) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ewol::widget::Entry::setColorText(const etk::Color<>& _color) {
|
|
||||||
m_textColorFg = _color;
|
|
||||||
markToRedraw();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ewol::widget::Entry::setColorTextSelected(const etk::Color<>& _color) {
|
|
||||||
m_textColorBg = _color;
|
|
||||||
markToRedraw();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ewol::widget::Entry::setEmptyText(const std::string& _text) {
|
void ewol::widget::Entry::setEmptyText(const std::string& _text) {
|
||||||
m_textWhenNothing = _text;
|
m_textWhenNothing = _text;
|
||||||
markToRedraw();
|
markToRedraw();
|
||||||
@ -609,14 +594,6 @@ bool ewol::widget::Entry::onSetConfig(const ewol::object::Config& _conf) {
|
|||||||
setRegExp(_conf.getData());
|
setRegExp(_conf.getData());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (_conf.getConfig() == configColorFg) {
|
|
||||||
setColorText(_conf.getData());
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (_conf.getConfig() == configColorBg) {
|
|
||||||
setColorTextSelected(_conf.getData());
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (_conf.getConfig() == configEmptyMessage) {
|
if (_conf.getConfig() == configEmptyMessage) {
|
||||||
setEmptyText(_conf.getData());
|
setEmptyText(_conf.getData());
|
||||||
return true;
|
return true;
|
||||||
@ -640,14 +617,6 @@ bool ewol::widget::Entry::onGetConfig(const char* _config, std::string& _result)
|
|||||||
_result = getRegExp();
|
_result = getRegExp();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (_config == configColorFg) {
|
|
||||||
_result = getColorText().getString();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (_config == configColorBg) {
|
|
||||||
_result = getColorTextSelected().getString();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (_config == configEmptyMessage) {
|
if (_config == configEmptyMessage) {
|
||||||
_result = getEmptyText();
|
_result = getEmptyText();
|
||||||
return true;
|
return true;
|
||||||
|
@ -40,8 +40,6 @@ namespace ewol {
|
|||||||
// Config list of properties
|
// Config list of properties
|
||||||
static const char* const configMaxChar;
|
static const char* const configMaxChar;
|
||||||
static const char* const configRegExp;
|
static const char* const configRegExp;
|
||||||
static const char* const configColorFg;
|
|
||||||
static const char* const configColorBg;
|
|
||||||
static const char* const configEmptyMessage;
|
static const char* const configEmptyMessage;
|
||||||
static const char* const configValue;
|
static const char* const configValue;
|
||||||
public:
|
public:
|
||||||
@ -150,39 +148,6 @@ namespace ewol {
|
|||||||
* @note This request a regeneration of the display
|
* @note This request a regeneration of the display
|
||||||
*/
|
*/
|
||||||
virtual void removeSelected(void);
|
virtual void removeSelected(void);
|
||||||
|
|
||||||
private:
|
|
||||||
etk::Color<> m_textColorFg; //!< Text color.
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
* @brief set text color.
|
|
||||||
* @param _color Color that is selected.
|
|
||||||
*/
|
|
||||||
void setColorText(const etk::Color<>& _color);
|
|
||||||
/**
|
|
||||||
* @brief get the color for the text.
|
|
||||||
* @return The color requested.
|
|
||||||
*/
|
|
||||||
const etk::Color<>& getColorText(void) const {
|
|
||||||
return m_textColorFg;
|
|
||||||
};
|
|
||||||
|
|
||||||
private:
|
|
||||||
etk::Color<> m_textColorBg; //!< Background color.
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
* @brief set text backgroung color when selected.
|
|
||||||
* @param _color Color that is selected.
|
|
||||||
*/
|
|
||||||
void setColorTextSelected(const etk::Color<>& _color);
|
|
||||||
/**
|
|
||||||
* @brief get the selected color for the text in selection mode.
|
|
||||||
* @return The color requested.
|
|
||||||
*/
|
|
||||||
const etk::Color<>& getColorTextSelected(void) const {
|
|
||||||
return m_textColorBg;
|
|
||||||
};
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string m_textWhenNothing; //!< Text to display when nothing in in the entry (decorated text...)
|
std::string m_textWhenNothing; //!< Text to display when nothing in in the entry (decorated text...)
|
||||||
public:
|
public:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user