[DEV] update new property interface

This commit is contained in:
Edouard DUPIN 2016-03-02 21:51:44 +01:00
parent 11577515ff
commit c2bc4c553c
55 changed files with 853 additions and 598 deletions

View File

@ -17,7 +17,7 @@
ewol::object::Manager::Manager(ewol::Context& _context) : ewol::object::Manager::Manager(ewol::Context& _context) :
m_context(_context), m_context(_context),
periodicCall(*this, "periodic", "Call every time system render"), periodicCall(this, "periodic", "Call every time system render"),
m_applWakeUpTime(0), m_applWakeUpTime(0),
m_lastPeriodicCallTime(0) { m_lastPeriodicCallTime(0) {
EWOL_DEBUG(" == > init Object-Manager"); EWOL_DEBUG(" == > init Object-Manager");

View File

@ -46,7 +46,7 @@ void ewol::Object::removeParent() {
} }
ewol::Object::Object() : ewol::Object::Object() :
propertyName(*this, "name", "", "Object name, might be a unique reference in all the program"), propertyName(this, "name", "", "Object name, might be a unique reference in all the program"),
m_objectHasBeenInit(false), m_objectHasBeenInit(false),
m_destroy(false), m_destroy(false),
m_static(false), m_static(false),

View File

@ -21,17 +21,17 @@ const static int32_t STATUS_PRESSED(1);
const static int32_t STATUS_DOWN(3); const static int32_t STATUS_DOWN(3);
ewol::widget::Button::Button() : ewol::widget::Button::Button() :
signalPressed(*this, "pressed", "Button is pressed"), signalPressed(this, "pressed", "Button is pressed"),
signalDown(*this, "down", "Button is DOWN"), signalDown(this, "down", "Button is DOWN"),
signalUp(*this, "up", "Button is UP"), signalUp(this, "up", "Button is UP"),
signalEnter(*this, "enter", "The cursor enter inside the button"), signalEnter(this, "enter", "The cursor enter inside the button"),
signalLeave(*this, "leave", "the cursor leave the button"), signalLeave(this, "leave", "the cursor leave the button"),
signalValue(*this, "value", "button value change"), signalValue(this, "value", "button value change"),
propertyShape(*this, "shaper", "", "The display name for config file"), propertyShape(this, "shaper", "", "The display name for config file", &ewol::widget::Button::onChangePropertyShape),
propertyValue(*this, "value", false, "Value of the Button"), propertyValue(this, "value", false, "Value of the Button", &ewol::widget::Button::onChangePropertyValue),
propertyLock(*this, "lock", lockNone, "Lock the button in a special state to permit changing state only by the coder"), propertyLock(this, "lock", lockNone, "Lock the button in a special state to permit changing state only by the coder", &ewol::widget::Button::onChangePropertyLock),
propertyToggleMode(*this, "toggle", false, "The Button can toogle"), propertyToggleMode(this, "toggle", false, "The Button can toogle", &ewol::widget::Button::onChangePropertyToggleMode),
propertyEnableSingle(*this, "enable-single", false, "If one element set in the Button ==> display only set"), propertyEnableSingle(this, "enable-single", false, "If one element set in the Button ==> display only set", &ewol::widget::Button::onChangePropertyEnableSingle),
m_mouseHover(false), m_mouseHover(false),
m_buttonPressed(false), m_buttonPressed(false),
m_selectableAreaPos(0,0), m_selectableAreaPos(0,0),
@ -207,80 +207,84 @@ void ewol::widget::Button::periodicCall(const ewol::event::Time& _event) {
markToRedraw(); markToRedraw();
} }
void ewol::widget::Button::onPropertyChangeValue(const eproperty::Ref& _paramPointer) { void ewol::widget::Button::onChangePropertyShape() {
ewol::widget::Container2::onPropertyChangeValue(_paramPointer); m_shaper.setSource(*propertyShape);
if (_paramPointer == propertyShape) { markToRedraw();
m_shaper.setSource(*propertyShape); }
markToRedraw(); void ewol::widget::Button::onChangePropertyValue() {
} else if (_paramPointer == propertyValue) { if (*propertyToggleMode == true) {
if (*propertyToggleMode == true) { if (*propertyValue == false) {
if (*propertyValue == false) {
m_idWidgetDisplayed = 0;
} else {
m_idWidgetDisplayed = 1;
}
}
if (*propertyEnableSingle == true) {
if ( m_idWidgetDisplayed == 0
&& m_subWidget[0] == nullptr
&& m_subWidget[1] != nullptr) {
m_idWidgetDisplayed = 1;
} else if ( m_idWidgetDisplayed == 1
&& m_subWidget[1] == nullptr
&& m_subWidget[0] != nullptr) {
m_idWidgetDisplayed = 0;
}
}
CheckStatus();
markToRedraw();
} else if (_paramPointer == propertyLock) {
if(ewol::widget::Button::lockAccess == *propertyLock) {
m_buttonPressed = false;
m_mouseHover = false;
}
CheckStatus();
markToRedraw();
} else if (_paramPointer == propertyToggleMode) {
if (*propertyValue == true) {
propertyValue.setDirect(false);
// TODO : change display and send event ...
}
if (*propertyToggleMode == false) {
m_idWidgetDisplayed = 0; m_idWidgetDisplayed = 0;
} else { } else {
if (*propertyValue == false) { m_idWidgetDisplayed = 1;
m_idWidgetDisplayed = 0;
} else {
m_idWidgetDisplayed = 1;
}
} }
if (*propertyEnableSingle == true) { }
if ( m_idWidgetDisplayed == 0 if (*propertyEnableSingle == true) {
&& m_subWidget[0] == nullptr if ( m_idWidgetDisplayed == 0
&& m_subWidget[1] != nullptr) { && m_subWidget[0] == nullptr
m_idWidgetDisplayed = 1; && m_subWidget[1] != nullptr) {
} else if ( m_idWidgetDisplayed == 1 m_idWidgetDisplayed = 1;
&& m_subWidget[1] == nullptr } else if ( m_idWidgetDisplayed == 1
&& m_subWidget[0] != nullptr) { && m_subWidget[1] == nullptr
m_idWidgetDisplayed = 0; && m_subWidget[0] != nullptr) {
} m_idWidgetDisplayed = 0;
} }
CheckStatus(); }
markToRedraw(); CheckStatus();
} else if (_paramPointer == propertyEnableSingle) { markToRedraw();
if (*propertyEnableSingle == true) { }
if ( m_idWidgetDisplayed == 0
&& m_subWidget[0] == nullptr void ewol::widget::Button::onChangePropertyLock() {
&& m_subWidget[1] != nullptr) { if(ewol::widget::Button::lockAccess == *propertyLock) {
m_idWidgetDisplayed = 1; m_buttonPressed = false;
} else if ( m_idWidgetDisplayed == 1 m_mouseHover = false;
&& m_subWidget[1] == nullptr }
&& m_subWidget[0] != nullptr) { CheckStatus();
m_idWidgetDisplayed = 0; markToRedraw();
} else if ( m_subWidget[0] == nullptr }
&& m_subWidget[1] == nullptr) {
m_idWidgetDisplayed = 0; void ewol::widget::Button::onChangePropertyToggleMode() {
} if (*propertyValue == true) {
propertyValue.setDirect(false);
// TODO : change display and send event ...
}
if (*propertyToggleMode == false) {
m_idWidgetDisplayed = 0;
} else {
if (*propertyValue == false) {
m_idWidgetDisplayed = 0;
} else {
m_idWidgetDisplayed = 1;
}
}
if (*propertyEnableSingle == true) {
if ( m_idWidgetDisplayed == 0
&& m_subWidget[0] == nullptr
&& m_subWidget[1] != nullptr) {
m_idWidgetDisplayed = 1;
} else if ( m_idWidgetDisplayed == 1
&& m_subWidget[1] == nullptr
&& m_subWidget[0] != nullptr) {
m_idWidgetDisplayed = 0;
}
}
CheckStatus();
markToRedraw();
}
void ewol::widget::Button::onChangePropertyEnableSingle() {
if (*propertyEnableSingle == true) {
if ( m_idWidgetDisplayed == 0
&& m_subWidget[0] == nullptr
&& m_subWidget[1] != nullptr) {
m_idWidgetDisplayed = 1;
} else if ( m_idWidgetDisplayed == 1
&& m_subWidget[1] == nullptr
&& m_subWidget[0] != nullptr) {
m_idWidgetDisplayed = 0;
} else if ( m_subWidget[0] == nullptr
&& m_subWidget[1] == nullptr) {
m_idWidgetDisplayed = 0;
} }
} }
} }

View File

@ -78,7 +78,6 @@ namespace ewol {
void CheckStatus(); void CheckStatus();
protected: // Derived function protected: // Derived function
virtual void onDraw(); virtual void onDraw();
virtual void onPropertyChangeValue(const eproperty::Ref& _paramPointer);
public: // Derived function public: // Derived function
virtual void calculateMinMaxSize(); virtual void calculateMinMaxSize();
virtual void onChangeSize(); virtual void onChangeSize();
@ -91,6 +90,12 @@ namespace ewol {
private: // derived function private: // derived function
virtual void periodicCall(const ewol::event::Time& _event); virtual void periodicCall(const ewol::event::Time& _event);
virtual void onLostFocus(); virtual void onLostFocus();
protected:
virtual void onChangePropertyShape();
virtual void onChangePropertyValue();
virtual void onChangePropertyLock();
virtual void onChangePropertyToggleMode();
virtual void onChangePropertyEnableSingle();
}; };
}; };
}; };

View File

