From: kishorekumar Dachinamoorthy Date: Fri, 21 Jun 2013 07:00:26 +0000 (+0530) Subject: Updating Winset4.4 ux to popup, progress popup. X-Git-Tag: submit/tizen_2.2/20130714.153149~375^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=57dc4a1a4a54c00ea81eaa427f8d27eb835cc06f;p=framework%2Fosp%2Fuifw.git Updating Winset4.4 ux to popup, progress popup. Change-Id: I31d4e3ec5d5cda18729945d2c1d0c72ccf7854ea Signed-off-by: kishorekumar Dachinamoorthy --- diff --git a/src/ui/controls/FUiCtrl_Popup.cpp b/src/ui/controls/FUiCtrl_Popup.cpp index 4cd9389..f45b19d 100644 --- a/src/ui/controls/FUiCtrl_Popup.cpp +++ b/src/ui/controls/FUiCtrl_Popup.cpp @@ -58,8 +58,8 @@ _Popup::_Popup(void) , _pBgBitmap(null) , _pComposedBgBitmap(null) , _pOutlineBitmap(null) - , __pComposedTitleBitmap(null) - , __pTitleEffectBitmap(null) + , _pComposedTitleBitmap(null) + , _pTitleEffectBitmap(null) , _pTitleTextAccessibilityElement(null) , __pPopupPresenter(null) , __bounds(0.0f, 0.0f, 0.0f, 0.0f) @@ -86,11 +86,11 @@ _Popup::~_Popup(void) delete _pOutlineBitmap; _pOutlineBitmap = null; - delete __pComposedTitleBitmap; - __pComposedTitleBitmap = null; + delete _pComposedTitleBitmap; + _pComposedTitleBitmap = null; - delete __pTitleEffectBitmap; - __pTitleEffectBitmap = null; + delete _pTitleEffectBitmap; + _pTitleEffectBitmap = null; if (_pTitleTextAccessibilityElement) { @@ -132,7 +132,7 @@ _Popup::Initialize(bool hasTitle, const Tizen::Graphics::FloatRectangle& bounds) _AccessibilityContainer* pContainer = null; _DataBindingContext* pContext = null; Bitmap* titleBgBitmap = null; - Color titleBgColor(0XFFFFFFFF); + Color titleBgColor(0x00000000); _titleState = hasTitle; __bounds = bounds; @@ -158,12 +158,12 @@ _Popup::Initialize(bool hasTitle, const Tizen::Graphics::FloatRectangle& bounds) r = GetLastResult(); SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - __pComposedTitleBitmap = _BitmapImpl::GetColorReplacedBitmapN(*titleBgBitmap, Color::GetColor(COLOR_ID_MAGENTA), titleBgColor); + _pComposedTitleBitmap = _BitmapImpl::GetColorReplacedBitmapN(*titleBgBitmap, Color::GetColor(COLOR_ID_MAGENTA), titleBgColor); r = GetLastResult(); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); // Popup-TitleEffectBitmap - GET_BITMAP_CONFIG_N(POPUP::BG_TITLE_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pTitleEffectBitmap); + GET_BITMAP_CONFIG_N(POPUP::BG_TITLE_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, _pTitleEffectBitmap); r = GetLastResult(); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); } @@ -202,16 +202,43 @@ _Popup::Initialize(bool hasTitle, const Tizen::Graphics::FloatRectangle& bounds) pContainer->Activate(true); } - delete titleBgBitmap; - titleBgBitmap = null; + if (titleBgBitmap != null) + { + delete titleBgBitmap; + titleBgBitmap = null; + } return r; CATCH: delete pContext; - delete titleBgBitmap; - titleBgBitmap = null; + if (titleBgBitmap != null) + { + delete titleBgBitmap; + titleBgBitmap = null; + } + + if (_pComposedTitleBitmap != null) + { + delete _pComposedTitleBitmap; + _pComposedTitleBitmap = null; + } + + if (_pTitleEffectBitmap != null) + { + delete _pTitleEffectBitmap; + _pTitleEffectBitmap = null; + } + + delete _pOutlineBitmap; + _pOutlineBitmap = null; + + delete _pBgBitmap; + _pBgBitmap = null; + + delete _pComposedBgBitmap; + _pComposedBgBitmap = null; return r; } @@ -384,13 +411,13 @@ _Popup::GetOutlineBitmap(void) const Bitmap* _Popup::GetTitleBackgroundBitmap(void) { - return __pComposedTitleBitmap; + return _pComposedTitleBitmap; } Bitmap* _Popup::GetTitleBackgroundEffectBitmap(void) { - return __pTitleEffectBitmap; + return _pTitleEffectBitmap; } diff --git a/src/ui/controls/FUiCtrl_PopupPresenter.cpp b/src/ui/controls/FUiCtrl_PopupPresenter.cpp index d4ea7ad..c0474e7 100644 --- a/src/ui/controls/FUiCtrl_PopupPresenter.cpp +++ b/src/ui/controls/FUiCtrl_PopupPresenter.cpp @@ -52,7 +52,7 @@ namespace Tizen { namespace Ui { namespace Controls _PopupPresenter::_PopupPresenter(void) : _pFont(null) , _titleBounds(0.0f, 0.0f, 0.0f, 0.0f) - , __titleBgBounds(0.0f, 0.0f, 0.0f, 0.0f) + , _titleBgBounds(0.0f, 0.0f, 0.0f, 0.0f) , _titleTextSize(0.0f) , _fontStyle(0) , _fontSize(0.0f) @@ -244,13 +244,13 @@ _PopupPresenter::SetTitleTextObject(const String &title) r = CalculateTitleTextSize(titleTextSize, minTitleTextSize); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - __titleBgBounds.SetBounds(0, + _titleBgBounds.SetBounds(0, 0, __pPopup->GetBounds().width, titleHeight); _titleBounds = FloatRectangle(titleLeftMargin, - __titleBgBounds.y + (__titleBgBounds.height - _pTitleTextObject->GetTotalHeight())/2, + _titleBgBounds.y + (_titleBgBounds.height - _pTitleTextObject->GetTotalHeight()) / 2.0f, __pPopup->GetBoundsF().width - (titleLeftMargin + titleRightMargin), _pTitleTextObject->GetTotalHeight()); @@ -348,7 +348,7 @@ _PopupPresenter::UpdateTitleTextBounds(void) GET_SHAPE_CONFIG(POPUP::MIN_TITLE_TEXT_SIZE, orientation, minTitleTextSize); _titleBounds.width = __pPopup->GetBounds().width - (titleLeftMargin + titleRightMargin), - __titleBgBounds.width = __pPopup->GetBounds().width; + _titleBgBounds.width = __pPopup->GetBounds().width; _pTitleTextObject->SetBounds(_titleBounds); @@ -462,31 +462,29 @@ _PopupPresenter::Draw(void) const Bitmap* pTitleBitmap = __pPopup->GetTitleBackgroundBitmap(); const Bitmap* pTitleEffectBitmap = __pPopup->GetTitleBackgroundEffectBitmap(); - isCustomBitmap = IS_CUSTOM_BITMAP(POPUP::BG_TITLE_AREA); - //DrawTitleBG if(pTitleBitmap != null) { if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pTitleBitmap)) { - pCanvas->DrawNinePatchedBitmap(__titleBgBounds, *pTitleBitmap); + pCanvas->DrawNinePatchedBitmap(_titleBgBounds, *pTitleBitmap); } else { - pCanvas->DrawBitmap(__titleBgBounds, *pTitleBitmap); + pCanvas->DrawBitmap(_titleBgBounds, *pTitleBitmap); } } //DrawEffectTitleBitmap - if (!isCustomBitmap && pTitleEffectBitmap != null) + if (pTitleEffectBitmap != null) { if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pTitleEffectBitmap)) { - pCanvas->DrawNinePatchedBitmap(__titleBgBounds, *pTitleEffectBitmap); + pCanvas->DrawNinePatchedBitmap(_titleBgBounds, *pTitleEffectBitmap); } else { - pCanvas->DrawBitmap(__titleBgBounds, *pTitleEffectBitmap); + pCanvas->DrawBitmap(_titleBgBounds, *pTitleEffectBitmap); } } diff --git a/src/ui/controls/FUiCtrl_ProgressPopup.cpp b/src/ui/controls/FUiCtrl_ProgressPopup.cpp index f8fefcb..a304441 100644 --- a/src/ui/controls/FUiCtrl_ProgressPopup.cpp +++ b/src/ui/controls/FUiCtrl_ProgressPopup.cpp @@ -64,7 +64,6 @@ _ProgressPopup::_ProgressPopup(void) , __buttonState(false) , __isTransparent(false) { - AppLog(" KISH inside _ProgressPopup::_ProgressPopup"); // empty statement } @@ -94,11 +93,11 @@ _ProgressPopup::~_ProgressPopup(void) delete __pButtonEffectBitmap; __pButtonEffectBitmap = null; - delete __pComposedTitleBitmap; - __pComposedTitleBitmap = null; + delete _pComposedTitleBitmap; + _pComposedTitleBitmap = null; - delete __pTitleEffectBitmap; - __pTitleEffectBitmap = null; + delete _pTitleEffectBitmap; + _pTitleEffectBitmap = null; delete __pButton; __pButton = null; @@ -134,8 +133,8 @@ _ProgressPopup::Initialize(bool cancelButton, bool transparent, const FloatRecta Bitmap* buttonBgBitmap = null; Bitmap* titleBgBitmap = null; - Color titleBgColor(0XFFFFFFFF); - Color buttonBgColor(0XFFFFFFFF); + Color titleBgColor(0x00000000); + Color buttonBgColor(0x00000000); __animationRect = animationRect; __buttonState = cancelButton; @@ -188,11 +187,11 @@ _ProgressPopup::Initialize(bool cancelButton, bool transparent, const FloatRecta r = GetLastResult(); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); - __pComposedTitleBitmap = _BitmapImpl::GetColorReplacedBitmapN(*titleBgBitmap, Color::GetColor(COLOR_ID_MAGENTA), titleBgColor); + _pComposedTitleBitmap = _BitmapImpl::GetColorReplacedBitmapN(*titleBgBitmap, Color::GetColor(COLOR_ID_MAGENTA), titleBgColor); r = GetLastResult(); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); - GET_BITMAP_CONFIG_N(MESSAGEBOX::BG_TITLE_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pTitleEffectBitmap); + GET_BITMAP_CONFIG_N(MESSAGEBOX::BG_TITLE_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, _pTitleEffectBitmap); r = GetLastResult(); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); @@ -234,8 +233,11 @@ _ProgressPopup::Initialize(bool cancelButton, bool transparent, const FloatRecta r = _SettingInfoImpl::AddSettingEventListenerForInternal(*this); SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r)); - delete buttonBgBitmap; - buttonBgBitmap = null; + if (buttonBgBitmap != null) + { + delete buttonBgBitmap; + buttonBgBitmap = null; + } delete titleBgBitmap; titleBgBitmap = null; @@ -244,12 +246,42 @@ _ProgressPopup::Initialize(bool cancelButton, bool transparent, const FloatRecta CATCH: - delete buttonBgBitmap; - buttonBgBitmap = null; - delete titleBgBitmap; titleBgBitmap = null; + delete _pBgBitmap; + _pBgBitmap = null; + + delete _pOutlineBitmap; + _pOutlineBitmap = null; + + delete _pComposedBgBitmap; + _pComposedBgBitmap = null; + + if (buttonBgBitmap != null) + { + delete buttonBgBitmap; + buttonBgBitmap = null; + } + + if (__pComposedButtonBitmap != null) + { + delete __pComposedButtonBitmap; + __pComposedButtonBitmap = null; + } + + if (__pButtonEffectBitmap != null) + { + delete __pButtonEffectBitmap; + __pButtonEffectBitmap = null; + } + + delete _pComposedTitleBitmap; + _pComposedTitleBitmap = null; + + delete _pTitleEffectBitmap; + _pTitleEffectBitmap = null; + delete __pButton; __pButton = null; diff --git a/src/ui/controls/FUiCtrl_ProgressPopupPresenter.cpp b/src/ui/controls/FUiCtrl_ProgressPopupPresenter.cpp index 4ee9baa..3a6be4d 100644 --- a/src/ui/controls/FUiCtrl_ProgressPopupPresenter.cpp +++ b/src/ui/controls/FUiCtrl_ProgressPopupPresenter.cpp @@ -187,13 +187,14 @@ _ProgressPopupPresenter::SetTitleTextObject(void) r = CalculateTitleTextSize(titleTextSize, minTitleTextSize); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + __titleBgBounds.SetBounds(transLeftMargin, transTopMargin, + defaultWidth - (transLeftMargin + transRightMargin), titleHeight); + _titleBounds = FloatRectangle(titleLeftMargin + transLeftMargin, - titleTopMargin + transTopMargin, + __titleBgBounds.y + (__titleBgBounds.height - _pTitleTextObject->GetTotalHeight()) / 2.0f, defaultWidth - (titleLeftMargin + titleRightMargin + transLeftMargin + transRightMargin), - titleHeight - titleTopMargin); + _pTitleTextObject->GetTotalHeight()); - __titleBgBounds.SetBounds(transLeftMargin, transTopMargin, - defaultWidth - (transLeftMargin + transRightMargin), titleHeight); SetLastResult(E_SUCCESS); return; @@ -529,7 +530,6 @@ _ProgressPopupPresenter::Draw(void) // Draw Title text if (_pTitleTextObject != null) { - isCustomBitmap = IS_CUSTOM_BITMAP(MESSAGEBOX::BG_TITLE_AREA); //DrawTitleBG if(pTitleBitmap != null) { @@ -544,7 +544,7 @@ _ProgressPopupPresenter::Draw(void) } //DrawEffectTitleBitmap - if (!isCustomBitmap && pTitleEffectBitmap != null) + if (pTitleEffectBitmap != null) { if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pTitleEffectBitmap)) { @@ -568,7 +568,6 @@ _ProgressPopupPresenter::Draw(void) { const Bitmap* pButtonBitmap = __pProgressPopup->GetButtonBackgroundBitmap(); const Bitmap* pButtonEffectBitmap = __pProgressPopup->GetButtonBackgroundEffectBitmap(); - isCustomBitmap = IS_CUSTOM_BITMAP(MESSAGEBOX::BG_BUTTON_AREA); //DrawButtonBG if(pButtonBitmap != null) @@ -584,7 +583,7 @@ _ProgressPopupPresenter::Draw(void) } //DrawEffectButtonBitmap - if (!isCustomBitmap && pButtonEffectBitmap != null) + if (pButtonEffectBitmap != null) { if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pButtonEffectBitmap)) { diff --git a/src/ui/inc/FUiCtrl_Popup.h b/src/ui/inc/FUiCtrl_Popup.h index cb5fa66..39f5266 100644 --- a/src/ui/inc/FUiCtrl_Popup.h +++ b/src/ui/inc/FUiCtrl_Popup.h @@ -158,8 +158,8 @@ protected: Tizen::Graphics::Bitmap* _pBgBitmap; Tizen::Graphics::Bitmap* _pComposedBgBitmap; Tizen::Graphics::Bitmap* _pOutlineBitmap; - Tizen::Graphics::Bitmap* __pComposedTitleBitmap; - Tizen::Graphics::Bitmap* __pTitleEffectBitmap; + Tizen::Graphics::Bitmap* _pComposedTitleBitmap; + Tizen::Graphics::Bitmap* _pTitleEffectBitmap; Tizen::Ui::_AccessibilityElement* _pTitleTextAccessibilityElement; private: diff --git a/src/ui/inc/FUiCtrl_PopupPresenter.h b/src/ui/inc/FUiCtrl_PopupPresenter.h index 77f3b24..9a0a415 100644 --- a/src/ui/inc/FUiCtrl_PopupPresenter.h +++ b/src/ui/inc/FUiCtrl_PopupPresenter.h @@ -94,7 +94,7 @@ private: protected: Tizen::Graphics::Font* _pFont; Tizen::Graphics::FloatRectangle _titleBounds; - Tizen::Graphics::FloatRectangle __titleBgBounds; + Tizen::Graphics::FloatRectangle _titleBgBounds; float _titleTextSize; unsigned long _fontStyle;