Derived InputPickerPopup from Webpopup and ColorPicker popup issue fixed
authorrajeev.ran <rajeev.ran@samsung.com>
Wed, 16 Oct 2013 08:24:30 +0000 (13:54 +0530)
committerrajeev.ran <rajeev.ran@samsung.com>
Fri, 18 Oct 2013 05:59:34 +0000 (11:29 +0530)
Change-Id: Ia551ba6fc2e1ada3d164e4fe67efb09e5080d096
Signed-off-by: rajeev.ran <rajeev.ran@samsung.com>
src/controls/FWebCtrl_InputPickerPopup.cpp
src/controls/FWebCtrl_InputPickerPopup.h
src/controls/FWebCtrl_WebImpl.cpp
src/controls/FWebCtrl_WebNotification.cpp
src/controls/FWebCtrl_WebPopup.cpp

index 1f44ee0..b528c42 100755 (executable)
 #include <FUiCtrlEditDate.h>
 #include <FUiCtrlEditTime.h>
 #include <FUiCtrlLabel.h>
+#include <FUiCtrlPanel.h>
 #include <FUiIActionEventListener.h>
 #include <FUiKeyEventInfo.h>
 #include <FUiLayout.h>
 #include <FUiVerticalBoxLayout.h>
 #include <FWebCtrlAuthenticationChallenge.h>
 #include <FSys_SystemResource.h>
+#include <FUi_ControlManager.h>
 #include <FUi_ResourceManager.h>
 #include "FWebCtrl_WebImpl.h"
 #include "FWebCtrl_InputPickerPopup.h"
 
 
 using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
 using namespace Tizen::Graphics;
 using namespace Tizen::Locales;
 using namespace Tizen::System;
@@ -58,15 +61,14 @@ static const int DATE_POPUP_BUTTON_WIDTH = 250;
 
 
 _InputPickerPopup::_InputPickerPopup(void)
-       : __pPopup(null)
-       , __pEditDate(null)
+       : __pEditDate(null)
        , __pEditTime(null)
        , __pSelectionBtn(null)
-       , __modal(0)
-       , __isModal(false)
+       , __pColorPicker(null)
+       , __pButtonPanel(null)
        , __popupHeight(0)
        , __popupWidth(0)
-       , __btnHeight(0)
+       , __panelHeight(0)
        , __inputType(EWK_INPUT_TYPE_TIME)
 {
 }
