Commit 547dbafef42c0a7d75e2857d679619a3461da5bc
Committed by
Gerrit Code Review
Merge "Change a label of check box button" into tizen
Showing
1 changed file
with
9 additions
and
34 deletions
examples/buttons/buttons-example.cpp
| ... | ... | @@ -292,19 +292,12 @@ class ButtonsController: public ConnectionTracker |
| 292 | 292 | checkBox.SetAnchorPoint( AnchorPoint::TOP_LEFT ); |
| 293 | 293 | checkBox.SetBackgroundImage( unselected ); |
| 294 | 294 | checkBox.SetSelectedImage( selected ); |
| 295 | - checkBox.SetSize( DP(48), DP(48) ); | |
| 295 | + checkBox.SetLabel( "CheckBox1 is unselected" ); | |
| 296 | 296 | checkBox.StateChangedSignal().Connect( this, &ButtonsController::OnCheckBoxesSelected ); |
| 297 | 297 | |
| 298 | 298 | checkBoxBackground.Add( checkBox ); |
| 299 | 299 | } |
| 300 | 300 | |
| 301 | - mCheckBox1State = Toolkit::TextView::New( "CheckBox1 is unselected" ); | |
| 302 | - | |
| 303 | - mCheckBox1State.SetAnchorPoint( AnchorPoint::TOP_LEFT ); | |
| 304 | - mCheckBox1State.SetPosition( DP(80), DP(checkYPos) ); | |
| 305 | - | |
| 306 | - checkBoxBackground.Add( mCheckBox1State ); | |
| 307 | - | |
| 308 | 301 | checkYPos += 60; |
| 309 | 302 | |
| 310 | 303 | { |
| ... | ... | @@ -314,20 +307,13 @@ class ButtonsController: public ConnectionTracker |
| 314 | 307 | checkBox.SetAnchorPoint( AnchorPoint::TOP_LEFT ); |
| 315 | 308 | checkBox.SetBackgroundImage( unselected ); |
| 316 | 309 | checkBox.SetSelectedImage( selected ); |
| 317 | - checkBox.SetSize( DP(48), DP(48) ); | |
| 310 | + checkBox.SetLabel( "CheckBox2 is selected" ); | |
| 318 | 311 | checkBox.SetSelected( true ); |
| 319 | 312 | checkBox.StateChangedSignal().Connect( this, &ButtonsController::OnCheckBoxesSelected ); |
| 320 | 313 | |
| 321 | 314 | checkBoxBackground.Add( checkBox ); |
| 322 | 315 | } |
| 323 | 316 | |
| 324 | - mCheckBox2State = Toolkit::TextView::New( "CheckBox2 is selected" ); | |
| 325 | - mCheckBox2State.SetParentOrigin( ParentOrigin::TOP_LEFT ); | |
| 326 | - mCheckBox2State.SetAnchorPoint( AnchorPoint::TOP_LEFT ); | |
| 327 | - mCheckBox2State.SetPosition( DP(80), DP(checkYPos) ); | |
| 328 | - | |
| 329 | - checkBoxBackground.Add( mCheckBox2State ); | |
| 330 | - | |
| 331 | 317 | checkYPos += 60; |
| 332 | 318 | |
| 333 | 319 | { |
| ... | ... | @@ -337,19 +323,12 @@ class ButtonsController: public ConnectionTracker |
| 337 | 323 | checkBox.SetAnchorPoint( AnchorPoint::TOP_LEFT ); |
| 338 | 324 | checkBox.SetBackgroundImage( unselected ); |
| 339 | 325 | checkBox.SetSelectedImage( selected ); |
| 340 | - checkBox.SetSize( DP(48), DP(48) ); | |
| 326 | + checkBox.SetLabel( "CheckBox3 is unselected" ); | |
| 341 | 327 | checkBox.StateChangedSignal().Connect( this, &ButtonsController::OnCheckBoxesSelected ); |
| 342 | 328 | |
| 343 | 329 | checkBoxBackground.Add( checkBox ); |
| 344 | 330 | } |
| 345 | 331 | |
| 346 | - mCheckBox3State = Toolkit::TextView::New( "CheckBox3 is unselected" ); | |
| 347 | - | |
| 348 | - mCheckBox3State.SetAnchorPoint( AnchorPoint::TOP_LEFT ); | |
| 349 | - mCheckBox3State.SetPosition( DP(80), DP(checkYPos) ); | |
| 350 | - | |
| 351 | - checkBoxBackground.Add( mCheckBox3State ); | |
| 352 | - | |
| 353 | 332 | // Create togglabe button |
| 354 | 333 | yPos += GROUP3_HEIGHT + MARGIN_SIZE; |
| 355 | 334 | |
| ... | ... | @@ -444,11 +423,11 @@ class ButtonsController: public ConnectionTracker |
| 444 | 423 | { |
| 445 | 424 | if( button.IsSelected() ) |
| 446 | 425 | { |
| 447 | - mCheckBox1State.SetText("CheckBox1 is selected"); | |
| 426 | + button.SetLabel("CheckBox1 is selected"); | |
| 448 | 427 | } |
| 449 | 428 | else |
| 450 | 429 | { |
| 451 | - mCheckBox1State.SetText("CheckBox1 is unselected"); | |
| 430 | + button.SetLabel("CheckBox1 is unselected"); | |
| 452 | 431 | } |
| 453 | 432 | } |
| 454 | 433 | |
| ... | ... | @@ -456,11 +435,11 @@ class ButtonsController: public ConnectionTracker |
| 456 | 435 | { |
| 457 | 436 | if( button.IsSelected() ) |
| 458 | 437 | { |
| 459 | - mCheckBox2State.SetText("CheckBox2 is selected"); | |
| 438 | + button.SetLabel("CheckBox2 is selected"); | |
| 460 | 439 | } |
| 461 | 440 | else |
| 462 | 441 | { |
| 463 | - mCheckBox2State.SetText("CheckBox2 is unselected"); | |
| 442 | + button.SetLabel("CheckBox2 is unselected"); | |
| 464 | 443 | } |
| 465 | 444 | } |
| 466 | 445 | |
| ... | ... | @@ -468,11 +447,11 @@ class ButtonsController: public ConnectionTracker |
| 468 | 447 | { |
| 469 | 448 | if( button.IsSelected() ) |
| 470 | 449 | { |
| 471 | - mCheckBox3State.SetText("CheckBox3 is selected"); | |
| 450 | + button.SetLabel("CheckBox3 is selected"); | |
| 472 | 451 | } |
| 473 | 452 | else |
| 474 | 453 | { |
| 475 | - mCheckBox3State.SetText("CheckBox3 is unselected"); | |
| 454 | + button.SetLabel("CheckBox3 is unselected"); | |
| 476 | 455 | } |
| 477 | 456 | } |
| 478 | 457 | |
| ... | ... | @@ -496,10 +475,6 @@ class ButtonsController: public ConnectionTracker |
| 496 | 475 | Image mBigImage2; |
| 497 | 476 | Image mBigImage3; |
| 498 | 477 | ImageActor mImage; |
| 499 | - | |
| 500 | - Toolkit::TextView mCheckBox1State; | |
| 501 | - Toolkit::TextView mCheckBox2State; | |
| 502 | - Toolkit::TextView mCheckBox3State; | |
| 503 | 478 | }; |
| 504 | 479 | |
| 505 | 480 | void RunTest( Application& application ) | ... | ... |