+ SetUnselectedImage( UNSELECTED_BUTTON_IMAGE_DIR );
+ SetSelectedImage( SELECTED_BUTTON_IMAGE_DIR );
+ SetDisabledImage( DISABLED_UNSELECTED_BUTTON_IMAGE_DIR );
+ SetDisabledSelectedImage( DISABLED_SELECTED_BUTTON_IMAGE_DIR );
+}
+
+void PushButton::SetIcon( DecorationState state, const std::string iconFilename )
+{
+ mIconName[ state ] = iconFilename;
+ SetDecoration( state, Toolkit::ImageView::New( iconFilename ) );
+ ConfigureSizeNegotiation();
+}
+
+std::string& PushButton::GetIcon( DecorationState state )
+{
+ return mIconName[ state ];
+}
+
+void PushButton::SetIconAlignment( const PushButton::IconAlignment iconAlignment )
+{
+ mIconAlignment = iconAlignment;
+ ConfigureSizeNegotiation();
+}
+
+const PushButton::IconAlignment PushButton::GetIconAlignment() const
+{
+ return mIconAlignment;
+}
+
+void PushButton::SetLabelPadding( const Vector4& padding )
+{
+ mLabelPadding = Padding( padding.x, padding.y, padding.z, padding.w );
+ ConfigureSizeNegotiation();
+}
+
+Vector4 PushButton::GetLabelPadding()
+{
+ return Vector4( mLabelPadding.left, mLabelPadding.right, mLabelPadding.top, mLabelPadding.bottom );
+}
+
+void PushButton::SetIconPadding( const Vector4& padding )
+{
+ mIconPadding = Padding( padding.x, padding.y, padding.z, padding.w );
+ ConfigureSizeNegotiation();
+}
+
+Vector4 PushButton::GetIconPadding()
+{
+ return Vector4( mIconPadding.left, mIconPadding.right, mIconPadding.top, mIconPadding.bottom );
+}
+
+void PushButton::SetProperty( BaseObject* object, Property::Index propertyIndex, const Property::Value& value )
+{
+ Toolkit::PushButton pushButton = Toolkit::PushButton::DownCast( Dali::BaseHandle( object ) );
+
+ if ( pushButton )
+ {
+ PushButton& pushButtonImpl( GetImplementation( pushButton ) );
+
+ switch ( propertyIndex )
+ {
+ case Toolkit::PushButton::Property::UNSELECTED_ICON:
+ {
+ pushButtonImpl.SetIcon( UNSELECTED_DECORATION, value.Get< std::string >() );
+ break;
+ }
+ case Toolkit::PushButton::Property::SELECTED_ICON:
+ {
+ pushButtonImpl.SetIcon( SELECTED_DECORATION, value.Get< std::string >() );
+ break;
+ }
+ case Toolkit::PushButton::Property::ICON_ALIGNMENT:
+ {
+ IconAlignment iconAlignment;
+ if( Scripting::GetEnumeration< IconAlignment >( value.Get< std::string >().c_str(), IconAlignmentTable, IconAlignmentTableCount, iconAlignment ) )
+ {
+ pushButtonImpl.SetIconAlignment( iconAlignment );
+ }
+ break;
+ }
+ case Toolkit::PushButton::Property::LABEL_PADDING:
+ {
+ pushButtonImpl.SetLabelPadding( value.Get< Vector4 >() );
+ break;
+ }
+ case Toolkit::PushButton::Property::ICON_PADDING:
+ {
+ pushButtonImpl.SetIconPadding( value.Get< Vector4 >() );
+ break;
+ }
+ }
+ }
+}
+
+Property::Value PushButton::GetProperty( BaseObject* object, Property::Index propertyIndex )
+{
+ Property::Value value;
+
+ Toolkit::PushButton pushButton = Toolkit::PushButton::DownCast( Dali::BaseHandle( object ) );
+
+ if ( pushButton )
+ {
+ PushButton& pushButtonImpl( GetImplementation( pushButton ) );
+
+ switch ( propertyIndex )
+ {
+ case Toolkit::PushButton::Property::UNSELECTED_ICON:
+ {
+ value = pushButtonImpl.GetIcon( UNSELECTED_DECORATION );
+ break;
+ }
+ case Toolkit::PushButton::Property::SELECTED_ICON:
+ {
+ value = pushButtonImpl.GetIcon( UNSELECTED_DECORATION );
+ break;
+ }
+ case Toolkit::PushButton::Property::ICON_ALIGNMENT:
+ {
+ value = Scripting::GetLinearEnumerationName< IconAlignment >( pushButtonImpl.GetIconAlignment(), IconAlignmentTable, IconAlignmentTableCount );
+ break;
+ }
+ case Toolkit::PushButton::Property::LABEL_PADDING:
+ {
+ value = pushButtonImpl.GetLabelPadding();
+ break;
+ }
+ case Toolkit::PushButton::Property::ICON_PADDING:
+ {
+ value = pushButtonImpl.GetIconPadding();
+ break;
+ }
+ }
+ }