Tizen 2.2.1
[framework/osp/web.git] / src / controls / FWebCtrl_PromptPopup.cpp
index 7937488..9a6ab1a 100755 (executable)
@@ -61,6 +61,7 @@ static const int EDIT_TEXT_SIZE = 35;
 _PromptPopup::_PromptPopup(void)
        : __pEditField(null)
        , __pWebView(null)
+       , __pImpl(null)
 {
 }
 
@@ -72,19 +73,20 @@ _PromptPopup::~_PromptPopup(void)
 
 // Prompt popup
 result
-_PromptPopup::Construct(const String& message, const String& defaultVale,  Evas_Object* pView)
+_PromptPopup::Construct(const String& message, const String& defaultVale,  Evas_Object* pView, _WebImpl* pImpl)
 {
        result r = E_SUCCESS;
        Rectangle rect(0, 0, 0, 0);
 
        int popupHeight = 0;
 
+       __pImpl = pImpl;
        __pWebView = pView;
 
        _WebPopupData* pPopupData = _WebPopup::GetPopupData();
        SysTryReturn(NID_WEB_CTRL, pPopupData, r = GetLastResult(), r, "[%s] Propagating.", GetErrorMessage(r));
 
-       popupHeight = pPopupData->editDim.height + pPopupData->labelDim.height  + pPopupData->btnDim.height + (2 * pPopupData->spacePad);
+       popupHeight = pPopupData->editDim.height + pPopupData->labelDim.height + pPopupData->panelHeight + (2 * pPopupData->spacePad);
 
        r = _WebPopup::Construct(true, Dimension(pPopupData->popupDim.width, popupHeight));
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
@@ -147,8 +149,8 @@ _PromptPopup::Construct(const String& message, const String& defaultVale,  Evas_
        ArrayList titleList;
        r = titleList.Construct();
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-       titleList.Add(*(new String(pSysResource->GetString("sys_string", "IDS_COM_POP_CANCEL"))));
-       titleList.Add(*(new String(pSysResource->GetString("sys_string", "IDS_COM_SK_OK"))));
+       titleList.Add(*(new String(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BUTTON_CANCEL_ABB"))));
+       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));
@@ -158,7 +160,6 @@ _PromptPopup::Construct(const String& message, const String& defaultVale,  Evas_
 
        pLayout->SetHorizontalAlignment(*pTmpTextBox, LAYOUT_HORIZONTAL_ALIGN_CENTER);
        pLayout->SetHorizontalAlignment(*__pEditField, LAYOUT_HORIZONTAL_ALIGN_CENTER);
-       pLayout->SetHorizontalAlignment(*pButtonPanel, LAYOUT_HORIZONTAL_ALIGN_CENTER);
 
        pLayout->SetSpacing(*__pEditField, pPopupData->spacePad);
        pLayout->SetSpacing(*pButtonPanel, pPopupData->spacePad);
@@ -197,13 +198,13 @@ _PromptPopup::OnActionPerformed(const Control& source, int actionId)
                SysAssertf(false, "unknown action ID used");
                break;
        }
-       GetOwner()->SendUserEvent(ID_PROMPT_POPUP_CLOSE, null);
+       __pImpl->SendUserEvent(ID_PROMPT_POPUP_CLOSE, null);
 }
 
 bool
 _PromptPopup::OnKeyPressed(Control& source, const KeyEventInfo& keyEventInfo)
 {
-       return true;
+       return false;
 }
 
 bool
@@ -213,10 +214,10 @@ _PromptPopup::OnKeyReleased(Control& source, const KeyEventInfo& keyEventInfo)
        {
                HidePopup(ID_BUTTON_PROMPT_CANCEL);
                ewk_view_javascript_prompt_reply(__pWebView, null);
-               GetOwner()->SendUserEvent(ID_PROMPT_POPUP_CLOSE, null);
+               __pImpl->SendUserEvent(ID_PROMPT_POPUP_CLOSE, null);
        }
 
-       return true;
+       return false;
 }
 
 bool