label.SetProperty( TextLabel::Property::TEXT, title );
label.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
label.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
+ label.SetResizePolicy( FILL_TO_PARENT, HEIGHT );
label.SetColor( TABLE_TEXT_STYLE_COLOR );
content.Add( label );
void SetTitle(const std::string& title)
{
- // TODO
+ if(!mTitleActor)
+ {
+ mTitleActor = TextLabel::New();
+ // 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 )
Actor MenuItem(const std::string& text)
{
- return Actor();
+ int size = static_cast<int>(DemoHelper::ScalePointSize(6));
+
+ std::ostringstream fontString;
+ fontString << "<font size="<< size <<">"<< ShortName( text ) << "</font>";
+
+ TextLabel label = TextLabel::New( fontString.str() );
+ label.SetResizePolicy( FILL_TO_PARENT, WIDTH );
+
+ // Hook up tap detector
+ mTapDetector.Attach( label );
+
+ return label;
}
bool OnTimer()
unsigned int mOrientation;
Toolkit::ToolBar mToolBar;
+ TextLabel mTitleActor; ///< The Toolbar's Title.
Layer mBuilderLayer;
tableView.SetPreferredSize( Vector2( DP(260), 0.0f ) );
tableView.SetResizePolicy( USE_NATURAL_SIZE, HEIGHT );
+ Toolkit::TextLabel textLabel = Toolkit::TextLabel::New( "Select enabled" );
+ tableView.AddChild( textLabel, Toolkit::TableView::CellPosition( 0, 0 ) );
+
ImageActor imageActor = ImageActor::New( ResourceImage::New( ENABLED_IMAGE ) );
imageActor.SetPreferredSize( Vector2( DP(RADIO_LABEL_THUMBNAIL_SIZE), DP(RADIO_LABEL_THUMBNAIL_SIZE) ) );
imageActor.SetResizePolicy( FIXED, ALL_DIMENSIONS );
bool OnCheckBoxesSelected( Toolkit::Button button )
{
+ if( button.GetName() == "checkbox1" )
+ {
+ if( button.IsSelected() )
+ {
+ button.SetLabel("CheckBox1 is selected");
+ }
+ else
+ {
+ button.SetLabel("CheckBox1 is unselected");
+ }
+ }
+
+ if( button.GetName() == "checkbox2" )
+ {
+ if( button.IsSelected() )
+ {
+ button.SetLabel("CheckBox2 is selected");
+ }
+ else
+ {
+ button.SetLabel("CheckBox2 is unselected");
+ }
+ }
+
+ if( button.GetName() == "checkbox3" )
+ {
+ if( button.IsSelected() )
+ {
+ button.SetLabel("CheckBox3 is selected");
+ }
+ else
+ {
+ button.SetLabel("CheckBox3 is unselected");
+ }
+ }
+
return true;
}
*/
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 );
}
/**
Application& mApplication; ///< Application instance
Toolkit::View mView; ///< The View instance.
Toolkit::ToolBar mToolBar; ///< The View's Toolbar.
+ TextLabel mTitleActor; ///< The Toolbar's Title.
Layer mContentLayer; ///< Content layer (scrolling cluster content)
using namespace Dali;
+using Dali::Toolkit::TextLabel;
+
// LOCAL STUFF
namespace
{
Toolkit::View mView;
Toolkit::ToolBar mToolBar;
Layer mContent;
+ Toolkit::TextLabel mTitleActor;
Actor mParent;
Vector2 mViewSize;
mEffectChangeButton.ClickedSignal().Connect( this, &CubeTransitionApp::OnEffectButtonClicked );
mToolBar.AddControl( mEffectChangeButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
+ // Add title to the tool bar.
+ mTitleActor = DemoHelper::CreateToolBarLabel( APPLICATION_TITLE_WAVE );
+ mToolBar.AddControl( mTitleActor, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarTitlePercentage, Toolkit::Alignment::HorizontalCenter );
+
//Add an slideshow icon on the right of the title
mIconSlideshowStart = ResourceImage::New( SLIDE_SHOW_START_ICON );
mIconSlideshowStop = ResourceImage::New( SLIDE_SHOW_STOP_ICON );
if(mCurrentEffect == mCubeWaveEffect)
{
mCurrentEffect = mCubeCrossEffect;
+ mTitleActor.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_CROSS) );
mEffectChangeButton.SetBackgroundImage(mImageCross);
}
else if(mCurrentEffect == mCubeCrossEffect)
{
mCurrentEffect = mCubeFoldEffect;
+ mTitleActor.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_FOLD) );
mEffectChangeButton.SetBackgroundImage(mImageFold);
}
else
{
mCurrentEffect = mCubeWaveEffect;
+ mTitleActor.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_WAVE) );
mEffectChangeButton.SetBackgroundImage(mImageWave);
}
using namespace Dali;
+using Dali::Toolkit::TextLabel;
+
// LOCAL STUFF
namespace
{
Toolkit::View mView;
Toolkit::ToolBar mToolBar;
Layer mContent;
+ Toolkit::TextLabel mTitleActor;
Actor mParent;
ImageActor mCurrentImage;
mToolBar.AddControl( mEffectChangeButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
// Add title to the tool bar.
- // TODO
+ mTitleActor = DemoHelper::CreateToolBarLabel( APPLICATION_TITLE_HIGHP );
+ mToolBar.AddControl( mTitleActor, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarTitlePercentage, Toolkit::Alignment::HorizontalCenter );
// Add an slide-show button on the right of the title
mIconPlay = ResourceImage::New( PLAY_ICON );
mCurrentImageEffect = Toolkit::DissolveEffect::New(mUseHighPrecision);
if(mUseHighPrecision)
{
+ mTitleActor.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_HIGHP) );
mEffectChangeButton.SetBackgroundImage(mIconHighP);
}
else
*/
void SetTitle(const std::string& title)
{
- // TODO
+ if(!mTitleActor)
+ {
+ mTitleActor = TextLabel::New();
+ // Add title to the tool bar.
+ mToolBar.AddControl( mTitleActor, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarTitlePercentage, Alignment::HorizontalCenter );
+ }
}
/**
Layer mContentLayer; ///< The content layer (contains non gui chrome actors)
Toolkit::View mView; ///< The View instance.
Toolkit::ToolBar mToolBar; ///< The View's Toolbar.
+ TextLabel mTitleActor; ///< The Toolbar's Title.
Actor mGridActor; ///< The container for the grid of images
ScrollView mScrollView; ///< ScrollView UI Component
bool mScrolling; ///< ScrollView scrolling state (true = scrolling, false = stationary)
const unsigned int NUM_ALPHA_FUNCTIONS = sizeof(ALPHA_FUNCTIONS) / sizeof(AlphaFunction);
-//const char* ALPHA_FUNCTIONS_TEXT[] = { "Linear",
-// "EaseIn",
-// "EaseOut" };
+const char* ALPHA_FUNCTIONS_TEXT[] = { "Linear",
+ "EaseIn",
+ "EaseOut" };
const char* BACKGROUND_IMAGE( "" );
const char* TOOLBAR_IMAGE( DALI_IMAGE_DIR "top-bar.png" );
const float MENU_OPTION_HEIGHT(140.0f);
const float LABEL_TEXT_SIZE_Y = 20.0f;
-//const char* DEFAULT_TEXT_STYLE_FONT_FAMILY("HelveticaNue");
-//const char* DEFAULT_TEXT_STYLE_FONT_STYLE("Regular");
-//const Vector4 DEFAULT_TEXT_STYLE_COLOR(1.0f, 1.0f, 1.0f, 1.0f);
-
const Vector3 INITIAL_OFFSCREEN_POSITION( 1000.0f, 0, -1000.0f );
static Vector3 DepthLayoutItemSizeFunctionPortrait(unsigned int numberOfColumns, float layoutWidth)
*/
void SetTitle(const std::string& title)
{
- // TODO
+ if(!mTitleActor)
+ {
+ mTitleActor = TextLabel::New();
+ // Add title to the tool bar.
+ mToolBar.AddControl( mTitleActor, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarTitlePercentage, Alignment::HorizontalCenter );
+ }
}
void ShowMenu()
slider.ValueChangedSignal().Connect( this, &ItemViewExample::SliderValueChange );
tableView.AddChild( slider, TableView::CellPosition( 0, 0 ) );
+ TextLabel text = TextLabel::New( "Duration" );
+ text.SetAnchorPoint( ParentOrigin::TOP_LEFT );
+ text.SetParentOrigin( ParentOrigin::TOP_LEFT );
+ text.SetResizePolicy( FILL_TO_PARENT, WIDTH );
+ text.SetResizePolicy( FIXED, HEIGHT );
+ text.SetPreferredSize( Vector2( 0.0f, LABEL_TEXT_SIZE_Y ) );
+ slider.Add( text );
+
+ Actor textContainer = Actor::New();
+ textContainer.SetRelayoutEnabled( true );
+ textContainer.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ mAlphaFunctionText = TextLabel::New( ALPHA_FUNCTIONS_TEXT[mAlphaFuncIndex] );
+ mAlphaFunctionText.SetAnchorPoint( ParentOrigin::CENTER );
+ mAlphaFunctionText.SetParentOrigin( ParentOrigin::CENTER );
+ textContainer.Add( mAlphaFunctionText );
+ tableView.AddChild( textContainer, TableView::CellPosition( 1, 0 ) );
+
+ mTapDetector = TapGestureDetector::New();
+ mTapDetector.Attach(mAlphaFunctionText);
+ mTapDetector.DetectedSignal().Connect( this, &ItemViewExample::ChangeAlphaFunctionOnTap );
+
+ text = TextLabel::New( "Alpha Function" );
+ text.SetAnchorPoint( ParentOrigin::TOP_LEFT );
+ text.SetParentOrigin( ParentOrigin::TOP_LEFT );
+ text.SetResizePolicy( FILL_TO_PARENT, WIDTH );
+ text.SetResizePolicy( FIXED, HEIGHT );
+ text.SetPreferredSize( Vector2( 0.0f, LABEL_TEXT_SIZE_Y ) );
+ textContainer.Add( text );
+
+ mMenu.MarkDirtyForRelayout();
mMenu.Show();
mMenuShown = true;
}
mAlphaFuncIndex = 0;
}
+ if( mAlphaFunctionText )
+ {
+ mAlphaFunctionText.SetProperty( TextLabel::Property::TEXT, std::string(ALPHA_FUNCTIONS_TEXT[mAlphaFuncIndex]) );
+ }
+
if( mItemView )
{
mItemView.GetActiveLayout()->SetAlphaFunction( ALPHA_FUNCTIONS[mAlphaFuncIndex] );
unsigned int mOrientation;
Toolkit::ToolBar mToolBar;
+ TextLabel mTitleActor; ///< The Toolbar's Title.
ItemView mItemView;
Image mBorderImage;
Toolkit::PushButton mReplaceButton;
unsigned int mAlphaFuncIndex;
+ TextLabel mAlphaFunctionText;
BufferImage mWhiteImage;
};
radioGroupBackground.SetSize( stageSize.width - 2 * DP(MARGIN_SIZE), DP(LOGGER_RADIO_GROUP_HEIGHT) );
mContentLayer.Add( radioGroupBackground );
+ // Label
+ {
+ Toolkit::TextLabel label = Toolkit::TextLabel::New( LOGGER_TEXT );
+ label.SetParentOrigin( ParentOrigin::TOP_LEFT );
+ label.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ label.SetPosition( DP(MARGIN_SIZE), DP(MARGIN_SIZE) );
+
+ radioGroupBackground.Add( label );
+ }
+
// Radio group
Actor radioButtonsGroup = Actor::New();
radioButtonsGroup.SetParentOrigin( ParentOrigin::TOP_LEFT );
frequencyRadioGroupBackground.SetSize( stageSize.width - 2 * DP(MARGIN_SIZE), DP(groupHeight) );
mContentLayer.Add( frequencyRadioGroupBackground );
+ // Label
+ {
+ Toolkit::TextLabel label = Toolkit::TextLabel::New( FREQUENCY_TEXT );
+ label.SetParentOrigin( ParentOrigin::TOP_LEFT );
+ label.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ label.SetPosition( DP(MARGIN_SIZE), DP(MARGIN_SIZE) );
+
+ frequencyRadioGroupBackground.Add( label );
+ }
+
// Radio group
Actor frequencyRadioButtonsGroup = Actor::New();
frequencyRadioButtonsGroup.SetParentOrigin( ParentOrigin::TOP_LEFT );
void WriteConsole()
{
- // TODO
+ for( unsigned int i = 0; i < NUM_LOGGERS; ++i)
+ {
+ std::stringstream ss;
+ ss << (i + 1) << ") " << ((mPerformanceLoggers[i]) ? "Created" : "Deleted")
+ << ", " << ((mLoggerStates[i].isTiming) ? "Started" : "Stopped")
+ << ", " << ((mLoggerStates[i].isEnabled) ? "Enabled" : "Disabled");
+
+ Toolkit::TextLabel textLabel = Toolkit::TextLabel::New( ss.str() );
+
+ mLogRadioButtons[i].SetLabel( textLabel );
+ }
}
bool LoggingRadioSelect( Toolkit::Button button )
private:
Application mApplication;
Actor mCastingLight;
+ TextLabel mTextActor;
ImageActor mImageActor;
ImageActor mBlendActor;
Image mEffectImage;
Toolkit::View mView; ///< The View instance.
Toolkit::ToolBar mToolBar; ///< The View's Toolbar.
+ TextLabel mTitleActor; ///< The Toolbar's Title.
Layer mContentLayer; ///< Content layer (scrolling cluster content)
Toolkit::PushButton mLoseContextButton;
Vector3 mHSVDelta;
void NewWindowController::Destroy( Application& app )
{
+ UnparentAndReset(mTextActor);
}
bool NewWindowController::OnLoseContextButtonClicked( Toolkit::Button button )
void NewWindowController::CreateText()
{
- // TODO
+ mTextActor = TextLabel::New("Some text");
+ mTextActor.SetParentOrigin(ParentOrigin::CENTER);
+ mTextActor.SetColor(Color::RED);
+ mTextActor.SetName("PushMe text");
+ mContentLayer.Add( mTextActor );
}
Mesh NewWindowController::CreateMesh(bool hasColor, Material material)
const char* BACKGROUND_IMAGE( DALI_IMAGE_DIR "background-default.png" );
const char* ACTOR_IMAGE( DALI_IMAGE_DIR "dali-logo.png" );
const char* TOOLBAR_IMAGE( DALI_IMAGE_DIR "top-bar.png" );
+const char* APPLICATION_TITLE( "Path Animation Example" );
}; //Unnamed namespace
/**
*/
Actor CreateVectorComponentControl( const std::string& label, const Vector3& size, bool(PathController::*callback)(Slider,float) )
{
- return Actor();
+ TextLabel text = TextLabel::New(label);
+ text.SetColor( Vector4(0.0f,0.0f,0.0f,1.0f));
+
+ Slider slider = Slider::New();
+ slider.SetRelayoutEnabled( false );
+ slider.SetAnchorPoint( AnchorPoint::CENTER_LEFT);
+ slider.SetParentOrigin( ParentOrigin::CENTER_RIGHT);
+ slider.SetProperty(Slider::Property::LOWER_BOUND, -1.0f );
+ slider.SetProperty(Slider::Property::UPPER_BOUND, 1.0f );
+
+ Property::Array marks;
+ float mark = -1.0f;
+ for(unsigned short i(0); i<21; ++i )
+ {
+ marks.push_back( mark );
+ mark += 0.1f;
+ }
+
+ slider.SetProperty(Slider::Property::MARKS, marks);
+ slider.SetProperty(Slider::Property::SNAP_TO_MARKS, true );
+ slider.SetSize(size);
+ slider.SetScale( 0.5f );
+ slider.ValueChangedSignal().Connect(this,callback);
+ text.Add( slider );
+ return text;
}
/**
return true;
}
+ /**
+ * Callback called when user changes slider Y
+ * @param[in] slider The slider that has generated the signal
+ * @param[in] value The new value
+ */
bool OnSliderYValueChange( Slider s, float value)
{
if( fabs( value ) - Math::MACHINE_EPSILON_1000 < 0.0f )
}
/**
- * Create the path animation.
+ * Callback called when user changes slider Z
+ * @param[in] slider The slider that has generated the signal
+ * @param[in] value The new value
*/
bool OnSliderZValueChange( Slider s, float value)
{
mContentLayer.TouchedSignal().Connect(this, &PathController::OnTouchLayer);
+ //Title
+ TextLabel title = DemoHelper::CreateToolBarLabel( APPLICATION_TITLE );
+ toolBar.AddControl( title, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarTitlePercentage, Alignment::HorizontalCenter );
+
//Path
mPath = Dali::Path::New();
mPath.AddPoint( Vector3( 10.0f, stage.GetSize().y*0.5f, 0.0f ));
using namespace Dali;
+using namespace Dali::Toolkit;
#define TOKEN_STRING(x) #x
void Launcher::Create( Dali::Application& application )
{
+ TextLabel textActor = TextLabel::New( "JSON & JavaScript Launcher..." );
+
+ // Reposition the actor
+ textActor.SetParentOrigin( ParentOrigin::TOP_LEFT );
+ textActor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ textActor.SetPosition( 20, 0 );
+
// Get a handle to the stage
Stage stage = Stage::GetCurrent();
+ // Display the actor on the stage
+ stage.Add( textActor );
+
// change the background color to purple
Stage::GetCurrent().SetBackgroundColor( Vector4(0.2,0.2,0.4,1.0) );
*/
void SetTitle(const std::string& title)
{
+ if(!mTitleActor)
+ {
+ mTitleActor = DemoHelper::CreateToolBarLabel( "" );
+ // Add title to the tool bar.
+ mToolBar.AddControl( mTitleActor, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarTitlePercentage, Alignment::HorizontalCenter );
+ }
+
+ mTitleActor.SetProperty( Toolkit::TextLabel::Property::TEXT, title );
}
/**
Application& mApplication; ///< Application instance
Toolkit::View mView; ///< The View instance.
Toolkit::ToolBar mToolBar; ///< The View's Toolbar.
+ TextLabel mTitleActor; ///< The Toolbar's Title.
Layer mContentLayer; ///< The content layer (contains game actors)
ScrollView mScrollView; ///< ScrollView UI Component
bool mScrolling; ///< ScrollView scrolling state (true = scrolling, false = stationary)
const char* BACKGROUND_IMAGE( DALI_IMAGE_DIR "background-default.png" );
const char* TOOLBAR_IMAGE( DALI_IMAGE_DIR "top-bar.png" );
-//const char* APPLICATION_TITLE_PAN_LIGHT( "Lighting: Pan Light" );
-//const char* APPLICATION_TITLE_PAN_OBJECT( "Lighting: Pan Object" );
-//const char* APPLICATION_TITLE_PAN_SCENE( "Lighting: Pan Scene" );
-//const char* APPLICATION_TITLE_ROTATE_SCENE( "Lighting: Rotate Scene" );
+const char* APPLICATION_TITLE_PAN_LIGHT( "Lighting: Pan Light" );
+const char* APPLICATION_TITLE_PAN_OBJECT( "Lighting: Pan Object" );
+const char* APPLICATION_TITLE_PAN_SCENE( "Lighting: Pan Scene" );
+const char* APPLICATION_TITLE_ROTATE_SCENE( "Lighting: Rotate Scene" );
const char* CHANGE_EFFECT_IMAGE( DALI_IMAGE_DIR "icon-change.png" );
const char* RESET_ICON( DALI_IMAGE_DIR "icon-reset.png" );
toolBar.AddControl( effectChangeButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
// Add title to the tool bar.
- // TODO
+ mTitleActor = DemoHelper::CreateToolBarLabel( "" );
+ toolBar.AddControl( mTitleActor, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarTitlePercentage, Toolkit::Alignment::HorizontalCenter );
+
+ // Set Title text
+ mTitleActor.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_PAN_SCENE) );
//Add a reset button
Image resetImage = ResourceImage::New( RESET_ICON );
mCastingLight.SetAnchorPoint(AnchorPoint::CENTER);
mCastingLight.SetPosition( Vector3( 0.0f, 0.0f, 800.0f ) * scaleFactor );
+ TextLabel text = TextLabel::New( "Light" );
+ text.SetColor( Color::BLUE );
+
+ mCastingLight.Add(text);
mLightAnchor.Add(mCastingLight);
mShadowPlaneBg.Add(mLightAnchor);
+ text.SetParentOrigin(ParentOrigin::CENTER);
mShadowView.SetPointLight(mCastingLight);
}
bool OnEffectButtonClicked( Toolkit::Button button )
{
+ switch(mPanState)
+ {
+ case PAN_SCENE:
+ mPanState = ROTATE_SCENE;
+ mTitleActor.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_ROTATE_SCENE) );
+ break;
+ case ROTATE_SCENE:
+ mPanState = PAN_LIGHT;
+ mTitleActor.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_PAN_LIGHT) );
+ break;
+ case PAN_LIGHT:
+ mPanState = PAN_OBJECT;
+ mTitleActor.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_PAN_OBJECT) );
+ break;
+ case PAN_OBJECT:
+ mPanState = PAN_SCENE;
+ mTitleActor.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_PAN_SCENE) );
+ break;
+ default:
+ break;
+ }
+
return true;
}
Property::Index mAngle1Index;
Property::Index mAngle3Index;
+ Toolkit::TextLabel mTitleActor;
+
enum PanState
{
PAN_SCENE,
using namespace Dali;
+using Dali::Toolkit::TextLabel;
+
// Define this so that it is interchangeable
// "DP" stands for Device independent Pixels
#define DP(x) DemoHelper::ScalePointSize(x)
TOOLBAR_IMAGE,
std::string("") );
- mTitleActor = Dali::Toolkit::TextLabel::New(); // FIXME
- mTitleActor.SetName( "CUSTOM_TOOLBAR_TITLE" );
+ mTitleActor = DemoHelper::CreateToolBarLabel( "CUSTOM_TOOLBAR_TITLE" );
SetTitle();
{
mPopup = CreatePopup();
- // FIXME - Add text
+ TextLabel text = TextLabel::New( CONTENT_TEXT );
+ text.SetName( "POPUP_CONTENT_TEXT" );
+ text.SetProperty( TextLabel::Property::MULTI_LINE, true );
+ text.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
+ text.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
+ text.SetResizePolicy( FILL_TO_PARENT, Dali::HEIGHT );
+ text.SetPadding( Padding( 20.0f, 20.0f, 20.0f, 20.0f ) );
+
+ mPopup.Add( text );
// The popup is not yet on the stage so needs to be flaged as dirty
mPopup.MarkDirtyForRelayout();
mPopup = CreatePopup();
mPopup.SetTitle( "Popup!" );
- // FIXME - Add text
+ Toolkit::TextLabel text = Toolkit::TextLabel::New( CONTENT_TEXT );
+ text.SetName( "POPUP_CONTENT_TEXT" );
+ text.SetResizePolicy( FILL_TO_PARENT, WIDTH );
+ text.SetDimensionDependency( HEIGHT, WIDTH );
+ text.SetPadding( Padding( 20.0f, 20.0f, 20.0f, 20.0f ) );
+
+ mPopup.Add( text );
// The popup is not yet on the stage so needs to be flaged as dirty
mPopup.MarkDirtyForRelayout();
mPopup = CreatePopup();
mPopup.SetTitle( "Popup!" );
- // FIXME - Add text
+ Toolkit::TextLabel text = Toolkit::TextLabel::New( CONTENT_TEXT );
+ text.SetName( "POPUP_CONTENT_TEXT" );
+ text.SetResizePolicy( FILL_TO_PARENT, WIDTH );
+ text.SetDimensionDependency( HEIGHT, WIDTH );
+ text.SetPadding( Padding( 10.0f, 10.0f, 20.0f, 0.0f ) );
+
+ mPopup.Add( text );
Toolkit::PushButton cancelButton = Toolkit::PushButton::New();
cancelButton.SetName( CANCEL_BUTTON_ID );
// Text
{
- Toolkit::TextLabel text = Toolkit::TextLabel::New();
- // FIXME
+ Toolkit::TextLabel text = Toolkit::TextLabel::New( "Do you really want to quit?" );
+ text.SetResizePolicy( FILL_TO_PARENT, WIDTH );
+ text.SetDimensionDependency( HEIGHT, WIDTH );
content.AddChild( text, Toolkit::TableView::CellPosition( 0, 0 ) );
}
root.AddChild( checkBox, Toolkit::TableView::CellPosition( 0, 0 ) );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Don't show again" );
- // FIXME
Actor textActor = text;
textActor.SetPadding( Padding( 20.0f, 0.0f, 0.0f, 10.0f ) );
{
Dali::Toolkit::TextLabel label = Dali::Toolkit::TextLabel::New();
label.SetAnchorPoint( Dali::AnchorPoint::TOP_LEFT );
- label.SetSize( stage.GetSize().width, style.mToolBarHeight );
label.SetDrawMode( Dali::DrawMode::OVERLAY );
label.SetProperty( Dali::Toolkit::Control::Property::STYLE_NAME, "toolbarlabel" );
label.SetProperty( Dali::Toolkit::TextLabel::Property::TEXT, title );
label.SetProperty( Dali::Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
label.SetProperty( Dali::Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
+ label.SetResizePolicy( Dali::FILL_TO_PARENT, Dali::HEIGHT );
label.SetColor( DEFAULT_TEXT_STYLE_COLOR );
toolBarLayer.Add( label );
}
return contentLayer;
}
+Dali::Toolkit::TextLabel CreateToolBarLabel( const std::string& text )
+{
+ Dali::Toolkit::TextLabel label = Dali::Toolkit::TextLabel::New( text );
+ label.SetProperty( Dali::Toolkit::Control::Property::STYLE_NAME, "toolbarlabel" );
+ label.SetDrawMode( Dali::DrawMode::OVERLAY );
+ label.SetProperty( Dali::Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
+ label.SetProperty( Dali::Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
+ label.SetResizePolicy( Dali::FILL_TO_PARENT, Dali::HEIGHT );
+ label.SetColor( DEFAULT_TEXT_STYLE_COLOR );
+
+ return label;
+}
+
} // DemoHelper
#endif // __DALI_DEMO_HELPER_VIEW_H__