[DEV] update for build URI

This commit is contained in:
Edouard DUPIN 2018-09-29 21:58:25 +02:00
parent 532b64a1f0
commit dbe995abd8
27 changed files with 72 additions and 70 deletions

View File

@ -28,7 +28,7 @@ namespace ewol {
ColorFile(); ColorFile();
void init(const etk::Uri& _uri); void init(const etk::Uri& _uri);
public: public:
DECLARE_RESOURCE_NAMED_FACTORY(ColorFile); DECLARE_RESOURCE_URI_FACTORY(ColorFile);
/** /**
* @brief Simple Destructor of this class (nothing specific ...) * @brief Simple Destructor of this class (nothing specific ...)
*/ */

View File

@ -22,7 +22,7 @@ namespace ewol {
void init(const etk::Uri& _filename); void init(const etk::Uri& _filename);
public: public:
virtual ~ConfigFile(); virtual ~ConfigFile();
DECLARE_RESOURCE_NAMED_FACTORY(ConfigFile); DECLARE_RESOURCE_URI_FACTORY(ConfigFile);
public: public:
void reload(); void reload();

View File

@ -24,7 +24,7 @@ ewol::widget::Button::Button() :
signalEnter(this, "enter", "The cursor enter inside the button"), signalEnter(this, "enter", "The cursor enter inside the button"),
signalLeave(this, "leave", "the cursor leave the button"), signalLeave(this, "leave", "the cursor leave the button"),
signalValue(this, "value", "button value change"), signalValue(this, "value", "button value change"),
propertyShape(this, "shape", "{ewol}THEME:GUI:Button.json", "The display name for config file", &ewol::widget::Button::onChangePropertyShape), propertyShape(this, "shape", etk::Uri("THEME_GUI://Button.json?lib=ewol"), "The display name for config file", &ewol::widget::Button::onChangePropertyShape),
propertyValue(this, "value", false, "Value of the Button", &ewol::widget::Button::onChangePropertyValue), 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), 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), propertyToggleMode(this, "toggle", false, "The Button can toogle", &ewol::widget::Button::onChangePropertyToggleMode),
@ -129,10 +129,10 @@ bool ewol::widget::Button::onEventInput(const ewol::event::Input& _event) {
markToRedraw(); markToRedraw();
} }
if(_event.getStatus() == gale::key::status::pressSingle) { if(_event.getStatus() == gale::key::status::pressSingle) {
if( ( *propertyValue == true if ( ( *propertyValue == true
&& *propertyLock == ewol::widget::Button::lockWhenPressed) && *propertyLock == ewol::widget::Button::lockWhenPressed)
|| ( *propertyValue == false || ( *propertyValue == false
&& *propertyLock == ewol::widget::Button::lockWhenReleased) ) { && *propertyLock == ewol::widget::Button::lockWhenReleased) ) {
// nothing to do : Lock mode ... // nothing to do : Lock mode ...
// user might set himself the new correct value with @ref setValue(xxx) // user might set himself the new correct value with @ref setValue(xxx)
} else { } else {

View File

@ -41,7 +41,7 @@ namespace ewol {
esignal::Signal<> signalLeave; esignal::Signal<> signalLeave;
esignal::Signal<bool> signalValue; esignal::Signal<bool> signalValue;
public: // propertie list public: // propertie list
eproperty::Value<etk::String> propertyShape; //!< shaper name property eproperty::Value<etk::Uri> propertyShape; //!< shaper name property
eproperty::Value<bool> propertyValue; //!< Current state of the button. eproperty::Value<bool> propertyValue; //!< Current state of the button.
eproperty::List<enum buttonLock> propertyLock; //!< Current lock state of the button. eproperty::List<enum buttonLock> propertyLock; //!< Current lock state of the button.
eproperty::Value<bool> propertyToggleMode; //!< The button is able to toggle. eproperty::Value<bool> propertyToggleMode; //!< The button is able to toggle.

View File

@ -25,7 +25,7 @@ ETK_DECLARE_TYPE(ewol::widget::ButtonColor);
ewol::widget::ButtonColor::ButtonColor() : ewol::widget::ButtonColor::ButtonColor() :
signalChange(this, "change", "Button color change value"), signalChange(this, "change", "Button color change value"),
propertyValue(this, "color", etk::color::black, "Current color", &ewol::widget::ButtonColor::onChangePropertyValue), propertyValue(this, "color", etk::color::black, "Current color", &ewol::widget::ButtonColor::onChangePropertyValue),
propertyShape(this, "shape", "{ewol}THEME:GUI:Button.json", "shape of the widget", &ewol::widget::ButtonColor::onChangePropertyShape), propertyShape(this, "shape", etk::Uri("THEME_GUI://Button.json?lib=ewol"), "shape of the widget", &ewol::widget::ButtonColor::onChangePropertyShape),
m_widgetContextMenu(null) { m_widgetContextMenu(null) {
addObjectType("ewol::widget::ButtonColor"); addObjectType("ewol::widget::ButtonColor");
changeStatusIn(STATUS_UP); changeStatusIn(STATUS_UP);

View File

@ -25,7 +25,7 @@ namespace ewol {
esignal::Signal<etk::Color<>> signalChange; esignal::Signal<etk::Color<>> signalChange;
public: // properties public: // properties
eproperty::Value<etk::Color<>> propertyValue; //!< Current color. eproperty::Value<etk::Color<>> propertyValue; //!< Current color.
eproperty::Value<etk::String> propertyShape; //!< Current color. eproperty::Value<etk::Uri> propertyShape; //!< Current color.
private: private:
ewol::compositing::Shaper m_shaper; //!< Compositing theme. ewol::compositing::Shaper m_shaper; //!< Compositing theme.
ewol::compositing::Text m_text; //!< Compositing Test display. ewol::compositing::Text m_text; //!< Compositing Test display.

View File

@ -27,7 +27,7 @@ ewol::widget::CheckBox::CheckBox() :
"Basic value of the widget", "Basic value of the widget",
&ewol::widget::CheckBox::onChangePropertyValue), &ewol::widget::CheckBox::onChangePropertyValue),
propertyShape(this, "shape", propertyShape(this, "shape",
"{ewol}THEME:GUI:CheckBox.json", etk::Uri("THEME_GUI://CheckBox.json?lib=ewol"),
"The display name for config file", "The display name for config file",
&ewol::widget::CheckBox::onChangePropertyShape), &ewol::widget::CheckBox::onChangePropertyShape),
m_mouseHover(false), m_mouseHover(false),

View File

@ -27,7 +27,7 @@ namespace ewol {
esignal::Signal<bool> signalValue; esignal::Signal<bool> signalValue;
public: // propertie list public: // propertie list
eproperty::Value<bool> propertyValue; //!< Current state of the checkbox. eproperty::Value<bool> propertyValue; //!< Current state of the checkbox.
eproperty::Value<etk::String> propertyShape; //!< shape of the widget eproperty::Value<etk::Uri> propertyShape; //!< shape of the widget
private: private:
ewol::compositing::Shaper m_shaper; //!< Compositing theme. ewol::compositing::Shaper m_shaper; //!< Compositing theme.
bool m_mouseHover; //!< Flag to know where the mouse is (inside the displayed widget (if not fill)). bool m_mouseHover; //!< Flag to know where the mouse is (inside the displayed widget (if not fill)).

View File

@ -18,7 +18,7 @@ ETK_DECLARE_TYPE(enum ewol::widget::ContextMenu::markPosition);
ewol::widget::ContextMenu::ContextMenu(): ewol::widget::ContextMenu::ContextMenu():
propertyShape(this, "shape", propertyShape(this, "shape",
"{ewol}THEME:GUI:ContextMenu.json", etk::Uri("THEME_GUI://ContextMenu.json?lib=ewol"),
"the display name for config file", "the display name for config file",
&ewol::widget::ContextMenu::onChangePropertyShape), &ewol::widget::ContextMenu::onChangePropertyShape),
propertyArrowPos(this, "arrow-position", propertyArrowPos(this, "arrow-position",

View File

@ -31,7 +31,7 @@ namespace ewol {
markNone markNone
}; };
public: // properties public: // properties
eproperty::Value<etk::String> propertyShape; //!< shape of the widget. eproperty::Value<etk::Uri> propertyShape; //!< shape of the widget.
eproperty::Value<vec2> propertyArrowPos; eproperty::Value<vec2> propertyArrowPos;
eproperty::List<enum markPosition> propertyArrawBorder; eproperty::List<enum markPosition> propertyArrawBorder;
protected: protected:

View File

@ -27,7 +27,7 @@ ewol::widget::Entry::Entry() :
"Not display content in password mode", "Not display content in password mode",
&ewol::widget::Entry::onChangePropertyPassword), &ewol::widget::Entry::onChangePropertyPassword),
propertyShape(this, "shape", propertyShape(this, "shape",
"{ewol}THEME:GUI:Entry.json", etk::Uri("THEME_GUI://Entry.json?lib=ewol"),
"Shaper to display the background", "Shaper to display the background",
&ewol::widget::Entry::onChangePropertyShaper), &ewol::widget::Entry::onChangePropertyShaper),
propertyValue(this, "value", propertyValue(this, "value",

View File

@ -38,7 +38,7 @@ namespace ewol {
esignal::Signal<etk::String> signalModify; //!< data change esignal::Signal<etk::String> signalModify; //!< data change
public: // propertie list public: // propertie list
eproperty::Value<bool> propertyPassword; //!< Disable display of the content of the entry eproperty::Value<bool> propertyPassword; //!< Disable display of the content of the entry
eproperty::Value<etk::String> propertyShape; eproperty::Value<etk::Uri> propertyShape;
eproperty::Value<etk::String> propertyValue; //!< string that must be displayed eproperty::Value<etk::String> propertyValue; //!< string that must be displayed
eproperty::Range<int32_t> propertyMaxCharacter; //!< number max of xharacter in the list eproperty::Range<int32_t> propertyMaxCharacter; //!< number max of xharacter in the list
eproperty::Value<etk::String> propertyRegex; //!< regular expression value eproperty::Value<etk::String> propertyRegex; //!< regular expression value

View File

@ -28,7 +28,7 @@ ewol::widget::Image::Image() :
m_colorId(-1) { m_colorId(-1) {
addObjectType("ewol::widget::Image"); addObjectType("ewol::widget::Image");
m_imageRenderSize = vec2(0,0); m_imageRenderSize = vec2(0,0);
m_colorProperty = ewol::resource::ColorFile::create("{ewol}THEME:COLOR:Image.json"); m_colorProperty = ewol::resource::ColorFile::create(etk::Uri("THEME_COLOR://Image.json?lib=ewol"));
if (m_colorProperty != null) { if (m_colorProperty != null) {
m_colorId = m_colorProperty->request("foreground"); m_colorId = m_colorProperty->request("foreground");
} }

View File

@ -28,7 +28,7 @@ ewol::widget::Label::Label() :
m_colorDefaultFgText(-1), m_colorDefaultFgText(-1),
m_colorDefaultBgText(-1){ m_colorDefaultBgText(-1){
addObjectType("ewol::widget::Label"); addObjectType("ewol::widget::Label");
m_colorProperty = ewol::resource::ColorFile::create("{ewol}THEME:COLOR:Label.json"); m_colorProperty = ewol::resource::ColorFile::create(etk::Uri("THEME_COLOR://Label.json?lib=ewol"));
if (m_colorProperty != null) { if (m_colorProperty != null) {
m_colorDefaultFgText = m_colorProperty->request("foreground"); m_colorDefaultFgText = m_colorProperty->request("foreground");
m_colorDefaultBgText = m_colorProperty->request("background"); m_colorDefaultBgText = m_colorProperty->request("background");

View File

@ -17,7 +17,7 @@ static const char* annimationIncrease = "increase";
ewol::widget::PopUp::PopUp() : ewol::widget::PopUp::PopUp() :
propertyShape(this, "shaper", propertyShape(this, "shaper",
"{ewol}THEME:GUI:PopUp.json", etk::Uri("THEME_GUI://PopUp.json?lib=ewol"),
"The shaper properties", "The shaper properties",
&ewol::widget::PopUp::onChangePropertyShape), &ewol::widget::PopUp::onChangePropertyShape),
propertyLockExpand(this, "lock", propertyLockExpand(this, "lock",

View File

@ -23,7 +23,7 @@ namespace ewol {
*/ */
class PopUp : public ewol::widget::Container { class PopUp : public ewol::widget::Container {
public: // properties public: // properties
eproperty::Value<etk::String> propertyShape; //!< Compositing theme. eproperty::Value<etk::Uri> propertyShape; //!< Compositing theme.
eproperty::Value<bvec2> propertyLockExpand; //!< Lock the expend of the sub widget to this one == > this permit to limit bigger subWidget eproperty::Value<bvec2> propertyLockExpand; //!< Lock the expend of the sub widget to this one == > this permit to limit bigger subWidget
eproperty::Value<bool> propertyCloseOutEvent; //!< ratio progression of a sliding eproperty::Value<bool> propertyCloseOutEvent; //!< ratio progression of a sliding
protected: protected:

View File

@ -18,11 +18,11 @@ ewol::widget::Scroll::Scroll() :
"Limit the scroll maximum position [0..1]% represent the free space in the scoll when arrive at the end", "Limit the scroll maximum position [0..1]% represent the free space in the scoll when arrive at the end",
&ewol::widget::Scroll::onChangePropertyLimit), &ewol::widget::Scroll::onChangePropertyLimit),
propertyShapeVert(this, "shape-vert", propertyShapeVert(this, "shape-vert",
"{ewol}THEME:GUI:WidgetScrolled.json", etk::Uri("THEME_GUI://WidgetScrolled.json?lib=ewol"),
"shape for the vertical display", "shape for the vertical display",
&ewol::widget::Scroll::onChangePropertyShapeVert), &ewol::widget::Scroll::onChangePropertyShapeVert),
propertyShapeHori(this, "shape-hori", propertyShapeHori(this, "shape-hori",
"{ewol}THEME:GUI:WidgetScrolled.json", etk::Uri("THEME_GUI://WidgetScrolled.json?lib=ewol"),
"shape for the horizonal display", "shape for the horizonal display",
&ewol::widget::Scroll::onChangePropertyShapeHori), &ewol::widget::Scroll::onChangePropertyShapeHori),
propertyHover(this, "hover", propertyHover(this, "hover",

View File

@ -20,8 +20,8 @@ namespace ewol {
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
eproperty::Value<etk::String> propertyShapeVert; //!< Vertical shaper name eproperty::Value<etk::Uri> propertyShapeVert; //!< Vertical shaper name
eproperty::Value<etk::String> propertyShapeHori; //!< Horizontal shaper name eproperty::Value<etk::Uri> propertyShapeHori; //!< Horizontal shaper name
eproperty::Value<bool> propertyHover; //!< Horizontal shaper name eproperty::Value<bool> propertyHover; //!< Horizontal shaper name
public: public:
enum highSpeedMode { enum highSpeedMode {

View File

@ -28,7 +28,7 @@ ewol::widget::Select::Select() :
&ewol::widget::Select::onChangePropertyValue) { &ewol::widget::Select::onChangePropertyValue) {
addObjectType("ewol::widget::Select"); addObjectType("ewol::widget::Select");
// override the basic parameter: // override the basic parameter:
propertyShape.setDirectCheck("{ewol}THEME:GUI:Select.json"); propertyShape.setDirectCheck(etk::Uri("THEME_GUI://Select.json?lib=ewol"));
propertySpinMode.setDirect(ewol::widget::spinPosition_noneRight); propertySpinMode.setDirect(ewol::widget::spinPosition_noneRight);
propertySpinMode.changeDefault(ewol::widget::spinPosition_noneRight); propertySpinMode.changeDefault(ewol::widget::spinPosition_noneRight);
propertySpinMode.rename("none-none", "none"); propertySpinMode.rename("none-none", "none");

View File

@ -38,7 +38,7 @@ ewol::widget::Spin::Spin() :
"fix-point mantis", "fix-point mantis",
&ewol::widget::Spin::onChangePropertyMantis) { &ewol::widget::Spin::onChangePropertyMantis) {
addObjectType("ewol::widget::Spin"); addObjectType("ewol::widget::Spin");
propertyShape.setDirectCheck("{ewol}THEME:GUI:Spin.json"); propertyShape.setDirectCheck(etk::Uri("THEME_GUI://Spin.json?lib=ewol"));
} }
ewol::widget::Spin::~Spin() { ewol::widget::Spin::~Spin() {

View File

@ -15,11 +15,11 @@ ETK_DECLARE_TYPE(ewol::widget::WidgetScrolled);
ewol::widget::WidgetScrolled::WidgetScrolled() : ewol::widget::WidgetScrolled::WidgetScrolled() :
propertyShapeVert(this, "shape-vert", propertyShapeVert(this, "shape-vert",
"{ewol}THEME:GUI:WidgetScrolled.json", etk::Uri("THEME_GUI://WidgetScrolled.json?lib=ewol"),
"shape for the vertical display", "shape for the vertical display",
&ewol::widget::WidgetScrolled::onChangePropertyShapeVert), &ewol::widget::WidgetScrolled::onChangePropertyShapeVert),
propertyShapeHori(this, "shape-hori", propertyShapeHori(this, "shape-hori",
"{ewol}THEME:GUI:WidgetScrolled.json", etk::Uri("THEME_GUI://WidgetScrolled.json?lib=ewol"),
"shape for the horizonal display", "shape for the horizonal display",
&ewol::widget::WidgetScrolled::onChangePropertyShapeHori), &ewol::widget::WidgetScrolled::onChangePropertyShapeHori),
m_shaperH(), m_shaperH(),

View File

@ -23,8 +23,8 @@ namespace ewol {
*/ */
class WidgetScrolled : public ewol::Widget { class WidgetScrolled : public ewol::Widget {
public: // properties: public: // properties:
eproperty::Value<etk::String> propertyShapeVert; //!< Vertical shaper name eproperty::Value<etk::Uri> propertyShapeVert; //!< Vertical shaper name
eproperty::Value<etk::String> propertyShapeHori; //!< Horizontal shaper name eproperty::Value<etk::Uri> propertyShapeHori; //!< Horizontal shaper name
// TODO : All property // TODO : All property
public: public:
enum scrollingMode { enum scrollingMode {

View File

@ -18,8 +18,16 @@
ETK_DECLARE_TYPE(ewol::widget::Windows); ETK_DECLARE_TYPE(ewol::widget::Windows);
ewol::widget::Windows::Windows() : ewol::widget::Windows::Windows() :
propertyColorConfiguration(this, "file-color", "{ewol}THEME:COLOR:Windows.json", "color file link on the theme", &ewol::widget::Windows::onChangePropertyColor), propertyColorConfiguration(this,
propertyTitle(this, "title", "No title", "Title of the windows", &ewol::widget::Windows::onChangePropertyTitle), "file-color",
etk::Uri("THEME_COLOR://Windows.json?lib=ewol"),
"File color of the Windows",
&ewol::widget::Windows::onChangePropertyColor),
propertyTitle(this,
"title",
"No title",
"Title of the windows",
&ewol::widget::Windows::onChangePropertyTitle),
m_resourceColor(null), m_resourceColor(null),
m_colorBg(-1) { m_colorBg(-1) {
addObjectType("ewol::widget::Windows"); addObjectType("ewol::widget::Windows");

View File

@ -21,7 +21,7 @@ namespace ewol {
*/ */
class Windows : public ewol::Widget { class Windows : public ewol::Widget {
public: public:
eproperty::Value<etk::String> propertyColorConfiguration; //!< Configuration file of the windows theme eproperty::Value<etk::Uri> propertyColorConfiguration; //!< Configuration file of the windows theme
eproperty::Value<etk::String> propertyTitle; //!< Current title of the windows eproperty::Value<etk::String> propertyTitle; //!< Current title of the windows
protected: protected:
ememory::SharedPtr<ewol::resource::ColorFile> m_resourceColor; //!< theme color property (name of file in @ref propertyColorConfiguration) ememory::SharedPtr<ewol::resource::ColorFile> m_resourceColor; //!< theme color property (name of file in @ref propertyColorConfiguration)

View File

@ -19,7 +19,7 @@
//#include <etk/Vector.hpp> //#include <etk/Vector.hpp>
#include <etk/Vector.hpp> #include <etk/Vector.hpp>
#include <etk/tool.hpp> #include <etk/tool.hpp>
#include <etk/os/FSNode.hpp> #include <etk/path/fileSystem.hpp>
extern "C" { extern "C" {
// file browsing ... // file browsing ...
@ -34,7 +34,7 @@ ewol::widget::FileChooser::FileChooser() :
signalCancel(this, "cancel", ""), signalCancel(this, "cancel", ""),
signalValidate(this, "validate", ""), signalValidate(this, "validate", ""),
propertyPath(this, "path", propertyPath(this, "path",
etk::getUserHomeFolder(), etk::path::getHomePath(),
"", "",
&ewol::widget::FileChooser::onChangePropertyPath), &ewol::widget::FileChooser::onChangePropertyPath),
propertyFile(this, "file", propertyFile(this, "file",
@ -72,7 +72,7 @@ void ewol::widget::FileChooser::init() {
subBind(ewol::widget::ListFileSystem, "[" + etk::toString(getId()) + "]file-shooser:list-files", signalFileSelect, sharedFromThis(), &ewol::widget::FileChooser::onCallbackListFileSelectChange); subBind(ewol::widget::ListFileSystem, "[" + etk::toString(getId()) + "]file-shooser:list-files", signalFileSelect, sharedFromThis(), &ewol::widget::FileChooser::onCallbackListFileSelectChange);
subBind(ewol::widget::ListFileSystem, "[" + etk::toString(getId()) + "]file-shooser:list-files", signalFileValidate, sharedFromThis(), &ewol::widget::FileChooser::onCallbackListFileValidate); subBind(ewol::widget::ListFileSystem, "[" + etk::toString(getId()) + "]file-shooser:list-files", signalFileValidate, sharedFromThis(), &ewol::widget::FileChooser::onCallbackListFileValidate);
subBind(ewol::widget::Entry, "[" + etk::toString(getId()) + "]file-shooser:entry-file", signalModify, sharedFromThis(), &ewol::widget::FileChooser::onCallbackEntryFileChangeValue); subBind(ewol::widget::Entry, "[" + etk::toString(getId()) + "]file-shooser:entry-file", signalModify, sharedFromThis(), &ewol::widget::FileChooser::onCallbackEntryFileChangeValue);
subBind(ewol::widget::Entry, "[" + etk::toString(getId()) + "]file-shooser:entry-file", signalEnter, sharedFromThis(), &ewol::widget::FileChooser::onCallbackListFileValidate); subBind(ewol::widget::Entry, "[" + etk::toString(getId()) + "]file-shooser:entry-file", signalEnter, sharedFromThis(), &ewol::widget::FileChooser::onCallbackEntryFileChangeValidate);
subBind(ewol::widget::Entry, "[" + etk::toString(getId()) + "]file-shooser:entry-folder", signalModify, sharedFromThis(), &ewol::widget::FileChooser::onCallbackEntryFolderChangeValue); subBind(ewol::widget::Entry, "[" + etk::toString(getId()) + "]file-shooser:entry-folder", signalModify, sharedFromThis(), &ewol::widget::FileChooser::onCallbackEntryFolderChangeValue);
//composerBind(ewol::widget::CheckBox, "[" + etk::toString(getId()) + "]file-shooser:entry-folder", signalEnter, sharedFromThis(), &ewol::widget::FileChooser::); //composerBind(ewol::widget::CheckBox, "[" + etk::toString(getId()) + "]file-shooser:entry-folder", signalEnter, sharedFromThis(), &ewol::widget::FileChooser::);
subBind(ewol::widget::Image, "[" + etk::toString(getId()) + "]file-shooser:img-home", signalPressed, sharedFromThis(), &ewol::widget::FileChooser::onCallbackHomePressed); subBind(ewol::widget::Image, "[" + etk::toString(getId()) + "]file-shooser:img-home", signalPressed, sharedFromThis(), &ewol::widget::FileChooser::onCallbackHomePressed);
@ -96,7 +96,7 @@ void ewol::widget::FileChooser::onChangePropertyPath() {
} }
void ewol::widget::FileChooser::onChangePropertyFile() { void ewol::widget::FileChooser::onChangePropertyFile() {
propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:entry-file", "value", propertyFile); propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:entry-file", "value", propertyFile.getString());
//updateCurrentFolder(); //updateCurrentFolder();
} }
@ -118,10 +118,10 @@ void ewol::widget::FileChooser::onCallbackEntryFolderChangeValue(const etk::Stri
} }
void ewol::widget::FileChooser::onCallbackEntryFileChangeValue(const etk::String& _value) { void ewol::widget::FileChooser::onCallbackEntryFileChangeValue(const etk::String& _value) {
// == > change the file name // == > change the file name.get(.get(
propertyFile.setDirect(_value); propertyFile.setDirect(_value);
// update the selected file in the list : // update the selected file in the list :
propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:list-files", "select", propertyFile); propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:list-files", "select", propertyFile.getString());
} }
void ewol::widget::FileChooser::onCallbackButtonCancelPressed() { void ewol::widget::FileChooser::onCallbackButtonCancelPressed() {
@ -140,17 +140,16 @@ void ewol::widget::FileChooser::onCallbackHidenFileChangeChangeValue(const bool&
} }
} }
void ewol::widget::FileChooser::onCallbackListFolderSelectChange(const etk::String& _value) { void ewol::widget::FileChooser::onCallbackListFolderSelectChange(const etk::Path& _value) {
// == > this is an internal event ... // == > this is an internal event ...
EWOL_DEBUG(" old PATH: '" << *propertyPath << "' + '" << _value << "'"); EWOL_DEBUG(" old PATH: '" << *propertyPath << "' + '" << _value << "'");
propertyPath.setDirect(propertyPath.get() + _value); propertyPath.setDirect(*propertyPath / _value);
EWOL_DEBUG("new PATH: '" << *propertyPath << "'"); EWOL_DEBUG("new PATH: '" << *propertyPath << "'");
propertyPath.setDirect(etk::simplifyPath(*propertyPath));
propertyFile.setDirect(""); propertyFile.setDirect("");
updateCurrentFolder(); updateCurrentFolder();
} }
void ewol::widget::FileChooser::onCallbackListFileSelectChange(const etk::String& _value) { void ewol::widget::FileChooser::onCallbackListFileSelectChange(const etk::Path& _value) {
propertyFile.set(_value); propertyFile.set(_value);
/* /*
etk::String tmpFileCompleatName = m_folder; etk::String tmpFileCompleatName = m_folder;
@ -159,7 +158,7 @@ void ewol::widget::FileChooser::onCallbackListFileSelectChange(const etk::String
*/ */
} }
void ewol::widget::FileChooser::onCallbackListFileValidate(const etk::String& _value) { void ewol::widget::FileChooser::onCallbackListFileValidate(const etk::Path& _value) {
// select the file == > generate a validate // select the file == > generate a validate
propertyFile.set(_value); propertyFile.set(_value);
EWOL_VERBOSE(" generate a fiel opening : '" << propertyPath << "' / '" << propertyFile << "'"); EWOL_VERBOSE(" generate a fiel opening : '" << propertyPath << "' / '" << propertyFile << "'");
@ -167,6 +166,10 @@ void ewol::widget::FileChooser::onCallbackListFileValidate(const etk::String& _v
autoDestroy(); autoDestroy();
} }
void ewol::widget::FileChooser::onCallbackEntryFileChangeValidate(const etk::String& _value) {
onCallbackListFileValidate(_value);
}
void ewol::widget::FileChooser::onCallbackListValidate() { void ewol::widget::FileChooser::onCallbackListValidate() {
if (propertyFile.get() == "") { if (propertyFile.get() == "") {
EWOL_WARNING(" Validate : '" << propertyPath << "' / '" << propertyFile << "' ==> error No name ..."); EWOL_WARNING(" Validate : '" << propertyPath << "' / '" << propertyFile << "' ==> error No name ...");
@ -178,31 +181,21 @@ void ewol::widget::FileChooser::onCallbackListValidate() {
} }
void ewol::widget::FileChooser::onCallbackHomePressed() { void ewol::widget::FileChooser::onCallbackHomePressed() {
etk::String tmpUserFolder = etk::getUserHomeFolder(); etk::Path tmpUserFolder = etk::path::getHomePath();
EWOL_DEBUG("new PATH : \"" << tmpUserFolder << "\""); EWOL_DEBUG("new PATH: '" << tmpUserFolder << "'");
propertyPath.setDirect(etk::simplifyPath(tmpUserFolder));
propertyPath.setDirect(tmpUserFolder);
propertyFile.setDirect(""); propertyFile.setDirect("");
updateCurrentFolder(); updateCurrentFolder();
} }
void ewol::widget::FileChooser::updateCurrentFolder() { void ewol::widget::FileChooser::updateCurrentFolder() {
if (*propertyPath != "") { propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:list-files", "path", propertyPath.getString());
if (propertyPath.get()[propertyPath->size()-1] != '/') { propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:list-folder", "path", propertyPath.getString());
propertyPath.getDirect() += "/"; propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:entry-folder", "value", propertyPath.getString());
}
}
propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:list-files", "path", propertyPath);
propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:list-folder", "path", propertyPath);
propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:entry-folder", "value", propertyPath);
markToRedraw(); markToRedraw();
} }
etk::String ewol::widget::FileChooser::getCompleateFileName() { etk::Path ewol::widget::FileChooser::getCompleateFileName() {
etk::String tmpString = propertyPath; return *propertyPath / *propertyFile;
tmpString += "/";
tmpString += propertyFile;
etk::FSNode node(tmpString);
return node.getName();
} }

View File

@ -66,10 +66,10 @@ namespace ewol {
class FileChooser : public ewol::widget::Composer { class FileChooser : public ewol::widget::Composer {
public: // signals public: // signals
esignal::Signal<> signalCancel; //!< abort the display of the pop-up or press cancel button esignal::Signal<> signalCancel; //!< abort the display of the pop-up or press cancel button
esignal::Signal<etk::String> signalValidate; //!< select file(s) esignal::Signal<etk::Path> signalValidate; //!< select file(s)
public: // properties public: // properties
eproperty::Value<etk::String> propertyPath; //!< Current path to explore eproperty::Value<etk::Path> propertyPath; //!< Current path to explore
eproperty::Value<etk::String> propertyFile; //!< Selected file eproperty::Value<etk::Path> propertyFile; //!< Selected file
eproperty::Value<etk::String> propertyLabelTitle; //!< Label of the pop-up (can use translation) eproperty::Value<etk::String> propertyLabelTitle; //!< Label of the pop-up (can use translation)
eproperty::Value<etk::String> propertyLabelValidate; //!< Label of validate button of the pop-up (can use translation) eproperty::Value<etk::String> propertyLabelValidate; //!< Label of validate button of the pop-up (can use translation)
eproperty::Value<etk::String> propertyLabelCancel; //!< Label of cancel/close button of the pop-up (can use translation) eproperty::Value<etk::String> propertyLabelCancel; //!< Label of cancel/close button of the pop-up (can use translation)
@ -80,7 +80,7 @@ namespace ewol {
DECLARE_WIDGET_FACTORY(FileChooser, "FileChooser"); DECLARE_WIDGET_FACTORY(FileChooser, "FileChooser");
virtual ~FileChooser(); virtual ~FileChooser();
private: private:
etk::String getCompleateFileName(); etk::Path getCompleateFileName();
void updateCurrentFolder(); void updateCurrentFolder();
public: public:
void onGetFocus() override; void onGetFocus() override;
@ -88,11 +88,12 @@ namespace ewol {
// callback functions: // callback functions:
void onCallbackEntryFolderChangeValue(const etk::String& _value); void onCallbackEntryFolderChangeValue(const etk::String& _value);
void onCallbackEntryFileChangeValue(const etk::String& _value); void onCallbackEntryFileChangeValue(const etk::String& _value);
void onCallbackEntryFileChangeValidate(const etk::String& _value);
void onCallbackButtonCancelPressed(); void onCallbackButtonCancelPressed();
void onCallbackHidenFileChangeChangeValue(const bool& _value); void onCallbackHidenFileChangeChangeValue(const bool& _value);
void onCallbackListFolderSelectChange(const etk::String& _value); void onCallbackListFolderSelectChange(const etk::Path& _value);
void onCallbackListFileSelectChange(const etk::String& _value); void onCallbackListFileSelectChange(const etk::Path& _value);
void onCallbackListFileValidate(const etk::String& _value); void onCallbackListFileValidate(const etk::Path& _value);
void onCallbackListValidate(); void onCallbackListValidate();
void onCallbackHomePressed(); void onCallbackHomePressed();
protected: protected:

View File

@ -63,7 +63,7 @@ namespace ewol {
*/ */
class SpinBase : public ewol::widget::Sizer { class SpinBase : public ewol::widget::Sizer {
public: // properties list: public: // properties list:
eproperty::Value<etk::String> propertyShape; //!< Shape of the widget eproperty::Value<etk::Uri> propertyShape; //!< Shape of the widget
eproperty::List<enum ewol::widget::spinPosition> propertySpinMode; //!< How to display the spin base eproperty::List<enum ewol::widget::spinPosition> propertySpinMode; //!< How to display the spin base
public: public:
UN_DECLARE_FACTORY(SpinBase); UN_DECLARE_FACTORY(SpinBase);