#include <fstream>
#include <streambuf>
#include <sstream>
-#include <boost/scoped_ptr.hpp>
#include <dirent.h>
#include <stdio.h>
+#include <iostream>
-//#include <boost/regex.hpp>
#include "sys/stat.h"
#include <ctime>
#include <dali/integration-api/debug.h>
-#include "../shared/view.h"
+#include "shared/view.h"
#define TOKEN_STRING(x) #x
'stage': \
[ \
{ \
- 'type':'TextView', \
+ 'type':'TextLabel', \
'size': [50,50,1], \
'parent-origin': 'CENTER', \
'text':'COULD NOT LOAD JSON FILE' \
void SetTitle(const std::string& title)
{
- // TODO
+ if(!mTitleActor)
+ {
+ mTitleActor = DemoHelper::CreateToolBarLabel( "" );
+ // Add title to the tool bar.
+ mToolBar.AddControl( mTitleActor, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarTitlePercentage, Alignment::HorizontalCenter );
+ }
+
+ mTitleActor.SetProperty( TextLabel::Property::TEXT, title );
}
bool OnToolSelectLayout( Toolkit::Button button )
{
Stage stage = Stage::GetCurrent();
+ mTapDetector = TapGestureDetector::New();
+ mTapDetector.DetectedSignal().Connect( this, &ExampleApp::OnTap );
+
if( mItemView )
{
stage.Remove( mItemView );
mFiles.clear();
mItemView = ItemView::New(*this);
+ mItemView.SetRelayoutEnabled( false );
stage.Add( mItemView );
mItemView.SetParentOrigin(ParentOrigin::CENTER);
mItemView.SetAnchorPoint(AnchorPoint::CENTER);
}
}
- mTapDetector = TapGestureDetector::New();
-
- for( unsigned int i = 0u; i < mItemView.GetChildCount(); ++i )
- {
- mTapDetector.Attach( mItemView.GetChildAt(i) );
- }
-
- mTapDetector.DetectedSignal().Connect( this, &ExampleApp::OnTap );
-
// Display item view on the stage
stage.Add( mItemView );
Actor MenuItem(const std::string& text)
{
- return Actor();
+ TextLabel label = TextLabel::New( ShortName( text ) );
+ label.SetProperty( Dali::Toolkit::Control::Property::STYLE_NAME, "builderlabel" );
+ label.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+
+ // Hook up tap detector
+ mTapDetector.Attach( label );
+
+ return label;
}
bool OnTimer()
builder.AddActors( layer );
+ // Force relayout on layer
+ layer.RelayoutRequestTree();
}
void Create(Application& app)
{
+ DemoHelper::RequestThemeChange();
+
Stage stage = Stage::GetCurrent();
Stage::GetCurrent().KeyEventSignal().Connect(this, &ExampleApp::OnKeyEvent);
// Create an edit mode button. (left of toolbar)
Toolkit::PushButton editButton = Toolkit::PushButton::New();
- editButton.SetBackgroundImage( Image::New( EDIT_IMAGE ) );
+ editButton.SetBackgroundImage( ResourceImage::New( EDIT_IMAGE ) );
editButton.ClickedSignal().Connect( this, &ExampleApp::OnToolSelectLayout);
editButton.SetLeaveRequired( true );
mToolBar.AddControl( editButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalLeft, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
unsigned int mOrientation;
Toolkit::ToolBar mToolBar;
+ TextLabel mTitleActor; ///< The Toolbar's Title.
Layer mBuilderLayer;