X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fcontrols%2FFWebCtrl_InputPickerPopup.cpp;h=082635855406ede3a543a1218e9548b1393014da;hb=86daf9e9f4a4ec7fffd9b80556243f16ff1239ee;hp=15eeaf7f84025681ec16094502923ecc6a6f33ea;hpb=f41c613e80a5fcbc7f08febb707a7745ca26a461;p=framework%2Fosp%2Fweb.git diff --git a/src/controls/FWebCtrl_InputPickerPopup.cpp b/src/controls/FWebCtrl_InputPickerPopup.cpp index 15eeaf7..0826358 100755 --- a/src/controls/FWebCtrl_InputPickerPopup.cpp +++ b/src/controls/FWebCtrl_InputPickerPopup.cpp @@ -32,23 +32,22 @@ #include #include #include +#include #include #include #include -#include -#include #include +#include #include "FWebCtrl_WebImpl.h" #include "FWebCtrl_InputPickerPopup.h" using namespace Tizen::Base; using namespace Tizen::Graphics; -using namespace Tizen::Web::Controls; -using namespace Tizen::Ui::Controls; -using namespace Tizen::Ui; using namespace Tizen::Locales; using namespace Tizen::System; +using namespace Tizen::Ui; +using namespace Tizen::Ui::Controls; namespace Tizen { namespace Web { namespace Controls @@ -64,6 +63,7 @@ _InputPickerPopup::_InputPickerPopup(void) , __pEditTime(null) , __pSelectionBtn(null) , __modal(0) + , __isModal(false) , __popupHeight(0) , __popupWidth(0) , __btnHeight(0) @@ -74,11 +74,15 @@ _InputPickerPopup::_InputPickerPopup(void) _InputPickerPopup::~_InputPickerPopup(void) { + if (__isModal == true) + { + HidePopup(); + } } result -_InputPickerPopup::Construct(const String& strDate, Ewk_Input_Type inputType) +_InputPickerPopup::Construct(const String& strDate, Ewk_Input_Type inputType, Tizen::Web::Controls::_WebImpl* pImpl) { result r = E_SUCCESS; @@ -98,7 +102,7 @@ _InputPickerPopup::Construct(const String& strDate, Ewk_Input_Type inputType) r = Parse(strDate, inputDateTime); } - _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation(); + _ControlOrientation orientation = _CONTROL_ORIENTATION_PORTRAIT; GET_SHAPE_CONFIG(EDITDATE::WIDTH, orientation, dateWidth); GET_SHAPE_CONFIG(EDITDATE::HEIGHT, orientation, dateHeight); @@ -107,6 +111,8 @@ _InputPickerPopup::Construct(const String& strDate, Ewk_Input_Type inputType) GET_SHAPE_CONFIG(MESSAGEBOX::MIN_HEIGHT, orientation, __popupHeight); GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_HEIGHT, orientation, __btnHeight); + __popupWidth -= 2*sideMargin; + std::unique_ptr pEditDate(new (std::nothrow) EditDate()); SysTryReturnResult(NID_WEB_CTRL, pEditDate.get(), E_OUT_OF_MEMORY, "Memory Allocation Failed."); @@ -194,6 +200,8 @@ _InputPickerPopup::Construct(const String& strDate, Ewk_Input_Type inputType) r = AddButton(ID_BUTTON_INPUT_DATE_SELECTION); SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + __pPopup->SetPropagatedKeyEventListener(this); + std::unique_ptr pLayout(dynamic_cast< VerticalBoxLayout* >(__pPopup->GetLayoutN())); SysTryReturnResult(NID_WEB_CTRL, pLayout.get(), E_OUT_OF_MEMORY, "Memory Allocation Failed."); @@ -217,7 +225,7 @@ _InputPickerPopup::Construct(const String& strDate, Ewk_Input_Type inputType) result -_InputPickerPopup::Construct(const Color& color) +_InputPickerPopup::Construct(const Color& color, Tizen::Web::Controls::_WebImpl* pImpl) { result r = E_SUCCESS; @@ -240,6 +248,7 @@ _InputPickerPopup::Construct(const Color& color) pColorPicker->SetColor(color); + __pPopup->SetPropagatedKeyEventListener(this); r = __pPopup->AddControl(*pColorPicker); SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -295,7 +304,7 @@ _InputPickerPopup::CreatePopup(void) std::unique_ptr pPopup(new (std::nothrow) Popup()); SysTryReturnResult(NID_WEB_CTRL, pPopup.get(), E_OUT_OF_MEMORY, "Memory Allocation Failed."); - r = pPopup->Construct(layout, layout, true, Tizen::Graphics::Dimension(__popupWidth, __popupHeight)); + 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); @@ -310,11 +319,11 @@ _InputPickerPopup::AddButton(_InputPickerButtonId buttonId) result r = E_SUCCESS; String buttonStr; - - Tizen::System::_SystemResource* pSysResource = Tizen::System::_SystemResource::GetInstance(); + + _SystemResource* pSysResource = _SystemResource::GetInstance(); SysAssertf(pSysResource != null, "Failed to get _SystemResource instance"); - buttonStr = pSysResource->GetString("sys_string", "IDS_COM_SK_OK"); + buttonStr = pSysResource->GetString("sys_string", "IDS_TPLATFORM_BUTTON_OK"); std::unique_ptr