diff --git a/build/tizen/examples/Makefile.am b/build/tizen/examples/Makefile.am index 40e33dc..d4f45d7 100644 --- a/build/tizen/examples/Makefile.am +++ b/build/tizen/examples/Makefile.am @@ -34,8 +34,7 @@ bin_PROGRAMS = \ dali-builder \ builder.example \ image-scaling-irregular-grid.example \ - buttons.example \ - text-view.example + buttons.example daliimagedir = $(appdatadir)/images/ diff --git a/demo/dali-table-view.cpp b/demo/dali-table-view.cpp index 4f7176b..7a3123a 100644 --- a/demo/dali-table-view.cpp +++ b/demo/dali-table-view.cpp @@ -78,29 +78,13 @@ const float BACKGROUND_SIZE_SCALE = 2.0f; const Vector4 BACKGROUND_COLOR( 1.0f, 1.0f, 1.0f, 1.0f ); -const std::string DEFAULT_TEXT_STYLE_FONT_FAMILY("HelveticaNeue"); -const std::string DEFAULT_TEXT_STYLE_FONT_STYLE("Regular"); -const Dali::PointSize DEFAULT_TEXT_STYLE_POINT_SIZE( 8.0f ); -const Dali::TextStyle::Weight DEFAULT_TEXT_STYLE_WEIGHT(Dali::TextStyle::REGULAR); -const Dali::Vector4 DEFAULT_TEXT_STYLE_COLOR(0.7f, 0.7f, 0.7f, 1.0f); +//const std::string DEFAULT_TEXT_STYLE_FONT_FAMILY("HelveticaNeue"); +//const std::string DEFAULT_TEXT_STYLE_FONT_STYLE("Regular"); +//const Dali::Vector4 DEFAULT_TEXT_STYLE_COLOR(0.7f, 0.7f, 0.7f, 1.0f); -const std::string TABLE_TEXT_STYLE_FONT_FAMILY("HelveticaNeue"); -const std::string TABLE_TEXT_STYLE_FONT_STYLE("Regular"); -const Dali::PointSize TABLE_TEXT_STYLE_POINT_SIZE( 8.0f ); -const Dali::TextStyle::Weight TABLE_TEXT_STYLE_WEIGHT(Dali::TextStyle::LIGHT); -const Dali::Vector4 TABLE_TEXT_STYLE_COLOR(0.0f, 0.0f, 0.0f, 1.0f); - - -TextStyle GetTableTextStyle() -{ - TextStyle textStyle; - textStyle.SetFontName(TABLE_TEXT_STYLE_FONT_FAMILY); - textStyle.SetFontStyle(TABLE_TEXT_STYLE_FONT_STYLE); - textStyle.SetFontPointSize( Dali::PointSize(DemoHelper::ScalePointSize(TABLE_TEXT_STYLE_POINT_SIZE))); - textStyle.SetWeight(TABLE_TEXT_STYLE_WEIGHT); - textStyle.SetTextColor(TABLE_TEXT_STYLE_COLOR); - return textStyle; -} +//const std::string TABLE_TEXT_STYLE_FONT_FAMILY("HelveticaNeue"); +//const std::string TABLE_TEXT_STYLE_FONT_STYLE("Regular"); +//const Dali::Vector4 TABLE_TEXT_STYLE_COLOR(0.0f, 0.0f, 0.0f, 1.0f); /** * Creates the background image @@ -269,8 +253,7 @@ void DaliTableView::Initialize( Application& application ) Dali::Layer toolBarLayer = DemoHelper::CreateToolbar(toolbar, DEFAULT_TOOLBAR_IMAGE_PATH, DEFAULT_TOOLBAR_TEXT, - DemoHelper::DEFAULT_VIEW_STYLE, - DemoHelper::GetDefaultTextStyle()); + DemoHelper::DEFAULT_VIEW_STYLE); mRootActor.AddChild( toolBarLayer, TableView::CellPosition( 0, 0 ) ); mRootActor.SetFixedHeight( 0, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarHeight ); @@ -529,21 +512,6 @@ Actor DaliTableView::CreateTile( const std::string& name, const std::string& tit image.Add( stencil ); } - TextView text = TextView::New( title ); - text.SetAnchorPoint( AnchorPoint::CENTER ); - text.SetParentOrigin( ParentOrigin::CENTER ); - text.SetWidthExceedPolicy( Toolkit::TextView::ShrinkToFit ); - text.SetMultilinePolicy( Toolkit::TextView::SplitByWord ); - text.SetLineJustification( Toolkit::TextView::Center ); - text.SetTextAlignment( Toolkit::Alignment::Type( Alignment::HorizontalCenter | Alignment::VerticalCenter ) ); - text.SetColor( Color::WHITE ); - text.SetZ( 1 ); - // make the text 90% of tile - text.SetSize( 0.9f * parentSize.width, 0.9f * parentSize.height ); - text.SetStyleToCurrentText( GetTableTextStyle() ); - text.SetSnapshotModeEnabled( false ); - content.Add( text ); - // Set the tile to be keyboard focusable tile.SetKeyboardFocusable(true); diff --git a/examples/builder/examples.cpp b/examples/builder/examples.cpp index 1f98958..9bb3319 100644 --- a/examples/builder/examples.cpp +++ b/examples/builder/examples.cpp @@ -242,17 +242,7 @@ public: void SetTitle(const std::string& title) { - if(!mTitleActor) - { - mTitleActor = TextView::New(); - // Add title to the tool bar. - mToolBar.AddControl( mTitleActor, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarTitlePercentage, Alignment::HorizontalCenter ); - } - - Font font = Font::New(); - mTitleActor.SetText( title ); - mTitleActor.SetSize( font.MeasureText( title ) ); - mTitleActor.SetStyleToCurrentText(DemoHelper::GetDefaultTextStyle()); + // TODO } bool OnToolSelectLayout( Toolkit::Button button ) @@ -402,18 +392,7 @@ public: Actor MenuItem(const std::string& text) { - TextView t = TextView::New(); - t.SetMarkupProcessingEnabled(true); - - int size = static_cast(DemoHelper::ScalePointSize(6)); - - std::ostringstream fontString; - fontString << ""<< ShortName( text ) << ""; - - t.SetText( fontString.str() ); - - t.SetTextAlignment( Alignment::HorizontalLeft ); - return t; + return Actor(); } bool OnTimer() @@ -604,7 +583,6 @@ private: unsigned int mOrientation; Toolkit::ToolBar mToolBar; - TextView mTitleActor; ///< The Toolbar's Title. Layer mBuilderLayer; diff --git a/examples/buttons/buttons-example.cpp b/examples/buttons/buttons-example.cpp index bbdeab1..11c19b0 100644 --- a/examples/buttons/buttons-example.cpp +++ b/examples/buttons/buttons-example.cpp @@ -234,11 +234,6 @@ class ButtonsController: public ConnectionTracker Toolkit::TableView tableView = Toolkit::TableView::New( 1, 2 ); tableView.SetSize( DP(260), DP(RADIO_LABEL_THUMBNAIL_SIZE) ); - Toolkit::TextView textView = Toolkit::TextView::New( "Select enabled" ); - Toolkit::Alignment alignment = Toolkit::Alignment::New( Toolkit::Alignment::HorizontalLeft ); - alignment.Add( textView ); - tableView.AddChild( alignment, Toolkit::TableView::CellPosition( 0, 0 ) ); - ImageActor imageActor = ImageActor::New( Image::New( ENABLED_IMAGE ) ); imageActor.SetSize( DP(RADIO_LABEL_THUMBNAIL_SIZE), DP(RADIO_LABEL_THUMBNAIL_SIZE) ); tableView.AddChild( imageActor, Toolkit::TableView::CellPosition( 0, 1 ) ); @@ -298,13 +293,6 @@ class ButtonsController: public ConnectionTracker checkBoxBackground.Add( checkBox ); } - mCheckBox1State = Toolkit::TextView::New( "CheckBox1 is unchecked" ); - - mCheckBox1State.SetAnchorPoint( AnchorPoint::TOP_LEFT ); - mCheckBox1State.SetPosition( DP(80), DP(checkYPos) ); - - checkBoxBackground.Add( mCheckBox1State ); - checkYPos += 60; { @@ -321,13 +309,6 @@ class ButtonsController: public ConnectionTracker checkBoxBackground.Add( checkBox ); } - mCheckBox2State = Toolkit::TextView::New( "CheckBox2 is checked" ); - mCheckBox2State.SetParentOrigin( ParentOrigin::TOP_LEFT ); - mCheckBox2State.SetAnchorPoint( AnchorPoint::TOP_LEFT ); - mCheckBox2State.SetPosition( DP(80), DP(checkYPos) ); - - checkBoxBackground.Add( mCheckBox2State ); - checkYPos += 60; { @@ -343,13 +324,6 @@ class ButtonsController: public ConnectionTracker checkBoxBackground.Add( checkBox ); } - mCheckBox3State = Toolkit::TextView::New( "CheckBox3 is unchecked" ); - - mCheckBox3State.SetAnchorPoint( AnchorPoint::TOP_LEFT ); - mCheckBox3State.SetPosition( DP(80), DP(checkYPos) ); - - checkBoxBackground.Add( mCheckBox3State ); - // Create toggle button yPos += GROUP3_HEIGHT + MARGIN_SIZE; @@ -440,42 +414,6 @@ class ButtonsController: public ConnectionTracker bool OnCheckBoxesToggled( Toolkit::Button button, bool state ) { - if( button.GetName() == "checkbox1" ) - { - if( state ) - { - mCheckBox1State.SetText("CheckBox1 is checked"); - } - else - { - mCheckBox1State.SetText("CheckBox1 is unchecked"); - } - } - - if( button.GetName() == "checkbox2" ) - { - if( state ) - { - mCheckBox2State.SetText("CheckBox2 is checked"); - } - else - { - mCheckBox2State.SetText("CheckBox2 is unchecked"); - } - } - - if( button.GetName() == "checkbox3" ) - { - if( state ) - { - mCheckBox3State.SetText("CheckBox3 is checked"); - } - else - { - mCheckBox3State.SetText("CheckBox3 is unchecked"); - } - } - return true; } @@ -496,10 +434,6 @@ class ButtonsController: public ConnectionTracker Image mBigImage2; Image mBigImage3; ImageActor mImage; - - Toolkit::TextView mCheckBox1State; - Toolkit::TextView mCheckBox2State; - Toolkit::TextView mCheckBox3State; }; void RunTest( Application& application ) diff --git a/examples/cluster/cluster-example.cpp b/examples/cluster/cluster-example.cpp index 6af3c8d..beb2957 100644 --- a/examples/cluster/cluster-example.cpp +++ b/examples/cluster/cluster-example.cpp @@ -873,17 +873,7 @@ public: */ void SetTitle(const std::string& title) { - if(!mTitleActor) - { - mTitleActor = TextView::New(); - // Add title to the tool bar. - mToolBar.AddControl( mTitleActor, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarTitlePercentage, Alignment::HorizontalCenter ); - } - - Font font = Font::New(); - mTitleActor.SetText( title ); - mTitleActor.SetSize( font.MeasureText( title ) ); - mTitleActor.SetStyleToCurrentText(DemoHelper::GetDefaultTextStyle()); + // TODO } /** @@ -905,7 +895,6 @@ private: Application& mApplication; ///< Application instance Toolkit::View mView; ///< The View instance. Toolkit::ToolBar mToolBar; ///< The View's Toolbar. - TextView mTitleActor; ///< The Toolbar's Title. Layer mContentLayer; ///< Content layer (scrolling cluster content) diff --git a/examples/hello-world/hello-world-example.cpp b/examples/hello-world/hello-world-example.cpp index f018779..1994698 100644 --- a/examples/hello-world/hello-world-example.cpp +++ b/examples/hello-world/hello-world-example.cpp @@ -42,22 +42,7 @@ public: // The Init signal is received once (only) during the Application lifetime void Create( Application& application ) { - std::cout << "HelloWorldController::Create" << std::endl; - - // Initialize the actor - TextActor textActor = TextActor::New( "Hello World" ); - - // Reposition the actor - textActor.SetParentOrigin( ParentOrigin::CENTER ); - - // Get a handle to the stage - Stage stage = Stage::GetCurrent(); - - // Display the actor on the stage - stage.Add( textActor ); - - // Respond to a click anywhere on the stage - stage.GetRootLayer().TouchedSignal().Connect( this, &HelloWorldController::OnTouch ); + // TODO } bool OnTouch( Actor actor, const TouchEvent& touch ) diff --git a/examples/image/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp b/examples/image/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp index 13e4c26..c653bcc 100644 --- a/examples/image/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp +++ b/examples/image/image-scaling-irregular-grid/image-scaling-irregular-grid-example.cpp @@ -531,17 +531,7 @@ public: */ void SetTitle(const std::string& title) { - if(!mTitleActor) - { - mTitleActor = TextView::New(); - // Add title to the tool bar. - mToolBar.AddControl( mTitleActor, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarTitlePercentage, Alignment::HorizontalCenter ); - } - - Font font = Font::New(); - mTitleActor.SetText( title ); - mTitleActor.SetSize( font.MeasureText( title ) ); - mTitleActor.SetStyleToCurrentText(DemoHelper::GetDefaultTextStyle()); + // TODO } /** @@ -570,7 +560,6 @@ private: Layer mContentLayer; ///< The content layer (contains non gui chrome actors) Toolkit::View mView; ///< The View instance. Toolkit::ToolBar mToolBar; ///< The View's Toolbar. - TextView 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) diff --git a/examples/item-view/item-view-example.cpp b/examples/item-view/item-view-example.cpp index b006c5f..6e1b4c2 100644 --- a/examples/item-view/item-view-example.cpp +++ b/examples/item-view/item-view-example.cpp @@ -105,9 +105,9 @@ AlphaFunction ALPHA_FUNCTIONS[] = { AlphaFunctions::Linear, 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" ); @@ -156,11 +156,9 @@ const float BUTTON_BORDER = -10.0f; 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 PointSize DEFAULT_TEXT_STYLE_POINT_SIZE( 5.0f ); -const TextStyle::Weight DEFAULT_TEXT_STYLE_WEIGHT(Dali::TextStyle::MEDIUM); -const Vector4 DEFAULT_TEXT_STYLE_COLOR(1.0f, 1.0f, 1.0f, 1.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 ); @@ -951,17 +949,7 @@ private: */ void SetTitle(const std::string& title) { - if(!mTitleActor) - { - mTitleActor = TextView::New(); - // Add title to the tool bar. - mToolBar.AddControl( mTitleActor, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarTitlePercentage, Alignment::HorizontalCenter ); - } - - Font font = Font::New(); - mTitleActor.SetText( title ); - mTitleActor.SetSize( font.MeasureText( title ) ); - mTitleActor.SetStyleToCurrentText(DemoHelper::GetDefaultTextStyle()); + // TODO } void ShowMenu() @@ -990,45 +978,6 @@ private: tableView.AddChild( slider, TableView::CellPosition( 0, 0 ) ); tableView.SetRelativeHeight( 0, 0.5f ); - TextStyle defaultTextStyle; - defaultTextStyle.SetFontName(DEFAULT_TEXT_STYLE_FONT_FAMILY); - defaultTextStyle.SetFontStyle(DEFAULT_TEXT_STYLE_FONT_STYLE); - defaultTextStyle.SetFontPointSize(DEFAULT_TEXT_STYLE_POINT_SIZE); - defaultTextStyle.SetWeight(DEFAULT_TEXT_STYLE_WEIGHT); - defaultTextStyle.SetTextColor(DEFAULT_TEXT_STYLE_COLOR); - - TextView text = TextView::New( "Duration" ); - text.SetAnchorPoint( ParentOrigin::TOP_LEFT ); - text.SetParentOrigin( ParentOrigin::TOP_LEFT ); - text.SetTextAlignment( Dali::Toolkit::Alignment::HorizontalLeft ); - text.SetStyleToCurrentText( defaultTextStyle ); - text.SetSize( 0.0f, LABEL_TEXT_SIZE_Y ); - text.ApplyConstraint( Dali::Constraint::New( Dali::Actor::SIZE_WIDTH, Dali::ParentSource( Dali::Actor::SIZE_WIDTH ), Dali::EqualToConstraint() ) ); - text.SetZ( -0.9f ); - slider.Add( text ); - - Actor textContainer = Actor::New(); - mAlphaFunctionText = TextView::New( ALPHA_FUNCTIONS_TEXT[mAlphaFuncIndex] ); - mAlphaFunctionText.SetAnchorPoint( ParentOrigin::CENTER ); - mAlphaFunctionText.SetParentOrigin( ParentOrigin::CENTER ); - mAlphaFunctionText.SetTextAlignment( Toolkit::Alignment::VerticalCenter ); - textContainer.Add( mAlphaFunctionText ); - tableView.AddChild( textContainer, TableView::CellPosition( 1, 0 ) ); - tableView.SetRelativeHeight( 0, 0.5f ); - - mTapDetector = TapGestureDetector::New(); - mTapDetector.Attach(mAlphaFunctionText); - mTapDetector.DetectedSignal().Connect( this, &ItemViewExample::ChangeAlphaFunctionOnTap ); - - text = TextView::New( "Alpha Function" ); - text.SetAnchorPoint( ParentOrigin::TOP_LEFT ); - text.SetParentOrigin( ParentOrigin::TOP_LEFT ); - text.SetTextAlignment( Dali::Toolkit::Alignment::HorizontalLeft ); - text.SetStyleToCurrentText( defaultTextStyle ); - text.SetSize( 0.0f, LABEL_TEXT_SIZE_Y ); - text.ApplyConstraint( Dali::Constraint::New( Dali::Actor::SIZE_WIDTH, Dali::ParentSource( Dali::Actor::SIZE_WIDTH ), Dali::EqualToConstraint() ) ); - textContainer.Add( text ); - mMenu.Show(); mMenuShown = true; } @@ -1047,11 +996,6 @@ private: mAlphaFuncIndex = 0; } - if( mAlphaFunctionText ) - { - mAlphaFunctionText.SetText( ALPHA_FUNCTIONS_TEXT[mAlphaFuncIndex] ); - } - if( mItemView ) { mItemView.GetActiveLayout()->SetAlphaFunction( ALPHA_FUNCTIONS[mAlphaFuncIndex] ); @@ -1113,7 +1057,6 @@ private: unsigned int mOrientation; Toolkit::ToolBar mToolBar; - TextView mTitleActor; ///< The Toolbar's Title. ItemView mItemView; Image mBorderImage; @@ -1133,7 +1076,6 @@ private: Toolkit::PushButton mReplaceButton; unsigned int mAlphaFuncIndex; - TextView mAlphaFunctionText; BitmapImage mWhiteImage; }; diff --git a/examples/motion/motion-blur-example.cpp b/examples/motion/motion-blur-example.cpp index 4100f44..6cfec92 100644 --- a/examples/motion/motion-blur-example.cpp +++ b/examples/motion/motion-blur-example.cpp @@ -487,7 +487,6 @@ private: Application& mApplication; ///< Application instance Toolkit::View mView; Toolkit::ToolBar mToolBar; - TextView mTitleActor; ///< The Toolbar's Title. Image mIconEffectsOff; Image mIconEffectsOn; diff --git a/examples/motion/motion-stretch-example.cpp b/examples/motion/motion-stretch-example.cpp index db224ae..bd88490 100644 --- a/examples/motion/motion-stretch-example.cpp +++ b/examples/motion/motion-stretch-example.cpp @@ -399,7 +399,6 @@ private: Application& mApplication; ///< Application instance Toolkit::View mView; Toolkit::ToolBar mToolBar; - TextView mTitleActor; ///< The Toolbar's Title. Image mIconEffectsOff; Image mIconEffectsOn; Layer mContentLayer; ///< Content layer (contains actor for this stretch demo) diff --git a/examples/new-window/new-window-example.cpp b/examples/new-window/new-window-example.cpp index 14445ac..d99c4ec 100644 --- a/examples/new-window/new-window-example.cpp +++ b/examples/new-window/new-window-example.cpp @@ -83,7 +83,6 @@ private: Animation mModelAnimation; Actor mModelActor; Actor mCastingLight; - TextActor mTextActor; ImageActor mImageActor; ImageActor mBlendActor; Image mEffectImage; @@ -95,7 +94,6 @@ private: Toolkit::View mView; ///< The View instance. Toolkit::ToolBar mToolBar; ///< The View's Toolbar. - TextView mTitleActor; ///< The Toolbar's Title. Layer mContentLayer; ///< Content layer (scrolling cluster content) Toolkit::PushButton mLoseContextButton; Vector3 mHSVDelta; @@ -182,7 +180,6 @@ void NewWindowController::Create( Application& app ) void NewWindowController::Destroy( Application& app ) { - UnparentAndReset(mTextActor); } bool NewWindowController::OnLoseContextButtonClicked( Toolkit::Button button ) @@ -387,11 +384,7 @@ void NewWindowController::CreateBlending() void NewWindowController::CreateText() { - mTextActor = TextActor::New("Some text"); - mTextActor.SetParentOrigin(ParentOrigin::CENTER); - mTextActor.SetColor(Color::RED); - mTextActor.SetName("PushMe text"); - mContentLayer.Add( mTextActor ); + // TODO } Mesh NewWindowController::CreateMesh(bool hasColor, Material material) diff --git a/examples/scroll-view/scroll-view-example.cpp b/examples/scroll-view/scroll-view-example.cpp index fce13f8..fe13444 100644 --- a/examples/scroll-view/scroll-view-example.cpp +++ b/examples/scroll-view/scroll-view-example.cpp @@ -669,17 +669,6 @@ private: */ void SetTitle(const std::string& title) { - if(!mTitleActor) - { - mTitleActor = TextView::New(); - // Add title to the tool bar. - mToolBar.AddControl( mTitleActor, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarTitlePercentage, Alignment::HorizontalCenter ); - } - - Font font = Font::New(); - mTitleActor.SetText( title ); - mTitleActor.SetSize( font.MeasureText( title ) ); - mTitleActor.SetStyleToCurrentText(DemoHelper::GetDefaultTextStyle()); } /** @@ -701,7 +690,6 @@ private: Application& mApplication; ///< Application instance Toolkit::View mView; ///< The View instance. Toolkit::ToolBar mToolBar; ///< The View's Toolbar. - TextView 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) diff --git a/examples/shader-effect/dissolve-effect-example.cpp b/examples/shader-effect/dissolve-effect-example.cpp index 327c08c..7373a6f 100644 --- a/examples/shader-effect/dissolve-effect-example.cpp +++ b/examples/shader-effect/dissolve-effect-example.cpp @@ -138,7 +138,6 @@ private: Toolkit::View mView; Toolkit::ToolBar mToolBar; Layer mContent; - Toolkit::TextView mTitleActor; ImageActor mCurrentImage; ImageActor mNextImage; @@ -200,10 +199,7 @@ void DissolveEffectApp::OnInit( Application& application ) mToolBar.AddControl( mEffectChangeButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); // Add title to the tool bar. - mTitleActor = Toolkit::TextView::New(); - mTitleActor.SetText( APPLICATION_TITLE_HIGHP ); - mTitleActor.SetStyleToCurrentText(DemoHelper::GetDefaultTextStyle()); - mToolBar.AddControl( mTitleActor, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarTitlePercentage, Toolkit::Alignment::HorizontalCenter ); + // TODO // Add an slide-show button on the right of the title mIconPlay = Image::New( PLAY_ICON ); @@ -313,15 +309,12 @@ bool DissolveEffectApp::OnEffectButtonClicked( Toolkit::Button button ) mCurrentImageEffect = Toolkit::DissolveEffect::New(mUseHighPrecision); if(mUseHighPrecision) { - mTitleActor.SetText( APPLICATION_TITLE_HIGHP ); mEffectChangeButton.SetBackgroundImage(mIconHighP); } else { - mTitleActor.SetText( APPLICATION_TITLE_MEDIUMP ); mEffectChangeButton.SetBackgroundImage(mIconMediumP); } - mTitleActor.SetStyleToCurrentText(DemoHelper::GetDefaultTextStyle()); return true; } diff --git a/examples/shadows/shadow-bone-lighting-example.cpp b/examples/shadows/shadow-bone-lighting-example.cpp index 1246be2..094821f 100644 --- a/examples/shadows/shadow-bone-lighting-example.cpp +++ b/examples/shadows/shadow-bone-lighting-example.cpp @@ -34,10 +34,10 @@ const char* gBinaryModelFile = DALI_MODEL_DIR "AlbumCute.dali-bin"; 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" ); @@ -155,13 +155,7 @@ public: toolBar.AddControl( effectChangeButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight, DemoHelper::DEFAULT_MODE_SWITCH_PADDING ); // Add title to the tool bar. - mTitleActor = Toolkit::TextView::New(); - toolBar.AddControl( mTitleActor, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarTitlePercentage, Toolkit::Alignment::HorizontalCenter ); - - // Set Title text - mTitleActor.SetText( APPLICATION_TITLE_PAN_SCENE ); - mTitleActor.SetSize( Font::New().MeasureText( APPLICATION_TITLE_PAN_SCENE ) ); - mTitleActor.SetStyleToCurrentText( DemoHelper::GetDefaultTextStyle() ); + // TODO //Add a reset button Image resetImage = Image::New( RESET_ICON ); @@ -264,20 +258,9 @@ public: mCastingLight.SetAnchorPoint(AnchorPoint::CENTER); mCastingLight.SetPosition( Vector3( 0.0f, 0.0f, 800.0f ) * scaleFactor ); - TextStyle style; - style.SetFontPointSize( PointSize(DemoHelper::ScalePointSize(20.0f)) ); - style.SetFontName("Times New Roman"); - style.SetFontStyle("Book"); - - TextActorParameters parameters( style, TextActorParameters::FONT_DETECTION_ON ); - TextActor text = TextActor::New("Light", parameters); - text.SetColor(Color::BLUE); - - mCastingLight.Add(text); mLightAnchor.Add(mCastingLight); mShadowPlaneBg.Add(mLightAnchor); - text.SetParentOrigin(ParentOrigin::CENTER); mShadowView.SetPointLight(mCastingLight); } @@ -436,34 +419,6 @@ public: bool OnEffectButtonClicked( Toolkit::Button button ) { - switch(mPanState) - { - case PAN_SCENE: - mPanState = ROTATE_SCENE; - mTitleActor.SetText( APPLICATION_TITLE_ROTATE_SCENE ); - mTitleActor.SetSize( Font::New().MeasureText( APPLICATION_TITLE_ROTATE_SCENE ) ); - break; - case ROTATE_SCENE: - mPanState = PAN_LIGHT; - mTitleActor.SetText( APPLICATION_TITLE_PAN_LIGHT ); - mTitleActor.SetSize( Font::New().MeasureText( APPLICATION_TITLE_PAN_LIGHT ) ); - break; - case PAN_LIGHT: - mPanState = PAN_OBJECT; - mTitleActor.SetText( APPLICATION_TITLE_PAN_OBJECT ); - mTitleActor.SetSize( Font::New().MeasureText( APPLICATION_TITLE_PAN_OBJECT ) ); - break; - case PAN_OBJECT: - mPanState = PAN_SCENE; - mTitleActor.SetText( APPLICATION_TITLE_PAN_SCENE ); - mTitleActor.SetSize( Font::New().MeasureText( APPLICATION_TITLE_PAN_SCENE ) ); - break; - default: - break; - } - - mTitleActor.SetStyleToCurrentText(DemoHelper::GetDefaultTextStyle()); - return true; } @@ -509,8 +464,6 @@ private: float mPinchScale; float mScaleAtPinchStart; - Toolkit::TextView mTitleActor; - enum PanState { PAN_SCENE, diff --git a/examples/shared/view.h b/examples/shared/view.h index ab9f20c..7bf7076 100644 --- a/examples/shared/view.h +++ b/examples/shared/view.h @@ -45,16 +45,11 @@ const ViewStyle DEFAULT_VIEW_STYLE( 0.1f, 0.7f, 80.f, 4.f ); const char* DEFAULT_TEXT_STYLE_FONT_FAMILY("HelveticaNue"); const char* DEFAULT_TEXT_STYLE_FONT_STYLE("Regular"); -const Dali::PointSize DEFAULT_TEXT_STYLE_POINT_SIZE( 8.0f ); -const Dali::TextStyle::Weight DEFAULT_TEXT_STYLE_WEIGHT(Dali::TextStyle::EXTRALIGHT); const Dali::Vector4 DEFAULT_TEXT_STYLE_COLOR(0.0f, 0.0f, 0.0f, 1.0f); const Dali::Toolkit::Alignment::Padding DEFAULT_PLAY_PADDING(12.0f, 12.0f, 12.0f, 12.0f); const Dali::Toolkit::Alignment::Padding DEFAULT_MODE_SWITCH_PADDING(8.0f, 8.0f, 8.0f, 8.0f); -static Dali::TextStyle defaultTextStyle; -static bool textStyleSet=false; - float ScalePointSize(int pointSize) { Dali::Vector2 dpi = Dali::Stage::GetCurrent().GetDpi(); @@ -62,26 +57,10 @@ float ScalePointSize(int pointSize) return pointSize * 220.0f / meanDpi; // 220 is the default horizontal DPI defined in adaptor Application } -Dali::TextStyle& GetDefaultTextStyle() -{ - if(!textStyleSet) - { - defaultTextStyle.SetFontName(DEFAULT_TEXT_STYLE_FONT_FAMILY); - defaultTextStyle.SetFontStyle(DEFAULT_TEXT_STYLE_FONT_STYLE); - defaultTextStyle.SetFontPointSize(Dali::PointSize(ScalePointSize(DEFAULT_TEXT_STYLE_POINT_SIZE))); - defaultTextStyle.SetWeight(DEFAULT_TEXT_STYLE_WEIGHT); - defaultTextStyle.SetTextColor(DEFAULT_TEXT_STYLE_COLOR); - textStyleSet = true; - } - - return defaultTextStyle; -} - Dali::Layer CreateToolbar( Dali::Toolkit::ToolBar& toolBar, const std::string& toolbarImagePath, const std::string& title, - const ViewStyle& style, - const Dali::TextStyle& textStyle ) + const ViewStyle& style ) { Dali::Layer toolBarLayer = Dali::Layer::New(); toolBarLayer.SetAnchorPoint( Dali::AnchorPoint::TOP_CENTER ); @@ -106,20 +85,10 @@ Dali::Layer CreateToolbar( Dali::Toolkit::ToolBar& toolBar, // Add the tool bar to the too bar layer. toolBarLayer.Add( toolBar ); - Dali::Font font = Dali::Font::New(); - // Tool bar text. if( !title.empty() ) { - Dali::Toolkit::TextView titleActor = Dali::Toolkit::TextView::New(); - titleActor.SetName( "ToolbarTitle" ); - titleActor.SetText( title ); - titleActor.SetSize( font.MeasureText( title ) ); - titleActor.SetStyleToCurrentText(textStyle); - - // Add title to the tool bar. - const float padding( style.mToolBarPadding ); - toolBar.AddControl( titleActor, style.mToolBarTitlePercentage, Dali::Toolkit::Alignment::HorizontalCenter, Dali::Toolkit::Alignment::Padding( padding, padding, padding, padding ) ); + // TODO } return toolBarLayer; @@ -131,8 +100,7 @@ Dali::Layer CreateView( Dali::Application& application, const std::string& backgroundImagePath, const std::string& toolbarImagePath, const std::string& title, - const ViewStyle& style, - const Dali::TextStyle& textStyle ) + const ViewStyle& style = DEFAULT_VIEW_STYLE ) { Dali::Stage stage = Dali::Stage::GetCurrent(); @@ -155,7 +123,7 @@ Dali::Layer CreateView( Dali::Application& application, //application.GetOrientation().ChangedSignal().Connect( &view, &Dali::Toolkit::View::OrientationChanged ); // Create default ToolBar - Dali::Layer toolBarLayer = CreateToolbar( toolBar, toolbarImagePath, title, style, textStyle ); + Dali::Layer toolBarLayer = CreateToolbar( toolBar, toolbarImagePath, title, style ); // Add tool bar layer to the view. view.AddContentLayer( toolBarLayer ); @@ -173,19 +141,6 @@ Dali::Layer CreateView( Dali::Application& application, return contentLayer; } -Dali::Layer CreateView( Dali::Application& application, - Dali::Toolkit::View& view, - Dali::Toolkit::ToolBar& toolBar, - const std::string& backgroundImagePath, - const std::string& toolbarImagePath, - const std::string& title, - const ViewStyle& style = DEFAULT_VIEW_STYLE ) -{ - return CreateView( application, view, toolBar, backgroundImagePath, toolbarImagePath, title, style, - GetDefaultTextStyle() ); -} - - } // DemoHelper #endif // __DALI_DEMO_HELPER_VIEW_H__ diff --git a/examples/transition/cube-transition-effect-example.cpp b/examples/transition/cube-transition-effect-example.cpp index bd0d0a7..abcb394 100644 --- a/examples/transition/cube-transition-effect-example.cpp +++ b/examples/transition/cube-transition-effect-example.cpp @@ -154,7 +154,6 @@ private: Toolkit::View mView; Toolkit::ToolBar mToolBar; Layer mContent; - Toolkit::TextView mTitleActor; Actor mParent; Vector2 mViewSize; @@ -217,10 +216,6 @@ void CubeTransitionApp::OnInit( Application& application ) 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 = Toolkit::TextView::New(); - mToolBar.AddControl( mTitleActor, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarTitlePercentage, Toolkit::Alignment::HorizontalCenter ); - //Add an slideshow icon on the right of the title mIconSlideshowStart = Image::New( SLIDE_SHOW_START_ICON ); mIconSlideshowStop = Image::New( SLIDE_SHOW_STOP_ICON ); @@ -273,11 +268,6 @@ void CubeTransitionApp::OnInit( Application& application ) mCurrentEffect = mCubeWaveEffect; mCurrentEffect.SetCurrentImage( mCurrentImage ); - - // Set Title text - mTitleActor.SetText( APPLICATION_TITLE_WAVE ); - mTitleActor.SetSize( Font::New().MeasureText( APPLICATION_TITLE_WAVE ) ); - mTitleActor.SetStyleToCurrentText( DemoHelper::GetDefaultTextStyle() ); } // signal handler, called when the pan gesture is detected @@ -338,26 +328,19 @@ bool CubeTransitionApp::OnEffectButtonClicked( Toolkit::Button button ) if(mCurrentEffect == mCubeWaveEffect) { mCurrentEffect = mCubeCrossEffect; - mTitleActor.SetText( APPLICATION_TITLE_CROSS ); - mTitleActor.SetSize( Font::New().MeasureText( APPLICATION_TITLE_CROSS ) ); mEffectChangeButton.SetBackgroundImage(mImageCross); } else if(mCurrentEffect == mCubeCrossEffect) { mCurrentEffect = mCubeFoldEffect; - mTitleActor.SetText( APPLICATION_TITLE_FOLD ); - mTitleActor.SetSize( Font::New().MeasureText( APPLICATION_TITLE_FOLD ) ); mEffectChangeButton.SetBackgroundImage(mImageFold); } else { mCurrentEffect = mCubeWaveEffect; - mTitleActor.SetText( APPLICATION_TITLE_WAVE ); - mTitleActor.SetSize( Font::New().MeasureText( APPLICATION_TITLE_WAVE ) ); mEffectChangeButton.SetBackgroundImage(mImageWave); } - mTitleActor.SetStyleToCurrentText(DemoHelper::GetDefaultTextStyle()); // Set the current image to cube transition effect // only need to set at beginning or change from another effect