@ -25,12 +25,10 @@
#undef __class__ #undef __class__
#define __class__ "ButtonColor" #define __class__ "ButtonColor"
static const char* const eventColorHasChange = "ewol-widget-ButtonColor-colorChange";
ewol::widget::ButtonColor::ButtonColor() : ewol::widget::ButtonColor::ButtonColor() :
signalChange(*this, "change", "Button color change value"), signalChange(this, "change", "Button color change value"),
propertyValue(*this, "color", etk::color::black, "Current color"), propertyValue(this, "color", etk::color::black, "Current color", &ewol::widget::ButtonColor::onChangePropertyValue),
propertyShape(*this, "shape", "", "shape of the widget"), propertyShape(this, "shape", "", "shape of the widget", &ewol::widget::ButtonColor::onChangePropertyShape),
m_widgetContextMenu(nullptr) { m_widgetContextMenu(nullptr) {
addObjectType("ewol::widget::ButtonColor"); addObjectType("ewol::widget::ButtonColor");
changeStatusIn(STATUS_UP); changeStatusIn(STATUS_UP);
@ -222,13 +220,12 @@ void ewol::widget::ButtonColor::periodicCall(const ewol::event::Time& _event) {
markToRedraw(); markToRedraw();
} }
void ewol::widget::ButtonColor::onChangePropertyValue() {
signalChange.emit(propertyValue);
}
void ewol::widget::ButtonColor::onChangePropertyShape() {
m_shaper.setSource(propertyShape.get());
markToRedraw();
}
void ewol::widget::ButtonColor::onPropertyChangeValue(const eproperty::Ref& _paramPointer) {
ewol::Widget::onPropertyChangeValue(_paramPointer);
if (_paramPointer == propertyValue) {
signalChange.emit(propertyValue);
} else if (_paramPointer == propertyShape) {
m_shaper.setSource(propertyShape.get());
markToRedraw();
}
}

View File

@ -54,7 +54,6 @@ namespace ewol {
virtual void calculateMinMaxSize(); virtual void calculateMinMaxSize();
virtual void onRegenerateDisplay(); virtual void onRegenerateDisplay();
virtual bool onEventInput(const ewol::event::Input& _event); virtual bool onEventInput(const ewol::event::Input& _event);
virtual void onPropertyChangeValue(const eproperty::Ref& _paramPointer);
private: private:
/** /**
* @brief internal system to change the property of the current status * @brief internal system to change the property of the current status
@ -65,6 +64,9 @@ namespace ewol {
virtual void periodicCall(const ewol::event::Time& _event); virtual void periodicCall(const ewol::event::Time& _event);
// Callback function: // Callback function:
void onCallbackColorChange(const etk::Color<>& _color); void onCallbackColorChange(const etk::Color<>& _color);
protected:
virtual void onChangePropertyValue();
virtual void onChangePropertyShape();
}; };
}; };
}; };

View File

@ -18,15 +18,20 @@
#undef __class__ #undef __class__
#define __class__ "CheckBox" #define __class__ "CheckBox"
ewol::widget::CheckBox::CheckBox() : ewol::widget::CheckBox::CheckBox() :
signalPressed(*this, "pressed", "CheckBox is pressed"), signalPressed(this, "pressed", "CheckBox is pressed"),
signalDown(*this, "down", "CheckBox is DOWN"), signalDown(this, "down", "CheckBox is DOWN"),
signalUp(*this, "up", "CheckBox is UP"), signalUp(this, "up", "CheckBox is UP"),
signalEnter(*this, "enter", "The cursor enter inside the CheckBox"), signalEnter(this, "enter", "The cursor enter inside the CheckBox"),
signalValue(*this, "value", "CheckBox value change"), signalValue(this, "value", "CheckBox value change"),
propertyValue(*this, "value", false, "Basic value of the widget"), propertyValue(this, "value",
propertyShape(*this, "shape", "", "The display name for config file"), false,
"Basic value of the widget",
&ewol::widget::CheckBox::onChangePropertyValue),
propertyShape(this, "shape",
"",
"The display name for config file",
&ewol::widget::CheckBox::onChangePropertyShape),
m_mouseHover(false), m_mouseHover(false),
m_buttonPressed(false), m_buttonPressed(false),
m_selectableAreaPos(0,0), m_selectableAreaPos(0,0),
@ -196,19 +201,18 @@ void ewol::widget::CheckBox::periodicCall(const ewol::event::Time& _event) {
markToRedraw(); markToRedraw();
} }
void ewol::widget::CheckBox::onPropertyChangeValue(const eproperty::Ref& _paramPointer) { void ewol::widget::CheckBox::onChangePropertyShape() {
ewol::widget::Container2::onPropertyChangeValue(_paramPointer); m_shaper.setSource(*propertyShape);
if (_paramPointer == propertyShape) { markToRedraw();
m_shaper.setSource(*propertyShape); }
markToRedraw();
} else if (_paramPointer == propertyValue) { void ewol::widget::CheckBox::onChangePropertyValue() {
if (*propertyValue == false) { if (*propertyValue == false) {
m_idWidgetDisplayed = convertId(0); m_idWidgetDisplayed = convertId(0);
} else { } else {
m_idWidgetDisplayed = convertId(1); m_idWidgetDisplayed = convertId(1);
} }
CheckStatus(); CheckStatus();
markToRedraw(); markToRedraw();
m_shaper.setActivateState(*propertyValue==true?1:0); m_shaper.setActivateState(*propertyValue==true?1:0);
}
} }

View File

@ -62,7 +62,6 @@ namespace ewol {
void CheckStatus(); void CheckStatus();
protected: // Derived function protected: // Derived function
virtual void onDraw(); virtual void onDraw();
virtual void onPropertyChangeValue(const eproperty::Ref& _paramPointer);
public: // Derived function public: // Derived function
virtual void calculateMinMaxSize(); virtual void calculateMinMaxSize();
virtual void onChangeSize(); virtual void onChangeSize();
@ -70,6 +69,9 @@ namespace ewol {
virtual bool onEventInput(const ewol::event::Input& _event); virtual bool onEventInput(const ewol::event::Input& _event);
virtual bool onEventEntry(const ewol::event::Entry& _event); virtual bool onEventEntry(const ewol::event::Entry& _event);
virtual void periodicCall(const ewol::event::Time& _event); virtual void periodicCall(const ewol::event::Time& _event);
protected:
virtual void onChangePropertyShape();
virtual void onChangePropertyValue();
}; };
}; };
}; };

View File

@ -17,8 +17,11 @@
#define __class__ "ColorBar" #define __class__ "ColorBar"
ewol::widget::ColorBar::ColorBar() : ewol::widget::ColorBar::ColorBar() :
signalChange(*this, "change", "Color value change"), signalChange(this, "change", "Color value change"),
propertyValue(*this, "color", etk::color::black, "Current color") { propertyValue(this, "color",
etk::color::black,
"Current color",
&ewol::widget::ColorBar::onChangePropertyValue) {
addObjectType("ewol::widget::ColorBar"); addObjectType("ewol::widget::ColorBar");
m_currentUserPos.setValue(0,0); m_currentUserPos.setValue(0,0);
setMouseLimit(1); setMouseLimit(1);
@ -52,13 +55,10 @@ static etk::Color<> s_listColor[NB_BAND_COLOR+1] = {
etk::Color<>(0xFF, 0x00, 0x00, 0xFF)}; etk::Color<>(0xFF, 0x00, 0x00, 0xFF)};
void ewol::widget::ColorBar::onPropertyChangeValue(const eproperty::Ref& _paramPointer) { void ewol::widget::ColorBar::onChangePropertyValue() {
ewol::Widget::onPropertyChangeValue(_paramPointer); propertyValue.getDirect().setA(0xFF);
if (_paramPointer == propertyValue) { // estimate the cursor position:
propertyValue.getDirect().setA(0xFF); EWOL_TODO("Later when really needed ...");
// estimate the cursor position:
EWOL_TODO("Later when really needed ...");
}
} }
void ewol::widget::ColorBar::onDraw() { void ewol::widget::ColorBar::onDraw() {

View File

@ -37,7 +37,8 @@ namespace ewol {
virtual void calculateMinMaxSize(); virtual void calculateMinMaxSize();
virtual void onRegenerateDisplay(); virtual void onRegenerateDisplay();
virtual bool onEventInput(const ewol::event::Input& _event); virtual bool onEventInput(const ewol::event::Input& _event);
virtual void onPropertyChangeValue(const eproperty::Ref& _paramPointer); protected:
virtual void onChangePropertyValue();
}; };
}; };
}; };

View File

@ -16,7 +16,10 @@
ewol::widget::ContainerN::ContainerN() : ewol::widget::ContainerN::ContainerN() :
propertyLockExpand(*this, "lock", vec2(false,false), "Lock the subwidget expand"), propertyLockExpand(this, "lock",
vec2(false,false),
"Lock the subwidget expand",
&ewol::widget::ContainerN::onChangePropertyLockExpand),
m_subExpend(false,false) { m_subExpend(false,false) {
addObjectType("ewol::widget::ContainerN"); addObjectType("ewol::widget::ContainerN");
// nothing to do ... // nothing to do ...
@ -47,12 +50,9 @@ bvec2 ewol::widget::ContainerN::canExpand() {
return res; return res;
} }
void ewol::widget::ContainerN::onPropertyChangeValue(const eproperty::Ref& _paramPointer) { void ewol::widget::ContainerN::onChangePropertyLockExpand() {
ewol::Widget::onPropertyChangeValue(_paramPointer); markToRedraw();
if (_paramPointer == propertyLockExpand) { requestUpdateSize();
markToRedraw();
requestUpdateSize();
}
} }
void ewol::widget::ContainerN::subWidgetReplace(const std::shared_ptr<ewol::Widget>& _oldWidget, void ewol::widget::ContainerN::subWidgetReplace(const std::shared_ptr<ewol::Widget>& _oldWidget,

View File

@ -98,7 +98,8 @@ namespace ewol {
virtual bool loadXML(const std::shared_ptr<const exml::Element>& _node); virtual bool loadXML(const std::shared_ptr<const exml::Element>& _node);
virtual void setOffset(const vec2& _newVal); virtual void setOffset(const vec2& _newVal);
virtual void requestDestroyFromChild(const std::shared_ptr<Object>& _child); virtual void requestDestroyFromChild(const std::shared_ptr<Object>& _child);
void onPropertyChangeValue(const eproperty::Ref& _paramPointer); protected:
virtual void onChangePropertyLockExpand();
}; };
}; };
}; };

View File

@ -17,11 +17,19 @@
#undef __class__ #undef __class__
#define __class__ "ContextMenu" #define __class__ "ContextMenu"
ewol::widget::ContextMenu::ContextMenu(): ewol::widget::ContextMenu::ContextMenu():
propertyShape(*this, "shape", "", "the display name for config file"), propertyShape(this, "shape",
propertyArrowPos(*this, "arrow-position", vec2(0,0), "Position of the arrow in the pop-up"), "",
propertyArrawBorder(*this, "arrow-mode", markTop, "position of the arrow") { "the display name for config file",
&ewol::widget::ContextMenu::onChangePropertyShape),
propertyArrowPos(this, "arrow-position",
vec2(0,0),
"Position of the arrow in the pop-up",
&ewol::widget::ContextMenu::onChangePropertyArrowPos),
propertyArrawBorder(this, "arrow-mode",
markTop,
"position of the arrow",
&ewol::widget::ContextMenu::onChangePropertyArrawBorder) {
addObjectType("ewol::widget::ContextMenu"); addObjectType("ewol::widget::ContextMenu");
propertyArrawBorder.add(markTop, "top"); propertyArrawBorder.add(markTop, "top");
propertyArrawBorder.add(markRight, "right"); propertyArrawBorder.add(markRight, "right");
@ -226,17 +234,17 @@ std::shared_ptr<ewol::Widget> ewol::widget::ContextMenu::getWidgetAtPos(const ve
return std::dynamic_pointer_cast<ewol::Widget>(shared_from_this()); return std::dynamic_pointer_cast<ewol::Widget>(shared_from_this());
} }
void ewol::widget::ContextMenu::onChangePropertyArrowPos() {
markToRedraw();
}
void ewol::widget::ContextMenu::onPropertyChangeValue(const eproperty::Ref& _paramPointer) { void ewol::widget::ContextMenu::onChangePropertyArrawBorder() {
ewol::widget::Container::onPropertyChangeValue(_paramPointer); markToRedraw();
if (_paramPointer == propertyArrowPos) { }
markToRedraw();
} else if (_paramPointer == propertyArrawBorder) { void ewol::widget::ContextMenu::onChangePropertyShape() {
markToRedraw(); m_shaper.setSource(propertyShape.get());
} else if (_paramPointer == propertyShape) { markToRedraw();
m_shaper.setSource(propertyShape.get());
markToRedraw();
}
} }

View File

@ -53,13 +53,16 @@ namespace ewol {
void setPositionMark(enum markPosition _position, const vec2& _arrowPos); void setPositionMark(enum markPosition _position, const vec2& _arrowPos);
protected: // Derived function protected: // Derived function
virtual void onDraw(); virtual void onDraw();
virtual void onPropertyChangeValue(const eproperty::Ref& _paramPointer);
public: // Derived function public: // Derived function
virtual void onRegenerateDisplay(); virtual void onRegenerateDisplay();
virtual bool onEventInput(const ewol::event::Input& _event); virtual bool onEventInput(const ewol::event::Input& _event);
virtual void onChangeSize(); virtual void onChangeSize();
virtual void calculateMinMaxSize(); virtual void calculateMinMaxSize();
virtual std::shared_ptr<ewol::Widget> getWidgetAtPos(const vec2& _pos); virtual std::shared_ptr<ewol::Widget> getWidgetAtPos(const vec2& _pos);
protected:
virtual void onChangePropertyArrowPos();
virtual void onChangePropertyArrawBorder();
virtual void onChangePropertyShape();
}; };
}; };
}; };

View File

@ -22,14 +22,29 @@
#define STATUS_SELECTED (2) #define STATUS_SELECTED (2)
ewol::widget::Entry::Entry() : ewol::widget::Entry::Entry() :
signalClick(*this, "click", "the user Click on the Entry box"), signalClick(this, "click", "the user Click on the Entry box"),
signalEnter(*this, "enter", "The cursor enter inside the button"), signalEnter(this, "enter", "The cursor enter inside the button"),
signalModify(*this, "modify", "Entry box value change"), signalModify(this, "modify", "Entry box value change"),
propertyShaper(*this, "shaper", "", "Shaper to display the background"), propertyShaper(this, "shaper",
propertyValue(*this, "value", "", "Value display in the entry (decorated text)"), "",
propertyMaxCharacter(*this, "max", 0x7FFFFFFF, 0, 0x7FFFFFFF, "Maximum cgar that can be set on the Entry"), "Shaper to display the background",
propertyRegex(*this, "regex", ".*", "Control what it is write with a regular expression"), &ewol::widget::Entry::onChangePropertyShaper),
propertyTextWhenNothing(*this, "empty-text", "", "Text when nothing is written"), propertyValue(this, "value",
"",
"Value display in the entry (decorated text)",
&ewol::widget::Entry::onChangePropertyValue),
propertyMaxCharacter(this, "max",
0x7FFFFFFF, 0, 0x7FFFFFFF,
"Maximum char that can be set on the Entry",
&ewol::widget::Entry::onChangePropertyMaxCharacter),
propertyRegex(this, "regex",
".*",
"Control what it is write with a regular expression",
&ewol::widget::Entry::onChangePropertyRegex),
propertyTextWhenNothing(this, "empty-text",
"",
"Text when nothing is written",
&ewol::widget::Entry::onChangePropertyTextWhenNothing),
m_needUpdateTextPos(true), m_needUpdateTextPos(true),
m_displayStartPosition(0), m_displayStartPosition(0),
m_displayCursor(false), m_displayCursor(false),
@ -541,40 +556,44 @@ void ewol::widget::Entry::periodicCall(const ewol::event::Time& _event) {
markToRedraw(); markToRedraw();
} }
void ewol::widget::Entry::onPropertyChangeValue(const eproperty::Ref& _paramPointer) { void ewol::widget::Entry::onChangePropertyShaper() {
ewol::Widget::onPropertyChangeValue(_paramPointer); m_shaper.setSource(propertyShaper.get());
if (_paramPointer == propertyShaper) { m_colorIdTextFg = m_shaper.requestColor("text-foreground");
m_shaper.setSource(propertyShaper.get()); m_colorIdTextBg = m_shaper.requestColor("text-background");
m_colorIdTextFg = m_shaper.requestColor("text-foreground"); m_colorIdCursor = m_shaper.requestColor("text-cursor");
m_colorIdTextBg = m_shaper.requestColor("text-background"); m_colorIdSelection = m_shaper.requestColor("text-selection");
m_colorIdCursor = m_shaper.requestColor("text-cursor");
m_colorIdSelection = m_shaper.requestColor("text-selection");
} else if (_paramPointer == propertyValue) {
std::string newData = propertyValue.get();
if ((int64_t)newData.size() > propertyMaxCharacter) {
newData = std::string(newData, 0, propertyMaxCharacter);
EWOL_DEBUG("Limit entry set of data... " << std::string(newData, propertyMaxCharacter));
}
// set the value with the check of the RegExp ...
setInternalValue(newData);
if (newData == propertyValue.get()) {
m_displayCursorPos = propertyValue->size();
m_displayCursorPosSelection = m_displayCursorPos;
EWOL_VERBOSE("Set : '" << newData << "'");
}
markToRedraw();
} else if (_paramPointer == propertyMaxCharacter) {
// TODO : check nomber of char in the data
} else if (_paramPointer == propertyRegex) {
try {
m_regex.assign(propertyRegex.get(), std::regex_constants::optimize | std::regex_constants::ECMAScript);
} catch (std::regex_error e) {
EWOL_ERROR("can not parse regex : '" << e.what() << "' for : " << propertyRegex);
}
markToRedraw();
} else if (_paramPointer == propertyTextWhenNothing) {
markToRedraw();
}
} }
void ewol::widget::Entry::onChangePropertyValue() {
std::string newData = propertyValue.get();
if ((int64_t)newData.size() > propertyMaxCharacter) {
newData = std::string(newData, 0, propertyMaxCharacter);
EWOL_DEBUG("Limit entry set of data... " << std::string(newData, propertyMaxCharacter));
}
// set the value with the check of the RegExp ...
setInternalValue(newData);
if (newData == propertyValue.get()) {
m_displayCursorPos = propertyValue->size();
m_displayCursorPosSelection = m_displayCursorPos;
EWOL_VERBOSE("Set : '" << newData << "'");
}
markToRedraw();
}
void ewol::widget::Entry::onChangePropertyMaxCharacter() {
// TODO : check nomber of char in the data
}
void ewol::widget::Entry::onChangePropertyRegex() {
try {
m_regex.assign(propertyRegex.get(), std::regex_constants::optimize | std::regex_constants::ECMAScript);
} catch (std::regex_error e) {
EWOL_ERROR("can not parse regex : '" << e.what() << "' for : " << propertyRegex);
}
markToRedraw();
}
void ewol::widget::Entry::onChangePropertyTextWhenNothing() {
markToRedraw();
}

View File

@ -115,7 +115,6 @@ namespace ewol {
virtual void onLostFocus(); virtual void onLostFocus();
virtual void changeStatusIn(int32_t _newStatusId); virtual void changeStatusIn(int32_t _newStatusId);
virtual void periodicCall(const ewol::event::Time& _event); virtual void periodicCall(const ewol::event::Time& _event);
virtual void onPropertyChangeValue(const eproperty::Ref& _paramPointer);
private: // callback functions private: // callback functions
void onCallbackShortCut(const std::string& _value); void onCallbackShortCut(const std::string& _value);
void onCallbackEntryClean(); void onCallbackEntryClean();
@ -123,6 +122,12 @@ namespace ewol {
void onCallbackCopy(); void onCallbackCopy();
void onCallbackPaste(); void onCallbackPaste();
void onCallbackSelect(bool _all); void onCallbackSelect(bool _all);
protected:
virtual void onChangePropertyShaper();
virtual void onChangePropertyValue();
virtual void onChangePropertyMaxCharacter();
virtual void onChangePropertyRegex();
virtual void onChangePropertyTextWhenNothing();
}; };
}; };
}; };

View File

@ -12,20 +12,19 @@
#include <ewol/widget/Manager.h> #include <ewol/widget/Manager.h>
#include <ewol/ewol.h> #include <ewol/ewol.h>
#undef __class__ #undef __class__
#define __class__ "Image" #define __class__ "Image"
ewol::widget::Image::Image() : ewol::widget::Image::Image() :
signalPressed(*this, "pressed", "Image is pressed"), signalPressed(this, "pressed", "Image is pressed"),
propertySource(*this, "src", "", "Image source path"), propertySource(this, "src", "", "Image source path", &ewol::widget::Image::onChangePropertySource),
propertyBorder(*this, "border", vec2(0,0), "Border of the image"), propertyBorder(this, "border", vec2(0,0), "Border of the image", &ewol::widget::Image::onChangePropertyGlobalSize),
propertyImageSize(*this, "size", vec2(0,0), "Basic display size of the image"), propertyImageSize(this, "size", vec2(0,0), "Basic display size of the image", &ewol::widget::Image::onChangePropertyGlobalSize),
propertyKeepRatio(*this, "ratio", true, "Keep ratio of the image"), propertyKeepRatio(this, "ratio", true, "Keep ratio of the image", &ewol::widget::Image::onChangePropertyGlobalSize),
propertyPosStart(*this, "part-start", vec2(0.0f, 0.0f), vec2(0.0f, 0.0f), vec2(1.0f, 1.0f), "Start display position in the image"), propertyPosStart(this, "part-start", vec2(0.0f, 0.0f), vec2(0.0f, 0.0f), vec2(1.0f, 1.0f), "Start display position in the image", &ewol::widget::Image::onChangePropertyGlobalSize),
propertyPosStop(*this, "part-stop", vec2(1.0f, 1.0f), vec2(0.0f, 0.0f), vec2(1.0f, 1.0f), "Start display position in the image"), propertyPosStop(this, "part-stop", vec2(1.0f, 1.0f), vec2(0.0f, 0.0f), vec2(1.0f, 1.0f), "Start display position in the image", &ewol::widget::Image::onChangePropertyGlobalSize),
propertyDistanceFieldMode(*this, "distance-field", false, "Distance field mode"), propertyDistanceFieldMode(this, "distance-field", false, "Distance field mode", &ewol::widget::Image::onChangePropertyDistanceFieldMode),
propertySmooth(*this, "smooth", true, "Smooth display of the image"), propertySmooth(this, "smooth", true, "Smooth display of the image", &ewol::widget::Image::onChangePropertySmooth),
m_colorProperty(nullptr), m_colorProperty(nullptr),
m_colorId(-1) { m_colorId(-1) {
addObjectType("ewol::widget::Image"); addObjectType("ewol::widget::Image");
@ -195,26 +194,31 @@ bool ewol::widget::Image::loadXML(const std::shared_ptr<const exml::Element>& _n
return true; return true;
} }
void ewol::widget::Image::onPropertyChangeValue(const eproperty::Ref& _paramPointer) { void ewol::widget::Image::onChangePropertySource() {
ewol::Widget::onPropertyChangeValue(_paramPointer); markToRedraw();
if ( _paramPointer == propertySource requestUpdateSize();
|| _paramPointer == propertyImageSize) { EWOL_VERBOSE("Set sources : " << *propertySource << " size=" << *propertyImageSize);
markToRedraw(); m_compositing.setSource(*propertySource, propertyImageSize->getPixel());
requestUpdateSize();
EWOL_VERBOSE("Set sources : " << *propertySource << " size=" << *propertyImageSize);
m_compositing.setSource(*propertySource, propertyImageSize->getPixel());
} else if ( _paramPointer == propertyBorder
|| _paramPointer == propertyKeepRatio
|| _paramPointer == propertyPosStart
|| _paramPointer == propertyPosStop) {
markToRedraw();
requestUpdateSize();
} else if (_paramPointer == propertyDistanceFieldMode) {
markToRedraw();
} else if (_paramPointer == propertySmooth) {
markToRedraw();
} else if (_paramPointer == propertyDistanceFieldMode) {
m_compositing.setDistanceFieldMode(*propertyDistanceFieldMode);
markToRedraw();
}
} }
void ewol::widget::Image::onChangePropertyImageSize() {
markToRedraw();
requestUpdateSize();
EWOL_VERBOSE("Set sources : " << *propertySource << " size=" << *propertyImageSize);
m_compositing.setSource(*propertySource, propertyImageSize->getPixel());
}
void ewol::widget::Image::onChangePropertyGlobalSize() {
markToRedraw();
requestUpdateSize();
}
void ewol::widget::Image::onChangePropertySmooth() {
markToRedraw();
}
void ewol::widget::Image::onChangePropertyDistanceFieldMode() {
m_compositing.setDistanceFieldMode(*propertyDistanceFieldMode);
markToRedraw();
}

View File

@ -59,12 +59,17 @@ namespace ewol {
vec2 m_imageRenderSize; //!< size of the image when we render it vec2 m_imageRenderSize; //!< size of the image when we render it
protected: // Derived function protected: // Derived function
virtual void onDraw(); virtual void onDraw();
virtual void onPropertyChangeValue(const eproperty::Ref& _paramPointer);
public: // Derived function public: // Derived function
virtual void calculateMinMaxSize(); virtual void calculateMinMaxSize();
virtual void onRegenerateDisplay(); virtual void onRegenerateDisplay();
virtual bool onEventInput(const ewol::event::Input& _event); virtual bool onEventInput(const ewol::event::Input& _event);
virtual bool loadXML(const std::shared_ptr<const exml::Element>& _node); virtual bool loadXML(const std::shared_ptr<const exml::Element>& _node);
protected:
virtual void onChangePropertySource();
virtual void onChangePropertyImageSize();
virtual void onChangePropertyGlobalSize();
virtual void onChangePropertySmooth();
virtual void onChangePropertyDistanceFieldMode();
}; };
}; };
}; };

View File

@ -21,9 +21,9 @@ static float l_ratio(1.0/7.0);
#define __class__ "Joystick" #define __class__ "Joystick"
ewol::widget::Joystick::Joystick() : ewol::widget::Joystick::Joystick() :
signalEnable(*this, "enable"), signalEnable(this, "enable", ""),
signalDisable(*this, "disable"), signalDisable(this, "disable", ""),
signalMove(*this, "move") { signalMove(this, "move", "") {
addObjectType("ewol::widget::Joystick"); addObjectType("ewol::widget::Joystick");
// by default the joy does not lock when free out // by default the joy does not lock when free out
m_lock = false; m_lock = false;

View File

@ -17,8 +17,11 @@
// TODO : Remove the label name in the constructor ... // TODO : Remove the label name in the constructor ...
ewol::widget::Label::Label() : ewol::widget::Label::Label() :
signalPressed(*this, "pressed"), signalPressed(this, "pressed", ""),
propertyValue(*this, "value", "", "displayed value string"), propertyValue(this, "value",
"",
"displayed value string",
&ewol::widget::Label::onChangePropertyValue),
m_value(U""), m_value(U""),
m_colorProperty(nullptr), m_colorProperty(nullptr),
m_colorDefaultFgText(-1), m_colorDefaultFgText(-1),
@ -143,12 +146,9 @@ bool ewol::widget::Label::loadXML(const std::shared_ptr<const exml::Element>& _n
return true; return true;
} }
void ewol::widget::Label::onPropertyChangeValue(const eproperty::Ref& _paramPointer) { void ewol::widget::Label::onChangePropertyValue() {
ewol::Widget::onPropertyChangeValue(_paramPointer); m_value = etk::to_u32string(propertyValue.get());
if (_paramPointer == propertyValue) { markToRedraw();
m_value = etk::to_u32string(propertyValue.get()); requestUpdateSize();
markToRedraw();
requestUpdateSize();
}
} }

View File

@ -46,12 +46,13 @@ namespace ewol {
virtual ~Label(); virtual ~Label();
protected: // Derived function protected: // Derived function
virtual void onDraw(); virtual void onDraw();
virtual void onPropertyChangeValue(const eproperty::Ref& _paramPointer);
public: // Derived function public: // Derived function
virtual void calculateMinMaxSize(); virtual void calculateMinMaxSize();
virtual void onRegenerateDisplay(); virtual void onRegenerateDisplay();
virtual bool onEventInput(const ewol::event::Input& _event); virtual bool onEventInput(const ewol::event::Input& _event);
virtual bool loadXML(const std::shared_ptr<const exml::Element>& _node); virtual bool loadXML(const std::shared_ptr<const exml::Element>& _node);
protected:
virtual void onChangePropertyValue();
}; };
}; };
}; };

View File

@ -8,24 +8,40 @@
#include <ewol/widget/ListFileSystem.h> #include <ewol/widget/ListFileSystem.h>
#include <etk/tool.h> #include <etk/tool.h>
#include <etk/os/FSNode.h> #include <etk/os/FSNode.h>
#undef __class__ #undef __class__
#define __class__ "ListFileSystem" #define __class__ "ListFileSystem"
ewol::widget::ListFileSystem::ListFileSystem() : ewol::widget::ListFileSystem::ListFileSystem() :
signalFileSelect(*this, "file-select"), signalFileSelect(this, "file-select", ""),
signalFileValidate(*this, "file-validate"), signalFileValidate(this, "file-validate", ""),
signalFolderSelect(*this, "folder-select"), signalFolderSelect(this, "folder-select", ""),
signalFolderValidate(*this, "folder-validate"), signalFolderValidate(this, "folder-validate", ""),
propertyPath(*this, "path", "/", "Path to display"), propertyPath(this, "path",
propertyFile(*this, "select", "", "selection af a specific file"), "/",
propertyShowFile(*this, "show-file", true, "display files"), "Path to display",
propertyShowFolder(*this, "show-folder", true, "display folders"), &ewol::widget::ListFileSystem::onChangePropertyPath),
propertyShowHidden(*this, "show-hidden", true, "Show the hidden element (file, folder, ...)"), propertyFile(this, "select",
propertyFilter(*this, "filter", "", "regex to filter files ..."), "",
"selection af a specific file",
&ewol::widget::ListFileSystem::onChangePropertyFile),
propertyShowFile(this, "show-file",
true,
"display files",
&ewol::widget::ListFileSystem::onChangePropertyShowFile),
propertyShowFolder(this, "show-folder",
true,
"display folders",
&ewol::widget::ListFileSystem::onChangePropertyShowFolder),
propertyShowHidden(this, "show-hidden",
true,
"Show the hidden element (file, folder, ...)",
&ewol::widget::ListFileSystem::onChangePropertyShowHidden),
propertyFilter(this, "filter",
"",
"regex to filter files ...",
&ewol::widget::ListFileSystem::onChangePropertyFilter),
m_selectedLine(-1) { m_selectedLine(-1) {
addObjectType("ewol::widget::ListFileSystem"); addObjectType("ewol::widget::ListFileSystem");
#if defined(__TARGET_OS__Windows) #if defined(__TARGET_OS__Windows)
@ -239,20 +255,27 @@ bool ewol::widget::ListFileSystem::onItemEvent(int32_t _IdInput,
return false; return false;
} }
void ewol::widget::ListFileSystem::onPropertyChangeValue(const eproperty::Ref& _paramPointer) { void ewol::widget::ListFileSystem::onChangePropertyPath() {
ewol::widget::List::onPropertyChangeValue(_paramPointer); regenerateView();
if (_paramPointer == propertyPath) { }
regenerateView();
} else if (_paramPointer == propertyFile) { void ewol::widget::ListFileSystem::onChangePropertyFile() {
setSelect(propertyFile); setSelect(propertyFile);
} else if (_paramPointer == propertyShowFile) { }
regenerateView();
} else if (_paramPointer == propertyShowFolder) { void ewol::widget::ListFileSystem::onChangePropertyShowFile() {
regenerateView(); regenerateView();
} else if (_paramPointer == propertyShowHidden) { }
regenerateView();
} else if (_paramPointer == propertyFilter) { void ewol::widget::ListFileSystem::onChangePropertyShowFolder() {
regenerateView(); regenerateView();
} }
void ewol::widget::ListFileSystem::onChangePropertyShowHidden() {
regenerateView();
}
void ewol::widget::ListFileSystem::onChangePropertyFilter() {
regenerateView();
} }

View File

@ -73,8 +73,13 @@ namespace ewol {
* @return the String of the element selected. * @return the String of the element selected.
*/ */
std::string getSelect() const ; std::string getSelect() const ;
public: // glocal derived functions protected:
virtual void onPropertyChangeValue(const eproperty::Ref& _paramPointer); virtual void onChangePropertyPath();
virtual void onChangePropertyFile();
virtual void onChangePropertyShowFile();
virtual void onChangePropertyShowFolder();
virtual void onChangePropertyShowHidden();
virtual void onChangePropertyFilter();
}; };
}; };
}; };

View File

@ -19,7 +19,7 @@
#define __class__ "Menu" #define __class__ "Menu"
ewol::widget::Menu::Menu() : ewol::widget::Menu::Menu() :
signalSelect(*this, "select") { signalSelect(this, "select", "") {
addObjectType("ewol::widget::Menu"); addObjectType("ewol::widget::Menu");
m_staticId = 666; m_staticId = 666;
} }

View File

@ -18,9 +18,17 @@
static const char* annimationIncrease = "increase"; static const char* annimationIncrease = "increase";
ewol::widget::PopUp::PopUp() : ewol::widget::PopUp::PopUp() :
propertyShape(*this, "shaper", "", "The shaper properties"), propertyShape(this, "shaper",
propertyLockExpand(*this, "lock", bvec2(true,true), "Lock expand contamination"), "",
propertyCloseOutEvent(*this, "out-click-remove", false, "Remove the widget if the use click outside") { "The shaper properties",
&ewol::widget::PopUp::onChangePropertyShape),
propertyLockExpand(this, "lock",
bvec2(true,true),
"Lock expand contamination",
&ewol::widget::PopUp::onChangePropertyLockExpand),
propertyCloseOutEvent(this, "out-click-remove",
false,
"Remove the widget if the use click outside") {
addObjectType("ewol::widget::PopUp"); addObjectType("ewol::widget::PopUp");
// Add annimations : // Add annimations :
addAnnimationType(ewol::Widget::annimationModeEnableAdd, annimationIncrease); addAnnimationType(ewol::Widget::annimationModeEnableAdd, annimationIncrease);
@ -130,18 +138,15 @@ std::shared_ptr<ewol::Widget> ewol::widget::PopUp::getWidgetAtPos(const vec2& _p
return std::dynamic_pointer_cast<ewol::Widget>(shared_from_this()); return std::dynamic_pointer_cast<ewol::Widget>(shared_from_this());
} }
void ewol::widget::PopUp::onPropertyChangeValue(const eproperty::Ref& _paramPointer) { void ewol::widget::PopUp::onChangePropertyShape() {
ewol::widget::Container::onPropertyChangeValue(_paramPointer); m_shaper.setSource(*propertyShape);
if (_paramPointer == propertyShape) { markToRedraw();
m_shaper.setSource(*propertyShape); requestUpdateSize();
markToRedraw(); }
requestUpdateSize();
} else if (_paramPointer == propertyLockExpand) { void ewol::widget::PopUp::onChangePropertyLockExpand() {
markToRedraw(); markToRedraw();
requestUpdateSize(); requestUpdateSize();
} else if (_paramPointer == propertyCloseOutEvent) {
// nothing to do ...
}
} }
bool ewol::widget::PopUp::onEventInput(const ewol::event::Input& _event) { bool ewol::widget::PopUp::onEventInput(const ewol::event::Input& _event) {

View File

@ -42,7 +42,6 @@ namespace ewol {
ewol::compositing::Shaper m_shaper; //!< Compositing theme. ewol::compositing::Shaper m_shaper; //!< Compositing theme.
protected: // Derived function protected: // Derived function
virtual void onDraw(); virtual void onDraw();
virtual void onPropertyChangeValue(const eproperty::Ref& _paramPointer);
public: // Derived function public: // Derived function
virtual void periodicCall(const ewol::event::Time& _event); virtual void periodicCall(const ewol::event::Time& _event);
virtual void systemDraw(const ewol::DrawProperty& _displayProp); virtual void systemDraw(const ewol::DrawProperty& _displayProp);
@ -53,6 +52,9 @@ namespace ewol {
protected: protected:
virtual bool onStartAnnimation(enum ewol::Widget::annimationMode _mode); virtual bool onStartAnnimation(enum ewol::Widget::annimationMode _mode);
virtual void onStopAnnimation(); virtual void onStopAnnimation();
protected:
virtual void onChangePropertyShape();
virtual void onChangePropertyLockExpand();
}; };
}; };
}; };

