Merge remote-tracking branch 'origin/tizen' into new_text
[platform/core/uifw/dali-demo.git] / examples / buttons / buttons-example.cpp
index ee3a59d..a658fa1 100644 (file)
@@ -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( ResourceImage::New( ENABLED_IMAGE ) );
       imageActor.SetSize( DP(RADIO_LABEL_THUMBNAIL_SIZE), DP(RADIO_LABEL_THUMBNAIL_SIZE) );
       tableView.AddChild( imageActor, Toolkit::TableView::CellPosition( 0, 1 ) );
@@ -292,19 +287,12 @@ class ButtonsController: public ConnectionTracker
       checkBox.SetAnchorPoint( AnchorPoint::TOP_LEFT );
       checkBox.SetBackgroundImage( unselected );
       checkBox.SetSelectedImage( selected );
-      checkBox.SetSize( DP(48), DP(48) );
+      checkBox.SetLabel( "CheckBox1 is unselected" );
       checkBox.StateChangedSignal().Connect( this, &ButtonsController::OnCheckBoxesSelected );
 
       checkBoxBackground.Add( checkBox );
     }
 
-    mCheckBox1State = Toolkit::TextView::New( "CheckBox1 is unselected" );
-
-    mCheckBox1State.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-    mCheckBox1State.SetPosition( DP(80), DP(checkYPos) );
-
-    checkBoxBackground.Add( mCheckBox1State );
-
     checkYPos += 60;
 
     {
@@ -314,20 +302,13 @@ class ButtonsController: public ConnectionTracker
       checkBox.SetAnchorPoint( AnchorPoint::TOP_LEFT );
       checkBox.SetBackgroundImage( unselected );
       checkBox.SetSelectedImage( selected );
-      checkBox.SetSize( DP(48), DP(48) );
+      checkBox.SetLabel( "CheckBox2 is selected" );
       checkBox.SetSelected( true );
       checkBox.StateChangedSignal().Connect( this, &ButtonsController::OnCheckBoxesSelected );
 
       checkBoxBackground.Add( checkBox );
     }
 
-    mCheckBox2State = Toolkit::TextView::New( "CheckBox2 is selected" );
-    mCheckBox2State.SetParentOrigin( ParentOrigin::TOP_LEFT );
-    mCheckBox2State.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-    mCheckBox2State.SetPosition( DP(80), DP(checkYPos) );
-
-    checkBoxBackground.Add( mCheckBox2State );
-
     checkYPos += 60;
 
     {
@@ -337,19 +318,12 @@ class ButtonsController: public ConnectionTracker
       checkBox.SetAnchorPoint( AnchorPoint::TOP_LEFT );
       checkBox.SetBackgroundImage( unselected );
       checkBox.SetSelectedImage( selected );
-      checkBox.SetSize( DP(48), DP(48) );
+      checkBox.SetLabel( "CheckBox3 is unselected" );
       checkBox.StateChangedSignal().Connect( this, &ButtonsController::OnCheckBoxesSelected );
 
       checkBoxBackground.Add( checkBox );
     }
 
-    mCheckBox3State = Toolkit::TextView::New( "CheckBox3 is unselected" );
-
-    mCheckBox3State.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-    mCheckBox3State.SetPosition( DP(80), DP(checkYPos) );
-
-    checkBoxBackground.Add( mCheckBox3State );
-
     // Create togglabe button
     yPos += GROUP3_HEIGHT + MARGIN_SIZE;
 
@@ -440,42 +414,6 @@ class ButtonsController: public ConnectionTracker
 
   bool OnCheckBoxesSelected( Toolkit::Button button )
   {
-    if( button.GetName() == "checkbox1" )
-    {
-      if( button.IsSelected() )
-      {
-        mCheckBox1State.SetText("CheckBox1 is selected");
-      }
-      else
-      {
-        mCheckBox1State.SetText("CheckBox1 is unselected");
-      }
-    }
-
-    if( button.GetName() == "checkbox2" )
-    {
-      if( button.IsSelected() )
-      {
-        mCheckBox2State.SetText("CheckBox2 is selected");
-      }
-      else
-      {
-        mCheckBox2State.SetText("CheckBox2 is unselected");
-      }
-    }
-
-    if( button.GetName() == "checkbox3" )
-    {
-      if( button.IsSelected() )
-      {
-        mCheckBox3State.SetText("CheckBox3 is selected");
-      }
-      else
-      {
-        mCheckBox3State.SetText("CheckBox3 is unselected");
-      }
-    }
-
     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 )