X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fui%2Fcontrols%2FFUiCtrl_FormImpl.cpp;h=ae4e5089e9dee2b2b124e5813dedf1efaf55b63b;hb=9d79922e94340196bcff0b2c7760e59abb7e8de5;hp=3475998adf554507c528733e3cb9a031f1d3c9d8;hpb=65ec482025f84b8256d4f02ba4ae53709f369385;p=platform%2Fframework%2Fnative%2Fuifw.git diff --git a/src/ui/controls/FUiCtrl_FormImpl.cpp b/src/ui/controls/FUiCtrl_FormImpl.cpp index 3475998..ae4e508 100644 --- a/src/ui/controls/FUiCtrl_FormImpl.cpp +++ b/src/ui/controls/FUiCtrl_FormImpl.cpp @@ -328,19 +328,48 @@ _FormImpl::SetFormStyle(unsigned long formStyle) { GetCore().SetIndicatorShowState(true); indicatorBounds = GetCore().GetIndicatorBoundsF(); + + if (FORM_STYLE_LANDSCAPE_INDICATOR_AUTO_HIDE & formStyle) + { + GetCore().SetIndicatorAutoHide(false, true); + } + else + { + GetCore().SetIndicatorAutoHide(false, false); + } r = GetLastResult(); SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); } - else if(FORM_STYLE_INDICATOR_AUTO_HIDE & formStyle) - { - r = GetCore().SetIndicatorShowState(false, true); - SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); - } else { - r = GetCore().SetIndicatorShowState(false); - SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + if ((FORM_STYLE_INDICATOR_AUTO_HIDE & formStyle) && (FORM_STYLE_LANDSCAPE_INDICATOR_AUTO_HIDE & formStyle)) + { + r = GetCore().SetIndicatorShowState(true); + GetCore().SetIndicatorAutoHide(true, true); + SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + } + else + { + if (FORM_STYLE_INDICATOR_AUTO_HIDE & formStyle) + { + r = GetCore().SetIndicatorShowState(true); + GetCore().SetIndicatorAutoHide(true, false); + SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + } + else if(FORM_STYLE_LANDSCAPE_INDICATOR_AUTO_HIDE & formStyle) + { + r = GetCore().SetIndicatorShowState(true); + GetCore().SetIndicatorAutoHide(false, true); + SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + } + else + { + r = GetCore().SetIndicatorShowState(false); + GetCore().SetIndicatorAutoHide(false, false); + SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + } + } } if (formStyle & FORM_STYLE_HEADER) @@ -492,7 +521,7 @@ _FormImpl::SetFormStyle(unsigned long formStyle) r = GetCore().AttachSystemChild(pFooter->GetCore()); SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); - //[ToDo] + GetCore().SetFormBackEventListener(this); GetCore().SetFormMenuEventListener(this); } @@ -839,7 +868,6 @@ _FormImpl::TranslateFromClientAreaPosition(const FloatPoint& clientPosition) con void _FormImpl::SetFormBackEventListener(const IFormBackEventListener* pFormBackEventListener) { - SysTryReturnVoidResult(NID_UI_CTRL, GetFooter() || GetHeader(), E_INVALID_STATE, "[E_INVALID_STATE] Footer isn't constructed."); __pFormBackEventListener = const_cast (pFormBackEventListener); GetCore().SetFormBackEventListener(this); result r = GetLastResult(); @@ -849,7 +877,6 @@ _FormImpl::SetFormBackEventListener(const IFormBackEventListener* pFormBackEvent void _FormImpl::SetFormMenuEventListener(const IFormMenuEventListener* pFormMenuEventListener) { - SysTryReturnVoidResult(NID_UI_CTRL, GetFooter() || GetHeader(), E_INVALID_STATE, "[E_INVALID_STATE] Footer isn't constructed."); __pFormMenuEventListener = const_cast (pFormMenuEventListener); GetCore().SetFormMenuEventListener(this); result r = GetLastResult(); @@ -1136,7 +1163,6 @@ _FormImpl::OnChangeLayout(_ControlOrientation orientation) FloatDimension portraitSize = _ControlManager::GetInstance()->_ControlManager::GetScreenSizeF(); FloatDimension landscapeSize = FloatDimension(portraitSize.height, portraitSize.width); - // Adjust the position of the partial Frame. _FrameImpl* pFrameImpl = dynamic_cast<_FrameImpl*>(GetParent()); if (pFrameImpl) { @@ -1148,57 +1174,38 @@ _FormImpl::OnChangeLayout(_ControlOrientation orientation) pFrameImpl->GetCore().SetMovable(true); FloatPoint prevPoint = pFrameImpl->GetPositionF(); - - FloatPoint curPoint(0.0f, 0.0f); - + FloatPoint curPoint(prevPoint.x, prevPoint.y); + float ratio = portraitSize.width / portraitSize.height; if (orientation == _CONTROL_ORIENTATION_PORTRAIT) { - if (prevPoint.x < 0.0f) - { - curPoint.x = portraitSize.height / portraitSize.width * prevPoint.x; - } - else + if (prevPoint.x > 0.0f) { - curPoint.x = portraitSize.width / portraitSize.height * prevPoint.x; + curPoint.x = prevPoint.x * ratio; } - if (prevPoint.y < 0.0f) - { - curPoint.y = portraitSize.width / portraitSize.height * prevPoint.y; - } - else + if (prevPoint.y > 0.0f) { - curPoint.y = portraitSize.height / portraitSize.width * prevPoint.y; + curPoint.y = prevPoint.y / ratio; } } else { - if (prevPoint.x < 0.0f) + if (prevPoint.x > 0.0f) { - curPoint.x = portraitSize.width / portraitSize.height * prevPoint.x; - } - else - { - curPoint.x = portraitSize.height / portraitSize.width * prevPoint.x; + curPoint.x = prevPoint.x / ratio; } - if (prevPoint.y < 0.0f) - { - curPoint.y = portraitSize.height / portraitSize.width * prevPoint.y; - } - else + if (prevPoint.y > 0.0f) { - curPoint.y = portraitSize.width / portraitSize.height * prevPoint.y; + curPoint.y = prevPoint.y * ratio; } - } pFrameImpl->SetPosition(curPoint); - portraitSize = pFrameImpl->GetSizeF(); landscapeSize = portraitSize; - pFrameImpl->GetCore().SetMovable(movable); + pFrameImpl->GetCore().SetFloatingOrientation(orientation); } } @@ -1226,15 +1233,29 @@ _FormImpl::OnChangeLayout(_ControlOrientation orientation) if (orientation == _CONTROL_ORIENTATION_PORTRAIT) { pIndicator->SetBounds(FloatRectangle(0.0f, 0.0f, GetClientBoundsF().width, indicatorheight)); + if ((FORM_STYLE_INDICATOR & GetFormStyle()) || (FORM_STYLE_INDICATOR_AUTO_HIDE & GetFormStyle())) + { + GetCore().SetIndicatorShowState(true); + } + else + { + GetCore().SetIndicatorShowState(false); + } } else { - GET_SHAPE_CONFIG(FORM::INDICATOR_MINIMIZE_HEIGHT, GetCore().GetOrientation(), indicatorheight); - pIndicator->SetBounds(FloatRectangle(0.0f, 0.0f, GetClientBoundsF().width, indicatorheight)); + if (FORM_STYLE_LANDSCAPE_INDICATOR_AUTO_HIDE & GetFormStyle()) + { + GetCore().SetIndicatorShowState(true); + } } } GetCore().AdjustClientBounds(); } + else + { + GetCore().SetIndicatorShowState(false); + } if (pIndicator) { pIndicator->OnChangeLayout(orientation); @@ -1261,6 +1282,13 @@ _FormImpl::OnChangeLayout(_ControlOrientation orientation) { indicatorBounds.height = 0.0f; } + else + { + if (FORM_STYLE_INDICATOR_AUTO_HIDE & GetFormStyle()) + { + adjHeight = 0.0f; + } + } } } } @@ -1793,6 +1821,21 @@ protected: style |= FORM_STYLE_INDICATOR; } } + if (styleString.Contains(L"FORM_STYLE_PORTRAIT_INDICATOR")) + { + if (styleString.Contains(L"FORM_STYLE_PORTRAIT_INDICATOR_AUTO_HIDE")) + { + style |= FORM_STYLE_PORTRAIT_INDICATOR_AUTO_HIDE; + } + else + { + style |= FORM_STYLE_PORTRAIT_INDICATOR; + } + } + if (styleString.Contains(L"FORM_STYLE_LANDSCAPE_INDICATOR_AUTO_HIDE")) + { + style |= FORM_STYLE_LANDSCAPE_INDICATOR_AUTO_HIDE; + } if (styleString.Contains(L"FORM_STYLE_TEXT_TAB")) { style |= FORM_STYLE_TEXT_TAB;