View File

@ -17,10 +17,22 @@
const int32_t dotRadius = 6; const int32_t dotRadius = 6;
ewol::widget::ProgressBar::ProgressBar() : ewol::widget::ProgressBar::ProgressBar() :
propertyValue(*this, "value", 0.0f, 0.0f, 1.0f, "Value of the progress bar"), propertyValue(this, "value",
propertyTextColorFg(*this, "color-bg", etk::color::black, "Background color"), 0.0f, 0.0f, 1.0f,
propertyTextColorBgOn(*this, "color-on", etk::Color<>(0x00, 0xFF, 0x00, 0xFF), "Color of the true value"), "Value of the progress bar",
PropertyTextColorBgOff(*this, "color-off", etk::color::none, "Color of the false value") { &ewol::widget::ProgressBar::onChangePropertyValue),
propertyTextColorFg(this, "color-bg",
etk::color::black,
"Background color",
&ewol::widget::ProgressBar::onChangePropertyTextColorFg),
propertyTextColorBgOn(this, "color-on",
etk::Color<>(0x00, 0xFF, 0x00, 0xFF),
"Color of the true value",
&ewol::widget::ProgressBar::onChangePropertyTextColorBgOn),
propertyTextColorBgOff(this, "color-off",
etk::color::none,
"Color of the false value",
&ewol::widget::ProgressBar::onChangePropertyTextColorBgOff) {
addObjectType("ewol::widget::ProgressBar"); addObjectType("ewol::widget::ProgressBar");
} }
@ -60,7 +72,7 @@ void ewol::widget::ProgressBar::onRegenerateDisplay() {
m_draw.setColor(propertyTextColorBgOn); m_draw.setColor(propertyTextColorBgOn);
m_draw.setPos(vec3(tmpOriginX, tmpOriginY, 0) ); m_draw.setPos(vec3(tmpOriginX, tmpOriginY, 0) );
m_draw.rectangleWidth(vec3(tmpSizeX*propertyValue, tmpSizeY, 0) ); m_draw.rectangleWidth(vec3(tmpSizeX*propertyValue, tmpSizeY, 0) );
m_draw.setColor(PropertyTextColorBgOff); m_draw.setColor(propertyTextColorBgOff);
m_draw.setPos(vec3(tmpOriginX+tmpSizeX*propertyValue, tmpOriginY, 0) ); m_draw.setPos(vec3(tmpOriginX+tmpSizeX*propertyValue, tmpOriginY, 0) );
m_draw.rectangleWidth(vec3(tmpSizeX*(1.0-propertyValue), tmpSizeY, 0) ); m_draw.rectangleWidth(vec3(tmpSizeX*(1.0-propertyValue), tmpSizeY, 0) );
@ -69,17 +81,20 @@ void ewol::widget::ProgressBar::onRegenerateDisplay() {
//m_draw.rectangleBorder( tmpOriginX, tmpOriginY, tmpSizeX, tmpSizeY, 1); //m_draw.rectangleBorder( tmpOriginX, tmpOriginY, tmpSizeX, tmpSizeY, 1);
} }
void ewol::widget::ProgressBar::onPropertyChangeValue(const eproperty::Ref& _paramPointer) { void ewol::widget::ProgressBar::onChangePropertyValue() {
ewol::Widget::onPropertyChangeValue(_paramPointer); markToRedraw();
if (_paramPointer == propertyValue) { }
markToRedraw();
} else if (_paramPointer == propertyTextColorFg) { void ewol::widget::ProgressBar::onChangePropertyTextColorFg() {
markToRedraw(); markToRedraw();
} else if (_paramPointer == propertyTextColorBgOn) { }
markToRedraw();
} else if (_paramPointer == PropertyTextColorBgOff) { void ewol::widget::ProgressBar::onChangePropertyTextColorBgOn() {
markToRedraw(); markToRedraw();
} }
void ewol::widget::ProgressBar::onChangePropertyTextColorBgOff() {
markToRedraw();
} }

