Handling Home & Power key in OptionMenu & ContextMenu
authorvipul <vipul.kumar@samsung.com>
Mon, 15 Jul 2013 10:44:37 +0000 (16:14 +0530)
committermoinuddin.s <moinuddin.s@samsung.com>
Mon, 15 Jul 2013 16:58:33 +0000 (22:28 +0530)
Signed-off-by: vipul <vipul.kumar@samsung.com>
Change-Id: I94d94858475b0f2348ea98904442956c251a7fa7
Signed-off-by: moinuddin.s <moinuddin.s@samsung.com>
13 files changed:
src/ui/controls/FUiCtrl_ContextMenu.cpp
src/ui/controls/FUiCtrl_ContextMenuItem.cpp
src/ui/controls/FUiCtrl_ContextMenuListPresenter.cpp
src/ui/controls/FUiCtrl_OptionMenu.cpp
src/ui/controls/FUiCtrl_OptionMenuItem.cpp
src/ui/controls/FUiCtrl_OptionMenuPresenter.cpp
src/ui/controls/FUiCtrl_TabBarPresenter.cpp
src/ui/controls/FUiCtrl_TableViewItem.cpp
src/ui/inc/FUiCtrl_ContextMenu.h
src/ui/inc/FUiCtrl_OptionMenu.h
src/ui/inc/FUiCtrl_OptionMenuItem.h
src/ui/inc/FUi_ResourceOptionMenuConfig.h
src/ui/resource/FUi_ResourceOptionMenuConfig.cpp

index b06d8aa..c3e16af 100644 (file)
@@ -66,6 +66,7 @@ _ContextMenu::_ContextMenu(const FloatPoint& point, enum ContextMenuCoreStyle st
        , __pBackgroundNormalBitmap(null)
        , __pBackgroundEffectBitmap(null)
        , __dropPosition(CONTEXT_MENU_CORE_DROP_POSITION_INVALID)
+       , __pCurrentFrame(null)
        , __layout(_CONTROL_ORIENTATION_PORTRAIT)
        , __rotation(_CONTROL_ROTATION_0)
        , __pScrollPanel(null)
@@ -91,6 +92,12 @@ _ContextMenu::_ContextMenu(const FloatPoint& point, enum ContextMenuCoreStyle st
 
 _ContextMenu::~_ContextMenu(void)
 {
+       if (__pCurrentFrame)
+       {
+               __pCurrentFrame->RemoveFrameEventListener(*this);
+               __pCurrentFrame = null;
+       }
+
        if (__isAttachedToMainTree && GetOwner() != null)
        {
                GetOwner()->UnlockInputEvent();
@@ -296,11 +303,13 @@ _ContextMenu::OnAttachedToMainTree(void)
        _Control* pOwner = GetOwner();
        if (pOwner == null)
        {
-               _Frame* pFrame = dynamic_cast<_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame());
-               SysTryReturn(NID_UI_CTRL, pFrame != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Current frame instance is not available.");
+               __pCurrentFrame = dynamic_cast<_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame());
+               SysTryReturn(NID_UI_CTRL, __pCurrentFrame != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Current frame instance is not available.");
 
-               _Form* pForm = pFrame->GetCurrentForm();
-               pForm != null ? SetOwner(pForm) : SetOwner(pFrame);
+               __pCurrentFrame->AddFrameEventListener(*this);
+
+               _Form* pForm = __pCurrentFrame->GetCurrentForm();
+               pForm != null ? SetOwner(pForm) : SetOwner(__pCurrentFrame);
 
                pOwner = GetOwner();
 
@@ -435,6 +444,30 @@ _ContextMenu::OnDetachingFromMainTree(void)
        return r;
 }
 
+void
+_ContextMenu::OnFrameDeactivated(const _Frame& source)
+{
+       SetVisibleState(false);
+       return;
+}
+
+void
+_ContextMenu::OnFrameActivated(const _Frame& source)
+{
+       return;
+}
+
+void
+_ContextMenu::OnFrameMinimized(const _Frame& source)
+{
+       return;
+}
+void
+_ContextMenu::OnFrameRestored(const _Frame& source)
+{
+       return;
+}
+
 result
 _ContextMenu::AddItem(const Base::String& text, int actionId, const Bitmap* pNormalBitmap, const Bitmap* pPressedBitmap,
                                          const Bitmap* pHighlightedBitmap)
index 49bc955..c8a878d 100644 (file)
@@ -409,12 +409,10 @@ _ContextMenuItem::DrawItemUpperDivider(void)
        }
 
        bounds = GetBoundsF();
-       if (__selected == false)
-       {
-               dividerLineColor = __upperDividerLineColor;
-       }
 
-       __pUpperDividerLineLabel->SetBounds(FloatRectangle(__leftMargin, 0.0f, bounds.width - __leftMargin - __rightMargin, __dividerHeight));
+       dividerLineColor = __upperDividerLineColor;
+
+       __pUpperDividerLineLabel->SetBounds(FloatRectangle(0.0f, 0.0f, bounds.width , __dividerHeight));
        __pUpperDividerLineLabel->SetBackgroundColor(dividerLineColor);
        __pUpperDividerLineLabel->Invalidate();
 }
@@ -453,21 +451,21 @@ _ContextMenuItem::DrawItemBackground(void)
        FloatRectangle boundsScrollPanel = pScrollPanel->GetBoundsF();
 
        float topOverlap = pScrollPanel->GetScrollPosition() - bounds.y;
-       if (topOverlap > 0.0f)
+       if (topOverlap >= 0.0f)
        {
-               topMargin = topOverlap + __bgPressedMargin;
+               topMargin = topOverlap;
        }
-       else if (!__upperDividerLine)
+       else
        {
                topMargin = __bgPressedMargin;
        }
 
        float bottomOverlap = bounds.y + bounds.height - (pScrollPanel->GetScrollPosition() + boundsScrollPanel.height);
-       if (bottomOverlap > 0.0f)
+       if (bottomOverlap >= 0.0f)
        {
-               bottomMargin = bottomOverlap + __bgPressedMargin;
+               bottomMargin = bottomOverlap;
        }
-       else if (!__lowerDividerLine)
+       else
        {
                bottomMargin = __bgPressedMargin;
        }
@@ -505,12 +503,10 @@ _ContextMenuItem::DrawItemLowerDivider(void)
        }
 
        bounds = GetBoundsF();
-       if (__selected == false)
-       {
-               dividerLineColor = __lowerDividerLineColor;
-       }
 
-       __pLowerDividerLineLabel->SetBounds(FloatRectangle(__leftMargin, bounds.height - __dividerHeight, bounds.width - __leftMargin - __rightMargin, __dividerHeight));
+       dividerLineColor = __lowerDividerLineColor;
+
+       __pLowerDividerLineLabel->SetBounds(FloatRectangle(0.0f, bounds.height - __dividerHeight, bounds.width, __dividerHeight));
        __pLowerDividerLineLabel->SetBackgroundColor(dividerLineColor);
        __pLowerDividerLineLabel->Invalidate();
 }
