-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://floralicense.org/license/
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an AS IS BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
#include "check-button-factory.h"
// EXTERNAL INCLUDES
+#include <dali/public-api/actors/image-actor.h>
+#include <dali/public-api/images/resource-image.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/alignment/alignment.h>
-#include <dali/dali.h>
namespace Dali
{
Alignment CreateAlignedImage( const std::string& imagePath )
{
- Image image = Image::New( imagePath );
+ Image image = ResourceImage::New( imagePath );
return CreateAlignedImage( ImageActor::New( image ) );
}
} // namespace
-CheckBoxButton CreateCheckBoxButton( const std::string& backgroundImagePath, const std::string& checkedImagePath, const std::string& dimmedBackgroundImagePath, const std::string& dimmedCheckedImagePath )
+CheckBoxButton CreateCheckBoxButton( const std::string& backgroundImagePath, const std::string& selectedImagePath, const std::string& disabledBackgroundImagePath, const std::string& disabledSelectedImagePath )
{
CheckBoxButton button = Toolkit::CheckBoxButton::New();
button.SetBackgroundImage( CreateAlignedImage( backgroundImagePath ) );
}
- if( !checkedImagePath.empty() )
+ if( !selectedImagePath.empty() )
{
- button.SetCheckedImage( CreateAlignedImage( checkedImagePath ) );
+ button.SetSelectedImage( CreateAlignedImage( selectedImagePath ) );
}
- if( !dimmedBackgroundImagePath.empty() )
+ if( !disabledBackgroundImagePath.empty() )
{
- button.SetDimmedBackgroundImage( CreateAlignedImage( dimmedBackgroundImagePath ) );
+ button.SetDisabledBackgroundImage( CreateAlignedImage( disabledBackgroundImagePath ) );
}
- if( !dimmedCheckedImagePath.empty() )
+ if( !disabledSelectedImagePath.empty() )
{
- button.SetDimmedCheckedImage( CreateAlignedImage( dimmedCheckedImagePath ) );
+ button.SetDisabledSelectedImage( CreateAlignedImage( disabledSelectedImagePath ) );
}
return button;
}
-CheckBoxButton CreateCheckBoxButton( Actor backgroundImageActor, Actor checkedImageActor, Actor dimmedBackgroundImageActor, Actor dimmedCheckedImagActor )
+CheckBoxButton CreateCheckBoxButton( Actor backgroundImageActor, Actor selectedImageActor, Actor disabledBackgroundImageActor, Actor disabledSelectedImagActor )
{
CheckBoxButton button = Toolkit::CheckBoxButton::New();
button.SetBackgroundImage( CreateAlignedImage( backgroundImageActor ) );
}
- if( checkedImageActor )
+ if( selectedImageActor )
{
- button.SetCheckedImage( CreateAlignedImage( checkedImageActor ) );
+ button.SetSelectedImage( CreateAlignedImage( selectedImageActor ) );
}
- if( dimmedBackgroundImageActor )
+ if( disabledBackgroundImageActor )
{
- button.SetDimmedBackgroundImage( CreateAlignedImage( dimmedBackgroundImageActor ) );
+ button.SetDisabledBackgroundImage( CreateAlignedImage( disabledBackgroundImageActor ) );
}
- if( dimmedCheckedImagActor )
+ if( disabledSelectedImagActor )
{
- button.SetDimmedCheckedImage( CreateAlignedImage( dimmedCheckedImagActor ) );
+ button.SetDisabledSelectedImage( CreateAlignedImage( disabledSelectedImagActor ) );
}
return button;
}
-CheckBoxButton CreateCheckBoxButton( const std::string& backgroundImagePath, const std::string& checkedImagePath )
+CheckBoxButton CreateCheckBoxButton( const std::string& backgroundImagePath, const std::string& selectedImagePath )
{
CheckBoxButton button = Toolkit::CheckBoxButton::New();
button.SetBackgroundImage( CreateAlignedImage( backgroundImagePath ) );
}
- if( !checkedImagePath.empty() )
+ if( !selectedImagePath.empty() )
{
- button.SetCheckedImage( CreateAlignedImage( checkedImagePath ) );
+ button.SetSelectedImage( CreateAlignedImage( selectedImagePath ) );
}
return button;
}
-CheckBoxButton CreateCheckBoxButton( Actor backgroundImageActor, Actor checkedImageActor )
+CheckBoxButton CreateCheckBoxButton( Actor backgroundImageActor, Actor selectedImageActor )
{
CheckBoxButton button = Toolkit::CheckBoxButton::New();
button.SetBackgroundImage( CreateAlignedImage( backgroundImageActor ) );
}
- if( checkedImageActor )
+ if( selectedImageActor )
{
- button.SetCheckedImage( CreateAlignedImage( checkedImageActor ) );
+ button.SetSelectedImage( CreateAlignedImage( selectedImageActor ) );
}
return button;