View File

@ -24,7 +24,7 @@ namespace ewol {
eproperty::Range<float> propertyValue; //!< % used eproperty::Range<float> propertyValue; //!< % used
eproperty::Value<etk::Color<>> propertyTextColorFg; //!< forder bar color eproperty::Value<etk::Color<>> propertyTextColorFg; //!< forder bar color
eproperty::Value<etk::Color<>> propertyTextColorBgOn; //!< bar color enable eproperty::Value<etk::Color<>> propertyTextColorBgOn; //!< bar color enable
eproperty::Value<etk::Color<>> PropertyTextColorBgOff; //!< bar color disable eproperty::Value<etk::Color<>> propertyTextColorBgOff; //!< bar color disable
protected: protected:
ProgressBar(); ProgressBar();
void init(); void init();
@ -35,10 +35,14 @@ namespace ewol {
ewol::compositing::Drawing m_draw; // basic drawing element ewol::compositing::Drawing m_draw; // basic drawing element
protected: // Derived function protected: // Derived function
virtual void onDraw(); virtual void onDraw();
virtual void onPropertyChangeValue(const eproperty::Ref& _paramPointer);
public: // Derived function public: // Derived function
virtual void onRegenerateDisplay(); virtual void onRegenerateDisplay();
virtual void calculateMinMaxSize(); virtual void calculateMinMaxSize();
protected:
virtual void onChangePropertyValue();
virtual void onChangePropertyTextColorFg();
virtual void onChangePropertyTextColorBgOn();
virtual void onChangePropertyTextColorBgOff();
}; };
}; };
}; };

View File

@ -15,9 +15,18 @@
#define __class__ "Scroll" #define __class__ "Scroll"
ewol::widget::Scroll::Scroll() : ewol::widget::Scroll::Scroll() :
propertyLimit(*this, "limit", vec2(0.15,0.5), vec2(0.0,0.0), vec2(1.0,1.0), "Limit the scroll maximum position [0..1]% represent the free space in the scoll when arrive at the end"), propertyLimit(this, "limit",
propertyShapeVert(*this, "shape-vert", "", "shape for the vertical display"), vec2(0.15,0.5), vec2(0.0,0.0), vec2(1.0,1.0),
propertyShapeHori(*this, "shape-hori", "", "shape for the horizonal display"), "Limit the scroll maximum position [0..1]% represent the free space in the scoll when arrive at the end",
&ewol::widget::Scroll::onChangePropertyLimit),
propertyShapeVert(this, "shape-vert",
"",
"shape for the vertical display",
&ewol::widget::Scroll::onChangePropertyShapeVert),
propertyShapeHori(this, "shape-hori",
"",
"shape for the horizonal display",
&ewol::widget::Scroll::onChangePropertyShapeHori),
m_pixelScrolling(20), m_pixelScrolling(20),
m_highSpeedStartPos(0,0), m_highSpeedStartPos(0,0),
m_highSpeedMode(speedModeDisable), m_highSpeedMode(speedModeDisable),
@ -347,16 +356,18 @@ std::shared_ptr<ewol::Widget> ewol::widget::Scroll::getWidgetAtPos(const vec2& _
} }
return std::dynamic_pointer_cast<ewol::Widget>(shared_from_this());; return std::dynamic_pointer_cast<ewol::Widget>(shared_from_this());;
} }
void ewol::widget::Scroll::onPropertyChangeValue(const eproperty::Ref& _paramPointer) {
ewol::widget::Container::onPropertyChangeValue(_paramPointer); void ewol::widget::Scroll::onChangePropertyLimit() {
if (_paramPointer == propertyLimit) { markToRedraw();
markToRedraw(); }
} else if (_paramPointer == propertyShapeVert) {
m_shaperV.setSource(propertyShapeVert); void ewol::widget::Scroll::onChangePropertyShapeVert() {
markToRedraw(); m_shaperV.setSource(propertyShapeVert);
} else if (_paramPointer == propertyShapeHori) { markToRedraw();
m_shaperH.setSource(propertyShapeHori); }
markToRedraw();
} void ewol::widget::Scroll::onChangePropertyShapeHori() {
m_shaperH.setSource(propertyShapeHori);
markToRedraw();
} }

View File

@ -53,7 +53,10 @@ namespace ewol {
virtual std::shared_ptr<ewol::Widget> getWidgetAtPos(const vec2& _pos); virtual std::shared_ptr<ewol::Widget> getWidgetAtPos(const vec2& _pos);
protected: // Derived function protected: // Derived function
virtual void onDraw(); virtual void onDraw();
virtual void onPropertyChangeValue(const eproperty::Ref& _paramPointer); protected:
virtual void onChangePropertyLimit();
virtual void onChangePropertyShapeVert();
virtual void onChangePropertyShapeHori();
}; };
} }
} }

View File

@ -28,8 +28,11 @@ ewol::widget::Select::Element::Element(int32_t _value, std::string _name, bool _
ewol::widget::Select::Select() : ewol::widget::Select::Select() :
signalValue(*this, "value", "Select value change"), signalValue(this, "value", "Select value change"),
propertyValue(*this, "value", -1, "Value of the Select") { propertyValue(this, "value",
-1,
"Value of the Select",
&ewol::widget::Select::onChangePropertyValue) {
addObjectType("ewol::widget::Select"); addObjectType("ewol::widget::Select");
} }
@ -44,24 +47,21 @@ ewol::widget::Select::~Select() {
} }
void ewol::widget::Select::onPropertyChangeValue(const eproperty::Ref& _paramPointer) { void ewol::widget::Select::onChangePropertyValue() {
ewol::widget::SpinBase::onPropertyChangeValue(_paramPointer); markToRedraw();
if (_paramPointer == propertyValue) { if (m_widgetEntry == nullptr) {
markToRedraw(); EWOL_ERROR("Can not acces at entry ...");
if (m_widgetEntry == nullptr) { return;
EWOL_ERROR("Can not acces at entry ..."); }
return; for (auto &it : m_listElement) {
} if (it.m_value == propertyValue.get()) {
for (auto &it : m_listElement) { if (it.m_selected == false) {
if (it.m_value == propertyValue.get()) { it.m_selected = true;
if (it.m_selected == false) { m_widgetEntry->propertyValue.set(it.m_name);
it.m_selected = true; signalValue.emit(propertyValue.get());
m_widgetEntry->propertyValue.set(it.m_name);
signalValue.emit(propertyValue.get());
}
} else {
it.m_selected = false;
} }
} else {
it.m_selected = false;
} }
} }
} }

View File

@ -51,7 +51,6 @@ namespace ewol {
void optionClear(); void optionClear();
void optionAdd(int32_t _value, std::string _name); void optionAdd(int32_t _value, std::string _name);
protected: protected:
virtual void onPropertyChangeValue(const eproperty::Ref& _paramPointer);
virtual bool loadXML(const std::shared_ptr<const exml::Element>& _node); virtual bool loadXML(const std::shared_ptr<const exml::Element>& _node);
virtual void updateGui(); virtual void updateGui();
protected: protected:
@ -60,6 +59,8 @@ namespace ewol {
protected: protected:
esignal::Connection m_connectionEntry; esignal::Connection m_connectionEntry;
esignal::Connection m_connectionButton; esignal::Connection m_connectionButton;
protected:
virtual void onChangePropertyValue();
}; };
}; };
}; };

View File

@ -14,10 +14,20 @@
#define __class__ "Sizer" #define __class__ "Sizer"
ewol::widget::Sizer::Sizer() : ewol::widget::Sizer::Sizer() :
propertyMode(*this, "mode", modeHori, "The display mode"), propertyMode(this, "mode",
propertyBorderSize(*this, "border", vec2(0,0), "The sizer border size"), modeHori,
propertyAnimation(*this, "annimation", animationNone, "sizer annimation"), "The display mode",
propertyAnimationTime(*this, "annimation-time", 0, "time of the anniation") { &ewol::widget::Sizer::onChangePropertyMode),
propertyBorderSize(this, "border",
vec2(0,0),
"The sizer border size",
&ewol::widget::Sizer::onChangePropertyBorderSize),
propertyAnimation(this, "annimation",
animationNone,
"sizer annimation"),
propertyAnimationTime(this, "annimation-time",
0,
"time of the anniation") {
addObjectType("ewol::widget::Sizer"); addObjectType("ewol::widget::Sizer");
propertyMode.add(modeHori, "hori"); propertyMode.add(modeHori, "hori");
propertyMode.add(modeVert, "vert"); propertyMode.add(modeVert, "vert");
@ -286,13 +296,12 @@ void ewol::widget::Sizer::subWidgetUnLink(std::shared_ptr<ewol::Widget> _newWidg
ewol::widget::ContainerN::subWidgetUnLink(_newWidget); ewol::widget::ContainerN::subWidgetUnLink(_newWidget);
} }
void ewol::widget::Sizer::onPropertyChangeValue(const eproperty::Ref& _paramPointer) { void ewol::widget::Sizer::onChangePropertyMode() {
ewol::widget::ContainerN::onPropertyChangeValue(_paramPointer); markToRedraw();
if (_paramPointer == propertyMode) { requestUpdateSize();
markToRedraw(); }
requestUpdateSize();
} else if (_paramPointer == propertyBorderSize) { void ewol::widget::Sizer::onChangePropertyBorderSize() {
markToRedraw(); markToRedraw();
requestUpdateSize(); requestUpdateSize();
} }
}

View File

@ -64,7 +64,9 @@ namespace ewol {
virtual int32_t subWidgetAddStart(std::shared_ptr<ewol::Widget> _newWidget); virtual int32_t subWidgetAddStart(std::shared_ptr<ewol::Widget> _newWidget);
virtual void subWidgetRemove(std::shared_ptr<ewol::Widget> _newWidget); virtual void subWidgetRemove(std::shared_ptr<ewol::Widget> _newWidget);
virtual void subWidgetUnLink(std::shared_ptr<ewol::Widget> _newWidget); virtual void subWidgetUnLink(std::shared_ptr<ewol::Widget> _newWidget);
virtual void onPropertyChangeValue(const eproperty::Ref& _paramPointer); protected:
virtual void onChangePropertyMode();
virtual void onChangePropertyBorderSize();
}; };
} }
} }

View File