index d050a29..c93fac3 100644 (file)
@@ -759,11 +759,14 @@ _ContextMenuListPresenter::CalculateRect(void)
        // _Scroll visual interaction if Bounds < ScrollAreaBounds
        if (__pContextMenu->IsVisible())
        {
-               __pContextMenu->GetScrollPanel()->SetBounds(FloatRectangle(bodyRect.x + bodyLeftMargin, bodyRect.y + bodyTopMargin, __layoutSize.width, __layoutSize.height));
+               int itemTopMargin;
+               GET_SHAPE_CONFIG(CONTEXTMENU::ITEM_BG_PRESSED_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, itemTopMargin);
+               __pContextMenu->GetScrollPanel()->SetBounds(FloatRectangle(bodyRect.x + bodyLeftMargin, bodyRect.y + bodyTopMargin + itemTopMargin,
+                               __layoutSize.width, __layoutSize.height - 2 * itemTopMargin));
                int itemCount = __pModel->GetItemCount();
                float itemHeight = __itemHeight + (__dividerHeight * 2.0f);
                float layoutClientHeight = itemCount * itemHeight - (__dividerHeight * 2.0f);
-               __pContextMenu->GetScrollPanel()->SetClientAreaHeight(layoutClientHeight);
+               __pContextMenu->GetScrollPanel()->SetClientAreaHeight(layoutClientHeight - 2 * itemTopMargin);
        }
 
        __pContextMenu->SetMovable(true);
