[DEV] review translation methodologe and position
This commit is contained in:
parent
2abb546c5e
commit
f1a0b784f6
@ -1,28 +0,0 @@
|
|||||||
/**
|
|
||||||
* @author Edouard DUPIN
|
|
||||||
*
|
|
||||||
* @copyright 2011, Edouard DUPIN, all right reserved
|
|
||||||
*
|
|
||||||
* @license APACHE v2.0 (see license file)
|
|
||||||
*/
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <etk/types.h>
|
|
||||||
#include <vector>
|
|
||||||
#include <exml/exml.h>
|
|
||||||
#include <mutex>
|
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
namespace ewol {
|
|
||||||
template<class TYPE>
|
|
||||||
using SharedPtr = std::shared_ptr<TYPE>;
|
|
||||||
template<class TYPE>
|
|
||||||
using WeakPtr = std::weak_ptr<TYPE>;
|
|
||||||
template<class TYPE>
|
|
||||||
using EnableSharedFromThis = std::enable_shared_from_this<TYPE>;
|
|
||||||
/*
|
|
||||||
template<class TYPE>
|
|
||||||
using DynamicPointerCastZZ = std::dynamic_pointer_cast<TYPE>;
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
|||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
#include <ewol/debug.h>
|
#include <ewol/debug.h>
|
||||||
#include <ewol/memory.h>
|
#include <ememory/memory.h>
|
||||||
#include <eproperty/Interface.h>
|
#include <eproperty/Interface.h>
|
||||||
#include <eproperty/Value.h>
|
#include <eproperty/Value.h>
|
||||||
#include <eproperty/Range.h>
|
#include <eproperty/Range.h>
|
||||||
@ -32,12 +32,12 @@ namespace ewol {
|
|||||||
class Context;
|
class Context;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class TYPE_OBJECT> static void baseInit(const ewol::SharedPtr<TYPE_OBJECT>& _object) {
|
template<class TYPE_OBJECT> static void baseInit(const ememory::SharedPtr<TYPE_OBJECT>& _object) {
|
||||||
// end of recurtion
|
// end of recurtion
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class TYPE_OBJECT, class TYPE_VAL, class ... TYPE> static void baseInit(const ewol::SharedPtr<TYPE_OBJECT>& _object, const std::string& _name, const TYPE_VAL& _val, TYPE&& ... _all ) {
|
template<class TYPE_OBJECT, class TYPE_VAL, class ... TYPE> static void baseInit(const ememory::SharedPtr<TYPE_OBJECT>& _object, const std::string& _name, const TYPE_VAL& _val, TYPE&& ... _all ) {
|
||||||
eproperty::Property* prop(nullptr);
|
eproperty::Property* prop(nullptr);
|
||||||
eproperty::PropertyType<TYPE_VAL>* propType(nullptr);
|
eproperty::PropertyType<TYPE_VAL>* propType(nullptr);
|
||||||
if (_object == nullptr) {
|
if (_object == nullptr) {
|
||||||
@ -61,17 +61,15 @@ exit_on_error:
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define UN_DECLARE_FACTORY(className) \
|
#define UN_DECLARE_FACTORY(className) \
|
||||||
template<class ... TYPE> static ewol::SharedPtr<className> create(const TYPE& ... _all) = delete;
|
template<class ... EWOL_FACTORY_CREATE_TYPE> static ememory::SharedPtr<className> create(const EWOL_FACTORY_CREATE_TYPE& ... _all) = delete;
|
||||||
|
|
||||||
#define DECLARE_FACTORY(className) \
|
#define DECLARE_FACTORY(className) \
|
||||||
template<class ... TYPE> static ewol::SharedPtr<className> create(const TYPE& ... _all) { \
|
template<class ... EWOL_FACTORY_CREATE_TYPE> static ememory::SharedPtr<className> create(const EWOL_FACTORY_CREATE_TYPE& ... _all) { \
|
||||||
ewol::SharedPtr<className> object(new className()); \
|
ememory::SharedPtr<className> object(new className()); \
|
||||||
if (object == nullptr) { \
|
if (object == nullptr) { \
|
||||||
EWOL_ERROR("Factory error"); \
|
EWOL_ERROR("Factory error"); \
|
||||||
return nullptr; \
|
return nullptr; \
|
||||||
} \
|
} \
|
||||||
/*object->initNoValue();*/ \
|
|
||||||
/*baseInit(object, std::forward<TYPE>(_all)... ); */ \
|
|
||||||
baseInit(object, _all... ); \
|
baseInit(object, _all... ); \
|
||||||
object->init(); \
|
object->init(); \
|
||||||
if (object->objectHasBeenCorectlyInit() == false) { \
|
if (object->objectHasBeenCorectlyInit() == false) { \
|
||||||
@ -81,30 +79,40 @@ exit_on_error:
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define DECLARE_SINGLE_FACTORY(className, uniqueName) \
|
#define DECLARE_SINGLE_FACTORY(className, uniqueName) \
|
||||||
template<class ... TYPE> static ewol::SharedPtr<className> create(const TYPE& ... _all) { \
|
template<class ... EWOL_FACTORY_CREATE_TYPE> static ememory::SharedPtr<className> create(const EWOL_FACTORY_CREATE_TYPE& ... _all) { \
|
||||||
ewol::SharedPtr<className> object; \
|
ememory::SharedPtr<className> object; \
|
||||||
ewol::SharedPtr<ewol::Object> object2 = getObjectNamed(uniqueName); \
|
ememory::SharedPtr<ewol::Object> object2 = getObjectNamed(uniqueName); \
|
||||||
if (object2 != nullptr) { \
|
if (object2 != nullptr) { \
|
||||||
object = std::dynamic_pointer_cast<className>(object2); \
|
object = std::dynamic_pointer_cast<className>(object2); \
|
||||||
if (object == nullptr) { \
|
if (object == nullptr) { \
|
||||||
GALE_CRITICAL("Request object element: '" << uniqueName << "' With the wrong type (dynamic cast error)"); \
|
EWOL_CRITICAL("Request object element: '" << uniqueName << "' With the wrong type (dynamic cast error)"); \
|
||||||
return nullptr; \
|
return nullptr; \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
if (object != nullptr) { \
|
if (object != nullptr) { \
|
||||||
return object; \
|
return object; \
|
||||||
} \
|
} \
|
||||||
return create("name", std::string(uniqueName), _all...); \
|
object = ememory::SharedPtr<className>(new className()); \
|
||||||
|
if (object == nullptr) { \
|
||||||
|
EWOL_ERROR("Factory error"); \
|
||||||
|
return nullptr; \
|
||||||
|
} \
|
||||||
|
baseInit(object, "name", std::string(uniqueName), _all... ); \
|
||||||
|
object->init(); \
|
||||||
|
if (object->objectHasBeenCorectlyInit() == false) { \
|
||||||
|
EWOL_CRITICAL("Object Is not correctly init : " << #className ); \
|
||||||
|
} \
|
||||||
|
return object; \
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace ewol {
|
namespace ewol {
|
||||||
using ObjectShared = ewol::SharedPtr<ewol::Object>;
|
using ObjectShared = ememory::SharedPtr<ewol::Object>;
|
||||||
using ObjectWeak = ewol::WeakPtr<ewol::Object>;
|
using ObjectWeak = ememory::WeakPtr<ewol::Object>;
|
||||||
/**
|
/**
|
||||||
* @brief Basic message classes for ewol system
|
* @brief Basic message classes for ewol system
|
||||||
* this class mermit at every Object to communicate between them.
|
* this class mermit at every Object to communicate between them.
|
||||||
*/
|
*/
|
||||||
class Object : public ewol::EnableSharedFromThis<Object>,
|
class Object : public ememory::EnableSharedFromThis<Object>,
|
||||||
public eproperty::Interface,
|
public eproperty::Interface,
|
||||||
public esignal::Interface {
|
public esignal::Interface {
|
||||||
public: // Event list
|
public: // Event list
|
||||||
@ -281,7 +289,7 @@ namespace ewol {
|
|||||||
* @brief link on an signal in the subwiget with his name
|
* @brief link on an signal in the subwiget with his name
|
||||||
*/
|
*/
|
||||||
#define subBind(_type, _name, _event, _shared_ptr, _func, ...) do {\
|
#define subBind(_type, _name, _event, _shared_ptr, _func, ...) do {\
|
||||||
ewol::SharedPtr<_type> myObject = std::dynamic_pointer_cast<_type>(getSubObjectNamed(_name)); \
|
ememory::SharedPtr<_type> myObject = std::dynamic_pointer_cast<_type>(getSubObjectNamed(_name)); \
|
||||||
if (myObject != nullptr) { \
|
if (myObject != nullptr) { \
|
||||||
myObject->_event.connect(_shared_ptr, _func, ##__VA_ARGS__); \
|
myObject->_event.connect(_shared_ptr, _func, ##__VA_ARGS__); \
|
||||||
} else { \
|
} else { \
|
||||||
@ -289,8 +297,8 @@ namespace ewol {
|
|||||||
} \
|
} \
|
||||||
} while (false)
|
} while (false)
|
||||||
/*
|
/*
|
||||||
template<class TYPE> void subBind(ewol::SharedPtr<ewol::Object> _obj, void (TYPE::*_func)()) {
|
template<class TYPE> void subBind(ememory::SharedPtr<ewol::Object> _obj, void (TYPE::*_func)()) {
|
||||||
ewol::SharedPtr<TYPE> obj2 = std::dynamic_pointer_cast<TYPE>(_obj);
|
ememory::SharedPtr<TYPE> obj2 = std::dynamic_pointer_cast<TYPE>(_obj);
|
||||||
if (obj2 == nullptr) {
|
if (obj2 == nullptr) {
|
||||||
EWOL_ERROR("Can not connect signal ...");
|
EWOL_ERROR("Can not connect signal ...");
|
||||||
return;
|
return;
|
||||||
@ -306,7 +314,7 @@ namespace ewol {
|
|||||||
* @brief link on an signal in the global object list with his name
|
* @brief link on an signal in the global object list with his name
|
||||||
*/
|
*/
|
||||||
#define globalBind(_type, _name, _event, _obj, _func, ...) do {\
|
#define globalBind(_type, _name, _event, _obj, _func, ...) do {\
|
||||||
ewol::SharedPtr<_type> myObject = std::dynamic_pointer_cast<_type>(ewol::getContext().getEObjectManager().getObjectNamed(_name)); \
|
ememory::SharedPtr<_type> myObject = std::dynamic_pointer_cast<_type>(ewol::getContext().getEObjectManager().getObjectNamed(_name)); \
|
||||||
if (myObject != nullptr) { \
|
if (myObject != nullptr) { \
|
||||||
myObject->_event.connect(_obj, _func, ##__VA_ARGS__); \
|
myObject->_event.connect(_obj, _func, ##__VA_ARGS__); \
|
||||||
} else { \
|
} else { \
|
||||||
@ -318,7 +326,7 @@ namespace ewol {
|
|||||||
* @brief link on an signal in the subWidget of an object with his name
|
* @brief link on an signal in the subWidget of an object with his name
|
||||||
*/
|
*/
|
||||||
#define externSubBind(_object, _type, _name, _event, _obj, _func, ...) do {\
|
#define externSubBind(_object, _type, _name, _event, _obj, _func, ...) do {\
|
||||||
ewol::SharedPtr<_type> myObject = std::dynamic_pointer_cast<_type>(_object->getObjectNamed(_name)); \
|
ememory::SharedPtr<_type> myObject = std::dynamic_pointer_cast<_type>(_object->getObjectNamed(_name)); \
|
||||||
if (myObject != nullptr) { \
|
if (myObject != nullptr) { \
|
||||||
myObject->_event.connect(_obj, _func, ##__VA_ARGS__); \
|
myObject->_event.connect(_obj, _func, ##__VA_ARGS__); \
|
||||||
} else { \
|
} else { \
|
||||||
|
@ -13,8 +13,8 @@
|
|||||||
namespace ewol {
|
namespace ewol {
|
||||||
namespace object {
|
namespace object {
|
||||||
class Worker;
|
class Worker;
|
||||||
using WorkerShared = ewol::SharedPtr<ewol::object::Worker>;
|
using WorkerShared = ememory::SharedPtr<ewol::object::Worker>;
|
||||||
using WorkerWeak = ewol::WeakPtr<ewol::object::Worker>;
|
using WorkerWeak = ememory::WeakPtr<ewol::object::Worker>;
|
||||||
/**
|
/**
|
||||||
* @brief A worker might not been possesed by someone, then the system might keep a pointer on it.
|
* @brief A worker might not been possesed by someone, then the system might keep a pointer on it.
|
||||||
*/
|
*/
|
||||||
|
@ -103,17 +103,44 @@ class LocalInstanceTranslation {
|
|||||||
return m_language;
|
return m_language;
|
||||||
};
|
};
|
||||||
|
|
||||||
const std::string& get(const std::string& _instance) {
|
std::string get(const std::string& _instance) {
|
||||||
loadTranslation();
|
loadTranslation();
|
||||||
if (etk::start_with(_instance, "TRANSLATE:") == false) {
|
EWOL_VERBOSE("Request translate: '" << _instance << "'");
|
||||||
return _instance;
|
// find all iterance of '_T{' ... '}'
|
||||||
|
std::string out;
|
||||||
|
auto itOld = _instance.begin();
|
||||||
|
size_t pos = _instance.find("_T{");
|
||||||
|
while (pos != std::string::npos) {
|
||||||
|
out.append(itOld, _instance.begin() + pos);
|
||||||
|
auto it = _instance.begin() + pos + 3;
|
||||||
|
itOld = it;
|
||||||
|
pos = _instance.find("}", pos);
|
||||||
|
if (pos == std::string::npos) {
|
||||||
|
EWOL_WARNING("missing end translation '}' in: '" << _instance << "'");
|
||||||
|
it = _instance.end();
|
||||||
|
} else {
|
||||||
|
it = _instance.begin() + pos;
|
||||||
}
|
}
|
||||||
auto it = m_translate.find(std::string(_instance.begin() + 9, _instance.end()));
|
std::string basicEmptyValue = std::string(itOld, it);
|
||||||
if (it == m_translate.end()) {
|
auto itTranslate = m_translate.find(basicEmptyValue);
|
||||||
|
if (itTranslate == m_translate.end()) {
|
||||||
EWOL_DEBUG("Can not find tranlation : '" << _instance << "'");
|
EWOL_DEBUG("Can not find tranlation : '" << _instance << "'");
|
||||||
return _instance;
|
out += basicEmptyValue;
|
||||||
|
} else {
|
||||||
|
out += itTranslate->second;
|
||||||
}
|
}
|
||||||
return it->second;
|
if (it != _instance.end()) {
|
||||||
|
itOld = it+1;
|
||||||
|
} else {
|
||||||
|
itOld = it;
|
||||||
|
}
|
||||||
|
pos = _instance.find("_T{", pos);
|
||||||
|
}
|
||||||
|
if (itOld != _instance.end()) {
|
||||||
|
out.append(itOld, _instance.end());
|
||||||
|
}
|
||||||
|
EWOL_VERBOSE(" translation: '" << out << "'");
|
||||||
|
return out;
|
||||||
};
|
};
|
||||||
private:
|
private:
|
||||||
void loadTranslation() {
|
void loadTranslation() {
|
||||||
@ -229,7 +256,7 @@ void ewol::translate::autoDetectLanguage() {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string& ewol::translate::get(const std::string& _instance) {
|
std::string ewol::translate::get(const std::string& _instance) {
|
||||||
return getInstanceTranslation().get(_instance);
|
return getInstanceTranslation().get(_instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ namespace ewol {
|
|||||||
* @brief Set the path folder of the translation files
|
* @brief Set the path folder of the translation files
|
||||||
* @param[in] _lib Library name that the path depend
|
* @param[in] _lib Library name that the path depend
|
||||||
* @param[in] _path ETK generic path (DATA:... or /xxx)
|
* @param[in] _path ETK generic path (DATA:... or /xxx)
|
||||||
* @param[in] _major This path is the major path (The last loaded, the one wichi overload all)
|
* @param[in] _major This path is the major path (The last loaded, the one which overload all)
|
||||||
*/
|
*/
|
||||||
void addPath(const std::string& _lib, const std::string& _path, bool _major = false);
|
void addPath(const std::string& _lib, const std::string& _path, bool _major = false);
|
||||||
/**
|
/**
|
||||||
@ -68,7 +68,7 @@ namespace ewol {
|
|||||||
* @param[in] _instance Text to translate.
|
* @param[in] _instance Text to translate.
|
||||||
* @return The tranlated text.
|
* @return The tranlated text.
|
||||||
*/
|
*/
|
||||||
const std::string& get(const std::string& _instance);
|
std::string get(const std::string& _instance);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
// Here we define a simple macro to Translate all string simply:
|
// Here we define a simple macro to Translate all string simply:
|
||||||
|
@ -21,8 +21,8 @@
|
|||||||
namespace ewol {
|
namespace ewol {
|
||||||
namespace widget {
|
namespace widget {
|
||||||
class Button;
|
class Button;
|
||||||
using ButtonShared = ewol::SharedPtr<ewol::widget::Button>;
|
using ButtonShared = ememory::SharedPtr<ewol::widget::Button>;
|
||||||
using ButtonWeak = ewol::WeakPtr<ewol::widget::Button>;
|
using ButtonWeak = ememory::WeakPtr<ewol::widget::Button>;
|
||||||
/**
|
/**
|
||||||
* @brief a composed button is a button with an inside composed with the specify XML element
|
* @brief a composed button is a button with an inside composed with the specify XML element
|
||||||
* ==> this permit to generate standard element simple
|
* ==> this permit to generate standard element simple
|
||||||
|
@ -20,8 +20,8 @@
|
|||||||
namespace ewol {
|
namespace ewol {
|
||||||
namespace widget {
|
namespace widget {
|
||||||
class ButtonColor;
|
class ButtonColor;
|
||||||
using ButtonColorShared = ewol::SharedPtr<ewol::widget::ButtonColor>;
|
using ButtonColorShared = ememory::SharedPtr<ewol::widget::ButtonColor>;
|
||||||
using ButtonColorWeak = ewol::WeakPtr<ewol::widget::ButtonColor>;
|
using ButtonColorWeak = ememory::WeakPtr<ewol::widget::ButtonColor>;
|
||||||
class ButtonColor : public ewol::Widget {
|
class ButtonColor : public ewol::Widget {
|
||||||
public: // signals
|
public: // signals
|
||||||
esignal::ISignal<etk::Color<>> signalChange;
|
esignal::ISignal<etk::Color<>> signalChange;
|
||||||
|
@ -18,8 +18,8 @@
|
|||||||
namespace ewol {
|
namespace ewol {
|
||||||
namespace widget {
|
namespace widget {
|
||||||
class CheckBox;
|
class CheckBox;
|
||||||
using CheckBoxShared = ewol::SharedPtr<ewol::widget::CheckBox>;
|
using CheckBoxShared = ememory::SharedPtr<ewol::widget::CheckBox>;
|
||||||
using CheckBoxWeak = ewol::WeakPtr<ewol::widget::CheckBox>;
|
using CheckBoxWeak = ememory::WeakPtr<ewol::widget::CheckBox>;
|
||||||
class CheckBox : public ewol::widget::Container2 {
|
class CheckBox : public ewol::widget::Container2 {
|
||||||
public: // Event list
|
public: // Event list
|
||||||
esignal::ISignal<> signalPressed;
|
esignal::ISignal<> signalPressed;
|
||||||
|
@ -18,8 +18,8 @@
|
|||||||
namespace ewol {
|
namespace ewol {
|
||||||
namespace widget {
|
namespace widget {
|
||||||
class ColorBar;
|
class ColorBar;
|
||||||
using ColorBarShared = ewol::SharedPtr<ewol::widget::ColorBar>;
|
using ColorBarShared = ememory::SharedPtr<ewol::widget::ColorBar>;
|
||||||
using ColorBarWeak = ewol::WeakPtr<ewol::widget::ColorBar>;
|
using ColorBarWeak = ememory::WeakPtr<ewol::widget::ColorBar>;
|
||||||
class ColorBar : public ewol::Widget {
|
class ColorBar : public ewol::Widget {
|
||||||
public: // signals
|
public: // signals
|
||||||
esignal::ISignal<etk::Color<>> signalChange;
|
esignal::ISignal<etk::Color<>> signalChange;
|
||||||
|
@ -14,8 +14,8 @@
|
|||||||
namespace ewol {
|
namespace ewol {
|
||||||
namespace widget {
|
namespace widget {
|
||||||
class Composer;
|
class Composer;
|
||||||
using ComposerShared = ewol::SharedPtr<ewol::widget::Composer>;
|
using ComposerShared = ememory::SharedPtr<ewol::widget::Composer>;
|
||||||
using ComposerWeak = ewol::WeakPtr<ewol::widget::Composer>;
|
using ComposerWeak = ememory::WeakPtr<ewol::widget::Composer>;
|
||||||
/**
|
/**
|
||||||
* @ingroup ewolWidgetGroup
|
* @ingroup ewolWidgetGroup
|
||||||
* @brief the composer widget is a widget that create a link on a string.file to parse the data and generate some widget tree
|
* @brief the composer widget is a widget that create a link on a string.file to parse the data and generate some widget tree
|
||||||
|
@ -14,8 +14,8 @@
|
|||||||
namespace ewol {
|
namespace ewol {
|
||||||
namespace widget {
|
namespace widget {
|
||||||
class Container;
|
class Container;
|
||||||
using ContainerShared = ewol::SharedPtr<ewol::widget::Container>;
|
using ContainerShared = ememory::SharedPtr<ewol::widget::Container>;
|
||||||
using ContainerWeak = ewol::WeakPtr<ewol::widget::Container>;
|
using ContainerWeak = ememory::WeakPtr<ewol::widget::Container>;
|
||||||
/**
|
/**
|
||||||
* @ingroup ewolWidgetGroup
|
* @ingroup ewolWidgetGroup
|
||||||
* @brief the Cotainer widget is a widget that have an only one subWidget
|
* @brief the Cotainer widget is a widget that have an only one subWidget
|
||||||
|
@ -15,8 +15,8 @@
|
|||||||
namespace ewol {
|
namespace ewol {
|
||||||
namespace widget {
|
namespace widget {
|
||||||
class Container2;
|
class Container2;
|
||||||
using Container2Shared = ewol::SharedPtr<ewol::widget::Container2>;
|
using Container2Shared = ememory::SharedPtr<ewol::widget::Container2>;
|
||||||
using Container2Weak = ewol::WeakPtr<ewol::widget::Container2>;
|
using Container2Weak = ememory::WeakPtr<ewol::widget::Container2>;
|
||||||
/**
|
/**
|
||||||
* @ingroup ewolWidgetGroup
|
* @ingroup ewolWidgetGroup
|
||||||
* @brief the Cotainer widget is a widget that have an only one subWidget
|
* @brief the Cotainer widget is a widget that have an only one subWidget
|
||||||
|
@ -15,8 +15,8 @@
|
|||||||
namespace ewol {
|
namespace ewol {
|
||||||
namespace widget {
|
namespace widget {
|
||||||
class ContainerN;
|
class ContainerN;
|
||||||
using ContainerNShared = ewol::SharedPtr<ewol::widget::ContainerN>;
|
using ContainerNShared = ememory::SharedPtr<ewol::widget::ContainerN>;
|
||||||
using ContainerNWeak = ewol::WeakPtr<ewol::widget::ContainerN>;
|
using ContainerNWeak = ememory::WeakPtr<ewol::widget::ContainerN>;
|
||||||
/**
|
/**
|
||||||
* @ingroup ewolWidgetGroup
|
* @ingroup ewolWidgetGroup
|
||||||
* @brief the Cotainer widget is a widget that have an only one subWidget
|
* @brief the Cotainer widget is a widget that have an only one subWidget
|
||||||
|
@ -18,8 +18,8 @@
|
|||||||
namespace ewol {
|
namespace ewol {
|
||||||
namespace widget {
|
namespace widget {
|
||||||
class ContextMenu;
|
class ContextMenu;
|
||||||
using ContextMenuShared = ewol::SharedPtr<ewol::widget::ContextMenu>;
|
using ContextMenuShared = ememory::SharedPtr<ewol::widget::ContextMenu>;
|
||||||
using ContextMenuWeak = ewol::WeakPtr<ewol::widget::ContextMenu>;
|
using ContextMenuWeak = ememory::WeakPtr<ewol::widget::ContextMenu>;
|
||||||
/**
|
/**
|
||||||
* @ingroup ewolWidgetGroup
|
* @ingroup ewolWidgetGroup
|
||||||
*/
|
*/
|
||||||
|
@ -21,8 +21,8 @@
|
|||||||
namespace ewol {
|
namespace ewol {
|
||||||
namespace widget {
|
namespace widget {
|
||||||
class Entry;
|
class Entry;
|
||||||
using EntryShared = ewol::SharedPtr<ewol::widget::Entry>;
|
using EntryShared = ememory::SharedPtr<ewol::widget::Entry>;
|
||||||
using EntryWeak = ewol::WeakPtr<ewol::widget::Entry>;
|
using EntryWeak = ememory::WeakPtr<ewol::widget::Entry>;
|
||||||
/**
|
/**
|
||||||
* @ingroup ewolWidgetGroup
|
* @ingroup ewolWidgetGroup
|
||||||
* @brief Entry box display :
|
* @brief Entry box display :
|
||||||
|
@ -16,8 +16,8 @@
|
|||||||
namespace ewol {
|
namespace ewol {
|
||||||
namespace widget {
|
namespace widget {
|
||||||
class Gird;
|
class Gird;
|
||||||
using GirdShared = ewol::SharedPtr<ewol::widget::Gird>;
|
using GirdShared = ememory::SharedPtr<ewol::widget::Gird>;
|
||||||
using GirdWeak = ewol::WeakPtr<ewol::widget::Gird>;
|
using GirdWeak = ememory::WeakPtr<ewol::widget::Gird>;
|
||||||
/**
|
/**
|
||||||
* @ingroup ewolWidgetGroup
|
* @ingroup ewolWidgetGroup
|
||||||
*/
|
*/
|
||||||
|
@ -18,8 +18,8 @@
|
|||||||
namespace ewol {
|
namespace ewol {
|
||||||
namespace widget {
|
namespace widget {
|
||||||
class Image;
|
class Image;
|
||||||
using ImageShared = ewol::SharedPtr<ewol::widget::Image>;
|
using ImageShared = ememory::SharedPtr<ewol::widget::Image>;
|
||||||
using ImageWeak = ewol::WeakPtr<ewol::widget::Image>;
|
using ImageWeak = ememory::WeakPtr<ewol::widget::Image>;
|
||||||
/**
|
/**
|
||||||
* @ingroup ewolWidgetGroup
|
* @ingroup ewolWidgetGroup
|
||||||
*/
|
*/
|
||||||
|
@ -18,8 +18,8 @@
|
|||||||
namespace ewol {
|
namespace ewol {
|
||||||
namespace widget {
|
namespace widget {
|
||||||
class Joystick;
|
class Joystick;
|
||||||
using JoystickShared = ewol::SharedPtr<ewol::widget::Joystick>;
|
using JoystickShared = ememory::SharedPtr<ewol::widget::Joystick>;
|
||||||
using JoystickWeak = ewol::WeakPtr<ewol::widget::Joystick>;
|
using JoystickWeak = ememory::WeakPtr<ewol::widget::Joystick>;
|
||||||
/**
|
/**
|
||||||
* @ingroup ewolWidgetGroup
|
* @ingroup ewolWidgetGroup
|
||||||
*/
|
*/
|
||||||
|
@ -18,6 +18,10 @@
|
|||||||
// TODO : Remove the label name in the constructor ...
|
// TODO : Remove the label name in the constructor ...
|
||||||
ewol::widget::Label::Label() :
|
ewol::widget::Label::Label() :
|
||||||
signalPressed(this, "pressed", ""),
|
signalPressed(this, "pressed", ""),
|
||||||
|
propertyAutoTranslate(this, "auto-translate",
|
||||||
|
true,
|
||||||
|
"Translate the String with the marker _{T:xxxxxx}",
|
||||||
|
&ewol::widget::Label::onChangePropertyAutoTranslate),
|
||||||
propertyValue(this, "value",
|
propertyValue(this, "value",
|
||||||
"",
|
"",
|
||||||
"displayed value string",
|
"displayed value string",
|
||||||
@ -142,8 +146,15 @@ bool ewol::widget::Label::loadXML(const std::shared_ptr<const exml::Element>& _n
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ewol::widget::Label::onChangePropertyValue() {
|
void ewol::widget::Label::onChangePropertyValue() {
|
||||||
m_value = etk::to_u32string(propertyValue.get());
|
if (*propertyAutoTranslate == true) {
|
||||||
|
m_value = etk::to_u32string(ewol::translate::get(*propertyValue));
|
||||||
|
} else {
|
||||||
|
m_value = etk::to_u32string(*propertyValue);
|
||||||
|
}
|
||||||
markToRedraw();
|
markToRedraw();
|
||||||
requestUpdateSize();
|
requestUpdateSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ewol::widget::Label::onChangePropertyAutoTranslate() {
|
||||||
|
onChangePropertyValue();
|
||||||
|
}
|
||||||
|
@ -18,8 +18,8 @@
|
|||||||
namespace ewol {
|
namespace ewol {
|
||||||
namespace widget {
|
namespace widget {
|
||||||
class Label;
|
class Label;
|
||||||
using LabelShared = ewol::SharedPtr<ewol::widget::Label>;
|
using LabelShared = ememory::SharedPtr<ewol::widget::Label>;
|
||||||
using LabelWeak = ewol::WeakPtr<ewol::widget::Label>;
|
using LabelWeak = ememory::WeakPtr<ewol::widget::Label>;
|
||||||
/**
|
/**
|
||||||
* @ingroup ewolWidgetGroup
|
* @ingroup ewolWidgetGroup
|
||||||
*/
|
*/
|
||||||
@ -27,6 +27,7 @@ namespace ewol {
|
|||||||
public: // signals
|
public: // signals
|
||||||
esignal::ISignal<> signalPressed;
|
esignal::ISignal<> signalPressed;
|
||||||
public: // properties
|
public: // properties
|
||||||
|
eproperty::Value<bool> propertyAutoTranslate; //!< if at true the data is translate automaticaly translate.
|
||||||
eproperty::Value<std::string> propertyValue; //!< decorated text to display.
|
eproperty::Value<std::string> propertyValue; //!< decorated text to display.
|
||||||
private:
|
private:
|
||||||
ewol::compositing::Text m_text; //!< Compositing text element.
|
ewol::compositing::Text m_text; //!< Compositing text element.
|
||||||
@ -55,6 +56,7 @@ namespace ewol {
|
|||||||
virtual bool loadXML(const std::shared_ptr<const exml::Element>& _node);
|
virtual bool loadXML(const std::shared_ptr<const exml::Element>& _node);
|
||||||
protected:
|
protected:
|
||||||
virtual void onChangePropertyValue();
|
virtual void onChangePropertyValue();
|
||||||
|
virtual void onChangePropertyAutoTranslate();
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -15,8 +15,8 @@
|
|||||||
namespace ewol {
|
namespace ewol {
|
||||||
namespace widget {
|
namespace widget {
|
||||||
class Layer;
|
class Layer;
|
||||||
using LayerShared = ewol::SharedPtr<ewol::widget::Layer>;
|
using LayerShared = ememory::SharedPtr<ewol::widget::Layer>;
|
||||||
using LayerWeak = ewol::WeakPtr<ewol::widget::Layer>;
|
using LayerWeak = ememory::WeakPtr<ewol::widget::Layer>;
|
||||||
/**
|
/**
|
||||||
* @ingroup ewolWidgetGroup
|
* @ingroup ewolWidgetGroup
|
||||||
*/
|
*/
|
||||||
|
@ -16,8 +16,8 @@
|
|||||||
namespace ewol {
|
namespace ewol {
|
||||||
namespace widget {
|
namespace widget {
|
||||||
class List;
|
class List;
|
||||||
using ListShared = ewol::SharedPtr<ewol::widget::List>;
|
using ListShared = ememory::SharedPtr<ewol::widget::List>;
|
||||||
using ListWeak = ewol::WeakPtr<ewol::widget::List>;
|
using ListWeak = ememory::WeakPtr<ewol::widget::List>;
|
||||||
/**
|
/**
|
||||||
* @ingroup ewolWidgetGroup
|
* @ingroup ewolWidgetGroup
|
||||||
*/
|
*/
|
||||||
|
@ -15,8 +15,8 @@
|
|||||||
namespace ewol {
|
namespace ewol {
|
||||||
namespace widget {
|
namespace widget {
|
||||||
class ListFileSystem;
|
class ListFileSystem;
|
||||||
using ListFileSystemShared = ewol::SharedPtr<ewol::widget::ListFileSystem>;
|
using ListFileSystemShared = ememory::SharedPtr<ewol::widget::ListFileSystem>;
|
||||||
using ListFileSystemWeak = ewol::WeakPtr<ewol::widget::ListFileSystem>;
|
using ListFileSystemWeak = ememory::WeakPtr<ewol::widget::ListFileSystem>;
|
||||||
/**
|
/**
|
||||||
* @brief Generic display folder class. This widget display the content of a single folder :
|
* @brief Generic display folder class. This widget display the content of a single folder :
|
||||||
*/
|
*/
|
||||||
|
@ -99,7 +99,9 @@ int32_t ewol::widget::Menu::add(int32_t _parent,
|
|||||||
composeString+="</sizer>\n";
|
composeString+="</sizer>\n";
|
||||||
myButton->setSubWidget(ewol::widget::composerGenerateString(composeString));
|
myButton->setSubWidget(ewol::widget::composerGenerateString(composeString));
|
||||||
} else {
|
} else {
|
||||||
myButton->setSubWidget(ewol::widget::Label::create("value", "<left>" + tmpObject.m_label + "</left>") );
|
ewol::widget::LabelShared label = ewol::widget::Label::create();
|
||||||
|
label->propertyValue.set("<left>" + tmpObject.m_label + "</left>");
|
||||||
|
myButton->setSubWidget(label);
|
||||||
}
|
}
|
||||||
// add it in the widget list
|
// add it in the widget list
|
||||||
ewol::widget::Sizer::subWidgetAdd(myButton);
|
ewol::widget::Sizer::subWidgetAdd(myButton);
|
||||||
@ -174,8 +176,9 @@ void ewol::widget::Menu::onButtonPressed(ewol::widget::ButtonWeak _button) {
|
|||||||
tmpContext->setPositionMark(ewol::widget::ContextMenu::markTop, newPosition);
|
tmpContext->setPositionMark(ewol::widget::ContextMenu::markTop, newPosition);
|
||||||
ewol::widget::SizerShared mySizer;
|
ewol::widget::SizerShared mySizer;
|
||||||
ewol::widget::ButtonShared myButton;
|
ewol::widget::ButtonShared myButton;
|
||||||
mySizer = ewol::widget::Sizer::create("mode", widget::Sizer::modeVert);
|
mySizer = ewol::widget::Sizer::create();
|
||||||
if (mySizer != nullptr) {
|
if (mySizer != nullptr) {
|
||||||
|
mySizer->propertyMode.set(widget::Sizer::modeVert);
|
||||||
mySizer->propertyLockExpand.set(vec2(true,true));
|
mySizer->propertyLockExpand.set(vec2(true,true));
|
||||||
mySizer->propertyFill.set(vec2(true,true));
|
mySizer->propertyFill.set(vec2(true,true));
|
||||||
// set it in the pop-up-system:
|
// set it in the pop-up-system:
|
||||||
|
@ -28,8 +28,8 @@ namespace ewol {
|
|||||||
std::string m_message;
|
std::string m_message;
|
||||||
};
|
};
|
||||||
class Menu;
|
class Menu;
|
||||||
using MenuShared = ewol::SharedPtr<ewol::widget::Menu>;
|
using MenuShared = ememory::SharedPtr<ewol::widget::Menu>;
|
||||||
using MenuWeak = ewol::WeakPtr<ewol::widget::Menu>;
|
using MenuWeak = ememory::WeakPtr<ewol::widget::Menu>;
|
||||||
/**
|
/**
|
||||||
* @ingroup ewolWidgetGroup
|
* @ingroup ewolWidgetGroup
|
||||||
*/
|
*/
|
||||||
|
@ -18,8 +18,8 @@
|
|||||||
namespace ewol {
|
namespace ewol {
|
||||||
namespace widget {
|
namespace widget {
|
||||||
class PopUp;
|
class PopUp;
|
||||||
using PopUpShared = ewol::SharedPtr<ewol::widget::PopUp>;
|
using PopUpShared = ememory::SharedPtr<ewol::widget::PopUp>;
|
||||||
using PopUpWeak = ewol::WeakPtr<ewol::widget::PopUp>;
|
using PopUpWeak = ememory::WeakPtr<ewol::widget::PopUp>;
|
||||||
/**
|
/**
|
||||||
* @ingroup ewolWidgetGroup
|
* @ingroup ewolWidgetGroup
|
||||||
*/
|
*/
|
||||||
|
@ -17,8 +17,8 @@
|
|||||||
namespace ewol {
|
namespace ewol {
|
||||||
namespace widget {
|
namespace widget {
|
||||||
class ProgressBar;
|
class ProgressBar;
|
||||||
using ProgressBarShared = ewol::SharedPtr<ewol::widget::ProgressBar>;
|
using ProgressBarShared = ememory::SharedPtr<ewol::widget::ProgressBar>;
|
||||||
using ProgressBarWeak = ewol::WeakPtr<ewol::widget::ProgressBar>;
|
using ProgressBarWeak = ememory::WeakPtr<ewol::widget::ProgressBar>;
|
||||||
/**
|
/**
|
||||||
* @ingroup ewolWidgetGroup
|
* @ingroup ewolWidgetGroup
|
||||||
*/
|
*/
|
||||||
|
@ -17,8 +17,8 @@
|
|||||||
namespace ewol {
|
namespace ewol {
|
||||||
namespace widget {
|
namespace widget {
|
||||||
class Scroll;
|
class Scroll;
|
||||||
using ScrollShared = ewol::SharedPtr<ewol::widget::Scroll>;
|
using ScrollShared = ememory::SharedPtr<ewol::widget::Scroll>;
|
||||||
using ScrollWeak = ewol::WeakPtr<ewol::widget::Scroll>;
|
using ScrollWeak = ememory::WeakPtr<ewol::widget::Scroll>;
|
||||||
class Scroll : public ewol::widget::Container {
|
class Scroll : public ewol::widget::Container {
|
||||||
public: // properties
|
public: // properties
|
||||||
eproperty::Range<vec2> propertyLimit; //!< Set the limitation of the ratio in the sreen
|
eproperty::Range<vec2> propertyLimit; //!< Set the limitation of the ratio in the sreen
|
||||||
|
@ -14,8 +14,8 @@
|
|||||||
namespace ewol {
|
namespace ewol {
|
||||||
namespace widget {
|
namespace widget {
|
||||||
class Select;
|
class Select;
|
||||||
using SelectShared = ewol::SharedPtr<ewol::widget::Select>;
|
using SelectShared = ememory::SharedPtr<ewol::widget::Select>;
|
||||||
using SelectWeak = ewol::WeakPtr<ewol::widget::Select>;
|
using SelectWeak = ememory::WeakPtr<ewol::widget::Select>;
|
||||||
/**
|
/**
|
||||||
* @brief a composed Select is a Select with an inside composed with the specify XML element
|
* @brief a composed Select is a Select with an inside composed with the specify XML element
|
||||||
* ==> this permit to generate standard element simple
|
* ==> this permit to generate standard element simple
|
||||||
|
@ -17,8 +17,8 @@
|
|||||||
namespace ewol {
|
namespace ewol {
|
||||||
namespace widget {
|
namespace widget {
|
||||||
class Sizer;
|
class Sizer;
|
||||||
using SizerShared = ewol::SharedPtr<ewol::widget::Sizer>;
|
using SizerShared = ememory::SharedPtr<ewol::widget::Sizer>;
|
||||||
using SizerWeak = ewol::WeakPtr<ewol::widget::Sizer>;
|
using SizerWeak = ememory::WeakPtr<ewol::widget::Sizer>;
|
||||||
/**
|
/**
|
||||||
* @ingroup ewolWidgetGroup
|
* @ingroup ewolWidgetGroup
|
||||||
*/
|
*/
|
||||||
|
@ -17,8 +17,8 @@
|
|||||||
namespace ewol {
|
namespace ewol {
|
||||||
namespace widget {
|
namespace widget {
|
||||||
class Slider;
|
class Slider;
|
||||||
using SliderShared = ewol::SharedPtr<ewol::widget::Slider>;
|
using SliderShared = ememory::SharedPtr<ewol::widget::Slider>;
|
||||||
using SliderWeak = ewol::WeakPtr<ewol::widget::Slider>;
|
using SliderWeak = ememory::WeakPtr<ewol::widget::Slider>;
|
||||||
/**
|
/**
|
||||||
* @ingroup ewolWidgetGroup
|
* @ingroup ewolWidgetGroup
|
||||||
*/
|
*/
|
||||||
|
@ -17,8 +17,8 @@
|
|||||||
namespace ewol {
|
namespace ewol {
|
||||||
namespace widget {
|
namespace widget {
|
||||||
class Spacer;
|
class Spacer;
|
||||||
using SpacerShared = ewol::SharedPtr<ewol::widget::Spacer>;
|
using SpacerShared = ememory::SharedPtr<ewol::widget::Spacer>;
|
||||||
using SpacerWeak = ewol::WeakPtr<ewol::widget::Spacer>;
|
using SpacerWeak = ememory::WeakPtr<ewol::widget::Spacer>;
|
||||||
/**
|
/**
|
||||||
* @ingroup ewolWidgetGroup
|
* @ingroup ewolWidgetGroup
|
||||||
*/
|
*/
|
||||||
|
@ -14,8 +14,8 @@
|
|||||||
namespace ewol {
|
namespace ewol {
|
||||||
namespace widget {
|
namespace widget {
|
||||||
class Spin;
|
class Spin;
|
||||||
using SpinShared = ewol::SharedPtr<ewol::widget::Spin>;
|
using SpinShared = ememory::SharedPtr<ewol::widget::Spin>;
|
||||||
using SpinWeak = ewol::WeakPtr<ewol::widget::Spin>;
|
using SpinWeak = ememory::WeakPtr<ewol::widget::Spin>;
|
||||||
/**
|
/**
|
||||||
* @brief a composed Spin is a Spin with an inside composed with the specify XML element
|
* @brief a composed Spin is a Spin with an inside composed with the specify XML element
|
||||||
* ==> this permit to generate standard element simple
|
* ==> this permit to generate standard element simple
|
||||||
|
@ -16,8 +16,8 @@
|
|||||||
namespace ewol {
|
namespace ewol {
|
||||||
namespace widget {
|
namespace widget {
|
||||||
class WSlider;
|
class WSlider;
|
||||||
using WSliderShared = ewol::SharedPtr<ewol::widget::WSlider>;
|
using WSliderShared = ememory::SharedPtr<ewol::widget::WSlider>;
|
||||||
using WSliderWeak = ewol::WeakPtr<ewol::widget::WSlider>;
|
using WSliderWeak = ememory::WeakPtr<ewol::widget::WSlider>;
|
||||||
/**
|
/**
|
||||||
* @ingroup ewolWidgetGroup
|
* @ingroup ewolWidgetGroup
|
||||||
*/
|
*/
|
||||||
|
@ -22,8 +22,8 @@ namespace ewol {
|
|||||||
class Manager;
|
class Manager;
|
||||||
class Windows;
|
class Windows;
|
||||||
};
|
};
|
||||||
using WidgetShared = ewol::SharedPtr<ewol::Widget>;
|
using WidgetShared = ememory::SharedPtr<ewol::Widget>;
|
||||||
using WidgetWeak = ewol::WeakPtr<ewol::Widget>;
|
using WidgetWeak = ememory::WeakPtr<ewol::Widget>;
|
||||||
};
|
};
|
||||||
#include <gale/context/clipBoard.h>
|
#include <gale/context/clipBoard.h>
|
||||||
#include <gale/key/key.h>
|
#include <gale/key/key.h>
|
||||||
@ -528,7 +528,7 @@ namespace ewol {
|
|||||||
/**
|
/**
|
||||||
* @brief get the curent Windows
|
* @brief get the curent Windows
|
||||||
*/
|
*/
|
||||||
ewol::SharedPtr<ewol::widget::Windows> getWindows();
|
ememory::SharedPtr<ewol::widget::Windows> getWindows();
|
||||||
/*
|
/*
|
||||||
* Annimation section :
|
* Annimation section :
|
||||||
*/
|
*/
|
||||||
|
@ -18,8 +18,8 @@
|
|||||||
namespace ewol {
|
namespace ewol {
|
||||||
namespace widget {
|
namespace widget {
|
||||||
class WidgetScrolled;
|
class WidgetScrolled;
|
||||||
using WidgetScrolledShared = ewol::SharedPtr<ewol::widget::WidgetScrolled>;
|
using WidgetScrolledShared = ememory::SharedPtr<ewol::widget::WidgetScrolled>;
|
||||||
using WidgetScrolledWeak = ewol::WeakPtr<ewol::widget::WidgetScrolled>;
|
using WidgetScrolledWeak = ememory::WeakPtr<ewol::widget::WidgetScrolled>;
|
||||||
/**
|
/**
|
||||||
* @brief Widget to integrate a scrool bar in a widget. This is not a stadalone widget.
|
* @brief Widget to integrate a scrool bar in a widget. This is not a stadalone widget.
|
||||||
*/
|
*/
|
||||||
|
@ -17,8 +17,8 @@
|
|||||||
namespace ewol {
|
namespace ewol {
|
||||||
namespace widget {
|
namespace widget {
|
||||||
class Windows;
|
class Windows;
|
||||||
using WindowsShared = ewol::SharedPtr<ewol::widget::Windows>;
|
using WindowsShared = ememory::SharedPtr<ewol::widget::Windows>;
|
||||||
using WindowsWeak = ewol::WeakPtr<ewol::widget::Windows>;
|
using WindowsWeak = ememory::WeakPtr<ewol::widget::Windows>;
|
||||||
/**
|
/**
|
||||||
* @brief Windows basic interface
|
* @brief Windows basic interface
|
||||||
*/
|
*/
|
||||||
|
@ -21,8 +21,8 @@
|
|||||||
namespace ewol {
|
namespace ewol {
|
||||||
namespace widget {
|
namespace widget {
|
||||||
class ColorChooser;
|
class ColorChooser;
|
||||||
using ColorChooserShared = ewol::SharedPtr<ewol::widget::ColorChooser>;
|
using ColorChooserShared = ememory::SharedPtr<ewol::widget::ColorChooser>;
|
||||||
using ColorChooserWeak = ewol::WeakPtr<ewol::widget::ColorChooser>;
|
using ColorChooserWeak = ememory::WeakPtr<ewol::widget::ColorChooser>;
|
||||||
/**
|
/**
|
||||||
* @ingroup ewolWidgetGroup
|
* @ingroup ewolWidgetGroup
|
||||||
*/
|
*/
|
||||||
|
@ -45,15 +45,15 @@ ewol::widget::FileChooser::FileChooser() :
|
|||||||
"",
|
"",
|
||||||
&ewol::widget::FileChooser::onChangePropertyFile),
|
&ewol::widget::FileChooser::onChangePropertyFile),
|
||||||
propertyLabelTitle(this, "title",
|
propertyLabelTitle(this, "title",
|
||||||
"TRANSLATE:FileChooser",
|
"_T{FileChooser}",
|
||||||
"",
|
"",
|
||||||
&ewol::widget::FileChooser::onChangePropertyLabelTitle),
|
&ewol::widget::FileChooser::onChangePropertyLabelTitle),
|
||||||
propertyLabelValidate(this, "label-validate",
|
propertyLabelValidate(this, "label-validate",
|
||||||
"TRANSLATE:Validate",
|
"_T{Validate}",
|
||||||
"",
|
"",
|
||||||
&ewol::widget::FileChooser::onChangePropertyLabelValidate),
|
&ewol::widget::FileChooser::onChangePropertyLabelValidate),
|
||||||
propertyLabelCancel(this, "label-cancel",
|
propertyLabelCancel(this, "label-cancel",
|
||||||
"TRANSLATE:Cancel",
|
"_T{Cancel}",
|
||||||
"",
|
"",
|
||||||
&ewol::widget::FileChooser::onChangePropertyLabelCancel) {
|
&ewol::widget::FileChooser::onChangePropertyLabelCancel) {
|
||||||
addObjectType("ewol::widget::FileChooser");
|
addObjectType("ewol::widget::FileChooser");
|
||||||
@ -66,19 +66,19 @@ void ewol::widget::FileChooser::init() {
|
|||||||
+ " <sizer mode='vert' lock='true' fill='true' expand='true'>\n"
|
+ " <sizer mode='vert' lock='true' fill='true' expand='true'>\n"
|
||||||
+ " <sizer mode='hori'>\n"
|
+ " <sizer mode='hori'>\n"
|
||||||
+ " <checkbox name='[" + etk::to_string(getId()) + "]file-shooser:show-hiden-file'>\n"
|
+ " <checkbox name='[" + etk::to_string(getId()) + "]file-shooser:show-hiden-file'>\n"
|
||||||
+ " <label>" + TRANSLATE("TRANSLATE:ShowHiddenFiles") + "</label>\n"
|
+ " <label>_T{ShowHiddenFiles}</label>\n"
|
||||||
+ " </checkbox>\n"
|
+ " </checkbox>\n"
|
||||||
+ " <spacer expand='true,false'/>\n"
|
+ " <spacer expand='true,false'/>\n"
|
||||||
+ " <button name='[" + etk::to_string(getId()) + "]file-shooser:button-validate'>\n"
|
+ " <button name='[" + etk::to_string(getId()) + "]file-shooser:button-validate'>\n"
|
||||||
+ " <sizer mode='hori'>\n"
|
+ " <sizer mode='hori'>\n"
|
||||||
+ " <image src='{ewol}THEME:GUI:Load.edf' fill='true' size='7,7mm' distance-field='true'/>\n"
|
+ " <image src='{ewol}THEME:GUI:Load.edf' fill='true' size='7,7mm' distance-field='true'/>\n"
|
||||||
+ " <label name='[" + etk::to_string(getId()) + "]file-shooser:validate-label'>" + TRANSLATE(propertyLabelValidate) + "</label>\n"
|
+ " <label name='[" + etk::to_string(getId()) + "]file-shooser:validate-label'>" + *propertyLabelValidate + "</label>\n"
|
||||||
+ " </sizer>\n"
|
+ " </sizer>\n"
|
||||||
+ " </button>\n"
|
+ " </button>\n"
|
||||||
+ " <button name='[" + etk::to_string(getId()) + "]file-shooser:button-cancel'>\n"
|
+ " <button name='[" + etk::to_string(getId()) + "]file-shooser:button-cancel'>\n"
|
||||||
+ " <sizer mode='hori'>\n"
|
+ " <sizer mode='hori'>\n"
|
||||||
+ " <image src='{ewol}THEME:GUI:Remove.edf' fill='true' size='7,7mm' distance-field='true'/>\n"
|
+ " <image src='{ewol}THEME:GUI:Remove.edf' fill='true' size='7,7mm' distance-field='true'/>\n"
|
||||||
+ " <label name='[" + etk::to_string(getId()) + "]file-shooser:cancel-label'>" + TRANSLATE(propertyLabelCancel) + "</label>\n"
|
+ " <label name='[" + etk::to_string(getId()) + "]file-shooser:cancel-label'>" + *propertyLabelCancel + "</label>\n"
|
||||||
+ " </sizer>\n"
|
+ " </sizer>\n"
|
||||||
+ " </button>\n"
|
+ " </button>\n"
|
||||||
+ " </sizer>\n"
|
+ " </sizer>\n"
|
||||||
@ -109,7 +109,7 @@ void ewol::widget::FileChooser::init() {
|
|||||||
+ " <entry name='[" + etk::to_string(getId()) + "]file-shooser:entry-folder' expand='true,false' fill='true,false'/>\n"
|
+ " <entry name='[" + etk::to_string(getId()) + "]file-shooser:entry-folder' expand='true,false' fill='true,false'/>\n"
|
||||||
+ " <image name='[" + etk::to_string(getId()) + "]file-shooser:img-home' src='{ewol}THEME:GUI:Home.edf' expand='false' size='8,8mm' distance-field='true'/>\n"
|
+ " <image name='[" + etk::to_string(getId()) + "]file-shooser:img-home' src='{ewol}THEME:GUI:Home.edf' expand='false' size='8,8mm' distance-field='true'/>\n"
|
||||||
+ " </sizer>\n"
|
+ " </sizer>\n"
|
||||||
+ " <label name='[" + etk::to_string(getId()) + "]file-shooser:title-label'>" + TRANSLATE(propertyLabelTitle) + "</label>\n"
|
+ " <label name='[" + etk::to_string(getId()) + "]file-shooser:title-label'>" + *propertyLabelTitle + "</label>\n"
|
||||||
+ " </sizer>\n"
|
+ " </sizer>\n"
|
||||||
+ "</popup>";
|
+ "</popup>";
|
||||||
loadFromString(myDescription);
|
loadFromString(myDescription);
|
||||||
@ -149,15 +149,15 @@ void ewol::widget::FileChooser::onChangePropertyFile() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ewol::widget::FileChooser::onChangePropertyLabelTitle() {
|
void ewol::widget::FileChooser::onChangePropertyLabelTitle() {
|
||||||
propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:title-label", "value", TRANSLATE(propertyLabelTitle));
|
propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:title-label", "value", propertyLabelTitle);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ewol::widget::FileChooser::onChangePropertyLabelValidate() {
|
void ewol::widget::FileChooser::onChangePropertyLabelValidate() {
|
||||||
propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:validate-label", "value", TRANSLATE(propertyLabelValidate));
|
propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:validate-label", "value", propertyLabelValidate);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ewol::widget::FileChooser::onChangePropertyLabelCancel() {
|
void ewol::widget::FileChooser::onChangePropertyLabelCancel() {
|
||||||
propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:cancel-label", "value", TRANSLATE(propertyLabelCancel));
|
propertySetOnWidgetNamed("[" + etk::to_string(getId()) + "]file-shooser:cancel-label", "value", propertyLabelCancel);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ewol::widget::FileChooser::onCallbackEntryFolderChangeValue(const std::string& _value) {
|
void ewol::widget::FileChooser::onCallbackEntryFolderChangeValue(const std::string& _value) {
|
||||||
|
@ -15,8 +15,8 @@
|
|||||||
namespace ewol {
|
namespace ewol {
|
||||||
namespace widget {
|
namespace widget {
|
||||||
class FileChooser;
|
class FileChooser;
|
||||||
using FileChooserShared = ewol::SharedPtr<ewol::widget::FileChooser>;
|
using FileChooserShared = ememory::SharedPtr<ewol::widget::FileChooser>;
|
||||||
using FileChooserWeak = ewol::WeakPtr<ewol::widget::FileChooser>;
|
using FileChooserWeak = ememory::WeakPtr<ewol::widget::FileChooser>;
|
||||||
/**
|
/**
|
||||||
* @brief File Chooser is a simple selector of file for opening, saving, and what you want ...
|
* @brief File Chooser is a simple selector of file for opening, saving, and what you want ...
|
||||||
*
|
*
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
ewol::widget::Parameter::Parameter() :
|
ewol::widget::Parameter::Parameter() :
|
||||||
signalClose(this, "close", ""),
|
signalClose(this, "close", ""),
|
||||||
propertyLabelTitle(this, "title",
|
propertyLabelTitle(this, "title",
|
||||||
"TRANSLATE:Parameter",
|
"_T{Parameter}",
|
||||||
"Title of the parameter interface",
|
"Title of the parameter interface",
|
||||||
&ewol::widget::Parameter::onChangePropertyLabelTitle),
|
&ewol::widget::Parameter::onChangePropertyLabelTitle),
|
||||||
m_currentIdList(0),
|
m_currentIdList(0),
|
||||||
@ -76,9 +76,9 @@ void ewol::widget::Parameter::init() {
|
|||||||
EWOL_ERROR("Can not allocate widget == > display might be in error");
|
EWOL_ERROR("Can not allocate widget == > display might be in error");
|
||||||
} else {
|
} else {
|
||||||
tmpButton->setSubWidget(ewol::widget::composerGenerateString(
|
tmpButton->setSubWidget(ewol::widget::composerGenerateString(
|
||||||
"<sizer mode=\"hori\">\n"
|
"<sizer mode='hori'>\n"
|
||||||
" <image src=\"{ewol}THEME:GUI:Save.svg\" expand=\"true\" size=\"8,8mm\"/>\n"
|
" <image src='{ewol}THEME:GUI:Save.svg' expand='true' size='8,8mm'/>\n"
|
||||||
" <label>Save</label>\n"
|
" <label>_T{Save}</label>\n"
|
||||||
"</sizer>\n"));
|
"</sizer>\n"));
|
||||||
tmpButton->signalPressed.connect(shared_from_this(), &ewol::widget::Parameter::onCallbackParameterSave);
|
tmpButton->signalPressed.connect(shared_from_this(), &ewol::widget::Parameter::onCallbackParameterSave);
|
||||||
mySizerHori->subWidgetAdd(tmpButton);
|
mySizerHori->subWidgetAdd(tmpButton);
|
||||||
@ -98,9 +98,9 @@ void ewol::widget::Parameter::init() {
|
|||||||
EWOL_ERROR("Can not allocate widget == > display might be in error");
|
EWOL_ERROR("Can not allocate widget == > display might be in error");
|
||||||
} else {
|
} else {
|
||||||
tmpButton->setSubWidget(ewol::widget::composerGenerateString(
|
tmpButton->setSubWidget(ewol::widget::composerGenerateString(
|
||||||
"<sizer mode=\"hori\">\n"
|
"<sizer mode='hori'>\n"
|
||||||
" <image src=\"{ewol}THEME:GUI:Remove.svg\" expand=\"true\" size=\"8,8mm\"/>\n"
|
" <image src='{ewol}THEME:GUI:Remove.svg' expand='true' size='8,8mm'/>\n"
|
||||||
" <label>Close</label>\n"
|
" <label>_T{Close}</label>\n"
|
||||||
"</sizer>\n"));
|
"</sizer>\n"));
|
||||||
tmpButton->signalPressed.connect(shared_from_this(), &ewol::widget::Parameter::onCallbackMenuclosed);
|
tmpButton->signalPressed.connect(shared_from_this(), &ewol::widget::Parameter::onCallbackMenuclosed);
|
||||||
mySizerHori->subWidgetAdd(tmpButton);
|
mySizerHori->subWidgetAdd(tmpButton);
|
||||||
@ -177,7 +177,7 @@ void ewol::widget::Parameter::init() {
|
|||||||
if (m_widgetTitle == nullptr) {
|
if (m_widgetTitle == nullptr) {
|
||||||
EWOL_ERROR("Can not allocate widget == > display might be in error");
|
EWOL_ERROR("Can not allocate widget == > display might be in error");
|
||||||
} else {
|
} else {
|
||||||
m_widgetTitle->propertyValue.set(TRANSLATE(propertyLabelTitle));
|
m_widgetTitle->propertyValue.set(propertyLabelTitle);
|
||||||
m_widgetTitle->propertyExpand.set(bvec2(true,false));
|
m_widgetTitle->propertyExpand.set(bvec2(true,false));
|
||||||
mySizerVert->subWidgetAdd(m_widgetTitle);
|
mySizerVert->subWidgetAdd(m_widgetTitle);
|
||||||
}
|
}
|
||||||
@ -191,7 +191,7 @@ ewol::widget::Parameter::~Parameter() {
|
|||||||
|
|
||||||
void ewol::widget::Parameter::onChangePropertyLabelTitle() {
|
void ewol::widget::Parameter::onChangePropertyLabelTitle() {
|
||||||
if (m_widgetTitle != nullptr) {
|
if (m_widgetTitle != nullptr) {
|
||||||
m_widgetTitle->propertyValue.set(TRANSLATE(propertyLabelTitle));
|
m_widgetTitle->propertyValue.set(propertyLabelTitle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,8 +22,8 @@
|
|||||||
namespace ewol {
|
namespace ewol {
|
||||||
namespace widget {
|
namespace widget {
|
||||||
class Parameter;
|
class Parameter;
|
||||||
using ParameterShared = ewol::SharedPtr<ewol::widget::Parameter>;
|
using ParameterShared = ememory::SharedPtr<ewol::widget::Parameter>;
|
||||||
using ParameterWeak = ewol::WeakPtr<ewol::widget::Parameter>;
|
using ParameterWeak = ememory::WeakPtr<ewol::widget::Parameter>;
|
||||||
/**
|
/**
|
||||||
* @ingroup ewolWidgetGroup
|
* @ingroup ewolWidgetGroup
|
||||||
*/
|
*/
|
||||||
|
@ -30,8 +30,8 @@ namespace ewol {
|
|||||||
virtual ~elementPL() {};
|
virtual ~elementPL() {};
|
||||||
};
|
};
|
||||||
class ParameterList;
|
class ParameterList;
|
||||||
using ParameterListShared = ewol::SharedPtr<ewol::widget::ParameterList>;
|
using ParameterListShared = ememory::SharedPtr<ewol::widget::ParameterList>;
|
||||||
using ParameterListWeak = ewol::WeakPtr<ewol::widget::ParameterList>;
|
using ParameterListWeak = ememory::WeakPtr<ewol::widget::ParameterList>;
|
||||||
/**
|
/**
|
||||||
* @ingroup ewolWidgetGroup
|
* @ingroup ewolWidgetGroup
|
||||||
*/
|
*/
|
||||||
|
@ -58,8 +58,8 @@ namespace ewol {
|
|||||||
spinPosition_RightRight
|
spinPosition_RightRight
|
||||||
};
|
};
|
||||||
class SpinBase;
|
class SpinBase;
|
||||||
using SpinBaseShared = ewol::SharedPtr<ewol::widget::SpinBase>;
|
using SpinBaseShared = ememory::SharedPtr<ewol::widget::SpinBase>;
|
||||||
using SpinBaseWeak = ewol::WeakPtr<ewol::widget::SpinBase>;
|
using SpinBaseWeak = ememory::WeakPtr<ewol::widget::SpinBase>;
|
||||||
/**
|
/**
|
||||||
* @ingroup ewolWidgetGroup
|
* @ingroup ewolWidgetGroup
|
||||||
*/
|
*/
|
||||||
|
@ -14,8 +14,8 @@
|
|||||||
namespace ewol {
|
namespace ewol {
|
||||||
namespace widget {
|
namespace widget {
|
||||||
class StdPopUp;
|
class StdPopUp;
|
||||||
using StdPopUpShared = ewol::SharedPtr<ewol::widget::StdPopUp>;
|
using StdPopUpShared = ememory::SharedPtr<ewol::widget::StdPopUp>;
|
||||||
using StdPopUpWeak = ewol::WeakPtr<ewol::widget::StdPopUp>;
|
using StdPopUpWeak = ememory::WeakPtr<ewol::widget::StdPopUp>;
|
||||||
/**
|
/**
|
||||||
* @brief The std pop up widget is a siple message widget to notify user of some simple things, like:
|
* @brief The std pop up widget is a siple message widget to notify user of some simple things, like:
|
||||||
*
|
*
|
||||||
|
@ -48,8 +48,7 @@ def create(target, module_name):
|
|||||||
'ewol/Padding.h',
|
'ewol/Padding.h',
|
||||||
'ewol/translate.h',
|
'ewol/translate.h',
|
||||||
'ewol/DrawProperty.h',
|
'ewol/DrawProperty.h',
|
||||||
'ewol/gravity.h',
|
'ewol/gravity.h'
|
||||||
'ewol/memory.h'
|
|
||||||
])
|
])
|
||||||
|
|
||||||
# compositing:
|
# compositing:
|
||||||
@ -239,9 +238,11 @@ def create(target, module_name):
|
|||||||
|
|
||||||
# name of the dependency
|
# name of the dependency
|
||||||
my_module.add_module_depend([
|
my_module.add_module_depend([
|
||||||
|
'elog',
|
||||||
'etk',
|
'etk',
|
||||||
'esignal',
|
'esignal',
|
||||||
'eproperty',
|
'eproperty',
|
||||||
|
'ememory',
|
||||||
'gale',
|
'gale',
|
||||||
'freetype',
|
'freetype',
|
||||||
'exml',
|
'exml',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user