X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2FIntDefaultCustomItem.cpp;h=53209c0528f195bec57aa9fa345296eabe726b8b;hb=refs%2Ftags%2Fsubmit%2Ftizen_2.2%2F20131107.055207;hp=c5accf60a2226adb119eaa95e74fa0c0f592681f;hpb=324d5cb2fb4cbdf85e040dc87e6702c8f4412b26;p=apps%2Fosp%2FInternet.git diff --git a/src/IntDefaultCustomItem.cpp b/src/IntDefaultCustomItem.cpp index c5accf6..53209c0 100644 --- a/src/IntDefaultCustomItem.cpp +++ b/src/IntDefaultCustomItem.cpp @@ -1,87 +1,89 @@ -// - -// Copyright (c) 2012 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. -// - -// !Internet -/*@file: IntDefaultCustomItem - *@brief: - * - */ - -#include -#include "IntDefaultCustomItem.h" -#include "IntTypes.h" - -using namespace Tizen::Base; -using namespace Tizen::Graphics; -using namespace Tizen::Ui::Controls; - -const int DefaultCustomItem::IDA_FORMAT_STRING = 101; - -DefaultCustomItem::DefaultCustomItem(void) -{ - __width = 0; - __height = 0; - __text = L""; -} - -DefaultCustomItem::~DefaultCustomItem(void) -{ - -} - -result -DefaultCustomItem::Construct(int width, int height) -{ - result r = E_FAILURE; - __width = width; - __height = height; - const Dimension dim(width, height); - r = CustomItem::Construct(dim, LIST_ANNEX_STYLE_NORMAL); - return r; - -} - -void -DefaultCustomItem::SetText(String& text) -{ - __text = text; -} - -String -DefaultCustomItem::GetText(void) -{ - return __text; -} - - -result -DefaultCustomItem::Make(void) -{ - result r = E_SUCCESS; - const Color pressedTextColor = Color(249, 249, 249); - const int textSize = 40; - const int x_Margin_Element = 26; - const int y_Margin_Element = 26; - const int width_Element = __width - 60; - - r = AddElement(Rectangle(x_Margin_Element, y_Margin_Element, width_Element,60), IDA_FORMAT_STRING, __text, textSize, CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,true); - TryCatch( !IsFailed(r),,"DefaultCustomItem::Make %s",GetErrorMessage(r)); - - SetElementSelectionEnabled(IDA_FORMAT_STRING, true); - - CATCH:return r; -} +// + +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.1 (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. +// + +// !Internet +/*@file: IntDefaultCustomItem + *@brief: + * + */ + +#include +#include "IntCommonLib.h" +#include "IntDefaultCustomItem.h" +#include "IntTypes.h" + +using namespace Tizen::Base; +using namespace Tizen::Graphics; +using namespace Tizen::Ui::Controls; + +const int DefaultCustomItem::IDA_FORMAT_STRING = 101; + +DefaultCustomItem::DefaultCustomItem(void) +{ + __width = 0; + __height = 0; + __text = L""; +} + +DefaultCustomItem::~DefaultCustomItem(void) +{ + +} + +result +DefaultCustomItem::Construct(int width, int height) +{ + result r = E_FAILURE; + __fontSize = CommonUtil::GetFontSize(); + __width = width; + __height = height; + const Dimension dim(width, height); + r = CustomItem::Construct(dim, LIST_ANNEX_STYLE_NORMAL); + return r; + +} + +void +DefaultCustomItem::SetText(String& text) +{ + __text = text; +} + +String +DefaultCustomItem::GetText(void) +{ + return __text; +} + + +result +DefaultCustomItem::Make(void) +{ + result r = E_SUCCESS; + const Color pressedTextColor = Color(249, 249, 249); + const int textSize = 40; + const int x_Margin_Element = 26; + const int y_Margin_Element = 26; + const int width_Element = __width - 60; + + r = AddElement(Rectangle(x_Margin_Element, y_Margin_Element, width_Element,60 + (__fontSize - 44)), IDA_FORMAT_STRING, __text, __fontSize , CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,CUSTOM_COLOR_TRANSPARENT,true); + TryCatch( !IsFailed(r),,"DefaultCustomItem::Make %s",GetErrorMessage(r)); + +// SetElementSelectionEnabled(IDA_FORMAT_STRING, true); + + CATCH:return r; +}