index 3905327..f4b574c 100644 (file)
@@ -26,6 +26,7 @@
 
 #include <FGrp_BitmapImpl.h>
 #include "FUi_ControlImplManager.h"
+#include "FUi_EcoreEvasMgr.h"
 #include "FUi_ResourceManager.h"
 #include "FUiAnim_VisualElement.h"
 #include "FUiAnim_AnimationManager.h"
@@ -69,8 +70,10 @@ _OptionMenu::_OptionMenu(void)
        , __pBackgroundNormalBitmap(null)
        , __pBackgroundEffectBitmap(null)
        , __layout(_CONTROL_ORIENTATION_PORTRAIT)
+       , __rotation(_CONTROL_ROTATION_0)
        , __pScrollPanel(null)
        , __pSubMenu(null)
+       , __pCurrentFrame(null)
        , __subMenuIndex(-1)
 {
        __backgroundColor = Color(255, 255, 255, 255);
@@ -86,6 +89,12 @@ _OptionMenu::_OptionMenu(void)
 
 _OptionMenu::~_OptionMenu(void)
 {
+       if (__pCurrentFrame)
+       {
+               __pCurrentFrame->RemoveFrameEventListener(*this);
+               __pCurrentFrame = null;
+       }
+
        if (__isAttachedToMainTree && GetOwner() != null)
        {
                GetOwner()->UnlockInputEvent();
@@ -433,22 +442,57 @@ _OptionMenu::OnAttachedToMainTree(void)
 {
        result r = E_SUCCESS;
 
-       __layout = _ControlManager::GetInstance()->GetOrientation();
        __isAttachedToMainTree = true;
+
        _Control* pOwner = GetOwner();
        if (pOwner == null)
        {
-               _Frame* pFrame = dynamic_cast<_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame());
-               SysTryReturn(NID_UI_CTRL, pFrame != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Current frame instance is not available.");
+               __pCurrentFrame = dynamic_cast<_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame());
+               SysTryReturn(NID_UI_CTRL, __pCurrentFrame != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Current frame instance is not available.");
 
-               _Form* pForm = pFrame->GetCurrentForm();
-               pForm != null ? SetOwner(pForm) : SetOwner(pFrame);
+               __pCurrentFrame->AddFrameEventListener(*this);
+
+               _Form* pForm = __pCurrentFrame->GetCurrentForm();
+               pForm != null ? SetOwner(pForm) : SetOwner(__pCurrentFrame);
+
+               pOwner = GetOwner();
        }
        else
        {
                pOwner->LockInputEvent();
        }
 
+       __layout = pOwner->GetOrientation();
+
+       _Window* pOwnerWindow = pOwner->GetRootWindow();
+
+       if (pOwnerWindow != null)
+       {
+               int ownerRotation = GetEcoreEvasMgr()->GetEcoreEvas()->GetWindowRotation(*pOwnerWindow);
+               switch (ownerRotation)
+               {
+               case 0:
+                       __rotation = _CONTROL_ROTATION_0;
+                       break;
+
+               case 90:
+                       __rotation = _CONTROL_ROTATION_90;
+                       break;
+
+               case 180:
+                       __rotation = _CONTROL_ROTATION_180;
+                       break;
+
+               case 270:
+                       __rotation = _CONTROL_ROTATION_270;
+                       break;
+
+               default:
+                       __rotation = _CONTROL_ROTATION_0;
+                       break;
+               }
+       }
+
        r = __pOptionMenuPresenter->CalculateWindowRect();
        SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(GetLastResult()));
 
@@ -495,6 +539,31 @@ _OptionMenu::OnDetachingFromMainTree(void)
 }
 
 void
+_OptionMenu::OnFrameDeactivated(const _Frame& source)
+{
+       DestroySubMenu();
+       SetVisibleState(false);
+       return;
+}
+
+void
+_OptionMenu::OnFrameActivated(const _Frame& source)
+{
+       return;
+}
+
+void
+_OptionMenu::OnFrameMinimized(const _Frame& source)
+{
+       return;
+}
+void
+_OptionMenu::OnFrameRestored(const _Frame& source)
+{
+       return;
+}
+
+void
 _OptionMenu::OnActivated(void)
 {
        _TouchManager* pTouchManager = _TouchManager::GetInstance();
@@ -664,22 +733,21 @@ _OptionMenu::ShowSubMenu(int mainIndex, _OptionMenuItem& item)
        FloatRectangle itemBounds = item.GetBoundsF();
        itemBounds.height = itemHeight;
        float scrollPosition = __pScrollPanel->GetScrollPosition();
-    FloatPoint anchorPosition(0.0f, 0.0f);
-    _ControlRotation rotation = _ControlManager::GetInstance()->GetScreenRotation();
-    ContextMenuCoreAlign alignment = CONTEXT_MENU_CORE_ALIGN_RIGHT;
+       FloatPoint anchorPosition(0.0f, 0.0f);
+       ContextMenuCoreAlign alignment = CONTEXT_MENU_CORE_ALIGN_RIGHT;
 
-    if (rotation == _CONTROL_ROTATION_270 && __layout == _CONTROL_ORIENTATION_LANDSCAPE)
-    {
-        alignment = CONTEXT_MENU_CORE_ALIGN_LEFT;
-    }
-    else
-    {
-        alignment = CONTEXT_MENU_CORE_ALIGN_RIGHT;
-    }
+       if (__rotation == _CONTROL_ROTATION_270 && __layout == _CONTROL_ORIENTATION_LANDSCAPE)
+       {
+               alignment = CONTEXT_MENU_CORE_ALIGN_LEFT;
+       }
+       else
+       {
+               alignment = CONTEXT_MENU_CORE_ALIGN_RIGHT;
+       }
 
-    anchorPosition = FloatPoint(GetBoundsF().x + itemBounds.x + itemBounds.width / 2.0f, GetBoundsF().y + itemBounds.y + itemBounds.height / 2.0f - scrollPosition);
+       anchorPosition = FloatPoint(GetBoundsF().x + itemBounds.x + itemBounds.width / 2.0f, GetBoundsF().y + itemBounds.y + itemBounds.height / 2.0f - scrollPosition);
 
-    __pSubMenu = _ContextMenu::CreateContextMenuN(anchorPosition, CONTEXT_MENU_CORE_STYLE_LIST, alignment);
+       __pSubMenu = _ContextMenu::CreateContextMenuN(anchorPosition, CONTEXT_MENU_CORE_STYLE_LIST, alignment);
 
        if (__pSubMenu == null)
        {
@@ -1352,6 +1420,16 @@ _OptionMenu::OnChangeLayout(_ControlRotation rotation)
                GET_SHAPE_CONFIG(OPTIONMENU::MAX_VISIBLE_ITEM_COUNT, __layout, __showItemCount);
        }
 
+       if (__isAttachedToMainTree == true)
+       {
+               if(__rotation != rotation)
+               {
+                       SetVisibleState(false);
+               }
+       }
+
+       __rotation =  rotation;
+
        __pOptionMenuPresenter->ResetSelectedItem();
        __pOptionMenuPresenter->CalculateWindowRect();
 }
@@ -1497,4 +1575,10 @@ _OptionMenu::GetLayout(void) const
        return __layout;
 }
 
+_ControlRotation
+_OptionMenu::GetRotation(void) const
+{
+       return __rotation;
+}
+
 }}} // Tizen::Ui: Control
