From: DongJinJeon Date: Tue, 21 May 2013 09:02:44 +0000 (+0900) Subject: Merge master->tizen_2.1 : Popup, MessageBox, ProgressPopup(accessibility, focus ui... X-Git-Tag: accepted/tizen/20130924.144426~1^2~807^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6d99423a7fb8081559266581c6a6b38c69299d62;p=platform%2Fframework%2Fnative%2Fuifw.git Merge master->tizen_2.1 : Popup, MessageBox, ProgressPopup(accessibility, focus ui, title font) Change-Id: Id3246dd1a6f0b3338da10790a91a375411b848e0 Signed-off-by: DongJinJeon --- diff --git a/src/ui/controls/FUiCtrl_MessageBox.cpp b/src/ui/controls/FUiCtrl_MessageBox.cpp index 9451d41..45d70dc 100644 --- a/src/ui/controls/FUiCtrl_MessageBox.cpp +++ b/src/ui/controls/FUiCtrl_MessageBox.cpp @@ -146,6 +146,7 @@ _MessageBox::Initialize(const String& title, const String& text, MessageBoxStyle if(pContainer != null) { pContainer->Activate(true); + pContainer->AddListener(*this); } r = _SettingInfoImpl::AddSettingEventListenerForInternal(*this); @@ -164,6 +165,12 @@ _MessageBox::SetPresenter(const _MessageBoxPresenter& msgboxPresenter) return E_SUCCESS; } +_PopupPresenter* +_MessageBox::GetPresenter(void) +{ + return static_cast <_PopupPresenter*>(__pMsgboxPresenter); +} + void _MessageBox::OnDraw() { @@ -199,24 +206,23 @@ _MessageBox::OnDeactivated(void) _Popup::OnDeactivated(); } -result -_MessageBox::OnAttachedToMainTree(void) +void +_MessageBox::InitializeAccessibilityElement(void) { result r = E_SUCCESS; - SysTryReturn(NID_UI_CTRL, GetVisibleState() != false, E_INVALID_OPERATION, - E_INVALID_OPERATION, "[E_INVALID_OPERATION] This control is not 'displayable'"); + _Popup::InitializeAccessibilityElement(); - _Control* pOwner = GetOwner(); - if (pOwner) + if (_pTitleTextAccessibilityElement != null) { - GetEcoreEvasMgr()->GetEcoreEvas()->SetOwner(*this, *pOwner); + _pTitleTextAccessibilityElement->SetName(L"MessageBoxTitleText"); } - r = __pMsgboxPresenter->OnAttachedToMainTree(); - SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + __pMsgboxPresenter->InitializeAccessibilityElement(); + r = GetLastResult(); + SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); - return r; + return; } result @@ -343,8 +349,27 @@ _MessageBox::OnChangeLayout(_ControlOrientation orientation) void _MessageBox::OnBoundsChanged(void) { + _AccessibilityContainer* pContainer = null; + + pContainer = GetAccessibilityContainer(); + SetClientBounds(FloatRectangle(0.0f, 0.0f, GetBoundsF().width, GetBoundsF().height)); + if ((_pTitleTextAccessibilityElement != null) && (HasTitle() == true)) + { + _pTitleTextAccessibilityElement->SetBounds(__pMsgboxPresenter->GetTitleTextBounds()); + } + + if (GetMsgBoxStyle() == MSGBOX_STYLE_NONE && pContainer != null) + { + _AccessibilityElement* pElementMessageBox = pContainer->GetChildElement(L"MessageBox"); + + if (pElementMessageBox != null) + { + pElementMessageBox->SetBounds(FloatRectangle(0.0f, 0.0f, GetBoundsF().width, GetBoundsF().height)); + } + } + return; } @@ -391,5 +416,58 @@ _MessageBox::OnSettingChanged(String& key) } } +bool +_MessageBox::OnAccessibilityFocusMovedNext(const _AccessibilityContainer& control, const _AccessibilityElement& element) +{ + return false; +} + +bool +_MessageBox::OnAccessibilityFocusMovedPrevious(const _AccessibilityContainer& control, const _AccessibilityElement& element) +{ + return false; +} + +bool +_MessageBox::OnAccessibilityReadElement(const _AccessibilityContainer& control, const _AccessibilityElement& element) +{ + return false; +} + +bool +_MessageBox::OnAccessibilityReadingElement(const _AccessibilityContainer& control, const _AccessibilityElement& element) +{ + return false; +} + +bool +_MessageBox::OnAccessibilityFocusIn(const _AccessibilityContainer& control, const _AccessibilityElement& element) +{ + return false; +} + +bool +_MessageBox::OnAccessibilityFocusOut(const _AccessibilityContainer& control, const _AccessibilityElement& element) +{ + return false; +} + +bool +_MessageBox::OnAccessibilityActionPerformed(const _AccessibilityContainer& control, const _AccessibilityElement& element) +{ + return __pMsgboxPresenter->OnAccessibilityActionPerformed(control, element); +} + +bool +_MessageBox::OnAccessibilityValueIncreased(const _AccessibilityContainer& control, const _AccessibilityElement& element) +{ + return false; +} + +bool +_MessageBox::OnAccessibilityValueDecreased(const _AccessibilityContainer& control, const _AccessibilityElement& element) +{ + return false; +} }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrl_MessageBoxPresenter.cpp b/src/ui/controls/FUiCtrl_MessageBoxPresenter.cpp index 5bf1137..bc8ea89 100644 --- a/src/ui/controls/FUiCtrl_MessageBoxPresenter.cpp +++ b/src/ui/controls/FUiCtrl_MessageBoxPresenter.cpp @@ -58,16 +58,11 @@ _MessageBoxPresenter::_MessageBoxPresenter(void) : __pMessageBox(null) , __pButtonListener(null) , __msgboxResult(MSGBOX_RESULT_CLOSE) - , __pTextAccessibilityElement(null) - , __pTitleTextObject(null) , __pBodyTextObject(null) - , __titleBounds(0.0f, 0.0f, 0.0f, 0.0f) , __textBounds(0.0f, 0.0f, 0.0f, 0.0f) , __pLabel(null) , __pScroll(null) , __pScrollPanel(null) - , __fontStyle(0) - , __fontSize(0.0f) , __scrollPos(0.0f) , __buttonNum(0) , __prevPositionY(-1.0f) @@ -95,13 +90,6 @@ _MessageBoxPresenter::~_MessageBoxPresenter(void) delete __pButtonListener; __pButtonListener = null; - if (__pTitleTextObject != null) - { - __pTitleTextObject->RemoveAll(); - delete __pTitleTextObject; - __pTitleTextObject = null; - } - if (__pBodyTextObject != null) { __pBodyTextObject->RemoveAll(); @@ -129,12 +117,6 @@ _MessageBoxPresenter::~_MessageBoxPresenter(void) delete __pScroll; __pScroll = null; } - - if (__pTextAccessibilityElement) - { - __pTextAccessibilityElement->Activate(false); - __pTextAccessibilityElement = null; - } } result @@ -142,6 +124,8 @@ _MessageBoxPresenter::OnChangeLayout(_ControlOrientation orientation) { result r = E_SUCCESS; + float titleTextSize = 0.0f; + float minTitleTextSize = 0.0f; float defaultWidth = 0.0f; float titleHeight = 0.0f; float bottomHeight = 0.0f; @@ -157,6 +141,9 @@ _MessageBoxPresenter::OnChangeLayout(_ControlOrientation orientation) float transBottomMargin = 0.0f; float labelHeight = 0.0f; + GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_SIZE, orientation, titleTextSize); + GET_SHAPE_CONFIG(POPUP::MIN_TITLE_TEXT_SIZE, orientation, minTitleTextSize); + GET_SHAPE_CONFIG(MESSAGEBOX::DEFAULT_WIDTH, orientation, defaultWidth); GET_SHAPE_CONFIG(MESSAGEBOX::BOTTOM_HEIGHT, orientation, bottomHeight); GET_SHAPE_CONFIG(MESSAGEBOX::MAX_HEIGHT, orientation, maxHeight); @@ -177,11 +164,13 @@ _MessageBoxPresenter::OnChangeLayout(_ControlOrientation orientation) { GET_SHAPE_CONFIG(MESSAGEBOX::TITLE_HEIGHT, orientation, titleHeight); - __titleBounds.width = __textBounds.width; - __pTitleTextObject->SetBounds(__titleBounds); + _titleBounds.width = __textBounds.width; + _pTitleTextObject->SetBounds(_titleBounds); + + r = CalculateTitleTextSize(titleTextSize, minTitleTextSize); + SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); - __pTitleTextObject->Compose(); - __titleBounds.height = titleHeight - titleTopMargin; + _titleBounds.height = titleHeight - titleTopMargin; } // Text @@ -271,10 +260,10 @@ _MessageBoxPresenter::Initialize(_MessageBox& msgbox) // TitleText if (__pMessageBox->HasTitle() == true) { - __pTitleTextObject = new (std::nothrow) TextObject(); - SysTryReturn(NID_UI_CTRL, __pTitleTextObject != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Unable to create TitleTextObject."); + _pTitleTextObject = new (std::nothrow) TextObject(); + SysTryReturn(NID_UI_CTRL, _pTitleTextObject != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Unable to create TitleTextObject."); - r = __pTitleTextObject->Construct(); + r = _pTitleTextObject->Construct(); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); FloatRectangle bounds = FloatRectangle(titleLeftMargin + transLeftMargin, @@ -282,10 +271,13 @@ _MessageBoxPresenter::Initialize(_MessageBox& msgbox) defaultWidth - (titleLeftMargin + titleRightMargin + transLeftMargin + transRightMargin), titleHeight - titleTopMargin); - labelHeight = GetLabelHeight(__pTitleTextObject, const_cast (__pMessageBox->GetTitleText().GetPointer()), - __pMessageBox->GetTitleText().GetLength(), bodyTextSize, bounds); + labelHeight = GetLabelHeight(_pTitleTextObject, const_cast (__pMessageBox->GetTitleText().GetPointer()), + __pMessageBox->GetTitleText().GetLength(), titleTextSize, bounds, true); - __titleBounds = FloatRectangle(titleLeftMargin + transLeftMargin, + r = GetLastResult(); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + _titleBounds = FloatRectangle(titleLeftMargin + transLeftMargin, titleTopMargin + transTopMargin, defaultWidth - (titleLeftMargin + titleRightMargin + transLeftMargin + transRightMargin), titleHeight - titleTopMargin); @@ -317,7 +309,10 @@ _MessageBoxPresenter::Initialize(_MessageBox& msgbox) SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); labelHeight = GetLabelHeight(__pBodyTextObject, const_cast (__pMessageBox->GetText().GetPointer()), - __pMessageBox->GetText().GetLength(), bodyTextSize, __textBounds); + __pMessageBox->GetText().GetLength(), bodyTextSize, __textBounds, false); + + r = GetLastResult(); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); if (__pMessageBox->GetText().GetLength() > 0) { @@ -353,8 +348,8 @@ _MessageBoxPresenter::Initialize(_MessageBox& msgbox) return r; CATCH: - delete __pTitleTextObject; - __pTitleTextObject = null; + delete _pTitleTextObject; + _pTitleTextObject = null; delete __pBodyTextObject; __pBodyTextObject = null; @@ -364,26 +359,44 @@ CATCH: } float -_MessageBoxPresenter::GetLabelHeight(TextObject* textObject, wchar_t* text, int length, float bodyTextSize, FloatRectangle bounds) +_MessageBoxPresenter::GetLabelHeight(TextObject* textObject, wchar_t* text, int length, float bodyTextSize, FloatRectangle bounds, bool isTitle) { TextSimple* pSimpleTextForBodyText = null; + result r = E_SUCCESS; // Text - result r = SetFontInfo(FONT_STYLE_PLAIN, bodyTextSize); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to set font.", GetErrorMessage(r)); - pSimpleTextForBodyText = new (std::nothrow) TextSimple(text, length, TEXT_ELEMENT_SOURCE_TYPE_EXTERNAL); SysTryCatch(NID_UI_CTRL, pSimpleTextForBodyText != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); textObject->AppendElement(*pSimpleTextForBodyText); textObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_WORD); textObject->SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV); - textObject->SetFont(_pFont, 0, textObject->GetTextLength()); textObject->SetAlignment(TEXT_OBJECT_ALIGNMENT_LEFT|TEXT_OBJECT_ALIGNMENT_MIDDLE); textObject->SetBounds(bounds); - textObject->Compose(); + + if (isTitle == true) + { + float minTitleTextSize = 0.0f; + + GET_SHAPE_CONFIG(MESSAGEBOX::MIN_TITLE_TEXT_SIZE, __pMessageBox->GetOrientation(), minTitleTextSize); + + r = CalculateTitleTextSize(bodyTextSize, minTitleTextSize); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + } + else + { + r = SetFontInfo(FONT_STYLE_PLAIN, bodyTextSize); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to set font.", GetErrorMessage(r)); + + textObject->SetFont(_pFont, 0, textObject->GetTextLength()); + + textObject->Compose(); + } + + SetLastResult(r); return textObject->GetTotalHeightF(); + CATCH: return 0.0f; } @@ -407,37 +420,11 @@ _MessageBoxPresenter::GetLeftRightLabelMargin(void) } void -_MessageBoxPresenter::OnFontChanged(Font* pFont) -{ - _pFont = pFont; -} - -void -_MessageBoxPresenter::OnFontInfoRequested(unsigned long& style, float& size) -{ - style = __fontStyle; - size = __fontSize; -} - -result -_MessageBoxPresenter::SetFontInfo(unsigned long style, float size) -{ - __fontStyle = style; - __fontSize = size; - - _pFont = __pMessageBox->GetFallbackFont(); - SysTryReturnResult(NID_UI_CTRL, _pFont != null, GetLastResult(), "Failed to get a font."); - - return E_SUCCESS; -} - -void _MessageBoxPresenter::Draw(void) { result r = E_SUCCESS; float defaultWidth = 0.0f; - float titleTextSize = 0.0f; float textSize = 0.0f; @@ -450,7 +437,6 @@ _MessageBoxPresenter::Draw(void) orientation = __pMessageBox->GetOrientation(); GET_SHAPE_CONFIG(MESSAGEBOX::DEFAULT_WIDTH, orientation, defaultWidth); - GET_SHAPE_CONFIG(MESSAGEBOX::TITLE_TEXT_SIZE, orientation, titleTextSize); GET_SHAPE_CONFIG(MESSAGEBOX::TEXT_SIZE, orientation, textSize); @@ -494,16 +480,16 @@ _MessageBoxPresenter::Draw(void) } // Draw Title - if (__pTitleTextObject != null) + if (_pTitleTextObject != null) { - r = SetFontInfo(FONT_STYLE_PLAIN, titleTextSize); + r = SetFontInfo(FONT_STYLE_PLAIN, _titleTextSize); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - __pTitleTextObject->SetFont(_pFont, 0, __pTitleTextObject->GetTextLength()); - __pTitleTextObject->SetForegroundColor(__pMessageBox->GetTitleTextColor(), 0, __pTitleTextObject->GetTextLength()); - __pTitleTextObject->SetBounds(__titleBounds); + _pTitleTextObject->SetFont(_pFont, 0, _pTitleTextObject->GetTextLength()); + _pTitleTextObject->SetForegroundColor(__pMessageBox->GetTitleTextColor(), 0, _pTitleTextObject->GetTextLength()); + _pTitleTextObject->SetBounds(_titleBounds); - __pTitleTextObject->Draw(*_CanvasImpl::GetInstance(*pCanvas)); + _pTitleTextObject->Draw(*_CanvasImpl::GetInstance(*pCanvas)); } __pLabel->SetTextColor(__pMessageBox->GetTextColor()); @@ -673,6 +659,7 @@ _MessageBoxPresenter::CreateButtons(void) __pButtons[i]->SetText(__buttonText[i]); __pButtons[i]->AddTouchEventListener(*__pButtonListener); + __pButtons[i]->AddKeyEventListener(*__pButtonListener); pImpl = _ControlImpl::GetInstance(*__pButtons[i]); pButtonCore = dynamic_cast<_Button*>(&pImpl->GetCore()); @@ -682,6 +669,12 @@ _MessageBoxPresenter::CreateButtons(void) pButtonCore->SetTouchPressThreshold(0.16); __pMessageBox->AttachChild(*pButtonCore); } + + if (i != 0) + { + __pButtons[i-1]->SetNextFocus(__pButtons[i]); + __pButtons[i]->SetPreviousFocus(__pButtons[i-1]); + } } return r; @@ -951,12 +944,6 @@ _MessageBoxPresenter::GetBodyTextHeight(void) const } FloatRectangle -_MessageBoxPresenter::GetTitleBounds(void) const -{ - return __titleBounds; -} - -FloatRectangle _MessageBoxPresenter::GetTextBounds(void) const { return __textBounds; @@ -974,85 +961,88 @@ _MessageBoxPresenter::GetReturnValue(void) const return (int) __msgboxResult; } -result -_MessageBoxPresenter::OnAttachedToMainTree(void) +void +_MessageBoxPresenter::InitializeAccessibilityElement(void) { result r = E_SUCCESS; - _AccessibilityElement* pTitleTextAccessibility = null; - pTitleTextAccessibility = __pMessageBox->GetTitleTextAccessibilityElement(); - if ((pTitleTextAccessibility != null) && (__pTextAccessibilityElement != null)) + _AccessibilityContainer* pContainer = null; + + pContainer = __pMessageBox->GetAccessibilityContainer(); + + if (pContainer == null) { - return r; + return ; } - _AccessibilityContainer* pContainer = __pMessageBox->GetAccessibilityContainer(); - if (pContainer != null) + if (__pLabel != null) { - float titleHeight = 0.0f; - GET_SHAPE_CONFIG(MESSAGEBOX::TITLE_HEIGHT, __pMessageBox->GetOrientation(), titleHeight); - - if (pTitleTextAccessibility == null) + _AccessibilityContainer* pLabelContainer = __pLabel->GetAccessibilityContainer(); + if (pLabelContainer != null) { - pTitleTextAccessibility = new (std::nothrow) _AccessibilityElement(true); - SysTryReturn(NID_UI_CTRL, pTitleTextAccessibility != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY,"[E_OUT_OF_MEMORY] Memory allocation failed."); - - pTitleTextAccessibility->Construct(L"MessageBoxTitleText", __titleBounds); - pTitleTextAccessibility->SetLabel(__pMessageBox->GetTitleText()); - pTitleTextAccessibility->SetTrait(L"Popup Title"); + _AccessibilityElement* pLabelElement = pLabelContainer->GetChildElement(L"LabelText"); + if (pLabelElement != null) + { + pLabelElement->SetName(L"MessageBoxText"); + pLabelElement->SetTrait(L"Popup body text"); + } - pContainer->AddElement(*pTitleTextAccessibility); + // Add Container + pContainer->AddChildContainer(*pLabelContainer); } + } - if (__pTextAccessibilityElement == null) + if (__pMessageBox->GetMsgBoxStyle() != MSGBOX_STYLE_NONE) + { + for (int i = 0; i < __buttonNum; i++) { - __pTextAccessibilityElement = new (std::nothrow) _AccessibilityElement(true); - SysTryReturn(NID_UI_CTRL, __pTextAccessibilityElement != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY,"[E_OUT_OF_MEMORY] Memory allocation failed."); + _ControlImpl* pImpl = null; + _Button* pButtonCore = null; - __pTextAccessibilityElement->Construct(L"MessageBoxText", __textBounds); - __pTextAccessibilityElement->SetLabel(__pMessageBox->GetText()); - __pTextAccessibilityElement->SetTrait(L"Popup body text"); + pImpl = _ControlImpl::GetInstance(*__pButtons[i]); - pContainer->AddElement(*__pTextAccessibilityElement); - } + pButtonCore = dynamic_cast<_Button*>(&pImpl->GetCore()); + r = GetLastResult(); + SysTryReturnVoidResult(NID_UI_CTRL, pButtonCore != null, r, "[%s] Propagating.", GetErrorMessage(r)); - if (__pMessageBox->GetMsgBoxStyle() != MSGBOX_STYLE_NONE) - { - for (int i = 0; i < __buttonNum; i++) + _AccessibilityContainer* pButtonContainer = pButtonCore->GetAccessibilityContainer(); + if (pButtonContainer != null) { - _ControlImpl* pImpl = null; - _Button* pButtonCore = null; - - pImpl = _ControlImpl::GetInstance(*__pButtons[i]); - - pButtonCore = dynamic_cast<_Button*>(&pImpl->GetCore()); - r = GetLastResult(); - SysTryReturn(NID_UI_CTRL, pButtonCore != null, r, r, "[%s] Propagating.", GetErrorMessage(r)); - - _AccessibilityContainer* pButtonContainer = pButtonCore->GetAccessibilityContainer(); - if (pButtonContainer != null) + _AccessibilityElement* pButtonElement = pButtonContainer->GetChildElement(L"ButtonText"); + if (pButtonElement != null) { - _AccessibilityElement* pButtonElement = pButtonContainer->GetChildElement(L"ButtonText"); - if (pButtonElement != null) - { - String numberString = null; - numberString = Integer::ToString(i + 1); + String numberString = null; + numberString = Integer::ToString(i + 1); - String buttonName = L"MessageBoxButton"; - buttonName.Append(numberString); + String buttonName = L"MessageBoxButton"; + buttonName.Append(numberString); - pButtonElement->SetName(buttonName); - } - - // Add Container - pContainer->AddChildContainer(*pButtonContainer); + pButtonElement->SetName(buttonName); } + + // Add Container + pContainer->AddChildContainer(*pButtonContainer); } } } + else + { + _AccessibilityElement* pElementMessageBox = new (std::nothrow) _AccessibilityElement(true); + SysTryReturnVoidResult(NID_UI_CTRL, pElementMessageBox != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory shortage."); + + pElementMessageBox->SetSupportOperatingGesture(false); + pElementMessageBox->SetName(L"MessageBox"); + pElementMessageBox->SetTrait(L"MessageBox"); + pElementMessageBox->SetHint(L"double tap to close"); + pElementMessageBox->SetBounds(FloatRectangle(0.0f, 0.0f, __pMessageBox->GetBoundsF().width, __pMessageBox->GetBoundsF().height)); + pContainer->AddElement(*pElementMessageBox); + } +} - return r; - +_Popup* +_MessageBoxPresenter::GetCore(void) +{ + return static_cast <_Popup*>(__pMessageBox); } bool @@ -1112,6 +1102,18 @@ _MessageBoxPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& } bool +_MessageBoxPresenter::OnAccessibilityActionPerformed(const _AccessibilityContainer& control, const _AccessibilityElement& element) +{ + if (__pMessageBox->GetMsgBoxStyle() == MSGBOX_STYLE_NONE) + { + SetReturnValue(MSGBOX_RESULT_CLOSE); + _ModalLoopManager::GetInstance()->EndMainLoop(MSGBOX_RESULT_CLOSE, false); + } + + return true; +} + +bool _MessageBoxPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo) { __touchOutBounds = false; @@ -1244,6 +1246,48 @@ _MessageBoxPresenter::_MessageBoxButtonListener::OnTouchReleased(const Control& } } +void +_MessageBoxPresenter::_MessageBoxButtonListener::OnKeyPressed(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode keyCode) +{ + const _ControlImpl* pImpl = null; + const _Button* pControl = null; + + pImpl = _ControlImpl::GetInstance(source); + pControl = dynamic_cast(&pImpl->GetCore()); + + if (pControl != null) + { + + _Button* pFocusControl = null; + switch (keyCode) + { + case KEY_RIGHT: + pFocusControl = dynamic_cast<_Button*>(pControl->GetNextFocus()); + break; + + case KEY_LEFT: + pFocusControl = dynamic_cast<_Button*>(pControl->GetPreviousFocus()); + break; + default : + break; + } + + if (pFocusControl != null) + { + _Control* pParentControl = pFocusControl->GetParent(); + + if (pParentControl != null) + { + pParentControl->OnChildControlFocusMoved(*pFocusControl); + } + + pFocusControl->SetFocused(); + pFocusControl->DrawFocus(); + } + } + + return ; +} }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrl_Popup.cpp b/src/ui/controls/FUiCtrl_Popup.cpp index 6b02ca6..a578bdd 100644 --- a/src/ui/controls/FUiCtrl_Popup.cpp +++ b/src/ui/controls/FUiCtrl_Popup.cpp @@ -157,7 +157,6 @@ _Popup::Initialize(bool hasTitle, const Tizen::Graphics::FloatRectangle& bounds) if(pContainer != null) { pContainer->Activate(true); - InitializeAccessibilityElement(); } return r; @@ -176,6 +175,12 @@ _Popup::SetPresenter(const _PopupPresenter& popupPresenter) return E_SUCCESS; } +_PopupPresenter* +_Popup::GetPresenter(void) +{ + return __pPopupPresenter; +} + result _Popup::DoModal(int& modalResult) { @@ -299,13 +304,13 @@ _Popup::SetTitleText(const String& title) { _pTitleTextAccessibilityElement->SetLabel(title); } - return E_SUCCESS; } else { return E_SYSTEM; } + } String @@ -454,7 +459,13 @@ _Popup::OnAttachedToMainTree(void) SysTryReturn(NID_UI_CTRL, GetVisibleState() != false, E_INVALID_OPERATION, E_INVALID_OPERATION, "[E_INVALID_OPERATION] This control is not 'displayable'"); - GetEcoreEvasMgr()->GetEcoreEvas()->SetOwner(*this, *GetOwner()); + _Control* pOwner = GetOwner(); + if (pOwner != null) + { + GetEcoreEvasMgr()->GetEcoreEvas()->SetOwner(*this, *pOwner); + } + + InitializeAccessibilityElement(); return E_SUCCESS; } @@ -465,16 +476,21 @@ _Popup::InitializeAccessibilityElement(void) _AccessibilityContainer* pContainer = GetAccessibilityContainer(); if (pContainer != null) { - float titleHeight = 0.0f; - GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, GetOrientation(), titleHeight); - _pTitleTextAccessibilityElement = new (std::nothrow) _AccessibilityElement(true); - SysTryReturnVoidResult(NID_UI_CTRL, _pTitleTextAccessibilityElement != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); + pContainer->RemoveAllElement(); + _pTitleTextAccessibilityElement = null; + if (HasTitle() == true) + { + _pTitleTextAccessibilityElement = new (std::nothrow) _AccessibilityElement(true); + SysTryReturnVoidResult(NID_UI_CTRL, _pTitleTextAccessibilityElement != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); - _pTitleTextAccessibilityElement->Construct(L"PopupTitleText", __pPopupPresenter->GetTitleTextBounds()); - _pTitleTextAccessibilityElement->SetLabel(GetTitleText()); - _pTitleTextAccessibilityElement->SetTrait(L"Popup Title"); + _PopupPresenter* pPresenter = GetPresenter(); + SysTryReturnVoidResult(NID_UI_CTRL, pPresenter != null, E_SYSTEM, "[E_SYSTEM] This instance is not constructed."); + _pTitleTextAccessibilityElement->Construct(L"PopupTitleText", pPresenter->GetTitleTextBounds()); + _pTitleTextAccessibilityElement->SetLabel(GetTitleText()); + _pTitleTextAccessibilityElement->SetTrait(L"Popup Title"); - pContainer->AddElement(*_pTitleTextAccessibilityElement); + pContainer->AddElement(*_pTitleTextAccessibilityElement); + } } return; @@ -498,15 +514,12 @@ _Popup::OnBoundsChanged(void) SetClientBounds(GetPopupClientArea()); if (__pPopupPresenter != null) { - __pPopupPresenter->UpdateEffectBounds(); + __pPopupPresenter->OnBoundsChanged(); } - if (_pTitleTextAccessibilityElement != null) + if ((_pTitleTextAccessibilityElement != null) && (HasTitle() == true)) { - float titleHeight = 0.0f; - GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, GetOrientation(), titleHeight); - - _pTitleTextAccessibilityElement->SetBounds(FloatRectangle(0.0f, 0.0f, GetPopupClientArea().width, titleHeight)); + _pTitleTextAccessibilityElement->SetBounds(__pPopupPresenter->GetTitleTextBounds()); } } @@ -580,15 +593,5 @@ _Popup::IsRotationSynchronized(void) const return true; } -void -_Popup::OnWindowStateChanged(void) -{ - SetOrientationCallbackModeEnabled(true); - - _Window::OnWindowStateChanged(); - - SetOrientationCallbackModeEnabled(false); -} - }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrl_PopupPresenter.cpp b/src/ui/controls/FUiCtrl_PopupPresenter.cpp index a983efc..53fb465 100644 --- a/src/ui/controls/FUiCtrl_PopupPresenter.cpp +++ b/src/ui/controls/FUiCtrl_PopupPresenter.cpp @@ -51,21 +51,25 @@ namespace Tizen { namespace Ui { namespace Controls _PopupPresenter::_PopupPresenter(void) : _pFont(null) + , _titleBounds(0.0f, 0.0f, 0.0f, 0.0f) + , _titleTextSize(0.0f) + , _fontStyle(0) + , _fontSize(0.0f) + , _pTitleTextObject(null) , __pPopup(null) , __pPopupVE(null) , __pBackgroundVE(null) - , __pTextObject(null) - , __titleBounds(0.0f, 0.0f, 0.0f, 0.0f) { //empty statement } _PopupPresenter::~_PopupPresenter(void) { - if (__pTextObject != null) + if (_pTitleTextObject != null) { - delete __pTextObject; - __pTextObject = null; + _pTitleTextObject->RemoveAll(); + delete _pTitleTextObject; + _pTitleTextObject = null; } if (__pBackgroundVE != null) @@ -153,11 +157,20 @@ _PopupPresenter::OnFontChanged(Font* pFont) void _PopupPresenter::OnFontInfoRequested(unsigned long& style, float& size) { - float textSize = 0.0f; - GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_SIZE, __pPopup->GetOrientation(), textSize); + style = _fontStyle; + size = _fontSize; +} + +result +_PopupPresenter::SetFontInfo(unsigned long style, float size) +{ + _fontStyle = style; + _fontSize = size; - style = FONT_STYLE_PLAIN; - size = textSize; + _pFont = GetCore()->GetFallbackFont(); + SysTryReturnResult(NID_UI_CTRL, _pFont != null, GetLastResult(), "Failed to get a font."); + + return E_SUCCESS; } result @@ -166,6 +179,8 @@ _PopupPresenter::SetTitleTextObject(const String &title) result r = E_SUCCESS; TextSimple* pSimpleText = null; + float titleTextSize = 0.0f; + float minTitleTextSize = 0.0f; float titleHeight = 0.0f; float titleTopMargin = 0.0f; float titleLeftMargin = 0.0f; @@ -178,6 +193,8 @@ _PopupPresenter::SetTitleTextObject(const String &title) orientation = __pPopup->GetOrientation(); + GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_SIZE, orientation, titleTextSize); + GET_SHAPE_CONFIG(POPUP::MIN_TITLE_TEXT_SIZE, orientation, minTitleTextSize); GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, orientation, titleHeight); GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_TOP_MARGIN, orientation, titleTopMargin); @@ -188,59 +205,88 @@ _PopupPresenter::SetTitleTextObject(const String &title) GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_LEFT_MARGIN, orientation, transLeftMargin); GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_RIGHT_MARGIN, orientation, transRightMargin); - // Title font - _pFont = __pPopup->GetFallbackFont(); - SysTryReturn(NID_UI_CTRL, _pFont != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); - - if (__pTextObject != null) + if (_pTitleTextObject != null) { - delete __pTextObject; + delete _pTitleTextObject; } // Title text - __pTextObject = new (std::nothrow) TextObject(); - SysTryReturn(NID_UI_CTRL, __pTextObject != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); + _pTitleTextObject = new (std::nothrow) TextObject(); + SysTryReturn(NID_UI_CTRL, _pTitleTextObject != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); - r = __pTextObject->Construct(); - SysTryCatch(NID_UI_CTRL, r == E_SUCCESS , , r, "[%s] Propagating.", GetErrorMessage(r)); + r = _pTitleTextObject->Construct(); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); pSimpleText = new (std::nothrow) TextSimple(const_cast (title.GetPointer()), title.GetLength(), TEXT_ELEMENT_SOURCE_TYPE_EXTERNAL); SysTryCatch(NID_UI_CTRL, pSimpleText != null , r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); - __pTextObject->AppendElement(*pSimpleText); - __pTextObject->SetForegroundColor(__pPopup->GetTitleTextColor(), 0, __pTextObject->GetTextLength()); - __pTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_NONE); - __pTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV); - __pTextObject->SetTextObjectEllipsisType(TEXT_OBJECT_ELLIPSIS_TYPE_TAIL); + _pTitleTextObject->AppendElement(*pSimpleText); + _pTitleTextObject->SetForegroundColor(__pPopup->GetTitleTextColor(), 0, _pTitleTextObject->GetTextLength()); + _pTitleTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_NONE); + _pTitleTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV); + _pTitleTextObject->SetTextObjectEllipsisType(TEXT_OBJECT_ELLIPSIS_TYPE_TAIL); - __pTextObject->SetFont(_pFont, 0, __pTextObject->GetTextLength()); - __pTextObject->SetAlignment(TEXT_OBJECT_ALIGNMENT_LEFT); + _pTitleTextObject->SetAlignment(TEXT_OBJECT_ALIGNMENT_LEFT); - __pTextObject->SetBounds(FloatRectangle(titleLeftMargin + transLeftMargin, + _pTitleTextObject->SetBounds(FloatRectangle(titleLeftMargin, titleTopMargin, - __pPopup->GetBoundsF().width - (titleLeftMargin + titleRightMargin + transLeftMargin + transRightMargin), + __pPopup->GetBoundsF().width - (titleLeftMargin + titleRightMargin), titleHeight - titleTopMargin)); - __pTextObject->Compose(); - // After TextObject::Compose(), we can get text-object's height. - __titleBounds.SetBounds(titleLeftMargin + transLeftMargin, + r = CalculateTitleTextSize(titleTextSize, minTitleTextSize); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + _titleBounds.SetBounds(titleLeftMargin, titleTopMargin, - __pPopup->GetBounds().width - (titleLeftMargin + titleRightMargin + transLeftMargin + transRightMargin), - __pTextObject->GetTotalHeight()); + __pPopup->GetBounds().width - (titleLeftMargin + titleRightMargin), + _pTitleTextObject->GetTotalHeight()); - __pTextObject->SetBounds(__titleBounds); + _pTitleTextObject->SetBounds(_titleBounds); return r; CATCH: - delete __pTextObject; - __pTextObject = null; + delete _pTitleTextObject; + _pTitleTextObject = null; return r; } +result +_PopupPresenter::CalculateTitleTextSize(float titleTextSize, float minTitleTextSize) +{ + result r = E_SUCCESS; + + int titleTextLength = _pTitleTextObject->GetTextLength(); + + while (titleTextSize >= minTitleTextSize) + { + r = SetFontInfo(FONT_STYLE_PLAIN, titleTextSize); + SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] failed to set font.", GetErrorMessage(r)); + _pTitleTextObject->SetFont(_pFont, 0, titleTextLength); + _pTitleTextObject->Compose(); + + if (titleTextLength <= _pTitleTextObject->GetTextLengthAt(0)) + { + break; + } + + --titleTextSize; + } + + if (titleTextSize < minTitleTextSize) + { + _titleTextSize = minTitleTextSize; + } + else + { + _titleTextSize = titleTextSize; + } + + return r; +} void _PopupPresenter::OnDraw(void) { @@ -250,7 +296,48 @@ _PopupPresenter::OnDraw(void) FloatRectangle _PopupPresenter::GetTitleTextBounds(void) const { - return __titleBounds; + return _titleBounds; +} + +void +_PopupPresenter::OnBoundsChanged(void) +{ + UpdateEffectBounds(); + + if (__pPopup->HasTitle() == true) + { + UpdateTitleTextBounds(); + } +} + +void +_PopupPresenter::UpdateTitleTextBounds(void) +{ + float titleLeftMargin = 0.0f; + float titleRightMargin = 0.0f; + float titleTextSize = 0.0f; + float minTitleTextSize = 0.0f; + + _ControlOrientation orientation; + + if (_pTitleTextObject == null) + { + return; + } + + orientation = __pPopup->GetOrientation(); + + GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_LEFT_MARGIN, orientation, titleLeftMargin); + GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_RIGHT_MARGIN, orientation, titleRightMargin); + + GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_SIZE, orientation, titleTextSize); + GET_SHAPE_CONFIG(POPUP::MIN_TITLE_TEXT_SIZE, orientation, minTitleTextSize); + + _titleBounds.width =__pPopup->GetBounds().width - (titleLeftMargin + titleRightMargin), + + _pTitleTextObject->SetBounds(_titleBounds); + + CalculateTitleTextSize(titleTextSize, minTitleTextSize); } void @@ -354,17 +441,16 @@ _PopupPresenter::Draw(void) // Draw Title if (__pPopup->HasTitle()) { - if (__pTextObject != null) + if (_pTitleTextObject != null) { - _pFont = __pPopup->GetFallbackFont(); - r = GetLastResult(); - SysTryCatch(NID_UI_CTRL, _pFont != null, , r, "[%s] Propagating.", GetErrorMessage(r)); + r = SetFontInfo(FONT_STYLE_PLAIN, _titleTextSize); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - __pTextObject->SetFont(_pFont, 0, __pTextObject->GetTextLength()); - __pTextObject->SetBounds(__titleBounds); - __pTextObject->SetForegroundColor(__pPopup->GetTitleTextColor(), 0, __pTextObject->GetTextLength()); + _pTitleTextObject->SetFont(_pFont, 0, _pTitleTextObject->GetTextLength()); + _pTitleTextObject->SetBounds(_titleBounds); + _pTitleTextObject->SetForegroundColor(__pPopup->GetTitleTextColor(), 0, _pTitleTextObject->GetTextLength()); - __pTextObject->Draw(*_CanvasImpl::GetInstance(*pCanvas)); + _pTitleTextObject->Draw(*_CanvasImpl::GetInstance(*pCanvas)); } } @@ -460,6 +546,11 @@ _PopupPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touch return true; } +_Popup* +_PopupPresenter::GetCore(void) +{ + return __pPopup; +} }}} // Tizen::Ui::Controls diff --git a/src/ui/controls/FUiCtrl_ProgressPopup.cpp b/src/ui/controls/FUiCtrl_ProgressPopup.cpp index c29c903..268224e 100644 --- a/src/ui/controls/FUiCtrl_ProgressPopup.cpp +++ b/src/ui/controls/FUiCtrl_ProgressPopup.cpp @@ -56,7 +56,6 @@ _ProgressPopup::_ProgressPopup(void) , __text(L"") , __textColor(Color(0xFFFFFFFF)) , __animationRect(0.0f, 0.0f, 0.0f, 0.0f) - , __pTextAccessibilityElement(null) , __textState(false) , __buttonState(false) , __isTransparent(false) @@ -87,12 +86,6 @@ _ProgressPopup::~_ProgressPopup(void) delete __pButton; __pButton = null; - if (__pTextAccessibilityElement) - { - __pTextAccessibilityElement->Activate(false); - __pTextAccessibilityElement = null; - } - _SettingInfoImpl::RemoveSettingEventListenerForInternal(*this); } @@ -183,7 +176,6 @@ _ProgressPopup::Initialize(bool cancelButton, bool transparent, const FloatRecta if(pContainer != null) { pContainer->Activate(true); - InitializeAccessibilityElement(); } r = _SettingInfoImpl::AddSettingEventListenerForInternal(*this); @@ -206,6 +198,12 @@ _ProgressPopup::SetPresenter(const _ProgressPopupPresenter& ProgressPopupPresent return E_SUCCESS; } +_PopupPresenter* +_ProgressPopup::GetPresenter(void) +{ + return static_cast <_PopupPresenter*>(__pProgressPopupPresenter); +} + result _ProgressPopup::DoModal(int& modalResult) { @@ -243,13 +241,13 @@ _ProgressPopup::SetTitleText(const String& title) _titleText = title; _titleState = true; + __pProgressPopupPresenter->SetTitleTextObject(); + if (_pTitleTextAccessibilityElement != null) { _pTitleTextAccessibilityElement->SetLabel(title); } - __pProgressPopupPresenter->SetTitleTextObject(); - return r; } @@ -261,11 +259,6 @@ _ProgressPopup::SetText(const String& text) __text = text; __textState = true; - if (__pTextAccessibilityElement != null) - { - __pTextAccessibilityElement->SetLabel(text); - } - __pProgressPopupPresenter->SetTextObject(); return r; @@ -531,6 +524,11 @@ _ProgressPopup::OnBoundsChanged(void) { SetClientBounds(FloatRectangle(0.0f, 0.0f, GetBoundsF().width, GetBoundsF().height)); + if ((HasTitle() == true) && (_pTitleTextAccessibilityElement != null)) + { + _pTitleTextAccessibilityElement->SetBounds(__pProgressPopupPresenter->GetTitleTextBounds()); + } + return; } @@ -540,17 +538,6 @@ _ProgressPopup::OnVisibleStateChanged(void) _Window::OnVisibleStateChanged(); } -result -_ProgressPopup::OnAttachedToMainTree(void) -{ - SysTryReturn(NID_UI_CTRL, GetVisibleState() != false, E_INVALID_OPERATION, - E_INVALID_OPERATION, "[E_INVALID_OPERATION] This control is not 'displayable'"); - - GetEcoreEvasMgr()->GetEcoreEvas()->SetOwner(*this, *GetOwner()); - - return E_SUCCESS; -} - void _ProgressPopup::OnActivated(void) { @@ -608,32 +595,33 @@ _ProgressPopup::OnDeactivated(void) void _ProgressPopup::InitializeAccessibilityElement(void) { - _AccessibilityContainer* pContainer = GetAccessibilityContainer(); - if (_pTitleTextAccessibilityElement == null) - { - _pTitleTextAccessibilityElement = new (std::nothrow) _AccessibilityElement(true); - SysTryReturnVoidResult(NID_UI_CTRL, _pTitleTextAccessibilityElement != null, E_OUT_OF_MEMORY,"[E_OUT_OF_MEMORY] Memory allocation failed."); + result r = E_SUCCESS; - _pTitleTextAccessibilityElement->Construct(L"ProgressPopupTitleText", __pProgressPopupPresenter->GetTitleBounds()); - _pTitleTextAccessibilityElement->SetLabel(GetTitleText()); - _pTitleTextAccessibilityElement->SetTrait(L"Popup Title"); + _Popup::InitializeAccessibilityElement(); - pContainer->AddElement(*_pTitleTextAccessibilityElement); + if (_pTitleTextAccessibilityElement != null) + { + _pTitleTextAccessibilityElement->SetName(L"ProgressPopupTitleText"); } - if (__pTextAccessibilityElement == null) - { - __pTextAccessibilityElement = new (std::nothrow) _AccessibilityElement(true); - SysTryReturnVoidResult(NID_UI_CTRL, __pTextAccessibilityElement != null, E_OUT_OF_MEMORY,"[E_OUT_OF_MEMORY] Memory allocation failed."); + __pProgressPopupPresenter->InitializeAccessibilityElement(); + r = GetLastResult(); + SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); - __pTextAccessibilityElement->Construct(L"ProgressPopupText", __pProgressPopupPresenter->GetTextBounds()); - __pTextAccessibilityElement->SetLabel(GetText()); - __pTextAccessibilityElement->SetTrait(L"Popup body text"); + if (HasButton() == true) + { - pContainer->AddElement(*__pTextAccessibilityElement); + SetCancelButtonAccessibilityElement(); } + return; +} - if (HasButton() == true) +void +_ProgressPopup::SetCancelButtonAccessibilityElement(void) +{ + _AccessibilityContainer* pContainer = GetAccessibilityContainer(); + + if (pContainer != null) { _ControlImpl* pImpl = null; _Button* pButtonCore = null; @@ -645,6 +633,7 @@ _ProgressPopup::InitializeAccessibilityElement(void) SysTryReturnVoidResult(NID_UI_CTRL, pButtonCore != null, r, "[%s] Propagating.", GetErrorMessage(r)); _AccessibilityContainer* pButtonContainer = pButtonCore->GetAccessibilityContainer(); + if (pButtonContainer != null) { _AccessibilityElement* pButtonElement = pButtonContainer->GetChildElement(L"ButtonText"); @@ -657,10 +646,7 @@ _ProgressPopup::InitializeAccessibilityElement(void) pContainer->AddChildContainer(*pButtonContainer); } } - return; } - - void _ProgressPopup::OnChangeLayout(_ControlOrientation orientation) { diff --git a/src/ui/controls/FUiCtrl_ProgressPopupPresenter.cpp b/src/ui/controls/FUiCtrl_ProgressPopupPresenter.cpp index 1eca1a5..2058d88 100644 --- a/src/ui/controls/FUiCtrl_ProgressPopupPresenter.cpp +++ b/src/ui/controls/FUiCtrl_ProgressPopupPresenter.cpp @@ -26,6 +26,8 @@ #include #include #include +#include "FUi_AccessibilityContainer.h" +#include "FUi_AccessibilityElement.h" #include "FUi_CoordinateSystemUtils.h" #include "FUi_ResourceManager.h" #include "FUi_UiTouchEvent.h" @@ -50,16 +52,12 @@ namespace Tizen { namespace Ui { namespace Controls _ProgressPopupPresenter::_ProgressPopupPresenter(void) : __pProgressPopup(null) - , __pTitleTextObject(null) , __pBodyTextObject(null) - , __titleBounds(0.0f, 0.0f, 0.0f, 0.0f) , __textBounds(0.0f, 0.0f, 0.0f, 0.0f) , __pLabel(null) , __pScrollPanel(null) , __pAnimation(null) , __pAnimationFrameList(null) - , __fontStyle(0) - , __fontSize(0.0f) , __textObjectHeight(0.0f) , __currentIndex(0) , __buttonPressState(false) @@ -70,13 +68,6 @@ _ProgressPopupPresenter::_ProgressPopupPresenter(void) _ProgressPopupPresenter::~_ProgressPopupPresenter(void) { - if (__pTitleTextObject != null) - { - __pTitleTextObject->RemoveAll(); - delete __pTitleTextObject; - __pTitleTextObject = null; - } - if (__pBodyTextObject != null) { __pBodyTextObject->RemoveAll(); @@ -128,6 +119,7 @@ void _ProgressPopupPresenter::SetTitleTextObject(void) { float titleTextSize = 0.0f; + float minTitleTextSize = 0.0f; float defaultWidth = 0.0f; float titleHeight = 0.0f; float titleTopMargin = 0.0f; @@ -143,6 +135,7 @@ _ProgressPopupPresenter::SetTitleTextObject(void) orientation = __pProgressPopup->GetOrientation(); GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_SIZE, orientation, titleTextSize); + GET_SHAPE_CONFIG(POPUP::MIN_TITLE_TEXT_SIZE, orientation, minTitleTextSize); GET_SHAPE_CONFIG(MESSAGEBOX::DEFAULT_WIDTH, orientation, defaultWidth); GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, orientation, titleHeight); GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_TOP_MARGIN, orientation, titleTopMargin); @@ -157,15 +150,12 @@ _ProgressPopupPresenter::SetTitleTextObject(void) { result r = E_SUCCESS; - if (__pTitleTextObject == null) //add for landscape + if (_pTitleTextObject == null) //add for landscape { - __pTitleTextObject = new (std::nothrow) TextObject(); - SysTryReturnVoidResult(NID_UI_CTRL, __pTitleTextObject != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); + _pTitleTextObject = new (std::nothrow) TextObject(); + SysTryReturnVoidResult(NID_UI_CTRL, _pTitleTextObject != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); - r = SetFontInfo(FONT_STYLE_PLAIN, titleTextSize); - SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Failed to set font.", GetErrorMessage(r)); - - r = __pTitleTextObject->Construct(); + r = _pTitleTextObject->Construct(); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); TextSimple* pSimpleTextForTitleText = new (std::nothrow) TextSimple(const_cast (__pProgressPopup->GetTitleText().GetPointer()), @@ -173,22 +163,24 @@ _ProgressPopupPresenter::SetTitleTextObject(void) TEXT_ELEMENT_SOURCE_TYPE_EXTERNAL); SysTryCatch(NID_UI_CTRL, pSimpleTextForTitleText != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); - __pTitleTextObject->AppendElement(*pSimpleTextForTitleText); - __pTitleTextObject->SetForegroundColor(__pProgressPopup->GetTitleTextColor(), 0, __pTitleTextObject->GetTextLength()); - __pTitleTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_NONE); - __pTitleTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV); - __pTitleTextObject->SetTextObjectEllipsisType(TEXT_OBJECT_ELLIPSIS_TYPE_TAIL); + _pTitleTextObject->AppendElement(*pSimpleTextForTitleText); + _pTitleTextObject->SetForegroundColor(__pProgressPopup->GetTitleTextColor(), 0, _pTitleTextObject->GetTextLength()); + _pTitleTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_NONE); + _pTitleTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV); + _pTitleTextObject->SetTextObjectEllipsisType(TEXT_OBJECT_ELLIPSIS_TYPE_TAIL); - __pTitleTextObject->SetFont(_pFont, 0, __pTitleTextObject->GetTextLength()); - __pTitleTextObject->SetAlignment(TEXT_OBJECT_ALIGNMENT_LEFT); + _pTitleTextObject->SetAlignment(TEXT_OBJECT_ALIGNMENT_LEFT); } - __pTitleTextObject->SetBounds(FloatRectangle(titleLeftMargin + transLeftMargin, + + _pTitleTextObject->SetBounds(FloatRectangle(titleLeftMargin + transLeftMargin, titleTopMargin + transTopMargin, defaultWidth - (titleLeftMargin + titleRightMargin + transLeftMargin + transRightMargin), titleHeight - titleTopMargin)); - __pTitleTextObject->Compose(); - __titleBounds = FloatRectangle(titleLeftMargin + transLeftMargin, + r = CalculateTitleTextSize(titleTextSize, minTitleTextSize); + SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + _titleBounds = FloatRectangle(titleLeftMargin + transLeftMargin, titleTopMargin + transTopMargin, defaultWidth - (titleLeftMargin + titleRightMargin + transLeftMargin + transRightMargin), titleHeight - titleTopMargin); @@ -196,8 +188,8 @@ _ProgressPopupPresenter::SetTitleTextObject(void) return; CATCH: - delete __pTitleTextObject; - __pTitleTextObject = null; + delete _pTitleTextObject; + _pTitleTextObject = null; return; } @@ -261,6 +253,7 @@ _ProgressPopupPresenter::SetTextObject(void) { __pLabel = _Label::CreateLabelN(); SysTryCatch(NID_UI_CTRL, __pLabel != null, , E_OUT_OF_MEMORY, "[E_SYSTEM] Failed to create the scroll."); + __pBodyTextObject = new (std::nothrow) TextObject(); SysTryReturnVoidResult(NID_UI_CTRL, __pBodyTextObject != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed."); @@ -330,6 +323,7 @@ _ProgressPopupPresenter::SetTextObject(void) { __pScrollPanel->SetBounds(__textBounds); } + } return; @@ -454,31 +448,6 @@ _ProgressPopupPresenter::OnAnimationStopped(const _Control & source) } void -_ProgressPopupPresenter::OnFontChanged(Font* pFont) -{ - _pFont = pFont; -} - -void -_ProgressPopupPresenter::OnFontInfoRequested(unsigned long& style, float& size) -{ - style = __fontStyle; - size = __fontSize; -} - -result -_ProgressPopupPresenter::SetFontInfo(unsigned long style, float size) -{ - __fontStyle = style; - __fontSize = size; - - _pFont = __pProgressPopup->GetFallbackFont(); - SysTryReturnResult(NID_UI_CTRL, _pFont != null, GetLastResult(), "Failed to get a font."); - - return E_SUCCESS; -} - -void _ProgressPopupPresenter::Draw(void) { result r = E_SUCCESS; @@ -545,14 +514,14 @@ _ProgressPopupPresenter::Draw(void) } // Draw Title text - if (__pTitleTextObject != null) + if (_pTitleTextObject != null) { - r = SetFontInfo(FONT_STYLE_PLAIN, titleTextSize); + r = SetFontInfo(FONT_STYLE_PLAIN, _titleTextSize); SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - __pTitleTextObject->SetFont(_pFont, 0, __pTitleTextObject->GetTextLength()); - __pTitleTextObject->SetBounds(__titleBounds); - __pTitleTextObject->Draw(*_CanvasImpl::GetInstance(*pCanvas)); + _pTitleTextObject->SetFont(_pFont, 0, _pTitleTextObject->GetTextLength()); + _pTitleTextObject->SetBounds(_titleBounds); + _pTitleTextObject->Draw(*_CanvasImpl::GetInstance(*pCanvas)); } if (__pLabel != null) @@ -593,12 +562,6 @@ _ProgressPopupPresenter::GetBodyTextHeight(void) const } FloatRectangle -_ProgressPopupPresenter::GetTitleBounds(void) const -{ - return __titleBounds; -} - -FloatRectangle _ProgressPopupPresenter::GetTextBounds(void) const { return __textBounds; @@ -674,6 +637,41 @@ _ProgressPopupPresenter::GetButtonBounds(void) const return FloatRectangle(x, y, width, height); } +void +_ProgressPopupPresenter::InitializeAccessibilityElement(void) +{ + _AccessibilityContainer* pContainer = __pProgressPopup->GetAccessibilityContainer(); + + if (pContainer == null) + { + return ; + } + + if (__pLabel != null) + { + _AccessibilityContainer* pLabelContainer = __pLabel->GetAccessibilityContainer(); + if (pLabelContainer != null) + { + _AccessibilityElement* pLabelElement = pLabelContainer->GetChildElement(L"LabelText"); + if (pLabelElement != null) + { + pLabelElement->SetName(L"ProgressPopupText"); + pLabelElement->SetTrait(L"Popup body text"); + } + + // Add Container + pContainer->AddChildContainer(*pLabelContainer); + } + } +} + + +_Popup* +_ProgressPopupPresenter::GetCore(void) +{ + return static_cast <_Popup*>(__pProgressPopup); +} + bool _ProgressPopupPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo) { diff --git a/src/ui/inc/FUiCtrl_MessageBox.h b/src/ui/inc/FUiCtrl_MessageBox.h index e5c5deb..2ad5941 100644 --- a/src/ui/inc/FUiCtrl_MessageBox.h +++ b/src/ui/inc/FUiCtrl_MessageBox.h @@ -28,7 +28,7 @@ #include #include #include "FUiCtrl_Popup.h" - +#include "FUi_IAccessibilityListener.h" namespace Tizen { namespace Ui { namespace Controls { @@ -50,6 +50,7 @@ class _OSP_EXPORT_ _MessageBox , virtual public _IUiEventListener , virtual public _IUiEventPreviewer , virtual public Tizen::System::ISettingEventListener + , public _IAccessibilityListener { // Lifecycle public: @@ -72,13 +73,20 @@ public: virtual void OnActivated(void); virtual void OnDeactivated(void); - virtual result OnAttachedToMainTree(void); - virtual void OnChangeLayout(_ControlOrientation orientation); virtual void OnBoundsChanged(void); virtual void OnSettingChanged(Tizen::Base::String& key); + virtual bool OnAccessibilityFocusMovedNext(const _AccessibilityContainer& control, const _AccessibilityElement& element); + virtual bool OnAccessibilityFocusMovedPrevious(const _AccessibilityContainer& control, const _AccessibilityElement& element); + virtual bool OnAccessibilityReadingElement(const _AccessibilityContainer& control, const _AccessibilityElement& element); + virtual bool OnAccessibilityReadElement(const _AccessibilityContainer& control, const _AccessibilityElement& element); + virtual bool OnAccessibilityFocusIn(const _AccessibilityContainer& control, const _AccessibilityElement& element); + virtual bool OnAccessibilityFocusOut(const _AccessibilityContainer& control, const _AccessibilityElement& element); + virtual bool OnAccessibilityActionPerformed(const _AccessibilityContainer& control, const _AccessibilityElement& element); + virtual bool OnAccessibilityValueIncreased(const _AccessibilityContainer& control, const _AccessibilityElement& element); + virtual bool OnAccessibilityValueDecreased(const _AccessibilityContainer& control, const _AccessibilityElement& element); // Accessors public: MessageBoxStyle GetMsgBoxStyle(void) const; @@ -92,11 +100,13 @@ public: protected: result SetPresenter(const _MessageBoxPresenter& msgboxPresenter); + virtual _PopupPresenter* GetPresenter(void); // Touch Event Listener virtual bool OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo); virtual bool OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo); virtual bool OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo); + virtual void InitializeAccessibilityElement(void); private: _MessageBox(void); diff --git a/src/ui/inc/FUiCtrl_MessageBoxPresenter.h b/src/ui/inc/FUiCtrl_MessageBoxPresenter.h index 06c8249..ec0ab98 100644 --- a/src/ui/inc/FUiCtrl_MessageBoxPresenter.h +++ b/src/ui/inc/FUiCtrl_MessageBoxPresenter.h @@ -69,14 +69,8 @@ public: virtual result ShowAndWait(int& modalResult); - result OnAttachedToMainTree(void); - - void OnFontChanged(Tizen::Graphics::Font* pFont); - void OnFontInfoRequested(unsigned long& style, float& size); result OnChangeLayout(_ControlOrientation orientation); - result SetFontInfo(unsigned long style, float size); - // get touch event from _MessageBox, for drawing scroll in TextObject virtual bool OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo); virtual bool OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo); @@ -84,17 +78,19 @@ public: void UpdateButtonString(void); + void InitializeAccessibilityElement(void); + + bool OnAccessibilityActionPerformed(const _AccessibilityContainer& control, const _AccessibilityElement& element); //Accessor public: float GetBodyTextHeight(void) const; float GetBodyTextObjHeight(void) const; - Tizen::Graphics::FloatRectangle GetTitleBounds(void) const; Tizen::Graphics::FloatRectangle GetTextBounds(void) const; protected: virtual void ProcessEvent(void); - + virtual _Popup* GetCore(void); private: _MessageBoxPresenter(const _MessageBoxPresenter& rhs); _MessageBoxPresenter& operator =(const _MessageBoxPresenter& rhs); @@ -108,7 +104,7 @@ private: void SetReturnValue(MessageBoxModalResult rtn); int GetReturnValue(void) const; - float GetLabelHeight(Tizen::Graphics::_Text::TextObject* textObject, wchar_t* text, int length, float fontSize, FloatRectangle bounds); + float GetLabelHeight(Tizen::Graphics::_Text::TextObject* textObject, wchar_t* text, int length, float fontSize, FloatRectangle bounds, bool isTitle); float GetLeftRightLabelMargin(void); void GetButtonString(void); @@ -117,6 +113,7 @@ private: private: class _MessageBoxButtonListener : public ITouchEventListener + , public IKeyEventListener , virtual public Tizen::Base::Runtime::IEventListener { public: @@ -141,6 +138,9 @@ protected: const Tizen::Ui::TouchEventInfo& touchInfo) {} virtual void OnTouchFocusOut(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo) {} + virtual void OnKeyPressed(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode keyCode); + virtual void OnKeyReleased(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode keyCode) {} + virtual void OnKeyLongPressed(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode keyCode) {} private: _ControlHandle __buttonHandle; @@ -170,21 +170,14 @@ private: Tizen::Ui::Controls::Button* __pButtons[MSGBOX_MAX_BUTTON_NUM]; Tizen::Base::String __buttonText[MSGBOX_MAX_BUTTON_NUM]; - Tizen::Ui::_AccessibilityElement* __pTextAccessibilityElement; - - Tizen::Graphics::_Text::TextObject* __pTitleTextObject; Tizen::Graphics::_Text::TextObject* __pBodyTextObject; - Tizen::Graphics::FloatRectangle __titleBounds; Tizen::Graphics::FloatRectangle __textBounds; Tizen::Ui::Controls::_Label* __pLabel; Tizen::Ui::Controls::_Scroll* __pScroll; Tizen::Ui::Controls::_ScrollPanel* __pScrollPanel; - unsigned long __fontStyle; - float __fontSize; - float __scrollPos; int __buttonNum; float __prevPositionY; diff --git a/src/ui/inc/FUiCtrl_Popup.h b/src/ui/inc/FUiCtrl_Popup.h index 7906aa9..621fb4b 100644 --- a/src/ui/inc/FUiCtrl_Popup.h +++ b/src/ui/inc/FUiCtrl_Popup.h @@ -107,8 +107,6 @@ public: virtual void UpdateClientBounds(const Tizen::Graphics::FloatDimension& size, Tizen::Graphics::FloatRectangle& clientBounds); virtual bool IsRotationSynchronized(void) const; - virtual void OnWindowStateChanged(void); - // Accessor public: void SetColor(const Tizen::Graphics::Color& color); @@ -134,6 +132,7 @@ protected: _Popup(void); result SetPresenter(const _PopupPresenter& popupPresenter); + virtual _PopupPresenter* GetPresenter(void); virtual void InitializeAccessibilityElement(void); diff --git a/src/ui/inc/FUiCtrl_PopupPresenter.h b/src/ui/inc/FUiCtrl_PopupPresenter.h index f6b5092..b1eeafa 100644 --- a/src/ui/inc/FUiCtrl_PopupPresenter.h +++ b/src/ui/inc/FUiCtrl_PopupPresenter.h @@ -68,11 +68,14 @@ public: Tizen::Graphics::FloatRectangle GetTitleTextBounds(void) const; void UpdateEffectBounds(void); + void UpdateTitleTextBounds(void); void OnActivated(void); + void OnBoundsChanged(void); void OnFontChanged(Tizen::Graphics::Font* pFont); void OnFontInfoRequested(unsigned long& style, float& size); + result SetFontInfo(unsigned long style, float size); // Touch Event Listener virtual bool OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo); @@ -80,6 +83,8 @@ public: protected: virtual void ProcessEvent(void); + result CalculateTitleTextSize(float titleTextSize, float minTitleTextSize); + virtual _Popup* GetCore(void); private: _PopupPresenter(const _PopupPresenter& rhs); @@ -88,6 +93,12 @@ private: //Attribute protected: Tizen::Graphics::Font* _pFont; + Tizen::Graphics::FloatRectangle _titleBounds; + float _titleTextSize; + unsigned long _fontStyle; + float _fontSize; + Tizen::Graphics::_Text::TextObject* _pTitleTextObject; + private: _Popup* __pPopup; @@ -95,9 +106,6 @@ private: Tizen::Ui::Animations::_VisualElement* __pPopupVE; Tizen::Ui::Animations::_VisualElement* __pBackgroundVE; - Tizen::Graphics::_Text::TextObject* __pTextObject; - Tizen::Graphics::FloatRectangle __titleBounds; - }; // _PopupPresenter diff --git a/src/ui/inc/FUiCtrl_ProgressPopup.h b/src/ui/inc/FUiCtrl_ProgressPopup.h index 38c4fc8..64798a6 100644 --- a/src/ui/inc/FUiCtrl_ProgressPopup.h +++ b/src/ui/inc/FUiCtrl_ProgressPopup.h @@ -73,8 +73,6 @@ public: virtual void OnFontChanged(Tizen::Graphics::Font* pFont); virtual void OnFontInfoRequested(unsigned long& style, float& size); - virtual result OnAttachedToMainTree(void); - virtual void OnActivated(void); virtual void OnDeactivated(void); @@ -111,13 +109,16 @@ public: float GetTotalHeight(void) const; Tizen::Graphics::FloatRectangle GetAnimationRect(void) const; + Tizen::Graphics::FloatRectangle GetTitleBounds(void) const; void SetButtonText(void); + void SetCancelButtonAccessibilityElement(void); protected: result SetPresenter(const _ProgressPopupPresenter& ProgressPopupPresenter); + virtual _PopupPresenter* GetPresenter(void); - virtual void InitializeAccessibilityElement(void); + virtual void InitializeAccessibilityElement(void); private: _ProgressPopup(void); @@ -137,8 +138,6 @@ private: Tizen::Graphics::FloatRectangle __animationRect; - Tizen::Ui::_AccessibilityElement* __pTextAccessibilityElement; - bool __textState; bool __buttonState; bool __isTransparent; diff --git a/src/ui/inc/FUiCtrl_ProgressPopupPresenter.h b/src/ui/inc/FUiCtrl_ProgressPopupPresenter.h index df83dc0..89b00b1 100644 --- a/src/ui/inc/FUiCtrl_ProgressPopupPresenter.h +++ b/src/ui/inc/FUiCtrl_ProgressPopupPresenter.h @@ -72,18 +72,12 @@ public: float GetBodyTextObjHeight(void) const; Tizen::Graphics::FloatRectangle GetButtonBounds(void) const; - Tizen::Graphics::FloatRectangle GetTitleBounds(void) const; Tizen::Graphics::FloatRectangle GetTextBounds(void) const; result PlayProcessAnimation(void); result StopProcessAnimation(void); result SetProcessAnimation(void); - void OnFontChanged(Tizen::Graphics::Font* pFont); - void OnFontInfoRequested(unsigned long& style, float& size); - - result SetFontInfo(unsigned long style, float size); - // Touch Event Listener virtual bool OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo); virtual bool OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo); @@ -93,18 +87,18 @@ public: result OnChangeLayout(_ControlOrientation orientation); + void InitializeAccessibilityElement(void); + private: _ProgressPopupPresenter(const _ProgressPopupPresenter& rhs); _ProgressPopupPresenter& operator =(const _ProgressPopupPresenter& rhs); - + virtual _Popup* GetCore(void); //Attribute private: _ProgressPopup* __pProgressPopup; - Tizen::Graphics::_Text::TextObject* __pTitleTextObject; Tizen::Graphics::_Text::TextObject* __pBodyTextObject; - Tizen::Graphics::FloatRectangle __titleBounds; Tizen::Graphics::FloatRectangle __textBounds; Tizen::Ui::Controls::_Label* __pLabel; @@ -113,9 +107,6 @@ private: _Animation* __pAnimation; Tizen::Base::Collection::ArrayList* __pAnimationFrameList; - unsigned long __fontStyle; - float __fontSize; - float __textObjectHeight; int __currentIndex; diff --git a/src/ui/inc/FUi_ResourceMessageBoxConfig.h b/src/ui/inc/FUi_ResourceMessageBoxConfig.h index f716429..83ce528 100644 --- a/src/ui/inc/FUi_ResourceMessageBoxConfig.h +++ b/src/ui/inc/FUi_ResourceMessageBoxConfig.h @@ -58,6 +58,7 @@ DECLARE_UI_CONFIG(MESSAGEBOX); DECLARE_SHAPE_CONFIG(BUTTON_SIDE_MARGIN_02, 25); DECLARE_SHAPE_CONFIG(BUTTON_SIDE_MARGIN_03, 26); DECLARE_SHAPE_CONFIG(TEXT_HEIGHT, 27); + DECLARE_SHAPE_CONFIG(MIN_TITLE_TEXT_SIZE, 28); DECLARE_END_UI_CONFIG(MESSAGEBOX); #endif //_FUI_RESOURCE_MESSAGEBOX_CONFIG_H_ diff --git a/src/ui/inc/FUi_ResourcePopupConfig.h b/src/ui/inc/FUi_ResourcePopupConfig.h index 823d5e5..438b215 100644 --- a/src/ui/inc/FUi_ResourcePopupConfig.h +++ b/src/ui/inc/FUi_ResourcePopupConfig.h @@ -56,5 +56,6 @@ DECLARE_UI_CONFIG(POPUP); DECLARE_SHAPE_CONFIG(BG_OUTLINE_EFFECT_RIGHT_MARGIN, 21); DECLARE_SHAPE_CONFIG(BODY_TEXT_HEIGHT, 22); DECLARE_SHAPE_CONFIG(PROCESS_ANIMATION_WITH_TITLE_TOP_MARGIN, 23); + DECLARE_SHAPE_CONFIG(MIN_TITLE_TEXT_SIZE, 24); DECLARE_END_UI_CONFIG(POPUP); #endif //_FUI_RESOURCE_POPUP_CONFIG_H_ diff --git a/src/ui/resource/FUi_ResourceMessageBoxConfig.cpp b/src/ui/resource/FUi_ResourceMessageBoxConfig.cpp index 6bd78b2..787a731 100644 --- a/src/ui/resource/FUi_ResourceMessageBoxConfig.cpp +++ b/src/ui/resource/FUi_ResourceMessageBoxConfig.cpp @@ -49,6 +49,7 @@ START_UI_CONFIG(MESSAGEBOX); ADD_SHAPE_CONFIG(TITLE_HEIGHT, 78); // 20130403 ADD_SHAPE_CONFIG(TITLE_TEXT_SIZE, 50); // 20121113 + ADD_SHAPE_CONFIG(MIN_TITLE_TEXT_SIZE, 42); // 20121113 ADD_SHAPE_CONFIG(TITLE_TEXT_TOP_MARGIN, 20); // 20130403 ADD_SHAPE_CONFIG(TITLE_TEXT_LEFT_MARGIN, 29); // 20130403 ADD_SHAPE_CONFIG(TITLE_TEXT_RIGHT_MARGIN, 29); // 20130403 diff --git a/src/ui/resource/FUi_ResourcePopupConfig.cpp b/src/ui/resource/FUi_ResourcePopupConfig.cpp index b1da0c1..a66bd64 100644 --- a/src/ui/resource/FUi_ResourcePopupConfig.cpp +++ b/src/ui/resource/FUi_ResourcePopupConfig.cpp @@ -82,6 +82,7 @@ START_UI_CONFIG(POPUP); ADD_SHAPE_CONFIG(TITLE_HEIGHT, 78); //20130403 ADD_SHAPE_CONFIG(TITLE_TEXT_SIZE, 50); //20121113 + ADD_SHAPE_CONFIG(MIN_TITLE_TEXT_SIZE, 42); //20130507 ADD_SHAPE_CONFIG(TITLE_TEXT_TOP_MARGIN, 20); //20130403 ADD_SHAPE_CONFIG(TITLE_TEXT_LEFT_MARGIN, 29); //20130403 ADD_SHAPE_CONFIG(TITLE_TEXT_RIGHT_MARGIN, 29); //20130403