bool CubeTransitionApp::OnEffectButtonClicked( Toolkit::Button button ) { mContent.Remove( mCurrentEffect ); if(mCurrentEffect == mCubeWaveEffect) { mCurrentEffect = mCubeCrossEffect; mTitle.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_CROSS) ); mEffectChangeButton.SetUnselectedImage( EFFECT_CROSS_IMAGE ); mEffectChangeButton.SetSelectedImage( EFFECT_CROSS_IMAGE_SELECTED ); } else if(mCurrentEffect == mCubeCrossEffect) { mCurrentEffect = mCubeFoldEffect; mTitle.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_FOLD) ); mEffectChangeButton.SetUnselectedImage( EFFECT_FOLD_IMAGE ); mEffectChangeButton.SetSelectedImage( EFFECT_FOLD_IMAGE_SELECTED ); } else { mCurrentEffect = mCubeWaveEffect; mTitle.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_WAVE) ); mEffectChangeButton.SetUnselectedImage( EFFECT_WAVE_IMAGE ); mEffectChangeButton.SetSelectedImage( EFFECT_WAVE_IMAGE_SELECTED ); } mContent.Add( mCurrentEffect ); // Set the current image to cube transition effect // only need to set at beginning or change from another effect mCurrentEffect.SetCurrentImage( mCurrentImage ); return true; }
bool DissolveEffectApp::OnEffectButtonClicked( Toolkit::Button button ) { mUseHighPrecision = !mUseHighPrecision; mDissolveEffect = Dali::Toolkit::CreateDissolveEffect(mUseHighPrecision); if(mUseHighPrecision) { mTitleActor.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_HIGHP) ); mEffectChangeButton.SetProperty( Toolkit::Button::Property::UNSELECTED_STATE_IMAGE, EFFECT_HIGHP_IMAGE ); mEffectChangeButton.SetProperty( Toolkit::Button::Property::SELECTED_STATE_IMAGE, EFFECT_HIGHP_IMAGE_SELECTED ); } else { mTitleActor.SetProperty( TextLabel::Property::TEXT, std::string(APPLICATION_TITLE_MEDIUMP) ); mEffectChangeButton.SetProperty( Toolkit::Button::Property::UNSELECTED_STATE_IMAGE, EFFECT_MEDIUMP_IMAGE ); mEffectChangeButton.SetProperty( Toolkit::Button::Property::SELECTED_STATE_IMAGE, EFFECT_MEDIUMP_IMAGE_SELECTED ); } return true; }
void EffectsViewApp::SetTitle(int effectSize) { std::ostringstream title; title<<TITLE<< effectSize; if(!mTitleActor) { mTitleActor = DemoHelper::CreateToolBarLabel( title.str() ); // Add title to the tool bar. mToolBar.AddControl( mTitleActor, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarTitlePercentage, Toolkit::Alignment::HorizontalCenter ); } mTitleActor.SetProperty( Toolkit::TextLabel::Property::TEXT, title.str() ); }