index 26210be..37f0d21 100755 (executable)
@@ -62,6 +62,8 @@ _OptionMenuItem::_OptionMenuItem(void)
        , __arrowRightMargin(0.0f)
        , __arrowMargin(0.0f)
        , __itemHeight(0.0f)
+       , __bgPressedLeftRightMargin(0.0f)
+       , __bgPressedTopBottomMargin(0.0f)
        , __textSize(0.0f)
        , __text(L"")
        , __pMagentaBgBitmap(null)
@@ -87,6 +89,8 @@ _OptionMenuItem::_OptionMenuItem(void)
        GET_SHAPE_CONFIG(OPTIONMENU::LIST_RIGHT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, __rightMargin);
        GET_SHAPE_CONFIG(OPTIONMENU::LIST_DIVIDER_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, __dividerHeight);
        GET_SHAPE_CONFIG(OPTIONMENU::ITEM_BG_PRESSED_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, __bgPressedMargin);
+       GET_SHAPE_CONFIG(OPTIONMENU::ITEM_BG_PRESSED_LEFT_RIGHT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, __bgPressedLeftRightMargin);
+       GET_SHAPE_CONFIG(OPTIONMENU::ITEM_BG_PRESSED_TOP_BOTTOM_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, __bgPressedTopBottomMargin);
 
        GET_SHAPE_CONFIG(OPTIONMENU::TEXT_LEFT_MARGIN, orientation, __textLeftMargin);
        GET_SHAPE_CONFIG(OPTIONMENU::TEXT_RIGHT_MARGIN, orientation, __textRightMargin);
