diff --git a/ewol/resource/ColorFile.hpp b/ewol/resource/ColorFile.hpp index e311f2a8..f8c2367b 100644 --- a/ewol/resource/ColorFile.hpp +++ b/ewol/resource/ColorFile.hpp @@ -28,7 +28,7 @@ namespace ewol { ColorFile(); void init(const etk::Uri& _uri); public: - DECLARE_RESOURCE_NAMED_FACTORY(ColorFile); + DECLARE_RESOURCE_URI_FACTORY(ColorFile); /** * @brief Simple Destructor of this class (nothing specific ...) */ diff --git a/ewol/resource/ConfigFile.hpp b/ewol/resource/ConfigFile.hpp index cd36d7da..0cc5045b 100644 --- a/ewol/resource/ConfigFile.hpp +++ b/ewol/resource/ConfigFile.hpp @@ -22,7 +22,7 @@ namespace ewol { void init(const etk::Uri& _filename); public: virtual ~ConfigFile(); - DECLARE_RESOURCE_NAMED_FACTORY(ConfigFile); + DECLARE_RESOURCE_URI_FACTORY(ConfigFile); public: void reload(); diff --git a/ewol/widget/Button.cpp b/ewol/widget/Button.cpp index e710f8f4..37cadefd 100644 --- a/ewol/widget/Button.cpp +++ b/ewol/widget/Button.cpp @@ -24,7 +24,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, "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), 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), @@ -129,10 +129,10 @@ bool ewol::widget::Button::onEventInput(const ewol::event::Input& _event) { markToRedraw(); } if(_event.getStatus() == gale::key::status::pressSingle) { - if( ( *propertyValue == true - && *propertyLock == ewol::widget::Button::lockWhenPressed) - || ( *propertyValue == false - && *propertyLock == ewol::widget::Button::lockWhenReleased) ) { + if ( ( *propertyValue == true + && *propertyLock == ewol::widget::Button::lockWhenPressed) + || ( *propertyValue == false + && *propertyLock == ewol::widget::Button::lockWhenReleased) ) { // nothing to do : Lock mode ... // user might set himself the new correct value with @ref setValue(xxx) } else { diff --git a/ewol/widget/Button.hpp b/ewol/widget/Button.hpp index 769f12b4..55c168c8 100644 --- a/ewol/widget/Button.hpp +++ b/ewol/widget/Button.hpp @@ -41,7 +41,7 @@ namespace ewol { esignal::Signal<> signalLeave; esignal::Signal signalValue; public: // propertie list - eproperty::Value propertyShape; //!< shaper name property + eproperty::Value propertyShape; //!< shaper name property eproperty::Value propertyValue; //!< Current state of the button. eproperty::List propertyLock; //!< Current lock state of the button. eproperty::Value propertyToggleMode; //!< The button is able to toggle. diff --git a/ewol/widget/ButtonColor.cpp b/ewol/widget/ButtonColor.cpp index 0bc11ff0..40393170 100644 --- a/ewol/widget/ButtonColor.cpp +++ b/ewol/widget/ButtonColor.cpp @@ -25,7 +25,7 @@ ETK_DECLARE_TYPE(ewol::widget::ButtonColor); 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", "{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) { addObjectType("ewol::widget::ButtonColor"); changeStatusIn(STATUS_UP); diff --git a/ewol/widget/ButtonColor.hpp b/ewol/widget/ButtonColor.hpp index 2f698ef9..07197944 100644 --- a/ewol/widget/ButtonColor.hpp +++ b/ewol/widget/ButtonColor.hpp @@ -25,7 +25,7 @@ namespace ewol { esignal::Signal> signalChange; public: // properties eproperty::Value> propertyValue; //!< Current color. - eproperty::Value propertyShape; //!< Current color. + eproperty::Value propertyShape; //!< Current color. private: ewol::compositing::Shaper m_shaper; //!< Compositing theme. ewol::compositing::Text m_text; //!< Compositing Test display. diff --git a/ewol/widget/CheckBox.cpp b/ewol/widget/CheckBox.cpp index 1c942c2c..e4f37f8c 100644 --- a/ewol/widget/CheckBox.cpp +++ b/ewol/widget/CheckBox.cpp @@ -27,7 +27,7 @@ ewol::widget::CheckBox::CheckBox() : "Basic value of the widget", &ewol::widget::CheckBox::onChangePropertyValue), propertyShape(this, "shape", - "{ewol}THEME:GUI:CheckBox.json", + etk::Uri("THEME_GUI://CheckBox.json?lib=ewol"), "The display name for config file", &ewol::widget::CheckBox::onChangePropertyShape), m_mouseHover(false), diff --git a/ewol/widget/CheckBox.hpp b/ewol/widget/CheckBox.hpp index 5fb6e577..b5059b31 100644 --- a/ewol/widget/CheckBox.hpp +++ b/ewol/widget/CheckBox.hpp @@ -27,7 +27,7 @@ namespace ewol { esignal::Signal signalValue; public: // propertie list eproperty::Value propertyValue; //!< Current state of the checkbox. - eproperty::Value propertyShape; //!< shape of the widget + eproperty::Value propertyShape; //!< shape of the widget private: ewol::compositing::Shaper m_shaper; //!< Compositing theme. bool m_mouseHover; //!< Flag to know where the mouse is (inside the displayed widget (if not fill)). diff --git a/ewol/widget/ContextMenu.cpp b/ewol/widget/ContextMenu.cpp index 1006d6cd..ee710baa 100644 --- a/ewol/widget/ContextMenu.cpp +++ b/ewol/widget/ContextMenu.cpp @@ -18,7 +18,7 @@ ETK_DECLARE_TYPE(enum ewol::widget::ContextMenu::markPosition); ewol::widget::ContextMenu::ContextMenu(): propertyShape(this, "shape", - "{ewol}THEME:GUI:ContextMenu.json", + etk::Uri("THEME_GUI://ContextMenu.json?lib=ewol"), "the display name for config file", &ewol::widget::ContextMenu::onChangePropertyShape), propertyArrowPos(this, "arrow-position", diff --git a/ewol/widget/ContextMenu.hpp b/ewol/widget/ContextMenu.hpp index 23faaec5..9dc15371 100644 --- a/ewol/widget/ContextMenu.hpp +++ b/ewol/widget/ContextMenu.hpp @@ -31,7 +31,7 @@ namespace ewol { markNone }; public: // properties - eproperty::Value propertyShape; //!< shape of the widget. + eproperty::Value propertyShape; //!< shape of the widget. eproperty::Value propertyArrowPos; eproperty::List propertyArrawBorder; protected: diff --git a/ewol/widget/Entry.cpp b/ewol/widget/Entry.cpp index 174914fc..079c0eb9 100644 --- a/ewol/widget/Entry.cpp +++ b/ewol/widget/Entry.cpp @@ -27,7 +27,7 @@ ewol::widget::Entry::Entry() : "Not display content in password mode", &ewol::widget::Entry::onChangePropertyPassword), propertyShape(this, "shape", - "{ewol}THEME:GUI:Entry.json", + etk::Uri("THEME_GUI://Entry.json?lib=ewol"), "Shaper to display the background", &ewol::widget::Entry::onChangePropertyShaper), propertyValue(this, "value", diff --git a/ewol/widget/Entry.hpp b/ewol/widget/Entry.hpp index 5aee0102..66eb62ff 100644 --- a/ewol/widget/Entry.hpp +++ b/ewol/widget/Entry.hpp @@ -38,7 +38,7 @@ namespace ewol { esignal::Signal signalModify; //!< data change public: // propertie list eproperty::Value propertyPassword; //!< Disable display of the content of the entry - eproperty::Value propertyShape; + eproperty::Value propertyShape; eproperty::Value propertyValue; //!< string that must be displayed eproperty::Range propertyMaxCharacter; //!< number max of xharacter in the list eproperty::Value propertyRegex; //!< regular expression value diff --git a/ewol/widget/Image.cpp b/ewol/widget/Image.cpp index 138d1d38..142284e7 100644 --- a/ewol/widget/Image.cpp +++ b/ewol/widget/Image.cpp @@ -28,7 +28,7 @@ ewol::widget::Image::Image() : m_colorId(-1) { addObjectType("ewol::widget::Image"); 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) { m_colorId = m_colorProperty->request("foreground"); } diff --git a/ewol/widget/Label.cpp b/ewol/widget/Label.cpp index 94677efb..505e2cf2 100644 --- a/ewol/widget/Label.cpp +++ b/ewol/widget/Label.cpp @@ -28,7 +28,7 @@ ewol::widget::Label::Label() : m_colorDefaultFgText(-1), m_colorDefaultBgText(-1){ 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) { m_colorDefaultFgText = m_colorProperty->request("foreground"); m_colorDefaultBgText = m_colorProperty->request("background"); diff --git a/ewol/widget/PopUp.cpp b/ewol/widget/PopUp.cpp index a5b8b5dd..f1c6ebe2 100644 --- a/ewol/widget/PopUp.cpp +++ b/ewol/widget/PopUp.cpp @@ -17,7 +17,7 @@ static const char* annimationIncrease = "increase"; ewol::widget::PopUp::PopUp() : propertyShape(this, "shaper", - "{ewol}THEME:GUI:PopUp.json", + etk::Uri("THEME_GUI://PopUp.json?lib=ewol"), "The shaper properties", &ewol::widget::PopUp::onChangePropertyShape), propertyLockExpand(this, "lock", diff --git a/ewol/widget/PopUp.hpp b/ewol/widget/PopUp.hpp index 18e3822d..3d784c96 100644 --- a/ewol/widget/PopUp.hpp +++ b/ewol/widget/PopUp.hpp @@ -23,7 +23,7 @@ namespace ewol { */ class PopUp : public ewol::widget::Container { public: // properties - eproperty::Value propertyShape; //!< Compositing theme. + eproperty::Value propertyShape; //!< Compositing theme. eproperty::Value propertyLockExpand; //!< Lock the expend of the sub widget to this one == > this permit to limit bigger subWidget eproperty::Value propertyCloseOutEvent; //!< ratio progression of a sliding protected: diff --git a/ewol/widget/Scroll.cpp b/ewol/widget/Scroll.cpp index 36aea9cd..90bc78e9 100644 --- a/ewol/widget/Scroll.cpp +++ b/ewol/widget/Scroll.cpp @@ -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", &ewol::widget::Scroll::onChangePropertyLimit), propertyShapeVert(this, "shape-vert", - "{ewol}THEME:GUI:WidgetScrolled.json", + etk::Uri("THEME_GUI://WidgetScrolled.json?lib=ewol"), "shape for the vertical display", &ewol::widget::Scroll::onChangePropertyShapeVert), propertyShapeHori(this, "shape-hori", - "{ewol}THEME:GUI:WidgetScrolled.json", + etk::Uri("THEME_GUI://WidgetScrolled.json?lib=ewol"), "shape for the horizonal display", &ewol::widget::Scroll::onChangePropertyShapeHori), propertyHover(this, "hover", diff --git a/ewol/widget/Scroll.hpp b/ewol/widget/Scroll.hpp index c5681425..e7959d01 100644 --- a/ewol/widget/Scroll.hpp +++ b/ewol/widget/Scroll.hpp @@ -20,8 +20,8 @@ namespace ewol { class Scroll : public ewol::widget::Container { public: // properties eproperty::Range propertyLimit; //!< Set the limitation of the ratio in the sreen - eproperty::Value propertyShapeVert; //!< Vertical shaper name - eproperty::Value propertyShapeHori; //!< Horizontal shaper name + eproperty::Value propertyShapeVert; //!< Vertical shaper name + eproperty::Value propertyShapeHori; //!< Horizontal shaper name eproperty::Value propertyHover; //!< Horizontal shaper name public: enum highSpeedMode { diff --git a/ewol/widget/Select.cpp b/ewol/widget/Select.cpp index a26b36f8..37c26afb 100644 --- a/ewol/widget/Select.cpp +++ b/ewol/widget/Select.cpp @@ -28,7 +28,7 @@ ewol::widget::Select::Select() : &ewol::widget::Select::onChangePropertyValue) { addObjectType("ewol::widget::Select"); // 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.changeDefault(ewol::widget::spinPosition_noneRight); propertySpinMode.rename("none-none", "none"); diff --git a/ewol/widget/Spin.cpp b/ewol/widget/Spin.cpp index 0fe62f91..6b6469f8 100644 --- a/ewol/widget/Spin.cpp +++ b/ewol/widget/Spin.cpp @@ -38,7 +38,7 @@ ewol::widget::Spin::Spin() : "fix-point mantis", &ewol::widget::Spin::onChangePropertyMantis) { 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() { diff --git a/ewol/widget/WidgetScrolled.cpp b/ewol/widget/WidgetScrolled.cpp index d96aab5a..073fcc45 100644 --- a/ewol/widget/WidgetScrolled.cpp +++ b/ewol/widget/WidgetScrolled.cpp @@ -15,11 +15,11 @@ ETK_DECLARE_TYPE(ewol::widget::WidgetScrolled); ewol::widget::WidgetScrolled::WidgetScrolled() : propertyShapeVert(this, "shape-vert", - "{ewol}THEME:GUI:WidgetScrolled.json", + etk::Uri("THEME_GUI://WidgetScrolled.json?lib=ewol"), "shape for the vertical display", &ewol::widget::WidgetScrolled::onChangePropertyShapeVert), propertyShapeHori(this, "shape-hori", - "{ewol}THEME:GUI:WidgetScrolled.json", + etk::Uri("THEME_GUI://WidgetScrolled.json?lib=ewol"), "shape for the horizonal display", &ewol::widget::WidgetScrolled::onChangePropertyShapeHori), m_shaperH(), diff --git a/ewol/widget/WidgetScrolled.hpp b/ewol/widget/WidgetScrolled.hpp index aab1d17e..0e95ea29 100644 --- a/ewol/widget/WidgetScrolled.hpp +++ b/ewol/widget/WidgetScrolled.hpp @@ -23,8 +23,8 @@ namespace ewol { */ class WidgetScrolled : public ewol::Widget { public: // properties: - eproperty::Value propertyShapeVert; //!< Vertical shaper name - eproperty::Value propertyShapeHori; //!< Horizontal shaper name + eproperty::Value propertyShapeVert; //!< Vertical shaper name + eproperty::Value propertyShapeHori; //!< Horizontal shaper name // TODO : All property public: enum scrollingMode { diff --git a/ewol/widget/Windows.cpp b/ewol/widget/Windows.cpp index 985c4ec9..b5dab889 100644 --- a/ewol/widget/Windows.cpp +++ b/ewol/widget/Windows.cpp @@ -18,8 +18,16 @@ ETK_DECLARE_TYPE(ewol::widget::Windows); ewol::widget::Windows::Windows() : - propertyColorConfiguration(this, "file-color", "{ewol}THEME:COLOR:Windows.json", "color file link on the theme", &ewol::widget::Windows::onChangePropertyColor), - propertyTitle(this, "title", "No title", "Title of the windows", &ewol::widget::Windows::onChangePropertyTitle), + propertyColorConfiguration(this, + "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_colorBg(-1) { addObjectType("ewol::widget::Windows"); diff --git a/ewol/widget/Windows.hpp b/ewol/widget/Windows.hpp index d1b2271f..0f8b2949 100644 --- a/ewol/widget/Windows.hpp +++ b/ewol/widget/Windows.hpp @@ -21,7 +21,7 @@ namespace ewol { */ class Windows : public ewol::Widget { public: - eproperty::Value propertyColorConfiguration; //!< Configuration file of the windows theme + eproperty::Value propertyColorConfiguration; //!< Configuration file of the windows theme eproperty::Value propertyTitle; //!< Current title of the windows protected: ememory::SharedPtr m_resourceColor; //!< theme color property (name of file in @ref propertyColorConfiguration) diff --git a/ewol/widget/meta/FileChooser.cpp b/ewol/widget/meta/FileChooser.cpp index 0b56235f..b737c453 100644 --- a/ewol/widget/meta/FileChooser.cpp +++ b/ewol/widget/meta/FileChooser.cpp @@ -19,7 +19,7 @@ //#include #include #include -#include +#include extern "C" { // file browsing ... @@ -34,7 +34,7 @@ ewol::widget::FileChooser::FileChooser() : signalCancel(this, "cancel", ""), signalValidate(this, "validate", ""), propertyPath(this, "path", - etk::getUserHomeFolder(), + etk::path::getHomePath(), "", &ewol::widget::FileChooser::onChangePropertyPath), 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", 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", 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); //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); @@ -96,7 +96,7 @@ void ewol::widget::FileChooser::onChangePropertyPath() { } 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(); } @@ -118,10 +118,10 @@ void ewol::widget::FileChooser::onCallbackEntryFolderChangeValue(const etk::Stri } void ewol::widget::FileChooser::onCallbackEntryFileChangeValue(const etk::String& _value) { - // == > change the file name + // == > change the file name.get(.get( propertyFile.setDirect(_value); // 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() { @@ -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 ... EWOL_DEBUG(" old PATH: '" << *propertyPath << "' + '" << _value << "'"); - propertyPath.setDirect(propertyPath.get() + _value); + propertyPath.setDirect(*propertyPath / _value); EWOL_DEBUG("new PATH: '" << *propertyPath << "'"); - propertyPath.setDirect(etk::simplifyPath(*propertyPath)); propertyFile.setDirect(""); updateCurrentFolder(); } -void ewol::widget::FileChooser::onCallbackListFileSelectChange(const etk::String& _value) { +void ewol::widget::FileChooser::onCallbackListFileSelectChange(const etk::Path& _value) { propertyFile.set(_value); /* 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 propertyFile.set(_value); EWOL_VERBOSE(" generate a fiel opening : '" << propertyPath << "' / '" << propertyFile << "'"); @@ -167,6 +166,10 @@ void ewol::widget::FileChooser::onCallbackListFileValidate(const etk::String& _v autoDestroy(); } +void ewol::widget::FileChooser::onCallbackEntryFileChangeValidate(const etk::String& _value) { + onCallbackListFileValidate(_value); +} + void ewol::widget::FileChooser::onCallbackListValidate() { if (propertyFile.get() == "") { EWOL_WARNING(" Validate : '" << propertyPath << "' / '" << propertyFile << "' ==> error No name ..."); @@ -178,31 +181,21 @@ void ewol::widget::FileChooser::onCallbackListValidate() { } void ewol::widget::FileChooser::onCallbackHomePressed() { - etk::String tmpUserFolder = etk::getUserHomeFolder(); - EWOL_DEBUG("new PATH : \"" << tmpUserFolder << "\""); - - propertyPath.setDirect(etk::simplifyPath(tmpUserFolder)); + etk::Path tmpUserFolder = etk::path::getHomePath(); + EWOL_DEBUG("new PATH: '" << tmpUserFolder << "'"); + propertyPath.setDirect(tmpUserFolder); propertyFile.setDirect(""); updateCurrentFolder(); } void ewol::widget::FileChooser::updateCurrentFolder() { - if (*propertyPath != "") { - if (propertyPath.get()[propertyPath->size()-1] != '/') { - propertyPath.getDirect() += "/"; - } - } - 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); + propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:list-files", "path", propertyPath.getString()); + propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:list-folder", "path", propertyPath.getString()); + propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:entry-folder", "value", propertyPath.getString()); markToRedraw(); } -etk::String ewol::widget::FileChooser::getCompleateFileName() { - etk::String tmpString = propertyPath; - tmpString += "/"; - tmpString += propertyFile; - etk::FSNode node(tmpString); - return node.getName(); +etk::Path ewol::widget::FileChooser::getCompleateFileName() { + return *propertyPath / *propertyFile; } diff --git a/ewol/widget/meta/FileChooser.hpp b/ewol/widget/meta/FileChooser.hpp index 5e7d4b57..1059357a 100644 --- a/ewol/widget/meta/FileChooser.hpp +++ b/ewol/widget/meta/FileChooser.hpp @@ -66,10 +66,10 @@ namespace ewol { class FileChooser : public ewol::widget::Composer { public: // signals esignal::Signal<> signalCancel; //!< abort the display of the pop-up or press cancel button - esignal::Signal signalValidate; //!< select file(s) + esignal::Signal signalValidate; //!< select file(s) public: // properties - eproperty::Value propertyPath; //!< Current path to explore - eproperty::Value propertyFile; //!< Selected file + eproperty::Value propertyPath; //!< Current path to explore + eproperty::Value propertyFile; //!< Selected file eproperty::Value propertyLabelTitle; //!< Label of the pop-up (can use translation) eproperty::Value propertyLabelValidate; //!< Label of validate button of the pop-up (can use translation) eproperty::Value propertyLabelCancel; //!< Label of cancel/close button of the pop-up (can use translation) @@ -80,7 +80,7 @@ namespace ewol { DECLARE_WIDGET_FACTORY(FileChooser, "FileChooser"); virtual ~FileChooser(); private: - etk::String getCompleateFileName(); + etk::Path getCompleateFileName(); void updateCurrentFolder(); public: void onGetFocus() override; @@ -88,11 +88,12 @@ namespace ewol { // callback functions: void onCallbackEntryFolderChangeValue(const etk::String& _value); void onCallbackEntryFileChangeValue(const etk::String& _value); + void onCallbackEntryFileChangeValidate(const etk::String& _value); void onCallbackButtonCancelPressed(); void onCallbackHidenFileChangeChangeValue(const bool& _value); - void onCallbackListFolderSelectChange(const etk::String& _value); - void onCallbackListFileSelectChange(const etk::String& _value); - void onCallbackListFileValidate(const etk::String& _value); + void onCallbackListFolderSelectChange(const etk::Path& _value); + void onCallbackListFileSelectChange(const etk::Path& _value); + void onCallbackListFileValidate(const etk::Path& _value); void onCallbackListValidate(); void onCallbackHomePressed(); protected: diff --git a/ewol/widget/meta/SpinBase.hpp b/ewol/widget/meta/SpinBase.hpp index 48c440c6..9dbdff55 100644 --- a/ewol/widget/meta/SpinBase.hpp +++ b/ewol/widget/meta/SpinBase.hpp @@ -63,7 +63,7 @@ namespace ewol { */ class SpinBase : public ewol::widget::Sizer { public: // properties list: - eproperty::Value propertyShape; //!< Shape of the widget + eproperty::Value propertyShape; //!< Shape of the widget eproperty::List propertySpinMode; //!< How to display the spin base public: UN_DECLARE_FACTORY(SpinBase);