[DEV] update to the ewol interface

This commit is contained in:
Edouard DUPIN 2014-08-19 19:01:57 +02:00
parent 8dcb98a91c
commit 00a225c379
17 changed files with 299 additions and 289 deletions

View File

@ -41,53 +41,55 @@ static const char * l_eventChangeWidgetPrevious = "event-change-widget-test-pre
#undef __class__
#define __class__ "MainWindows"
MainWindows::MainWindows() :
m_idWidget(0),
m_subWidget(nullptr),
m_testName(nullptr) {
appl::MainWindows::MainWindows() :
m_idWidget(0) {
APPL_DEBUG("CREATE WINDOWS ... ");
addObjectType("appl::MainWindows");
ewol::object::Shared<ewol::widget::Sizer> mySizerHori = nullptr;
ewol::object::Shared<ewol::widget::Button> myButton = nullptr;
}
m_sizerVert = ewol::object::makeShared(new ewol::widget::Sizer(ewol::widget::Sizer::modeVert));
void appl::MainWindows::init() {
ewol::widget::Windows::init();
std::shared_ptr<ewol::widget::Sizer> mySizerHori = nullptr;
std::shared_ptr<ewol::widget::Button> myButton = nullptr;
m_sizerVert = ewol::widget::Sizer::create(ewol::widget::Sizer::modeVert);
if (nullptr == m_sizerVert) {
APPL_DEBUG("Allocation error mySizerVert");
return;
}
setSubWidget(m_sizerVert);
mySizerHori = ewol::object::makeShared(new ewol::widget::Sizer(ewol::widget::Sizer::modeHori));
mySizerHori = ewol::widget::Sizer::create(ewol::widget::Sizer::modeHori);
if (nullptr == mySizerHori) {
APPL_DEBUG("Allocation error mySizerHori");
return;
}
m_sizerVert->subWidgetAdd(mySizerHori);
myButton = ewol::object::makeShared(new ewol::widget::Button());
myButton = ewol::widget::Button::create();
if (nullptr != myButton) {
myButton->setSubWidget(ewol::object::makeShared(new ewol::widget::Label("default theme (cube)")));
myButton->setSubWidgetToggle(ewol::object::makeShared(new ewol::widget::Label("rounded theme")));
myButton->setSubWidget(ewol::widget::Label::create("default theme (cube)"));
myButton->setSubWidgetToggle(ewol::widget::Label::create("rounded theme"));
myButton->setToggleMode(true);
myButton->registerOnEvent(this, "value", l_eventChangeTheme);
myButton->registerOnEvent(shared_from_this(), "value", l_eventChangeTheme);
mySizerHori->subWidgetAdd(myButton);
}
myButton = ewol::object::makeShared(new ewol::widget::Button());
myButton = ewol::widget::Button::create();
if (nullptr != myButton) {
myButton->setSubWidget(ewol::object::makeShared(new ewol::widget::Label("Previous Widget test")));
myButton->registerOnEvent(this, "pressed", l_eventChangeWidgetPrevious);
myButton->setSubWidget(ewol::widget::Label::create("Previous Widget test"));
myButton->registerOnEvent(shared_from_this(), "pressed", l_eventChangeWidgetPrevious);
mySizerHori->subWidgetAdd(myButton);
}
myButton = ewol::object::makeShared(new ewol::widget::Button());
myButton = ewol::widget::Button::create();
if (nullptr != myButton) {
myButton->setSubWidget(ewol::object::makeShared(new ewol::widget::Label("Next Widget test")));
myButton->registerOnEvent(this, "pressed", l_eventChangeWidgetNext);
myButton->setSubWidget(ewol::widget::Label::create("Next Widget test"));
myButton->registerOnEvent(shared_from_this(), "pressed", l_eventChangeWidgetNext);
mySizerHori->subWidgetAdd(myButton);
}
m_testName = new ewol::widget::Label("none");
m_testName = ewol::widget::Label::create("none");
if (nullptr != m_testName) {
mySizerHori->subWidgetAdd(m_testName);
}
ewol::object::Shared<ewol::widget::Spacer> mySpacer = ewol::object::makeShared(new ewol::widget::Spacer());
std::shared_ptr<ewol::widget::Spacer> mySpacer = ewol::widget::Spacer::create();
if (nullptr != mySpacer) {
mySpacer->setExpand(bvec2(false,false));
mySpacer->setFill(bvec2(true,false));
@ -100,12 +102,8 @@ MainWindows::MainWindows() :
onReceiveMessage(msg);
}
MainWindows::~MainWindows() {
}
void MainWindows::onReceiveMessage(const ewol::object::Message& _msg) {
if( _msg.getCaller() != ewol::object::Shared<ewol::Object>(this)
void appl::MainWindows::onReceiveMessage(const ewol::object::Message& _msg) {
if( _msg.getCaller() != std::shared_ptr<ewol::Object>(this)
&& _msg.getCaller() != nullptr) {
ewol::widget::Windows::onReceiveMessage(_msg);
}
@ -127,7 +125,7 @@ void MainWindows::onReceiveMessage(const ewol::object::Message& _msg) {
}
if (m_subWidget != nullptr) {
m_subWidget->removeObject();
m_subWidget->destroy();
// in theory it must be removed ...
m_subWidget.reset();
}
@ -137,7 +135,7 @@ void MainWindows::onReceiveMessage(const ewol::object::Message& _msg) {
}
switch(m_idWidget) {
case 0:
m_subWidget = ewol::object::makeShared(new appl::TestButton());
m_subWidget = appl::TestButton::create();
if (nullptr != m_subWidget) {
m_sizerVert->subWidgetAdd(m_subWidget);
}
@ -146,7 +144,7 @@ void MainWindows::onReceiveMessage(const ewol::object::Message& _msg) {
};
break;
case 1:
m_subWidget = ewol::object::makeShared(new TestDistanceField());
m_subWidget = TestDistanceField::create();
if (nullptr != m_subWidget) {
m_sizerVert->subWidgetAdd(m_subWidget);
}
@ -155,7 +153,7 @@ void MainWindows::onReceiveMessage(const ewol::object::Message& _msg) {
};
break;
case 2:
m_subWidget = ewol::object::makeShared(new TestButtonColor());
m_subWidget = TestButtonColor::create();
if (nullptr != m_subWidget) {
m_sizerVert->subWidgetAdd(m_subWidget);
}
@ -164,7 +162,7 @@ void MainWindows::onReceiveMessage(const ewol::object::Message& _msg) {
};
break;
case 3:
m_subWidget = ewol::object::makeShared(new TestLabel());
m_subWidget = TestLabel::create();
if (nullptr != m_subWidget) {
m_sizerVert->subWidgetAdd(m_subWidget);
}
@ -173,7 +171,7 @@ void MainWindows::onReceiveMessage(const ewol::object::Message& _msg) {
};
break;
case 4:
m_subWidget = ewol::object::makeShared(new TestImage());
m_subWidget = TestImage::create();
if (nullptr != m_subWidget) {
m_sizerVert->subWidgetAdd(m_subWidget);
}
@ -182,7 +180,7 @@ void MainWindows::onReceiveMessage(const ewol::object::Message& _msg) {
};
break;
case 5:
m_subWidget = ewol::object::makeShared(new appl::TestCheckBox());
m_subWidget = appl::TestCheckBox::create();
if (nullptr != m_subWidget) {
m_sizerVert->subWidgetAdd(m_subWidget);
}
@ -191,7 +189,7 @@ void MainWindows::onReceiveMessage(const ewol::object::Message& _msg) {
};
break;
default:
m_subWidget = ewol::object::makeShared(new ewol::widget::Label("Test software for EWOL"));
m_subWidget = ewol::widget::Label::create("Test software for EWOL");
if (nullptr != m_subWidget) {
m_subWidget->setExpand(bvec2(true,true));
m_sizerVert->subWidgetAdd(m_subWidget);
@ -201,16 +199,6 @@ void MainWindows::onReceiveMessage(const ewol::object::Message& _msg) {
};
m_idWidget = -1;
break;
/*case 5:
m_subWidget = ewol::object::makeShared(new TestScene());
if (nullptr != m_subWidget) {
m_sizerVert->subWidgetAdd(m_subWidget);
}
if (m_testName!=nullptr) {
m_testName->setLabel("TestScene");
};
break;
*/
}
}

View File

@ -16,21 +16,24 @@
#include <ewol/widget/Button.h>
#include <ewol/widget/Label.h>
#include <ewol/widget/Spacer.h>
class MainWindows : public ewol::widget::Windows {
namespace appl {
class MainWindows : public ewol::widget::Windows {
private:
ewol::object::Shared<ewol::widget::Sizer> m_sizerVert;
ewol::object::Shared<ewol::Widget> m_subWidget;
ewol::object::Shared<ewol::widget::Label> m_testName;
std::shared_ptr<ewol::widget::Sizer> m_sizerVert;
std::shared_ptr<ewol::Widget> m_subWidget;
std::shared_ptr<ewol::widget::Label> m_testName;
int32_t m_idWidget;
public:
// Constructeur
MainWindows();
~MainWindows();
void init();
public:
DECLARE_FACTORY(MainWindows);
~MainWindows() {};
public: // derived fuction
virtual void onReceiveMessage(const ewol::object::Message& _msg);
};
};
#endif

View File

@ -39,10 +39,13 @@ static const char * l_eventChangeImageToggle = "event-change-image-toggle";
#undef __class__
#define __class__ "TestButton"
appl::TestButton::TestButton() :
m_testWidget(nullptr) {
APPL_INFO("Create " __class__ " (start)");
appl::TestButton::TestButton() {
addObjectType("appl::TestButton");
}
void appl::TestButton::init() {
ewol::widget::Composer::init();
APPL_INFO("Create " __class__ " (start)");
std::string myDescription = std::string("")
+ "<sizer mode='vert' fill='true' expand='true'>\n"
@ -101,7 +104,7 @@ appl::TestButton::TestButton() :
registerOnEventNameWidget("[TEST]Button:ChangeText", "pressed", l_eventChangeText);
// show all event from a button :
registerOnEventNameWidget("[TEST]Button:TO-TEST", "*");
m_testWidget = ewol::dynamic_pointer_cast<ewol::widget::Button>(getWidgetNamed("[TEST]Button:TO-TEST"));
m_testWidget = std::dynamic_pointer_cast<ewol::widget::Button>(getWidgetNamed("[TEST]Button:TO-TEST"));
if (m_testWidget == nullptr) {
APPL_CRITICAL("Can not get the pointer of the widget button pointer");
}
@ -159,7 +162,7 @@ void appl::TestButton::onReceiveMessage(const ewol::object::Message& _msg) {
} else if (_msg.getMessage() == l_eventChangeTextToggle) {
if (nullptr!=m_testWidget) {
if (_msg.getData()=="true") {
m_testWidget->setSubWidgetToggle(ewol::object::makeShared(new ewol::widget::Label("A stupid very long text on toggle <br/><br/> and on multiple lines")));
m_testWidget->setSubWidgetToggle(ewol::widget::Label::create("A stupid very long text on toggle <br/><br/> and on multiple lines"));
} else {
m_testWidget->setSubWidgetToggle(nullptr);
}
@ -169,55 +172,50 @@ void appl::TestButton::onReceiveMessage(const ewol::object::Message& _msg) {
static int32_t countTextID = 1;
switch (countTextID) {
case 0:
m_testWidget->setSubWidget(ewol::object::makeShared(new ewol::widget::Label("simple Text")));
m_testWidget->setSubWidget(ewol::widget::Label::create("simple Text"));
break;
case 1:
m_testWidget->setSubWidget(ewol::object::makeShared(new ewol::widget::Label("<left>Align Left</left>")));
m_testWidget->setSubWidget(ewol::widget::Label::create("<left>Align Left</left>"));
break;
case 2:
m_testWidget->setSubWidget(ewol::object::makeShared(new ewol::widget::Label("<right>Align right</right>")));
m_testWidget->setSubWidget(ewol::widget::Label::create("<right>Align right</right>"));
break;
case 3:
m_testWidget->setSubWidget(ewol::object::makeShared(new ewol::widget::Label("<center>Align center</center>")));
m_testWidget->setSubWidget(ewol::widget::Label::create("<center>Align center</center>"));
break;
case 4:
m_testWidget->setSubWidget(ewol::object::makeShared(new ewol::widget::Label("simple Text<br/> With Some Other Lines<br/> and more if you want ...<br/> plop")));
m_testWidget->setSubWidget(ewol::widget::Label::create("simple Text<br/> With Some Other Lines<br/> and more if you want ...<br/> plop"));
break;
case 5:
m_testWidget->setSubWidget(ewol::object::makeShared(new ewol::widget::Label("simple <bold>Text</bold> with bold")));
m_testWidget->setSubWidget(ewol::widget::Label::create("simple <bold>Text</bold> with bold"));
break;
case 6:
m_testWidget->setSubWidget(ewol::object::makeShared(new ewol::widget::Label("simple <italic>Text</italic> with italic")));
m_testWidget->setSubWidget(ewol::widget::Label::create("simple <italic>Text</italic> with italic"));
break;
case 7:
m_testWidget->setSubWidget(ewol::object::makeShared(new ewol::widget::Label("simple <italic><bold>Text</bold></italic> with italic bold")));
m_testWidget->setSubWidget(ewol::widget::Label::create("simple <italic><bold>Text</bold></italic> with italic bold"));
break;
case 8:
m_testWidget->setSubWidget(nullptr);
break;
case 9:
m_testWidget->setSubWidget(ewol::object::makeShared(new ewol::widget::Label("simple <font color=\"#FFFF0088\">Text</font> with colored text")));
m_testWidget->setSubWidget(ewol::widget::Label::create("simple <font color=\"#FFFF0088\">Text</font> with colored text"));
break;
case 10:
m_testWidget->setSubWidget(ewol::object::makeShared(
new ewol::widget::Composer(ewol::widget::Composer::String,
"<label>ploppp</label>\n")));
m_testWidget->setSubWidget(ewol::widget::Composer::create(ewol::widget::Composer::String, "<label>ploppp</label>\n"));
break;
case 11:
m_testWidget->setSubWidget(ewol::object::makeShared(
new ewol::widget::Composer(ewol::widget::Composer::String,
m_testWidget->setSubWidget(ewol::widget::Composer::create(ewol::widget::Composer::String,
" <sizer mode=\"vert\" addmode=\"invert\">\n"
" <label>ploppp</label>\n"
" <label expand=\"true,true\"><center>** ** * *<br/>** * * * *</center></label>\n"
" </sizer>\n")));
" </sizer>\n"));
break;
case 12:
m_testWidget->setSubWidget(ewol::object::makeShared(
new ewol::widget::Composer(ewol::widget::Composer::String,
"<spacer color='red' min-size='30,30px'/>\n")));
m_testWidget->setSubWidget(ewol::widget::Composer::create(ewol::widget::Composer::String, "<spacer color='red' min-size='30,30px'/>\n"));
break;
default:
m_testWidget->setSubWidget(ewol::object::makeShared(new ewol::widget::Label("My <font color=\"#FF0000\">Button</font> <br/> And Some under line<br/> plop <br/> and an other super long line ...")));
m_testWidget->setSubWidget(ewol::widget::Label::create("My <font color=\"#FF0000\">Button</font> <br/> And Some under line<br/> plop <br/> and an other super long line ..."));
countTextID=-1;
break;
}

View File

@ -15,10 +15,13 @@
namespace appl {
class TestButton : public ewol::widget::Composer {
private:
ewol::object::Shared<ewol::widget::Button> m_testWidget;
std::shared_ptr<ewol::widget::Button> m_testWidget;
public:
// Constructeur
TestButton();
void init();
public:
DECLARE_FACTORY(TestButton);
public: // Derived function
virtual void onReceiveMessage(const ewol::object::Message& _msg);
};

View File

@ -33,109 +33,108 @@ static const char * l_eventChangeFillY = "event-change-fill-Y";
#undef __class__
#define __class__ "TestButton"
TestButtonColor::TestButtonColor() :
ewol::widget::Sizer(ewol::widget::Sizer::modeVert),
m_testWidget(nullptr) {
APPL_INFO("CREATE " __class__ " ... ");
appl::TestButtonColor::TestButtonColor() {
addObjectType("appl::TestButtonColor");
ewol::object::Shared<ewol::widget::Sizer> mySizerVert2;
ewol::object::Shared<ewol::widget::Sizer> mySizerHori;
ewol::object::Shared<ewol::widget::Button> myButton;
}
mySizerHori = ewol::object::makeShared(new ewol::widget::Sizer(ewol::widget::Sizer::modeHori));
void appl::TestButtonColor::init() {
ewol::widget::Sizer::init(ewol::widget::Sizer::modeVert);
APPL_INFO("CREATE " __class__ " ... ");
std::shared_ptr<ewol::widget::Sizer> mySizerVert2;
std::shared_ptr<ewol::widget::Sizer> mySizerHori;
std::shared_ptr<ewol::widget::Button> myButton;
mySizerHori = ewol::widget::Sizer::create(ewol::widget::Sizer::modeHori);
if (nullptr == mySizerHori) {
APPL_DEBUG("Allocation error mySizerHori");
return;
}
subWidgetAdd(mySizerHori);
myButton = ewol::object::makeShared(new ewol::widget::Button());
myButton = ewol::widget::Button::create();
if (nullptr != myButton) {
myButton->setToggleMode(true);
myButton->setSubWidget( ewol::object::makeShared(new ewol::widget::Label("Expand X (false)")));
myButton->setSubWidgetToggle(ewol::object::makeShared(new ewol::widget::Label("Expand X (true)")));
myButton->registerOnEvent(this, "value", l_eventChangeExpendX);
myButton->setSubWidget( ewol::widget::Label::create("Expand X (false)"));
myButton->setSubWidgetToggle(ewol::widget::Label::create("Expand X (true)"));
myButton->registerOnEvent(shared_from_this(), "value", l_eventChangeExpendX);
mySizerHori->subWidgetAdd(myButton);
}
myButton = ewol::object::makeShared(new ewol::widget::Button());
myButton = ewol::widget::Button::create();
if (nullptr != myButton) {
myButton->setToggleMode(true);
myButton->setSubWidget( ewol::object::makeShared(new ewol::widget::Label("Expand Y (false)")));
myButton->setSubWidgetToggle(ewol::object::makeShared(new ewol::widget::Label("Expand Y (true)")));
myButton->registerOnEvent(this, "value", l_eventChangeExpendY);
myButton->setSubWidget( ewol::widget::Label::create("Expand Y (false)"));
myButton->setSubWidgetToggle(ewol::widget::Label::create("Expand Y (true)"));
myButton->registerOnEvent(shared_from_this(), "value", l_eventChangeExpendY);
mySizerHori->subWidgetAdd(myButton);
}
myButton = ewol::object::makeShared(new ewol::widget::Button());
myButton = ewol::widget::Button::create();
if (nullptr != myButton) {
myButton->setToggleMode(true);
myButton->setSubWidget( ewol::object::makeShared(new ewol::widget::Label("Fill X (false)")));
myButton->setSubWidgetToggle(ewol::object::makeShared(new ewol::widget::Label("Fill X (true)")));
myButton->registerOnEvent(this, "value", l_eventChangeFillX);
myButton->setSubWidget( ewol::widget::Label::create("Fill X (false)"));
myButton->setSubWidgetToggle(ewol::widget::Label::create("Fill X (true)"));
myButton->registerOnEvent(shared_from_this(), "value", l_eventChangeFillX);
mySizerHori->subWidgetAdd(myButton);
}
myButton = ewol::object::makeShared(new ewol::widget::Button());
myButton = ewol::widget::Button::create();
if (nullptr != myButton) {
myButton->setToggleMode(true);
myButton->setSubWidget( ewol::object::makeShared(new ewol::widget::Label("Fill Y (false)")));
myButton->setSubWidgetToggle(ewol::object::makeShared(new ewol::widget::Label("Fill Y (true)")));
myButton->registerOnEvent(this, "value", l_eventChangeFillY);
myButton->setSubWidget( ewol::widget::Label::create("Fill Y (false)"));
myButton->setSubWidgetToggle(ewol::widget::Label::create("Fill Y (true)"));
myButton->registerOnEvent(shared_from_this(), "value", l_eventChangeFillY);
mySizerHori->subWidgetAdd(myButton);
}
ewol::object::Shared<ewol::widget::Spacer> mySpacer = ewol::object::makeShared(new ewol::widget::Spacer());
std::shared_ptr<ewol::widget::Spacer> mySpacer = ewol::widget::Spacer::create();
if (nullptr != mySpacer) {
mySpacer->setExpand(bvec2(false,false));
mySpacer->setFill(bvec2(true,false));
mySpacer->setMinSize(vec2(10,10));
mySpacer->setColor(0xFF000080);
mySpacer->setColor(etk::Color<>(0xFF, 0x00, 0x00, 0x80));
subWidgetAdd(mySpacer);
}
mySizerHori = ewol::object::makeShared(new ewol::widget::Sizer(ewol::widget::Sizer::modeHori));
mySizerHori = ewol::widget::Sizer::create(ewol::widget::Sizer::modeHori);
if (nullptr == mySizerHori) {
APPL_DEBUG("Allocation error mySizerHori");
return;
}
subWidgetAdd(mySizerHori);
mySpacer = ewol::object::makeShared(new ewol::widget::Spacer());
mySpacer = ewol::widget::Spacer::create();
if (nullptr != mySpacer) {
mySpacer->setExpand(bvec2(false,false));
mySpacer->setFill(bvec2(false,true));
mySpacer->setMinSize(vec2(10,10));
mySpacer->setColor(0x00FF0080);
mySpacer->setColor(etk::Color<>(0x00, 0xFF, 0x00, 0x80));
mySizerHori->subWidgetAdd(mySpacer);
}
m_testWidget = ewol::object::makeShared(new ewol::widget::ButtonColor(etk::color::olive));
m_testWidget = ewol::widget::ButtonColor::create(etk::color::olive);
if (nullptr != m_testWidget) {
m_testWidget->setExpand(bvec2(false,false));
m_testWidget->setFill(bvec2(false,false));
m_testWidget->registerOnEvent(this, "*");
m_testWidget->registerOnEvent(shared_from_this(), "*");
mySizerHori->subWidgetAdd(m_testWidget);
}
mySpacer = ewol::object::makeShared(new ewol::widget::Spacer());
mySpacer = ewol::widget::Spacer::create();
if (nullptr != mySpacer) {
mySpacer->setExpand(bvec2(false,false));
mySpacer->setFill(bvec2(false,true));
mySpacer->setMinSize(vec2(10,10));
mySpacer->setColor(0x0000FF80);
mySpacer->setColor(etk::Color<>(0x00, 0x00, 0xFF, 0x80));
mySizerHori->subWidgetAdd(mySpacer);
}
mySpacer = ewol::object::makeShared(new ewol::widget::Spacer());
mySpacer = ewol::widget::Spacer::create();
if (nullptr != mySpacer) {
mySpacer->setExpand(bvec2(false,false));
mySpacer->setFill(bvec2(true,false));
mySpacer->setMinSize(vec2(10,10));
mySpacer->setColor(0x00FFFF80);
mySpacer->setColor(etk::Color<>(0x00, 0xFF, 0xFF, 0x80));
subWidgetAdd(mySpacer);
}
}
TestButtonColor::~TestButtonColor() {
}
void TestButtonColor::onReceiveMessage(const ewol::object::Message& _msg) {
void appl::TestButtonColor::onReceiveMessage(const ewol::object::Message& _msg) {
ewol::widget::Sizer::onReceiveMessage(_msg);
//APPL_INFO("Receive Event from the main windows : " << _msg);
if (m_testWidget == _msg.getCaller()) {

View File

@ -16,15 +16,20 @@
#include <ewol/widget/Spacer.h>
#include <ewol/widget/Sizer.h>
class TestButtonColor : public ewol::widget::Sizer {
namespace appl {
class TestButtonColor : public ewol::widget::Sizer {
private:
ewol::object::Shared<ewol::widget::ButtonColor> m_testWidget;
std::shared_ptr<ewol::widget::ButtonColor> m_testWidget;
public:
// Constructeur
TestButtonColor();
virtual ~TestButtonColor();
void init();
public:
DECLARE_FACTORY(TestButtonColor);
virtual ~TestButtonColor() {};
public: // Derived function
virtual void onReceiveMessage(const ewol::object::Message& _msg);
};
};
#endif

View File

@ -39,10 +39,14 @@ static const char * l_eventChangeImageToggle = "event-change-image-toggle";
#undef __class__
#define __class__ "TestCheckBox"
appl::TestCheckBox::TestCheckBox() :
m_testWidget(nullptr) {
APPL_INFO("Create " __class__ " (start)");
appl::TestCheckBox::TestCheckBox() {
addObjectType("appl::TestCheckBox");
}
void appl::TestCheckBox::init() {
ewol::widget::Composer::init();
APPL_INFO("Create " __class__ " (start)");
std::string myDescription = std::string("")
+ "<sizer mode='vert' fill='true' expand='true'>\n"
@ -101,7 +105,7 @@ appl::TestCheckBox::TestCheckBox() :
registerOnEventNameWidget("[TEST]Button:ChangeText", "pressed", l_eventChangeText);
// show all event from a button :
registerOnEventNameWidget("[TEST]TO-TEST", "*");
m_testWidget = ewol::dynamic_pointer_cast<ewol::widget::CheckBox>(getWidgetNamed("[TEST]TO-TEST"));
m_testWidget = std::dynamic_pointer_cast<ewol::widget::CheckBox>(getWidgetNamed("[TEST]TO-TEST"));
if (m_testWidget == nullptr) {
APPL_CRITICAL("Can not get the pointer of the widget button pointer");
}
@ -149,7 +153,7 @@ void appl::TestCheckBox::onReceiveMessage(const ewol::object::Message& _msg) {
} else if (_msg.getMessage() == l_eventChangeTextToggle) {
if (nullptr!=m_testWidget) {
if (_msg.getData()=="true") {
m_testWidget->setSubWidgetToggle(ewol::object::makeShared(new ewol::widget::Label("A stupid very long text on toggle <br/><br/> and on multiple lines")));
m_testWidget->setSubWidgetToggle(ewol::widget::Label::create("A stupid very long text on toggle <br/><br/> and on multiple lines"));
} else {
m_testWidget->setSubWidgetToggle(nullptr);
}
@ -159,28 +163,28 @@ void appl::TestCheckBox::onReceiveMessage(const ewol::object::Message& _msg) {
static int32_t countTextID = 1;
switch (countTextID) {
case 0:
m_testWidget->setSubWidget(ewol::object::makeShared(new ewol::widget::Label("simple Text")));
m_testWidget->setSubWidget(ewol::widget::Label::create("simple Text"));
break;
case 1:
m_testWidget->setSubWidget(ewol::object::makeShared(new ewol::widget::Label("<left>Align Left</left>")));
m_testWidget->setSubWidget(ewol::widget::Label::create("<left>Align Left</left>"));
break;
case 2:
m_testWidget->setSubWidget(ewol::object::makeShared(new ewol::widget::Label("<right>Align right</right>")));
m_testWidget->setSubWidget(ewol::widget::Label::create("<right>Align right</right>"));
break;
case 3:
m_testWidget->setSubWidget(ewol::object::makeShared(new ewol::widget::Label("<center>Align center</center>")));
m_testWidget->setSubWidget(ewol::widget::Label::create("<center>Align center</center>"));
break;
case 4:
m_testWidget->setSubWidget(ewol::object::makeShared(new ewol::widget::Label("simple Text<br/> With Some Other Lines<br/> and more if you want ...<br/> plop")));
m_testWidget->setSubWidget(ewol::widget::Label::create("simple Text<br/> With Some Other Lines<br/> and more if you want ...<br/> plop"));
break;
case 5:
m_testWidget->setSubWidget(ewol::object::makeShared(new ewol::widget::Label("simple <bold>Text</bold> with bold")));
m_testWidget->setSubWidget(ewol::widget::Label::create("simple <bold>Text</bold> with bold"));
break;
case 6:
m_testWidget->setSubWidget(ewol::object::makeShared(new ewol::widget::Label("simple <italic>Text</italic> with italic")));
m_testWidget->setSubWidget(ewol::widget::Label::create("simple <italic>Text</italic> with italic"));
break;
case 7:
m_testWidget->setSubWidget(ewol::object::makeShared(new ewol::widget::Label("simple <italic><bold>Text</bold></italic> with italic bold")));
m_testWidget->setSubWidget(ewol::widget::Label::create("simple <italic><bold>Text</bold></italic> with italic bold"));
break;
case 8:
m_testWidget->setSubWidget(nullptr);

View File

@ -16,10 +16,13 @@
namespace appl {
class TestCheckBox : public ewol::widget::Composer {
private:
ewol::object::Shared<ewol::widget::CheckBox> m_testWidget;
std::shared_ptr<ewol::widget::CheckBox> m_testWidget;
public:
// Constructeur
TestCheckBox();
void init();
public:
DECLARE_FACTORY(TestCheckBox);
public: // Derived function
virtual void onReceiveMessage(const ewol::object::Message& _msg);
};

View File

@ -28,8 +28,12 @@
#undef __class__
#define __class__ "TestDistanceField"
TestDistanceField::TestDistanceField(){
appl::TestDistanceField::TestDistanceField(){
addObjectType("appl::TestDistanceField");
}
void appl::TestDistanceField::init() {
ewol::Widget::init();
APPL_INFO("Create " __class__ " (start)");
setExpand(bvec2(true, true));
setFill(bvec2(true, true));
@ -37,24 +41,19 @@ TestDistanceField::TestDistanceField(){
}
TestDistanceField::~TestDistanceField() {
APPL_INFO("Remove " __class__ " ...");
}
void TestDistanceField::calculateSize(const vec2& _availlable) {
void appl::TestDistanceField::calculateSize(const vec2& _availlable) {
// set minimal size
m_size = _availlable;
}
void TestDistanceField::calculateMinMaxSize() {
void appl::TestDistanceField::calculateMinMaxSize() {
m_minSize = vec2(256,256);
markToRedraw();
}
void TestDistanceField::onDraw() {
void appl::TestDistanceField::onDraw() {
m_text2.draw();
m_text1.draw();
@ -62,7 +61,7 @@ void TestDistanceField::onDraw() {
void TestDistanceField::onRegenerateDisplay() {
void appl::TestDistanceField::onRegenerateDisplay() {
if (false == needRedraw()) {
return;
}
@ -77,7 +76,7 @@ void TestDistanceField::onRegenerateDisplay() {
}
bool TestDistanceField::onEventInput(const ewol::event::Input& _event) {
bool appl::TestDistanceField::onEventInput(const ewol::event::Input& _event) {
if (_event.getId() == 4) {
setZoom(getZoom() + 0.01f);
} else if (_event.getId() == 5) {

View File

@ -16,19 +16,24 @@
#include <ewol/resource/Program.h>
#include <ewol/resource/DistanceFieldFont.h>
class TestDistanceField : public ewol::Widget {
namespace appl {
class TestDistanceField : public ewol::Widget {
ewol::compositing::Text m_text1;
ewol::compositing::TextDF m_text2;
public:
// Constructeur
TestDistanceField();
virtual ~TestDistanceField();
void init();
public:
DECLARE_FACTORY(TestDistanceField);
virtual ~TestDistanceField() {};
public: // Derived function
virtual void onDraw();
virtual void calculateMinMaxSize();
virtual void calculateSize(const vec2& _availlable);
virtual void onRegenerateDisplay();
virtual bool onEventInput(const ewol::event::Input& _event);
};
};
#endif

View File

@ -35,68 +35,69 @@ static const char * l_eventChangeImage = "event-change-image";
#undef __class__
#define __class__ "TestImage"
TestImage::TestImage() :
ewol::widget::Sizer(ewol::widget::Sizer::modeVert),
m_testWidget(nullptr) {
APPL_INFO("Create " __class__ " (start)");
appl::TestImage::TestImage() {
addObjectType("appl::TestImage");
ewol::object::Shared<ewol::widget::Sizer> mySizerVert2;
ewol::object::Shared<ewol::widget::Sizer> mySizerHori;
ewol::object::Shared<ewol::widget::Button> myButton;
}
void appl::TestImage::init() {
ewol::widget::Sizer::init(ewol::widget::Sizer::modeVert);
APPL_INFO("Create " __class__ " (start)");
std::shared_ptr<ewol::widget::Sizer> mySizerVert2;
std::shared_ptr<ewol::widget::Sizer> mySizerHori;
std::shared_ptr<ewol::widget::Button> myButton;
mySizerHori = ewol::object::makeShared(new ewol::widget::Sizer(ewol::widget::Sizer::modeHori));
mySizerHori = ewol::widget::Sizer::create(ewol::widget::Sizer::modeHori);
if (nullptr == mySizerHori) {
APPL_DEBUG("Allocation error mySizerHori");
return;
}
subWidgetAdd(mySizerHori);
myButton = ewol::object::makeShared(new ewol::widget::Button());
myButton = ewol::widget::Button::create();
if (nullptr != myButton) {
myButton->setToggleMode(true);
myButton->setSubWidget( ewol::object::makeShared(new ewol::widget::Label("Expend X <br/> (false)")));
myButton->setSubWidgetToggle(ewol::object::makeShared(new ewol::widget::Label("Expend X <br/><b>(true)</b>")));
myButton->registerOnEvent(this, "value", l_eventChangeExpendX);
myButton->setSubWidget( ewol::widget::Label::create("Expend X <br/> (false)"));
myButton->setSubWidgetToggle(ewol::widget::Label::create("Expend X <br/><b>(true)</b>"));
myButton->registerOnEvent(shared_from_this(), "value", l_eventChangeExpendX);
mySizerHori->subWidgetAdd(myButton);
}
myButton = ewol::object::makeShared(new ewol::widget::Button());
myButton = ewol::widget::Button::create();
if (nullptr != myButton) {
myButton->setToggleMode(true);
myButton->setSubWidget( ewol::object::makeShared(new ewol::widget::Label("Expend Y <br/> (false)")));
myButton->setSubWidgetToggle(ewol::object::makeShared(new ewol::widget::Label("Expend Y <br/><b>(true)</b>")));
myButton->registerOnEvent(this, "value", l_eventChangeExpendY);
myButton->setSubWidget( ewol::widget::Label::create("Expend Y <br/> (false)"));
myButton->setSubWidgetToggle(ewol::widget::Label::create("Expend Y <br/><b>(true)</b>"));
myButton->registerOnEvent(shared_from_this(), "value", l_eventChangeExpendY);
mySizerHori->subWidgetAdd(myButton);
}
mySizerHori = ewol::object::makeShared(new ewol::widget::Sizer(ewol::widget::Sizer::modeHori));
mySizerHori = ewol::widget::Sizer::create(ewol::widget::Sizer::modeHori);
if (nullptr == mySizerHori) {
APPL_DEBUG("Allocation error mySizerHori");
return;
}
subWidgetAdd(mySizerHori);
myButton = ewol::object::makeShared(new ewol::widget::Button());
myButton = ewol::widget::Button::create();
if (nullptr != myButton) {
myButton->setToggleMode(true);
myButton->setSubWidget( ewol::object::makeShared(new ewol::widget::Label("Fill X <br/> (false)")));
myButton->setSubWidgetToggle(ewol::object::makeShared(new ewol::widget::Label("Fill X <br/> (true)")));
myButton->registerOnEvent(this, "value", l_eventChangeFillX);
myButton->setSubWidget( ewol::widget::Label::create("Fill X <br/> (false)"));
myButton->setSubWidgetToggle(ewol::widget::Label::create("Fill X <br/> (true)"));
myButton->registerOnEvent(shared_from_this(), "value", l_eventChangeFillX);
mySizerHori->subWidgetAdd(myButton);
}
myButton = ewol::object::makeShared(new ewol::widget::Button());
myButton = ewol::widget::Button::create();
if (nullptr != myButton) {
myButton->setToggleMode(true);
myButton->setSubWidget( ewol::object::makeShared(new ewol::widget::Label("Fill Y <br/> (false)")));
myButton->setSubWidgetToggle(ewol::object::makeShared(new ewol::widget::Label("Fill Y <br/> (true)")));
myButton->registerOnEvent(this, "value", l_eventChangeFillY);
myButton->setSubWidget( ewol::widget::Label::create("Fill Y <br/> (false)"));
myButton->setSubWidgetToggle(ewol::widget::Label::create("Fill Y <br/> (true)"));
myButton->registerOnEvent(shared_from_this(), "value", l_eventChangeFillY);
mySizerHori->subWidgetAdd(myButton);
}
myButton = ewol::object::makeShared(new ewol::widget::Button());
myButton = ewol::widget::Button::create();
if (nullptr != myButton) {
myButton->setSubWidget(ewol::object::makeShared(new ewol::widget::Label("Change Image")));
myButton->registerOnEvent(this, "value", l_eventChangeImage);
myButton->setSubWidget(ewol::widget::Label::create("Change Image"));
myButton->registerOnEvent(shared_from_this(), "value", l_eventChangeImage);
mySizerHori->subWidgetAdd(myButton);
}
ewol::object::Shared<ewol::widget::Spacer> mySpacer = ewol::object::makeShared(new ewol::widget::Spacer());
std::shared_ptr<ewol::widget::Spacer> mySpacer = ewol::widget::Spacer::create();
if (nullptr != mySpacer) {
mySpacer->setExpand(bvec2(false,false));
mySpacer->setFill(bvec2(true,false));
@ -105,14 +106,14 @@ TestImage::TestImage() :
subWidgetAdd(mySpacer);
}
mySizerHori = ewol::object::makeShared(new ewol::widget::Sizer(ewol::widget::Sizer::modeHori));
mySizerHori = ewol::widget::Sizer::create(ewol::widget::Sizer::modeHori);
if (nullptr == mySizerHori) {
APPL_DEBUG("Allocation error mySizerHori");
return;
}
subWidgetAdd(mySizerHori);
mySpacer = ewol::object::makeShared(new ewol::widget::Spacer());
mySpacer = ewol::widget::Spacer::create();
if (nullptr != mySpacer) {
mySpacer->setExpand(bvec2(false,false));
mySpacer->setFill(bvec2(false,true));
@ -121,15 +122,15 @@ TestImage::TestImage() :
mySizerHori->subWidgetAdd(mySpacer);
}
m_testWidget = ewol::object::makeShared(new ewol::widget::Image("DATA:sphere.png"));
m_testWidget = ewol::widget::Image::create("DATA:sphere.png");
if (nullptr != m_testWidget) {
m_testWidget->setExpand(bvec2(false,false));
m_testWidget->setFill(bvec2(false,false));
//m_testWidget->registerOnEvent(this, ewolEventButtonValue);
//m_testWidget->registerOnEvent(shared_from_this(), ewolEventButtonValue);
mySizerHori->subWidgetAdd(m_testWidget);
}
mySpacer = ewol::object::makeShared(new ewol::widget::Spacer());
mySpacer = ewol::widget::Spacer::create();
if (nullptr != mySpacer) {
mySpacer->setExpand(bvec2(false,false));
mySpacer->setFill(bvec2(false,true));
@ -138,7 +139,7 @@ TestImage::TestImage() :
mySizerHori->subWidgetAdd(mySpacer);
}
mySpacer = ewol::object::makeShared(new ewol::widget::Spacer());
mySpacer = ewol::widget::Spacer::create();
if (nullptr != mySpacer) {
mySpacer->setExpand(bvec2(false,false));
mySpacer->setFill(bvec2(true,false));
@ -150,12 +151,7 @@ TestImage::TestImage() :
}
TestImage::~TestImage() {
APPL_INFO("Remove " __class__ " ...");
}
void TestImage::onReceiveMessage(const ewol::object::Message& _msg) {
void appl::TestImage::onReceiveMessage(const ewol::object::Message& _msg) {
ewol::widget::Sizer::onReceiveMessage(_msg);
//APPL_INFO("Receive Event from the main windows ... : \"" << eventId << "\" ==> data=\"" << data << "\"" );
if (m_testWidget == _msg.getCaller()) {

View File

@ -16,15 +16,20 @@
#include <ewol/widget/Spacer.h>
#include <ewol/widget/Sizer.h>
class TestImage : public ewol::widget::Sizer {
namespace appl {
class TestImage : public ewol::widget::Sizer {
private:
ewol::object::Shared<ewol::widget::Image> m_testWidget;
std::shared_ptr<ewol::widget::Image> m_testWidget;
public:
// Constructeur
TestImage();
virtual ~TestImage();
void init();
public:
DECLARE_FACTORY(TestImage);
virtual ~TestImage() {};
public: // Derived function
virtual void onReceiveMessage(const ewol::object::Message& _msg);
};
};
#endif

View File

@ -35,126 +35,123 @@ static const char * l_eventChangeLabel = "event-change-label";
#undef __class__
#define __class__ "TestButton"
TestLabel::TestLabel() :
ewol::widget::Sizer(ewol::widget::Sizer::modeVert),
m_labelId(0) {
APPL_DEBUG("CREATE " __class__ " ... ");
appl::TestLabel::TestLabel() {
addObjectType("appl::TestLabel");
ewol::object::Shared<ewol::widget::Sizer> mySizerVert2;
ewol::object::Shared<ewol::widget::Sizer> mySizerHori;
ewol::object::Shared<ewol::widget::Button> myButton;
}
mySizerHori = ewol::object::makeShared(new ewol::widget::Sizer(ewol::widget::Sizer::modeHori));
void appl::TestLabel::init() {
ewol::widget::Sizer::init(ewol::widget::Sizer::modeVert);
APPL_DEBUG("CREATE " __class__ " ... ");
std::shared_ptr<ewol::widget::Sizer> mySizerVert2;
std::shared_ptr<ewol::widget::Sizer> mySizerHori;
std::shared_ptr<ewol::widget::Button> myButton;
mySizerHori = ewol::widget::Sizer::create(ewol::widget::Sizer::modeHori);
if (nullptr == mySizerHori) {
APPL_DEBUG("Allocation error mySizerHori");
return;
}
subWidgetAdd(mySizerHori);
myButton = ewol::object::makeShared(new ewol::widget::Button());
myButton = ewol::widget::Button::create();
if (nullptr != myButton) {
myButton->setToggleMode(true);
myButton->setSubWidget( ewol::object::makeShared(new ewol::widget::Label("Expand X (false)")));
myButton->setSubWidgetToggle(ewol::object::makeShared(new ewol::widget::Label("Expand X (true)")));
myButton->registerOnEvent(this, "value", l_eventChangeExpendX);
myButton->setSubWidget( ewol::widget::Label::create("Expand X (false)"));
myButton->setSubWidgetToggle(ewol::widget::Label::create("Expand X (true)"));
myButton->registerOnEvent(shared_from_this(), "value", l_eventChangeExpendX);
mySizerHori->subWidgetAdd(myButton);
}
myButton = ewol::object::makeShared(new ewol::widget::Button());
myButton = ewol::widget::Button::create();
if (nullptr != myButton) {
myButton->setToggleMode(true);
myButton->setSubWidget( ewol::object::makeShared(new ewol::widget::Label("Expand Y (false)")));
myButton->setSubWidgetToggle(ewol::object::makeShared(new ewol::widget::Label("Expand Y (true)")));
myButton->registerOnEvent(this, "value", l_eventChangeExpendY);
myButton->setSubWidget( ewol::widget::Label::create("Expand Y (false)"));
myButton->setSubWidgetToggle(ewol::widget::Label::create("Expand Y (true)"));
myButton->registerOnEvent(shared_from_this(), "value", l_eventChangeExpendY);
mySizerHori->subWidgetAdd(myButton);
}
myButton = ewol::object::makeShared(new ewol::widget::Button());
myButton = ewol::widget::Button::create();
if (nullptr != myButton) {
myButton->setToggleMode(true);
myButton->setSubWidget( ewol::object::makeShared(new ewol::widget::Label("Fill X (false)")));
myButton->setSubWidgetToggle(ewol::object::makeShared(new ewol::widget::Label("Fill X (true)")));
myButton->registerOnEvent(this, "value", l_eventChangeFillX);
myButton->setSubWidget( ewol::widget::Label::create("Fill X (false)"));
myButton->setSubWidgetToggle(ewol::widget::Label::create("Fill X (true)"));
myButton->registerOnEvent(shared_from_this(), "value", l_eventChangeFillX);
mySizerHori->subWidgetAdd(myButton);
}
myButton = ewol::object::makeShared(new ewol::widget::Button());
myButton = ewol::widget::Button::create();
if (nullptr != myButton) {
myButton->setToggleMode(true);
myButton->setSubWidget( ewol::object::makeShared(new ewol::widget::Label("Fill Y (false)")));
myButton->setSubWidgetToggle(ewol::object::makeShared(new ewol::widget::Label("Fill Y (true)")));
myButton->registerOnEvent(this, "value", l_eventChangeFillY);
myButton->setSubWidget( ewol::widget::Label::create("Fill Y (false)"));
myButton->setSubWidgetToggle(ewol::widget::Label::create("Fill Y (true)"));
myButton->registerOnEvent(shared_from_this(), "value", l_eventChangeFillY);
mySizerHori->subWidgetAdd(myButton);
}
myButton = ewol::object::makeShared(new ewol::widget::Button());
myButton = ewol::widget::Button::create();
if (nullptr != myButton) {
myButton->setToggleMode(true);
myButton->setSubWidget( ewol::object::makeShared(new ewol::widget::Label("no Max size")));
myButton->setSubWidgetToggle(ewol::object::makeShared(new ewol::widget::Label("maxSize (400,99999999)")));
myButton->registerOnEvent(this, "value", l_eventChangeMaxSize);
myButton->setSubWidget( ewol::widget::Label::create("no Max size"));
myButton->setSubWidgetToggle(ewol::widget::Label::create("maxSize (400,99999999)"));
myButton->registerOnEvent(shared_from_this(), "value", l_eventChangeMaxSize);
mySizerHori->subWidgetAdd(myButton);
}
myButton = ewol::object::makeShared(new ewol::widget::Button());
myButton = ewol::widget::Button::create();
if (nullptr != myButton) {
myButton->setSubWidget(ewol::object::makeShared(new ewol::widget::Label("Next Label")));
myButton->registerOnEvent(this, "pressed", l_eventChangeLabel);
myButton->setSubWidget(ewol::widget::Label::create("Next Label"));
myButton->registerOnEvent(shared_from_this(), "pressed", l_eventChangeLabel);
mySizerHori->subWidgetAdd(myButton);
}
ewol::object::Shared<ewol::widget::Spacer> mySpacer = ewol::object::makeShared(new ewol::widget::Spacer());
std::shared_ptr<ewol::widget::Spacer> mySpacer = ewol::widget::Spacer::create();
if (nullptr != mySpacer) {
mySpacer->setExpand(bvec2(false,false));
mySpacer->setFill(bvec2(true,false));
mySpacer->setMinSize(vec2(10,10));
mySpacer->setColor(0xFF000080);
mySpacer->setColor(etk::Color<>(0xFF, 0x00, 0x00, 0x80));
subWidgetAdd(mySpacer);
}
mySizerHori = ewol::object::makeShared(new ewol::widget::Sizer(ewol::widget::Sizer::modeHori));
mySizerHori = ewol::widget::Sizer::create(ewol::widget::Sizer::modeHori);
if (nullptr == mySizerHori) {
APPL_DEBUG("Allocation error mySizerHori");
return;
}
subWidgetAdd(mySizerHori);
mySpacer = ewol::object::makeShared(new ewol::widget::Spacer());
mySpacer = ewol::widget::Spacer::create();
if (nullptr != mySpacer) {
mySpacer->setExpand(bvec2(false,false));
mySpacer->setFill(bvec2(false,true));
mySpacer->setMinSize(vec2(10,10));
mySpacer->setColor(0x00FF0080);
mySpacer->setColor(etk::Color<>(0x00, 0xFF, 0x00, 0x80));
mySizerHori->subWidgetAdd(mySpacer);
}
m_testWidget = ewol::object::makeShared(new ewol::widget::Label("Basic label"));
m_testWidget = ewol::widget::Label::create("Basic label");
if (nullptr != m_testWidget) {
m_testWidget->setExpand(bvec2(false,false));
m_testWidget->setFill(bvec2(false,false));
//m_testWidget->registerOnEvent(this, ewolEventButtonColorChange);
//m_testWidget->registerOnEvent(shared_from_this(), ewolEventButtonColorChange);
mySizerHori->subWidgetAdd(m_testWidget);
}
mySpacer = ewol::object::makeShared(new ewol::widget::Spacer());
mySpacer = ewol::widget::Spacer::create();
if (nullptr != mySpacer) {
mySpacer->setExpand(bvec2(false,false));
mySpacer->setFill(bvec2(false,true));
mySpacer->setMinSize(vec2(10,10));
mySpacer->setColor(0x0000FF80);
mySpacer->setColor(etk::Color<>(0x00, 0x00, 0xFF, 0x80));
mySizerHori->subWidgetAdd(mySpacer);
}
mySpacer = ewol::object::makeShared(new ewol::widget::Spacer());
mySpacer = ewol::widget::Spacer::create();
if (nullptr != mySpacer) {
mySpacer->setExpand(bvec2(false,false));
mySpacer->setFill(bvec2(true,false));
mySpacer->setMinSize(vec2(10,10));
mySpacer->setColor(0x00FFFF80);
mySpacer->setColor(etk::Color<>(0x00, 0xFF, 0xFF, 0x80));
subWidgetAdd(mySpacer);
}
}
TestLabel::~TestLabel() {
}
void TestLabel::onReceiveMessage(const ewol::object::Message& _msg) {
void appl::TestLabel::onReceiveMessage(const ewol::object::Message& _msg) {
ewol::widget::Sizer::onReceiveMessage(_msg);
//APPL_INFO("Receive Event from the main windows ... : \"" << eventId << "\" ==> data=\"" << data << "\"" );
if (m_testWidget == _msg.getCaller()) {

View File

@ -16,21 +16,26 @@
#include <ewol/widget/Spacer.h>
#include <ewol/widget/Sizer.h>
class TestLabel : public ewol::widget::Sizer {
namespace appl {
class TestLabel : public ewol::widget::Sizer {
private:
ewol::object::Shared<ewol::widget::Label> m_testWidget;
std::shared_ptr<ewol::widget::Label> m_testWidget;
int32_t m_labelId;
public:
/**
* @brief Constructeur
*/
TestLabel();
void init();
public:
DECLARE_FACTORY(TestLabel);
/**
* @brief Destructor
*/
virtual ~TestLabel();
virtual ~TestLabel() {};
public: // Derived function
virtual void onReceiveMessage(const ewol::object::Message& _msg);
};
};
#endif

View File

@ -57,9 +57,9 @@ TestScene::TestScene() :
*/
APPL_CRITICAL("Create "__class__" (start)");
ewol::object::Shared<ewol::widget::Sizer> mySizerVert2 = nullptr;
ewol::object::Shared<ewol::widget::Sizer> mySizerHori = nullptr;
ewol::object::Shared<ewol::widget::Button> myButton = nullptr;
std::shared_ptr<ewol::widget::Sizer> mySizerVert2 = nullptr;
std::shared_ptr<ewol::widget::Sizer> mySizerHori = nullptr;
std::shared_ptr<ewol::widget::Button> myButton = nullptr;
/*
mySizerHori = new ewol::widget::SizerHori();
if (nullptr == mySizerHori) {
@ -139,7 +139,7 @@ TestScene::TestScene() :
mySizerHori->SubWidgetAdd(myButton);
}
*/
ewol::object::Shared<ewol::widget::Spacer> mySpacer = new widget::Spacer();
std::shared_ptr<ewol::widget::Spacer> mySpacer = new widget::Spacer();
if (nullptr != mySpacer) {
mySpacer->setExpand(bvec2(false,false));
mySpacer->setFill(bvec2(true,false));

View File

@ -16,7 +16,7 @@
class TestScene : public ewol::widget::Sizer {
private:
ewol::object::Shared<ewol::widget::Scene> m_testWidget;
std::shared_ptr<ewol::widget::Scene> m_testWidget;
public:
// Constructeur
TestScene();

View File

@ -39,7 +39,7 @@ class MainApplication : public ewol::context::Application {
// set the application icon ...
_context.setIcon("DATA:icon.png");
ewol::object::Shared<MainWindows> basicWindows = ewol::object::makeShared(new MainWindows());
std::shared_ptr<appl::MainWindows> basicWindows = appl::MainWindows::create();
if (basicWindows == nullptr) {
APPL_ERROR("Can not allocate the basic windows");
return false;