@ -16,11 +16,23 @@
const int32_t dotRadius = 6; const int32_t dotRadius = 6;
ewol::widget::Slider::Slider() : ewol::widget::Slider::Slider() :
signalChange(*this, "change"), signalChange(this, "change", ""),
propertyValue(*this, "value", 0.0f, "Value of the Slider"), propertyValue(this, "value",
propertyMinimum(*this, "min", 0.0f, "Minium value"), 0.0f,
propertyMaximum(*this, "max", 10.0f, "Maximum value"), "Value of the Slider",
propertyStep(*this, "step", 1.0f, "Step size") { &ewol::widget::Slider::onChangePropertyValue),
propertyMinimum(this, "min",
0.0f,
"Minium value",
&ewol::widget::Slider::onChangePropertyMinimum),
propertyMaximum(this, "max",
10.0f,
"Maximum value",
&ewol::widget::Slider::onChangePropertyMaximum),
propertyStep(this, "step",
1.0f,
"Step size",
&ewol::widget::Slider::onChangePropertyStep) {
addObjectType("ewol::widget::Slider"); addObjectType("ewol::widget::Slider");
m_textColorFg = etk::color::black; m_textColorFg = etk::color::black;
@ -104,25 +116,25 @@ void ewol::widget::Slider::updateValue(float _newValue) {
markToRedraw(); markToRedraw();
} }
// TODO : Review this really bad things ...
void ewol::widget::Slider::onPropertyChangeValue(const eproperty::Ref& _paramPointer) { void ewol::widget::Slider::onChangePropertyValue() {
ewol::Widget::onPropertyChangeValue(_paramPointer); updateValue(*propertyValue);
if (_paramPointer == propertyValue) { return;
updateValue(*propertyValue); }
return;
} void ewol::widget::Slider::onChangePropertyMinimum() {
if (_paramPointer == propertyMinimum) { updateValue(*propertyValue);
updateValue(*propertyValue); return;
return; }
}
if (_paramPointer == propertyMaximum) { void ewol::widget::Slider::onChangePropertyMaximum() {
updateValue(*propertyValue); updateValue(*propertyValue);
return; return;
} }
if (_paramPointer == propertyStep) {
updateValue(*propertyValue); void ewol::widget::Slider::onChangePropertyStep() {
return; updateValue(*propertyValue);
} return;
} }

View File

@ -49,7 +49,11 @@ namespace ewol {
virtual void calculateMinMaxSize(); virtual void calculateMinMaxSize();
virtual void onRegenerateDisplay(); virtual void onRegenerateDisplay();
virtual bool onEventInput(const ewol::event::Input& _event); virtual bool onEventInput(const ewol::event::Input& _event);
virtual void onPropertyChangeValue(const eproperty::Ref& _paramPointer); protected:
virtual void onChangePropertyValue();
virtual void onChangePropertyMinimum();
virtual void onChangePropertyMaximum();
virtual void onChangePropertyStep();
}; };
} }
} }

View File

@ -15,7 +15,10 @@
#define __class__ "Spacer" #define __class__ "Spacer"
ewol::widget::Spacer::Spacer() : ewol::widget::Spacer::Spacer() :
propertyColor(*this, "color", etk::color::none, "background of the spacer") { propertyColor(this, "color",
etk::color::none,
"background of the spacer",
&ewol::widget::Spacer::onChangePropertyColor) {
addObjectType("ewol::widget::Spacer"); addObjectType("ewol::widget::Spacer");
} }
@ -48,10 +51,7 @@ void ewol::widget::Spacer::onRegenerateDisplay() {
m_draw.rectangleWidth(vec3(m_size.x(), m_size.y(),0) ); m_draw.rectangleWidth(vec3(m_size.x(), m_size.y(),0) );
} }
void ewol::widget::Spacer::onPropertyChangeValue(const eproperty::Ref& _paramPointer) { void ewol::widget::Spacer::onChangePropertyColor() {
ewol::Widget::onPropertyChangeValue(_paramPointer); markToRedraw();
if (_paramPointer == propertyColor) {
markToRedraw();
}
} }

View File

@ -40,7 +40,8 @@ namespace ewol {
virtual std::shared_ptr<ewol::Widget> getWidgetAtPos(const vec2& _pos) { return nullptr; }; virtual std::shared_ptr<ewol::Widget> getWidgetAtPos(const vec2& _pos) { return nullptr; };
virtual void onRegenerateDisplay(); virtual void onRegenerateDisplay();
virtual void onDraw(); virtual void onDraw();
virtual void onPropertyChangeValue(const eproperty::Ref& _paramPointer); protected:
virtual void onChangePropertyColor();
}; };
} }
} }

View File

@ -16,13 +16,30 @@
#define __class__ "widget::Spin" #define __class__ "widget::Spin"
ewol::widget::Spin::Spin() : ewol::widget::Spin::Spin() :
signalValue(*this, "value", "Spin value change"), signalValue(this, "value",
signalValueDouble(*this, "valueDouble", "Spin value change value in 'double'"), "Spin value change"),
propertyValue(*this, "value", 0, "Value of the Spin"), signalValueDouble(this, "valueDouble",
propertyMin(*this, "min", -9999999999, "Minimum value of the spin"), "Spin value change value in 'double'"),
propertyMax(*this, "max", 9999999999, "Maximum value of the spin"), propertyValue(this, "value",
propertyIncrement(*this, "increment", 1, "Increment value at each button event or keybord event"), 0,
propertyMantis(*this, "mantis", 0, "fix-point mantis") { "Value of the Spin",
&ewol::widget::Spin::onChangePropertyValue),
propertyMin(this, "min",
-9999999999,
"Minimum value of the spin",
&ewol::widget::Spin::onChangePropertyMin),
propertyMax(this, "max",
9999999999,
"Maximum value of the spin",
&ewol::widget::Spin::onChangePropertyMax),
propertyIncrement(this, "increment",
1,
"Increment value at each button event or keybord event",
&ewol::widget::Spin::onChangePropertyIncrement),
propertyMantis(this, "mantis",
0,
"fix-point mantis",
&ewol::widget::Spin::onChangePropertyMantis) {
addObjectType("ewol::widget::Spin"); addObjectType("ewol::widget::Spin");
} }
@ -38,24 +55,29 @@ ewol::widget::Spin::~Spin() {
} }
void ewol::widget::Spin::onPropertyChangeValue(const eproperty::Ref& _paramPointer) { void ewol::widget::Spin::onChangePropertyValue() {
ewol::widget::SpinBase::onPropertyChangeValue(_paramPointer); markToRedraw();
if (_paramPointer == propertyValue) { if (m_widgetEntry == nullptr) {
markToRedraw(); EWOL_ERROR("Can not acces at entry ...");
if (m_widgetEntry == nullptr) { return;
EWOL_ERROR("Can not acces at entry ...");
return;
}
checkValue(*propertyValue);
} else if (_paramPointer == propertyMin) {
checkValue(*propertyValue);
} else if (_paramPointer == propertyMax) {
checkValue(*propertyValue);
} else if (_paramPointer == propertyIncrement) {
} else if (_paramPointer == propertyMantis) {
} }
checkValue(*propertyValue);
}
void ewol::widget::Spin::onChangePropertyMin() {
checkValue(*propertyValue);
}
void ewol::widget::Spin::onChangePropertyMax() {
checkValue(*propertyValue);
}
void ewol::widget::Spin::onChangePropertyIncrement() {
}
void ewol::widget::Spin::onChangePropertyMantis() {
} }
void ewol::widget::Spin::updateGui() { void ewol::widget::Spin::updateGui() {

View File

@ -45,7 +45,6 @@ namespace ewol {
virtual ~Spin(); virtual ~Spin();
protected: protected:
virtual void checkValue(int64_t _value); virtual void checkValue(int64_t _value);
virtual void onPropertyChangeValue(const eproperty::Ref& _paramPointer);
virtual void updateGui(); virtual void updateGui();
protected: protected:
void onCallbackUp(); void onCallbackUp();
@ -54,6 +53,12 @@ namespace ewol {
esignal::Connection m_connectionEntry; esignal::Connection m_connectionEntry;
esignal::Connection m_connectionButtonUp; esignal::Connection m_connectionButtonUp;
esignal::Connection m_connectionButtonDown; esignal::Connection m_connectionButtonDown;
protected:
virtual void onChangePropertyValue();
virtual void onChangePropertyMin();
virtual void onChangePropertyMax();
virtual void onChangePropertyIncrement();
virtual void onChangePropertyMantis();
}; };
}; };
}; };

View File

