From c76862219bfd652e9188ecaf3674f4ed588cf190 Mon Sep 17 00:00:00 2001 From: HyukSoon Choi Date: Fri, 28 Jun 2013 13:37:21 +0900 Subject: [PATCH] Remove context menu - Back key pressed Change-Id: I2bf72c6977f2ba66640404380158ca9b97ab77cd Signed-off-by: HyukSoon Choi --- inc/VpVideoPlayerForm.h | 2 +- src/VpVideoPlayerForm.cpp | 35 ++++++++++++++++++----------------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/inc/VpVideoPlayerForm.h b/inc/VpVideoPlayerForm.h index b3f1c7e..3e18076 100755 --- a/inc/VpVideoPlayerForm.h +++ b/inc/VpVideoPlayerForm.h @@ -183,7 +183,7 @@ private: Tizen::Ui::Controls::Label* __pCurrenTimeLabel; Tizen::Ui::Controls::Label* __pTotalTimeLabel; Tizen::Ui::Controls::Slider* __pSlider; - Tizen::Ui::Controls::ContextMenu* __pContextMenuShare; + Tizen::Ui::Controls::ContextMenu* __pShareContextMenu; bool __actionTouchLongPressed; bool __setPauseState; bool __isControlVisibleState; diff --git a/src/VpVideoPlayerForm.cpp b/src/VpVideoPlayerForm.cpp index db970c0..fbb5fab 100644 --- a/src/VpVideoPlayerForm.cpp +++ b/src/VpVideoPlayerForm.cpp @@ -99,7 +99,7 @@ VideoPlayerForm::VideoPlayerForm(void) , __pCurrenTimeLabel(null) , __pTotalTimeLabel(null) , __pSlider(null) - , __pContextMenuShare(null) + , __pShareContextMenu(null) , __actionTouchLongPressed(false) , __setPauseState(false) , __isControlVisibleState(true) @@ -518,8 +518,8 @@ VideoPlayerForm::OnTerminating(void) delete __pSoundPathPopup; __pSoundPathPopup = null; - delete __pContextMenuShare; - __pContextMenuShare = null; + delete __pShareContextMenu; + __pShareContextMenu = null; return E_SUCCESS; } @@ -953,24 +953,25 @@ VideoPlayerForm::OnActionPerformed(const Control& source, int actionId) + (__pShareButton->GetBounds().width / DIVIDE_BY_TWO)), __pFunctionPanel->GetBounds().y + __pFunctionPanel->GetBounds().height); - if (__pContextMenuShare != null) + if (__pShareContextMenu != null) { - delete __pContextMenuShare; - __pContextMenuShare = null; + delete __pShareContextMenu; + __pShareContextMenu = null; } - __pContextMenuShare = new (std::nothrow) ContextMenu(); - r = __pContextMenuShare->Construct(point, CONTEXT_MENU_STYLE_LIST, CONTEXT_MENU_ANCHOR_DIRECTION_DOWNWARD); - TryReturnVoid(r == E_SUCCESS, "__pContextMenuShare->Construct() failed:%s", GetErrorMessage(r)); + __pShareContextMenu = new (std::nothrow) ContextMenu(); + r = __pShareContextMenu->Construct(point, CONTEXT_MENU_STYLE_LIST, CONTEXT_MENU_ANCHOR_DIRECTION_DOWNWARD); + TryReturnVoid(r == E_SUCCESS, "__pShareContextMenu->Construct() failed:%s", GetErrorMessage(r)); String str; Application::GetInstance()->GetAppResource()->GetString(L"IDS_COM_BODY_MESSAGE", str); - __pContextMenuShare->AddItem(str, IDA_CONTEXTMENU_MESSAGE); + __pShareContextMenu->AddItem(str, IDA_CONTEXTMENU_MESSAGE); Application::GetInstance()->GetAppResource()->GetString(L"IDS_COM_BODY_EMAIL", str); - __pContextMenuShare->AddItem(str, IDA_CONTEXTMENU_EMAIL); - __pContextMenuShare->AddActionEventListener(*this); - __pContextMenuShare->SetShowState(true); - __pContextMenuShare->Show(); + __pShareContextMenu->AddItem(str, IDA_CONTEXTMENU_EMAIL); + __pShareContextMenu->SetFocusable(true); + __pShareContextMenu->AddActionEventListener(*this); + __pShareContextMenu->SetShowState(true); + __pShareContextMenu->Show(); if (playState == PLAYER_STATE_PLAYING) { @@ -1526,11 +1527,11 @@ VideoPlayerForm::ShowControl(bool setShow) __pFunctionPanel->SetShowState(false); __pControllerPanel->SetShowState(false); - if (__pContextMenuShare != null) + if (__pShareContextMenu != null) { - if (__pContextMenuShare->GetShowState() == true) + if (__pShareContextMenu->GetShowState() == true) { - __pContextMenuShare->SetShowState(false); + __pShareContextMenu->SetShowState(false); } } -- 2.7.4