- 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();
-
- Toolkit::TextView text = Toolkit::TextView::New();
- text.SetName( "POPUP_CONTENT_TEXT" );
- text.SetText( CONTENT_TEXT );
- text.SetMultilinePolicy( Toolkit::TextView::SplitByWord );
- text.SetWidthExceedPolicy( Toolkit::TextView::Split );
- text.SetLineJustification( Toolkit::TextView::Center );
- 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.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 )
- {
- mPopup = CreatePopup();
- mPopup.SetTitle( "Popup!" );
-
- Toolkit::TextView text = Toolkit::TextView::New();
- text.SetName( "POPUP_CONTENT_TEXT" );
- text.SetText( CONTENT_TEXT );
- text.SetMultilinePolicy( Toolkit::TextView::SplitByWord );
- text.SetWidthExceedPolicy( Toolkit::TextView::Split );
- text.SetLineJustification( Toolkit::TextView::Center );
- 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.Show();
- }
- else if( button.GetName() == POPUP_BUTTON_TITLE_CONTENT_TEXT_BUTTONS_ID )
- {
- mPopup = CreatePopup();
- mPopup.SetTitle( "Popup!" );
-
- Toolkit::TextView text = Toolkit::TextView::New();
- text.SetName( "POPUP_CONTENT_TEXT" );
- text.SetText( CONTENT_TEXT );
- text.SetMultilinePolicy( Toolkit::TextView::SplitByWord );
- text.SetWidthExceedPolicy( Toolkit::TextView::Split );
- text.SetLineJustification( Toolkit::TextView::Left );
- 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 );
- 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_COMPLEX_ID )
- {
- mPopup = CreatePopup();
- mPopup.SetTitle( "Warning" );
-
- // Content
- Toolkit::TableView content = Toolkit::TableView::New( 2, 2 );
- content.SetName( "COMPLEX_TABLEVIEW" );
- content.SetResizePolicy( FILL_TO_PARENT, WIDTH );
- content.SetResizePolicy( USE_NATURAL_SIZE, HEIGHT );
- content.SetFitHeight( 0 );
- content.SetFitHeight( 1 );
- content.SetPadding( Padding( 20.0f, 20.0f, 20.0f, 0.0f ) );
-
- // Text
- {
- Toolkit::TextView text = Toolkit::TextView::New();
- text.SetText( "Do you really want to quit?" );
- text.SetMultilinePolicy( Toolkit::TextView::SplitByWord );
- text.SetWidthExceedPolicy( Toolkit::TextView::Split );
- text.SetLineJustification( Toolkit::TextView::Left );
- text.SetResizePolicy( FILL_TO_PARENT, WIDTH );
- text.SetDimensionDependency( HEIGHT, WIDTH );
-
- content.AddChild( text, Toolkit::TableView::CellPosition( 0, 0 ) );
- }
-
- // Image
- {
- ImageActor image = ImageActor::New( ResourceImage::New( IMAGE1 ) );
- image.SetName( "COMPLEX_IMAGE" );
- image.SetResizePolicy( FILL_TO_PARENT, WIDTH );
- image.SetDimensionDependency( HEIGHT, WIDTH );
- image.SetPadding( Padding( 20.0f, 0.0f, 0.0f, 0.0f ) );
- content.AddChild( image, Toolkit::TableView::CellPosition( 0, 1 ) );
- }
-
- // Text 2
- {
- Toolkit::TableView root = Toolkit::TableView::New( 1, 2 );
- root.SetResizePolicy( FILL_TO_PARENT, WIDTH );
- root.SetResizePolicy( USE_NATURAL_SIZE, HEIGHT );
- root.SetFitHeight( 0 );
- root.SetFitWidth( 0 );
- root.SetPadding( Padding( 0.0f, 0.0f, 0.0f, 20.0f ) );
-
- Dali::Image unchecked = Dali::ResourceImage::New( CHECKBOX_UNCHECKED_IMAGE );
- Dali::Image checked = Dali::ResourceImage::New( CHECKBOX_CHECKED_IMAGE );
- Toolkit::CheckBoxButton checkBox = Toolkit::CheckBoxButton::New();
- checkBox.SetBackgroundImage( unchecked );
- checkBox.SetSelectedImage( checked );
- checkBox.SetPreferredSize( Vector2( 48, 48 ) );
- checkBox.SetResizePolicy( FIXED, ALL_DIMENSIONS );
-
- root.AddChild( checkBox, Toolkit::TableView::CellPosition( 0, 0 ) );
-
- Toolkit::TextView text = Toolkit::TextView::New();
- text.SetText( "Don't show again" );
- text.SetLineJustification( Toolkit::TextView::Left );
- Actor textActor = text;
- textActor.SetPadding( Padding( 20.0f, 0.0f, 0.0f, 10.0f ) );
-
- root.AddChild( text, Toolkit::TableView::CellPosition( 0, 1 ) );
-
- content.AddChild( root, Toolkit::TableView::CellPosition( 1, 0, 0, 2 ) ); // Column span 2
- }
-
- mPopup.Add( content );
-
- // Buttons
- 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() == TABLEVIEW_BUTTON_EMPTY_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 ) );
-
-
- Toolkit::TableView table = Toolkit::TableView::New( 0, 0 );
- table.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
-
- mPopup.Add( table );
-
- // The popup is not yet on the stage so needs to be flaged as dirty
- mPopup.MarkDirtyForRelayout();
-
- mPopup.Show();
- }
- else if( button.GetName() == TABLEVIEW_BUTTON_1CELL_ID )