@ -24,11 +24,17 @@ std::ostream& operator <<(std::ostream& _os, const enum ewol::widget::WSlider::s
#define __class__ "WSlider" #define __class__ "WSlider"
ewol::widget::WSlider::WSlider() : ewol::widget::WSlider::WSlider() :
signalStartSlide(*this, "start"), signalStartSlide(this, "start", ""),
signalStopSlide(*this, "stop"), signalStopSlide(this, "stop", ""),
propertyTransitionSpeed(*this, "speed", 1.0f, 0.0f, 200.0f, "Transition speed of the slider"), propertyTransitionSpeed(this, "speed",
propertyTransitionMode(*this, "mode", sladingTransitionHori, "Transition mode of the slider"), 1.0f, 0.0f, 200.0f,
propertySelectWidget(*this, "select", "", "Select the requested widget to display"), "Transition speed of the slider",
&ewol::widget::WSlider::onChangePropertySelectWidget),
propertyTransitionMode(this, "mode",
sladingTransitionHori,
"Transition mode of the slider",
&ewol::widget::WSlider::onChangePropertyTransitionMode),
propertySelectWidget(this, "select", "", "Select the requested widget to display"),
m_windowsSources(0), m_windowsSources(0),
m_windowsDestination(0), m_windowsDestination(0),
m_windowsRequested(-1), m_windowsRequested(-1),
@ -272,19 +278,17 @@ void ewol::widget::WSlider::onRegenerateDisplay() {
} }
} }
void ewol::widget::WSlider::onPropertyChangeValue(const eproperty::Ref& _paramPointer) { void ewol::widget::WSlider::onChangePropertySelectWidget() {
ewol::widget::ContainerN::onPropertyChangeValue(_paramPointer); if (propertySelectWidget.get() != "") {
if (_paramPointer == propertySelectWidget) { subWidgetSelectSet(*propertySelectWidget);
if (propertySelectWidget.get() != "") {
subWidgetSelectSet(*propertySelectWidget);
}
} else if (_paramPointer == propertyTransitionSpeed) {
// nothing to do ...
} else if (_paramPointer == propertyTransitionMode) {
markToRedraw();
} }
} }
void ewol::widget::WSlider::onChangePropertyTransitionMode() {
markToRedraw();
}
std::shared_ptr<ewol::Widget> ewol::widget::WSlider::getWidgetAtPos(const vec2& _pos) { std::shared_ptr<ewol::Widget> ewol::widget::WSlider::getWidgetAtPos(const vec2& _pos) {
if (*propertyHide == true) { if (*propertyHide == true) {
return nullptr; return nullptr;

View File

@ -73,7 +73,9 @@ namespace ewol {
virtual void onRegenerateDisplay(); virtual void onRegenerateDisplay();
virtual std::shared_ptr<ewol::Widget> getWidgetAtPos(const vec2& _pos); virtual std::shared_ptr<ewol::Widget> getWidgetAtPos(const vec2& _pos);
virtual void periodicCall(const ewol::event::Time& _event); virtual void periodicCall(const ewol::event::Time& _event);
virtual void onPropertyChangeValue(const eproperty::Ref& _paramPointer); protected:
virtual void onChangePropertySelectWidget();
virtual void onChangePropertyTransitionMode();
}; };
} }
std::ostream& operator <<(std::ostream& _os, const enum ewol::widget::WSlider::sladingMode _obj); std::ostream& operator <<(std::ostream& _os, const enum ewol::widget::WSlider::sladingMode _obj);

View File

@ -18,13 +18,35 @@
#define __class__ "Widget" #define __class__ "Widget"
ewol::Widget::Widget() : ewol::Widget::Widget() :
propertyMinSize(*this, "min-size", gale::Dimension(vec2(0,0),gale::Dimension::Pixel), "User minimum size"), propertyMinSize(this, "min-size",
propertyMaxSize(*this, "max-size", gale::Dimension(vec2(ULTIMATE_MAX_SIZE,ULTIMATE_MAX_SIZE),gale::Dimension::Pixel), "User maximum size"), gale::Dimension(vec2(0,0),gale::Dimension::Pixel),
propertyExpand(*this, "expand", bvec2(false,false), "Request the widget Expand size wile space is available"), "User minimum size",
propertyFill(*this, "fill", bvec2(true,true), "Fill the widget available size"), &ewol::Widget::onChangePropertyMinSize),
propertyHide(*this, "hide", false, "The widget start hided"), propertyMaxSize(this, "max-size",
propertyGravity(*this, "gravity", ewol::gravity_buttomLeft, "Gravity orientation"), gale::Dimension(vec2(ULTIMATE_MAX_SIZE,ULTIMATE_MAX_SIZE),gale::Dimension::Pixel),
propertyCanFocus(*this, "focus", false, "enable the widget to have the focus capacity"), // TODO : je pense que c'est une erreur, c'st surement un event to get the cocus ... "User maximum size",
&ewol::Widget::onChangePropertyMaxSize),
propertyExpand(this, "expand",
bvec2(false,false),
"Request the widget Expand size wile space is available",
&ewol::Widget::onChangePropertyExpand),
propertyFill(this, "fill",
bvec2(true,true),
"Fill the widget available size",
&ewol::Widget::onChangePropertyFill),
propertyHide(this, "hide",
false,
"The widget start hided",
&ewol::Widget::onChangePropertyHide),
propertyGravity(this, "gravity",
ewol::gravity_buttomLeft,
"Gravity orientation",
&ewol::Widget::onChangePropertyGravity),
// TODO : je pense que c'est une erreur, c'est surement un event to get the cocus ...
propertyCanFocus(this, "focus",
false,
"enable the widget to have the focus capacity",
&ewol::Widget::onChangePropertyCanFocus),
m_size(10,10), m_size(10,10),
m_minSize(0,0), m_minSize(0,0),
m_maxSize(vec2(ULTIMATE_MAX_SIZE,ULTIMATE_MAX_SIZE)), m_maxSize(vec2(ULTIMATE_MAX_SIZE,ULTIMATE_MAX_SIZE)),
@ -34,19 +56,19 @@ ewol::Widget::Widget() :
m_hasFocus(false), m_hasFocus(false),
m_limitMouseEvent(3), m_limitMouseEvent(3),
m_allowRepeateKeyboardEvent(true), m_allowRepeateKeyboardEvent(true),
signalShortcut(*this, "shortcut"), signalShortcut(this, "shortcut", ""),
m_needRegenerateDisplay(true), m_needRegenerateDisplay(true),
m_grabCursor(false), m_grabCursor(false),
m_cursorDisplay(gale::context::cursor_arrow), m_cursorDisplay(gale::context::cursor_arrow),
signalAnnimationStart(*this, "annimation-start"), signalAnnimationStart(this, "annimation-start", ""),
signalAnnimationRatio(*this, "annimation-ratio"), signalAnnimationRatio(this, "annimation-ratio", ""),
signalAnnimationStop(*this, "annimation-stop"), signalAnnimationStop(this, "annimation-stop", ""),
m_annimationMode(annimationModeDisable), m_annimationMode(annimationModeDisable),
m_annimationratio(0.0f), m_annimationratio(0.0f),
propertyAnnimationTypeStart(*this, "annimation-start-type", 0, "Annimation type, when adding/show a widget"), propertyAnnimationTypeStart(this, "annimation-start-type", 0, "Annimation type, when adding/show a widget"),
propertyAnnimationTimeStart(*this, "annimation-start-time", 0.1f, 0.0f, 200.0f, "Annimation time in second, when adding/show a widget"), propertyAnnimationTimeStart(this, "annimation-start-time", 0.1f, 0.0f, 200.0f, "Annimation time in second, when adding/show a widget"),
propertyAnnimationTypeStop(*this, "annimation-stop-type", 0, "Annimation type, when removing/hide a widget"), propertyAnnimationTypeStop(this, "annimation-stop-type", 0, "Annimation type, when removing/hide a widget"),
propertyAnnimationTimeStop(*this, "annimation-stop-time", 0.1f, 0.0f, 200.0f, "Annimation time in second, when removing/hide a widget"){ propertyAnnimationTimeStop(this, "annimation-stop-time", 0.1f, 0.0f, 200.0f, "Annimation time in second, when removing/hide a widget"){
addObjectType("ewol::Widget"); addObjectType("ewol::Widget");
// TODO : Set a static interface for list ==> this methode create a multiple allocation // TODO : Set a static interface for list ==> this methode create a multiple allocation
@ -552,67 +574,68 @@ bool ewol::Widget::systemEventInput(ewol::event::InputSystem& _event) {
return onEventInput(_event.m_event); return onEventInput(_event.m_event);
} }
void ewol::Widget::onPropertyChangeValue(const eproperty::Ref& _paramPointer) { void ewol::Widget::onChangePropertyCanFocus() {
ewol::Object::onPropertyChangeValue(_paramPointer); if (m_hasFocus == true) {
if (_paramPointer == propertyCanFocus) { rmFocus();
if (m_hasFocus == true) {
rmFocus();
}
} else if (_paramPointer == propertyGravity) {
markToRedraw();
requestUpdateSize();
} else if (_paramPointer == propertyHide) {
markToRedraw();
requestUpdateSize();
} else if (_paramPointer == propertyFill) {
markToRedraw();
requestUpdateSize();
} else if (_paramPointer == propertyExpand) {
requestUpdateSize();
markToRedraw();
} else if (_paramPointer == propertyMaxSize) {
vec2 pixelMin = propertyMinSize->getPixel();
vec2 pixelMax = propertyMaxSize->getPixel();
// check minimum & maximum compatibility :
bool error=false;
if (pixelMin.x()>pixelMax.x()) {
error=true;
}
if (pixelMin.y()>pixelMax.y()) {
error=true;
}
if (error == true) {
EWOL_ERROR("Can not set a 'min size' > 'max size' reset to maximum ...");
propertyMaxSize.setDirect(gale::Dimension(vec2(ULTIMATE_MAX_SIZE,ULTIMATE_MAX_SIZE),gale::Dimension::Pixel));
}
requestUpdateSize();
} else if (_paramPointer == propertyMinSize) {
vec2 pixelMin = propertyMinSize->getPixel();
vec2 pixelMax = propertyMaxSize->getPixel();
// check minimum & maximum compatibility :
bool error=false;
if (pixelMin.x()>pixelMax.x()) {
error=true;
}
if (pixelMin.y()>pixelMax.y()) {
error=true;
}
if (error == true) {
EWOL_ERROR("Can not set a 'min size' > 'max size' set nothing ...");
propertyMinSize.setDirect(gale::Dimension(vec2(0,0),gale::Dimension::Pixel));
}
requestUpdateSize();
} else if (_paramPointer == propertyAnnimationTypeStart) {
} else if (_paramPointer == propertyAnnimationTimeStart) {
} else if (_paramPointer == propertyAnnimationTypeStop) {
} else if (_paramPointer == propertyAnnimationTimeStop) {
} }
} }
void ewol::Widget::onChangePropertyGravity() {
markToRedraw();
requestUpdateSize();
}
void ewol::Widget::onChangePropertyHide() {
markToRedraw();
requestUpdateSize();
}
void ewol::Widget::onChangePropertyFill() {
markToRedraw();
requestUpdateSize();
}
void ewol::Widget::onChangePropertyExpand() {
requestUpdateSize();
markToRedraw();
}
void ewol::Widget::onChangePropertyMaxSize() {
vec2 pixelMin = propertyMinSize->getPixel();
vec2 pixelMax = propertyMaxSize->getPixel();
// check minimum & maximum compatibility :
bool error=false;
if (pixelMin.x()>pixelMax.x()) {
error=true;
}
if (pixelMin.y()>pixelMax.y()) {
error=true;
}
if (error == true) {
EWOL_ERROR("Can not set a 'min size' > 'max size' reset to maximum ...");
propertyMaxSize.setDirect(gale::Dimension(vec2(ULTIMATE_MAX_SIZE,ULTIMATE_MAX_SIZE),gale::Dimension::Pixel));
}
requestUpdateSize();
}
void ewol::Widget::onChangePropertyMinSize() {
vec2 pixelMin = propertyMinSize->getPixel();
vec2 pixelMax = propertyMaxSize->getPixel();
// check minimum & maximum compatibility :
bool error=false;
if (pixelMin.x()>pixelMax.x()) {
error=true;
}
if (pixelMin.y()>pixelMax.y()) {
error=true;
}
if (error == true) {
EWOL_ERROR("Can not set a 'min size' > 'max size' set nothing ...");
propertyMinSize.setDirect(gale::Dimension(vec2(0,0),gale::Dimension::Pixel));
}
requestUpdateSize();
}
void ewol::Widget::requestUpdateSize() { void ewol::Widget::requestUpdateSize() {
getContext().requestUpdateSize(); getContext().requestUpdateSize();
} }

View File

@ -515,8 +515,6 @@ namespace ewol {
virtual enum gale::context::cursor getCursor(); virtual enum gale::context::cursor getCursor();
public: // Derived function public: // Derived function
virtual bool loadXML(const std::shared_ptr<const exml::Element>& _node); virtual bool loadXML(const std::shared_ptr<const exml::Element>& _node);
protected: // Derived function
virtual void onPropertyChangeValue(const eproperty::Ref& _paramPointer);
public: public:
/** /**
* @brief need to be call When the size of the current widget have change ==> this force the system to recalculate all the widget positions * @brief need to be call When the size of the current widget have change ==> this force the system to recalculate all the widget positions
@ -595,7 +593,14 @@ namespace ewol {
* @brief Event when Stop the annimation. * @brief Event when Stop the annimation.
*/ */
virtual void onStopAnnimation() { }; virtual void onStopAnnimation() { };
protected:
virtual void onChangePropertyCanFocus();
virtual void onChangePropertyGravity();
virtual void onChangePropertyHide();
virtual void onChangePropertyFill();
virtual void onChangePropertyExpand();
virtual void onChangePropertyMaxSize();
virtual void onChangePropertyMinSize();
}; };
}; };

View File

@ -13,11 +13,15 @@
#include <gale/renderer/openGL/openGL.h> #include <gale/renderer/openGL/openGL.h>
#include <ewol/ewol.h> #include <ewol/ewol.h>
ewol::widget::WidgetScrolled::WidgetScrolled() : ewol::widget::WidgetScrolled::WidgetScrolled() :
propertyShapeVert(*this, "shape-vert", "", "shape for the vertical display"), propertyShapeVert(this, "shape-vert",
propertyShapeHori(*this, "shape-hori", "", "shape for the horizonal display"), "",
"shape for the vertical display",
&ewol::widget::WidgetScrolled::onChangePropertyShapeVert),
propertyShapeHori(this, "shape-hori",
"",
"shape for the horizonal display",
&ewol::widget::WidgetScrolled::onChangePropertyShapeHori),
m_shaperH(), m_shaperH(),
m_shaperV(), m_shaperV(),
m_singleFingerMode(true) { m_singleFingerMode(true) {
@ -478,13 +482,12 @@ void ewol::widget::WidgetScrolled::setSingleFinger(bool _status) {
m_singleFingerMode = _status; m_singleFingerMode = _status;
} }
void ewol::widget::WidgetScrolled::onPropertyChangeValue(const eproperty::Ref& _paramPointer) { void ewol::widget::WidgetScrolled::onChangePropertyShapeVert() {
ewol::Widget::onPropertyChangeValue(_paramPointer); m_shaperV.setSource(propertyShapeVert);
if (_paramPointer == propertyShapeVert) { markToRedraw();
m_shaperV.setSource(propertyShapeVert); }
markToRedraw(); void ewol::widget::WidgetScrolled::onChangePropertyShapeHori() {
} else if (_paramPointer == propertyShapeHori) { m_shaperH.setSource(propertyShapeHori);
m_shaperH.setSource(propertyShapeHori); markToRedraw();
markToRedraw(); }
}
}

View File

@ -118,7 +118,9 @@ namespace ewol {
void setLimitScrolling(float _poucentageLimit) { void setLimitScrolling(float _poucentageLimit) {
m_limitScrolling = std::avg(0.1f, _poucentageLimit,0.9f); m_limitScrolling = std::avg(0.1f, _poucentageLimit,0.9f);
}; };
void onPropertyChangeValue(const eproperty::Ref& _paramPointer); protected:
virtual void onChangePropertyShapeVert();
virtual void onChangePropertyShapeHori();
}; };
} }
} }

