[TEST] update test to the new interface of ewol

This commit is contained in:
Edouard DUPIN 2014-08-19 21:06:17 +02:00
parent f0e325a853
commit 69e1259b27
3 changed files with 14 additions and 8 deletions

View File

@ -29,7 +29,7 @@ class MainApplication : public ewol::context::Application {
_context.getFontDefault().setUseExternal(false);
_context.getFontDefault().set("FreeSerif", 30);
ewol::object::Shared<ewol::widget::Windows> basicWindows = ewol::object::makeShared(new appl::Windows());
std::shared_ptr<ewol::widget::Windows> basicWindows = appl::Windows::create();
// create the specific windows
_context.setWindows(basicWindows);
APPL_INFO("==> Init APPL (END)");

View File

@ -24,8 +24,11 @@
static const char* const g_eventPlay1 = "appl-play-1";
static const char* const g_eventPlay2 = "appl-play-2";
appl::Windows::Windows() :
m_composer(NULL) {
appl::Windows::Windows() {
addObjectType("appl::Windows");
}
void appl::Windows::init() {
setTitle("example 001_HelloWord");
std::string composition = std::string("");
composition += "<sizer mode='vert'>\n";
@ -44,14 +47,14 @@ appl::Windows::Windows() :
composition += " <spacer expand='true' fill='true'/>\n";
composition += "</sizer>\n";
m_composer = new ewol::widget::Composer(ewol::widget::Composer::String, composition);
m_composer = ewol::widget::Composer::create(ewol::widget::Composer::String, composition);
if (m_composer == NULL) {
APPL_CRITICAL(" An error occured ... in the windows creatrion ...");
return;
}
setSubWidget(m_composer);
m_composer->registerOnEventNameWidget(this, "bt-play1", "pressed", g_eventPlay1);
m_composer->registerOnEventNameWidget(this, "bt-play2", "pressed", g_eventPlay2);
m_composer->registerOnEventNameWidget(shared_from_this(), "bt-play1", "pressed", g_eventPlay1);
m_composer->registerOnEventNameWidget(shared_from_this(), "bt-play2", "pressed", g_eventPlay2);
}
eaudiofx::Processing* process = NULL;

View File

@ -15,9 +15,12 @@
namespace appl {
class Windows : public ewol::widget::Windows {
private:
ewol::widget::Composer* m_composer;
public:
std::shared_ptr<ewol::widget::Composer> m_composer;
protected:
Windows();
void init();
public:
DECLARE_FACTORY(Windows);
public: // herited functions
virtual void onReceiveMessage(const ewol::object::Message& _msg);
};