[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) :
m_context(_context),
periodicCall(*this, "periodic", "Call every time system render"),
periodicCall(this, "periodic", "Call every time system render"),
m_applWakeUpTime(0),
m_lastPeriodicCallTime(0) {
EWOL_DEBUG(" == > init Object-Manager");

View File

@ -46,7 +46,7 @@ void ewol::Object::removeParent() {
}
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_destroy(false),
m_static(false),

View File

@ -21,17 +21,17 @@ const static int32_t STATUS_PRESSED(1);
const static int32_t STATUS_DOWN(3);
ewol::widget::Button::Button() :
signalPressed(*this, "pressed", "Button is pressed"),
signalDown(*this, "down", "Button is DOWN"),
signalUp(*this, "up", "Button is UP"),
signalEnter(*this, "enter", "The cursor enter inside the button"),
signalLeave(*this, "leave", "the cursor leave the button"),
signalValue(*this, "value", "button value change"),
propertyShape(*this, "shaper", "", "The display name for config file"),
propertyValue(*this, "value", false, "Value of the Button"),
propertyLock(*this, "lock", lockNone, "Lock the button in a special state to permit changing state only by the coder"),
propertyToggleMode(*this, "toggle", false, "The Button can toogle"),
propertyEnableSingle(*this, "enable-single", false, "If one element set in the Button ==> display only set"),
signalPressed(this, "pressed", "Button is pressed"),
signalDown(this, "down", "Button is DOWN"),
signalUp(this, "up", "Button is UP"),
signalEnter(this, "enter", "The cursor enter inside the button"),
signalLeave(this, "leave", "the cursor leave the button"),
signalValue(this, "value", "button value change"),
propertyShape(this, "shaper", "", "The display name for config file", &ewol::widget::Button::onChangePropertyShape),
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", &ewol::widget::Button::onChangePropertyLock),
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", &ewol::widget::Button::onChangePropertyEnableSingle),
m_mouseHover(false),
m_buttonPressed(false),
m_selectableAreaPos(0,0),
@ -207,80 +207,84 @@ void ewol::widget::Button::periodicCall(const ewol::event::Time& _event) {
markToRedraw();
}
void ewol::widget::Button::onPropertyChangeValue(const eproperty::Ref& _paramPointer) {
ewol::widget::Container2::onPropertyChangeValue(_paramPointer);
if (_paramPointer == propertyShape) {
m_shaper.setSource(*propertyShape);
markToRedraw();
} else if (_paramPointer == propertyValue) {
if (*propertyToggleMode == true) {
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) {
void ewol::widget::Button::onChangePropertyShape() {
m_shaper.setSource(*propertyShape);
markToRedraw();
}
void ewol::widget::Button::onChangePropertyValue() {
if (*propertyToggleMode == true) {
if (*propertyValue == false) {
m_idWidgetDisplayed = 0;
} else {
if (*propertyValue == false) {
m_idWidgetDisplayed = 0;
} else {
m_idWidgetDisplayed = 1;
}
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;
}
}
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 == propertyEnableSingle) {
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;
}
}
CheckStatus();
markToRedraw();
}
void ewol::widget::Button::onChangePropertyLock() {
if(ewol::widget::Button::lockAccess == *propertyLock) {
m_buttonPressed = false;
m_mouseHover = false;
}
CheckStatus();
markToRedraw();
}
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();
protected: // Derived function
virtual void onDraw();
virtual void onPropertyChangeValue(const eproperty::Ref& _paramPointer);
public: // Derived function
virtual void calculateMinMaxSize();
virtual void onChangeSize();
@ -91,6 +90,12 @@ namespace ewol {
private: // derived function
virtual void periodicCall(const ewol::event::Time& _event);
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__
#define __class__ "ButtonColor"
static const char* const eventColorHasChange = "ewol-widget-ButtonColor-colorChange";
ewol::widget::ButtonColor::ButtonColor() :
signalChange(*this, "change", "Button color change value"),
propertyValue(*this, "color", etk::color::black, "Current color"),
propertyShape(*this, "shape", "", "shape of the widget"),
signalChange(this, "change", "Button color change value"),
propertyValue(this, "color", etk::color::black, "Current color", &ewol::widget::ButtonColor::onChangePropertyValue),
propertyShape(this, "shape", "", "shape of the widget", &ewol::widget::ButtonColor::onChangePropertyShape),
m_widgetContextMenu(nullptr) {
addObjectType("ewol::widget::ButtonColor");
changeStatusIn(STATUS_UP);
@ -222,13 +220,12 @@ void ewol::widget::ButtonColor::periodicCall(const ewol::event::Time& _event) {
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 onRegenerateDisplay();
virtual bool onEventInput(const ewol::event::Input& _event);
virtual void onPropertyChangeValue(const eproperty::Ref& _paramPointer);
private:
/**
* @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);
// Callback function:
void onCallbackColorChange(const etk::Color<>& _color);
protected:
virtual void onChangePropertyValue();
virtual void onChangePropertyShape();
};
};
};

View File

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

View File

@ -62,7 +62,6 @@ namespace ewol {
void CheckStatus();
protected: // Derived function
virtual void onDraw();
virtual void onPropertyChangeValue(const eproperty::Ref& _paramPointer);
public: // Derived function
virtual void calculateMinMaxSize();
virtual void onChangeSize();
@ -70,6 +69,9 @@ namespace ewol {
virtual bool onEventInput(const ewol::event::Input& _event);
virtual bool onEventEntry(const ewol::event::Entry& _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"
ewol::widget::ColorBar::ColorBar() :
signalChange(*this, "change", "Color value change"),
propertyValue(*this, "color", etk::color::black, "Current color") {
signalChange(this, "change", "Color value change"),
propertyValue(this, "color",
etk::color::black,
"Current color",
&ewol::widget::ColorBar::onChangePropertyValue) {
addObjectType("ewol::widget::ColorBar");
m_currentUserPos.setValue(0,0);
setMouseLimit(1);
@ -52,13 +55,10 @@ static etk::Color<> s_listColor[NB_BAND_COLOR+1] = {
etk::Color<>(0xFF, 0x00, 0x00, 0xFF)};
void ewol::widget::ColorBar::onPropertyChangeValue(const eproperty::Ref& _paramPointer) {
ewol::Widget::onPropertyChangeValue(_paramPointer);
if (_paramPointer == propertyValue) {
propertyValue.getDirect().setA(0xFF);
// estimate the cursor position:
EWOL_TODO("Later when really needed ...");
}
void ewol::widget::ColorBar::onChangePropertyValue() {
propertyValue.getDirect().setA(0xFF);
// estimate the cursor position:
EWOL_TODO("Later when really needed ...");
}
void ewol::widget::ColorBar::onDraw() {

View File

@ -37,7 +37,8 @@ namespace ewol {
virtual void calculateMinMaxSize();
virtual void onRegenerateDisplay();
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() :
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) {
addObjectType("ewol::widget::ContainerN");
// nothing to do ...
@ -47,12 +50,9 @@ bvec2 ewol::widget::ContainerN::canExpand() {
return res;
}
void ewol::widget::ContainerN::onPropertyChangeValue(const eproperty::Ref& _paramPointer) {
ewol::Widget::onPropertyChangeValue(_paramPointer);
if (_paramPointer == propertyLockExpand) {
markToRedraw();
requestUpdateSize();
}
void ewol::widget::ContainerN::onChangePropertyLockExpand() {
markToRedraw();
requestUpdateSize();
}
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 void setOffset(const vec2& _newVal);
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__
#define __class__ "ContextMenu"
ewol::widget::ContextMenu::ContextMenu():
propertyShape(*this, "shape", "", "the display name for config file"),
propertyArrowPos(*this, "arrow-position", vec2(0,0), "Position of the arrow in the pop-up"),
propertyArrawBorder(*this, "arrow-mode", markTop, "position of the arrow") {
propertyShape(this, "shape",
"",
"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");
propertyArrawBorder.add(markTop, "top");
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());
}
void ewol::widget::ContextMenu::onChangePropertyArrowPos() {
markToRedraw();
}
void ewol::widget::ContextMenu::onPropertyChangeValue(const eproperty::Ref& _paramPointer) {
ewol::widget::Container::onPropertyChangeValue(_paramPointer);
if (_paramPointer == propertyArrowPos) {
markToRedraw();
} else if (_paramPointer == propertyArrawBorder) {
markToRedraw();
} else if (_paramPointer == propertyShape) {
m_shaper.setSource(propertyShape.get());
markToRedraw();
}
void ewol::widget::ContextMenu::onChangePropertyArrawBorder() {
markToRedraw();
}
void ewol::widget::ContextMenu::onChangePropertyShape() {
m_shaper.setSource(propertyShape.get());
markToRedraw();
}

View File

@ -53,13 +53,16 @@ namespace ewol {
void setPositionMark(enum markPosition _position, const vec2& _arrowPos);
protected: // Derived function
virtual void onDraw();
virtual void onPropertyChangeValue(const eproperty::Ref& _paramPointer);
public: // Derived function
virtual void onRegenerateDisplay();
virtual bool onEventInput(const ewol::event::Input& _event);
virtual void onChangeSize();
virtual void calculateMinMaxSize();
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)
ewol::widget::Entry::Entry() :
signalClick(*this, "click", "the user Click on the Entry box"),
signalEnter(*this, "enter", "The cursor enter inside the button"),
signalModify(*this, "modify", "Entry box value change"),
propertyShaper(*this, "shaper", "", "Shaper to display the background"),
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"),
propertyRegex(*this, "regex", ".*", "Control what it is write with a regular expression"),
propertyTextWhenNothing(*this, "empty-text", "", "Text when nothing is written"),
signalClick(this, "click", "the user Click on the Entry box"),
signalEnter(this, "enter", "The cursor enter inside the button"),
signalModify(this, "modify", "Entry box value change"),
propertyShaper(this, "shaper",
"",
"Shaper to display the background",
&ewol::widget::Entry::onChangePropertyShaper),
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_displayStartPosition(0),
m_displayCursor(false),
@ -541,40 +556,44 @@ void ewol::widget::Entry::periodicCall(const ewol::event::Time& _event) {
markToRedraw();
}
void ewol::widget::Entry::onPropertyChangeValue(const eproperty::Ref& _paramPointer) {
ewol::Widget::onPropertyChangeValue(_paramPointer);
if (_paramPointer == propertyShaper) {
m_shaper.setSource(propertyShaper.get());
m_colorIdTextFg = m_shaper.requestColor("text-foreground");
m_colorIdTextBg = m_shaper.requestColor("text-background");
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::onChangePropertyShaper() {
m_shaper.setSource(propertyShaper.get());
m_colorIdTextFg = m_shaper.requestColor("text-foreground");
m_colorIdTextBg = m_shaper.requestColor("text-background");
m_colorIdCursor = m_shaper.requestColor("text-cursor");
m_colorIdSelection = m_shaper.requestColor("text-selection");
}
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 changeStatusIn(int32_t _newStatusId);
virtual void periodicCall(const ewol::event::Time& _event);
virtual void onPropertyChangeValue(const eproperty::Ref& _paramPointer);
private: // callback functions
void onCallbackShortCut(const std::string& _value);
void onCallbackEntryClean();
@ -123,6 +122,12 @@ namespace ewol {
void onCallbackCopy();
void onCallbackPaste();
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/ewol.h>
#undef __class__
#define __class__ "Image"
ewol::widget::Image::Image() :
signalPressed(*this, "pressed", "Image is pressed"),
propertySource(*this, "src", "", "Image source path"),
propertyBorder(*this, "border", vec2(0,0), "Border of the image"),
propertyImageSize(*this, "size", vec2(0,0), "Basic display size of the image"),
propertyKeepRatio(*this, "ratio", true, "Keep ratio of 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"),
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"),
propertyDistanceFieldMode(*this, "distance-field", false, "Distance field mode"),
propertySmooth(*this, "smooth", true, "Smooth display of the image"),
signalPressed(this, "pressed", "Image is pressed"),
propertySource(this, "src", "", "Image source path", &ewol::widget::Image::onChangePropertySource),
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", &ewol::widget::Image::onChangePropertyGlobalSize),
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", &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", &ewol::widget::Image::onChangePropertyGlobalSize),
propertyDistanceFieldMode(this, "distance-field", false, "Distance field mode", &ewol::widget::Image::onChangePropertyDistanceFieldMode),
propertySmooth(this, "smooth", true, "Smooth display of the image", &ewol::widget::Image::onChangePropertySmooth),
m_colorProperty(nullptr),
m_colorId(-1) {
addObjectType("ewol::widget::Image");
@ -195,26 +194,31 @@ bool ewol::widget::Image::loadXML(const std::shared_ptr<const exml::Element>& _n
return true;
}
void ewol::widget::Image::onPropertyChangeValue(const eproperty::Ref& _paramPointer) {
ewol::Widget::onPropertyChangeValue(_paramPointer);
if ( _paramPointer == propertySource
|| _paramPointer == propertyImageSize) {
markToRedraw();
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::onChangePropertySource() {
markToRedraw();
requestUpdateSize();
EWOL_VERBOSE("Set sources : " << *propertySource << " size=" << *propertyImageSize);
m_compositing.setSource(*propertySource, propertyImageSize->getPixel());
}
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
protected: // Derived function
virtual void onDraw();
virtual void onPropertyChangeValue(const eproperty::Ref& _paramPointer);
public: // Derived function
virtual void calculateMinMaxSize();
virtual void onRegenerateDisplay();
virtual bool onEventInput(const ewol::event::Input& _event);
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"
ewol::widget::Joystick::Joystick() :
signalEnable(*this, "enable"),
signalDisable(*this, "disable"),
signalMove(*this, "move") {
signalEnable(this, "enable", ""),
signalDisable(this, "disable", ""),
signalMove(this, "move", "") {
addObjectType("ewol::widget::Joystick");
// by default the joy does not lock when free out
m_lock = false;

View File

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

View File

@ -46,12 +46,13 @@ namespace ewol {
virtual ~Label();
protected: // Derived function
virtual void onDraw();
virtual void onPropertyChangeValue(const eproperty::Ref& _paramPointer);
public: // Derived function
virtual void calculateMinMaxSize();
virtual void onRegenerateDisplay();
virtual bool onEventInput(const ewol::event::Input& _event);
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 <etk/tool.h>
#include <etk/os/FSNode.h>
#undef __class__
#define __class__ "ListFileSystem"
ewol::widget::ListFileSystem::ListFileSystem() :
signalFileSelect(*this, "file-select"),
signalFileValidate(*this, "file-validate"),
signalFolderSelect(*this, "folder-select"),
signalFolderValidate(*this, "folder-validate"),
propertyPath(*this, "path", "/", "Path to display"),
propertyFile(*this, "select", "", "selection af a specific file"),
propertyShowFile(*this, "show-file", true, "display files"),
propertyShowFolder(*this, "show-folder", true, "display folders"),
propertyShowHidden(*this, "show-hidden", true, "Show the hidden element (file, folder, ...)"),
propertyFilter(*this, "filter", "", "regex to filter files ..."),
signalFileSelect(this, "file-select", ""),
signalFileValidate(this, "file-validate", ""),
signalFolderSelect(this, "folder-select", ""),
signalFolderValidate(this, "folder-validate", ""),
propertyPath(this, "path",
"/",
"Path to display",
&ewol::widget::ListFileSystem::onChangePropertyPath),
propertyFile(this, "select",
"",
"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) {
addObjectType("ewol::widget::ListFileSystem");
#if defined(__TARGET_OS__Windows)
@ -239,20 +255,27 @@ bool ewol::widget::ListFileSystem::onItemEvent(int32_t _IdInput,
return false;
}
void ewol::widget::ListFileSystem::onPropertyChangeValue(const eproperty::Ref& _paramPointer) {
ewol::widget::List::onPropertyChangeValue(_paramPointer);
if (_paramPointer == propertyPath) {
regenerateView();
} else if (_paramPointer == propertyFile) {
setSelect(propertyFile);
} else if (_paramPointer == propertyShowFile) {
regenerateView();
} else if (_paramPointer == propertyShowFolder) {
regenerateView();
} else if (_paramPointer == propertyShowHidden) {
regenerateView();
} else if (_paramPointer == propertyFilter) {
regenerateView();
}
void ewol::widget::ListFileSystem::onChangePropertyPath() {
regenerateView();
}
void ewol::widget::ListFileSystem::onChangePropertyFile() {
setSelect(propertyFile);
}
void ewol::widget::ListFileSystem::onChangePropertyShowFile() {
regenerateView();
}
void ewol::widget::ListFileSystem::onChangePropertyShowFolder() {
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.
*/
std::string getSelect() const ;
public: // glocal derived functions
virtual void onPropertyChangeValue(const eproperty::Ref& _paramPointer);
protected:
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"
ewol::widget::Menu::Menu() :
signalSelect(*this, "select") {
signalSelect(this, "select", "") {
addObjectType("ewol::widget::Menu");
m_staticId = 666;
}

View File

@ -18,9 +18,17 @@
static const char* annimationIncrease = "increase";
ewol::widget::PopUp::PopUp() :
propertyShape(*this, "shaper", "", "The shaper properties"),
propertyLockExpand(*this, "lock", bvec2(true,true), "Lock expand contamination"),
propertyCloseOutEvent(*this, "out-click-remove", false, "Remove the widget if the use click outside") {
propertyShape(this, "shaper",
"",
"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");
// Add annimations :
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());
}
void ewol::widget::PopUp::onPropertyChangeValue(const eproperty::Ref& _paramPointer) {
ewol::widget::Container::onPropertyChangeValue(_paramPointer);
if (_paramPointer == propertyShape) {
m_shaper.setSource(*propertyShape);
markToRedraw();
requestUpdateSize();
} else if (_paramPointer == propertyLockExpand) {
markToRedraw();
requestUpdateSize();
} else if (_paramPointer == propertyCloseOutEvent) {
// nothing to do ...
}
void ewol::widget::PopUp::onChangePropertyShape() {
m_shaper.setSource(*propertyShape);
markToRedraw();
requestUpdateSize();
}
void ewol::widget::PopUp::onChangePropertyLockExpand() {
markToRedraw();
requestUpdateSize();
}
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.
protected: // Derived function
virtual void onDraw();
virtual void onPropertyChangeValue(const eproperty::Ref& _paramPointer);
public: // Derived function
virtual void periodicCall(const ewol::event::Time& _event);
virtual void systemDraw(const ewol::DrawProperty& _displayProp);
@ -53,6 +52,9 @@ namespace ewol {
protected:
virtual bool onStartAnnimation(enum ewol::Widget::annimationMode _mode);
virtual void onStopAnnimation();
protected:
virtual void onChangePropertyShape();
virtual void onChangePropertyLockExpand();
};
};
};

View File

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

View File

@ -24,7 +24,7 @@ namespace ewol {
eproperty::Range<float> propertyValue; //!< % used
eproperty::Value<etk::Color<>> propertyTextColorFg; //!< forder bar color
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:
ProgressBar();
void init();
@ -35,10 +35,14 @@ namespace ewol {
ewol::compositing::Drawing m_draw; // basic drawing element
protected: // Derived function
virtual void onDraw();
virtual void onPropertyChangeValue(const eproperty::Ref& _paramPointer);
public: // Derived function
virtual void onRegenerateDisplay();
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"
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"),
propertyShapeVert(*this, "shape-vert", "", "shape for the vertical display"),
propertyShapeHori(*this, "shape-hori", "", "shape for the horizonal display"),
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",
&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_highSpeedStartPos(0,0),
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());;
}
void ewol::widget::Scroll::onPropertyChangeValue(const eproperty::Ref& _paramPointer) {
ewol::widget::Container::onPropertyChangeValue(_paramPointer);
if (_paramPointer == propertyLimit) {
markToRedraw();
} else if (_paramPointer == propertyShapeVert) {
m_shaperV.setSource(propertyShapeVert);
markToRedraw();
} else if (_paramPointer == propertyShapeHori) {
m_shaperH.setSource(propertyShapeHori);
markToRedraw();
}
void ewol::widget::Scroll::onChangePropertyLimit() {
markToRedraw();
}
void ewol::widget::Scroll::onChangePropertyShapeVert() {
m_shaperV.setSource(propertyShapeVert);
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);
protected: // Derived function
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() :
signalValue(*this, "value", "Select value change"),
propertyValue(*this, "value", -1, "Value of the Select") {
signalValue(this, "value", "Select value change"),
propertyValue(this, "value",
-1,
"Value of the Select",
&ewol::widget::Select::onChangePropertyValue) {
addObjectType("ewol::widget::Select");
}
@ -44,24 +47,21 @@ ewol::widget::Select::~Select() {
}
void ewol::widget::Select::onPropertyChangeValue(const eproperty::Ref& _paramPointer) {
ewol::widget::SpinBase::onPropertyChangeValue(_paramPointer);
if (_paramPointer == propertyValue) {
markToRedraw();
if (m_widgetEntry == nullptr) {
EWOL_ERROR("Can not acces at entry ...");
return;
}
for (auto &it : m_listElement) {
if (it.m_value == propertyValue.get()) {
if (it.m_selected == false) {
it.m_selected = true;
m_widgetEntry->propertyValue.set(it.m_name);
signalValue.emit(propertyValue.get());
}
} else {
it.m_selected = false;
void ewol::widget::Select::onChangePropertyValue() {
markToRedraw();
if (m_widgetEntry == nullptr) {
EWOL_ERROR("Can not acces at entry ...");
return;
}
for (auto &it : m_listElement) {
if (it.m_value == propertyValue.get()) {
if (it.m_selected == false) {
it.m_selected = true;
m_widgetEntry->propertyValue.set(it.m_name);
signalValue.emit(propertyValue.get());
}
} else {
it.m_selected = false;
}
}
}

View File

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

View File

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

View File

@ -64,7 +64,9 @@ namespace ewol {
virtual int32_t subWidgetAddStart(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 onPropertyChangeValue(const eproperty::Ref& _paramPointer);
protected:
virtual void onChangePropertyMode();
virtual void onChangePropertyBorderSize();
};
}
}

View File

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

View File

@ -49,7 +49,11 @@ namespace ewol {
virtual void calculateMinMaxSize();
virtual void onRegenerateDisplay();
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"
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");
}
@ -48,10 +51,7 @@ void ewol::widget::Spacer::onRegenerateDisplay() {
m_draw.rectangleWidth(vec3(m_size.x(), m_size.y(),0) );
}
void ewol::widget::Spacer::onPropertyChangeValue(const eproperty::Ref& _paramPointer) {
ewol::Widget::onPropertyChangeValue(_paramPointer);
if (_paramPointer == propertyColor) {
markToRedraw();
}
void ewol::widget::Spacer::onChangePropertyColor() {
markToRedraw();
}

View File

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

View File

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

View File

@ -45,7 +45,6 @@ namespace ewol {
virtual ~Spin();
protected:
virtual void checkValue(int64_t _value);
virtual void onPropertyChangeValue(const eproperty::Ref& _paramPointer);
virtual void updateGui();
protected:
void onCallbackUp();
@ -54,6 +53,12 @@ namespace ewol {
esignal::Connection m_connectionEntry;
esignal::Connection m_connectionButtonUp;
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"
ewol::widget::WSlider::WSlider() :
signalStartSlide(*this, "start"),
signalStopSlide(*this, "stop"),
propertyTransitionSpeed(*this, "speed", 1.0f, 0.0f, 200.0f, "Transition speed of the slider"),
propertyTransitionMode(*this, "mode", sladingTransitionHori, "Transition mode of the slider"),
propertySelectWidget(*this, "select", "", "Select the requested widget to display"),
signalStartSlide(this, "start", ""),
signalStopSlide(this, "stop", ""),
propertyTransitionSpeed(this, "speed",
1.0f, 0.0f, 200.0f,
"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_windowsDestination(0),
m_windowsRequested(-1),
@ -272,19 +278,17 @@ void ewol::widget::WSlider::onRegenerateDisplay() {
}
}
void ewol::widget::WSlider::onPropertyChangeValue(const eproperty::Ref& _paramPointer) {
ewol::widget::ContainerN::onPropertyChangeValue(_paramPointer);
if (_paramPointer == propertySelectWidget) {
if (propertySelectWidget.get() != "") {
subWidgetSelectSet(*propertySelectWidget);
}
} else if (_paramPointer == propertyTransitionSpeed) {
// nothing to do ...
} else if (_paramPointer == propertyTransitionMode) {
markToRedraw();
void ewol::widget::WSlider::onChangePropertySelectWidget() {
if (propertySelectWidget.get() != "") {
subWidgetSelectSet(*propertySelectWidget);
}
}
void ewol::widget::WSlider::onChangePropertyTransitionMode() {
markToRedraw();
}
std::shared_ptr<ewol::Widget> ewol::widget::WSlider::getWidgetAtPos(const vec2& _pos) {
if (*propertyHide == true) {
return nullptr;

View File

@ -73,7 +73,9 @@ namespace ewol {
virtual void onRegenerateDisplay();
virtual std::shared_ptr<ewol::Widget> getWidgetAtPos(const vec2& _pos);
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);

View File

@ -18,13 +18,35 @@
#define __class__ "Widget"
ewol::Widget::Widget() :
propertyMinSize(*this, "min-size", gale::Dimension(vec2(0,0),gale::Dimension::Pixel), "User minimum size"),
propertyMaxSize(*this, "max-size", gale::Dimension(vec2(ULTIMATE_MAX_SIZE,ULTIMATE_MAX_SIZE),gale::Dimension::Pixel), "User maximum size"),
propertyExpand(*this, "expand", bvec2(false,false), "Request the widget Expand size wile space is available"),
propertyFill(*this, "fill", bvec2(true,true), "Fill the widget available size"),
propertyHide(*this, "hide", false, "The widget start hided"),
propertyGravity(*this, "gravity", ewol::gravity_buttomLeft, "Gravity orientation"),
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 ...
propertyMinSize(this, "min-size",
gale::Dimension(vec2(0,0),gale::Dimension::Pixel),
"User minimum size",
&ewol::Widget::onChangePropertyMinSize),
propertyMaxSize(this, "max-size",
gale::Dimension(vec2(ULTIMATE_MAX_SIZE,ULTIMATE_MAX_SIZE),gale::Dimension::Pixel),
"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_minSize(0,0),
m_maxSize(vec2(ULTIMATE_MAX_SIZE,ULTIMATE_MAX_SIZE)),
@ -34,19 +56,19 @@ ewol::Widget::Widget() :
m_hasFocus(false),
m_limitMouseEvent(3),
m_allowRepeateKeyboardEvent(true),
signalShortcut(*this, "shortcut"),
signalShortcut(this, "shortcut", ""),
m_needRegenerateDisplay(true),
m_grabCursor(false),
m_cursorDisplay(gale::context::cursor_arrow),
signalAnnimationStart(*this, "annimation-start"),
signalAnnimationRatio(*this, "annimation-ratio"),
signalAnnimationStop(*this, "annimation-stop"),
signalAnnimationStart(this, "annimation-start", ""),
signalAnnimationRatio(this, "annimation-ratio", ""),
signalAnnimationStop(this, "annimation-stop", ""),
m_annimationMode(annimationModeDisable),
m_annimationratio(0.0f),
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"),
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"){
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"),
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"){
addObjectType("ewol::Widget");
// 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);
}
void ewol::Widget::onPropertyChangeValue(const eproperty::Ref& _paramPointer) {
ewol::Object::onPropertyChangeValue(_paramPointer);
if (_paramPointer == propertyCanFocus) {
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::onChangePropertyCanFocus() {
if (m_hasFocus == true) {
rmFocus();
}
}
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() {
getContext().requestUpdateSize();
}

View File

@ -515,8 +515,6 @@ namespace ewol {
virtual enum gale::context::cursor getCursor();
public: // Derived function
virtual bool loadXML(const std::shared_ptr<const exml::Element>& _node);
protected: // Derived function
virtual void onPropertyChangeValue(const eproperty::Ref& _paramPointer);
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
@ -595,7 +593,14 @@ namespace ewol {
* @brief Event when Stop the annimation.
*/
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 <ewol/ewol.h>
ewol::widget::WidgetScrolled::WidgetScrolled() :
propertyShapeVert(*this, "shape-vert", "", "shape for the vertical display"),
propertyShapeHori(*this, "shape-hori", "", "shape for the horizonal display"),
propertyShapeVert(this, "shape-vert",
"",
"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_shaperV(),
m_singleFingerMode(true) {
@ -478,13 +482,12 @@ void ewol::widget::WidgetScrolled::setSingleFinger(bool _status) {
m_singleFingerMode = _status;
}
void ewol::widget::WidgetScrolled::onPropertyChangeValue(const eproperty::Ref& _paramPointer) {
ewol::Widget::onPropertyChangeValue(_paramPointer);
if (_paramPointer == propertyShapeVert) {
m_shaperV.setSource(propertyShapeVert);
markToRedraw();
} else if (_paramPointer == propertyShapeHori) {
m_shaperH.setSource(propertyShapeHori);
markToRedraw();
}
}
void ewol::widget::WidgetScrolled::onChangePropertyShapeVert() {
m_shaperV.setSource(propertyShapeVert);
markToRedraw();
}
void ewol::widget::WidgetScrolled::onChangePropertyShapeHori() {
m_shaperH.setSource(propertyShapeHori);
markToRedraw();
}

View File

@ -118,7 +118,9 @@ namespace ewol {
void setLimitScrolling(float _poucentageLimit) {
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__
#define __class__ "ColorChooser"
static const char * const eventColorBarHasChange = "event-color-bar-has-change";
ewol::widget::ColorChooser::ColorChooser() :
signalChange(*this, "change"),
propertyValue(*this, "value", etk::color::white, "color to select") {
signalChange(this, "change", ""),
propertyValue(this, "value",
etk::color::white,
"color to select",
&ewol::widget::ColorChooser::onChangePropertyValue) {
addObjectType("ewol::widget::ColorChooser");
}
@ -84,24 +84,21 @@ ewol::widget::ColorChooser::~ColorChooser() {
}
void ewol::widget::ColorChooser::onPropertyChangeValue(const eproperty::Ref& _paramPointer) {
ewol::widget::Sizer::onPropertyChangeValue(_paramPointer);
if (_paramPointer == propertyValue) {
if (m_widgetRed != nullptr) {
m_widgetRed->propertyValue.set(propertyValue->r());
}
if (m_widgetGreen != nullptr) {
m_widgetGreen->propertyValue.set(propertyValue->g());
}
if (m_widgetBlue != nullptr) {
m_widgetBlue->propertyValue.set(propertyValue->b());
}
if (m_widgetAlpha != nullptr) {
m_widgetAlpha->propertyValue.set(propertyValue->a());
}
if (m_widgetColorBar != nullptr) {
m_widgetColorBar->propertyValue.set(propertyValue);
}
void ewol::widget::ColorChooser::onChangePropertyValue() {
if (m_widgetRed != nullptr) {
m_widgetRed->propertyValue.set(propertyValue->r());
}
if (m_widgetGreen != nullptr) {
m_widgetGreen->propertyValue.set(propertyValue->g());
}
if (m_widgetBlue != nullptr) {
m_widgetBlue->propertyValue.set(propertyValue->b());
}
if (m_widgetAlpha != nullptr) {
m_widgetAlpha->propertyValue.set(propertyValue->a());
}
if (m_widgetColorBar != nullptr) {
m_widgetColorBar->propertyValue.set(propertyValue);
}
}

View File

@ -45,7 +45,8 @@ namespace ewol {
void onCallbackColorChangeBlue(const float& _newColor);
void onCallbackColorChangeAlpha(const float& _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__
#define __class__ "FileChooser"
ewol::widget::FileChooser::FileChooser() :
signalCancel(*this, "cancel"),
signalValidate(*this, "validate"),
propertyPath(*this, "path", etk::getUserHomeFolder(), ""),
propertyFile(*this, "file", "", ""),
propertyLabelTitle(*this, "title", "TRANSLATE:FileChooser", ""),
propertyLabelValidate(*this, "label-validate", "TRANSLATE:Validate", ""),
propertyLabelCancel(*this, "label-cancel", "TRANSLATE:Cancel", "") {
signalCancel(this, "cancel", ""),
signalValidate(this, "validate", ""),
propertyPath(this, "path",
etk::getUserHomeFolder(),
"",
&ewol::widget::FileChooser::onChangePropertyPath),
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");
}
@ -124,21 +138,26 @@ ewol::widget::FileChooser::~FileChooser() {
}
void ewol::widget::FileChooser::onPropertyChangeValue(const eproperty::Ref& _paramPointer) {
ewol::widget::Composer::onPropertyChangeValue(_paramPointer);
if (_paramPointer == propertyPath) {
propertyPath.getDirect() = *propertyPath + "/";
updateCurrentFolder();
} else if (_paramPointer == propertyFile) {
propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:entry-file", "value", propertyFile);
updateCurrentFolder();
} else if (_paramPointer == propertyLabelTitle) {
propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:title-label", "value", TRANSLATE(propertyLabelTitle));
} else if (_paramPointer == propertyLabelValidate) {
propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:validate-label", "value", TRANSLATE(propertyLabelValidate));
} else if (_paramPointer == propertyLabelCancel) {
propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:cancel-label", "value", TRANSLATE(propertyLabelCancel));
}
void ewol::widget::FileChooser::onChangePropertyPath() {
propertyPath.getDirect() = *propertyPath + "/";
updateCurrentFolder();
}
void ewol::widget::FileChooser::onChangePropertyFile() {
propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:entry-file", "value", propertyFile);
updateCurrentFolder();
}
void ewol::widget::FileChooser::onChangePropertyLabelTitle() {
propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:title-label", "value", TRANSLATE(propertyLabelTitle));
}
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) {

View File

@ -94,7 +94,12 @@ namespace ewol {
void onCallbackListFileValidate(const std::string& _value);
void onCallbackListValidate();
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"
ewol::widget::Parameter::Parameter() :
signalClose(*this, "close"),
propertyLabelTitle(*this, "title", "TRANSLATE:Parameter", ""),
signalClose(this, "close", ""),
propertyLabelTitle(this, "title",
"TRANSLATE:Parameter",
"Title of the parameter interface",
&ewol::widget::Parameter::onChangePropertyLabelTitle),
m_currentIdList(0),
m_widgetTitle(),
m_paramList() {
@ -184,12 +187,10 @@ void ewol::widget::Parameter::init() {
ewol::widget::Parameter::~Parameter() {
}
void ewol::widget::Parameter::onPropertyChangeValue(const eproperty::Ref& _paramPointer) {
ewol::widget::PopUp::onPropertyChangeValue(_paramPointer);
if (_paramPointer == propertyLabelTitle) {
if (m_widgetTitle != nullptr) {
m_widgetTitle->propertyValue.set(TRANSLATE(propertyLabelTitle));
}
void ewol::widget::Parameter::onChangePropertyLabelTitle() {
if (m_widgetTitle != nullptr) {
m_widgetTitle->propertyValue.set(TRANSLATE(propertyLabelTitle));
}
}

View File

@ -49,7 +49,8 @@ namespace ewol {
void onCallbackMenuclosed();
void onCallbackParameterSave();
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() :
signalSelect(*this, "select") {
signalSelect(this, "select", "") {
addObjectType("ewol::widget::ParameterList");
m_idSelected = -1;

View File

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

View File

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