From 63d7376645a8b1767fed4efc3afac326d6b5f61e Mon Sep 17 00:00:00 2001 From: HyukSoon Choi Date: Fri, 28 Jun 2013 13:38:02 +0900 Subject: [PATCH] Remove context menu - Back key pressed Change-Id: If9ad8729b08807d7a9006046b74e389513b864f2 Signed-off-by: HyukSoon Choi --- inc/GlAlbumListForm.h | 1 - inc/GlFileListEditorForm.h | 2 +- .../IDL_FORM_FILE_LIST_EDITOR.xml | 2 +- src/GlAlbumListEditorForm.cpp | 2 +- src/GlAlbumListForm.cpp | 5 --- src/GlFileListEditorForm.cpp | 45 +++++++++++----------- 6 files changed, 25 insertions(+), 32 deletions(-) diff --git a/inc/GlAlbumListForm.h b/inc/GlAlbumListForm.h index c56f017..8e2a988 100644 --- a/inc/GlAlbumListForm.h +++ b/inc/GlAlbumListForm.h @@ -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; }; diff --git a/inc/GlFileListEditorForm.h b/inc/GlFileListEditorForm.h index 613e0a7..ceea6eb 100644 --- a/inc/GlFileListEditorForm.h +++ b/inc/GlFileListEditorForm.h @@ -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; diff --git a/res/screen-size-normal/IDL_FORM_FILE_LIST_EDITOR.xml b/res/screen-size-normal/IDL_FORM_FILE_LIST_EDITOR.xml index 48f75f6..8a3aed8 100644 --- a/res/screen-size-normal/IDL_FORM_FILE_LIST_EDITOR.xml +++ b/res/screen-size-normal/IDL_FORM_FILE_LIST_EDITOR.xml @@ -7,7 +7,7 @@ 720
- + diff --git a/src/GlAlbumListEditorForm.cpp b/src/GlAlbumListEditorForm.cpp index 82e9127..8e3ac3f 100644 --- a/src/GlAlbumListEditorForm.cpp +++ b/src/GlAlbumListEditorForm.cpp @@ -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(); } diff --git a/src/GlAlbumListForm.cpp b/src/GlAlbumListForm.cpp index 5b6bc71..2a41143 100644 --- a/src/GlAlbumListForm.cpp +++ b/src/GlAlbumListForm.cpp @@ -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; diff --git a/src/GlFileListEditorForm.cpp b/src/GlFileListEditorForm.cpp index 7646421..f229826 100644 --- a/src/GlFileListEditorForm.cpp +++ b/src/GlFileListEditorForm.cpp @@ -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) -- 2.7.4