[DEV] update new URI and treeview

This commit is contained in:
Edouard DUPIN 2018-10-09 23:03:07 +02:00
parent dbe995abd8
commit 844aaa90dd
59 changed files with 194 additions and 197 deletions

View File

@ -7,13 +7,13 @@
<spacer expand="true,false"/> <spacer expand="true,false"/>
<button name="[{ID}]file-shooser:button-validate"> <button name="[{ID}]file-shooser:button-validate">
<sizer mode="hori"> <sizer mode="hori">
<image src="{ewol}THEME:GUI:Load.svg" fill="true" size="7,7mm"/> <image src="THEME_GUI:///Load.svg?lib=ewol" fill="true" size="7,7mm"/>
<label name="[{ID}]file-shooser:validate-label">_T{Validate}</label> <label name="[{ID}]file-shooser:validate-label">_T{Validate}</label>
</sizer> </sizer>
</button> </button>
<button name="[{ID}]file-shooser:button-cancel"> <button name="[{ID}]file-shooser:button-cancel">
<sizer mode="hori"> <sizer mode="hori">
<image src="{ewol}THEME:GUI:Remove.svg" fill="true" size="7,7mm"/> <image src="THEME_GUI:///Remove.svg?lib=ewol" fill="true" size="7,7mm"/>
<label name="[{ID}]file-shooser:cancel-label">_T{Cancel}</label> <label name="[{ID}]file-shooser:cancel-label">_T{Cancel}</label>
</sizer> </sizer>
</button> </button>
@ -37,13 +37,13 @@
<spacer min-size="2,2mm"/> <spacer min-size="2,2mm"/>
</sizer> </sizer>
<sizer mode="hori"> <sizer mode="hori">
<image name="[{ID}]file-shooser:img-file" src="{ewol}THEME:GUI:File.svg" expand="false" size="8,8mm"/> <image name="[{ID}]file-shooser:img-file" src="THEME_GUI:///File.svg?lib=ewol" expand="false" size="8,8mm"/>
<entry name="[{ID}]file-shooser:entry-file" expand="true,false" fill="true,false"/> <entry name="[{ID}]file-shooser:entry-file" expand="true,false" fill="true,false"/>
</sizer> </sizer>
<sizer mode="hori"> <sizer mode="hori">
<image name="[{ID}]file-shooser:img-folder" src="{ewol}THEME:GUI:Folder.svg" expand="false" size="8,8mm"/> <image name="[{ID}]file-shooser:img-folder" src="THEME_GUI:///Folder.svg?lib=ewol" expand="false" size="8,8mm"/>
<entry name="[{ID}]file-shooser:entry-folder" expand="true,false" fill="true,false"/> <entry name="[{ID}]file-shooser:entry-folder" expand="true,false" fill="true,false"/>
<image name="[{ID}]file-shooser:img-home" src="{ewol}THEME:GUI:Home.svg" expand="false" size="8,8mm"/> <image name="[{ID}]file-shooser:img-home" src="THEME_GUI:///Home.svg?lib=ewol" expand="false" size="8,8mm"/>
</sizer> </sizer>
<label name="[{ID}]file-shooser:title-label">_T{Title}</label> <label name="[{ID}]file-shooser:title-label">_T{Title}</label>
</sizer> </sizer>

View File

@ -18,6 +18,6 @@
padding-in-buttom:1, padding-in-buttom:1,
change-time:356, change-time:356,
program:"{ewol}THEME:GUI:Button.prog", program:"THEME_GUI:///Button.prog?lib=ewol",
color:"{ewol}THEME:COLOR:Button.json" color:"THEME_COLOR:///Button.json?lib=ewol"
} }

View File

@ -6,6 +6,6 @@
padding-top:10, padding-top:10,
padding-buttom:10, padding-buttom:10,
change-time:356, change-time:356,
program:"{ewol}THEME:GUI:CheckBox.prog", program:"THEME_GUI:///CheckBox.prog?lib=ewol",
color:"{ewol}THEME:COLOR:CheckBox.json" color:"THEME_COLOR:///CheckBox.json?lib=ewol"
} }

View File

@ -18,6 +18,6 @@
padding-in-buttom:1, padding-in-buttom:1,
change-time:356, change-time:356,
program:"{ewol}THEME:GUI:ContextMenu.prog", program:"THEME_GUI:///ContextMenu.prog?lib=ewol",
color:"{ewol}THEME:COLOR:ContextMenu.json" color:"THEME_COLOR:///ContextMenu.json?lib=ewol"
} }

View File

@ -18,6 +18,6 @@
padding-in-buttom:1, padding-in-buttom:1,
change-time:356, change-time:356,
program:"{ewol}THEME:GUI:Entry.prog", program:"THEME_GUI:///Entry.prog?lib=ewol",
color:"{ewol}THEME:COLOR:Entry.json" color:"THEME_COLOR:///Entry.json?lib=ewol"
} }

View File

@ -18,6 +18,6 @@
padding-in-buttom:1, padding-in-buttom:1,
change-time:356, change-time:356,
program:"{ewol}THEME:GUI:PopUp.prog", program:"THEME_GUI:///PopUp.prog?lib=ewol,
color:"{ewol}THEME:COLOR:PopUp.json" color:"THEME_COLOR:///PopUp.json?lib=ewol"
} }

View File

@ -4,6 +4,6 @@
padding-top:16, padding-top:16,
padding-buttom:16, padding-buttom:16,
change-time:200, change-time:200,
program:"{ewol}THEME:GUI:WidgetScrolled.prog", program:"THEME_GUI:///WidgetScrolled.prog?lib=ewol",
color:"{ewol}THEME:COLOR:WidgetScrolled.json" color:"THEME_COLOR:///WidgetScrolled.json?lib=ewol"
} }

View File

@ -18,6 +18,6 @@
padding-in-buttom:1, padding-in-buttom:1,
change-time:356, change-time:356,
program:"{ewol}THEME:GUI:Button.prog", program:"THEME_GUI:///Button.prog?lib=ewol",
color:"{ewol}THEME:COLOR:Button.json" color:"THEME_COLOR:///Button.json?lib=ewol"
} }

View File

@ -20,6 +20,6 @@
box-size:20, box-size:20,
box-inside:12, box-inside:12,
change-time:356, change-time:356,
program:"{ewol}THEME:GUI:CheckBox.prog", program:"THEME_GUI:///CheckBox.prog?lib=ewol",
color:"{ewol}THEME:COLOR:CheckBox.json" color:"THEME_COLOR:///CheckBox.json?lib=ewol"
} }

View File

@ -18,6 +18,6 @@
padding-in-buttom:2, padding-in-buttom:2,
change-time:356, change-time:356,
program:"{ewol}THEME:GUI:ContextMenu.prog", program:"THEME_GUI:///ContextMenu.prog?lib=ewol",
color:"{ewol}THEME:COLOR:ContextMenu.json" color:"THEME_COLOR:///ContextMenu.json?lib=ewol"
} }

View File

@ -18,6 +18,6 @@
padding-in-buttom:2, padding-in-buttom:2,
change-time:356, change-time:356,
program:"{ewol}THEME:GUI:Entry.prog", program:"THEME_GUI:///Entry.prog?lib=ewol",
color:"{ewol}THEME:COLOR:Entry.json" color:"THEME_COLOR:///Entry.json?lib=ewol"
} }

View File

@ -18,6 +18,6 @@
padding-in-buttom:2, padding-in-buttom:2,
change-time:356, change-time:356,
program:"{ewol}THEME:GUI:PopUp.prog", program:"THEME_GUI:///PopUp.prog?lib=ewol",
color:"{ewol}THEME:COLOR:PopUp.json" color:"THEME_COLOR:///PopUp.json?lib=ewol"
} }

View File

