[DEV] add composer in the xml widget list creatable

This commit is contained in:
Edouard DUPIN 2014-06-22 19:07:07 +02:00
parent beaf2179c6
commit ed8626e6a7
4 changed files with 17 additions and 5 deletions

View File

@ -145,6 +145,9 @@ void ewol::widget::Button::setEnableSingle(bool _single){
&& m_subWidget[1] == nullptr
&& m_subWidget[0] != nullptr) {
m_idWidgetDisplayed = 0;
} else if ( m_subWidget[0] == nullptr
&& m_subWidget[1] == nullptr) {
m_idWidgetDisplayed = 0;
}
}
}

View File

@ -15,6 +15,11 @@
#undef __class__
#define __class__ "ewol::widget::Composer"
#include <ewol/widget/Manager.h>
void ewol::widget::Composer::init(ewol::widget::Manager& _widgetManager) {
_widgetManager.addWidgetCreator("Composer",[]() -> ewol::Widget* { return new ewol::widget::Composer(); });
}
ewol::widget::Composer::Composer() {
// nothing to do ...
}
@ -45,10 +50,10 @@ bool ewol::widget::Composer::loadFromFile(const std::string& _fileName) {
return false;
}
exml::Element* root = (exml::Element*)doc.getNamed("composer");
if (nullptr == root ) {
if (root == nullptr) {
// Maybe a multiple node XML for internal config:
root = doc.toElement();
if (nullptr == root ) {
if (root == nullptr) {
EWOL_ERROR("[" << getId() << "] {" << getObjectType() << "} (l ?) main node not find: \"composer\" ...");
return false;
}
@ -70,10 +75,10 @@ bool ewol::widget::Composer::loadFromString(const std::string& _composerXmlStrin
return false;
}
exml::Element* root = (exml::Element*)doc.getNamed("composer");
if (nullptr == root ) {
if (root == nullptr) {
// Maybe a multiple node XML for internal config:
root = doc.toElement();
if (nullptr == root ) {
if (root == nullptr) {
EWOL_ERROR("[" << getId() << "] {" << getObjectType() << "} (l ?) main node not find: \"composer\" ...");
return false;
}
@ -84,7 +89,7 @@ bool ewol::widget::Composer::loadFromString(const std::string& _composerXmlStrin
}
// call upper class to parse his elements ...
ewol::widget::Container::loadXML(root);
requestUpdateSize();
return true;
}

View File

@ -20,6 +20,8 @@ namespace ewol {
* @brief the composer widget is a widget that create a link on a string.file to parse the data and generate some widget tree
*/
class Composer : public ewol::widget::Container {
public:
static void init(ewol::widget::Manager& _widgetManager);
public:
enum composerMode {
None,

View File

@ -26,6 +26,7 @@
#include <ewol/widget/PopUp.h>
#include <ewol/widget/WSlider.h>
#include <ewol/widget/ListFileSystem.h>
#include <ewol/widget/Composer.h>
#include <vector>
#undef __class__
@ -60,6 +61,7 @@ ewol::widget::Manager::Manager() :
ewol::widget::PopUp::init(*this);
ewol::widget::WSlider::init(*this);
ewol::widget::ListFileSystem::init(*this);
ewol::widget::Composer::init(*this);
}
ewol::widget::Manager::~Manager() {