X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=examples%2Fbuilder%2Fexamples.cpp;h=e0222277b7126c576707f8867bfae937e11de848;hb=888de069f8cb0dd95e90994474c488cfd8f5bbb0;hp=2895d828ac8cddabaa28f2857d23a111aba69138;hpb=971b11c17515c2f052f778d2e432e062738a99d7;p=platform%2Fcore%2Fuifw%2Fdali-demo.git diff --git a/examples/builder/examples.cpp b/examples/builder/examples.cpp index 2895d82..e022227 100644 --- a/examples/builder/examples.cpp +++ b/examples/builder/examples.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -42,6 +43,7 @@ #include #include +#include #include "shared/view.h" #define TOKEN_STRING(x) #x @@ -85,9 +87,14 @@ std::string ReplaceQuotes(const std::string &single_quoted) std::string GetFileContents(const std::string &fn) { - std::ifstream t(fn.c_str()); - return std::string((std::istreambuf_iterator(t)), - std::istreambuf_iterator()); + std::streampos bufferSize = 0; + Dali::Vector fileBuffer; + if( !Dali::FileLoader::ReadFile( fn, bufferSize, fileBuffer, FileLoader::FileType::BINARY ) ) + { + return std::string(); + } + + return std::string( &fileBuffer[0], bufferSize ); }; typedef std::vector FileList; @@ -472,8 +479,8 @@ public: // Create an edit mode button. (left of toolbar) Toolkit::PushButton backButton = Toolkit::PushButton::New(); - backButton.SetUnselectedImage( EDIT_IMAGE ); - backButton.SetSelectedImage( EDIT_IMAGE_SELECTED ); + backButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, EDIT_IMAGE ); + backButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, EDIT_IMAGE_SELECTED ); backButton.ClickedSignal().Connect( this, &ExampleApp::OnBackButtonPressed); backButton.SetLeaveRequired( true ); mToolBar.AddControl( backButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalLeft, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );