fix select popup
authorHyunseok Yang <hs0219.yang@samsung.com>
Tue, 17 Sep 2013 11:43:39 +0000 (20:43 +0900)
committerHyunseok Yang <hs0219.yang@samsung.com>
Tue, 17 Sep 2013 11:43:39 +0000 (20:43 +0900)
Change-Id: I1f9a13e45d526d513802d350b4cb531bab32ed66
Signed-off-by: Hyunseok Yang <hs0219.yang@samsung.com>
src/controls/FWebCtrl_SelectBox.cpp
src/controls/FWebCtrl_SelectBox.h
src/controls/FWebCtrl_WebImpl.cpp
src/controls/inc/FWebCtrl_WebImpl.h

index b65d1f4..057ebd7 100755 (executable)
@@ -42,6 +42,7 @@
 #include <FSys_SystemResource.h>
 #include <FUi_ResourceManager.h>
 #include "FWebCtrl_SelectBox.h"
+#include "FWebCtrl_WebImpl.h"
 
 
 using namespace Tizen::Base;
@@ -151,6 +152,7 @@ _SelectBox::_SelectBox(void)
        , __pWebView(null)
        , __pToggledArray(null)
        , __url(L"")
+       , __pImpl(null)
 {
 }
 
@@ -168,7 +170,7 @@ _SelectBox::~_SelectBox(void)
 
 
 result
-_SelectBox::Construct(bool isMultiSelect, const String& title, int listCount, Evas_Object* pWebView, const String& url)
+_SelectBox::Construct(Tizen::Web::Controls::_WebImpl* pImpl, bool isMultiSelect, const String& title, int listCount, Evas_Object* pWebView, const String& url)
 {
        result r = E_SUCCESS;
        Rectangle rect;
@@ -179,6 +181,7 @@ _SelectBox::Construct(bool isMultiSelect, const String& title, int listCount, Ev
 
        __pWebView = pWebView;
        __url = const_cast< String& >(url);
+       __pImpl = pImpl;
 
        GET_SHAPE_CONFIG(CONTEXTMENU::LIST_ITEM_HEIGHT, __orientation, listItemHeight);
 
@@ -450,6 +453,8 @@ _SelectBox::OnListViewItemStateChanged(ListView& listView, int index, int elemen
 
                result r = HidePopup();
                SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+               
+               __pImpl->SendUserEvent(ID_USER_SCRIPT_SELECTBOX_CLOSE, null);
        }
 }
 
@@ -492,6 +497,7 @@ _SelectBox::OnActionPerformed(const Control& source, int actionId)
                        SysAssertf(false, "Invalid Action ID");
                }
        }
+       __pImpl->SendUserEvent(ID_USER_SCRIPT_SELECTBOX_CLOSE, null);
 }
 
 bool
index 1b2f59c..00afe24 100755 (executable)
@@ -32,6 +32,7 @@
 #include <FUiIPropagatedKeyEventListener.h>
 #include <FUi_ControlManager.h>
 #include "FWebCtrl_WebPopup.h"
+#include "FWebCtrl_WebImpl.h"
 
 namespace Tizen { namespace Graphics
 {
@@ -77,7 +78,7 @@ public:
         */
        virtual ~_SelectBox(void);
 
-       result Construct(bool isMultiSelect, const Tizen::Base::String& title, int listItemCnt, Evas_Object* pWebView = null, const Tizen::Base::String& url = L"");
+       result Construct(Tizen::Web::Controls::_WebImpl* pImpl, bool isMultiSelect, const Tizen::Base::String& title, int listItemCnt, Evas_Object* pWebView = null, const Tizen::Base::String& url = L"");
        Tizen::Base::Collection::IList* GetSelectedListN(void) const;
 
        //IListViewItemProvider
@@ -125,6 +126,7 @@ public:
 private:
        Tizen::Base::Collection::ArrayList __listElementArray;
        Tizen::Ui::Controls::ListView* __pListView;
+       Tizen::Web::Controls::_WebImpl* __pImpl;
        bool __multiSelection;
        int __SelectedIndex;
        int __prevIndex;
index 7180a49..ac7477a 100755 (executable)
@@ -2525,7 +2525,7 @@ _WebImpl::ShowSelectBoxPopup(bool isMultiSelect, const String& title, Eina_List*
        std::unique_ptr<_SelectBox> pSelectBox(new (std::nothrow) _SelectBox());
        SysTryReturnResult(NID_WEB_CTRL, pSelectBox.get(), E_OUT_OF_MEMORY, "Memory allocation failed.");
 
-       r = pSelectBox->Construct(isMultiSelect, title, DEFAULT_LIST_ITEM_COUNT, pWebView);
+       r = pSelectBox->Construct(this, isMultiSelect, title, DEFAULT_LIST_ITEM_COUNT, pWebView);
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
        r = pSelectBox->UpdateList(pItems, selectedIndex, false, false);
@@ -5073,6 +5073,9 @@ _WebImpl::OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::ILi
        case ID_USER_CONFIRM_SAVE_PASSWORD_CLOSE:
                __pSavePasswordConfirmPopup.reset();
                break;
+       case ID_USER_SCRIPT_SELECTBOX_CLOSE:
+               __pSelectBox.reset();
+               break;
        default:
                break;
        }
index 7b5f131..b8560e2 100755 (executable)
@@ -138,7 +138,8 @@ enum _WebPopupCloseId
        ID_USER_CONFIRM_NOTIFICATION_CLOSE,
        ID_USER_SCRIPT_ALERT_CLOSE,
        ID_USER_SCRIPT_CONFIRM_CLOSE,
-       ID_USER_CONFIRM_SAVE_PASSWORD_CLOSE
+       ID_USER_CONFIRM_SAVE_PASSWORD_CLOSE,
+       ID_USER_SCRIPT_SELECTBOX_CLOSE
 };
 
 class _OSP_EXPORT_ _WebImpl