Remove context menu - Back key pressed
authorHyukSoon Choi <hs619.choi@samsung.com>
Fri, 28 Jun 2013 04:38:02 +0000 (13:38 +0900)
committerHyukSoon Choi <hs619.choi@samsung.com>
Fri, 28 Jun 2013 04:38:02 +0000 (13:38 +0900)
Change-Id: If9ad8729b08807d7a9006046b74e389513b864f2
Signed-off-by: HyukSoon Choi <hs619.choi@samsung.com>
inc/GlAlbumListForm.h
inc/GlFileListEditorForm.h
res/screen-size-normal/IDL_FORM_FILE_LIST_EDITOR.xml
src/GlAlbumListEditorForm.cpp
src/GlAlbumListForm.cpp
src/GlFileListEditorForm.cpp

index c56f017..8e2a988 100644 (file)
@@ -82,7 +82,6 @@ private:
 private:
        int __itemCount;
        Tizen::Ui::Controls::IconListView* __pAlbumViewIconList;
-       Tizen::Ui::Controls::ContextMenu* __pContextMenuMore;
        Tizen::Ui::Controls::OptionMenu* __pOptionMenu;
        AlbumListPresentationModel* __pPresentationModel;
 };
index 613e0a7..ceea6eb 100644 (file)
@@ -83,7 +83,7 @@ private:
        void SelectAllPressed(void);
 
 private:
-       Tizen::Ui::Controls::ContextMenu* __pContextMenuShare;
+       Tizen::Ui::Controls::ContextMenu* __pShareContextMenu;
        Tizen::Ui::Controls::OptionMenu* __pOptionMenu;
        Tizen::Ui::Controls::Popup* __pDeletePopup;
        Tizen::Graphics::Point __morePosition;
index 48f75f6..8a3aed8 100644 (file)
@@ -7,7 +7,7 @@
 <Scene Bversion="2.0.0.201306151404" Dversion="20120315">
     <LogicalCoordinate>720</LogicalCoordinate>
     <Form id="IDL_FORM_FILE_LIST_EDITOR">
-        <property backgroundColor="" backgroundColorOpacity="100" notificationTrayOpenEnabled="false" orientation="Portrait" softKey0NormalIcon="" softKey0PressedIcon="" softKey0Text="" softKey1NormalIcon="" softKey1PressedIcon="" softKey1Text="" title="" titleAlign="ALIGN_CENTER" titleIcon="" translucentFooter="false" translucentHeader="false" translucentIndicator="false"/>
+        <property backgroundColor="" backgroundColorOpacity="100" notificationTrayOpenEnabled="false" orientation="Automatic" softKey0NormalIcon="" softKey0PressedIcon="" softKey0Text="" softKey1NormalIcon="" softKey1PressedIcon="" softKey1Text="" title="" titleAlign="ALIGN_CENTER" titleIcon="" translucentFooter="false" translucentHeader="false" translucentIndicator="false"/>
         <layout mode="Portrait" style="FORM_STYLE_HEADER|FORM_STYLE_FOOTER|FORM_STYLE_INDICATOR_AUTO_HIDE" type="NONE"/>
         <layout mode="Landscape" style="FORM_STYLE_HEADER|FORM_STYLE_FOOTER|FORM_STYLE_INDICATOR_AUTO_HIDE" type="NONE"/>
     </Form>
index 82e9127..8e3ac3f 100644 (file)
@@ -608,8 +608,8 @@ AlbumListEditorForm::OnActionPerformed(const Control& source, int actionId)
                 __pShareContextMenu->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_MESSAGE"),
                                IDA_CONTEXT_MENU_MESSAGE);
                __pShareContextMenu->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_EMAIL"), IDA_CONTEXT_MENU_EMAIL);
+               __pShareContextMenu->SetFocusable(true);
                __pShareContextMenu->AddActionEventListener(*this);
-
                __pShareContextMenu->SetShowState(true);
                __pShareContextMenu->Show();
        }
index 5b6bc71..2a41143 100644 (file)
@@ -328,11 +328,6 @@ AlbumListForm::OnTerminating(void)
        AppLogDebug("ENTER");
        __pPresentationModel->RemovePresentationModelListener(*this);
        __pPresentationModel->RemoveContentEventListener(*this);
-       if (__pContextMenuMore != null)
-       {
-               delete __pContextMenuMore;
-               __pContextMenuMore = null;
-       }
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 
        return E_SUCCESS;
index 7646421..f229826 100644 (file)
@@ -58,7 +58,7 @@ static const unsigned int COLOR_DELETE_BUTTON_TEXT = Color32<248, 246, 239>::Val
 static const String RESERVED_MEDIA_PATH = Environment::GetMediaPath();
 
 FileListEditorForm::FileListEditorForm(void)
-       : __pContextMenuShare(null)
+       : __pShareContextMenu(null)
        , __pOptionMenu(null)
        , __pDeletePopup(null)
        , __morePosition(Point(0, 0))
@@ -318,11 +318,11 @@ FileListEditorForm::OnTerminating(void)
                __pOptionMenu = null;
        }
 
-       if (__pContextMenuShare != null)
+       if (__pShareContextMenu != null)
        {
-               __pContextMenuShare->RemoveActionEventListener(*this);
-               delete __pContextMenuShare;
-               __pContextMenuShare = null;
+               __pShareContextMenu->RemoveActionEventListener(*this);
+               delete __pShareContextMenu;
+               __pShareContextMenu = null;
        }
 
        if (__pDeletePopup != null)
@@ -351,34 +351,33 @@ FileListEditorForm::OnActionPerformed(const Control& source, int actionId)
 
        case IDA_FOOTER_SHARE:
        {
-               if ( __pContextMenuShare != NULL)
+               if ( __pShareContextMenu != NULL)
                {
-                       delete __pContextMenuShare;
-                       __pContextMenuShare = null;
+                       delete __pShareContextMenu;
+                       __pShareContextMenu = null;
                }
 
-               __pContextMenuShare = new (std::nothrow) ContextMenu();
-               __pContextMenuShare->Construct(Point(GetClientAreaBounds().width/3 + 15, GetClientAreaBounds().height), CONTEXT_MENU_STYLE_LIST , CONTEXT_MENU_ANCHOR_DIRECTION_UPWARD);
-               __pContextMenuShare->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_MESSAGE"),
+               __pShareContextMenu = new (std::nothrow) ContextMenu();
+               __pShareContextMenu->Construct(Point(GetClientAreaBounds().width/3 + 15, GetClientAreaBounds().height), CONTEXT_MENU_STYLE_LIST , CONTEXT_MENU_ANCHOR_DIRECTION_UPWARD);
+               __pShareContextMenu->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_MESSAGE"),
                                IDA_CONTEXT_MENU_SHARE_MESSAGE);
-               __pContextMenuShare->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_EMAIL"),
+               __pShareContextMenu->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_EMAIL"),
                                IDA_CONTEXT_MENU_SHARE_EMAIL);
-               __pContextMenuShare->AddActionEventListener(*this);
-
-
+               __pShareContextMenu->SetFocusable(true);
+               __pShareContextMenu->AddActionEventListener(*this);
 
                        Rectangle rect = source.GetBounds();
                        if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
                        {
-                               __pContextMenuShare->SetAnchorPosition(Point(rect.width / 8 * 3, rect.y));
+                               __pShareContextMenu->SetAnchorPosition(Point(rect.width / 8 * 3, rect.y));
                        }
                        else
                        {
-                               __pContextMenuShare->SetAnchorPosition(Point(rect.width / 8 * 3, rect.y - H_TOAST_LABEL));
+                               __pShareContextMenu->SetAnchorPosition(Point(rect.width / 8 * 3, rect.y - H_TOAST_LABEL));
                        }
 
-                       __pContextMenuShare->SetShowState(true);
-                       __pContextMenuShare->Show();
+                       __pShareContextMenu->SetShowState(true);
+                       __pShareContextMenu->Show();
 
        }
        break;
@@ -1010,9 +1009,9 @@ FileListEditorForm::OnFormBackRequested(Form& source)
                }
                else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
                {
-                       if (__pContextMenuShare != null && __pContextMenuShare->GetShowState() == true )
+                       if (__pShareContextMenu != null && __pShareContextMenu->GetShowState() == true )
                        {
-                               __pContextMenuShare->SetShowState(false);
+                               __pShareContextMenu->SetShowState(false);
                        }
                        else
                        {
@@ -1262,9 +1261,9 @@ FileListEditorForm::OnFormMenuRequested (Tizen::Ui::Controls::Form &source)
                }
        }
 
-       if (__pContextMenuShare != null && __pContextMenuShare->GetShowState() == true )
+       if (__pShareContextMenu != null && __pShareContextMenu->GetShowState() == true )
        {
-               __pContextMenuShare->SetShowState(false);
+               __pShareContextMenu->SetShowState(false);
        }
 
        if ( checkedCount > 0)