#include "FUiCtrl_Form.h"\r
#include "FUiCtrl_Frame.h"\r
#include "FUi_ContainerImpl.h"\r
-#include "FUiCtrl_Popup.h"\r
\r
using namespace std;\r
using namespace Tizen::Base;\r
using namespace Tizen::Graphics;\r
using namespace Tizen::Ui;\r
using namespace Tizen::Ui::Animations;\r
-using namespace Tizen::Ui::Controls;\r
\r
namespace {\r
\r
{\r
Point winPoint = pWindow->GetPosition();\r
\r
- Rectangle popupRect(0, 0, 0, 0);\r
- _Popup* pPopup = dynamic_cast<_Popup*>(pWindow);\r
- if (pPopup)\r
- {\r
- if (GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT)\r
- {\r
- popupRect = _CoordinateSystemUtils::ConvertToInteger(pPopup->GetNativeBounds(true));\r
- }\r
- else\r
- {\r
- popupRect = _CoordinateSystemUtils::ConvertToInteger(pPopup->GetNativeBounds(false));\r
- }\r
- }\r
-\r
- accumPoint.x = accumPoint.x + winPoint.x + popupRect.x;\r
- accumPoint.y = accumPoint.y + winPoint.y + popupRect.y;\r
+ accumPoint.x += winPoint.x;\r
+ accumPoint.y += winPoint.y;\r
}\r
\r
absoluteBounds.x = accumPoint.x;\r
{\r
FloatPoint winPoint = pWindow->GetPositionF();\r
\r
- FloatRectangle popupRect(0.0f, 0.0f, 0.0f, 0.0f);\r
- _Popup* pPopup = dynamic_cast<_Popup*>(pWindow);\r
- if (pPopup)\r
- {\r
- if (GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT)\r
- {\r
- popupRect = pPopup->GetNativeBounds(true);\r
- }\r
- else\r
- {\r
- popupRect = pPopup->GetNativeBounds(false);\r
- }\r
- }\r
-\r
- accumPoint.x = accumPoint.x + winPoint.x + popupRect.x;\r
- accumPoint.y = accumPoint.y + winPoint.y + popupRect.y;\r
+ accumPoint.x += winPoint.x;\r
+ accumPoint.y += winPoint.y;\r
}\r
\r
absoluteBounds.x = accumPoint.x;\r
}
}
+ _Window* pWindow = const_cast<_Window*>(&window);
+ if (pWindow->IsLayoutChangable() == true)
+ {
+ rotatePartial = false;
+ }
+
Evas_Object* pWinObj = pLayer->GetElmWin();
Ecore_X_Window win = (Ecore_X_Window) ecore_evas_window_get(pEcoreEvas);
Rectangle winBounds = _CoordinateSystemUtils::Transform(window.GetBounds());
int rotate = ecore_evas_rotation_get(pEcoreEvas);
- _Window* pWindow = const_cast<_Window*>(&window);
- if (pWindow->IsLayoutChangable() == true)
- {
- _Popup* pPopup = dynamic_cast<_Popup*>(pWindow);
- if (pPopup)
- {
- FloatRectangle nativeBoundsF(0.0f, 0.0f, 0.0f, 0.0f);
-
- if ((rotate == 0) || (rotate == 180))
- {
- nativeBoundsF = pPopup->GetNativeBounds(true);
- }
- else
- {
- nativeBoundsF = pPopup->GetNativeBounds(false);
- }
-
- nativeBoundsF = _CoordinateSystemUtils::Transform(nativeBoundsF);
- Rectangle nativeBounds = _CoordinateSystemUtils::ConvertToInteger(nativeBoundsF);
-
- winBounds.x = nativeBounds.x;
- winBounds.y = nativeBounds.y;
- winBounds.width = nativeBounds.width;
- winBounds.height = nativeBounds.height;
- }
- }
int winX = winBounds.x;
int winY = winBounds.y;
}
}
- if (pWindow->IsLayoutChangable() == true)
- {
- _Popup* pPopup = dynamic_cast<_Popup*>(pWindow);
- if (pPopup)
- {
- FloatRectangle nativeBoundsF(0.0f, 0.0f, 0.0f, 0.0f);
-
- if ((rotate == 0) || (rotate == 180))
- {
- nativeBoundsF = pPopup->GetNativeBounds(true);
- }
- else
- {
- nativeBoundsF = pPopup->GetNativeBounds(false);
- }
-
- nativeBoundsF = _CoordinateSystemUtils::Transform(nativeBoundsF);
- Rectangle nativeBounds = _CoordinateSystemUtils::ConvertToInteger(nativeBoundsF);
-
- winBounds.x = nativeBounds.x;
- winBounds.y = nativeBounds.y;
- winBounds.width = nativeBounds.width;
- winBounds.height = nativeBounds.height;
- }
- }
int winX = winBounds.x;
int winY = winBounds.y;
}
}
- if (pWindow->IsLayoutChangable() == true)
- {
- _Popup* pPopup = dynamic_cast<_Popup*>(pWindow);
- if (pPopup)
- {
- FloatRectangle nativeBoundsF(0.0f, 0.0f, 0.0f, 0.0f);
-
- if ((rotate == 0) || (rotate == 180))
- {
- nativeBoundsF = pPopup->GetNativeBounds(true);
- }
- else
- {
- nativeBoundsF = pPopup->GetNativeBounds(false);
- }
-
- nativeBoundsF = _CoordinateSystemUtils::Transform(nativeBoundsF);
- Rectangle nativeBounds = _CoordinateSystemUtils::ConvertToInteger(nativeBoundsF);
-
- winBounds.x = nativeBounds.x;
- winBounds.y = nativeBounds.y;
- winBounds.width = nativeBounds.width;
- winBounds.height = nativeBounds.height;
- }
- }
int winX = winBounds.x;
int winY = winBounds.y;
#include "FUiAnim_ControlVisualElement.h"
#include "FUiAnim_RootVisualElement.h"
#include "FUiAnim_EflLayer.h"
-#include "FUiCtrl_Popup.h"
using namespace std;
using namespace Tizen::Ui;
using namespace Tizen::Ui::Animations;
-using namespace Tizen::Ui::Controls;
using namespace Tizen::Graphics;
using namespace Tizen::Base::Collection;
using namespace Tizen::Base;
pWindow = pControlManager->GetTouchedWindow();
SysTryReturn(NID_UI, pWindow, null, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
- Rectangle popupRect(0, 0, 0, 0);
- _Popup* pPopup = dynamic_cast<_Popup*>(pWindow);
- if (pPopup)
- {
- if (pPopup->GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT)
- {
- popupRect = _CoordinateSystemUtils::ConvertToInteger(pPopup->GetNativeBounds(true));
- }
- else
- {
- popupRect = _CoordinateSystemUtils::ConvertToInteger(pPopup->GetNativeBounds(false));
- }
- }
-
Rectangle winBounds = pWindow->GetBounds();
- ptf.x = static_cast<float>(x - winBounds.x - popupRect.x);
- ptf.y = static_cast<float>(y - winBounds.y - popupRect.y);
+ ptf.x = static_cast<float>(x - winBounds.x);
+ ptf.y = static_cast<float>(y - winBounds.y);
pRootControlElement = dynamic_cast <_ControlVisualElement*>(pWindow->GetVisualElement());
}
_MessageBox* pMsgbox = new (std::nothrow) _MessageBox();
SysTryReturn(NID_UI, pMsgbox != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
- FloatDimension screenSize = _ControlManager::GetInstance()->GetScreenSizeF();
-
- _Frame* pFrame = dynamic_cast<_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame());
- SysTryReturn(NID_UI_CTRL, pFrame != null, null, E_SYSTEM, "[E_SYSTEM] This instance is not constructed.");
-
- _Form* pForm = pFrame->GetCurrentForm();
- float portIndiHeight = 0.0f;
- float landIndiHeight = 0.0f;
-
- if (pForm && pForm->IsIndicatorVisible())
- {
- GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, portIndiHeight);
- GET_SHAPE_CONFIG(FORM::INDICATOR_MINIMIZE_HEIGHT, _CONTROL_ORIENTATION_LANDSCAPE, landIndiHeight);
- }
-
- FloatRectangle portBoundsF(0.0f, 0.0f, screenSize.width, screenSize.height - portIndiHeight);
- FloatRectangle landBoundsF(0.0f, 0.0f, screenSize.width - landIndiHeight, screenSize.height);
-
- _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
-
result r = pMsgbox->CreateRootVisualElement(_WINDOW_TYPE_SUB);
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
- pEcoreEvas->SetWindowRotationBounds(*pMsgbox, 0, portBoundsF);
- pEcoreEvas->SetWindowRotationBounds(*pMsgbox, 180, portBoundsF);
- pEcoreEvas->SetWindowRotationBounds(*pMsgbox, 90, landBoundsF);
- pEcoreEvas->SetWindowRotationBounds(*pMsgbox, 270, landBoundsF);
-
// for taking touch event
pMsgbox->AcquireHandle();
result
_MessageBox::OnAttachedToMainTree(void)
{
- result r = _Popup::OnAttachedToMainTree();
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ result r = E_SUCCESS;
+
+ SysTryReturn(NID_UI_CTRL, GetVisibleState() != false, E_INVALID_OPERATION,
+ E_INVALID_OPERATION, "[E_INVALID_OPERATION] This control is not 'displayable'");
+
+ _Control* pOwner = GetOwner();
+ if (pOwner)
+ {
+ GetEcoreEvasMgr()->GetEcoreEvas()->SetOwner(*this, *pOwner);
+ }
r = __pMsgboxPresenter->OnAttachedToMainTree();
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
, __pPopupPresenter(null)
, __bounds(0.0f, 0.0f, 0.0f, 0.0f)
, __popupResult(POPUP_RESULT_NONE)
- , __portBounds(0.0f, 0.0f, 0.0f, 0.0f)
- , __landBounds(0.0f, 0.0f, 0.0f, 0.0f)
{
- FloatDimension screenSize = _ControlManager::GetInstance()->GetScreenSizeF();
-
- _Frame* pFrame = dynamic_cast<_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame());
- SysTryReturnVoidResult(NID_UI_CTRL, pFrame != null, E_SYSTEM, "[E_SYSTEM] This instance is not constructed.");
-
- _Form* pForm = pFrame->GetCurrentForm();
- int portIndiHeight = 0;
- int landIndiHeight = 0;
- if (pForm && pForm->IsIndicatorVisible())
- {
- GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, portIndiHeight);
- GET_SHAPE_CONFIG(FORM::INDICATOR_MINIMIZE_HEIGHT, _CONTROL_ORIENTATION_LANDSCAPE, landIndiHeight);
- }
- __portBounds = FloatRectangle(0, portIndiHeight, screenSize.width, screenSize.height - portIndiHeight);
- __landBounds = FloatRectangle(0, landIndiHeight, screenSize.height, screenSize.width - landIndiHeight);
}
_Popup::~_Popup(void)
_Popup* pPopup = new (std::nothrow) _Popup();
SysTryReturn(NID_UI_CTRL, pPopup != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
- FloatDimension screenSize = _ControlManager::GetInstance()->GetScreenSizeF();
-
- _Frame* pFrame = dynamic_cast<_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame());
- SysTryReturn(NID_UI_CTRL, pFrame != null, null, E_SYSTEM, "[E_SYSTEM] This instance is not constructed.");
-
- _Form* pForm = pFrame->GetCurrentForm();
- float portIndiHeight = 0.0f;
- float landIndiHeight = 0.0f;
-
- if (pForm && pForm->IsIndicatorVisible())
- {
- GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, portIndiHeight);
- GET_SHAPE_CONFIG(FORM::INDICATOR_MINIMIZE_HEIGHT, _CONTROL_ORIENTATION_LANDSCAPE, landIndiHeight);
- }
-
- FloatRectangle portBoundsF(0.0f, 0.0f, screenSize.width, screenSize.height - portIndiHeight);
- FloatRectangle landBoundsF(0.0f, 0.0f, screenSize.width - landIndiHeight, screenSize.height);
-
- _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
-
result r = pPopup->CreateRootVisualElement(_WINDOW_TYPE_SUB);
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
- pEcoreEvas->SetWindowRotationBounds(*pPopup, 0, portBoundsF);
- pEcoreEvas->SetWindowRotationBounds(*pPopup, 180, portBoundsF);
- pEcoreEvas->SetWindowRotationBounds(*pPopup, 90, landBoundsF);
- pEcoreEvas->SetWindowRotationBounds(*pPopup, 270, landBoundsF);
-
// for taking touch event
pPopup->AcquireHandle();
GetEcoreEvasMgr()->GetEcoreEvas()->SetOwner(*this, *GetOwner());
- FloatDimension screenSize = _ControlManager::GetInstance()->GetScreenSizeF();
-
- _Frame* pFrame = dynamic_cast<_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame());
- SysTryReturnResult(NID_UI_CTRL, pFrame != null, E_SYSTEM, "[E_SYSTEM] This instance is not constructed.");
-
- _Form* pForm = pFrame->GetCurrentForm();
-
- float portIndiHeight = 0.0f;
- float landIndiHeight = 0.0f;
- if (pForm && pForm->IsIndicatorVisible())
- {
- GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, portIndiHeight);
- GET_SHAPE_CONFIG(FORM::INDICATOR_MINIMIZE_HEIGHT, _CONTROL_ORIENTATION_LANDSCAPE, landIndiHeight);
- }
-
- FloatRectangle portBoundsF(0.0f, 0.0f, screenSize.width, screenSize.height - portIndiHeight);
- FloatRectangle landBoundsF(0.0f, 0.0f, screenSize.width - landIndiHeight, screenSize.height);
-
- _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
-
- pEcoreEvas->SetWindowRotationBounds(*this, 0, portBoundsF);
- pEcoreEvas->SetWindowRotationBounds(*this, 180, portBoundsF);
- pEcoreEvas->SetWindowRotationBounds(*this, 90, landBoundsF);
- pEcoreEvas->SetWindowRotationBounds(*this, 270, landBoundsF);
-
- __portBounds = FloatRectangle(0, portIndiHeight, screenSize.width, screenSize.height - portIndiHeight);
- __landBounds = FloatRectangle(0, landIndiHeight, screenSize.height, screenSize.width - landIndiHeight);
-
return E_SUCCESS;
}
return _Window::OnDetachingFromMainTree();
}
+result
+_Popup::OnBoundsChanging(const FloatRectangle& bounds)
+{
+ return E_SUCCESS;
+}
+
void
_Popup::OnBoundsChanged(void)
{
return true;
}
-FloatRectangle
-_Popup::GetNativeBounds(bool isPortrait) const
-{
- if (isPortrait)
- {
- return __portBounds;
- }
- else
- {
- return __landBounds;
- }
-}
-
}}} // Tizen::Ui::Controls
_ProgressPopup* pProgressPopup = new (std::nothrow) _ProgressPopup();
SysTryReturn(NID_UI_CTRL, pProgressPopup != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
- FloatDimension screenSize = _ControlManager::GetInstance()->GetScreenSizeF();
-
- _Frame* pFrame = dynamic_cast<_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame());
- SysTryReturn(NID_UI_CTRL, pFrame != null, null, E_SYSTEM, "[E_SYSTEM] This instance is not constructed.");
-
- _Form* pForm = pFrame->GetCurrentForm();
- float portIndiHeight = 0.0f;
- float landIndiHeight = 0.0f;
-
- if (pForm && pForm->IsIndicatorVisible())
- {
- GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, portIndiHeight);
- GET_SHAPE_CONFIG(FORM::INDICATOR_MINIMIZE_HEIGHT, _CONTROL_ORIENTATION_LANDSCAPE, landIndiHeight);
- }
-
- FloatRectangle portBoundsF(0.0f, 0.0f, screenSize.width, screenSize.height - portIndiHeight);
- FloatRectangle landBoundsF(0.0f, 0.0f, screenSize.width - landIndiHeight, screenSize.height);
-
- _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
-
- result r = pProgressPopup->CreateRootVisualElement();
+ result r = pProgressPopup->CreateRootVisualElement(_WINDOW_TYPE_SUB);
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
- pEcoreEvas->SetWindowRotationBounds(*pProgressPopup, 0, portBoundsF);
- pEcoreEvas->SetWindowRotationBounds(*pProgressPopup, 180, portBoundsF);
- pEcoreEvas->SetWindowRotationBounds(*pProgressPopup, 90, landBoundsF);
- pEcoreEvas->SetWindowRotationBounds(*pProgressPopup, 270, landBoundsF);
-
// for taking touch event
pProgressPopup->AcquireHandle();
return pProgressPopup;
result
_ProgressPopup::OnAttachedToMainTree(void)
{
- result r = _Popup::OnAttachedToMainTree();
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ 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;
}
virtual bool OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo);
virtual bool OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo);
+ virtual result OnBoundsChanging(const Tizen::Graphics::FloatRectangle& bounds);
+
virtual void OnBoundsChanged(void);
virtual bool IsLayoutChangable(void) const;
virtual void OnOwnerChanged(_Control* pOldOwner);
virtual void UpdateClientBounds(const Tizen::Graphics::FloatDimension& size, Tizen::Graphics::FloatRectangle& clientBounds);
virtual bool IsRotationSynchronized(void) const;
- Tizen::Graphics::FloatRectangle GetNativeBounds(bool isPortrait) const;
-
// Accessor
public:
void SetColor(const Tizen::Graphics::Color& color);
Tizen::Graphics::FloatRectangle __bounds;
PopupModalResult __popupResult;
-
- Tizen::Graphics::FloatRectangle __portBounds;
- Tizen::Graphics::FloatRectangle __landBounds;
}; // _Popup