@ -1,5 +1,5 @@
{ {
entry-shaper:"{ewol}THEME:GUI:SelectEntry.json", entry-shaper:"THEME_GUI:///SelectEntry.json?lib=ewol",
up-shaper:"{ewol}THEME:GUI:SelectBt.json", up-shaper:"THEME_GUI:///SelectBt.json?lib=ewol",
up-data:"<label>*</label>", up-data:"<label>*</label>",
} }

View File

@ -18,6 +18,6 @@
padding-in-buttom:1, padding-in-buttom:1,
change-time:356, change-time:356,
program:"{ewol}THEME:GUI:Button.prog", program:"THEME_GUI:///Button.prog?lib=ewol",
color:"{ewol}THEME:COLOR:Button.json" color:"THEME_COLOR:///Button.json?lib=ewol"
} }

View File

@ -18,6 +18,6 @@
padding-in-buttom:1, padding-in-buttom:1,
change-time:356, change-time:356,
program:"{ewol}THEME:GUI:Entry.prog", program:"THEME_GUI:///Entry.prog?lib=ewol",
color:"{ewol}THEME:COLOR:Entry.json" color:"THEME_COLOR:///Entry.json?lib=ewol"
} }

View File

@ -1,7 +1,7 @@
{ {
entry-shaper:"{ewol}THEME:GUI:SpinEntry.json", entry-shaper:"THEME_GUI:///SpinEntry.json?lib=ewol",
up-shaper:"{ewol}THEME:GUI:SpinUp.json", up-shaper:"THEME_GUI:///SpinUp.json?lib=ewol",
up-data:"<label>+</label>", up-data:"<label>+</label>",
down-shaper:"{ewol}THEME:GUI:SpinDown.json", down-shaper:"THEME_GUI:///SpinDown.json?lib=ewol",
down-data:"<label>-</label>", down-data:"<label>-</label>",
} }

View File

@ -18,6 +18,6 @@
padding-in-buttom:1, padding-in-buttom:1,
change-time:356, change-time:356,
program:"{ewol}THEME:GUI:Button.prog", program:"THEME_GUI:///Button.prog?lib=ewol",
color:"{ewol}THEME:COLOR:Button.json" color:"THEME_COLOR:///Button.json?lib=ewol"
} }

View File

@ -18,6 +18,6 @@
padding-in-buttom:1, padding-in-buttom:1,
change-time:356, change-time:356,
program:"{ewol}THEME:GUI:Entry.prog", program:"THEME_GUI:///Entry.prog?lib=ewol",
color:"{ewol}THEME:COLOR:Entry.json" color:"THEME_COLOR:///Entry.json?lib=ewol"
} }

View File

@ -18,6 +18,6 @@
padding-in-buttom:1, padding-in-buttom:1,
change-time:356, change-time:356,
program:"{ewol}THEME:GUI:Button.prog", program:"THEME_GUI:///Button.prog?lib=ewol",
color:"{ewol}THEME:COLOR:Button.json" color:"THEME_COLOR:///Button.json?lib=ewol"
} }

View File

@ -18,6 +18,6 @@
padding-in-buttom:3, padding-in-buttom:3,
change-time:200, change-time:200,
program:"{ewol}THEME:GUI:WidgetScrolled.prog", program:"THEME_GUI:///WidgetScrolled.prog?lib=ewol",
color:"{ewol}THEME:COLOR:WidgetScrolled.json" color:"THEME_COLOR:///WidgetScrolled.json?lib=ewol"
} }

View File

