float y = 0.0f;
float width = 0.0f;
float height = 0.0f;
-
float titleHeight = 0.0f;
- float titleLetfMargin = 0.0f;
- float titleRightMargin = 0.0f;
-
- float transTopMargin = 0.0f;
- float transBottomMargin = 0.0f;
- float transLeftMargin = 0.0f;
- float transRightMargin = 0.0f;
_ControlOrientation orientation;
- orientation = GetOrientation();
-
- GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, orientation, titleHeight);
- GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_LEFT_MARGIN, orientation, titleLetfMargin);
- GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_RIGHT_MARGIN, orientation, titleRightMargin);
-
- GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_TOP_MARGIN, orientation, transTopMargin);
- GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_BOTTOM_MARGIN, orientation, transBottomMargin);
- GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_LEFT_MARGIN, orientation, transLeftMargin);
- GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_RIGHT_MARGIN, orientation, transRightMargin);
+ if (HasTitle())
+ {
+ orientation = GetOrientation();
- x = titleLetfMargin;
- width = GetBoundsF().width - (titleLetfMargin + titleRightMargin);
+ GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, orientation, titleHeight);
- if (HasTitle() == false)
- {
- titleHeight = 0.0f;
+ y = titleHeight;
}
- y = titleHeight;
+ width = GetBoundsF().width;
height = GetBoundsF().height - y;
return FloatRectangle(x, y, width, height);
_pTitleTextAccessibilityElement->SetTrait(L"Popup Title");
pContainer->AddElement(*_pTitleTextAccessibilityElement);
-
- _Label* pLabelCore = __pPopupPresenter->GetSystemLabel();
- _AccessibilityContainer* pLabelContainer = pLabelCore->GetAccessibilityContainer();
- if (pLabelContainer != null)
- {
- pLabelContainer->Activate(false);
- }
}
return;
void
_Popup::UpdateClientBounds(const FloatDimension& size, FloatRectangle& clientBounds)
{
- float y = 0.0f;
-
float titleHeight = 0.0f;
- float titleLetfMargin = 0.0f;
- float titleRightMargin = 0.0f;
_ControlOrientation orientation;
- orientation = GetOrientation();
-
- GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, orientation, titleHeight);
- GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_LEFT_MARGIN, orientation, titleLetfMargin);
- GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_RIGHT_MARGIN, orientation, titleRightMargin);
-
if (HasTitle())
{
- y = titleHeight;
- }
+ orientation = GetOrientation();
- clientBounds.x = titleLetfMargin;
- clientBounds.y = y;
+ GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, orientation, titleHeight);
+
+ clientBounds.y = titleHeight;
+ }
- clientBounds.width = size.width - (titleLetfMargin + titleRightMargin);
- clientBounds.height = size.height - y;
+ clientBounds.width = size.width;
+ clientBounds.height = size.height - clientBounds.y;
}
}}} // Tizen::Ui::Controls
, __pPopupVE(null)
, __pBackgroundVE(null)
, __pTextObject(null)
- , __pLabelCore(null)
, __titleBounds(0.0f, 0.0f, 0.0f, 0.0f)
{
//empty statement
__pTextObject = null;
}
- delete __pLabelCore;
- __pLabelCore = null;
-
if (__pBackgroundVE != null)
{
__pBackgroundVE->Destroy();
GET_SHAPE_CONFIG(POPUP::BG_OUTLINE_EFFECT_LEFT_MARGIN, orientation, bgOutlineEffectLeftMargin);
GET_SHAPE_CONFIG(POPUP::BG_OUTLINE_EFFECT_RIGHT_MARGIN, orientation, bgOutlineEffectRightMargin);
- // system label to cover non-client area
- __pLabelCore = _Label::CreateLabelN();
- r = GetLastResult();
- SysTryReturnVoidResult(NID_UI_CTRL, __pLabelCore != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
-
- __pLabelCore->SetBackgroundColor(Color(0, 0 ,0, 0));
-
- r = __pPopup->AttachSystemChild(*__pLabelCore);
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
-
__pBackgroundVE = new (std::nothrow) _VisualElement();
SysTryReturnVoidResult(NID_UI_CTRL, __pBackgroundVE != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
return;
CATCH:
- delete __pLabelCore;
- __pLabelCore = null;
-
__pBackgroundVE->Destroy();
__pBackgroundVE = null;
return;
}
-
-_Label*
-_PopupPresenter::GetSystemLabel(void) const
-{
- return __pLabelCore;
-}
-
void
_PopupPresenter::OnFontChanged(Font* pFont)
{
void
_PopupPresenter::OnDraw(void)
{
- DrawSystemLabel();
Draw();
}
}
void
-_PopupPresenter::DrawSystemLabel(void)
-{
- result r = E_SUCCESS;
-
- float titleHeight = 0.0f;
- float transTopMargin = 0.0f;
- float transBottomMargin = 0.0f;
-
- _ControlOrientation orientation;
-
- orientation = __pPopup->GetOrientation();
-
- GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, orientation, titleHeight);
- GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_TOP_MARGIN, orientation, transTopMargin);
- GET_SHAPE_CONFIG(POPUP::BG_IMAGE_TRANSPARENT_BOTTOM_MARGIN, orientation, transBottomMargin);
-
- FloatRectangle systemBounds;
- FloatRectangle clientBounds = __pPopup->GetPopupClientArea();
- FloatRectangle bounds = __pPopup->GetBoundsF();
-
- systemBounds.x = clientBounds.x + clientBounds.width;
-
- if (__pPopup->HasTitle() == false)
- {
- titleHeight = 0.0f;
- }
- systemBounds.y = clientBounds.y + POPUP_LABEL_GAP;
-
- systemBounds.width = (bounds.width - systemBounds.x) - POPUP_LABEL_GAP / 2.0f;
- systemBounds.height = clientBounds.height -POPUP_LABEL_GAP * 2.0f;
-
- r = __pLabelCore->SetBounds(systemBounds);
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
-
- __pLabelCore->SetBackgroundColor(__pPopup->GetColor());
-
- __pLabelCore->Draw();
-
- return;
-
-CATCH:
- delete __pLabelCore;
- __pLabelCore = null;
-
- return;
-}
-
-void
_PopupPresenter::UpdateEffectBounds(void)
{
FloatRectangle bounds;
#include <FApp_AppImpl.h>
#include <FGrp_TextTextObject.h>
-#include "FUiCtrl_Label.h"
#include "FUiCtrl_Popup.h"
namespace Tizen { namespace Ui { namespace Controls
result SetTitleTextObject(const Tizen::Base::String& title);
- Tizen::Ui::Controls::_Label* GetSystemLabel(void) const;
-
Tizen::Graphics::FloatRectangle GetTitleTextBounds(void) const;
void UpdateEffectBounds(void);
_PopupPresenter(const _PopupPresenter& rhs);
_PopupPresenter& operator =(const _PopupPresenter& rhs);
- void DrawSystemLabel(void);
-
//Attribute
protected:
Tizen::Graphics::Font* _pFont;
Tizen::Ui::Animations::_VisualElement* __pBackgroundVE;
Tizen::Graphics::_Text::TextObject* __pTextObject;
- Tizen::Ui::Controls::_Label* __pLabelCore;
Tizen::Graphics::FloatRectangle __titleBounds;
- static const int POPUP_LABEL_GAP = 8.0f;
}; // _PopupPresenter