X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Fpublic-api%2Fcontrols%2Fdefault-controls%2Fcheck-button-factory.cpp;h=87fbb94bc3803b762e0a06bd4852acbc5ca1ff94;hp=97cd22c5d2ec71c8ce50981963655a93554efe32;hb=030e7c680a6eb0e8d87bfdb8ec359a0267ef7db2;hpb=e2eda444afbe82e9591fe198eef339227f90a616 diff --git a/dali-toolkit/public-api/controls/default-controls/check-button-factory.cpp b/dali-toolkit/public-api/controls/default-controls/check-button-factory.cpp index 97cd22c..87fbb94 100644 --- a/dali-toolkit/public-api/controls/default-controls/check-button-factory.cpp +++ b/dali-toolkit/public-api/controls/default-controls/check-button-factory.cpp @@ -1,26 +1,29 @@ -// -// 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) 2015 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. + * + */ + +// CLASS HEADER #include "check-button-factory.h" // EXTERNAL INCLUDES +#include +#include // INTERNAL INCLUDES #include -#include namespace Dali { @@ -43,7 +46,7 @@ Alignment CreateAlignedImage( Actor image ) Alignment CreateAlignedImage( const std::string& imagePath ) { - Image image = Image::New( imagePath ); + Image image = ResourceImage::New( imagePath ); return CreateAlignedImage( ImageActor::New( image ) ); } @@ -51,7 +54,7 @@ Alignment CreateAlignedImage( const std::string& imagePath ) } // 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(); @@ -60,25 +63,25 @@ CheckBoxButton CreateCheckBoxButton( const std::string& backgroundImagePath, con 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(); @@ -87,25 +90,25 @@ CheckBoxButton CreateCheckBoxButton( Actor backgroundImageActor, Actor checkedIm 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(); @@ -114,15 +117,15 @@ CheckBoxButton CreateCheckBoxButton( const std::string& backgroundImagePath, con 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(); @@ -131,9 +134,9 @@ CheckBoxButton CreateCheckBoxButton( Actor backgroundImageActor, Actor checkedIm button.SetBackgroundImage( CreateAlignedImage( backgroundImageActor ) ); } - if( checkedImageActor ) + if( selectedImageActor ) { - button.SetCheckedImage( CreateAlignedImage( checkedImageActor ) ); + button.SetSelectedImage( CreateAlignedImage( selectedImageActor ) ); } return button;