[DEV] simplify factory
This commit is contained in:
parent
d1caa7cb3b
commit
9371f59962
@ -68,16 +68,6 @@ void ewol::Object::init() {
|
||||
m_objectHasBeenInit = true;
|
||||
}
|
||||
|
||||
void ewol::Object::init(const std::unordered_map<std::string,eproperty::Variant>& _listProperty) {
|
||||
init();
|
||||
// TODO ...
|
||||
}
|
||||
|
||||
void ewol::Object::init(const std::string& _name) {
|
||||
init();
|
||||
propertyName.set(_name);
|
||||
}
|
||||
|
||||
const char * const ewol::Object::getObjectType() {
|
||||
if (m_listType.size() == 0) {
|
||||
return "ewol::Object";
|
||||
|
@ -19,7 +19,6 @@
|
||||
#include <eproperty/Value.h>
|
||||
#include <eproperty/Range.h>
|
||||
#include <eproperty/List.h>
|
||||
#include <eproperty/Variant.h>
|
||||
#include <esignal/Interface.h>
|
||||
|
||||
namespace ewol {
|
||||
@ -31,22 +30,56 @@ namespace ewol {
|
||||
class Context;
|
||||
};
|
||||
|
||||
template<class TYPE_OBJECT> static void baseInit(const std::shared_ptr<TYPE_OBJECT>& _object) {
|
||||
// end of recurtion
|
||||
return;
|
||||
}
|
||||
|
||||
template<class TYPE_OBJECT, class TYPE_VAL, class ... TYPE> static void baseInit(const std::shared_ptr<TYPE_OBJECT>& _object, const std::string& _name, const TYPE_VAL& _val, TYPE&& ... _all ) {
|
||||
eproperty::Property* prop(nullptr);
|
||||
eproperty::PropertyType<TYPE_VAL>* propType(nullptr);
|
||||
if (_object == nullptr) {
|
||||
EWOL_ERROR("EMPTY pointer");
|
||||
return;
|
||||
}
|
||||
prop = _object->getPropertyRaw(_name);
|
||||
if (prop == nullptr) {
|
||||
EWOL_ERROR("property does not exit ... '" << _name << "'");
|
||||
goto exit_on_error;
|
||||
}
|
||||
propType = dynamic_cast<eproperty::PropertyType<TYPE_VAL>*>(prop);
|
||||
if (propType == nullptr) {
|
||||
EWOL_ERROR("property does not cast in requested type ... '" << _name << "' require type : " << typeid(_val).name() << "' instead of '" << prop->getType() << "'");
|
||||
goto exit_on_error;
|
||||
}
|
||||
propType->setDirectCheck(_val);
|
||||
exit_on_error:
|
||||
baseInit(_object, std::forward<TYPE>(_all)... );
|
||||
return;
|
||||
}
|
||||
|
||||
#define UN_DECLARE_FACTORY(className) \
|
||||
template<typename ... TYPE> static std::shared_ptr<className> create(const TYPE& ... _all) = delete;
|
||||
|
||||
#define DECLARE_FACTORY(className) \
|
||||
template<typename ... T> static std::shared_ptr<className> create( T&& ... all ) { \
|
||||
template<typename ... TYPE> static std::shared_ptr<className> create(const TYPE& ... _all) { \
|
||||
std::shared_ptr<className> object(new className()); \
|
||||
if (object == nullptr) { \
|
||||
EWOL_ERROR("Factory error"); \
|
||||
return nullptr; \
|
||||
} \
|
||||
object->init(std::forward<T>(all)... ); \
|
||||
/*object->initNoValue();*/ \
|
||||
/*baseInit(object, std::forward<TYPE>(_all)... ); */ \
|
||||
baseInit(object, _all... ); \
|
||||
object->init(); \
|
||||
if (object->objectHasBeenCorectlyInit() == false) { \
|
||||
EWOL_CRITICAL("Object Is not correctly init : " << #className ); \
|
||||
} \
|
||||
return object; \
|
||||
}
|
||||
|
||||
#define DECLARE_SINGLE_FACTORY(className,uniqueName) \
|
||||
template<typename ... T> static std::shared_ptr<className> create( T&& ... all ) { \
|
||||
#define DECLARE_SINGLE_FACTORY(className, uniqueName) \
|
||||
template<typename ... TYPE> static std::shared_ptr<className> create(const TYPE& ... _all) { \
|
||||
std::shared_ptr<className> object; \
|
||||
std::shared_ptr<ewol::Object> object2 = getObjectNamed(uniqueName); \
|
||||
if (object2 != nullptr) { \
|
||||
@ -59,16 +92,7 @@ namespace ewol {
|
||||
if (object != nullptr) { \
|
||||
return object; \
|
||||
} \
|
||||
object = std::shared_ptr<className>(new className()); \
|
||||
if (object == nullptr) { \
|
||||
EWOL_ERROR("Factory error"); \
|
||||
return nullptr; \
|
||||
} \
|
||||
object->init(uniqueName, std::forward<T>(all)... ); \
|
||||
if (object->objectHasBeenCorectlyInit() == false) { \
|
||||
EWOL_CRITICAL("Object is not correctly init : " << #className ); \
|
||||
} \
|
||||
return object; \
|
||||
return create("name", std::string(uniqueName), _all...); \
|
||||
}
|
||||
|
||||
namespace ewol {
|
||||
@ -92,10 +116,7 @@ namespace ewol {
|
||||
* @brief Constructor.
|
||||
*/
|
||||
Object();
|
||||
void init();
|
||||
//! @previous
|
||||
void init(const std::string& _name);
|
||||
void init(const std::unordered_map<std::string,eproperty::Variant>& _listProperty);
|
||||
virtual void init();
|
||||
public:
|
||||
/**
|
||||
* @brief Factory
|
||||
|
@ -18,11 +18,6 @@ void ewol::object::Worker::init() {
|
||||
ewol::Object::init();
|
||||
getObjectManager().workerAdd(shared_from_this());
|
||||
}
|
||||
//! @previous
|
||||
void ewol::object::Worker::init(const std::string& _name) {
|
||||
ewol::Object::init(_name);
|
||||
getObjectManager().workerAdd(shared_from_this());
|
||||
}
|
||||
|
||||
ewol::object::Worker::~Worker() {
|
||||
// nothing to do ...
|
||||
|
@ -22,8 +22,6 @@ namespace ewol {
|
||||
*/
|
||||
Worker();
|
||||
void init();
|
||||
//! @previous
|
||||
void init(const std::string& _name);
|
||||
public:
|
||||
/**
|
||||
* @brief Factory
|
||||
|
@ -27,7 +27,7 @@ ewol::widget::Button::Button() :
|
||||
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),
|
||||
propertyShape(this, "shaper", "{ewol}THEME:GUI:Button.json", "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),
|
||||
@ -44,16 +44,17 @@ ewol::widget::Button::Button() :
|
||||
propertyLock.add(lockWhenReleased, "released");
|
||||
propertyLock.add(lockAccess, "access");
|
||||
|
||||
propertyCanFocus.setDirectCheck(true);
|
||||
|
||||
// shaper satatus update:
|
||||
CheckStatus();
|
||||
// Limit event at 1:
|
||||
setMouseLimit(1);
|
||||
}
|
||||
|
||||
void ewol::widget::Button::init(const std::string& _shaperName) {
|
||||
void ewol::widget::Button::init() {
|
||||
ewol::widget::Container2::init();
|
||||
propertyCanFocus.set(true);
|
||||
propertyShape.set(_shaperName);
|
||||
propertyShape.notifyChange();
|
||||
}
|
||||
|
||||
ewol::widget::Button::~Button() {
|
||||
|
@ -53,7 +53,7 @@ namespace ewol {
|
||||
* @param[in] _shaperName Shaper file properties
|
||||
*/
|
||||
Button();
|
||||
void init(const std::string& _shaperName="{ewol}THEME:GUI:Button.json");
|
||||
void init();
|
||||
public:
|
||||
DECLARE_WIDGET_FACTORY(Button, "Button");
|
||||
/**
|
||||
|
@ -28,19 +28,19 @@
|
||||
ewol::widget::ButtonColor::ButtonColor() :
|
||||
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),
|
||||
propertyShape(this, "shape", "{ewol}THEME:GUI:Button.json", "shape of the widget", &ewol::widget::ButtonColor::onChangePropertyShape),
|
||||
m_widgetContextMenu(nullptr) {
|
||||
addObjectType("ewol::widget::ButtonColor");
|
||||
changeStatusIn(STATUS_UP);
|
||||
// Limit event at 1:
|
||||
setMouseLimit(1);
|
||||
propertyCanFocus.setDirectCheck(true);
|
||||
}
|
||||
|
||||
void ewol::widget::ButtonColor::init(etk::Color<> _baseColor, std::string _shaperName) {
|
||||
void ewol::widget::ButtonColor::init() {
|
||||
ewol::Widget::init();
|
||||
propertyCanFocus.set(true);
|
||||
propertyShape.set(_shaperName);
|
||||
propertyValue.set(_baseColor);
|
||||
propertyShape.notifyChange();
|
||||
propertyValue.notifyChange();
|
||||
}
|
||||
|
||||
ewol::widget::ButtonColor::~ButtonColor() {
|
||||
|
@ -41,7 +41,7 @@ namespace ewol {
|
||||
* @param[in] _shaperName The new shaper filename.
|
||||
*/
|
||||
ButtonColor();
|
||||
void init(etk::Color<> _baseColor=etk::color::black, std::string _shaperName="{ewol}THEME:GUI:Button.json");
|
||||
void init();
|
||||
public:
|
||||
DECLARE_WIDGET_FACTORY(ButtonColor, "ButtonColor");
|
||||
/**
|
||||
|
@ -29,7 +29,7 @@ ewol::widget::CheckBox::CheckBox() :
|
||||
"Basic value of the widget",
|
||||
&ewol::widget::CheckBox::onChangePropertyValue),
|
||||
propertyShape(this, "shape",
|
||||
"",
|
||||
"{ewol}THEME:GUI:CheckBox.json",
|
||||
"The display name for config file",
|
||||
&ewol::widget::CheckBox::onChangePropertyShape),
|
||||
m_mouseHover(false),
|
||||
@ -41,17 +41,15 @@ ewol::widget::CheckBox::CheckBox() :
|
||||
addObjectType("ewol::widget::CheckBox");
|
||||
// shaper satatus update:
|
||||
CheckStatus();
|
||||
propertyCanFocus.setDirectCheck(true);
|
||||
// Limit event at 1:
|
||||
setMouseLimit(1);
|
||||
}
|
||||
|
||||
|
||||
void ewol::widget::CheckBox::init(const std::string& _shaperName) {
|
||||
void ewol::widget::CheckBox::init() {
|
||||
ewol::widget::Container2::init();
|
||||
propertyCanFocus.set(true);
|
||||
propertyShape.set(_shaperName);
|
||||
m_shaperIdSize = m_shaper.requestConfig("box-size");
|
||||
m_shaperIdSizeInsize = m_shaper.requestConfig("box-inside");
|
||||
propertyShape.notifyChange();
|
||||
}
|
||||
|
||||
ewol::widget::CheckBox::~CheckBox() {
|
||||
@ -203,6 +201,8 @@ void ewol::widget::CheckBox::periodicCall(const ewol::event::Time& _event) {
|
||||
|
||||
void ewol::widget::CheckBox::onChangePropertyShape() {
|
||||
m_shaper.setSource(*propertyShape);
|
||||
m_shaperIdSize = m_shaper.requestConfig("box-size");
|
||||
m_shaperIdSizeInsize = m_shaper.requestConfig("box-inside");
|
||||
markToRedraw();
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,7 @@ namespace ewol {
|
||||
* @param[in] _shaperName Shaper file properties
|
||||
*/
|
||||
CheckBox();
|
||||
void init(const std::string& _shaperName="{ewol}THEME:GUI:CheckBox.json");
|
||||
void init();
|
||||
public:
|
||||
DECLARE_WIDGET_FACTORY(CheckBox, "CheckBox");
|
||||
/**
|
||||
|
@ -24,14 +24,10 @@ ewol::widget::ColorBar::ColorBar() :
|
||||
&ewol::widget::ColorBar::onChangePropertyValue) {
|
||||
addObjectType("ewol::widget::ColorBar");
|
||||
m_currentUserPos.setValue(0,0);
|
||||
propertyCanFocus.setDirectCheck(true);
|
||||
setMouseLimit(1);
|
||||
}
|
||||
|
||||
void ewol::widget::ColorBar::init() {
|
||||
ewol::Widget::init();
|
||||
propertyCanFocus.set(true);
|
||||
}
|
||||
|
||||
ewol::widget::ColorBar::~ColorBar() {
|
||||
|
||||
}
|
||||
|
@ -24,7 +24,6 @@ namespace ewol {
|
||||
eproperty::Value<etk::Color<>> propertyValue;
|
||||
protected:
|
||||
ColorBar();
|
||||
void init();
|
||||
public:
|
||||
DECLARE_WIDGET_FACTORY(ColorBar, "ColorBar");
|
||||
virtual ~ColorBar();
|
||||
|
@ -21,28 +21,22 @@ ewol::widget::Composer::Composer() {
|
||||
// nothing to do ...
|
||||
}
|
||||
|
||||
std::shared_ptr<ewol::Widget> ewol::widget::composerGenerate(enum ewol::widget::Composer::composerMode _mode, const std::string& _data) {
|
||||
static std::shared_ptr<ewol::Widget> composerGenerate(bool _modeFile, const std::string& _data) {
|
||||
ewol::widget::Manager& widgetManager = ewol::getContext().getWidgetManager();
|
||||
if (_data == "") {
|
||||
return nullptr;
|
||||
}
|
||||
std::shared_ptr<exml::Document> doc = exml::Document::create();
|
||||
switch(_mode) {
|
||||
case ewol::widget::Composer::None:
|
||||
EWOL_ERROR("Not specify the type for compositing dynamic creation");
|
||||
if (_modeFile == true) {
|
||||
if (doc->load(_data) == false) {
|
||||
EWOL_ERROR(" can not load file XML : " << _data);
|
||||
return nullptr;
|
||||
case ewol::widget::Composer::String:
|
||||
if (doc->parse(_data) == false) {
|
||||
EWOL_ERROR(" can not load file XML string...");
|
||||
return nullptr;
|
||||
}
|
||||
break;
|
||||
case ewol::widget::Composer::file:
|
||||
if (doc->load(_data) == false) {
|
||||
EWOL_ERROR(" can not load file XML : " << _data);
|
||||
return nullptr;
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (doc->parse(_data) == false) {
|
||||
EWOL_ERROR(" can not load file XML string...");
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
std::shared_ptr<const exml::Element> root = doc->toElement();
|
||||
if (root->size() == 0) {
|
||||
@ -74,20 +68,12 @@ std::shared_ptr<ewol::Widget> ewol::widget::composerGenerate(enum ewol::widget::
|
||||
return tmpWidget;
|
||||
}
|
||||
|
||||
std::shared_ptr<ewol::Widget> ewol::widget::composerGenerateFile(const std::string& _data) {
|
||||
return composerGenerate(true, _data);
|
||||
}
|
||||
|
||||
void ewol::widget::Composer::init(enum composerMode _mode, const std::string& _fileName) {
|
||||
ewol::widget::Container::init();
|
||||
switch(_mode) {
|
||||
case ewol::widget::Composer::None:
|
||||
// nothing to do ...
|
||||
break;
|
||||
case ewol::widget::Composer::String:
|
||||
loadFromString(_fileName);
|
||||
break;
|
||||
case ewol::widget::Composer::file:
|
||||
loadFromFile(_fileName);
|
||||
break;
|
||||
}
|
||||
std::shared_ptr<ewol::Widget> ewol::widget::composerGenerateString(const std::string& _data) {
|
||||
return composerGenerate(false, _data);
|
||||
}
|
||||
|
||||
ewol::widget::Composer::~Composer() {
|
||||
|
@ -18,23 +18,11 @@ namespace ewol {
|
||||
* @brief the composer widget is a widget that create a link on a string.file to parse the data and generate some widget tree
|
||||
*/
|
||||
class Composer : public ewol::widget::Container {
|
||||
public:
|
||||
enum composerMode {
|
||||
None,
|
||||
String,
|
||||
file
|
||||
};
|
||||
protected:
|
||||
/**
|
||||
* @brief Constructor
|
||||
*/
|
||||
Composer();
|
||||
/**
|
||||
* @brief Constructor
|
||||
* @param[in] _mode mode of parsing the string
|
||||
* @param[in] _data file/directString data to generate compositing of the widget..
|
||||
*/
|
||||
void init(enum ewol::widget::Composer::composerMode _mode = ewol::widget::Composer::None, const std::string& _data = "");
|
||||
public:
|
||||
DECLARE_WIDGET_FACTORY(Composer, "Composer");
|
||||
/**
|
||||
@ -56,6 +44,7 @@ namespace ewol {
|
||||
*/
|
||||
bool loadFromString(const std::string& _composerXmlString);
|
||||
};
|
||||
std::shared_ptr<ewol::Widget> composerGenerate(enum ewol::widget::Composer::composerMode _mode = ewol::widget::Composer::None, const std::string& _data = "");
|
||||
std::shared_ptr<ewol::Widget> composerGenerateString(const std::string& _data = "");
|
||||
std::shared_ptr<ewol::Widget> composerGenerateFile(const std::string& _data = "");
|
||||
};
|
||||
};
|
||||
|
@ -21,12 +21,6 @@ ewol::widget::Container::Container() {
|
||||
// nothing to do ...
|
||||
}
|
||||
|
||||
void ewol::widget::Container::init(std::shared_ptr<ewol::Widget> _subElement) {
|
||||
ewol::Widget::init();
|
||||
m_subWidget = _subElement;
|
||||
}
|
||||
|
||||
|
||||
ewol::widget::Container::~Container() {
|
||||
subWidgetRemove();
|
||||
}
|
||||
|
@ -25,7 +25,6 @@ namespace ewol {
|
||||
* @brief Constructor
|
||||
*/
|
||||
Container();
|
||||
void init(std::shared_ptr<ewol::Widget> _subElement=nullptr);
|
||||
public:
|
||||
/**
|
||||
* @brief Destructor
|
||||
|
@ -19,13 +19,6 @@
|
||||
ewol::widget::Container2::Container2() :
|
||||
m_idWidgetDisplayed(0) {
|
||||
addObjectType("ewol::widget::Container2");
|
||||
// nothing to do ...
|
||||
}
|
||||
|
||||
void ewol::widget::Container2::init(std::shared_ptr<ewol::Widget> _subElement, std::shared_ptr<ewol::Widget> _subElementToggle) {
|
||||
ewol::Widget::init();
|
||||
m_subWidget[0] = _subElement;
|
||||
m_subWidget[1] = _subElementToggle;
|
||||
}
|
||||
|
||||
ewol::widget::Container2::~Container2() {
|
||||
|
@ -29,7 +29,6 @@ namespace ewol {
|
||||
* @param[in] _subElementToggle Widget to set on the toggle position
|
||||
*/
|
||||
Container2();
|
||||
void init(std::shared_ptr<ewol::Widget> _subElement = nullptr, std::shared_ptr<ewol::Widget> _subElementToggle = nullptr);
|
||||
public:
|
||||
/**
|
||||
* @brief Destructor
|
||||
|
@ -25,14 +25,6 @@ ewol::widget::ContainerN::ContainerN() :
|
||||
// nothing to do ...
|
||||
}
|
||||
|
||||
void ewol::widget::ContainerN::init(const std::unordered_map<std::string,eproperty::Variant>& _listProperty) {
|
||||
ewol::Widget::init(_listProperty);
|
||||
}
|
||||
|
||||
void ewol::widget::ContainerN::init() {
|
||||
ewol::Widget::init();
|
||||
}
|
||||
|
||||
ewol::widget::ContainerN::~ContainerN() {
|
||||
subWidgetRemoveAll();
|
||||
}
|
||||
|
@ -28,8 +28,6 @@ namespace ewol {
|
||||
* @brief Constructor
|
||||
*/
|
||||
ContainerN();
|
||||
void init();
|
||||
void init(const std::unordered_map<std::string,eproperty::Variant>& _listProperty);
|
||||
public:
|
||||
/**
|
||||
* @brief Destructor
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
ewol::widget::ContextMenu::ContextMenu():
|
||||
propertyShape(this, "shape",
|
||||
"",
|
||||
"{ewol}THEME:GUI:ContextMenu.json",
|
||||
"the display name for config file",
|
||||
&ewol::widget::ContextMenu::onChangePropertyShape),
|
||||
propertyArrowPos(this, "arrow-position",
|
||||
@ -47,10 +47,9 @@ ewol::widget::ContextMenu::ContextMenu():
|
||||
setMouseLimit(1);
|
||||
}
|
||||
|
||||
void ewol::widget::ContextMenu::init(const std::string& _shaperName) {
|
||||
void ewol::widget::ContextMenu::init() {
|
||||
ewol::widget::Container::init();
|
||||
propertyShape.set(_shaperName);
|
||||
propertyExpand.set(bvec2(false,false));
|
||||
propertyShape.notifyChange();
|
||||
}
|
||||
|
||||
ewol::widget::ContextMenu::~ContextMenu() {
|
||||
|
@ -35,7 +35,7 @@ namespace ewol {
|
||||
eproperty::List<enum markPosition> propertyArrawBorder;
|
||||
protected:
|
||||
ContextMenu();
|
||||
void init(const std::string& _shaperName="{ewol}THEME:GUI:ContextMenu.json");
|
||||
void init();
|
||||
public:
|
||||
DECLARE_WIDGET_FACTORY(ContextMenu, "ContextMenu");
|
||||
virtual ~ContextMenu();
|
||||
|
@ -25,10 +25,10 @@ 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",
|
||||
&ewol::widget::Entry::onChangePropertyShaper),
|
||||
propertyShape(this, "shape",
|
||||
"{ewol}THEME:GUI:Entry.json",
|
||||
"Shaper to display the background",
|
||||
&ewol::widget::Entry::onChangePropertyShaper),
|
||||
propertyValue(this, "value",
|
||||
"",
|
||||
"Value display in the entry (decorated text)",
|
||||
@ -51,13 +51,12 @@ ewol::widget::Entry::Entry() :
|
||||
m_displayCursorPos(0),
|
||||
m_displayCursorPosSelection(0) {
|
||||
addObjectType("ewol::widget::Entry");
|
||||
propertyCanFocus.setDirectCheck(true);
|
||||
}
|
||||
|
||||
void ewol::widget::Entry::init(const std::string& _newData, const std::string& _shaperName) {
|
||||
void ewol::widget::Entry::init() {
|
||||
ewol::Widget::init();
|
||||
propertyValue.set(_newData);
|
||||
propertyShaper.set(_shaperName);
|
||||
propertyCanFocus.set(true);
|
||||
propertyShape.notifyChange();
|
||||
|
||||
try {
|
||||
m_regex.assign(".*", std::regex_constants::optimize | std::regex_constants::ECMAScript);
|
||||
@ -557,7 +556,7 @@ void ewol::widget::Entry::periodicCall(const ewol::event::Time& _event) {
|
||||
}
|
||||
|
||||
void ewol::widget::Entry::onChangePropertyShaper() {
|
||||
m_shaper.setSource(propertyShaper.get());
|
||||
m_shaper.setSource(propertyShape.get());
|
||||
m_colorIdTextFg = m_shaper.requestColor("text-foreground");
|
||||
m_colorIdTextBg = m_shaper.requestColor("text-background");
|
||||
m_colorIdCursor = m_shaper.requestColor("text-cursor");
|
||||
|
@ -36,7 +36,7 @@ namespace ewol {
|
||||
esignal::ISignal<std::string> signalEnter; //!< Enter key is pressed
|
||||
esignal::ISignal<std::string> signalModify; //!< data change
|
||||
public: // propertie list
|
||||
eproperty::Value<std::string> propertyShaper;
|
||||
eproperty::Value<std::string> propertyShape;
|
||||
eproperty::Value<std::string> propertyValue; //!< string that must be displayed
|
||||
eproperty::Range<int32_t> propertyMaxCharacter; //!< number max of xharacter in the list
|
||||
eproperty::Value<std::string> propertyRegex; //!< regular expression value
|
||||
@ -54,8 +54,7 @@ namespace ewol {
|
||||
* @param[in] _newData The USting that might be set in the Entry box (no event generation!!)
|
||||
*/
|
||||
Entry();
|
||||
void init(const std::string& _newData = "",
|
||||
const std::string& _shaperName="{ewol}THEME:GUI:Entry.json");
|
||||
void init();
|
||||
public:
|
||||
DECLARE_WIDGET_FACTORY(Entry, "Entry");
|
||||
/**
|
||||
|
@ -22,11 +22,6 @@ ewol::widget::Gird::Gird() :
|
||||
addObjectType("ewol::widget::Gird");
|
||||
requestUpdateSize();
|
||||
}
|
||||
void ewol::widget::Gird::init(int32_t _colNumber) {
|
||||
ewol::Widget::init();
|
||||
setColNumber(_colNumber);
|
||||
}
|
||||
|
||||
|
||||
ewol::widget::Gird::~Gird() {
|
||||
EWOL_DEBUG("[" << getId() << "]={" << getObjectType() << "} Gird : destroy");
|
||||
|
@ -37,7 +37,6 @@ namespace ewol {
|
||||
* @brief Constructor
|
||||
*/
|
||||
Gird();
|
||||
void init(int32_t _colNumber=1);
|
||||
public:
|
||||
DECLARE_WIDGET_FACTORY(Gird, "Gird");
|
||||
/**
|
||||
|
@ -35,12 +35,6 @@ ewol::widget::Image::Image() :
|
||||
}
|
||||
}
|
||||
|
||||
void ewol::widget::Image::init(const std::string& _file, const gale::Dimension& _border) {
|
||||
ewol::Widget::init();
|
||||
set(_file, _border);
|
||||
}
|
||||
|
||||
|
||||
ewol::widget::Image::~Image() {
|
||||
|
||||
}
|
||||
|
@ -41,8 +41,6 @@ namespace ewol {
|
||||
* @brief
|
||||
*/
|
||||
Image();
|
||||
void init(const std::string& _file="",
|
||||
const gale::Dimension& _border=gale::Dimension(vec2(0,0),gale::Dimension::Millimeter));
|
||||
public:
|
||||
DECLARE_WIDGET_FACTORY(Image, "Image");
|
||||
/**
|
||||
|
@ -43,14 +43,9 @@ ewol::widget::Joystick::Joystick() :
|
||||
m_background = l_background;
|
||||
m_foreground = l_foreground;
|
||||
m_ratio = l_ratio;
|
||||
propertyCanFocus.setDirectCheck(true);
|
||||
}
|
||||
|
||||
void ewol::widget::Joystick::init() {
|
||||
ewol::Widget::init();
|
||||
propertyCanFocus.set(true);
|
||||
}
|
||||
|
||||
|
||||
ewol::widget::Joystick::~Joystick() {
|
||||
|
||||
}
|
||||
|
@ -47,7 +47,6 @@ namespace ewol {
|
||||
float m_ratio;
|
||||
protected:
|
||||
Joystick();
|
||||
void init();
|
||||
public:
|
||||
DECLARE_WIDGET_FACTORY(Joystick, "Joystick");
|
||||
virtual ~Joystick();
|
||||
|
@ -33,12 +33,7 @@ ewol::widget::Label::Label() :
|
||||
m_colorDefaultBgText = m_colorProperty->request("background");
|
||||
}
|
||||
setMouseLimit(1);
|
||||
}
|
||||
|
||||
void ewol::widget::Label::init(std::string _newLabel) {
|
||||
ewol::Widget::init();
|
||||
propertyCanFocus.set(false);
|
||||
propertyValue.set(_newLabel);
|
||||
propertyCanFocus.setDirectCheck(false);
|
||||
}
|
||||
|
||||
ewol::widget::Label::~Label() {
|
||||
|
@ -37,7 +37,6 @@ namespace ewol {
|
||||
* @param[in] _newLabel The displayed decorated text.
|
||||
*/
|
||||
Label();
|
||||
void init(std::string _newLabel="---");
|
||||
public:
|
||||
DECLARE_WIDGET_FACTORY(Label, "Label");
|
||||
/**
|
||||
|
@ -17,10 +17,6 @@ ewol::widget::Layer::Layer() {
|
||||
addObjectType("ewol::widget::Layer");
|
||||
}
|
||||
|
||||
void ewol::widget::Layer::init() {
|
||||
ewol::widget::ContainerN::init();
|
||||
}
|
||||
|
||||
ewol::widget::Layer::~Layer() {
|
||||
EWOL_DEBUG("[" << getId() << "] Layer : destroy");
|
||||
}
|
||||
|
@ -23,7 +23,6 @@ namespace ewol {
|
||||
* @brief Constructor
|
||||
*/
|
||||
Layer();
|
||||
void init();
|
||||
public:
|
||||
DECLARE_WIDGET_FACTORY(Layer, "Layer");
|
||||
/**
|
||||
|
@ -25,11 +25,7 @@ ewol::widget::List::List() {
|
||||
m_paddingSizeY = 2;
|
||||
#endif
|
||||
m_nbVisibleRaw = 0;
|
||||
}
|
||||
|
||||
void ewol::widget::List::init() {
|
||||
ewol::widget::WidgetScrolled::init();
|
||||
propertyCanFocus.set(true);
|
||||
propertyCanFocus.setDirectCheck(true);
|
||||
}
|
||||
|
||||
ewol::widget::List::~List() {
|
||||
|
@ -21,7 +21,6 @@ namespace ewol {
|
||||
class List : public ewol::widget::WidgetScrolled {
|
||||
protected:
|
||||
List();
|
||||
void init();
|
||||
public:
|
||||
virtual ~List();
|
||||
virtual void calculateMinMaxSize();
|
||||
|
@ -57,11 +57,6 @@ ewol::widget::ListFileSystem::ListFileSystem() :
|
||||
setMouseLimit(1);
|
||||
}
|
||||
|
||||
void ewol::widget::ListFileSystem::init() {
|
||||
ewol::widget::List::init();
|
||||
}
|
||||
|
||||
|
||||
ewol::widget::ListFileSystem::~ListFileSystem() {
|
||||
clearList();
|
||||
}
|
||||
|
@ -32,7 +32,6 @@ namespace ewol {
|
||||
eproperty::Value<std::string> propertyFilter; //!< Regular expression to filter the view (for temporary file:".*(~|.bck|.pyc)\e")
|
||||
protected:
|
||||
ListFileSystem();
|
||||
void init();
|
||||
public:
|
||||
DECLARE_WIDGET_FACTORY(ListFileSystem, "ListFileSystem");
|
||||
virtual ~ListFileSystem();
|
||||
|
@ -24,10 +24,6 @@ ewol::widget::Menu::Menu() :
|
||||
m_staticId = 666;
|
||||
}
|
||||
|
||||
void ewol::widget::Menu::init() {
|
||||
ewol::widget::Sizer::init();
|
||||
}
|
||||
|
||||
ewol::widget::Menu::~Menu() {
|
||||
clear();
|
||||
}
|
||||
@ -101,9 +97,9 @@ int32_t ewol::widget::Menu::add(int32_t _parent,
|
||||
}
|
||||
composeString+=" <label><left>" + tmpObject.m_label + "</left></label>\n";
|
||||
composeString+="</sizer>\n";
|
||||
myButton->setSubWidget(ewol::widget::Composer::create(widget::Composer::String, composeString));
|
||||
myButton->setSubWidget(ewol::widget::composerGenerateString(composeString));
|
||||
} else {
|
||||
myButton->setSubWidget(ewol::widget::Label::create("<left>" + tmpObject.m_label + "</left>") );
|
||||
myButton->setSubWidget(ewol::widget::Label::create("value", "<left>" + tmpObject.m_label + "</left>") );
|
||||
}
|
||||
// add it in the widget list
|
||||
ewol::widget::Sizer::subWidgetAdd(myButton);
|
||||
@ -178,7 +174,7 @@ void ewol::widget::Menu::onButtonPressed(std::weak_ptr<ewol::widget::Button> _bu
|
||||
tmpContext->setPositionMark(ewol::widget::ContextMenu::markTop, newPosition);
|
||||
std::shared_ptr<ewol::widget::Sizer> mySizer;
|
||||
std::shared_ptr<ewol::widget::Button> myButton;
|
||||
mySizer = ewol::widget::Sizer::create(widget::Sizer::modeVert);
|
||||
mySizer = ewol::widget::Sizer::create("mode", widget::Sizer::modeVert);
|
||||
if (mySizer != nullptr) {
|
||||
mySizer->propertyLockExpand.set(vec2(true,true));
|
||||
mySizer->propertyFill.set(vec2(true,true));
|
||||
@ -219,10 +215,10 @@ void ewol::widget::Menu::onButtonPressed(std::weak_ptr<ewol::widget::Button> _bu
|
||||
}
|
||||
composeString+=" <label exand='true,true' fill='true,true'><left>" + it2->m_label + "</left></label>\n";
|
||||
composeString+=" </sizer>\n";
|
||||
myButton->setSubWidget(ewol::widget::composerGenerate(widget::Composer::String, composeString));
|
||||
myButton->setSubWidget(ewol::widget::composerGenerateString(composeString));
|
||||
} else {
|
||||
if (menuHaveImage == true) {
|
||||
myButton->setSubWidget(ewol::widget::composerGenerate(widget::Composer::String,
|
||||
myButton->setSubWidget(ewol::widget::composerGenerateString(
|
||||
std::string() +
|
||||
" <sizer mode='hori' expand='true,false' fill='true,true' lock='true'>\n"
|
||||
" <spacer min-size='8,0mm'/>\n"
|
||||
@ -230,8 +226,9 @@ void ewol::widget::Menu::onButtonPressed(std::weak_ptr<ewol::widget::Button> _bu
|
||||
" </sizer>\n")
|
||||
);
|
||||
} else {
|
||||
std::shared_ptr<ewol::widget::Label> tmpLabel = widget::Label::create(std::string("<left>") + it2->m_label + "</left>\n");
|
||||
std::shared_ptr<ewol::widget::Label> tmpLabel = widget::Label::create();
|
||||
if (tmpLabel != nullptr) {
|
||||
tmpLabel->propertyValue.set(std::string("<left>") + it2->m_label + "</left>\n");
|
||||
tmpLabel->propertyExpand.set(bvec2(true,false));
|
||||
tmpLabel->propertyFill.set(bvec2(true,true));
|
||||
myButton->setSubWidget(tmpLabel);
|
||||
|
@ -35,7 +35,6 @@ namespace ewol {
|
||||
esignal::ISignal<std::string> signalSelect; // event on a menu button or ...
|
||||
protected:
|
||||
Menu();
|
||||
void init();
|
||||
public:
|
||||
DECLARE_WIDGET_FACTORY(Menu, "Menu");
|
||||
virtual ~Menu();
|
||||
|
@ -19,7 +19,7 @@ static const char* annimationIncrease = "increase";
|
||||
|
||||
ewol::widget::PopUp::PopUp() :
|
||||
propertyShape(this, "shaper",
|
||||
"",
|
||||
"{ewol}THEME:GUI:PopUp.json",
|
||||
"The shaper properties",
|
||||
&ewol::widget::PopUp::onChangePropertyShape),
|
||||
propertyLockExpand(this, "lock",
|
||||
@ -34,10 +34,10 @@ ewol::widget::PopUp::PopUp() :
|
||||
addAnnimationType(ewol::Widget::annimationModeEnableAdd, annimationIncrease);
|
||||
}
|
||||
|
||||
void ewol::widget::PopUp::init(const std::string& _shaperName) {
|
||||
void ewol::widget::PopUp::init() {
|
||||
ewol::widget::Container::init();
|
||||
propertyFill.set(bvec2(false,false));
|
||||
propertyShape.set(_shaperName);
|
||||
propertyShape.notifyChange();
|
||||
propertyMinSize.set(gale::Dimension(vec2(80,80),gale::Dimension::Pourcent));
|
||||
propertyExpand.set(bvec2(false, false));
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ namespace ewol {
|
||||
* @param[in] _shaperName Shaper file properties
|
||||
*/
|
||||
PopUp();
|
||||
void init(const std::string& _shaperName="{ewol}THEME:GUI:PopUp.json");
|
||||
void init();
|
||||
public:
|
||||
DECLARE_WIDGET_FACTORY(PopUp, "PopUp");
|
||||
/**
|
||||
|
@ -20,11 +20,11 @@ ewol::widget::Scroll::Scroll() :
|
||||
"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",
|
||||
"",
|
||||
"{ewol}THEME:GUI:WidgetScrolled.json",
|
||||
"shape for the vertical display",
|
||||
&ewol::widget::Scroll::onChangePropertyShapeVert),
|
||||
propertyShapeHori(this, "shape-hori",
|
||||
"",
|
||||
"{ewol}THEME:GUI:WidgetScrolled.json",
|
||||
"shape for the horizonal display",
|
||||
&ewol::widget::Scroll::onChangePropertyShapeHori),
|
||||
m_pixelScrolling(20),
|
||||
@ -35,10 +35,10 @@ ewol::widget::Scroll::Scroll() :
|
||||
addObjectType("ewol::widget::Scroll");
|
||||
}
|
||||
|
||||
void ewol::widget::Scroll::init(const std::string& _shaperName) {
|
||||
void ewol::widget::Scroll::init() {
|
||||
ewol::widget::Container::init();
|
||||
propertyShapeVert.set(_shaperName);
|
||||
propertyShapeHori.set(_shaperName);
|
||||
propertyShapeVert.notifyChange();
|
||||
propertyShapeHori.notifyChange();
|
||||
}
|
||||
|
||||
|
||||
|
@ -41,7 +41,7 @@ namespace ewol {
|
||||
enum gale::key::type m_highSpeedType;
|
||||
protected:
|
||||
Scroll();
|
||||
void init(const std::string& _shaperName="{ewol}THEME:GUI:WidgetScrolled.json");
|
||||
void init();
|
||||
public:
|
||||
DECLARE_WIDGET_FACTORY(Scroll, "Scroll");
|
||||
virtual ~Scroll();
|
||||
|
@ -34,13 +34,14 @@ ewol::widget::Select::Select() :
|
||||
"Value of the Select",
|
||||
&ewol::widget::Select::onChangePropertyValue) {
|
||||
addObjectType("ewol::widget::Select");
|
||||
}
|
||||
|
||||
void ewol::widget::Select::init(const std::string& _shaperName) {
|
||||
ewol::widget::SpinBase::init(ewol::widget::spinPosition_noneRight, _shaperName);
|
||||
//m_shaper->setSource(_shaperName);
|
||||
//m_shaperIdSize = m_shaper->requestConfig("box-size");
|
||||
//m_shaperIdSizeInsize = m_shaper->requestConfig("box-inside");
|
||||
// override the basic parameter:
|
||||
propertyShape.setDirectCheck("{ewol}THEME:GUI:Select.json");
|
||||
propertySpinMode.rename("none-none", "none");
|
||||
propertySpinMode.rename("none-right", "right");
|
||||
propertySpinMode.rename("left-none", "left");
|
||||
propertySpinMode.remove("left-right");
|
||||
propertySpinMode.remove("left-left");
|
||||
propertySpinMode.remove("right-right");
|
||||
}
|
||||
|
||||
ewol::widget::Select::~Select() {
|
||||
@ -171,26 +172,27 @@ void ewol::widget::Select::onCallbackOpenMenu() {
|
||||
// auto-select mark position:
|
||||
tmpContext->setPositionMarkAuto(m_origin, m_size);
|
||||
std::shared_ptr<ewol::widget::Sizer> mySizer;
|
||||
mySizer = ewol::widget::Sizer::create(widget::Sizer::modeVert);
|
||||
mySizer = ewol::widget::Sizer::create();
|
||||
if (mySizer == nullptr) {
|
||||
EWOL_ERROR("Allocation Error or sizer");
|
||||
return;
|
||||
}
|
||||
mySizer->propertyMode.set(widget::Sizer::modeVert);
|
||||
mySizer->propertyLockExpand.set(vec2(true,true));
|
||||
mySizer->propertyFill.set(vec2(true,true));
|
||||
// set it in the pop-up-system:
|
||||
tmpContext->setSubWidget(mySizer);
|
||||
for (auto &it : m_listElement) {
|
||||
std::shared_ptr<ewol::widget::Label> myLabel;
|
||||
if (it.m_selected == true) {
|
||||
myLabel = ewol::widget::Label::create(std::string("<b>") + it.m_name + "</b>");
|
||||
} else {
|
||||
myLabel = ewol::widget::Label::create(it.m_name);
|
||||
}
|
||||
std::shared_ptr<ewol::widget::Label> myLabel = ewol::widget::Label::create();
|
||||
if (myLabel == nullptr) {
|
||||
EWOL_ERROR("Allocation Error");
|
||||
continue;
|
||||
}
|
||||
if (it.m_selected == true) {
|
||||
myLabel->propertyValue.set(std::string("<b>") + it.m_name + "</b>");
|
||||
} else {
|
||||
myLabel->propertyValue.set(it.m_name);
|
||||
}
|
||||
myLabel->propertyExpand.set(bvec2(true,true));
|
||||
myLabel->propertyFill.set(bvec2(true,true));
|
||||
// set callback
|
||||
|
@ -28,7 +28,6 @@ namespace ewol {
|
||||
* @param[in] _shaperName Shaper file properties
|
||||
*/
|
||||
Select();
|
||||
void init(const std::string& _shaperName="{ewol}THEME:GUI:Select.json");
|
||||
public:
|
||||
DECLARE_WIDGET_FACTORY(Select, "Select");
|
||||
/**
|
||||
|
@ -38,15 +38,6 @@ ewol::widget::Sizer::Sizer() :
|
||||
propertyAnimation.add(animationRight, "right");
|
||||
}
|
||||
|
||||
void ewol::widget::Sizer::init(const std::unordered_map<std::string,eproperty::Variant>& _listProperty) {
|
||||
ewol::widget::ContainerN::init(_listProperty);
|
||||
}
|
||||
|
||||
void ewol::widget::Sizer::init(enum displayMode _mode) {
|
||||
ewol::widget::ContainerN::init();
|
||||
propertyMode.set(_mode);
|
||||
}
|
||||
|
||||
ewol::widget::Sizer::~Sizer() {
|
||||
//EWOL_DEBUG("[" << getId() << "]={" << getObjectType() << "} sizer : destroy (mode=" << (propertyMode == ewol::widget::Sizer::modeVert?"Vert":"Hori") << ")");
|
||||
}
|
||||
|
@ -38,19 +38,12 @@ namespace ewol {
|
||||
eproperty::Value<gale::Dimension> propertyBorderSize; //!< Border size needed for all the display
|
||||
eproperty::List<enum animation> propertyAnimation; //!< Methode add and remove element (animation)
|
||||
eproperty::Value<float> propertyAnimationTime; //!< Time in second to generate animation
|
||||
public:
|
||||
/**
|
||||
* @brief Main call of recording the widget on the List of "widget named creator"
|
||||
*/
|
||||
static void init(ewol::widget::Manager& _widgetManager);
|
||||
void init(const std::unordered_map<std::string,eproperty::Variant>& _listProperty);
|
||||
protected:
|
||||
/**
|
||||
* @brief Constructor
|
||||
* @param[in] _mode The mode to display the elements
|
||||
*/
|
||||
Sizer();
|
||||
void init(enum displayMode _mode=ewol::widget::Sizer::modeHori);
|
||||
public:
|
||||
DECLARE_WIDGET_FACTORY(Sizer, "Sizer");
|
||||
/**
|
||||
|
@ -39,15 +39,12 @@ ewol::widget::Slider::Slider() :
|
||||
|
||||
m_textColorBg = etk::color::black;
|
||||
m_textColorBg.setA(0x3F);
|
||||
|
||||
propertyCanFocus.setDirectCheck(true);
|
||||
// Limit event at 1:
|
||||
setMouseLimit(1);
|
||||
}
|
||||
|
||||
void ewol::widget::Slider::init() {
|
||||
ewol::Widget::init();
|
||||
propertyCanFocus.set(true);
|
||||
}
|
||||
|
||||
ewol::widget::Slider::~Slider() {
|
||||
|
||||
}
|
||||
|
@ -30,7 +30,6 @@ namespace ewol {
|
||||
eproperty::Value<float> propertyStep; //!< step of every iteration of the slider (increment/precision)
|
||||
protected:
|
||||
Slider();
|
||||
void init();
|
||||
public:
|
||||
DECLARE_WIDGET_FACTORY(Slider, "Slider");
|
||||
virtual ~Slider();
|
||||
|
@ -20,12 +20,8 @@ ewol::widget::Spacer::Spacer() :
|
||||
"background of the spacer",
|
||||
&ewol::widget::Spacer::onChangePropertyColor) {
|
||||
addObjectType("ewol::widget::Spacer");
|
||||
}
|
||||
|
||||
void ewol::widget::Spacer::init() {
|
||||
ewol::Widget::init();
|
||||
propertyMinSize.set(gale::Dimension(vec2(10,10)));
|
||||
propertyCanFocus.set(true);
|
||||
propertyMinSize.setDirectCheck(gale::Dimension(vec2(10,10)));
|
||||
propertyCanFocus.setDirectCheck(true);
|
||||
}
|
||||
|
||||
ewol::widget::Spacer::~Spacer() {
|
||||
|
@ -27,7 +27,6 @@ namespace ewol {
|
||||
* @brief Main constructer
|
||||
*/
|
||||
Spacer();
|
||||
void init();
|
||||
public:
|
||||
DECLARE_WIDGET_FACTORY(Spacer, "Spacer");
|
||||
/**
|
||||
|
@ -41,18 +41,7 @@ ewol::widget::Spin::Spin() :
|
||||
"fix-point mantis",
|
||||
&ewol::widget::Spin::onChangePropertyMantis) {
|
||||
addObjectType("ewol::widget::Spin");
|
||||
}
|
||||
|
||||
void ewol::widget::Spin::init(const std::unordered_map<std::string,eproperty::Variant>& _listProperty) {
|
||||
ewol::widget::SpinBase::init(_listProperty);
|
||||
}
|
||||
|
||||
void ewol::widget::Spin::init(enum ewol::widget::spinPosition _mode,
|
||||
const std::string& _shaperName) {
|
||||
EWOL_WARNING("init [START]");
|
||||
ewol::widget::SpinBase::init(_mode, _shaperName);
|
||||
markToRedraw();
|
||||
EWOL_WARNING("init [STOP]");
|
||||
propertyShape.setDirectCheck("{ewol}THEME:GUI:Spin.json");
|
||||
}
|
||||
|
||||
ewol::widget::Spin::~Spin() {
|
||||
|
@ -35,9 +35,6 @@ namespace ewol {
|
||||
* @param[in] _shaperName Shaper file properties
|
||||
*/
|
||||
Spin();
|
||||
void init(enum ewol::widget::spinPosition _mode=ewol::widget::spinPosition_RightRight,
|
||||
const std::string& _shaperName="{ewol}THEME:GUI:Spin.json");
|
||||
void init(const std::unordered_map<std::string,eproperty::Variant>& _listProperty);
|
||||
public:
|
||||
DECLARE_WIDGET_FACTORY(Spin, "Spin");
|
||||
/**
|
||||
|
@ -34,9 +34,6 @@ namespace ewol {
|
||||
eproperty::Value<std::string> propertySelectWidget; //!< current select configuration
|
||||
protected:
|
||||
WSlider();
|
||||
void init() {
|
||||
ewol::widget::ContainerN::init();
|
||||
};
|
||||
public:
|
||||
DECLARE_WIDGET_FACTORY(WSlider, "WSlider");
|
||||
virtual ~WSlider();
|
||||
|
@ -85,17 +85,6 @@ ewol::Widget::Widget() :
|
||||
propertyAnnimationTypeStop.add(0, "none");
|
||||
}
|
||||
|
||||
void ewol::Widget::init() {
|
||||
ewol::Object::init();
|
||||
}
|
||||
|
||||
void ewol::Widget::init(const std::string& _name) {
|
||||
ewol::Object::init(_name);
|
||||
}
|
||||
void ewol::Widget::init(const std::unordered_map<std::string,eproperty::Variant>& _listProperty) {
|
||||
ewol::Object::init(_listProperty);
|
||||
}
|
||||
|
||||
ewol::Widget::~Widget() {
|
||||
// clean all the short-cut ...
|
||||
shortCutClean();
|
||||
|
@ -39,7 +39,9 @@ namespace ewol {
|
||||
#define DECLARE_WIDGET_FACTORY(className, name) \
|
||||
DECLARE_FACTORY(className); \
|
||||
static void createManagerWidget(ewol::widget::Manager& _widgetManager) { \
|
||||
_widgetManager.addWidgetCreator(name,[]() -> std::shared_ptr<ewol::Widget> { return className::create(); }); \
|
||||
_widgetManager.addWidgetCreator(name, []() -> std::shared_ptr<ewol::Widget> { \
|
||||
return className::create(); \
|
||||
}); \
|
||||
}
|
||||
|
||||
namespace ewol {
|
||||
@ -85,10 +87,6 @@ namespace ewol {
|
||||
* @return (no execption generated (not managed in embended platform))
|
||||
*/
|
||||
Widget();
|
||||
|
||||
void init();
|
||||
void init(const std::string& _name);
|
||||
void init(const std::unordered_map<std::string,eproperty::Variant>& _listProperty);
|
||||
public:
|
||||
/**
|
||||
* @brief Destructor of the widget classes
|
||||
|
@ -15,11 +15,11 @@
|
||||
|
||||
ewol::widget::WidgetScrolled::WidgetScrolled() :
|
||||
propertyShapeVert(this, "shape-vert",
|
||||
"",
|
||||
"{ewol}THEME:GUI:WidgetScrolled.json",
|
||||
"shape for the vertical display",
|
||||
&ewol::widget::WidgetScrolled::onChangePropertyShapeVert),
|
||||
propertyShapeHori(this, "shape-hori",
|
||||
"",
|
||||
"{ewol}THEME:GUI:WidgetScrolled.json",
|
||||
"shape for the horizonal display",
|
||||
&ewol::widget::WidgetScrolled::onChangePropertyShapeHori),
|
||||
m_shaperH(),
|
||||
@ -40,10 +40,10 @@ ewol::widget::WidgetScrolled::WidgetScrolled() :
|
||||
}
|
||||
}
|
||||
|
||||
void ewol::widget::WidgetScrolled::init(const std::string& _shaperName) {
|
||||
void ewol::widget::WidgetScrolled::init() {
|
||||
ewol::Widget::init();
|
||||
propertyShapeVert.set(_shaperName);
|
||||
propertyShapeHori.set(_shaperName);
|
||||
propertyShapeVert.notifyChange();
|
||||
propertyShapeHori.notifyChange();
|
||||
}
|
||||
|
||||
ewol::widget::WidgetScrolled::~WidgetScrolled() {
|
||||
|
@ -71,7 +71,7 @@ namespace ewol {
|
||||
* @param[in] _shaperName Shaper name if the scrolled widget.
|
||||
*/
|
||||
WidgetScrolled();
|
||||
void init(const std::string& _shaperName="{ewol}THEME:GUI:WidgetScrolled.json");
|
||||
void init();
|
||||
public:
|
||||
DECLARE_WIDGET_FACTORY(WidgetScrolled, "WidgetScrolled");
|
||||
/**
|
||||
|
@ -32,14 +32,10 @@ ewol::widget::Windows::Windows() :
|
||||
if (m_colorProperty != nullptr) {
|
||||
m_colorBg = m_colorProperty->request("background");
|
||||
}
|
||||
propertyCanFocus.setDirectCheck(true);
|
||||
//KeyboardShow(KEYBOARD_MODE_CODE);
|
||||
}
|
||||
|
||||
void ewol::widget::Windows::init() {
|
||||
ewol::Widget::init();
|
||||
propertyCanFocus.set(true);
|
||||
}
|
||||
|
||||
ewol::widget::Windows::~Windows() {
|
||||
m_subWidget.reset();
|
||||
m_popUpWidgetList.clear();
|
||||
|
@ -25,7 +25,6 @@ namespace ewol {
|
||||
int32_t m_colorBg; //!< Default background color of the windows
|
||||
protected:
|
||||
Windows();
|
||||
void init();
|
||||
public:
|
||||
virtual ~Windows();
|
||||
// internal event at ewol system :
|
||||
|
@ -32,7 +32,8 @@ ewol::widget::ColorChooser::ColorChooser() :
|
||||
}
|
||||
|
||||
void ewol::widget::ColorChooser::init() {
|
||||
ewol::widget::Sizer::init(ewol::widget::Sizer::modeVert);
|
||||
ewol::widget::Sizer::init();
|
||||
propertyMode.set(ewol::widget::Sizer::modeVert);
|
||||
propertyLockExpand.set(bvec2(true,true));
|
||||
m_widgetColorBar = ewol::widget::ColorBar::create();
|
||||
m_widgetColorBar->signalChange.connect(shared_from_this(), &ewol::widget::ColorChooser::onCallbackColorChange);
|
||||
|
@ -45,20 +45,22 @@ void ewol::widget::Parameter::init() {
|
||||
propertyMinSize.set(gale::Dimension(vec2(80, 80), gale::Dimension::Pourcent));
|
||||
#endif
|
||||
|
||||
mySizerVert = ewol::widget::Sizer::create(widget::Sizer::modeVert);
|
||||
mySizerVert = ewol::widget::Sizer::create();
|
||||
if (mySizerVert == nullptr) {
|
||||
EWOL_ERROR("Can not allocate widget == > display might be in error");
|
||||
} else {
|
||||
EWOL_INFO("add widget");
|
||||
mySizerVert->propertyMode.set(widget::Sizer::modeVert);
|
||||
mySizerVert->propertyLockExpand.set(bvec2(true,true));
|
||||
mySizerVert->propertyExpand.set(bvec2(true,true));
|
||||
// set it in the pop-up-system :
|
||||
setSubWidget(mySizerVert);
|
||||
|
||||
mySizerHori = ewol::widget::Sizer::create(widget::Sizer::modeHori);
|
||||
mySizerHori = ewol::widget::Sizer::create();
|
||||
if (mySizerHori == nullptr) {
|
||||
EWOL_ERROR("Can not allocate widget == > display might be in error");
|
||||
} else {
|
||||
mySizerHori->propertyMode.set(widget::Sizer::modeHori);
|
||||
mySizerVert->subWidgetAdd(mySizerHori);
|
||||
|
||||
mySpacer = ewol::widget::Spacer::create();
|
||||
@ -73,13 +75,11 @@ void ewol::widget::Parameter::init() {
|
||||
if (tmpButton == nullptr) {
|
||||
EWOL_ERROR("Can not allocate widget == > display might be in error");
|
||||
} else {
|
||||
tmpButton->setSubWidget(ewol::widget::Composer::create(widget::Composer::String,
|
||||
"<composer>\n"
|
||||
" <sizer mode=\"hori\">\n"
|
||||
" <image src=\"{ewol}THEME:GUI:Save.svg\" expand=\"true\" size=\"8,8mm\"/>\n"
|
||||
" <label>Save</label>\n"
|
||||
" </sizer>\n"
|
||||
"</composer>\n"));
|
||||
tmpButton->setSubWidget(ewol::widget::composerGenerateString(
|
||||
"<sizer mode=\"hori\">\n"
|
||||
" <image src=\"{ewol}THEME:GUI:Save.svg\" expand=\"true\" size=\"8,8mm\"/>\n"
|
||||
" <label>Save</label>\n"
|
||||
"</sizer>\n"));
|
||||
tmpButton->signalPressed.connect(shared_from_this(), &ewol::widget::Parameter::onCallbackParameterSave);
|
||||
mySizerHori->subWidgetAdd(tmpButton);
|
||||
}
|
||||
@ -97,22 +97,21 @@ void ewol::widget::Parameter::init() {
|
||||
if (tmpButton == nullptr) {
|
||||
EWOL_ERROR("Can not allocate widget == > display might be in error");
|
||||
} else {
|
||||
tmpButton->setSubWidget(ewol::widget::Composer::create(widget::Composer::String,
|
||||
"<composer>\n"
|
||||
" <sizer mode=\"hori\">\n"
|
||||
" <image src=\"{ewol}THEME:GUI:Remove.svg\" expand=\"true\" size=\"8,8mm\"/>\n"
|
||||
" <label>Close</label>\n"
|
||||
" </sizer>\n"
|
||||
"</composer>\n"));
|
||||
tmpButton->setSubWidget(ewol::widget::composerGenerateString(
|
||||
"<sizer mode=\"hori\">\n"
|
||||
" <image src=\"{ewol}THEME:GUI:Remove.svg\" expand=\"true\" size=\"8,8mm\"/>\n"
|
||||
" <label>Close</label>\n"
|
||||
"</sizer>\n"));
|
||||
tmpButton->signalPressed.connect(shared_from_this(), &ewol::widget::Parameter::onCallbackMenuclosed);
|
||||
mySizerHori->subWidgetAdd(tmpButton);
|
||||
}
|
||||
}
|
||||
|
||||
mySizerHori = ewol::widget::Sizer::create(widget::Sizer::modeHori);
|
||||
mySizerHori = ewol::widget::Sizer::create();
|
||||
if (mySizerHori == nullptr) {
|
||||
EWOL_ERROR("Can not allocate widget == > display might be in error");
|
||||
} else {
|
||||
mySizerHori->propertyMode.set(widget::Sizer::modeHori);
|
||||
mySizerVert->subWidgetAdd(mySizerHori);
|
||||
|
||||
m_paramList = ewol::widget::ParameterList::create();
|
||||
@ -135,10 +134,11 @@ void ewol::widget::Parameter::init() {
|
||||
mySizerHori->subWidgetAdd(mySpacer);
|
||||
}
|
||||
|
||||
std::shared_ptr<ewol::widget::Sizer> mySizerVert2 = widget::Sizer::create(widget::Sizer::modeVert);
|
||||
std::shared_ptr<ewol::widget::Sizer> mySizerVert2 = widget::Sizer::create();
|
||||
if (mySizerVert2 == nullptr) {
|
||||
EWOL_ERROR("Can not allocate widget == > display might be in error");
|
||||
} else {
|
||||
mySizerVert2->propertyMode.set(widget::Sizer::modeVert);
|
||||
mySizerHori->subWidgetAdd(mySizerVert2);
|
||||
|
||||
mySpacer = ewol::widget::Spacer::create();
|
||||
@ -173,10 +173,11 @@ void ewol::widget::Parameter::init() {
|
||||
mySizerVert->subWidgetAdd(mySpacer);
|
||||
}
|
||||
|
||||
m_widgetTitle = ewol::widget::Label::create(TRANSLATE(propertyLabelTitle));
|
||||
m_widgetTitle = ewol::widget::Label::create();
|
||||
if (m_widgetTitle == nullptr) {
|
||||
EWOL_ERROR("Can not allocate widget == > display might be in error");
|
||||
} else {
|
||||
m_widgetTitle->propertyValue.set(TRANSLATE(propertyLabelTitle));
|
||||
m_widgetTitle->propertyExpand.set(bvec2(true,false));
|
||||
mySizerVert->subWidgetAdd(m_widgetTitle);
|
||||
}
|
||||
@ -219,10 +220,11 @@ void ewol::widget::Parameter::menuAdd(std::string _label, std::string _image, st
|
||||
m_wSlider->subWidgetAdd(_associateWidget);
|
||||
} else {
|
||||
EWOL_DEBUG("Associate an empty widget on it ...");
|
||||
std::shared_ptr<ewol::widget::Label> myLabel = widget::Label::create(std::string("No widget for : ") + _label);
|
||||
std::shared_ptr<ewol::widget::Label> myLabel = widget::Label::create();
|
||||
if (nullptr == myLabel) {
|
||||
EWOL_ERROR("Can not allocate widget == > display might be in error");
|
||||
} else {
|
||||
myLabel->propertyValue.set(std::string("No widget for : ") + _label);
|
||||
myLabel->propertyExpand.set(bvec2(true,true));
|
||||
m_wSlider->subWidgetAdd(myLabel);
|
||||
}
|
||||
|
@ -36,6 +36,7 @@ void ewol::widget::ParameterList::init() {
|
||||
ewol::widget::WidgetScrolled::init();
|
||||
propertyCanFocus.set(true);
|
||||
}
|
||||
|
||||
ewol::widget::ParameterList::~ParameterList() {
|
||||
//clean all the object
|
||||
for (size_t iii=0; iii<m_listOObject.size(); iii++) {
|
||||
|
@ -14,16 +14,13 @@
|
||||
#undef __class__
|
||||
#define __class__ "widget::SpinBase"
|
||||
|
||||
void ewol::widget::SpinBase::init(ewol::widget::Manager& _widgetManager) {
|
||||
|
||||
}
|
||||
|
||||
ewol::widget::SpinBase::SpinBase() :
|
||||
propertyShape(this, "shape",
|
||||
"",
|
||||
"shape for the display",
|
||||
&ewol::widget::SpinBase::onChangePropertyShape),
|
||||
propertySpinMode(this, "mode",
|
||||
propertySpinMode(this, "spin-mode",
|
||||
ewol::widget::spinPosition_RightRight,
|
||||
"The display spin mode",
|
||||
&ewol::widget::SpinBase::onChangePropertySpinMode),
|
||||
@ -32,6 +29,7 @@ ewol::widget::SpinBase::SpinBase() :
|
||||
m_confIdDownShaper(-1),
|
||||
m_confIdUpData(-1),
|
||||
m_confIdDownData(-1) {
|
||||
|
||||
addObjectType("ewol::widget::SpinBase");
|
||||
propertySpinMode.add(ewol::widget::spinPosition_noneNone, "none-none");
|
||||
propertySpinMode.add(ewol::widget::spinPosition_noneRight, "none-right");
|
||||
@ -39,20 +37,13 @@ ewol::widget::SpinBase::SpinBase() :
|
||||
propertySpinMode.add(ewol::widget::spinPosition_leftRight, "left-right");
|
||||
propertySpinMode.add(ewol::widget::spinPosition_leftLeft, "left-left");
|
||||
propertySpinMode.add(ewol::widget::spinPosition_RightRight, "right-right");
|
||||
propertyLockExpand.setDirectCheck(bvec2(true,true));
|
||||
propertyGravity.setDirectCheck(gravity_center);
|
||||
}
|
||||
|
||||
void ewol::widget::SpinBase::init(const std::unordered_map<std::string,eproperty::Variant>& _listProperty) {
|
||||
ewol::widget::Sizer::init(_listProperty);
|
||||
|
||||
}
|
||||
|
||||
void ewol::widget::SpinBase::init(enum ewol::widget::spinPosition _mode,
|
||||
const std::string& _shaperName) {
|
||||
ewol::widget::Sizer::init(ewol::widget::Sizer::modeHori);
|
||||
propertyLockExpand.set(bvec2(true,true));
|
||||
propertyShape.set(_shaperName);
|
||||
propertySpinMode.set(_mode);
|
||||
propertyGravity.set(gravity_center);
|
||||
void ewol::widget::SpinBase::init() {
|
||||
ewol::widget::Sizer::init();
|
||||
propertyShape.notifyChange();
|
||||
updateGui();
|
||||
}
|
||||
|
||||
@ -88,7 +79,7 @@ void ewol::widget::SpinBase::updateGui() {
|
||||
shaper = m_config->getString(m_confIdEntryShaper);
|
||||
EWOL_VERBOSE("shaper entry : " << shaper);
|
||||
}
|
||||
m_widgetEntry = ewol::widget::Entry::create("", shaper);
|
||||
m_widgetEntry = ewol::widget::Entry::create("shape", shaper);
|
||||
if (m_widgetEntry != nullptr) {
|
||||
m_widgetEntry->propertyExpand.set(bvec2(true,false));
|
||||
m_widgetEntry->propertyFill.set(bvec2(true,true));
|
||||
@ -100,12 +91,12 @@ void ewol::widget::SpinBase::updateGui() {
|
||||
shaper = m_config->getString(m_confIdDownShaper);
|
||||
EWOL_VERBOSE("shaper button DOWN : " << shaper);
|
||||
}
|
||||
m_widgetButtonDown = ewol::widget::Button::create(shaper);
|
||||
m_widgetButtonDown = ewol::widget::Button::create("shape", shaper);
|
||||
if (m_widgetButtonDown != nullptr) {
|
||||
m_widgetButtonDown->propertyExpand.set(bvec2(false,false));
|
||||
m_widgetButtonDown->propertyFill.set(bvec2(true,true));
|
||||
std::string data = m_config->getString(m_confIdDownData);
|
||||
std::shared_ptr<ewol::Widget> widget = ewol::widget::composerGenerate(ewol::widget::Composer::String, data);
|
||||
std::shared_ptr<ewol::Widget> widget = ewol::widget::composerGenerateString(data);
|
||||
m_widgetButtonDown->setSubWidget(widget);
|
||||
}
|
||||
}
|
||||
@ -115,12 +106,12 @@ void ewol::widget::SpinBase::updateGui() {
|
||||
shaper = m_config->getString(m_confIdUpShaper);
|
||||
EWOL_VERBOSE("shaper button UP : " << shaper);
|
||||
}
|
||||
m_widgetButtonUp = ewol::widget::Button::create(shaper);
|
||||
m_widgetButtonUp = ewol::widget::Button::create("shape", shaper);
|
||||
if (m_widgetButtonUp != nullptr) {
|
||||
m_widgetButtonUp->propertyExpand.set(bvec2(false,false));
|
||||
m_widgetButtonUp->propertyFill.set(bvec2(true,true));
|
||||
std::string data = m_config->getString(m_confIdUpData);
|
||||
std::shared_ptr<ewol::Widget> widget = ewol::widget::composerGenerate(ewol::widget::Composer::String, data);
|
||||
std::shared_ptr<ewol::Widget> widget = ewol::widget::composerGenerateString(data);
|
||||
m_widgetButtonUp->setSubWidget(widget);
|
||||
}
|
||||
}
|
||||
|
@ -65,11 +65,7 @@ namespace ewol {
|
||||
eproperty::Value<std::string> propertyShape; //!< Shape of the widget
|
||||
eproperty::List<enum ewol::widget::spinPosition> propertySpinMode; //!< How to display the spin base
|
||||
public:
|
||||
/**
|
||||
* @brief Main call of recording the widget on the List of "widget named creator"
|
||||
*/
|
||||
static void init(ewol::widget::Manager& _widgetManager);
|
||||
public:
|
||||
UN_DECLARE_FACTORY(SpinBase);
|
||||
protected:
|
||||
std::shared_ptr<ewol::resource::ConfigFile> m_config;
|
||||
int32_t m_confIdEntryShaper;
|
||||
@ -83,9 +79,7 @@ namespace ewol {
|
||||
* @param[in] _mode The mode to display the elements
|
||||
*/
|
||||
SpinBase();
|
||||
void init(enum ewol::widget::spinPosition _mode,
|
||||
const std::string& _shaperName);
|
||||
void init(const std::unordered_map<std::string,eproperty::Variant>& _listProperty);
|
||||
void init();
|
||||
public:
|
||||
/**
|
||||
* @brief Destructor
|
||||
|
@ -29,11 +29,12 @@ void ewol::widget::StdPopUp::init() {
|
||||
std::shared_ptr<ewol::widget::Sizer> mySizerVert;
|
||||
std::shared_ptr<ewol::widget::Spacer> mySpacer;
|
||||
|
||||
mySizerVert = ewol::widget::Sizer::create(widget::Sizer::modeVert);
|
||||
mySizerVert = ewol::widget::Sizer::create();
|
||||
// set it in the pop-up-system :
|
||||
setSubWidget(mySizerVert);
|
||||
|
||||
m_subBar = ewol::widget::Sizer::create(widget::Sizer::modeHori);
|
||||
mySizerVert->propertyMode.set(widget::Sizer::modeVert);
|
||||
m_subBar = ewol::widget::Sizer::create();
|
||||
m_subBar->propertyMode.set(widget::Sizer::modeHori);
|
||||
m_subBar->propertyLockExpand.set(bvec2(true,true));
|
||||
m_subBar->propertyExpand.set(bvec2(true,false));
|
||||
mySizerVert->subWidgetAdd(m_subBar);
|
||||
@ -52,7 +53,8 @@ void ewol::widget::StdPopUp::init() {
|
||||
mySpacer->propertyMinSize.set(gale::Dimension(vec2(0,5),gale::Dimension::Pixel));
|
||||
mySizerVert->subWidgetAdd(mySpacer);
|
||||
|
||||
m_comment = ewol::widget::Label::create("No Label");
|
||||
m_comment = ewol::widget::Label::create();
|
||||
m_comment->propertyValue.set("No Label");
|
||||
m_comment->propertyExpand.set(bvec2(true,true));
|
||||
mySizerVert->subWidgetAdd(m_comment);
|
||||
|
||||
@ -67,7 +69,8 @@ void ewol::widget::StdPopUp::init() {
|
||||
mySpacer->propertyMinSize.set(gale::Dimension(vec2(0,3),gale::Dimension::Pixel));
|
||||
mySizerVert->subWidgetAdd(mySpacer);
|
||||
|
||||
m_title = ewol::widget::Label::create("<bold>Message</bold>");
|
||||
m_title = ewol::widget::Label::create();
|
||||
m_title->propertyValue.set("<bold>Message</bold>");
|
||||
m_title->propertyExpand.set(bvec2(true,false));
|
||||
m_title->propertyFill.set(bvec2(true,true));
|
||||
mySizerVert->subWidgetAdd(m_title);
|
||||
@ -103,7 +106,7 @@ std::shared_ptr<ewol::widget::Button> ewol::widget::StdPopUp::addButton(const st
|
||||
EWOL_ERROR("Can not allocate new button ...");
|
||||
return nullptr;
|
||||
}
|
||||
myButton->setSubWidget(ewol::widget::Label::create(_text));
|
||||
myButton->setSubWidget(ewol::widget::Label::create("value", _text));
|
||||
if(_autoExit == true) {
|
||||
myButton->signalPressed.connect(shared_from_this(), &ewol::widget::StdPopUp::onCallBackButtonExit);
|
||||
}
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include <ewol/widget/meta/Parameter.h>
|
||||
#include <ewol/widget/Select.h>
|
||||
#include <ewol/widget/Manager.h>
|
||||
#include <ewol/widget/Spin.h>
|
||||
#include <ewol/context/Context.h>
|
||||
#include <appl/TestDistanceField.h>
|
||||
#include <etk/os/FSNode.h>
|
||||
@ -48,7 +49,8 @@ appl::MainWindows::MainWindows() :
|
||||
void appl::MainWindows::init() {
|
||||
ewol::widget::Windows::init();
|
||||
|
||||
m_composer = ewol::widget::Composer::create(ewol::widget::Composer::file, "DATA:gui.xml");
|
||||
m_composer = ewol::widget::Composer::create();
|
||||
m_composer->loadFromFile("DATA:gui.xml");
|
||||
setSubWidget(m_composer);
|
||||
externSubBind(m_composer, ewol::widget::Button, "appl-theme-toggle", signalValue, shared_from_this(), &appl::MainWindows::onCallbackThemeChange);
|
||||
externSubBind(m_composer, ewol::widget::Button, "appl-previous-widget", signalPressed, shared_from_this(), &appl::MainWindows::onCallbackWidgetChange, -1);
|
||||
@ -183,12 +185,16 @@ void appl::MainWindows::onCallbackWidgetChange(int32_t _increment) {
|
||||
break;
|
||||
}
|
||||
|
||||
m_subWidget = ewol::widget::SpinBase::create(std::unordered_map<std::string,eproperty::Variant>({{std::string("name"), eproperty::Variant(std::string("plop"))}}));
|
||||
m_subWidget = ewol::widget::Spin::create("name", std::string("plop"));
|
||||
// wrong: m_subWidget = ewol::widget::SpinBase::create("name", std::string("plop"), 1521);
|
||||
m_subWidget = ewol::widget::Spin::create("name", std::string("plop"),
|
||||
"spin-mode", ewol::widget::spinPosition_RightRight);
|
||||
|
||||
return;
|
||||
|
||||
|
||||
// create the widget with a xml generator (readable for test ...):
|
||||
m_subWidget = ewol::widget::composerGenerate(ewol::widget::Composer::String, tmpConstruct);
|
||||
m_subWidget = ewol::widget::composerGenerateString(tmpConstruct);
|
||||
if (m_subWidget != nullptr) {
|
||||
m_sizerVert->subWidgetReplace(oldWidget, m_subWidget);
|
||||
}
|
||||
@ -215,7 +221,8 @@ void appl::MainWindows::updateProperty() {
|
||||
if (m_subWidget == nullptr) {
|
||||
return;
|
||||
}
|
||||
std::shared_ptr<ewol::widget::Label> widget = ewol::widget::Label::create(m_subWidget->getObjectType());
|
||||
std::shared_ptr<ewol::widget::Label> widget = ewol::widget::Label::create();
|
||||
widget->propertyValue.set(m_subWidget->getObjectType());
|
||||
m_sizerDynamic->subWidgetAdd(widget);
|
||||
addSpacer(m_sizerDynamic, etk::color::red);
|
||||
for (size_t iii=0; iii<m_subWidget->getPropertyCount(); ++iii) {
|
||||
@ -224,13 +231,15 @@ void appl::MainWindows::updateProperty() {
|
||||
APPL_WARNING("Parameter EMPTY . " << iii << " : nullptr");
|
||||
continue;
|
||||
}
|
||||
std::shared_ptr<ewol::widget::Sizer> widgetSizer = ewol::widget::Sizer::create(ewol::widget::Sizer::modeHori);
|
||||
std::shared_ptr<ewol::widget::Sizer> widgetSizer = ewol::widget::Sizer::create();
|
||||
if (widgetSizer != nullptr) {
|
||||
widgetSizer->propertyMode.set(ewol::widget::Sizer::modeHori);
|
||||
widgetSizer->propertyExpand.set(bvec2(true,false));
|
||||
widgetSizer->propertyFill.set(bvec2(true,true));
|
||||
m_sizerDynamic->subWidgetAddStart(widgetSizer);
|
||||
|
||||
std::shared_ptr<ewol::widget::Label> widget = ewol::widget::Label::create(param->getName() + ":");
|
||||
std::shared_ptr<ewol::widget::Label> widget = ewol::widget::Label::create();
|
||||
widget->propertyValue.set(param->getName() + ":");
|
||||
widgetSizer->subWidgetAdd(widget);
|
||||
//addSpacer(widgetSizer, etk::color::purple);
|
||||
// Main part TODO: ...
|
||||
@ -274,7 +283,8 @@ void appl::MainWindows::updateProperty() {
|
||||
paramValue->set(lastValueInterpreted);
|
||||
return;
|
||||
});
|
||||
std::shared_ptr<ewol::widget::Label> widgetLabel = ewol::widget::Label::create("x");
|
||||
std::shared_ptr<ewol::widget::Label> widgetLabel = ewol::widget::Label::create();
|
||||
widgetLabel->propertyValue.set("x");
|
||||
widgetTmp->setSubWidget(widgetLabel);
|
||||
|
||||
widgetTmp = ewol::widget::CheckBox::create();
|
||||
@ -287,7 +297,8 @@ void appl::MainWindows::updateProperty() {
|
||||
paramValue->set(lastValueInterpreted);
|
||||
return;
|
||||
});
|
||||
widgetLabel = ewol::widget::Label::create("y");
|
||||
widgetLabel = ewol::widget::Label::create();
|
||||
widgetLabel->propertyValue.set("y");
|
||||
widgetTmp->setSubWidget(widgetLabel);
|
||||
} else if (type == typeid(ivec2).name()) {
|
||||
type = "ivec2";
|
||||
|
Loading…
x
Reference in New Issue
Block a user