- Image buttonImage = Dali::ResourceImage::New( UNSELECTED_BUTTON_IMAGE_DIR );
- Image selectedImage = Dali::ResourceImage::New( SELECTED_BUTTON_IMAGE_DIR );
-
- SetButtonImage( ImageActor::New( buttonImage ) );
- SetSelectedImage( ImageActor::New( selectedImage ) );
-
- SetImage( GetButtonImage() );
-
- RelayoutRequest();
-}
-
-void RadioButton::OnButtonUp()
-{
- if( ButtonDown == GetState() )
- {
- // Don't allow selection on an already selected radio button
- if( !IsSelected() )
- {
- SetSelected( !IsSelected() );
- }
- }
-}
-
-void RadioButton::OnLabelSet()
-{
- Actor& label = GetLabel();
-
- if( label )
- {
- // Add padding to the left of the label to create distance from the image
- label.SetPadding( Padding( DISTANCE_BETWEEN_IMAGE_AND_LABEL, 0.0f, 0.0f, 0.0f ) );
-
- mLayoutContainer.RemoveChildAt( Toolkit::TableView::CellPosition( 0, 1 ) );
- mLayoutContainer.AddChild( label, Toolkit::TableView::CellPosition( 0, 1 ) );
- }
-}
-
-void RadioButton::OnSelected( bool selected )
-{
- if( selected )