@@ -74,7 +76,7 @@ _InputPickerPopup::_InputPickerPopup(void)
 
 _InputPickerPopup::~_InputPickerPopup(void)
 {
-       if (__isModal == true)
+       if (IsModalPopup())
        {
                HidePopup();
        }
@@ -90,6 +92,7 @@ _InputPickerPopup::Construct(const String& strDate, Ewk_Input_Type inputType, Ti
        int dateHeight = 0;
        int dateWidth = 0;
        int sideMargin = 0;
+       int internalGap = 0;
        DateTime inputDateTime;
 
        __inputPickerMode = INPUT_MODE_DATE;
@@ -104,14 +107,19 @@ _InputPickerPopup::Construct(const String& strDate, Ewk_Input_Type inputType, Ti
 
        _ControlOrientation orientation = _CONTROL_ORIENTATION_PORTRAIT;
 
+       _WebPopupData* pPopupData = _WebPopup::GetPopupData();
+       SysTryReturn(NID_WEB_CTRL, pPopupData, r = GetLastResult(), r, "[%s] Propagating.", GetErrorMessage(r));
+
        GET_SHAPE_CONFIG(EDITDATE::WIDTH, orientation, dateWidth);
        GET_SHAPE_CONFIG(EDITDATE::HEIGHT, orientation, dateHeight);
        GET_SHAPE_CONFIG(POPUP::SIDE_BORDER, orientation, sideMargin);
        GET_SHAPE_CONFIG(MESSAGEBOX::DEFAULT_WIDTH, orientation, __popupWidth);
        GET_SHAPE_CONFIG(MESSAGEBOX::MIN_HEIGHT, orientation, __popupHeight);
-       GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_HEIGHT, orientation, __btnHeight);
+       GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_INTERNAL_GAP, orientation, internalGap);
+
+       __panelHeight = pPopupData->panelHeight;
 
-       __popupWidth -= 2*sideMargin;
+       __popupWidth += sideMargin;
 
        std::unique_ptr<EditDate> pEditDate(new (std::nothrow) EditDate());
        SysTryReturnResult(NID_WEB_CTRL, pEditDate.get(), E_OUT_OF_MEMORY, "Memory Allocation Failed.");
@@ -119,20 +127,22 @@ _InputPickerPopup::Construct(const String& strDate, Ewk_Input_Type inputType, Ti
        std::unique_ptr<EditTime> pEditTime(new (std::nothrow) EditTime());
        SysTryReturnResult(NID_WEB_CTRL, pEditTime.get(), E_OUT_OF_MEMORY, "Memory Allocation Failed.");
 
+       int space = dateHeight/4;
+
        switch (__inputType)
        {
        case EWK_INPUT_TYPE_TIME :
 
-               __popupHeight = __popupHeight + dateHeight + __btnHeight;
+               __popupHeight = dateHeight + space + __panelHeight;
                r = CreatePopup();
                SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
-               __pPopup->SetTitleText("Select time");
+               SetTitleText("Select time");
 
                r = pEditTime->Construct(Point(0, 0), L"Time (Default format) :");
                SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
-               r = __pPopup->AddControl(*pEditTime);
+               r = AddControl(*pEditTime);
                SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
                pEditTime->SetTime(inputDateTime);
                __pEditTime = pEditTime.release();
@@ -143,11 +153,11 @@ _InputPickerPopup::Construct(const String& strDate, Ewk_Input_Type inputType, Ti
 
        case EWK_INPUT_TYPE_DATETIMELOCAL :
 
-               __popupHeight = __popupHeight + 2*dateHeight + __btnHeight;
+               __popupHeight = 2*dateHeight + space + __panelHeight + internalGap;
                r = CreatePopup();
                SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
-               __pPopup->SetTitleText("Select datetime");
+               SetTitleText("Select datetime");
 
                r = pEditDate->Construct(Point(0, 0), L"Date (Default format) :");
                SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
@@ -155,13 +165,13 @@ _InputPickerPopup::Construct(const String& strDate, Ewk_Input_Type inputType, Ti
                r = pEditTime->Construct(Point(0, 0), L"Time (Default format) :");
                SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
-               r = __pPopup->AddControl(*pEditTime);
+               r = AddControl(*pEditTime);
                SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
                pEditTime->SetTime(inputDateTime);
                __pEditTime = pEditTime.release();
 
-               r = __pPopup->AddControl(*pEditDate);
+               r = AddControl(*pEditDate);
                SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
                pEditDate->SetDate(inputDateTime);
@@ -176,15 +186,15 @@ _InputPickerPopup::Construct(const String& strDate, Ewk_Input_Type inputType, Ti
                //fall through
        case EWK_INPUT_TYPE_MONTH :
 
-               __popupHeight = __popupHeight + dateHeight + __btnHeight;
+               __popupHeight = dateHeight + space + __panelHeight;
                r = CreatePopup();
                SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-               __pPopup->SetTitleText("Select date");
+               SetTitleText("Select date");
 
                r = pEditDate->Construct(Point(0, 0), L"Date (Default format) :");
                SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
-               r = __pPopup->AddControl(*pEditDate);
+               r = AddControl(*pEditDate);
                SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
                pEditDate->SetDate(inputDateTime);
@@ -197,28 +207,50 @@ _InputPickerPopup::Construct(const String& strDate, Ewk_Input_Type inputType, Ti
                return r;
        }
 
-       r = AddButton(ID_BUTTON_INPUT_DATE_SELECTION);
+       __pButtonPanel = CreateAndAddPanel();
+       SysTryReturn(NID_WEB_CTRL, __pButtonPanel, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+       ArrayList idList;
+       r = idList.Construct();
+       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+       ArrayList titleList;
+       r = titleList.Construct();
+       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+       idList.Add(*(new Integer(ID_BUTTON_INPUT_DATE_SELECTION)));
+
+       _SystemResource* pSysResource = _SystemResource::GetInstance();
+       SysAssertf(pSysResource != null, "Failed to get _SystemResource instance");
+
+       titleList.Add(*(new String(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BUTTON_OK"))));
+
+       r = CreateAndAddButtons(idList, titleList, __pButtonPanel);
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
-       __pPopup->SetPropagatedKeyEventListener(this);
-       
-       std::unique_ptr<VerticalBoxLayout> pLayout(dynamic_cast< VerticalBoxLayout* >(__pPopup->GetLayoutN()));
+       SetPropagatedKeyEventListener(this);
+
+       std::unique_ptr<VerticalBoxLayout> pLayout(dynamic_cast< VerticalBoxLayout* >(GetLayoutN()));
        SysTryReturnResult(NID_WEB_CTRL, pLayout.get(), E_OUT_OF_MEMORY, "Memory Allocation Failed.");
 
        if (__pEditDate)
        {
+               __pEditDate->SetSize(__popupWidth,__pEditDate->GetSize().height);
                pLayout->SetHorizontalAlignment(*__pEditDate, LAYOUT_HORIZONTAL_ALIGN_LEFT);
                pLayout->SetSpacing(*__pEditDate, sideMargin);
        }
 
        if (__pEditTime)
        {
+               __pEditTime->SetSize(__popupWidth,__pEditTime->GetSize().height);
                pLayout->SetHorizontalAlignment(*__pEditTime, LAYOUT_HORIZONTAL_ALIGN_LEFT);
                pLayout->SetSpacing(*__pEditTime, sideMargin);
        }
 
-       pLayout->SetHorizontalAlignment(*__pSelectionBtn, LAYOUT_HORIZONTAL_ALIGN_CENTER);
-       pLayout->SetSpacing(*__pSelectionBtn, sideMargin);
+       if (__pButtonPanel)
+       {
+               pLayout->SetSpacing(*__pButtonPanel, space);
+       }
 
        return E_SUCCESS;
 }
@@ -233,12 +265,11 @@ _InputPickerPopup::Construct(const Color& color, Tizen::Web::Controls::_WebImpl*
 
        _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
 
-       CalculateColorPickerPopupSize(orientation);
-
-       r = CreatePopup();
-       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+       _SystemResource* pSysResource = _SystemResource::GetInstance();
+       SysAssertf(pSysResource != null, "Failed to get _SystemResource instance");
 
-       __pPopup->SetTitleText("Select color");
+       _WebPopupData* pPopupData = _WebPopup::GetPopupData();
+       SysTryReturn(NID_WEB_CTRL, pPopupData, r = GetLastResult(), r, "[%s] Propagating.", GetErrorMessage(r));
 
        std::unique_ptr<ColorPicker> pColorPicker(new (std::nothrow) ColorPicker());
        SysTryReturnResult(NID_WEB_CTRL, pColorPicker.get(), E_OUT_OF_MEMORY, "Memory Allocation Failed.");
@@ -248,25 +279,46 @@ _InputPickerPopup::Construct(const Color& color, Tizen::Web::Controls::_WebImpl*
 
        pColorPicker->SetColor(color);
 
-       __pPopup->SetPropagatedKeyEventListener(this);
-       r = __pPopup->AddControl(*pColorPicker);
+       CalculateColorPickerPopupSize(orientation);
+
+       r = CreatePopup();
+       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+       SetTitleText("Select color");
+
+       SetPropagatedKeyEventListener(this);
+
+       r = AddControl(*pColorPicker);
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
        __pColorPicker = pColorPicker.release();
-       r = AddButton(ID_BUTTON_INPUT_COLOR_SELECTION);
+
+       __pButtonPanel = CreateAndAddPanel();
+       SysTryReturn(NID_WEB_CTRL, __pButtonPanel, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+       ArrayList idList;
+       r = idList.Construct();
+       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+       ArrayList titleList;
+       r = titleList.Construct();
+       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+       idList.Add(*(new Integer(ID_BUTTON_INPUT_COLOR_SELECTION)));
+       titleList.Add(*(new String(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BUTTON_OK"))));
+
+       r = CreateAndAddButtons(idList, titleList, __pButtonPanel);
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
-       std::unique_ptr<VerticalBoxLayout> pLayout(dynamic_cast< VerticalBoxLayout* >(__pPopup->GetLayoutN()));
+       std::unique_ptr<VerticalBoxLayout> pLayout(dynamic_cast< VerticalBoxLayout* >(GetLayoutN()));
        SysTryReturnResult(NID_WEB_CTRL, pLayout.get(), E_OUT_OF_MEMORY, "Memory Allocation Failed.");
 
        pLayout->SetHorizontalAlignment(*__pColorPicker, LAYOUT_HORIZONTAL_ALIGN_LEFT);
-       pLayout->SetHorizontalAlignment(*__pSelectionBtn, LAYOUT_HORIZONTAL_ALIGN_CENTER);
 
        int sideMargin = 0;
        GET_SHAPE_CONFIG(POPUP::SIDE_BORDER, orientation, sideMargin);
 
        pLayout->SetSpacing(*__pColorPicker, sideMargin);
-       pLayout->SetSpacing(*__pSelectionBtn, sideMargin);
 
        return E_SUCCESS;
 
@@ -278,17 +330,16 @@ _InputPickerPopup::CalculateColorPickerPopupSize(_ControlOrientation orientation
 {
        int sideMargin = 0;
        Dimension dim;
+       _WebPopupData* pPopupData = _WebPopup::GetPopupData();
 
        GET_SHAPE_CONFIG(POPUP::SIDE_BORDER, orientation, sideMargin);
-       GET_SHAPE_CONFIG(MESSAGEBOX::DEFAULT_WIDTH, orientation, __popupWidth);
-       GET_SHAPE_CONFIG(MESSAGEBOX::MIN_HEIGHT, orientation, __popupHeight);
-       GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_HEIGHT, orientation, __btnHeight);
 
+       __panelHeight = pPopupData->panelHeight;
        GET_DIMENSION_CONFIG(COLORPICKER::DEFAULT_SIZE, orientation, dim);
 
        dim.width += sideMargin;
        __popupWidth = dim.width;
-       __popupHeight = __popupHeight + dim.height + __btnHeight;
+       __popupHeight = dim.height + __panelHeight;
 }
 
 
@@ -296,51 +347,14 @@ result
 _InputPickerPopup::CreatePopup(void)
 {
        result r = E_SUCCESS;
+       bool hasTitle = true;
 
-       VerticalBoxLayout layout;
-       r = layout.Construct(VERTICAL_DIRECTION_DOWNWARD);
-       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
-       std::unique_ptr<Popup> pPopup(new (std::nothrow) Popup());
-       SysTryReturnResult(NID_WEB_CTRL, pPopup.get(), E_OUT_OF_MEMORY, "Memory Allocation Failed.");
-
-       r = pPopup->Construct(layout, layout, true, Dimension(__popupWidth, __popupHeight));
-       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
-       __pPopup = std::move(pPopup);
-
-       return E_SUCCESS;
-}
-
-
-result
-_InputPickerPopup::AddButton(_InputPickerButtonId buttonId)
-{
-       result r = E_SUCCESS;
-
-       String buttonStr;
-
-       _SystemResource* pSysResource = _SystemResource::GetInstance();
-       SysAssertf(pSysResource != null, "Failed to get _SystemResource instance");
-
-       buttonStr = pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BUTTON_OK");
-
-       std::unique_ptr<Button> pSelectionBtn(new (std::nothrow) Button());
-       SysTryReturnResult(NID_WEB_CTRL, pSelectionBtn.get(), E_OUT_OF_MEMORY, "Memory Allocation Failed.");
-
-       r = pSelectionBtn->Construct(Rectangle(0, 0, DATE_POPUP_BUTTON_WIDTH, __btnHeight), buttonStr);
+       r = _WebPopup::Construct(hasTitle, Dimension(__popupWidth, __popupHeight));
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
-       pSelectionBtn->SetActionId(buttonId);
-       __pPopup->AddControl(*pSelectionBtn);
-       pSelectionBtn->AddActionEventListener(*this);
-
-       __pSelectionBtn =  pSelectionBtn.release();
-
        return E_SUCCESS;
 }
 
-
 void
 _InputPickerPopup::OnActionPerformed(const Control& source, int actionId)
 {
@@ -378,9 +392,11 @@ _InputPickerPopup::ChangeLayout(_ControlOrientation orientation)
 
        int x = 0;
        int y = 0;
+       _WebPopupData* __pWebPopupData = _WebPopup::GetPopupData();
        Dimension screenRect = _ControlManager::GetInstance()->GetScreenSize();
 
        CalculateColorPickerPopupSize(orientation);
+       __popupHeight += __pWebPopupData->titleHeight;
 
        if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
        {
@@ -393,9 +409,25 @@ _InputPickerPopup::ChangeLayout(_ControlOrientation orientation)
                y = (screenRect.width - __popupHeight) / 2;
        }
 
-       r = __pPopup->SetBounds(Rectangle(x, y, __popupWidth, __popupHeight));
+       r = SetBounds(Rectangle(x, y, __popupWidth, __popupHeight));
+       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+       r = __pButtonPanel->SetSize(__popupWidth, __popupHeight);
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
+       int buttonMargin;
+       int idCount = 1;
+       GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_SIDE_MARGIN_01, _CONTROL_ORIENTATION_PORTRAIT, buttonMargin);
+
+       int buttonWidth = (__popupWidth - buttonMargin*(idCount+1)) / idCount;
+       int buttonTopMargin = (__pWebPopupData->panelHeight - __pWebPopupData->btnDim.height)/2;
+
+       if (__pButtonPanel->GetControl(0))
+       {
+               r = (__pButtonPanel->GetControl(0))->SetBounds(Rectangle(buttonMargin, buttonTopMargin, buttonWidth, __pWebPopupData->btnDim.height));
+               SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+       }
+
        return E_SUCCESS;
 }
 
@@ -475,39 +507,6 @@ _InputPickerPopup::UpdateColor(void)
 }
 
 
-result
-_InputPickerPopup::ShowPopup(void)
-{
-       result r = E_SUCCESS;
-
-       r = __pPopup->SetShowState(true);
-       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
-       __isModal = true;
-
-       r = __pPopup->DoModal(__modal);
-       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
-       return E_SUCCESS;
-}
-
-
-result
-_InputPickerPopup::HidePopup(void)
-{
-       result r = E_SUCCESS;
-
-       r = __pPopup->SetShowState(false);
-       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
-       __isModal = false;
-
-       r = __pPopup->EndModal(__modal);
-       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
-       return E_SUCCESS;
-}
-
 bool
 _InputPickerPopup::OnKeyPressed(Control& source, const KeyEventInfo& keyEventInfo)
 {
index 93151ce..462a942 100755 (executable)
@@ -32,6 +32,7 @@
 #include <FUiIActionEventListener.h>
 #include <FUiIPropagatedKeyEventListener.h>
 #include <FUi_ControlManager.h>
+#include "FWebCtrl_WebPopup.h"
 
 namespace Tizen { namespace Ui
 {
@@ -62,8 +63,7 @@ enum _InputPickerMode
 
 
 class _InputPickerPopup
-       : public Tizen::Base::Object
-       , virtual public Tizen::Ui::IActionEventListener
+       : public _WebPopup
        , public Tizen::Ui::IPropagatedKeyEventListener
 {
 
@@ -89,9 +89,6 @@ public:
        Tizen::Base::String GetDate(void) const;
        Tizen::Graphics::Color GetColor(void) const;
 
-       result ShowPopup(void);
-       result HidePopup(void);
-
        virtual bool  OnKeyPressed (Tizen::Ui::Control &source, const Tizen::Ui::KeyEventInfo &keyEventInfo);
        virtual bool  OnKeyReleased (Tizen::Ui::Control &source, const Tizen::Ui::KeyEventInfo &keyEventInfo);
        virtual bool  OnPreviewKeyPressed (Tizen::Ui::Control &source, const Tizen::Ui::KeyEventInfo &keyEventInfo);
@@ -105,8 +102,6 @@ private:
 
        result CreatePopup(void);
 
-       result AddButton(_InputPickerButtonId buttonId);
-
        void CalculateColorPickerPopupSize(Tizen::Ui::_ControlOrientation orientation);
 
        result UpdateDate(void);
@@ -118,18 +113,15 @@ private:
 
 private:
 
-       std::unique_ptr<Tizen::Ui::Controls::Popup> __pPopup;
        Tizen::Ui::Controls::EditDate* __pEditDate;
        Tizen::Ui::Controls::EditTime* __pEditTime;
        Tizen::Ui::Controls::Button* __pSelectionBtn;
        Tizen::Ui::Controls::ColorPicker* __pColorPicker;
-
-       int __modal;
-       bool __isModal;
+       Tizen::Ui::Controls::Panel* __pButtonPanel;
 
        int __popupHeight;
        int __popupWidth;
-       int __btnHeight;
+       int __panelHeight;
 
        Ewk_Input_Type __inputType;
        Tizen::Base::String __dateStr;
index 42b4100..b45a2e7 100755 (executable)
@@ -5318,7 +5318,8 @@ _WebImpl::ShowColorPicker(int red, int green, int blue, int alpha, Color& color)
 
        __pColorPicker = std::move(pColorHadler);
 
-       r = __pColorPicker->ShowPopup();
+       int modalResult = 0;
+       r = __pColorPicker->ShowAndWait(modalResult);
        SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
 
        if (__pColorPicker)
@@ -5350,7 +5351,8 @@ _WebImpl::ShowDatePicker(Ewk_Input_Type inputType, const char* inputValue, Strin
 
        __pDatePicker = std::move(pInputPicker);
 
-       r = __pDatePicker->ShowPopup();
+       int modalResult = 0;
+       r = __pDatePicker->ShowAndWait(modalResult);
        SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
 
        if (__pDatePicker)
index f46f224..98f3fad 100755 (executable)
@@ -27,6 +27,7 @@
 #include <FUiAnimPointAnimation.h>
 #include <FUiAnimFloatAnimation.h>
 #include <FUiAnimAnimationTransaction.h>
+#include <FUiAnimVisualElementPropertyAnimation.h>
 #include <FUiCtrlButton.h>
 #include "FWebCtrl_WebImpl.h"
 #include "FWebCtrl_WebNotificationHandler.h"
@@ -160,19 +161,19 @@ _WebNotification::LaunchNotification()
        r = Window::Show();
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Error Propogating.", GetErrorMessage(r));
 
-       Point start(0,-200),end;
-       PointAnimation pointAnimation(Point(0, 0), Point(0, 0), 0, ANIMATION_INTERPOLATOR_LINEAR);
+       FloatRectangle rect(static_cast< float >(NOTIFCATION_RECT_AREA.x),static_cast< float >(NOTIFCATION_RECT_AREA.y),static_cast< float >(NOTIFCATION_RECT_AREA.width),static_cast< float >(NOTIFCATION_RECT_AREA.height));
 
-       end = Point(0,0);
+       FloatRectangle __endRect = rect;
+       FloatRectangle __startRect = FloatRectangle(rect.x, rect.height - 200, rect.width, rect.height);
 
-       pointAnimation.SetStartValue(start);
-       pointAnimation.SetEndValue(end);
-       pointAnimation.SetDuration(2000);
-       pointAnimation.SetAutoReverseEnabled(false);
+       std::unique_ptr<VisualElementPropertyAnimation> pAnimation(new (std::nothrow) VisualElementPropertyAnimation());
+       SysTryReturnResult(NID_WEB_CTRL, pAnimation.get(), E_OUT_OF_MEMORY, "Memory allocation failed.");
 
-       ControlAnimator *pAnimator = this->GetControlAnimator();
-       r = pAnimator->StartUserAnimation(ANIMATION_TARGET_POSITION, pointAnimation);
-       SysTryReturnResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Error Propagated.", GetErrorMessage(r));
+       pAnimation->SetPropertyName(L"bounds");
+       pAnimation->SetStartValue(Variant(__startRect));
+       pAnimation->SetEndValue(Variant(__endRect));
+       pAnimation->SetDuration(2000);
+       this->GetVisualElement()->AddAnimation(L"bounds", *pAnimation);
 
        __pTimer->Start(15000);
        return E_SUCCESS;
@@ -182,25 +183,17 @@ _WebNotification::LaunchNotification()
 void
 _WebNotification::OnTimerExpired(Timer& timer)
 {
-       int transactionId = 0;
-       int duration = 1000;
        float start = 1.0f;
        float end = 0.0f;
 
-       ParallelAnimationGroup showAnim;
-       FloatAnimation floatAnim(start, end, duration, ANIMATION_INTERPOLATOR_LINEAR);
-       showAnim.AddAnimation(ANIMATION_TARGET_ALPHA, floatAnim);
+       std::unique_ptr<VisualElementPropertyAnimation> pAnimation(new (std::nothrow) VisualElementPropertyAnimation());
+       SysTryReturnVoidResult(NID_WEB_CTRL, pAnimation.get(), E_OUT_OF_MEMORY, "Memory allocation failed.");
 
-       AnimationTransaction::Begin(transactionId);
-
-       ControlAnimator *pAnimator = this->GetControlAnimator();
-       pAnimator->SetAnimation(ANIMATION_TRIGGER_SHOW_STATE_CHANGE, &showAnim);
-       pAnimator->SetShowState(static_cast< int >(start));
-
-       AnimationTransaction::Commit();
-       __pWebImpl->ClearWebNotification(this);
-
-       delete this;
+       pAnimation->SetPropertyName(L"opacity");
+       pAnimation->SetStartValue(Variant(start));
+       pAnimation->SetEndValue(Variant(end));
+       pAnimation->SetDuration(2000);
+       this->GetVisualElement()->AddAnimation(L"opacity", *pAnimation);
 }
 
 
index 38e586f..c9b6769 100755 (executable)
@@ -123,22 +123,21 @@ _WebPopup::ShowPopup(void)
 result
 _WebPopup::HidePopup(int modalResult)
 {
+       result r = E_SUCCESS;
+
+       r = SetShowState(false);
+       SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
        if (__isModal)
        {
                __modal = modalResult;
                __isModal = false;
 
-               return EndModal(__modal);
-       }
-       else
-       {
-               result r = E_SUCCESS;
-
-               r = SetShowState(false);
+               r = EndModal(__modal);
                SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
-               return E_SUCCESS;
        }
+
+       return E_SUCCESS;
 }
 
 
@@ -160,7 +159,7 @@ _WebPopup::CreateAndAddPanel(void)
        std::unique_ptr<Panel> pPanel(new (std::nothrow) Panel());
        SysTryReturn(NID_WEB_CTRL, pPanel.get(), null, E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
 
-       Rectangle panelRect(0, 0, __pWebPopupData->popupDim.width, __pWebPopupData->panelHeight);
+       Rectangle panelRect(0, 0, GetSize().width, __pWebPopupData->panelHeight);
 
        result r = pPanel->Construct(panelRect, GROUP_STYLE_BOTTOM);
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
@@ -193,7 +192,7 @@ _WebPopup::CreateAndAddButtons(const IList& buttonIds, const IList& buttonTitles
        {
                GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_SIDE_MARGIN_01, _CONTROL_ORIENTATION_PORTRAIT, buttonMargin);
        }
-       int buttonWidth = (__pWebPopupData->popupDim.width - buttonMargin*(idCount+1)) / idCount;
+       int buttonWidth = (GetSize().width - buttonMargin*(idCount+1)) / idCount;
        int buttonTopMargin = (__pWebPopupData->panelHeight - __pWebPopupData->btnDim.height)/2;
 
        result r = E_SUCCESS;