@@ -675,10 +679,8 @@ _OptionMenuItem::DrawItemUpperDivider(void)
        }
 
        bounds = GetBoundsF();
-       if (__selected == false)
-       {
-               dividerLineColor = __upperDividerLineColor;
-       }
+
+       dividerLineColor = __upperDividerLineColor;
 
        __pUpperDividerLineLabel->SetBounds(FloatRectangle(0.0f, 0.0f, bounds.width, __dividerHeight));
        __pUpperDividerLineLabel->SetBackgroundColor(dividerLineColor);
@@ -715,6 +717,8 @@ void
 _OptionMenuItem::DrawItemBackground(void)
 {
        SetBackgroundColor(Color(0, 0, 0, 0));
+       float topMargin = 0.0f;
+       float bottomMargin = 0.0f;
 
        if (__pBackgroundLabel == null)
        {
@@ -732,17 +736,39 @@ _OptionMenuItem::DrawItemBackground(void)
                }
        }
 
+       FloatRectangle bounds = GetBoundsF();
+
        Color color= Color(0, 0, 0, 0);
        if (__selected == true)
        {
                color = __selectedBgColor;
        }
 
-       FloatRectangle bounds = GetBoundsF();
        _ScrollPanel* pScrollPanel = static_cast<_ScrollPanel*>(GetParent());
        FloatRectangle boundsScrollPanel = pScrollPanel->GetBoundsF();
 
-       __pBackgroundLabel->SetBounds(FloatRectangle(0, 0, bounds.width, bounds.height));
+       float topOverlap = pScrollPanel->GetScrollPosition() - bounds.y;
+       if (topOverlap >= 0.0f)
+       {
+               topMargin = topOverlap;
+       }
+       else
+       {
+               topMargin = __bgPressedTopBottomMargin;
+       }
+
+       float bottomOverlap = bounds.y + bounds.height - (pScrollPanel->GetScrollPosition() + boundsScrollPanel.height);
+       if (bottomOverlap >= 0.0f)
+       {
+               bottomMargin = bottomOverlap;
+       }
+       else
+       {
+               bottomMargin = __bgPressedTopBottomMargin;
+       }
+
+       __pBackgroundLabel->SetBounds(FloatRectangle(__bgPressedLeftRightMargin, topMargin, bounds.width - __bgPressedLeftRightMargin * 2.0f,
+                       bounds.height - topMargin - bottomMargin));
 
        Bitmap* BgBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pMagentaBgBitmap, Color::GetColor(COLOR_ID_MAGENTA), color);
        SysTryReturnVoidResult(NID_UI_CTRL, BgBitmap, E_OUT_OF_MEMORY, "[%s] Propagating.", GetErrorMessage(GetLastResult()));
@@ -775,10 +801,8 @@ _OptionMenuItem::DrawItemLowerDivider(void)
        }
 
        bounds = GetBoundsF();
-       if (__selected == false)
-       {
-               dividerLineColor = __lowerDividerLineColor;
-       }
+
+       dividerLineColor = __lowerDividerLineColor;
 
        __pLowerDividerLineLabel->SetBounds(FloatRectangle(0.0f, bounds.height - __dividerHeight, bounds.width, __dividerHeight));
        __pLowerDividerLineLabel->SetBackgroundColor(dividerLineColor);
index e9c71bc..e873bef 100755 (executable)
@@ -543,7 +543,7 @@ _OptionMenuPresenter::CalculateRect(void)
        float bodyRightMargin = __rightMargin;
 
        FloatDimension screen = _ControlManager::GetInstance()->GetScreenSizeF();