@ -29,7 +29,7 @@ Generic Properties {#ewol_tutorial_file_access_pr
By default we dertermine some basics for files. By default we dertermine some basics for files.
Then we need to determine file in the tree with: Then we need to determine file in the tree with:
- **"DATA:XXX"** Application internal data - **"DATA:///XXX"** Application internal data
* Linux: /usr/share/applName/ * Linux: /usr/share/applName/
* Android: /xxx/yyy/applName.apk/asssets/ * Android: /xxx/yyy/applName.apk/asssets/
* IOs: applName.app/share * IOs: applName.app/share
@ -47,7 +47,7 @@ Then we need to determine file in the tree with:
When you will call a file, you need to just call it with the starting name. When you will call a file, you need to just call it with the starting name.
For example if I want to access at an application data I will call the file : "DATA:myImage.png" For example if I want to access at an application data I will call the file : "DATA:///myImage.png"
Integrate a file in a package {#ewol_tutorial_file_access_package} Integrate a file in a package {#ewol_tutorial_file_access_package}
============================= =============================
@ -61,7 +61,7 @@ In your ```lutin_xxx.py``` file add:
myModule.copy_path("relative/path/start*.png","destination/folder/") myModule.copy_path("relative/path/start*.png","destination/folder/")
``` ```
And now you can acces on these file with : "DATA:destination/folder/fileNewName.svg" And now you can acces on these file with : "DATA:///destination/folder/fileNewName.svg"
Read a file {#ewol_tutorial_file_access_read} Read a file {#ewol_tutorial_file_access_read}
@ -73,7 +73,7 @@ Read a file {#ewol_tutorial_file_access_read}
... ...
etk::FSNode file("DATA:destination/folder/file.svg"); etk::FSNode file("DATA:///destination/folder/file.svg");
if (file.exist() == false) { if (file.exist() == false) {
APPL_ERROR("Can not read the file (Does not exist)"); APPL_ERROR("Can not read the file (Does not exist)");
return; return;
@ -144,7 +144,7 @@ And when you want to change the theme, just call:
This is not done automaticly, because reloading the resources can have a real cost of time. This is not done automaticly, because reloading the resources can have a real cost of time.
``` ```
You can acces on your theme with accessing the filename: "THEME:GUI_COLOR:your/sub/path/file.xx" You can acces on your theme with accessing the filename: "THEME_GUI_COLOR:///your/sub/path/file.xx"
An important think is that the theme file is searching in many path in the order: An important think is that the theme file is searching in many path in the order:
- USERDATA:GUI_COLOR:your/sub/path/file.xx - USERDATA:GUI_COLOR:your/sub/path/file.xx

View File

@ -40,7 +40,7 @@ namespace appl {
//! @brief Constructor //! @brief Constructor
MyObj(void) : MyObj(void) :
propertyConfig(this, "file", propertyConfig(this, "file",
"DATA:ExapleConfig.json", "DATA:///ExapleConfig.json",
"no desc", "no desc",
&appl::MyObj::onChangePropertyFile), &appl::MyObj::onChangePropertyFile),
m_configValId(-1) { m_configValId(-1) {
@ -128,7 +128,7 @@ When loose hardware (juste update internal state the hardware is no more present
void removeContextToLate(); void removeContextToLate();
``` ```
When user request to reload all resources (can be usefull when using file type : THEME:GUI:xxx) When user request to reload all resources (can be usefull when using file type : THEME_GUI:///xxx)
```{.cpp} ```{.cpp}
void reload(); void reload();
``` ```

View File

@ -98,7 +98,7 @@ File ```gui.xml```
```{.cpp} ```{.cpp}
#include <ewol::widget::Composer.hpp> #include <ewol::widget::Composer.hpp>
ewol::widget::WidgetShared tmpWidget = ewol::widget::composerGenerateFile("DATA:gui.xml"); ewol::widget::WidgetShared tmpWidget = ewol::widget::composerGenerateFile("DATA:///gui.xml");
if (tmpWidget == null) { if (tmpWidget == null) {
APPL_CRITICAL("The widget can not be created"); APPL_CRITICAL("The widget can not be created");
} }

View File

@ -46,7 +46,7 @@ ewol::compositing::Area::~Area() {
void ewol::compositing::Area::loadProgram() { void ewol::compositing::Area::loadProgram() {
// get the shader resource : // get the shader resource :
m_GLPosition = 0; m_GLPosition = 0;
m_GLprogram = gale::resource::Program::create(etk::String("{ewol}DATA:textured3D.prog")); m_GLprogram = gale::resource::Program::create(etk::String("DATA:///textured3D.prog?lib=ewol"));
if (m_GLprogram != null) { if (m_GLprogram != null) {
m_GLPosition = m_GLprogram->getAttribute("EW_coord3d"); m_GLPosition = m_GLprogram->getAttribute("EW_coord3d");
m_GLColor = m_GLprogram->getAttribute("EW_color"); m_GLColor = m_GLprogram->getAttribute("EW_color");

View File

@ -299,7 +299,7 @@ void ewol::compositing::Drawing::loadProgram() {
// remove previous loading ... in case // remove previous loading ... in case
unLoadProgram(); unLoadProgram();
// oad the new ... // oad the new ...
m_GLprogram = gale::resource::Program::create("{ewol}DATA:color3.prog"); m_GLprogram = gale::resource::Program::create("DATA:///color3.prog?lib=ewol");
// get the shader resource : // get the shader resource :
if (m_GLprogram != null) { if (m_GLprogram != null) {
m_GLPosition = m_GLprogram->getAttribute("EW_coord3d"); m_GLPosition = m_GLprogram->getAttribute("EW_coord3d");

View File

@ -58,9 +58,9 @@ void ewol::compositing::Image::loadProgram() {
m_GLPosition = 0; m_GLPosition = 0;
m_GLprogram.reset(); m_GLprogram.reset();
if (m_distanceFieldMode == true) { if (m_distanceFieldMode == true) {
m_GLprogram = gale::resource::Program::create("{ewol}DATA:texturedDF.prog"); m_GLprogram = gale::resource::Program::create("DATA:///texturedDF.prog?lib=ewol");
} else { } else {
m_GLprogram = gale::resource::Program::create("{ewol}DATA:textured3D.prog"); m_GLprogram = gale::resource::Program::create("DATA:///textured3D.prog?lib=ewol");
} }
if (m_GLprogram != null) { if (m_GLprogram != null) {
m_GLPosition = m_GLprogram->getAttribute("EW_coord3d"); m_GLPosition = m_GLprogram->getAttribute("EW_coord3d");

View File

@ -99,7 +99,7 @@ namespace ewol {
/** /**
* @brief generic constructor * @brief generic constructor
*/ */
TextBase(const etk::String& _shaderName = "{ewol}DATA:text.prog", bool _loadProgram = true); TextBase(const etk::String& _shaderName = "DATA:///text.prog?lib=ewol", bool _loadProgram = true);
/** /**
* @brief generic destructor * @brief generic destructor
*/ */

View File

@ -17,7 +17,7 @@ ewol::compositing::TextDF::TextDF(const etk::String& _fontName, int32_t _fontSiz
m_GLglyphLevel(-1), m_GLglyphLevel(-1),
m_size(12.0) { m_size(12.0) {
setFont(_fontName, _fontSize); setFont(_fontName, _fontSize);
loadProgram("{ewol}DATA:fontDistanceField/font1.prog"); loadProgram("DATA:///fontDistanceField/font1.prog?lib=ewol");
} }
ewol::compositing::TextDF::~TextDF() { ewol::compositing::TextDF::~TextDF() {

View File

@ -10,7 +10,7 @@
ETK_DECLARE_TYPE(ewol::context::ConfigFont); ETK_DECLARE_TYPE(ewol::context::ConfigFont);
ewol::context::ConfigFont::ConfigFont() : ewol::context::ConfigFont::ConfigFont() :
m_folder("{ewol}DATA:fonts"), m_folder("DATA:///fonts?lib=ewol"),
m_name("Arial;Helvetica"), m_name("Arial;Helvetica"),
m_size(10), m_size(10),
m_useExternal(false) { m_useExternal(false) {

View File

@ -68,7 +68,7 @@ void ewol::Context::inputEventUnGrabPointer() {
void ewol::Context::onCreate(gale::Context& _context) { void ewol::Context::onCreate(gale::Context& _context) {
EWOL_INFO(" == > Ewol system create (BEGIN)"); EWOL_INFO(" == > Ewol system create (BEGIN)");
// Add basic ewol translation: // Add basic ewol translation:
etranslate::addPath("ewol", "{ewol}DATA:translate/ewol/"); etranslate::addPath("ewol", "DATA:///translate/ewol/?lib=ewol");
etranslate::autoDetectLanguage(); etranslate::autoDetectLanguage();
// By default we set 2 themes (1 color and 1 shape ...) : // By default we set 2 themes (1 color and 1 shape ...) :
etk::theme::setNameDefault("GUI", "shape/square/"); etk::theme::setNameDefault("GUI", "shape/square/");

View File

@ -24,7 +24,7 @@ void ewol::resource::Colored3DObject::init() {
gale::Resource::init(); gale::Resource::init();
// get the shader resource : // get the shader resource :
m_GLPosition = 0; m_GLPosition = 0;
m_GLprogram = gale::resource::Program::create("{ewol}DATA:simple3D.prog"); m_GLprogram = gale::resource::Program::create("DATA:///simple3D.prog?lib=ewol");
if (m_GLprogram != null) { if (m_GLprogram != null) {
m_GLPosition = m_GLprogram->getAttribute("EW_coord3d"); m_GLPosition = m_GLprogram->getAttribute("EW_coord3d");
m_GLColor = m_GLprogram->getUniform("EW_color"); m_GLColor = m_GLprogram->getUniform("EW_color");

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", etk::Uri("THEME_GUI://Button.json?lib=ewol"), "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),

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", etk::Uri("THEME_GUI://Button.json?lib=ewol"), "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

@ -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",
etk::Uri("THEME_GUI://CheckBox.json?lib=ewol"), 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

@ -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",
etk::Uri("THEME_GUI://ContextMenu.json?lib=ewol"), 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

@ -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",
etk::Uri("THEME_GUI://Entry.json?lib=ewol"), 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",
@ -162,7 +162,7 @@ void ewol::widget::Entry::onRegenerateDisplay() {
} else { } else {
m_text.setCursorPos(m_displayCursorPos); m_text.setCursorPos(m_displayCursorPos);
} }
etk::String valueToDisplay = *propertyValue; etk::UString valueToDisplay = etk::toUString(*propertyValue);
if (*propertyPassword == true) { if (*propertyPassword == true) {
for (auto &it: valueToDisplay) { for (auto &it: valueToDisplay) {
it = '*'; it = '*';
@ -375,14 +375,16 @@ bool ewol::widget::Entry::onEventEntry(const ewol::event::Entry& _event) {
m_displayCursorPosSelection = m_displayCursorPos; m_displayCursorPosSelection = m_displayCursorPos;
} }
} else if(_event.getChar() >= 20) { } else if(_event.getChar() >= 20) {
EWOL_ERROR("get data: '" << _event.getChar() << "' = '" << u32char::convertToUtf8(_event.getChar()) << "'");
if ((int64_t)propertyValue->size() > propertyMaxCharacter) { if ((int64_t)propertyValue->size() > propertyMaxCharacter) {
EWOL_INFO("Reject data for entry : '" << _event.getChar() << "'"); EWOL_INFO("Reject data for entry : '" << _event.getChar() << "'");
} else { } else {
etk::String newData = propertyValue; etk::String newData = propertyValue;
newData.insert(newData.begin()+m_displayCursorPos, _event.getChar()); etk::String inputData = u32char::convertToUtf8(_event.getChar());
newData.insert(newData.begin()+m_displayCursorPos, inputData);
setInternalValue(newData); setInternalValue(newData);
if (propertyValue.get() == newData) { if (propertyValue.get() == newData) {
m_displayCursorPos++; m_displayCursorPos += inputData.size();
m_displayCursorPosSelection = m_displayCursorPos; m_displayCursorPosSelection = m_displayCursorPos;
} }
} }

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(etk::Uri("THEME_COLOR://Image.json?lib=ewol")); 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

@ -33,7 +33,7 @@ namespace ewol {
eproperty::Range<vec2> propertyPosStop; //!< position in the image to start the sisplay (when we want not to display all the image) eproperty::Range<vec2> propertyPosStop; //!< position in the image to start the sisplay (when we want not to display all the image)
eproperty::Value<bool> propertyDistanceFieldMode; //!< to have a parameter eproperty::Value<bool> propertyDistanceFieldMode; //!< to have a parameter
eproperty::Value<bool> propertySmooth; //!< display is done in the pixed approximation if false eproperty::Value<bool> propertySmooth; //!< display is done in the pixed approximation if false
eproperty::Value<bool> propertyUseThemeColor; //!< Use the themo color management ("{ewol}THEME:COLOR:Image.json") default false eproperty::Value<bool> propertyUseThemeColor; //!< Use the themo color management ("THEME_COLOR:///Image.json?lib=ewol") default false
protected: protected:
ewol::compositing::Image m_compositing; //!< compositing element of the image. ewol::compositing::Image m_compositing; //!< compositing element of the image.
ememory::SharedPtr<ewol::resource::ColorFile> m_colorProperty; //!< theme color property ememory::SharedPtr<ewol::resource::ColorFile> m_colorProperty; //!< theme color property

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(etk::Uri("THEME_COLOR://Label.json?lib=ewol")); 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

@ -29,16 +29,31 @@ ewol::widget::List::List() {
void ewol::widget::List::init() { void ewol::widget::List::init() {
ewol::widget::WidgetScrolled::init(); ewol::widget::WidgetScrolled::init();
addComposeElemnent("drawing", ememory::makeShared<ewol::compositing::Drawing>());
addComposeElemnent("text", ememory::makeShared<ewol::compositing::Text>());
} }
ewol::widget::List::~List() { ewol::widget::List::~List() {
//clean all the object
for (size_t iii=0; iii<m_listOObject.size(); iii++) {
ETK_DELETE(ewol::Compositing, m_listOObject[iii]);
m_listOObject[iii] = null;
} }
m_listOObject.clear();
void ewol::widget::List::addComposeElemnent(const etk::String& _name, const ememory::SharedPtr<ewol::Compositing>& _element) {
m_compositingElements.set(_name, _element);
m_listOObject.pushBack(_element);
}
void ewol::widget::List::clearComposeElemnent() {
for (auto &it: m_compositingElements) {
it.second->clear();
}
}
void ewol::widget::List::removeComposeElemnent() {
m_compositingElements.clear();
}
ememory::SharedPtr<ewol::Compositing> ewol::widget::List::getComposeElemnent(const etk::String& _name) {
return m_compositingElements[_name];
} }
/* /*
void ewol::widget::List::setRawVisible(int32_t _id) { void ewol::widget::List::setRawVisible(int32_t _id) {
@ -79,27 +94,6 @@ void ewol::widget::List::calculateMinMaxSize() {
m_minSize.setValue(200, 150); m_minSize.setValue(200, 150);
} }
void ewol::widget::List::addOObject(ewol::Compositing* _newObject, int32_t _pos) {
if (_newObject == null) {
EWOL_ERROR("Try to add an empty object in the Widget generic display system");
return;
}
if ( _pos < 0
|| (size_t)_pos >= m_listOObject.size() ) {
m_listOObject.pushBack(_newObject);
} else {
m_listOObject.insert(m_listOObject.begin()+_pos, _newObject);
}
}
void ewol::widget::List::clearOObjectList() {
for (size_t iii=0; iii<m_listOObject.size(); iii++) {
ETK_DELETE(ewol::Compositing, m_listOObject[iii]);
m_listOObject[iii] = null;
}
m_listOObject.clear();
}
void ewol::widget::List::onDraw() { void ewol::widget::List::onDraw() {
for (size_t iii=0; iii<m_listOObject.size(); iii++) { for (size_t iii=0; iii<m_listOObject.size(); iii++) {
if (m_listOObject[iii] != null) { if (m_listOObject[iii] != null) {
@ -112,7 +106,7 @@ void ewol::widget::List::onDraw() {
void ewol::widget::List::onRegenerateDisplay() { void ewol::widget::List::onRegenerateDisplay() {
if (needRedraw() == true) { if (needRedraw() == true) {
// clean the object list ... // clean the object list ...
clearOObjectList(); clearComposeElemnent();
// ------------------------------------------------------- // -------------------------------------------------------
// -- Calculate the size of each element // -- Calculate the size of each element
// ------------------------------------------------------- // -------------------------------------------------------
@ -232,9 +226,9 @@ ivec2 ewol::widget::List::getMatrixSize() const {
} }
vec2 ewol::widget::List::calculateElementSize(const ivec2& _pos) { vec2 ewol::widget::List::calculateElementSize(const ivec2& _pos) {
ewol::compositing::Text tmpText; auto tmpText = ememory::staticPointerCast<ewol::compositing::Text>(getComposeElemnent("text"));
etk::String myTextToWrite = getData(ListRole::Text, _pos).getSafeString(); etk::String myTextToWrite = getData(ListRole::Text, _pos).getSafeString();
vec3 textSize = tmpText.calculateSize(myTextToWrite); vec3 textSize = tmpText->calculateSize(myTextToWrite);
ivec2 count = getMatrixSize(); ivec2 count = getMatrixSize();
return vec2(textSize.x(), return vec2(textSize.x(),
textSize.y() + m_paddingSizeY*3 textSize.y() + m_paddingSizeY*3
@ -242,9 +236,8 @@ vec2 ewol::widget::List::calculateElementSize(const ivec2& _pos) {
} }
void ewol::widget::List::drawBackground() { void ewol::widget::List::drawBackground() {
ewol::compositing::Drawing * BGOObjects = ETK_NEW(ewol::compositing::Drawing); auto BGOObjects = ememory::staticPointerCast<ewol::compositing::Drawing>(getComposeElemnent("drawing"));
if (BGOObjects != null) { if (BGOObjects != null) {
addOObject(BGOObjects);
etk::Color<> basicBG = getBasicBG(); etk::Color<> basicBG = getBasicBG();
BGOObjects->setColor(basicBG); BGOObjects->setColor(basicBG);
BGOObjects->setPos(vec3(0, 0, 0) ); BGOObjects->setPos(vec3(0, 0, 0) );
@ -258,18 +251,16 @@ void ewol::widget::List::drawElement(const ivec2& _pos, const vec2& _start, cons
auto backgroundVariant = getData(ListRole::BgColor, _pos); auto backgroundVariant = getData(ListRole::BgColor, _pos);
if (backgroundVariant.isColor() == true) { if (backgroundVariant.isColor() == true) {
etk::Color<> bg = backgroundVariant.getColor(); etk::Color<> bg = backgroundVariant.getColor();
ewol::compositing::Drawing * BGOObjects = ETK_NEW(ewol::compositing::Drawing); auto BGOObjects = ememory::staticPointerCast<ewol::compositing::Drawing>(getComposeElemnent("drawing"));
if (BGOObjects != null) { if (BGOObjects != null) {
addOObject(BGOObjects);
BGOObjects->setColor(bg); BGOObjects->setColor(bg);
BGOObjects->setPos(vec3(_start.x(), _start.y(), 0) ); BGOObjects->setPos(vec3(_start.x(), _start.y(), 0) );
BGOObjects->rectangleWidth(_size); BGOObjects->rectangleWidth(_size);
} }
} }
if (myTextToWrite != "") { if (myTextToWrite != "") {
ewol::compositing::Text * tmpText = ETK_NEW(ewol::compositing::Text); auto tmpText = ememory::staticPointerCast<ewol::compositing::Text>(getComposeElemnent("text"));
if (tmpText != null) { if (tmpText != null) {
addOObject(tmpText);
int32_t displayPositionY = _start.y() + m_paddingSizeY; int32_t displayPositionY = _start.y() + m_paddingSizeY;
tmpText->setColor(fg); tmpText->setColor(fg);
tmpText->setPos(vec3(_start.x() + m_paddingSizeX, displayPositionY, 0) ); tmpText->setPos(vec3(_start.x() + m_paddingSizeX, displayPositionY, 0) );

View File

@ -45,11 +45,16 @@ namespace ewol {
void calculateMinMaxSize() override; void calculateMinMaxSize() override;
// drawing capabilities .... // drawing capabilities ....
protected: protected:
etk::Vector<ewol::Compositing*> m_listOObject; //!< generic element to display... etk::Vector<ememory::SharedPtr<ewol::Compositing>> m_listOObject; //!< generic element to display...
etk::Vector<int32_t> m_listSizeX; //!< size of every colomns etk::Vector<int32_t> m_listSizeX; //!< size of every colomns
etk::Vector<int32_t> m_listSizeY; //!< size of every rows etk::Vector<int32_t> m_listSizeY; //!< size of every rows
protected:
etk::Map<etk::String, ememory::SharedPtr<ewol::Compositing>> m_compositingElements;
void addComposeElemnent(const etk::String& _name, const ememory::SharedPtr<ewol::Compositing>& _element);
void clearComposeElemnent();
void removeComposeElemnent();
ememory::SharedPtr<ewol::Compositing> getComposeElemnent(const etk::String& _name);
public: public:
void addOObject(ewol::Compositing* _newObject, int32_t _pos=-1);
void clearOObjectList(); void clearOObjectList();
// list properties ... // list properties ...
protected: protected:

View File

@ -7,7 +7,7 @@
#include <ewol/widget/ListFileSystem.hpp> #include <ewol/widget/ListFileSystem.hpp>
#include <etk/tool.hpp> #include <etk/tool.hpp>
#include <etk/path/fileSystem.hpp> #include <etk/path/fileSystem.hpp>
#include <etk/algorithm.hpp>
#include <etk/typeInfo.hpp> #include <etk/typeInfo.hpp>
ETK_DECLARE_TYPE(ewol::widget::ListFileSystem); ETK_DECLARE_TYPE(ewol::widget::ListFileSystem);
@ -45,14 +45,14 @@ ewol::widget::ListFileSystem::ListFileSystem() :
#if defined(__TARGET_OS__Windows) #if defined(__TARGET_OS__Windows)
propertyPath.setDirectCheck("c:/"); propertyPath.setDirectCheck("c:/");
#endif #endif
m_colorProperty = ewol::resource::ColorFile::create("{ewol}THEME:COLOR:ListFileSystem.json"); m_colorProperty = ewol::resource::ColorFile::create("THEME_COLOR:///ListFileSystem.json?lib=ewol");
if (m_colorProperty != null) { if (m_colorProperty != null) {
m_colorIdText = m_colorProperty->request("text"); m_colorIdText = m_colorProperty->request("text");
m_colorIdBackground1 = m_colorProperty->request("background1"); m_colorIdBackground1 = m_colorProperty->request("background1");
m_colorIdBackground2 = m_colorProperty->request("background2"); m_colorIdBackground2 = m_colorProperty->request("background2");
m_colorIdBackgroundSelected = m_colorProperty->request("selected"); m_colorIdBackgroundSelected = m_colorProperty->request("selected");
} }
setMouseLimit(1); setMouseLimit(2);
} }
ewol::widget::ListFileSystem::~ListFileSystem() { ewol::widget::ListFileSystem::~ListFileSystem() {
@ -67,6 +67,9 @@ etk::Color<> ewol::widget::ListFileSystem::getBasicBG() {
return m_colorProperty->get(m_colorIdBackground1); return m_colorProperty->get(m_colorIdBackground1);
} }
static bool localSort(const etk::Path& _left, const etk::Path& _right) {
return _left.getString().toUpper() <= _right.getString().toUpper();
}
void ewol::widget::ListFileSystem::regenerateView() { void ewol::widget::ListFileSystem::regenerateView() {
clearList(); clearList();
@ -84,6 +87,9 @@ void ewol::widget::ListFileSystem::regenerateView() {
flags |= etk::path::LIST_FILE; flags |= etk::path::LIST_FILE;
} }
m_list = etk::path::list(*propertyPath, flags); m_list = etk::path::list(*propertyPath, flags);
EWOL_ERROR("Lsit of element: " << m_list.size() );
// Sort the list:
etk::algorithm::quickSort(m_list, localSort);
// request a redraw ... // request a redraw ...
markToRedraw(); markToRedraw();
} }
@ -173,48 +179,45 @@ bool ewol::widget::ListFileSystem::onItemEvent(const ewol::event::Input& _event,
offset = 2; offset = 2;
} }
} }
if (_event.getStatus() == gale::key::status::pressSingle) { if ( _event.getStatus() == gale::key::status::pressSingle
|| _event.getStatus() == gale::key::status::pressDouble) {
EWOL_VERBOSE("Event on List : IdInput=" << _event.getId() << " _pos=" << _pos ); EWOL_VERBOSE("Event on List : IdInput=" << _event.getId() << " _pos=" << _pos );
if (1 == _event.getId()) { if (1 == _event.getId()) {
int32_t previousRaw = m_selectedLine;
if (_pos.y() > (int32_t)m_list.size()+offset ) { if (_pos.y() > (int32_t)m_list.size()+offset ) {
m_selectedLine = -1; m_selectedLine = -1;
} else { } else {
m_selectedLine = _pos.y(); m_selectedLine = _pos.y();
} }
if (previousRaw != m_selectedLine) {
if( *propertyShowFolder == true if( *propertyShowFolder == true
&& m_selectedLine == 0) { && m_selectedLine == 0) {
// "." folder // "." folder
signalFolderSelect.emit("."); if (_event.getStatus() == gale::key::status::pressSingle) {
signalFolderSelect.emit(*propertyPath);
} else {
signalFolderValidate.emit(*propertyPath);
}
} else if ( *propertyShowFolder == true } else if ( *propertyShowFolder == true
&& m_selectedLine == 1) { && m_selectedLine == 1) {
// ".." folder // ".." folder
signalFolderSelect.emit(".."); if (_event.getStatus() == gale::key::status::pressSingle) {
signalFolderSelect.emit(propertyPath->getParent());
} else {
signalFolderValidate.emit(propertyPath->getParent());
}
} else if( m_selectedLine-offset >= 0 } else if( m_selectedLine-offset >= 0
&& m_selectedLine-offset < (int32_t)m_list.size() ) { && m_selectedLine-offset < (int32_t)m_list.size() ) {
// generate event extern: // generate event extern:
if(etk::path::isDirectory(m_list[m_selectedLine-offset])) { if(etk::path::isDirectory(m_list[m_selectedLine-offset])) {
signalFolderSelect.emit(m_list[m_selectedLine-offset].getFileName()); if (_event.getStatus() == gale::key::status::pressSingle) {
signalFolderSelect.emit(m_list[m_selectedLine-offset]);
} else { } else {
signalFileSelect.emit(m_list[m_selectedLine-offset].getFileName()); signalFolderValidate.emit(m_list[m_selectedLine-offset]);
}
} }
} else { } else {
if( *propertyShowFolder == true if (_event.getStatus() == gale::key::status::pressSingle) {
&& m_selectedLine == 0) { signalFileSelect.emit(m_list[m_selectedLine-offset]);
// "." folder
signalFolderValidate.emit(".");
} else if ( *propertyShowFolder == true
&& m_selectedLine == 1) {
// ".." folder
signalFolderValidate.emit("..");
} else if( m_selectedLine-offset >= 0
&& m_selectedLine-offset < (int32_t)m_list.size()) {
if(etk::path::isDirectory(m_list[m_selectedLine-offset])) {
signalFolderSelect.emit(m_list[m_selectedLine-offset].getFileName());
} else { } else {
signalFileSelect.emit(m_list[m_selectedLine-offset].getFileName()); signalFileValidate.emit(m_list[m_selectedLine-offset]);
} }
} }
} }
@ -227,6 +230,7 @@ bool ewol::widget::ListFileSystem::onItemEvent(const ewol::event::Input& _event,
} }
void ewol::widget::ListFileSystem::onChangePropertyPath() { void ewol::widget::ListFileSystem::onChangePropertyPath() {
EWOL_WARNING("Change Path: " << *propertyPath << " selected File=" << *propertyFile);;
regenerateView(); regenerateView();
} }

View File

@ -301,7 +301,7 @@ bool ewol::widget::Menu::loadXML(const exml::Element& _node) {
etk::String widgetName = pNode.getValue(); etk::String widgetName = pNode.getValue();
EWOL_INFO("Get node : " << pNode); EWOL_INFO("Get node : " << pNode);
if (widgetName == "elem") { if (widgetName == "elem") {
// <elem title="_T{Title of the button}" image="DATA:List.svg" event="menu:exit"> // <elem title="_T{Title of the button}" image="DATA:///List.svg" event="menu:exit">
int32_t idMenu = addTitle(pNode.attributes["title"], pNode.attributes["image"], pNode.attributes["event"]); int32_t idMenu = addTitle(pNode.attributes["title"], pNode.attributes["image"], pNode.attributes["event"]);
for (const auto nodeIt2 : pNode.nodes) { for (const auto nodeIt2 : pNode.nodes) {
@ -312,7 +312,7 @@ bool ewol::widget::Menu::loadXML(const exml::Element& _node) {
} }
etk::String widgetName2 = pNode2.getValue(); etk::String widgetName2 = pNode2.getValue();
if (widgetName2 == "elem") { if (widgetName2 == "elem") {
// <elem title="_T{Title of the button}" image="DATA:List.svg" event="menu:exit"> // <elem title="_T{Title of the button}" image="DATA:///List.svg" event="menu:exit">
add(idMenu, pNode2.attributes["title"], pNode2.attributes["image"], pNode2.attributes["event"]); add(idMenu, pNode2.attributes["title"], pNode2.attributes["image"], pNode2.attributes["event"]);
} else if (widgetName2 == "separator") { } else if (widgetName2 == "separator") {
addSpacer(idMenu); addSpacer(idMenu);

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",
etk::Uri("THEME_GUI://PopUp.json?lib=ewol"), 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

@ -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",
etk::Uri("THEME_GUI://WidgetScrolled.json?lib=ewol"), 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",
etk::Uri("THEME_GUI://WidgetScrolled.json?lib=ewol"), 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

@ -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(etk::Uri("THEME_GUI://Select.json?lib=ewol")); 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(etk::Uri("THEME_GUI://Spin.json?lib=ewol")); propertyShape.setDirectCheck(etk::Uri("THEME_GUI:///Spin.json?lib=ewol"));
} }
ewol::widget::Spin::~Spin() { ewol::widget::Spin::~Spin() {

View File

@ -17,7 +17,7 @@ ETK_DECLARE_TYPE(ewol::widget::TreeView);
ewol::widget::TreeView::TreeView(): ewol::widget::TreeView::TreeView():
ewol::widget::List(), ewol::widget::List(),
propertyOffsetTreeView(this, "offsetTreeView", propertyOffsetTreeView(this, "offsetTreeView",
30, 15,
"Offset indentation for each node", "Offset indentation for each node",
&ewol::widget::TreeView::onChangePropertyOffsetTreeView), &ewol::widget::TreeView::onChangePropertyOffsetTreeView),
propertyIconTreeViewSize(this, "iconTreeViewSize", propertyIconTreeViewSize(this, "iconTreeViewSize",
@ -34,6 +34,8 @@ ewol::widget::TreeView::TreeView():
void ewol::widget::TreeView::init() { void ewol::widget::TreeView::init() {
ewol::widget::List::init(); ewol::widget::List::init();
propertyFill.set(bvec2(true,false)); propertyFill.set(bvec2(true,false));
addComposeElemnent("image_ChevronRight", ememory::makeShared<ewol::compositing::Image>("THEME_GUI:///ChevronRight.svg?lib=ewol"));
addComposeElemnent("image_ChevronMore", ememory::makeShared<ewol::compositing::Image>("THEME_GUI:///ChevronMore.svg?lib=ewol"));
} }
ewol::widget::TreeView::~TreeView() { ewol::widget::TreeView::~TreeView() {
@ -41,7 +43,7 @@ ewol::widget::TreeView::~TreeView() {
} }
vec2 ewol::widget::TreeView::calculateElementSize(const ivec2& _pos) { vec2 ewol::widget::TreeView::calculateElementSize(const ivec2& _pos) {
ewol::compositing::Text tmpText; auto tmpText = ememory::staticPointerCast<ewol::compositing::Text>(getComposeElemnent("text"));
etk::String myTextToWrite = getData(ListRole::Text, _pos).getSafeString(); etk::String myTextToWrite = getData(ListRole::Text, _pos).getSafeString();
float_t treeOffset = 0; float_t treeOffset = 0;
if (_pos.x() == 0) { if (_pos.x() == 0) {
@ -65,9 +67,9 @@ vec2 ewol::widget::TreeView::calculateElementSize(const ivec2& _pos) {
} }
vec3 textSize; vec3 textSize;
if (propertyTextIsDecorated.get() == true) { if (propertyTextIsDecorated.get() == true) {
textSize = tmpText.calculateSizeDecorated(myTextToWrite); textSize = tmpText->calculateSizeDecorated(myTextToWrite);
} else { } else {
textSize = tmpText.calculateSize(myTextToWrite); textSize = tmpText->calculateSize(myTextToWrite);
} }
ivec2 count = getMatrixSize(); ivec2 count = getMatrixSize();
return vec2(textSize.x() + treeOffset + iconSize, return vec2(textSize.x() + treeOffset + iconSize,
@ -87,14 +89,13 @@ void ewol::widget::TreeView::drawElement(const ivec2& _pos, const vec2& _start,
iconName = getData(ListRole::Icon, _pos).getSafeString(); iconName = getData(ListRole::Icon, _pos).getSafeString();
bool haveChild = getData(ListRole::HaveChild, _pos).getSafeBoolean(); bool haveChild = getData(ListRole::HaveChild, _pos).getSafeBoolean();
if (haveChild == true) { if (haveChild == true) {
ewol::compositing::Image * tmpImage = null; ememory::SharedPtr<ewol::compositing::Image> tmpImage = null;
if ( getData(ListRole::IsExpand, _pos).getSafeBoolean() == false) { if ( getData(ListRole::IsExpand, _pos).getSafeBoolean() == false) {
tmpImage = ETK_NEW(ewol::compositing::Image, "{ewol}THEME:GUI:ChevronRight.svg"); tmpImage = ememory::staticPointerCast<ewol::compositing::Image>(getComposeElemnent("image_ChevronRight"));
} else { } else {
tmpImage = ETK_NEW(ewol::compositing::Image, "{ewol}THEME:GUI:ChevronMore.svg"); tmpImage = ememory::staticPointerCast<ewol::compositing::Image>(getComposeElemnent("image_ChevronMore"));
} }
if (tmpImage != null) { if (tmpImage != null) {
addOObject(tmpImage);
tmpImage->setColor(fg); tmpImage->setColor(fg);
tmpImage->setPos(posStart); tmpImage->setPos(posStart);
tmpImage->print(vec2(propertyIconTreeViewSize.get(), propertyIconTreeViewSize.get())); tmpImage->print(vec2(propertyIconTreeViewSize.get(), propertyIconTreeViewSize.get()));
@ -108,9 +109,8 @@ void ewol::widget::TreeView::drawElement(const ivec2& _pos, const vec2& _start,
auto backgroundVariant = getData(ListRole::BgColor, _pos); auto backgroundVariant = getData(ListRole::BgColor, _pos);
if (backgroundVariant.isColor() == true) { if (backgroundVariant.isColor() == true) {
etk::Color<> bg = backgroundVariant.getColor(); etk::Color<> bg = backgroundVariant.getColor();
ewol::compositing::Drawing * BGOObjects = ETK_NEW(ewol::compositing::Drawing); auto BGOObjects = ememory::staticPointerCast<ewol::compositing::Drawing>(getComposeElemnent("drawing"));
if (BGOObjects != null) { if (BGOObjects != null) {
addOObject(BGOObjects);
BGOObjects->setColor(bg); BGOObjects->setColor(bg);
BGOObjects->setPos(_start); BGOObjects->setPos(_start);
BGOObjects->rectangleWidth(_size); BGOObjects->rectangleWidth(_size);
@ -118,20 +118,20 @@ void ewol::widget::TreeView::drawElement(const ivec2& _pos, const vec2& _start,
} }
posStart += vec2(m_paddingSizeX, m_paddingSizeY); posStart += vec2(m_paddingSizeX, m_paddingSizeY);
if (iconName != "") { if (iconName != "") {
ewol::compositing::Image * tmpImage = ETK_NEW(ewol::compositing::Image, iconName); auto tmpImage = ememory::staticPointerCast<ewol::compositing::Image>(getComposeElemnent(iconName));
if (tmpImage != null) { if (tmpImage != null) {
addOObject(tmpImage);
tmpImage->setColor(fg); tmpImage->setColor(fg);
tmpImage->setPos(posStart); tmpImage->setPos(posStart);
tmpImage->print(vec2(propertyIconTreeViewSize.get(), propertyIconTreeViewSize.get())); tmpImage->print(vec2(propertyIconTreeViewSize.get(), propertyIconTreeViewSize.get()));
} else {
EWOL_ERROR("can not get : " << iconName );
} }
// move right // move right
posStart.setX(posStart.x() + propertyIconTreeViewSize.get()); posStart.setX(posStart.x() + propertyIconTreeViewSize.get());
} }
if (myTextToWrite != "") { if (myTextToWrite != "") {
ewol::compositing::Text * tmpText = ETK_NEW(ewol::compositing::Text); auto tmpText = ememory::staticPointerCast<ewol::compositing::Text>(getComposeElemnent("text"));
if (tmpText != null) { if (tmpText != null) {
addOObject(tmpText);
tmpText->setColor(fg); tmpText->setColor(fg);
tmpText->setPos(posStart); tmpText->setPos(posStart);
if (propertyTextIsDecorated.get() == true) { if (propertyTextIsDecorated.get() == true) {

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",
etk::Uri("THEME_GUI://WidgetScrolled.json?lib=ewol"), 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",
etk::Uri("THEME_GUI://WidgetScrolled.json?lib=ewol"), 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

@ -20,7 +20,7 @@ ETK_DECLARE_TYPE(ewol::widget::Windows);
ewol::widget::Windows::Windows() : ewol::widget::Windows::Windows() :
propertyColorConfiguration(this, propertyColorConfiguration(this,
"file-color", "file-color",
etk::Uri("THEME_COLOR://Windows.json?lib=ewol"), etk::Uri("THEME_COLOR:///Windows.json?lib=ewol"),
"File color of the Windows", "File color of the Windows",
&ewol::widget::Windows::onChangePropertyColor), &ewol::widget::Windows::onChangePropertyColor),
propertyTitle(this, propertyTitle(this,

View File

@ -59,7 +59,7 @@ ewol::widget::FileChooser::FileChooser() :
void ewol::widget::FileChooser::init() { void ewol::widget::FileChooser::init() {
ewol::widget::Composer::init(); ewol::widget::Composer::init();
// Load file with replacing the "{ID}" with the local ID of the widget ==> obtain unique ID // Load file with replacing the "{ID}" with the local ID of the widget ==> obtain unique ID
loadFromFile("{ewol}DATA:ewol-gui-file-chooser.xml", getId()); loadFromFile("DATA:///ewol-gui-file-chooser.xml?lib=ewol", getId());
// Basic replacement of labels // Basic replacement of labels
propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:title-label", "value", propertyLabelTitle); propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:title-label", "value", propertyLabelTitle);
propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:validate-label", "value", propertyLabelValidate); propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:validate-label", "value", propertyLabelValidate);
@ -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.getString()); propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:entry-file", "value", propertyFile->getFileName());
//updateCurrentFolder(); //updateCurrentFolder();
} }
@ -142,8 +142,8 @@ void ewol::widget::FileChooser::onCallbackHidenFileChangeChangeValue(const bool&
void ewol::widget::FileChooser::onCallbackListFolderSelectChange(const etk::Path& _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 / _value); propertyPath.setDirect(_value);
EWOL_DEBUG("new PATH: '" << *propertyPath << "'"); EWOL_DEBUG("new PATH: '" << *propertyPath << "'");
propertyFile.setDirect(""); propertyFile.setDirect("");
updateCurrentFolder(); updateCurrentFolder();
@ -161,8 +161,8 @@ void ewol::widget::FileChooser::onCallbackListFileSelectChange(const etk::Path&
void ewol::widget::FileChooser::onCallbackListFileValidate(const etk::Path& _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 : '" << propertyFile << "'");
signalValidate.emit(getCompleateFileName()); signalValidate.emit(_value);
autoDestroy(); autoDestroy();
} }
@ -172,11 +172,11 @@ void ewol::widget::FileChooser::onCallbackEntryFileChangeValidate(const etk::Str
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 : '" << *propertyFile << "' ==> error No name ...");
return; return;
} }
EWOL_DEBUG(" generate a file opening : '" << propertyPath << "' / '" << propertyFile << "'"); EWOL_DEBUG(" generate a file opening : '" << *propertyFile << "'");
signalValidate.emit(getCompleateFileName()); signalValidate.emit(*propertyFile);
autoDestroy(); autoDestroy();
} }
@ -195,7 +195,3 @@ void ewol::widget::FileChooser::updateCurrentFolder() {
propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:entry-folder", "value", propertyPath.getString()); propertySetOnWidgetNamed("[" + etk::toString(getId()) + "]file-shooser:entry-folder", "value", propertyPath.getString());
markToRedraw(); markToRedraw();
} }
etk::Path ewol::widget::FileChooser::getCompleateFileName() {
return *propertyPath / *propertyFile;
}

View File

@ -80,7 +80,6 @@ namespace ewol {
DECLARE_WIDGET_FACTORY(FileChooser, "FileChooser"); DECLARE_WIDGET_FACTORY(FileChooser, "FileChooser");
virtual ~FileChooser(); virtual ~FileChooser();
private: private:
etk::Path getCompleateFileName();
void updateCurrentFolder(); void updateCurrentFolder();
public: public:
void onGetFocus() override; void onGetFocus() override;

View File

@ -74,7 +74,7 @@ void ewol::widget::Parameter::init() {
} 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='THEME_GUI:///Save.svg?lib=ewol' expand='true' size='8,8mm'/>\n"
" <label>_T{Save}</label>\n" " <label>_T{Save}</label>\n"
"</sizer>\n")); "</sizer>\n"));
tmpButton->signalPressed.connect(sharedFromThis(), &ewol::widget::Parameter::onCallbackParameterSave); tmpButton->signalPressed.connect(sharedFromThis(), &ewol::widget::Parameter::onCallbackParameterSave);
@ -96,7 +96,7 @@ void ewol::widget::Parameter::init() {
} 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='THEME_GUI:///Remove.svg?lib=ewol' expand='true' size='8,8mm'/>\n"
" <label>_T{Close}</label>\n" " <label>_T{Close}</label>\n"
"</sizer>\n")); "</sizer>\n"));
tmpButton->signalPressed.connect(sharedFromThis(), &ewol::widget::Parameter::onCallbackMenuclosed); tmpButton->signalPressed.connect(sharedFromThis(), &ewol::widget::Parameter::onCallbackMenuclosed);

View File

@ -82,13 +82,13 @@ fluorine::Variant appl::widget::BasicTree::getData(int32_t _role, const ivec2& _
return value.m_isExpand; return value.m_isExpand;
case ewol::widget::ListRole::Icon: case ewol::widget::ListRole::Icon:
if (elem->countToRoot() == 0) { if (elem->countToRoot() == 0) {
return "{ewol}THEME:GUI:Home.svg"; return "THEME_GUI:///Home.svg?lib=ewol";
} }
if (elem->countToRoot() == 1) { if (elem->countToRoot() == 1) {
return "{ewol}THEME:GUI:Folder.svg"; return "THEME_GUI:///Folder.svg?lib=ewol";
} }
if (elem->countToRoot() == 2) { if (elem->countToRoot() == 2) {
return "{ewol}THEME:GUI:File.svg"; return "THEME_GUI:///File.svg?lib=ewol";
} }
return ""; return "";
case ewol::widget::ListRole::FgColor: case ewol::widget::ListRole::FgColor:

View File

@ -17,7 +17,7 @@ appl::WidgetDisplay::WidgetDisplay() {
void appl::WidgetDisplay::init() { void appl::WidgetDisplay::init() {
ewol::Widget::init(); ewol::Widget::init();
m_compositing.setSource("DATA:SnowFlake.svg", ivec2(128,128)); m_compositing.setSource("DATA:///SnowFlake.svg", ivec2(128,128));
getObjectManager().periodicCall.connect(sharedFromThis(), &appl::WidgetDisplay::periodicCall); getObjectManager().periodicCall.connect(sharedFromThis(), &appl::WidgetDisplay::periodicCall);
for (int32_t iii=0; iii<250 ; ++iii) { for (int32_t iii=0; iii<250 ; ++iii) {
m_elements.pushBack(appl::WidgetDisplay::Element()); m_elements.pushBack(appl::WidgetDisplay::Element());

View File

@ -38,7 +38,7 @@ void appl::MainWindows::init() {
propertyFill.set(bvec2(true, true)); propertyFill.set(bvec2(true, true));
propertyExpand.set(bvec2(true, true)); propertyExpand.set(bvec2(true, true));
m_composer = ewol::widget::Composer::create(); m_composer = ewol::widget::Composer::create();
m_composer->loadFromFile("DATA:gui.xml"); m_composer->loadFromFile("DATA:///gui.xml");
setSubWidget(m_composer); setSubWidget(m_composer);
externSubBind(m_composer, ewol::widget::Button, "appl-past", signalPressed, sharedFromThis(), &appl::MainWindows::onCallbackPast); externSubBind(m_composer, ewol::widget::Button, "appl-past", signalPressed, sharedFromThis(), &appl::MainWindows::onCallbackPast);
externSubBind(m_composer, ewol::widget::Button, "appl-copy", signalPressed, sharedFromThis(), &appl::MainWindows::onCallbackCopy); externSubBind(m_composer, ewol::widget::Button, "appl-copy", signalPressed, sharedFromThis(), &appl::MainWindows::onCallbackCopy);

View File

@ -45,7 +45,7 @@ namespace appl {
#endif #endif
// set the application icon ... // set the application icon ...
_context.setIcon("DATA:icon.png"); _context.setIcon("DATA:///icon.png");
appl::widget::SizerColor::createManagerWidget(_context.getWidgetManager()); appl::widget::SizerColor::createManagerWidget(_context.getWidgetManager());

View File

@ -8,6 +8,8 @@
#include <appl/debug.hpp> #include <appl/debug.hpp>
#include <appl/MainWindows.hpp> #include <appl/MainWindows.hpp>
#include <etk/theme/theme.hpp>
#include <ewol/widget/Button.hpp> #include <ewol/widget/Button.hpp>
#include <ewol/widget/CheckBox.hpp> #include <ewol/widget/CheckBox.hpp>
#include <ewol/widget/Sizer.hpp> #include <ewol/widget/Sizer.hpp>
@ -25,7 +27,6 @@
#include <ewol/widget/Spin.hpp> #include <ewol/widget/Spin.hpp>
#include <ewol/context/Context.hpp> #include <ewol/context/Context.hpp>
#include <appl/TestDistanceField.hpp> #include <appl/TestDistanceField.hpp>
#include <etk/os/FSNode.hpp>
#include <eproperty/Value.hpp> #include <eproperty/Value.hpp>
appl::MainWindows::MainWindows() : appl::MainWindows::MainWindows() :
@ -43,7 +44,7 @@ void appl::MainWindows::init() {
APPL_WARNING("plop " << ETK_GET_TYPE_NAME(double)); APPL_WARNING("plop " << ETK_GET_TYPE_NAME(double));
APPL_WARNING("plop " << ETK_GET_TYPE_NAME(uint32_t)); APPL_WARNING("plop " << ETK_GET_TYPE_NAME(uint32_t));
m_composer = ewol::widget::Composer::create(); m_composer = ewol::widget::Composer::create();
m_composer->loadFromFile("DATA:gui.xml"); m_composer->loadFromFile("DATA:///gui.xml");
setSubWidget(m_composer); setSubWidget(m_composer);
externSubBind(m_composer, ewol::widget::Button, "appl-theme-toggle", signalValue, sharedFromThis(), &appl::MainWindows::onCallbackThemeChange); externSubBind(m_composer, ewol::widget::Button, "appl-theme-toggle", signalValue, sharedFromThis(), &appl::MainWindows::onCallbackThemeChange);
externSubBind(m_composer, ewol::widget::Button, "appl-previous-widget", signalPressed, sharedFromThis(), &appl::MainWindows::onCallbackWidgetChange, -1); externSubBind(m_composer, ewol::widget::Button, "appl-previous-widget", signalPressed, sharedFromThis(), &appl::MainWindows::onCallbackWidgetChange, -1);
@ -128,7 +129,7 @@ void appl::MainWindows::onCallbackWidgetChange(int32_t _increment) {
etk::String tmpConstruct; etk::String tmpConstruct;
switch(m_idWidget) { switch(m_idWidget) {
case 0: case 0:
tmpConstruct = "<image src='DATA:sphere.png'/>\n"; tmpConstruct = "<image src='DATA:///sphere.png'/>\n";
tmpDescription = "Test ewol::widget::Image"; tmpDescription = "Test ewol::widget::Image";
break; break;
case 1: case 1:

View File

@ -5,8 +5,7 @@
*/ */
#include <etk/types.hpp> #include <etk/types.hpp>
#include <etk/types.hpp> #include <etk/theme/theme.hpp>
#include <etk/os/FSNode.hpp>
#include <ewol/ewol.hpp> #include <ewol/ewol.hpp>
#include <ewol/object/Object.hpp> #include <ewol/object/Object.hpp>
#include <ewol/context/Context.hpp> #include <ewol/context/Context.hpp>
@ -45,7 +44,7 @@ namespace appl {
#endif #endif
// set the application icon ... // set the application icon ...
_context.setIcon("DATA:icon.png"); _context.setIcon("DATA:///icon.png");
appl::widget::SizerColor::createManagerWidget(_context.getWidgetManager()); appl::widget::SizerColor::createManagerWidget(_context.getWidgetManager());