View File

@ -22,12 +22,12 @@ extern "C" {
#undef __class__ #undef __class__
#define __class__ "ColorChooser" #define __class__ "ColorChooser"
static const char * const eventColorBarHasChange = "event-color-bar-has-change";
ewol::widget::ColorChooser::ColorChooser() : ewol::widget::ColorChooser::ColorChooser() :
signalChange(*this, "change"), signalChange(this, "change", ""),
propertyValue(*this, "value", etk::color::white, "color to select") { propertyValue(this, "value",
etk::color::white,
"color to select",
&ewol::widget::ColorChooser::onChangePropertyValue) {
addObjectType("ewol::widget::ColorChooser"); addObjectType("ewol::widget::ColorChooser");
} }
@ -84,24 +84,21 @@ ewol::widget::ColorChooser::~ColorChooser() {
} }
void ewol::widget::ColorChooser::onPropertyChangeValue(const eproperty::Ref& _paramPointer) { void ewol::widget::ColorChooser::onChangePropertyValue() {
ewol::widget::Sizer::onPropertyChangeValue(_paramPointer); if (m_widgetRed != nullptr) {
if (_paramPointer == propertyValue) { m_widgetRed->propertyValue.set(propertyValue->r());
if (m_widgetRed != nullptr) { }
m_widgetRed->propertyValue.set(propertyValue->r()); if (m_widgetGreen != nullptr) {
} m_widgetGreen->propertyValue.set(propertyValue->g());
if (m_widgetGreen != nullptr) { }
m_widgetGreen->propertyValue.set(propertyValue->g()); if (m_widgetBlue != nullptr) {
} m_widgetBlue->propertyValue.set(propertyValue->b());
if (m_widgetBlue != nullptr) { }
m_widgetBlue->propertyValue.set(propertyValue->b()); if (m_widgetAlpha != nullptr) {
} m_widgetAlpha->propertyValue.set(propertyValue->a());
if (m_widgetAlpha != nullptr) { }
m_widgetAlpha->propertyValue.set(propertyValue->a()); if (m_widgetColorBar != nullptr) {
} m_widgetColorBar->propertyValue.set(propertyValue);
if (m_widgetColorBar != nullptr) {
m_widgetColorBar->propertyValue.set(propertyValue);
}
} }
} }

View File

@ -45,7 +45,8 @@ namespace ewol {
void onCallbackColorChangeBlue(const float& _newColor); void onCallbackColorChangeBlue(const float& _newColor);
void onCallbackColorChangeAlpha(const float& _newColor); void onCallbackColorChangeAlpha(const float& _newColor);
void onCallbackColorChange(const etk::Color<>& _newColor); void onCallbackColorChange(const etk::Color<>& _newColor);
virtual void onPropertyChangeValue(const eproperty::Ref& _paramPointer); protected:
virtual void onChangePropertyValue();
}; };
}; };
}; };

View File

@ -33,15 +33,29 @@ extern "C" {
#undef __class__ #undef __class__
#define __class__ "FileChooser" #define __class__ "FileChooser"
ewol::widget::FileChooser::FileChooser() : ewol::widget::FileChooser::FileChooser() :
signalCancel(*this, "cancel"), signalCancel(this, "cancel", ""),
signalValidate(*this, "validate"), signalValidate(this, "validate", ""),
propertyPath(*this, "path", etk::getUserHomeFolder(), ""), propertyPath(this, "path",
propertyFile(*this, "file", "", ""), etk::getUserHomeFolder(),
propertyLabelTitle(*this, "title", "TRANSLATE:FileChooser", ""), "",
propertyLabelValidate(*this, "label-validate", "TRANSLATE:Validate", ""), &ewol::widget::FileChooser::onChangePropertyPath),
propertyLabelCancel(*this, "label-cancel", "TRANSLATE:Cancel", "") { propertyFile(this, "file",
"",
"",
&ewol::widget::FileChooser::onChangePropertyFile),
propertyLabelTitle(this, "title",
"TRANSLATE:FileChooser",
"",
&ewol::widget::FileChooser::onChangePropertyLabelTitle),
propertyLabelValidate(this, "label-validate",
"TRANSLATE:Validate",
"",
&ewol::widget::FileChooser::onChangePropertyLabelValidate),
propertyLabelCancel(this, "label-cancel",
"TRANSLATE:Cancel",
"",
&ewol::widget::FileChooser::onChangePropertyLabelCancel) {
addObjectType("ewol::widget::FileChooser"); addObjectType("ewol::widget::FileChooser");
} }
@ -124,21 +138,26 @@ ewol::widget::FileChooser::~FileChooser() {
} }
void ewol::widget::FileChooser::onPropertyChangeValue(const eproperty::Ref& _paramPointer) { void ewol::widget::FileChooser::onChangePropertyPath() {
ewol::widget::Composer::onPropertyChangeValue(_paramPointer); propertyPath.getDirect() = *propertyPath + "/";
if (_paramPointer == propertyPath) { updateCurrentFolder();
propertyPath.getDirect() = *propertyPath + "/"; }
updateCurrentFolder();
} else if (_paramPointer == propertyFile) { void ewol::widget::FileChooser::onChangePropertyFile() {
propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:entry-file", "value", propertyFile); propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:entry-file", "value", propertyFile);
updateCurrentFolder(); updateCurrentFolder();
} else if (_paramPointer == propertyLabelTitle) { }
propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:title-label", "value", TRANSLATE(propertyLabelTitle));
} else if (_paramPointer == propertyLabelValidate) { void ewol::widget::FileChooser::onChangePropertyLabelTitle() {
propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:validate-label", "value", TRANSLATE(propertyLabelValidate)); propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:title-label", "value", TRANSLATE(propertyLabelTitle));
} else if (_paramPointer == propertyLabelCancel) { }
propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:cancel-label", "value", TRANSLATE(propertyLabelCancel));
} void ewol::widget::FileChooser::onChangePropertyLabelValidate() {
propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:validate-label", "value", TRANSLATE(propertyLabelValidate));
}
void ewol::widget::FileChooser::onChangePropertyLabelCancel() {
propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:cancel-label", "value", TRANSLATE(propertyLabelCancel));
} }
void ewol::widget::FileChooser::onCallbackEntryFolderChangeValue(const std::string& _value) { void ewol::widget::FileChooser::onCallbackEntryFolderChangeValue(const std::string& _value) {

View File

@ -94,7 +94,12 @@ namespace ewol {
void onCallbackListFileValidate(const std::string& _value); void onCallbackListFileValidate(const std::string& _value);
void onCallbackListValidate(); void onCallbackListValidate();
void onCallbackHomePressed(); void onCallbackHomePressed();
virtual void onPropertyChangeValue(const eproperty::Ref& _paramPointer); protected:
virtual void onChangePropertyPath();
virtual void onChangePropertyFile();
virtual void onChangePropertyLabelTitle();
virtual void onChangePropertyLabelValidate();
virtual void onChangePropertyLabelCancel();
}; };
}; };
}; };

View File

@ -22,8 +22,11 @@
#define __class__ "Parameter" #define __class__ "Parameter"
ewol::widget::Parameter::Parameter() : ewol::widget::Parameter::Parameter() :
signalClose(*this, "close"), signalClose(this, "close", ""),
propertyLabelTitle(*this, "title", "TRANSLATE:Parameter", ""), propertyLabelTitle(this, "title",
"TRANSLATE:Parameter",
"Title of the parameter interface",
&ewol::widget::Parameter::onChangePropertyLabelTitle),
m_currentIdList(0), m_currentIdList(0),
m_widgetTitle(), m_widgetTitle(),
m_paramList() { m_paramList() {
@ -184,12 +187,10 @@ void ewol::widget::Parameter::init() {
ewol::widget::Parameter::~Parameter() { ewol::widget::Parameter::~Parameter() {
} }
void ewol::widget::Parameter::onPropertyChangeValue(const eproperty::Ref& _paramPointer) {
ewol::widget::PopUp::onPropertyChangeValue(_paramPointer); void ewol::widget::Parameter::onChangePropertyLabelTitle() {
if (_paramPointer == propertyLabelTitle) { if (m_widgetTitle != nullptr) {
if (m_widgetTitle != nullptr) { m_widgetTitle->propertyValue.set(TRANSLATE(propertyLabelTitle));
m_widgetTitle->propertyValue.set(TRANSLATE(propertyLabelTitle));
}
} }
} }

View File

@ -49,7 +49,8 @@ namespace ewol {
void onCallbackMenuclosed(); void onCallbackMenuclosed();
void onCallbackParameterSave(); void onCallbackParameterSave();
void onCallbackMenuSelected(const int32_t& _value); void onCallbackMenuSelected(const int32_t& _value);
virtual void onPropertyChangeValue(const eproperty::Ref& _paramPointer); protected:
virtual void onChangePropertyLabelTitle();
}; };
}; };
}; };

View File

@ -20,7 +20,7 @@
ewol::widget::ParameterList::ParameterList() : ewol::widget::ParameterList::ParameterList() :
signalSelect(*this, "select") { signalSelect(this, "select", "") {
addObjectType("ewol::widget::ParameterList"); addObjectType("ewol::widget::ParameterList");
m_idSelected = -1; m_idSelected = -1;

View File

@ -19,8 +19,14 @@ void ewol::widget::SpinBase::init(ewol::widget::Manager& _widgetManager) {
} }
ewol::widget::SpinBase::SpinBase() : ewol::widget::SpinBase::SpinBase() :
propertyShape(*this, "shape", "", "shape for the display"), propertyShape(this, "shape",
propertySpinMode(*this, "mode", ewol::widget::spinPosition_RightRight, "The display spin mode"), "",
"shape for the display",
&ewol::widget::SpinBase::onChangePropertyShape),
propertySpinMode(this, "mode",
ewol::widget::spinPosition_RightRight,
"The display spin mode",
&ewol::widget::SpinBase::onChangePropertySpinMode),
m_confIdEntryShaper(-1), m_confIdEntryShaper(-1),
m_confIdUpShaper(-1), m_confIdUpShaper(-1),
m_confIdDownShaper(-1), m_confIdDownShaper(-1),
@ -49,21 +55,20 @@ ewol::widget::SpinBase::~SpinBase() {
} }
void ewol::widget::SpinBase::onPropertyChangeValue(const eproperty::Ref& _paramPointer) { void ewol::widget::SpinBase::onChangePropertySpinMode() {
ewol::widget::Sizer::onPropertyChangeValue(_paramPointer); updateGui();
if (_paramPointer == propertySpinMode) { }
updateGui();
} else if (_paramPointer == propertyShape) { void ewol::widget::SpinBase::onChangePropertyShape() {
m_config = ewol::resource::ConfigFile::create(propertyShape); m_config = ewol::resource::ConfigFile::create(propertyShape);
if (m_config != nullptr) { if (m_config != nullptr) {
m_confIdEntryShaper = m_config->request("entry-shaper"); m_confIdEntryShaper = m_config->request("entry-shaper");
m_confIdUpShaper = m_config->request("up-shaper"); m_confIdUpShaper = m_config->request("up-shaper");
m_confIdDownShaper = m_config->request("down-shaper"); m_confIdDownShaper = m_config->request("down-shaper");
m_confIdUpData = m_config->request("up-data"); m_confIdUpData = m_config->request("up-data");
m_confIdDownData = m_config->request("down-data"); m_confIdDownData = m_config->request("down-data");
}
markToRedraw();
} }
markToRedraw();
} }

View File

@ -96,8 +96,10 @@ namespace ewol {
std::shared_ptr<ewol::widget::Button> m_widgetButtonUp; std::shared_ptr<ewol::widget::Button> m_widgetButtonUp;
virtual void updateGui(); virtual void updateGui();
public: // Derived function public: // Derived function
virtual void onPropertyChangeValue(const eproperty::Ref& _paramPointer);
virtual bool loadXML(const std::shared_ptr<const exml::Element>& _node); virtual bool loadXML(const std::shared_ptr<const exml::Element>& _node);
protected:
virtual void onChangePropertySpinMode();
virtual void onChangePropertyShape();
}; };
} }
} }