-void CheckBoxButton::OnButtonInitialize()
-{
- // Wrap around all children
- Self().SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::ALL_DIMENSIONS );
-
- Image buttonImage = Dali::ResourceImage::New( UNSELECTED_BUTTON_IMAGE_DIR, ResourceImage::ON_DEMAND, ResourceImage::NEVER );
- Image selectedImage = Dali::ResourceImage::New( SELECTED_BUTTON_IMAGE_DIR, ResourceImage::ON_DEMAND, ResourceImage::NEVER );
- Image disabledImage = Dali::ResourceImage::New( DISABLED_UNSELECTED_BUTTON_IMAGE_DIR, ResourceImage::ON_DEMAND, ResourceImage::NEVER );
- Image disabledSelectedImage = Dali::ResourceImage::New( DISABLED_SELECTED_BUTTON_IMAGE_DIR, ResourceImage::ON_DEMAND, ResourceImage::NEVER );
-
- SetButtonImage( ImageActor::New( buttonImage ) );
- SetSelectedImage( ImageActor::New( selectedImage ) );
- SetDisabledImage( ImageActor::New( disabledImage ) );
- SetDisabledSelectedImage( ImageActor::New( disabledSelectedImage ) );
-}
-
-void CheckBoxButton::OnLabelSet()
-{
- Actor& label = GetLabel();
-
- if( label )
- {
- label.SetParentOrigin( ParentOrigin::CENTER_LEFT );
- label.SetAnchorPoint( AnchorPoint::CENTER_LEFT );
-
- if( IsDisabled() && GetDisabledBackgroundImage() )
- {
- label.SetX( GetDisabledBackgroundImage().GetNaturalSize().width + DISTANCE_BETWEEN_IMAGE_AND_LABEL );
- }
- else if ( GetBackgroundImage() )
- {
- label.SetX( GetBackgroundImage().GetNaturalSize().width + DISTANCE_BETWEEN_IMAGE_AND_LABEL );
- }
- else if( IsSelected() && GetSelectedImage())
- {
- label.SetX( GetSelectedImage().GetNaturalSize().width + DISTANCE_BETWEEN_IMAGE_AND_LABEL );
- }
- else if( GetButtonImage() )
- {
- label.SetX( GetButtonImage().GetNaturalSize().width + DISTANCE_BETWEEN_IMAGE_AND_LABEL );
- }
- else
- {
- label.SetX( DISTANCE_BETWEEN_IMAGE_AND_LABEL );
- }
- }
-}
-
-void CheckBoxButton::OnDisabled()