- if( button.GetName() == POPUP_BUTTON_EMPTY_ID )
- {
- mPopup = CreatePopup();
-
- // The popup is not yet on the stage so needs to be flaged as dirty
- mPopup.MarkDirtyForRelayout();
-
- mPopup.Show();
- }
- else if( button.GetName() == POPUP_BUTTON_TITLE_ID )
- {
- mPopup = CreatePopup();
- mPopup.SetTitle( "Popup!" );
-
- // The popup is not yet on the stage so needs to be flaged as dirty
- mPopup.MarkDirtyForRelayout();
-
- mPopup.Show();
- }
- else if( button.GetName() == POPUP_BUTTON_BUTTONS_1_ID )
- {
- mPopup = CreatePopup();
-
- Toolkit::PushButton okayButton = Toolkit::PushButton::New();
- okayButton.SetName( OKAY_BUTTON_ID );
- okayButton.SetLabel( "OK!" );
- okayButton.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) );
- okayButton.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) );
-
- okayButton.ClickedSignal().Connect( this, &SizeNegotiationController::OnButtonClicked );
-
- mPopup.AddButton( okayButton );
-
- // The popup is not yet on the stage so needs to be flaged as dirty
- mPopup.MarkDirtyForRelayout();
-
- mPopup.Show();
- }
- else if( button.GetName() == POPUP_BUTTON_BUTTONS_2_ID )
- {
- mPopup = CreatePopup();
-
- Toolkit::PushButton cancelButton = Toolkit::PushButton::New();
- cancelButton.SetName( CANCEL_BUTTON_ID );
- cancelButton.SetLabel( "Cancel" );
- cancelButton.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) );
- cancelButton.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) );
-
- cancelButton.ClickedSignal().Connect( this, &SizeNegotiationController::OnButtonClicked );
-
- mPopup.AddButton( cancelButton );
-
- Toolkit::PushButton okayButton = Toolkit::PushButton::New();
- okayButton.SetName( OKAY_BUTTON_ID );
- okayButton.SetLabel( "OK!" );
- okayButton.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) );
- okayButton.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) );
-
- okayButton.ClickedSignal().Connect( this, &SizeNegotiationController::OnButtonClicked );
-
- mPopup.AddButton( okayButton );
-
- // The popup is not yet on the stage so needs to be flaged as dirty
- mPopup.MarkDirtyForRelayout();
-
- mPopup.Show();
- }
- else if( button.GetName() == POPUP_BUTTON_TITLE_BUTTONS_ID )
- {
- mPopup = CreatePopup();
- mPopup.SetTitle( "Popup!" );
-
- Toolkit::PushButton cancelButton = Toolkit::PushButton::New();
- cancelButton.SetName( CANCEL_BUTTON_ID );
- cancelButton.SetLabel( "Cancel" );
- cancelButton.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) );
- cancelButton.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) );
-
- cancelButton.ClickedSignal().Connect( this, &SizeNegotiationController::OnButtonClicked );
-
- mPopup.AddButton( cancelButton );
-
- Toolkit::PushButton okayButton = Toolkit::PushButton::New();
- okayButton.SetName( OKAY_BUTTON_ID );
- okayButton.SetLabel( "OK!" );
- okayButton.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) );
- okayButton.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) );
-
- okayButton.ClickedSignal().Connect( this, &SizeNegotiationController::OnButtonClicked );
-
- mPopup.AddButton( okayButton );
-
- // The popup is not yet on the stage so needs to be flaged as dirty
- mPopup.MarkDirtyForRelayout();
-
- mPopup.Show();
- }
- else if( button.GetName() == POPUP_BUTTON_CONTENT_TEXT_ID )
- {
- mPopup = CreatePopup();
-
- 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.Show();
- }
- else if( button.GetName() == POPUP_BUTTON_CONTENT_IMAGE_ID )
- {
- mPopup = CreatePopup();
-
- ImageActor image = ImageActor::New( ResourceImage::New( IMAGE2 ) );
- image.SetResizePolicy( FILL_TO_PARENT, WIDTH );
- image.SetDimensionDependency( HEIGHT, WIDTH );
- image.SetPadding( Padding( 20.0f, 20.0f, 20.0f, 20.0f ) );
-
- mPopup.Add( image );
-
- // The popup is not yet on the stage so needs to be flaged as dirty
- mPopup.MarkDirtyForRelayout();
-
- mPopup.Show();
- }
- else if( button.GetName() == POPUP_BUTTON_CONTENT_IMAGE_SCALE_ID )
- {
- mPopup = CreatePopup();
-
- mPopup.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
- mPopup.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
- mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
-
- ImageActor image = ImageActor::New( ResourceImage::New( IMAGE2 ) );
- image.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
-
- mPopup.Add( image );
-
- // The popup is not yet on the stage so needs to be flaged as dirty
- mPopup.MarkDirtyForRelayout();
-
- mPopup.Show();
- }
- else if( button.GetName() == POPUP_BUTTON_CONTENT_IMAGE_FIT_ID )
- {
- mPopup = CreatePopup();
-
- mPopup.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
- mPopup.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
- mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
-
- ImageActor image = ImageActor::New( ResourceImage::New( IMAGE2 ) );
- image.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
- image.SetSizeScalePolicy( FIT_WITH_ASPECT_RATIO );
-
- mPopup.Add( image );
-
- // The popup is not yet on the stage so needs to be flaged as dirty
- mPopup.MarkDirtyForRelayout();
-
- mPopup.Show();
- }
- else if( button.GetName() == POPUP_BUTTON_CONTENT_IMAGE_FILL_ID )
- {
- mPopup = CreatePopup();
-
- mPopup.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
- mPopup.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
- mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
-
- ImageActor image = ImageActor::New( ResourceImage::New( IMAGE2 ) );
- image.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
- image.SetSizeScalePolicy( FILL_WITH_ASPECT_RATIO );
-
- mPopup.Add( image );
-
- // The popup is not yet on the stage so needs to be flaged as dirty
- mPopup.MarkDirtyForRelayout();
-
- mPopup.Show();
- }
- else if( button.GetName() == POPUP_BUTTON_TITLE_CONTENT_TEXT_ID )