From 6f0e1a290a535739fcd3c611f3dcd85595a29649 Mon Sep 17 00:00:00 2001 From: DongJinJeon Date: Thu, 28 Mar 2013 19:57:07 +0900 Subject: [PATCH] add UpdateClientBounds() on Popup Change-Id: I48c61a6e7c3a958a3ae4bf74ff51a26a100a2682 Signed-off-by: DongJinJeon --- src/ui/controls/FUiCtrl_Popup.cpp | 35 +++++++++++++++++++++++++++++------ src/ui/inc/FUiCtrl_Popup.h | 2 +- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/src/ui/controls/FUiCtrl_Popup.cpp b/src/ui/controls/FUiCtrl_Popup.cpp index 0203c74..ddd17f4 100644 --- a/src/ui/controls/FUiCtrl_Popup.cpp +++ b/src/ui/controls/FUiCtrl_Popup.cpp @@ -590,12 +590,6 @@ _Popup::OnBoundsChanged(void) } } -result -_Popup::OnBoundsChanging(const FloatRectangle& bounds) -{ - return E_SUCCESS; -} - bool _Popup::IsLayoutChangable(void) const { @@ -640,5 +634,34 @@ _Popup::OnOwnerChanged(_Control* pOldOwner) } } +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; + } + + clientBounds.x = titleLetfMargin; + clientBounds.y = y; + + clientBounds.width = size.width - (titleLetfMargin + titleRightMargin); + clientBounds.height = size.height - y; +} + }}} // Tizen::Ui::Controls diff --git a/src/ui/inc/FUiCtrl_Popup.h b/src/ui/inc/FUiCtrl_Popup.h index 32fddcc..2587d0a 100644 --- a/src/ui/inc/FUiCtrl_Popup.h +++ b/src/ui/inc/FUiCtrl_Popup.h @@ -105,9 +105,9 @@ public: virtual bool OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo); virtual void OnBoundsChanged(void); - virtual result OnBoundsChanging(const Tizen::Graphics::FloatRectangle& bounds); virtual bool IsLayoutChangable(void) const; virtual void OnOwnerChanged(_Control* pOldOwner); + virtual void UpdateClientBounds(const Tizen::Graphics::FloatDimension& size, Tizen::Graphics::FloatRectangle& clientBounds); // Accessor public: -- 2.7.4