-       _ControlRotation rotation = _ControlManager::GetInstance()->GetScreenRotation();
+       _ControlRotation rotation = __pOptionMenu->GetRotation();
 
        if (__pOptionMenu->GetLayout() == _CONTROL_ORIENTATION_LANDSCAPE)
        {
@@ -583,11 +583,15 @@ _OptionMenuPresenter::CalculateRect(void)
        // _Scroll visual interaction if Bounds < ScrollAreaBounds
        if (__pOptionMenu->IsVisible())
        {
-               __pOptionMenu->GetScrollPanel()->SetBounds(FloatRectangle(bodyRect.x + bodyLeftMargin, bodyRect.y + bodyTopMargin, __layoutSize.width, __layoutSize.height));
+               int itemTopMargin;
+               GET_SHAPE_CONFIG(OPTIONMENU::ITEM_BG_PRESSED_TOP_BOTTOM_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, itemTopMargin);
+
+               __pOptionMenu->GetScrollPanel()->SetBounds(FloatRectangle(bodyRect.x + bodyLeftMargin, bodyRect.y + bodyTopMargin + itemTopMargin,
+                               __layoutSize.width, __layoutSize.height - 2 * itemTopMargin));
                int itemCount = __pModel->GetItemCount();
                float itemHeight = __itemHeight + (__dividerHeight * 2.0f);
                float layoutClientHeight = itemCount * itemHeight - (__dividerHeight * 2.0f);
-               __pOptionMenu->GetScrollPanel()->SetClientAreaHeight(layoutClientHeight);
+               __pOptionMenu->GetScrollPanel()->SetClientAreaHeight(layoutClientHeight - 2 * itemTopMargin);
        }
 
        __pOptionMenu->SetMovable(true);
index 9e35e48..2b45340 100644 (file)
@@ -611,7 +611,6 @@ result
 _TabBarPresenter::ShiftToFocusedItem(int itemIndex, _FocusDirectionMove direction)
 {
        int firstDrawnItemIndex = __pTabBarModel->GetFirstDrawnItemIndex();
-       int lastDrawnItemIndex  = __pTabBarModel->GetLastDrawnItemIndex();
        int index = 0;
        result r = E_SUCCESS;
 
index 9900dcb..9dfa368 100644 (file)
@@ -4634,8 +4634,6 @@ _TableViewItem::SetAccessibilityElementLabel(void)
        String accessibilityLabel;
        String space = L" ";
        int childControlCount = GetChildCount();
-       int groupIndex = -1;
-       int itemIndex = -1;
 
        for (int i = 0; i < childControlCount; i++)
        {
index 33c6347..dd70adb 100644 (file)
@@ -31,6 +31,7 @@
 #include "FUiCtrl_ContextMenuListPresenter.h"
 #include "FUiCtrl_ActionEvent.h"
 #include "FUiCtrl_IActionEventListener.h"
+#include "FUiCtrl_IFrameEventListener.h"
 
 #include "FUiCtrl_ScrollPanel.h"
 
@@ -96,6 +97,7 @@ class _OSP_EXPORT_ _ContextMenu
        , virtual public _IUiEventListener
        , virtual public _IUiEventPreviewer
        , public _IAccessibilityListener
+       , virtual public _IFrameEventListener
 {
        DECLARE_CLASS_BEGIN(_ContextMenu, _Control);
        DECLARE_PROPERTY("color", GetPropertyColor, SetPropertyColor);
@@ -186,6 +188,10 @@ public:
 
        virtual result OnAttachedToMainTree(void);
        virtual result OnDetachingFromMainTree(void);
+       virtual void OnFrameActivated(const Tizen::Ui::Controls::_Frame& source);
+       virtual void OnFrameDeactivated(const Tizen::Ui::Controls::_Frame& source);
+       virtual void OnFrameMinimized(const Tizen::Ui::Controls::_Frame& source);
+       virtual void OnFrameRestored(const Tizen::Ui::Controls::_Frame& source);
        virtual void OnDraw(void);
 
        virtual _UiTouchEventDelivery OnPreviewTouchPressed(const _Control& source, const _TouchInfo& touchinfo);
@@ -273,6 +279,7 @@ private:
        Tizen::Graphics::Bitmap* __pBackgroundNormalBitmap;
        Tizen::Graphics::Bitmap* __pBackgroundEffectBitmap;
        enum ContextMenuCoreDropPosition __dropPosition;
+       Tizen::Ui::Controls::_Frame* __pCurrentFrame;
        enum _ControlOrientation __layout;
        enum _ControlRotation __rotation;
 
index c32c22c..7dc760b 100644 (file)
@@ -29,6 +29,7 @@
 #include "FUiCtrl_OptionMenuPresenter.h"
 #include "FUiCtrl_ActionEvent.h"
 #include "FUiCtrl_IActionEventListener.h"
+#include "FUiCtrl_IFrameEventListener.h"
 
 #include "FUiCtrl_ScrollPanel.h"
 
@@ -70,6 +71,7 @@ class _OSP_EXPORT_ _OptionMenu
        , virtual public _IUiEventListener
        , virtual public _IUiEventPreviewer
        , public _IAccessibilityListener
+       , virtual public _IFrameEventListener
 {
        DECLARE_CLASS_BEGIN(_OptionMenu, _Control);
        DECLARE_PROPERTY("color", GetPropertyColor, SetPropertyColor);
@@ -159,9 +161,14 @@ public:
        const Tizen::Graphics::Bitmap* GetBackgroundNormalBitmap(void) const;
        const Tizen::Graphics::Bitmap* GetBackgroundEffectBitmap(void) const;
        _ControlOrientation GetLayout(void) const;
+       _ControlRotation GetRotation(void) const;
 
        virtual result OnAttachedToMainTree(void);
        virtual result OnDetachingFromMainTree(void);
+       virtual void OnFrameActivated(const Tizen::Ui::Controls::_Frame& source);
+       virtual void OnFrameDeactivated(const Tizen::Ui::Controls::_Frame& source);
+       virtual void OnFrameMinimized(const Tizen::Ui::Controls::_Frame& source);
+       virtual void OnFrameRestored(const Tizen::Ui::Controls::_Frame& source);
        virtual void OnDraw(void);
 
        virtual _UiTouchEventDelivery OnPreviewTouchPressed(const _Control& source, const _TouchInfo& touchinfo);
@@ -241,6 +248,7 @@ private:
        Tizen::Graphics::Bitmap* __pBackgroundNormalBitmap;
        Tizen::Graphics::Bitmap* __pBackgroundEffectBitmap;
        enum _ControlOrientation __layout;
+       enum _ControlRotation __rotation;
 
        Tizen::Graphics::Color __backgroundColor;
        Tizen::Graphics::Color __textColor[OPTION_MENU_ITEM_STATUS_COUNT];
@@ -251,6 +259,7 @@ private:
 
        _ScrollPanel* __pScrollPanel;
        _ContextMenu* __pSubMenu;
+       Tizen::Ui::Controls::_Frame* __pCurrentFrame;
        int __subMenuIndex;
 
 }; // _OptionMenu
index 68abb7d..06fe7d6 100755 (executable)
@@ -175,6 +175,8 @@ private:
        float __arrowRightMargin;
        float __arrowMargin;
        float __itemHeight;
+       float __bgPressedLeftRightMargin;
+       float __bgPressedTopBottomMargin;
 
        float __textSize;
        Tizen::Base::String __text;
index 9c259b5..f9fff2d 100644 (file)
@@ -69,6 +69,8 @@ DECLARE_UI_CONFIG(OPTIONMENU);
        DECLARE_SHAPE_CONFIG(LIST_ICON_WIDTH, 22);
        DECLARE_SHAPE_CONFIG(LIST_ICON_HEIGHT, 23);
        DECLARE_SHAPE_CONFIG(LIST_ITEM_FONT_SIZE, 24);
+       DECLARE_SHAPE_CONFIG(ITEM_BG_PRESSED_LEFT_RIGHT_MARGIN, 25);
+       DECLARE_SHAPE_CONFIG(ITEM_BG_PRESSED_TOP_BOTTOM_MARGIN, 26);
 DECLARE_END_UI_CONFIG(OPTIONMENU);
 
 #endif //_FUI_RESOURCE_OPTION_MENU_CONFIG_H_
index b5b8944..cce73f2 100644 (file)
@@ -81,6 +81,8 @@ START_UI_CONFIG(OPTIONMENU);
 
                ADD_SHAPE_CONFIG(LIST_ITEM_FONT_SIZE, 40);
                ADD_SHAPE_CONFIG(LIST_DIVIDER_HEIGHT, 1);
+               ADD_SHAPE_CONFIG(ITEM_BG_PRESSED_LEFT_RIGHT_MARGIN, 4);
+               ADD_SHAPE_CONFIG(ITEM_BG_PRESSED_TOP_BOTTOM_MARGIN, 3);
        }
        END_UI_CONFIG_MODE(720x1280);