{
GetCore().SetIndicatorShowState(true);
indicatorBounds = GetCore().GetIndicatorBoundsF();
- GetCore().SetIndicatorAutoHide(false);
+
+ 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(true);
- r = GetCore().SetIndicatorAutoHide(true);
- SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
- }
else
{
- r = GetCore().SetIndicatorShowState(false);
- r = GetCore().SetIndicatorAutoHide(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)
r = GetCore().AttachSystemChild(pFooter->GetCore());
SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
- //[ToDo]
+
GetCore().SetFormBackEventListener(this);
GetCore().SetFormMenuEventListener(this);
}
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 <IFormBackEventListener*>(pFormBackEventListener);
GetCore().SetFormBackEventListener(this);
result r = GetLastResult();
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 <IFormMenuEventListener*>(pFormMenuEventListener);
GetCore().SetFormMenuEventListener(this);
result r = GetLastResult();
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)
{
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)
+ if (prevPoint.x > 0.0f)
{
- curPoint.x = portraitSize.height / portraitSize.width * prevPoint.x;
- }
- else
- {
- 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)
- {
- curPoint.x = portraitSize.width / portraitSize.height * prevPoint.x;
- }
- else
+ if (prevPoint.x > 0.0f)
{
- 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);
}
}
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);
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;