revert commit
authorkeonpyo.kong <keonpyo.kong@samsung.com>
Tue, 11 Jun 2013 02:41:57 +0000 (11:41 +0900)
committerkeonpyo.kong <keonpyo.kong@samsung.com>
Tue, 11 Jun 2013 02:41:57 +0000 (11:41 +0900)
Change-Id: Iaa3e5e963cf8e74c28ff51058fbcfaa58cd4aedb
Signed-off-by: keonpyo.kong <keonpyo.kong@samsung.com>
37 files changed:
src/graphics/FGrp_Bitmap.cpp [changed mode: 0755->0644]
src/graphics/FGrp_Bitmap.h [changed mode: 0755->0644]
src/graphics/FGrp_BitmapImpl.cpp
src/graphics/FGrp_Canvas.cpp
src/graphics/FGrp_Canvas.h
src/graphics/FGrp_CanvasImpl.cpp
src/graphics/FGrp_Font.cpp
src/graphics/FGrp_Font.h
src/graphics/FGrp_FontImpl.cpp [changed mode: 0755->0644]
src/graphics/inc/FGrp_BitmapImpl.h [changed mode: 0755->0644]
src/graphics/inc/FGrp_CanvasImpl.h
src/graphics/inc/FGrp_FontImpl.h
src/graphics/opengl/FGrpEgl.cpp
src/graphics/util/FGrp_Util.h [changed mode: 0755->0644]
src/ui/FUi_Control.cpp
src/ui/FUi_FocusManagerImpl.cpp
src/ui/animations/FUiAnim_Debug.h
src/ui/animations/FUiAnim_DisplayManager.cpp
src/ui/animations/FUiAnim_EflVisualElementSurfaceImpl.cpp
src/ui/animations/FUiAnim_VisualElementImpl.cpp
src/ui/controls/FUiCtrl_ButtonPresenter.cpp
src/ui/controls/FUiCtrl_CheckButtonPresenter.cpp
src/ui/controls/FUiCtrl_Edit.cpp
src/ui/controls/FUiCtrl_EditPresenter.cpp
src/ui/controls/FUiCtrl_FooterImpl.cpp
src/ui/controls/FUiCtrl_Form.cpp
src/ui/controls/FUiCtrl_FormImpl.cpp
src/ui/controls/FUiCtrl_IconListPresenter.cpp
src/ui/controls/FUiCtrl_Indicator.cpp
src/ui/controls/FUiCtrl_Popup.cpp
src/ui/controls/FUiCtrl_PopupImpl.cpp
src/ui/controls/FUiCtrl_Toolbar.cpp
src/ui/inc/FUiAnim_DisplayManager.h
src/ui/inc/FUiCtrl_EditPresenter.h
src/ui/inc/FUiCtrl_Form.h
src/ui/inc/FUiCtrl_Indicator.h
src/ui/inc/FUiCtrl_Toolbar.h

old mode 100755 (executable)
new mode 100644 (file)
index 7d5e49a..bc5e930
@@ -282,8 +282,7 @@ namespace Tizen { namespace Graphics
 bool _GetScreenShot(int depth, unsigned char*& pOutBuffer, int& screenWidth, int& screenHeight);
 
 _Bitmap::_Bitmap(void)
-       : __magicKey(0)
-       , __timeStamp(0)
+       : __timeStamp(0)
        , __opacity(255)
        , __isOpaqueAllOver(0)
        , __hasOwnership(true)
@@ -300,7 +299,6 @@ _Bitmap::_Bitmap(void)
        , __pUnlockCallbackFunc(null)
        , __pUnlockCallbackParam(null)
 {
-       _Util::CarveMagicKey(*this, __magicKey);
 }
 
 _Bitmap::~_Bitmap(void)
@@ -312,8 +310,6 @@ _Bitmap::~_Bitmap(void)
        {
                delete[] __pBuffer;
        }
-
-       _Util::EraseMagicKey(*this, __magicKey);
 }
 
 result
old mode 100755 (executable)
new mode 100644 (file)
index ed90e82..922426a
@@ -111,7 +111,6 @@ private:
        result __Unlock(void);
 
 private:
-       unsigned long __magicKey;
        unsigned long __timeStamp;
        int __opacity;
        long __isOpaqueAllOver;
index 49a9ba0..a8aa967 100755 (executable)
@@ -273,8 +273,7 @@ _UpdateBitmapTimeStamp(Tizen::Graphics::_BitmapImpl& bitmap)
 ////////////////////////////////////////////////////////////////////////////////
 
 _BitmapImpl::_BitmapImpl(void)
-       : _magicKey(0)
-       , _sharedItem(std::tr1::shared_ptr<_SharedItem>(new (std::nothrow)_SharedItem))
+: _sharedItem(std::tr1::shared_ptr<_SharedItem>(new (std::nothrow)_SharedItem))
 {
        if (this->_sharedItem.get())
        {
@@ -304,8 +303,6 @@ _BitmapImpl::_BitmapImpl(void)
        }
 
        _UpdateBitmapTimeStamp(*this);
-
-       _Util::CarveMagicKey(*this, _magicKey);
 }
 
 _BitmapImpl::~_BitmapImpl(void)
@@ -320,8 +317,6 @@ _BitmapImpl::~_BitmapImpl(void)
                        }
                }
        }
-
-       _Util::EraseMagicKey(*this, _magicKey);
 }
 
 bool
index 126c136..86f8c17 100755 (executable)
@@ -591,8 +591,7 @@ struct _NativeGfxEngine
 
 
 _Canvas::_Canvas(void)
-       : _magicKey(0)
-       , _pNativeGfxEngine(static_cast<void*>(new (std::nothrow)_NativeGfxEngine))
+       : _pNativeGfxEngine(static_cast<void*>(new (std::nothrow)_NativeGfxEngine))
        , __pParent(0)
        , __pFont(0)
        , __pPriorityFont(0)
@@ -625,8 +624,6 @@ _Canvas::_Canvas(void)
 
        __ComposeFgColor();
        __ComposeBgColor();
-
-       _Util::CarveMagicKey(*this, _magicKey);
 }
 
 _Canvas::~_Canvas(void)
@@ -638,8 +635,6 @@ _Canvas::~_Canvas(void)
        {
                delete static_cast<_NativeGfxEngine*>(_pNativeGfxEngine);
        }
-
-       _Util::EraseMagicKey(*this, _magicKey);
 }
 
 result
index f204d65..a200246 100755 (executable)
@@ -226,7 +226,6 @@ private:
        bool __IsInClipBounds(const _Util::Rectangle<double>& bounds);
 
 protected:
-       unsigned long _magicKey;
        void* _pNativeGfxEngine;
 
 private:
index 48b8e3e..920f268 100755 (executable)
@@ -161,8 +161,7 @@ namespace Tizen { namespace Graphics
 {
 
 _CanvasImpl::_CanvasImpl(void)
-       : _magicKey(0)
-       , _pNativeCanvas(0)
+       : _pNativeCanvas(0)
        , _pCoordHolder(0)
        , _pFont(0)
        , _pPriorityFont(0)
@@ -181,8 +180,6 @@ _CanvasImpl::_CanvasImpl(void)
                _pCoordHolder = null;
                _pNativeCanvas = null;
        }
-
-       _Util::CarveMagicKey(*this, _magicKey);
 }
 
 _CanvasImpl::~_CanvasImpl(void)
@@ -195,8 +192,6 @@ _CanvasImpl::~_CanvasImpl(void)
 
        delete _pCoordHolder;
        delete _pNativeCanvas;
-
-       _Util::EraseMagicKey(*this, _magicKey);
 }
 
 result
index 242eeee..c26397d 100755 (executable)
@@ -565,25 +565,20 @@ namespace Tizen { namespace Graphics
 {
 
 _Font::_Font()
-       : __magicKey(0)
 {
        __fontAttrib.Init();
-
-       _Util::CarveMagicKey(*this, __magicKey);
 }
 
 _Font::_Font(const _Font& obj)
-       : __magicKey(0)
 {
        this->__fontAttrib = obj.__fontAttrib;
        this->__sharedFont = obj.__sharedFont;
 
-       _Util::CarveMagicKey(*this, __magicKey);
+       return;
 }
 
 _Font::~_Font(void)
 {
-       _Util::EraseMagicKey(*this, __magicKey);
 }
 
 result
index de9b8cb..5e4b2d5 100755 (executable)
@@ -186,7 +186,6 @@ private:
        result __GetTextExtentList(_TextBidiPropertyWithReorder& bidiProperty, _Util::AccumList<_Util::Pair<int, int> >& outList) const;
 
 private:
-       unsigned long __magicKey;
        std::tr1::shared_ptr <_IFont> __sharedFont;
        _FontAttribute __fontAttrib;
 
old mode 100755 (executable)
new mode 100644 (file)
index b1ab5b8..95d8c34
@@ -32,7 +32,6 @@
 #include "FGrp_FontImpl.h"
 #include "FGrp_Font.h"
 #include "FGrp_ResUtil.h"
-#include "util/FGrp_Util.h"
 
 
 using namespace Tizen::Base::Runtime;
@@ -132,8 +131,7 @@ struct _FontCoordHolder
 
 
 _FontImpl::_FontImpl()
-       : _magicKey(0)
-       , _pCoordHolder(new (std::nothrow) _FontCoordHolder)
+       : _pCoordHolder(new (std::nothrow) _FontCoordHolder)
        , _pNativeFont(new (std::nothrow) _Font)
 {
        if (_pNativeFont == null || _pCoordHolder == null)
@@ -144,8 +142,6 @@ _FontImpl::_FontImpl()
                _pNativeFont = null;
                _pCoordHolder = null;
        }
-
-       _Util::CarveMagicKey(*this, _magicKey);
 }
 
 _FontImpl::_FontImpl(const _FontImpl& obj)
@@ -167,8 +163,6 @@ _FontImpl::_FontImpl(const _FontImpl& obj)
                _pNativeFont = null;
                _pCoordHolder = null;
        }
-
-       _Util::CarveMagicKey(*this, _magicKey);
 }
 
 _FontImpl::~_FontImpl()
@@ -184,8 +178,6 @@ _FontImpl::~_FontImpl()
                delete _pCoordHolder;
                _pCoordHolder = 0;
        }
-
-       _Util::EraseMagicKey(*this, _magicKey);
 }
 
 result
old mode 100755 (executable)
new mode 100644 (file)
index 73b94da..8458859
@@ -266,7 +266,6 @@ protected:
                void Move(_SharedItem& source);
        };
 
-       unsigned long _magicKey;
        std::tr1::shared_ptr<_SharedItem> _sharedItem;
 
        friend class Bitmap;
index 654224f..86bc22e 100755 (executable)
@@ -261,7 +261,6 @@ private:
        _CanvasImpl& operator =(const _CanvasImpl& value);
 
 protected:
-       unsigned long _magicKey;
        _Canvas* _pNativeCanvas;
        struct _CanvasCoordHolder* _pCoordHolder;
        Font* _pFont;
index 68b5d36..3b247fb 100755 (executable)
@@ -216,7 +216,6 @@ public:
        static bool UpdateDefaultFont(const Tizen::Base::String& key);
 
 protected:
-       unsigned long _magicKey;
        struct _FontCoordHolder* _pCoordHolder;
        Tizen::Graphics::_Font* _pNativeFont;
 
index e57e664..9925c9b 100644 (file)
@@ -61,7 +61,7 @@
 #include <FUi_WindowImpl.h>
 #include <FUiAnim_VisualElementSurfaceImpl.h>
 #include <FUiAnim_VisualElementImpl.h>
-#include <FUiAnim_DisplayManager.h>
+
 
 #ifdef __cplusplus
 extern "C"
@@ -123,7 +123,6 @@ class _SglInfo;
 
 #define FGRAPHICS_INTERNAL_USE_RESTORE_CONTEXT
 #if defined(FGRAPHICS_INTERNAL_USE_RESTORE_CONTEXT)
-void _RestoreContext(void);
 void _PostRenderCallback(Ecore_Evas* ee);
 void _SaveCurrentContext(_SglInfo* pSglInfo);
 void _UnregisterRenderCallback(Evas_Object* pObject);
@@ -721,8 +720,6 @@ _GetEvasEngineType(Evas_Object* pObject)
 
                if (engineName.Contains(String("opengl_x11")))
                {
-                       _DisplayManager* pDisplayManger = _DisplayManager::GetInstance();
-                       pDisplayManger->SetRestoreContextCallback(_RestoreContext);
                        return ENGINE_TYPE_OPENGL_X11;
                }
                else
@@ -752,8 +749,6 @@ _GetEvasEngineType(Evas_Object* pObject)
 
                if (engineName.Contains(String("opengl_x11")))
                {
-                       _DisplayManager* pDisplayManger = _DisplayManager::GetInstance();
-                       pDisplayManger->SetRestoreContextCallback(_RestoreContext);
                        return ENGINE_TYPE_OPENGL_X11;
                }
                else if (engineName.Contains(String("software_x11")))
@@ -797,44 +792,6 @@ _EvasObjectImageChange(_SglInfo* pSglInfo)
 
 #if defined(FGRAPHICS_INTERNAL_USE_RESTORE_CONTEXT)
 void
-_RestoreContext(void)
-{
-       if (__pPreviousSglInfo != null)
-       {
-               EGLDisplay display = __pPreviousSglInfo->display;
-               EGLSurface surface = __pPreviousSglInfo->surface;
-               EGLContext context = __pPreviousSglInfo->context;
-
-               if (__isDoublePixmapEnabled)
-               {
-                       _SglInfo* pBackSglInfo = null;
-                       _SglInfo* pFrontSglInfo = null;
-
-                       if (__pPreviousSglInfo->isBackbuffer)
-                       {
-                               pBackSglInfo = __pPreviousSglInfo;
-                               pFrontSglInfo = __pPreviousSglInfo->pSecondSglInfo;
-                       }
-                       else
-                       {
-                               pBackSglInfo = __pPreviousSglInfo->pSecondSglInfo;
-                               pFrontSglInfo = __pPreviousSglInfo;
-                       }
-
-                       surface = pBackSglInfo->surface;
-               }
-
-               EGLBoolean ret = eglMakeCurrent(display, surface, surface, context);
-               SysTryLog(NID_GRP, ret == EGL_TRUE, "fail to restore previous surface and context. %#x %#x %#x %#x egl error:%#x"
-                               , (unsigned int)display
-                               , (unsigned int)surface
-                               , (unsigned int)surface
-                               , (unsigned int)context
-                               , (unsigned int)eglGetError());
-       }
-}
-
-void
 _PostRenderCallback(Ecore_Evas* ee)
 {
        if (__pPreviousSglInfo != null)
old mode 100755 (executable)
new mode 100644 (file)
index cccde04..4061080
@@ -333,85 +333,6 @@ inline _Util::Rectangle<double> Convert<Tizen::Graphics::FloatRectangle, _Util::
        return temp;
 }
 
-////////////////////////////////////////////////////////////////////////////
-// Magic key
-
-namespace
-{
-
-template <typename T>
-struct MagicKey
-{
-};
-
-template <>
-struct MagicKey<_CanvasImpl>
-{
-       enum
-       {
-               TAG = 0xCA01
-       };
-};
-
-template <>
-struct MagicKey<_Canvas>
-{
-       enum
-       {
-               TAG = 0xCA03
-       };
-};
-
-template <>
-struct MagicKey<_BitmapImpl>
-{
-       enum
-       {
-               TAG = 0xBA01
-       };
-};
-
-template <>
-struct MagicKey<_Bitmap>
-{
-       enum
-       {
-               TAG = 0xBA03
-       };
-};
-
-template <>
-struct MagicKey<_FontImpl>
-{
-       enum
-       {
-               TAG = 0xF001
-       };
-};
-
-template <>
-struct MagicKey<_Font>
-{
-       enum
-       {
-               TAG = 0xF003
-       };
-};
-
-}
-
-template <typename T>
-inline void CarveMagicKey(T&, unsigned long& key)
-{
-       key = 0xC0DE0000 | MagicKey<T>::TAG;
-}
-
-template <typename T>
-inline void EraseMagicKey(T&, unsigned long& key)
-{
-       key = 0xDEAD0000 | MagicKey<T>::TAG;
-}
-
 } // Tizen::Graphics::_Util
 
 }} // Tizen::Graphics
index e35175e..5777777 100644 (file)
@@ -2556,7 +2556,7 @@ _Control::IsFocused(void) const
        ClearLastResult();
 
        _Window* pTop = GetRootWindow();
-       if (pTop == null)
+       if (pTop)
        {
                return false;
        }
index 82e93b8..3a9f32b 100644 (file)
@@ -253,9 +253,9 @@ _FocusManagerImpl::StartFocusTraversal(_Control* pControl, FocusDirection focusD
                                        {
                                                if (pNextFocusControl != pControl)
                                                {
+                                                   pNextFocusControl->SetFocused();
                                                    pNextFocusControl->SetFocusModeStateEnabled(true);
                                                    pControl->SetFocusModeStateEnabled(false);
-                                                   pNextFocusControl->SetFocused();
                                                }
                                                findNextFocusControl = true;
                                                break;
index 4a119b0..eb02260 100644 (file)
@@ -29,7 +29,6 @@
 #include <Evas.h>
 
 //#define VE_DEBUG // debug config
-//#define UI_ANIM_DEBUG
 #define VE_DEBUG_MODULE
 
 extern "C" _OSP_EXPORT_ void DumpAllEvas(void);
index a56bf36..b0fde87 100644 (file)
@@ -55,7 +55,6 @@ int _DisplayManager::__eventType = 0;
 void* _DisplayManager::__pWakeUpEventHandler = null;
 bool _DisplayManager::__wakeUpEventAdded = false;
 _DisplayManager* _DisplayManager::__pInstance = null;
-_DisplayManager::RestoreContextCallback _DisplayManager::__pRestoreContextCallback = null;
 
 _DisplayManager::_DisplayManager(void)
        : __roots()
@@ -318,20 +317,8 @@ _DisplayManager::Flush(void)
        return E_SUCCESS;
 }
 
-void
-_DisplayManager::SetRestoreContextCallback(RestoreContextCallback pRestoreContextCallback)
-{
-       __pRestoreContextCallback = pRestoreContextCallback;
-}
 
-void
-_DisplayManager::RestoreContext(void)
-{
-       if (__pRestoreContextCallback)
-       {
-               (*__pRestoreContextCallback)();
-       }
-}
+
 
 }}}            // Tizen::Ui::Animations
 
index 9d52c1d..db61fe9 100644 (file)
@@ -36,7 +36,6 @@
 #include "FUiAnim_EflNode.h"
 #include "FUiAnim_EflLayer.h"
 #include "FUiAnim_EflVisualElementSurfaceImpl.h"
-#include "FUiAnim_DisplayManager.h"
 
 using namespace std;
 using namespace Tizen::Base;
@@ -98,14 +97,11 @@ _EflVisualElementSurfaceImpl::_EflVisualElementSurfaceImpl(const Handle layer, c
        evas_object_show(__pEvasImage);
        evas_object_move(__pEvasImage, -999999, -999999);
 #endif
-
-       _DisplayManager::RestoreContext();
        return;
 
 CATCH:
        evas_object_del(__pEvasImage);
        __pEvasImage = null;
-       _DisplayManager::RestoreContext();
 }
 
 _EflVisualElementSurfaceImpl::_EflVisualElementSurfaceImpl(const Handle layer, const Handle object, const Dimension& size)
@@ -118,8 +114,8 @@ _EflVisualElementSurfaceImpl::_EflVisualElementSurfaceImpl(const Handle layer, c
        ClearLastResult();
 
        _EflLayer* pLayer = reinterpret_cast<_EflLayer*>(layer);
-       Evas* pEvas = evas_object_evas_get(reinterpret_cast<Evas_Object*>(object));
-       if (pLayer->GetEvas() == pEvas)
+       Evas* evas = evas_object_evas_get(reinterpret_cast<Evas_Object*>(object));
+       if (pLayer->GetEvas() == evas)
        {
                __pEvasImage = reinterpret_cast<Evas_Object*>(object);
        }
@@ -136,7 +132,6 @@ _EflVisualElementSurfaceImpl::_EflVisualElementSurfaceImpl(const Handle layer, c
        evas_object_show(__pEvasImage);
        evas_object_move(__pEvasImage, -999999, -999999);
 #endif
-       _DisplayManager::RestoreContext();
 }
 
 _EflVisualElementSurfaceImpl::~_EflVisualElementSurfaceImpl(void)
@@ -151,7 +146,6 @@ _EflVisualElementSurfaceImpl::~_EflVisualElementSurfaceImpl(void)
                        evas_object_del(__pEvasImage);
                }
                evas_object_smart_member_del(__pEvasImage);
-               _DisplayManager::RestoreContext();
        }
 
        if (__pBuffer != null)
@@ -186,7 +180,6 @@ _EflVisualElementSurfaceImpl::SetImage(const String& fileName)
        }
 
        __pBuffer = null;
-       _DisplayManager::RestoreContext();
 
        return E_SUCCESS;
 }
index 0ed677e..a86708e 100644 (file)
@@ -59,7 +59,6 @@
 #include "FUiAnim_MatrixUtil.h"
 #include "FUiAnim_Debug.h"
 #include "FUiAnim_EflNode.h"
-#include "FUiAnim_EflLayer.h"
 #include "FUiAnim_VisualElementSurfaceImpl.h"
 #include "FUiAnim_EflVisualElementSurfaceImpl.h"
 #include "FUiAnim_DisplayManager.h"
@@ -6119,7 +6118,6 @@ _VisualElementImpl::CaptureI(Canvas& outputCanvas, const FloatRectangle& rectDes
                                        __pSharedData->pSurface->GetBufferInfo(info);
                                        
                                        byte* pStart = (byte*)evas_object_image_data_get((Evas_Object*)pSurfImpl->GetNativeHandle(), false);
-                                       _DisplayManager::RestoreContext();
 
                                        if(pStart)
                                        {
@@ -6290,8 +6288,6 @@ _VisualElementImpl::CaptureI(Canvas& outputCanvas, const FloatRectangle& rectDes
                                if(pSurfImpl && pSurfImpl->GetNativeHandle() && pSurfImpl->__isImageObject)
                                {
                                        byte* pStart = (byte*)evas_object_image_data_get((Evas_Object*)pSurfImpl->GetNativeHandle(), false);
-                                       _DisplayManager::RestoreContext();
-
                                        BufferInfo info;
                                        __pSharedData->pSurface->GetBufferInfo(info);
 
index a811af3..db7d280 100644 (file)
@@ -277,14 +277,25 @@ _ButtonPresenter::Draw(void)
        else
        {
                DrawBackground();
+
+               //Bitmap* pBackgroundBitmap = __pButton->GetBackgroundBitmap(status);
+               //if (pBackgroundBitmap)
+               //{
+               //      String imagePath = _BitmapImpl::GetInstance(*pBackgroundBitmap)->GetFileName();
+               //      if (imagePath.IsEmpty() == false && __pButton->GetText() == L"" && __pButton->GetBitmap(status) == null)
+               //      {
+               //              SysLog(NID_UI_CTRL, "Cannot get a canvas.");
+               //              return;
+               //      }
+               //}
        }
 
        DrawBitmap();
        DrawText();
 
-       if ((status == _BUTTON_STATUS_SELECTED && __pButton->GetToolbarItemBackgroundBitmap(_BUTTON_STATUS_SELECTED) == null) ||
-                       (status == _BUTTON_STATUS_PRESSED && prevStatus == _BUTTON_STATUS_SELECTED && __pButton->GetToolbarItemBackgroundBitmap(_BUTTON_STATUS_PRESSED) == null) ||
-                       (status == _BUTTON_STATUS_HIGHLIGHTED && prevStatus == _BUTTON_STATUS_SELECTED && __pButton->GetToolbarItemBackgroundBitmap(_BUTTON_STATUS_HIGHLIGHTED) == null))
+       if ((status == _BUTTON_STATUS_SELECTED || (status == _BUTTON_STATUS_PRESSED && prevStatus == _BUTTON_STATUS_SELECTED)
+                       || (status == _BUTTON_STATUS_HIGHLIGHTED && prevStatus == _BUTTON_STATUS_SELECTED))
+                       && __pButton->GetToolbarItemBackgroundBitmap(_BUTTON_STATUS_SELECTED) == null)
        {
                DrawToolbarSelectedBitmap();
        }
index fbda280..900935d 100644 (file)
@@ -1996,7 +1996,6 @@ _CheckButtonPresenter::OnKeyReleased(const _Control& source, const _KeyInfo& key
        _KeyCode keyCode = keyInfo.GetKeyCode();
 
        if (keyCode == _KEY_ENTER)
-       //if (__pCheckButton->IsFocusModeStateEnabled() == true && keyCode == _KEY_ENTER)
        {
                CheckButtonStyle checkStyle = __pCheckButton->GetCheckButtonStyle();
 
@@ -2437,12 +2436,9 @@ _CheckButtonPresenter::OnFocusModeStateChanged(void)
 bool
 _CheckButtonPresenter::OnFocusGained(const _Control& source)
 {
-       //if (__pCheckButton->IsFocusModeStateEnabled() == true)
-       {
-               __focusPrevStatus = __pCheckButton->GetCheckButtonStatus();
-               __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_HIGHLIGHTED);
-               __pCheckButton->Invalidate();
-       }
+       __focusPrevStatus = __pCheckButton->GetCheckButtonStatus();
+       __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_HIGHLIGHTED);
+       __pCheckButton->Invalidate();
 
        return true;
 }
index c989fcd..568b69b 100644 (file)
@@ -506,16 +506,7 @@ _Edit::Initialize(int editStyle, InputStyle inputStyle, int limitLength, GroupSt
        {
                __pTextAccessibilityElement = new _AccessibilityElement(true);
                __pTextAccessibilityElement->SetBounds(FloatRectangle(0.0f, 0.0f, GetBoundsF().width, GetBoundsF().height));
-
-               if ((GetEditStyle() & EDIT_STYLE_TITLE_TOP) || (GetEditStyle() & EDIT_STYLE_TITLE_LEFT))
-               {
-                       __pTextAccessibilityElement->SetLabel(GetTitleText() + GetGuideText() + GetText());
-               }
-               else
-               {
-                       __pTextAccessibilityElement->SetLabel(GetGuideText() + GetText());
-               }
-
+               __pTextAccessibilityElement->SetLabel(GetTitleText() + GetGuideText() + GetText());
                __pTextAccessibilityElement->SetTrait(L"Edit Field");
                __pTextAccessibilityElement->SetName(L"EditText");
                pEditAccessibilityContainer->AddElement(*__pTextAccessibilityElement);
index 29d1894..38267e3 100755 (executable)
@@ -247,11 +247,11 @@ _EditPresenter::OnInputConnectionPanelShowStateChanged(InputConnection& source,
 
                CheckUSBKeyboardStatus();
 
-               SysLog(NID_UI_CTRL, "INPUT_PANEL_SHOW_STATE_SHOW[Target:%x][Bound:%d][Usb mode:%d]", this, __isInputConnectionBound, __isUSBKeyboardConnected);
+               SysLog(NID_UI_CTRL, "[EDIT] INPUT_PANEL_SHOW_STATE_SHOW[Target:%x][Bound:%d][Usb mode:%d]", this, __isInputConnectionBound, __isUSBKeyboardConnected);
 
                if (__isInputConnectionBound)
                {
-                       if (__isKeypadCommandButtonVisible && __pCommandButton)
+                       if (__isKeypadCommandButtonVisible)
                        {
                                SetFooterVisible(false);
                        }
@@ -281,7 +281,7 @@ _EditPresenter::OnInputConnectionPanelShowStateChanged(InputConnection& source,
                        }
                }
 
-               if (__isUSBKeyboardConnected && (__isKeypadCommandButtonVisible && __pCommandButton))
+               if ((__isUSBKeyboardConnected && __isKeypadCommandButtonVisible))
                {
                        __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_BOUNDS_CHANGED);
                }
@@ -303,7 +303,7 @@ _EditPresenter::OnInputConnectionPanelShowStateChanged(InputConnection& source,
                __isKeypadHiding = false;
 
                CheckUSBKeyboardStatus();
-               SysLog(NID_UI_CTRL, "INPUT_PANEL_SHOW_STATE_HIDE[Target:%x][Bound:%d][Usb mode:%d]", this, __isInputConnectionBound, __isUSBKeyboardConnected);
+               SysLog(NID_UI_CTRL, "[EDIT] INPUT_PANEL_SHOW_STATE_HIDE[Target:%x][Bound:%d][Usb mode:%d]", this, __isInputConnectionBound, __isUSBKeyboardConnected);
 
                __isKeypadExist = false;
 
@@ -325,7 +325,7 @@ _EditPresenter::OnInputConnectionPanelShowStateChanged(InputConnection& source,
 
                        if (__isClipboardExist)
                        {
-                               AdjustParentPanelHeight(false);
+                               AdjustParentPanelHeight(false, true);
                        }
                        else
                        {
@@ -361,7 +361,7 @@ _EditPresenter::OnInputConnectionPanelShowStateChanged(InputConnection& source,
 
                                if (__isClipboardExist)
                                {
-                                       AdjustParentPanelHeight(false);
+                                       AdjustParentPanelHeight(false, true);
                                }
                                else
                                {
@@ -393,7 +393,7 @@ _EditPresenter::OnInputConnectionPanelShowStateChanged(InputConnection& source,
 
                                if (__pParentForm)
                                {
-                                       SysLog(NID_UI_CTRL, "Form deflate RESET!!!!!!!!!!");
+                                       SysLog(NID_UI_CTRL, "[EDIT] Form deflate RESET!!!!!!!!!!");
                                        __pParentForm->DeflateClientRectHeight(0.0f);
                                }
 
@@ -408,11 +408,11 @@ _EditPresenter::OnInputConnectionPanelShowStateChanged(InputConnection& source,
                        }
                }
 
-               if ((__isKeypadCommandButtonVisible && __pCommandButton) && __isInputConnectionBound)
+               if (__isKeypadCommandButtonVisible && __isInputConnectionBound)
                {
                        __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_BOUNDS_CHANGED);
                }
-               else if((__isUSBKeyboardConnected && (__isKeypadCommandButtonVisible &&__pCommandButton) && !__isInputConnectionBound) ||
+               else if((__isUSBKeyboardConnected && __isKeypadCommandButtonVisible && !__isInputConnectionBound) ||
                                (__isUSBKeyboardConnected && __isClipboardExist))
                {
                        //do nothing
@@ -450,32 +450,21 @@ _EditPresenter::OnInputConnectionPanelBoundsChanged(InputConnection& source, con
 
        if ((__isUSBKeyboardConnected == false) && __isKeypadExist == false)
        {
-               SysLog(NID_UI_CTRL, "OnInputConnectionPanelBoundsChanged skipped - __isUSBKeyboardConnected:(%), __isKeypadExist:(%d)", __isUSBKeyboardConnected, __isKeypadExist);
                return;
        }
 
        if (CheckKeypadExist(__pEdit->GetOrientation()) == false)//double check keypad Exist
        {
-               SysLog(NID_UI_CTRL, "OnInputConnectionPanelBoundsChanged skipped - Keypad doesn't exist!!");
                return;
        }
-       else
-       {
-               if (IsKeypadRotating(__pEdit->GetOrientation()))
-               {
-                       SysLog(NID_UI_CTRL, "OnInputConnectionPanelBoundsChanged skipped - Keypad is rotating!!");
-                       AdjustParentPanelHeight(true);
-                       return;
-               }
-       }
 
-       SysLog(NID_UI_CTRL, "OnInputConnectionPanelBoundsChanged");
+       SysLog(NID_UI_CTRL, "[EDIT] OnInputConnectionPanelBoundsChanged");
        ChangeLayoutInternal(__pEdit->GetOrientation());
-       AdjustParentPanelHeight(false);
-       ScrollPanelToCursorPosition();
+       AdjustParentPanelHeight(false, true);
 
        if (__pParentForm)
        {
+               ScrollPanelToCursorPosition();
                __pParentForm->Draw();
        }
 
@@ -873,18 +862,18 @@ _EditPresenter::OnClipboardPopupOpened(Tizen::Graphics::Dimension& clipboardPopu
 
                __clipboardHeight = floatClipboardPopupSize.height;
 
-               SysLog(NID_UI_CTRL, "clipboard height = %f, [KeypadExist:%d]keypad height = %f", floatClipboardPopupSize.height, __isKeypadExist, absKeypadBounds.height);
+               SysLog(NID_UI_CTRL, "[EDIT] clipboard height = %f, [KeypadExist:%d]keypad height = %f", floatClipboardPopupSize.height, __isKeypadExist, absKeypadBounds.height);
 
                if (__isKeypadExist) //resize as difference between clipboard height vs keypad height
                {
                        if (floatClipboardPopupSize.height > absKeypadBounds.height)
                        {
                                ChangeLayoutInternal(__pEdit->GetOrientation());
-                               AdjustParentPanelHeight(false);
-                               ScrollPanelToCursorPosition();
+                               AdjustParentPanelHeight(false, true);
 
                                if (__pParentForm)
                                {
+                                       ScrollPanelToCursorPosition();
                                        __pParentForm->SetClipboardShowState(true);
                                        __pParentForm->Draw();
                                }
@@ -907,10 +896,10 @@ _EditPresenter::OnClipboardPopupOpened(Tizen::Graphics::Dimension& clipboardPopu
 
                                ChangeLayoutInternal(__pEdit->GetOrientation());
                                AdjustParentPanelHeight(false);
-                               ScrollPanelToCursorPosition();
 
                                if (__pParentForm)
                                {
+                                       ScrollPanelToCursorPosition();
                                        __pParentForm->SetClipboardShowState(true);
                                        __pParentForm->Draw();
                                }
@@ -921,10 +910,10 @@ _EditPresenter::OnClipboardPopupOpened(Tizen::Graphics::Dimension& clipboardPopu
                        {
                                ChangeLayoutInternal(__pEdit->GetOrientation());
                                AdjustParentPanelHeight(false);
-                               ScrollPanelToCursorPosition();
 
                                if (__pParentForm)
                                {
+                                       ScrollPanelToCursorPosition();
                                        __pParentForm->SetClipboardShowState(true);
                                        __pParentForm->Draw();
                                }
@@ -950,7 +939,7 @@ _EditPresenter::OnClipboardPopupBoundsChanged(Tizen::Graphics::Dimension& clipbo
 
                __clipboardHeight = floatClipboardPopupSize.height;
 
-               SysLog(NID_UI_CTRL, "clipboard height = %f, [KeypadExist:%d]keypad height = %f", floatClipboardPopupSize.height, __isKeypadExist, absKeypadBounds.height);
+               SysLog(NID_UI_CTRL, "[EDIT] clipboard height = %f, [KeypadExist:%d]keypad height = %f", floatClipboardPopupSize.height, __isKeypadExist, absKeypadBounds.height);
 
                if (__isKeypadExist)
                {
@@ -958,11 +947,10 @@ _EditPresenter::OnClipboardPopupBoundsChanged(Tizen::Graphics::Dimension& clipbo
                        {
                                ChangeLayoutInternal(__pEdit->GetOrientation());
                                AdjustParentPanelHeight(false);
-                               ScrollPanelToCursorPosition();
-
                                if (__pParentForm)
                                {
                                        __pParentForm->Draw();
+                                       ScrollPanelToCursorPosition();
                                }
 
                                __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_BOUNDS_CHANGED);
@@ -971,11 +959,10 @@ _EditPresenter::OnClipboardPopupBoundsChanged(Tizen::Graphics::Dimension& clipbo
                        {
                                ChangeLayoutInternal(__pEdit->GetOrientation());
                                AdjustParentPanelHeight(false);
-                               ScrollPanelToCursorPosition();
-
                                if (__pParentForm)
                                {
                                        __pParentForm->Draw();
+                                       ScrollPanelToCursorPosition();
                                }
 
                                __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_BOUNDS_CHANGED);
@@ -985,11 +972,10 @@ _EditPresenter::OnClipboardPopupBoundsChanged(Tizen::Graphics::Dimension& clipbo
                {
                        ChangeLayoutInternal(__pEdit->GetOrientation());
                        AdjustParentPanelHeight(false);
-                       ScrollPanelToCursorPosition();
-
                        if (__pParentForm)
                        {
                                __pParentForm->Draw();
+                               ScrollPanelToCursorPosition();
                        }
 
                        __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_BOUNDS_CHANGED);
@@ -1027,7 +1013,7 @@ _EditPresenter::OnClipboardPopupClosed(void)
 
                __clipboardHeight = 0.0f;
 
-               SysLog(NID_UI_CTRL, "clipboard closed! [KeypadExist:%d]keypad height = %f", __isKeypadExist, absKeypadBounds.height);
+               SysLog(NID_UI_CTRL, "[EDIT] clipboard closed! [KeypadExist:%d]keypad height = %f", __isKeypadExist, absKeypadBounds.height);
 
                if (__isInputConnectionBound)
                {
@@ -1036,7 +1022,7 @@ _EditPresenter::OnClipboardPopupClosed(void)
 
                if (__isKeypadExist)
                {
-                       AdjustParentPanelHeight(false);
+                       AdjustParentPanelHeight(false, true);
 
                        if (__pParentForm)
                        {
@@ -1056,7 +1042,7 @@ _EditPresenter::OnClipboardPopupClosed(void)
                        AdjustParentPanelHeight(true);
                        if (__pParentForm)
                        {
-                               SysLog(NID_UI_CTRL, "Form deflate RESET!!!!!!!!!!");
+                               SysLog(NID_UI_CTRL, "[EDIT] Form deflate RESET!!!!!!!!!!");
                                __pParentForm->DeflateClientRectHeight(0.0f);
                                __pParentForm->SetClipboardShowState(false);
                                __pParentForm->Draw();
@@ -1119,7 +1105,7 @@ _EditPresenter::Dispose(void)
 
                if (__pParentForm)
                {
-                       SysLog(NID_UI_CTRL, "Form deflate RESET!!!!!!!!!!");
+                       SysLog(NID_UI_CTRL, "[EDIT] Form deflate RESET!!!!!!!!!!");
                        __pParentForm->DeflateClientRectHeight(0.0f);
 
                        if (__clipboardConnected)
@@ -1389,7 +1375,7 @@ _EditPresenter::Initialize(const _Control& control)
        }
 
        __pTextString = new (std::nothrow) String;
-       SysTryCatch(NID_UI_CTRL, __pTextString, , r = E_OUT_OF_MEMORY, "Unable to allocate text buffer.");
+       SysTryCatch(NID_UI_CTRL, __pTextString, , r = E_OUT_OF_MEMORY, "[EDIT] Unable to allocate text buffer.");
        __limitLength = 0;
 
        if (__pFont == null)
@@ -2454,7 +2440,7 @@ _EditPresenter::ConvertLinkType(void)
                        EditCutlinkColor cutlinkColor;
 
                        Font* pFont = _FontImpl::CloneN(const_cast <Font&>(*__pFont));
-                       SysTryReturnResult(NID_UI_CTRL, pFont, GetLastResult(), "Unable to get font.");
+                       SysTryReturnResult(NID_UI_CTRL, pFont, GetLastResult(), "[EDIT] Unable to get font.");
 
                        _FontImpl* fontImpl = _FontImpl::GetInstance(*pFont);
                        SysTryReturnResult(NID_UI_CTRL, fontImpl, GetLastResult(), "[E_SYSTEM] fontImpl is null.");
@@ -2468,7 +2454,7 @@ _EditPresenter::ConvertLinkType(void)
 
                        if (pCutLinkObject == null)
                        {
-                               SysLog(NID_UI_CTRL, "Unable to allocate cutlink object.");
+                               SysLog(NID_UI_CTRL, "[EDIT] Unable to allocate cutlink object.");
                        }
                        else
                        {
@@ -2484,7 +2470,7 @@ _EditPresenter::ConvertLinkType(void)
 
                        if (pSimpleText == null)
                        {
-                               SysLog(NID_UI_CTRL, "Unable to allocate text object.");
+                               SysLog(NID_UI_CTRL, "[EDIT] Unable to allocate text object.");
 
                        }
                        else
@@ -2518,7 +2504,7 @@ int
 _EditPresenter::GetLinkElementOffsetInTextBuffer(int elementIndex) const
 {
        const int textElementCount = __pTextObject->GetElementCount();
-       SysTryReturn(NID_UI_CTRL, elementIndex >= 0 && elementIndex <= textElementCount, -1, E_OUT_OF_RANGE, "The Invalid argument is given.");
+       SysTryReturn(NID_UI_CTRL, elementIndex >= 0 && elementIndex <= textElementCount, -1, E_OUT_OF_RANGE, "[EDIT] The Invalid argument is given.");
 
        _Text::TextElement* pTextElement = null;
        int elementOffset = -1;
@@ -3218,7 +3204,7 @@ _EditPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchI
                        if (IsInternalFocused() && !tokenEditting)
                        {
                                __pCopyPasteManager = new (std::nothrow) _EditCopyPasteManager(*__pEdit);
-                               SysTryReturn(NID_UI_CTRL, __pCopyPasteManager != null, false, E_SYSTEM, "Unable to create _EditCopyPasteManager instance.");
+                               SysTryReturn(NID_UI_CTRL, __pCopyPasteManager != null, false, E_SYSTEM, "[EDIT] Unable to create _EditCopyPasteManager instance.");
                                __pCopyPasteManager->AddCopyPasteEventListener(*this);
                                __pCopyPasteManager->Show();
                                __isCopyPasteManagerExist = true;
@@ -3581,7 +3567,7 @@ _EditPresenter::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
                                UpdateComponentInformation();
                                SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, true, r, "[%s] Propagating.", GetErrorMessage(r));
                                __pCopyPasteManager = new (std::nothrow) _EditCopyPasteManager(*__pEdit);
-                               SysTryReturn(NID_UI_CTRL, __pCopyPasteManager != null, true, E_OUT_OF_MEMORY, "Unable to create _EditCopyPasteManager instance.");
+                               SysTryReturn(NID_UI_CTRL, __pCopyPasteManager != null, true, E_OUT_OF_MEMORY, "[EDIT] Unable to create _EditCopyPasteManager instance.");
                                __pCopyPasteManager->AddCopyPasteEventListener(*this);
                                __pCopyPasteManager->CreateCopyPastePopup();
                                __pCopyPasteManager->Show();
@@ -4181,7 +4167,7 @@ _EditPresenter::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
                else if (__textBlockMoving)
                {
                        __pCopyPasteManager = new (std::nothrow) _EditCopyPasteManager(*__pEdit);
-                       SysTryReturn(NID_UI_CTRL, __pCopyPasteManager != null, true, E_OUT_OF_MEMORY, "Unable to create _EditCopyPasteManager instance.");
+                       SysTryReturn(NID_UI_CTRL, __pCopyPasteManager != null, true, E_OUT_OF_MEMORY, "[EDIT] Unable to create _EditCopyPasteManager instance.");
                        __pCopyPasteManager->AddCopyPasteEventListener(*this);
                        __pCopyPasteManager->CreateCopyPastePopup();
                        __pCopyPasteManager->Show();
@@ -4321,7 +4307,7 @@ _EditPresenter::OnClipboardPopupClosed(const ClipboardItem* pClipboardItem)
                        DeleteText(start, end);
                        ReleaseTextBlock();
                        pSubString = new String(__limitLength - currentLength + (end - start));
-                       SysTryCatch(NID_UI_CTRL, pSubString, , r = E_OUT_OF_MEMORY, "Unable to allocate text buffer.");
+                       SysTryCatch(NID_UI_CTRL, pSubString, , r = E_OUT_OF_MEMORY, "[EDIT] Unable to allocate text buffer.");
 
                        filteredString.SubString(0, __limitLength - currentLength + (end - start), *pSubString);
                        r = InsertTextAt(__cursorPos, pSubString->GetPointer());
@@ -4345,7 +4331,7 @@ _EditPresenter::OnClipboardPopupClosed(const ClipboardItem* pClipboardItem)
                }
 
                pSubString = new String(__limitLength - currentLength);
-               SysTryCatch(NID_UI_CTRL, pSubString, , r = E_OUT_OF_MEMORY, "Unable to allocate text buffer.");
+               SysTryCatch(NID_UI_CTRL, pSubString, , r = E_OUT_OF_MEMORY, "[EDIT] Unable to allocate text buffer.");
 
                filteredString.SubString(0, __limitLength - currentLength, *pSubString);
                r = InsertTextAt(__cursorPos, pSubString->GetPointer());
@@ -4375,7 +4361,7 @@ CATCH:
 bool
 _EditPresenter::OnLongPressGestureDetected(void)
 {
-       SysLog(NID_UI_CTRL, "OnLongPressGestureDetected");
+       SysLog(NID_UI_CTRL, "[EDIT] OnLongPressGestureDetected");
 
        if (__isClearIconPressed)
        {
@@ -4422,7 +4408,7 @@ _EditPresenter::OnLongPressGestureDetected(void)
                GetCursorBounds(true, cursorBounds);
 
                __pCopyPasteManager = new (std::nothrow) _EditCopyPasteManager(*__pEdit);
-               SysTryReturn(NID_UI_CTRL, __pCopyPasteManager != null, false, E_SYSTEM, "Unable to create _EditCopyPasteManager instance.");
+               SysTryReturn(NID_UI_CTRL, __pCopyPasteManager != null, false, E_SYSTEM, "[EDIT] Unable to create _EditCopyPasteManager instance.");
                __pCopyPasteManager->AddCopyPasteEventListener(*this);
                __pCopyPasteManager->Show();
                __isCopyPasteManagerExist = true;
@@ -4435,7 +4421,7 @@ _EditPresenter::OnLongPressGestureDetected(void)
 bool
 _EditPresenter::OnTapGestureDetected(void)
 {
-       SysLog(NID_UI_CTRL, "OnTapGestureDetected");
+       SysLog(NID_UI_CTRL, "[EDIT] OnTapGestureDetected");
 
        if (IsInternalFocused() == false)
        {
@@ -4485,7 +4471,7 @@ _EditPresenter::OnTapGestureDetected(void)
                GetCursorBounds(true, cursorBounds);
 
                __pCopyPasteManager = new (std::nothrow) _EditCopyPasteManager(*__pEdit);
-               SysTryReturn(NID_UI_CTRL, __pCopyPasteManager != null, false, E_SYSTEM, "Unable to create _EditCopyPasteManager instance.");
+               SysTryReturn(NID_UI_CTRL, __pCopyPasteManager != null, false, E_SYSTEM, "[EDIT] Unable to create _EditCopyPasteManager instance.");
                __pCopyPasteManager->AddCopyPasteEventListener(*this);
                __pCopyPasteManager->Show();
                __isCopyPasteManagerExist = true;
@@ -4636,7 +4622,7 @@ _EditPresenter::CopyText(void)
        result r = E_SUCCESS;
 
        _Clipboard* pClipBoard = _Clipboard::GetInstance();
-       SysTryReturnResult(NID_UI_CTRL, pClipBoard != null, E_SYSTEM, "Unable to get the clipboard instance.");
+       SysTryReturnResult(NID_UI_CTRL, pClipBoard != null, E_SYSTEM, "[EDIT] Unable to get the clipboard instance.");
 
        int start = 0;
        int end = 0;
@@ -4645,7 +4631,7 @@ _EditPresenter::CopyText(void)
        String blockString(GetText(start, end - 1));
 
        _ClipboardItem* pClipboardItem = _ClipboardItem::CreateInstanceN(CLIPBOARD_DATA_TYPE_TEXT, blockString);
-       SysTryReturnResult(NID_UI_CTRL, pClipboardItem != null, E_SYSTEM, "Unable to get the clipboarditem instance.");
+       SysTryReturnResult(NID_UI_CTRL, pClipboardItem != null, E_SYSTEM, "[EDIT] Unable to get the clipboarditem instance.");
 
        r = pClipBoard->CopyItem(*pClipboardItem);
 
@@ -4677,10 +4663,10 @@ _EditPresenter::CopyText(void)
                        continue;
                }
                const Bitmap * pImage = pImageText->GetBitmap();
-               SysTryReturnResult(NID_UI_CTRL, pImage != null, E_SYSTEM, "Unable to get the bitmap from textobject.");
+               SysTryReturnResult(NID_UI_CTRL, pImage != null, E_SYSTEM, "[EDIT] Unable to get the bitmap from textobject.");
 
                _ClipboardItem* pClipboardImageItem = _ClipboardItem::CreateInstanceN(CLIPBOARD_DATA_TYPE_IMAGE, *pImage);
-               SysTryReturnResult(NID_UI_CTRL, pClipboardImageItem != null, E_SYSTEM, "Unable to get the clipboardImageitem instance.");
+               SysTryReturnResult(NID_UI_CTRL, pClipboardImageItem != null, E_SYSTEM, "[EDIT] Unable to get the clipboardImageitem instance.");
 
                r = pClipBoard->CopyItem(*pClipboardImageItem);
 
@@ -4725,13 +4711,13 @@ _EditPresenter::PasteText(void)
        String filteredString;
 
        _Clipboard* pClipBoard = _Clipboard::GetInstance();
-       SysTryReturnResult(NID_UI_CTRL, pClipBoard != null, E_SYSTEM, "Unable to get the clipboard instance.");
+       SysTryReturnResult(NID_UI_CTRL, pClipBoard != null, E_SYSTEM, "[EDIT] Unable to get the clipboard instance.");
 
        const _ClipboardItem* pClipboardItem = pClipBoard->RetrieveLatestItemN(CLIPBOARD_DATA_TYPE_TEXT|CLIPBOARD_DATA_TYPE_AUDIO | CLIPBOARD_DATA_TYPE_VIDEO);
-       SysTryReturnResult(NID_UI_CTRL, pClipboardItem != null, E_SYSTEM, "Unable to get the clipboarditem instance.");
+       SysTryReturnResult(NID_UI_CTRL, pClipboardItem != null, E_SYSTEM, "[EDIT] Unable to get the clipboarditem instance.");
 
        const String* pClipString = dynamic_cast<const String*>(pClipboardItem->GetData());
-       SysTryCatch(NID_UI_CTRL, pClipString, r = E_SYSTEM, E_SYSTEM, "Unable to get the clipboarditem instance.");
+       SysTryCatch(NID_UI_CTRL, pClipString, r = E_SYSTEM, E_SYSTEM, "[EDIT] Unable to get the clipboarditem instance.");
 
        filteredString = *pClipString;
 
@@ -4757,7 +4743,7 @@ _EditPresenter::PasteText(void)
                        DeleteText(start, end);
                        ReleaseTextBlock();
                        pSubString = new String(__limitLength - currentLength + (end - start));
-                       SysTryCatch(NID_UI_CTRL, pSubString, , r = E_OUT_OF_MEMORY, "Unable to allocate text buffer.");
+                       SysTryCatch(NID_UI_CTRL, pSubString, , r = E_OUT_OF_MEMORY, "[EDIT] Unable to allocate text buffer.");
 
                        filteredString.SubString(0, __limitLength - currentLength + (end - start), *pSubString);
                        r = InsertTextAt(__cursorPos, pSubString->GetPointer());
@@ -4781,7 +4767,7 @@ _EditPresenter::PasteText(void)
                }
 
                pSubString = new String(__limitLength - currentLength);
-               SysTryCatch(NID_UI_CTRL, pSubString, , r = E_OUT_OF_MEMORY, "Unable to allocate text buffer.");
+               SysTryCatch(NID_UI_CTRL, pSubString, , r = E_OUT_OF_MEMORY, "[EDIT] Unable to allocate text buffer.");
 
                filteredString.SubString(0, __limitLength - currentLength, *pSubString);
                r = InsertTextAt(__cursorPos, pSubString->GetPointer());
@@ -4843,7 +4829,7 @@ bool
 _EditPresenter::IsClipped(void) const
 {
        _Clipboard* pClipBoard = _Clipboard::GetInstance();
-       SysTryReturn(NID_UI_CTRL, pClipBoard != null, false, E_SYSTEM, "Unable to get the clipboard instance.");
+       SysTryReturn(NID_UI_CTRL, pClipBoard != null, false, E_SYSTEM, "[EDIT] Unable to get the clipboard instance.");
 
        const _ClipboardItem* pClipboardItem = pClipBoard->RetrieveLatestItemN(CLIPBOARD_DATA_TYPE_TEXT|CLIPBOARD_DATA_TYPE_AUDIO | CLIPBOARD_DATA_TYPE_VIDEO);
        if (pClipboardItem == null)
@@ -4880,7 +4866,7 @@ _EditPresenter::SetTextAlignment(HorizontalAlignment alignment)
        {
                r = __pTextObject->SetAlignment(textAlign | TEXT_OBJECT_ALIGNMENT_TOP);
        }
-       SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, "Unable to set text alignment.");
+       SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, "[EDIT] Unable to set text alignment.");
        __horizontalAlignment = alignment;
 
        return r;
@@ -4914,10 +4900,11 @@ _EditPresenter::GetText(int start, int end) const
        if (start != 0 && end != -1)
        {
                SysTryReturn(NID_UI_CTRL, (start <= end), tempString, E_SYSTEM, "[E_SYSTEM] The invalid argument(start = %d, end = %d) is given.", start, end);
-               int textLength = GetTextLength();
-               SysTryReturn(NID_UI_CTRL, (start < textLength && end < textLength), tempString, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The invalid argument(start = %d, end = %d) is given.", start, end);
        }
 
+       int textLength = GetTextLength();
+       SysTryReturn(NID_UI_CTRL, (start < textLength && end < textLength), tempString, E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The invalid argument(start = %d, end = %d) is given.", start, end);
+
        if (__pEdit->GetEditStyle() & EDIT_STYLE_PASSWORD)
        {
                int length = end - start + 1;
@@ -5028,7 +5015,7 @@ _EditPresenter::SetText(const String& text)
        }
        else
        {
-               SysTryReturnResult(NID_UI_CTRL, length <= __limitLength, E_INVALID_ARG, "The Invalid argument is given.");
+               SysTryReturnResult(NID_UI_CTRL, length <= __limitLength, E_INVALID_ARG, "[EDIT] The Invalid argument is given.");
        }
 
        if (__isInputConnectionBound && __isTextComposing)
@@ -5084,7 +5071,7 @@ _EditPresenter::SetCursorPosition(int position)
        result r = E_SUCCESS;
        int length = GetTextLength();
 
-       SysTryReturnResult(NID_UI_CTRL, -1 < position && position <= length, E_INVALID_ARG, "Invalid argument is given.");
+       SysTryReturnResult(NID_UI_CTRL, -1 < position && position <= length, E_INVALID_ARG, "[Edit] Invalid argument is given.");
 
        if (__isTouchMoving == false)
        {
@@ -5092,7 +5079,7 @@ _EditPresenter::SetCursorPosition(int position)
        }
 
        r = __pTextObject->SetCursorIndex(position);
-       SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, "Failed to set cursor position");
+       SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, "[Edit] Failed to set cursor position");
 
        if (__cursorPos != position)
        {
@@ -5109,7 +5096,7 @@ _EditPresenter::SetCursorPosition(int position,int rowIndex, int columnIndex)
        result r = E_SUCCESS;
        int length = GetTextLength();
 
-       SysTryReturnResult(NID_UI_CTRL, -1 < position && position <= length, E_INVALID_ARG, "Invalid argument is given.");
+       SysTryReturnResult(NID_UI_CTRL, -1 < position && position <= length, E_INVALID_ARG, "[Edit] Invalid argument is given.");
 
        if (__isTouchMoving == false)
        {
@@ -5117,7 +5104,7 @@ _EditPresenter::SetCursorPosition(int position,int rowIndex, int columnIndex)
        }
 
        r = __pTextObject->SetCursorIndex(position);
-       SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, "Failed to set cursor position");
+       SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, "[Edit] Failed to set cursor position");
 
        __rowCursorIndex = rowIndex;
        __columnCursorIndex = columnIndex;
@@ -5150,7 +5137,7 @@ _EditPresenter::InsertTextAt(int index, const String& text)
        String insertText = text;
        int i = 0;
 
-       SysTryReturnResult(NID_UI_CTRL, index >= 0 && index <= currentLength, E_OUT_OF_RANGE, "The Invalid argument is given.");
+       SysTryReturnResult(NID_UI_CTRL, index >= 0 && index <= currentLength, E_OUT_OF_RANGE, "[EDIT] The Invalid argument is given.");
 
        if (__pEdit->GetEditStyle() & EDIT_STYLE_VIEWER)
        {
@@ -5163,7 +5150,7 @@ _EditPresenter::InsertTextAt(int index, const String& text)
        }
        else
        {
-               SysTryReturnResult(NID_UI_CTRL, totalLength <= __limitLength, E_MAX_EXCEEDED, "The Invalid argument is given.");
+               SysTryReturnResult(NID_UI_CTRL, totalLength <= __limitLength, E_MAX_EXCEEDED, "[EDIT] The Invalid argument is given.");
        }
 
        if (__pEdit->GetEditStyle() & EDIT_STYLE_SINGLE_LINE || __pEdit->GetEditStyle() & EDIT_STYLE_TOKEN )
@@ -5215,7 +5202,7 @@ _EditPresenter::InsertTextAt(int index, const String& text)
 
        __pTextObject->SetRange(index, length);
        r = __pTextObject->NotifyTextChanged(__pTextBuffer, 0, __pTextString->GetLength(), length);
-       SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, "Failed to set length");
+       SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, "[Edit] Failed to set length");
 
        __pTextObject->Compose();
 
@@ -5268,7 +5255,7 @@ _EditPresenter::AppendText(const String& text)
        }
        else
        {
-               SysTryReturnResult(NID_UI_CTRL, totalLength <= __limitLength, E_MAX_EXCEEDED, "The Invalid argument is given.");
+               SysTryReturnResult(NID_UI_CTRL, totalLength <= __limitLength, E_MAX_EXCEEDED, "[EDIT] The Invalid argument is given.");
        }
 
        r = __pTextString->Append(text);
@@ -5284,7 +5271,7 @@ _EditPresenter::AppendText(const String& text)
 
        __pTextObject->SetRange(currentLength, length);
        r = __pTextObject->NotifyTextChanged(__pTextBuffer, 0, __pTextString->GetLength(), length);
-       SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, "Failed to set length");
+       SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, "[Edit] Failed to set length");
 
        __pTextObject->Compose();
 
@@ -5369,8 +5356,8 @@ _EditPresenter::DeleteText(int startCursorPosition, int endCursorPosition)
 
        int length = GetTextLength();
 
-       SysTryReturnResult(NID_UI_CTRL, -1 < startCursorPosition && startCursorPosition < endCursorPosition, E_INVALID_ARG, "Invalid argument is given.");
-       SysTryReturnResult(NID_UI_CTRL, startCursorPosition < endCursorPosition && endCursorPosition <= length, E_INVALID_ARG, "Invalid argument is given.");
+       SysTryReturnResult(NID_UI_CTRL, -1 < startCursorPosition && startCursorPosition < endCursorPosition, E_INVALID_ARG, "[EDIT] Invalid argument is given.");
+       SysTryReturnResult(NID_UI_CTRL, startCursorPosition < endCursorPosition && endCursorPosition <= length, E_INVALID_ARG, "[EDIT] Invalid argument is given.");
 
        _Text::TextElement* pFirstTextElement = __pTextObject->GetElementAtTextIndex(startCursorPosition);
        const TextSimple* pFirstSimpleText = dynamic_cast <const TextSimple*>(pFirstTextElement);
@@ -5885,7 +5872,7 @@ _EditPresenter::InsertTextAt(int position, const String& text, const Bitmap& tex
        int length = text.GetLength();
        int totalLength = currentLength + length;
 
-       SysTryReturnResult(NID_UI_CTRL, position >= 0 && position <= currentLength, E_OUT_OF_RANGE, "The given position is out-of-range.");
+       SysTryReturnResult(NID_UI_CTRL, position >= 0 && position <= currentLength, E_OUT_OF_RANGE, "[EDIT] The given position is out-of-range.");
 
        if ((__pEdit->GetEditStyle() & EDIT_STYLE_FLEXIBLE) || (__pEdit->GetEditStyle() & EDIT_STYLE_VIEWER))
        {
@@ -5898,7 +5885,7 @@ _EditPresenter::InsertTextAt(int position, const String& text, const Bitmap& tex
        }
        else
        {
-               SysTryReturnResult(NID_UI_CTRL, totalLength <= __limitLength, E_MAX_EXCEEDED, "The text exceeds the limitation length.");
+               SysTryReturnResult(NID_UI_CTRL, totalLength <= __limitLength, E_MAX_EXCEEDED, "[EDIT] The text exceeds the limitation length.");
        }
 
        if (__isInputConnectionBound == true && __isTextComposing == true)
@@ -5945,7 +5932,7 @@ _EditPresenter::InsertTextAt(int position, const String& text, const Bitmap& tex
 
        TextSimple* pSimpleText = null;
        pSimpleText = new (std::nothrow) TextSimple(__pTextBuffer, length, TEXT_ELEMENT_SOURCE_TYPE_EXTERNAL, GetFont());
-       SysTryReturnResult(NID_UI_CTRL, pSimpleText, E_OUT_OF_MEMORY, "Unable to allocate text simple element.");
+       SysTryReturnResult(NID_UI_CTRL, pSimpleText, E_OUT_OF_MEMORY, "[Edit] Unable to allocate text simple element.");
 
        pSimpleText->ChangeTextOffset(__pTextBuffer, position);
        pSimpleText->SetBitmap((Bitmap&)textImage);
@@ -6024,11 +6011,6 @@ _EditPresenter::OnFocusGained(void)
        if (!__pParentForm)
        {
                __pParentForm = GetParentForm();
-
-               if (!__pParentForm && __isKeypadCommandButtonVisible)
-               {
-                       __isKeypadCommandButtonVisible = false;
-               }
        }
 
        if (__isAutoShrinkEnabled)
@@ -6044,7 +6026,7 @@ _EditPresenter::OnFocusGained(void)
        {
                result r = E_SUCCESS;
                __pTextVisualElement = new (std::nothrow) _VisualElement;
-               SysTryReturn(NID_UI_CTRL, __pTextVisualElement != null, false, E_OUT_OF_MEMORY, "Unable to create __pTextVisualElement instance.");
+               SysTryReturn(NID_UI_CTRL, __pTextVisualElement != null, false, E_OUT_OF_MEMORY, "[EDIT] Unable to create __pTextVisualElement instance.");
 
                r = __pTextVisualElement->Construct();
                SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to construct", GetErrorMessage(r));
@@ -6548,7 +6530,7 @@ _EditPresenter::SetKeypadCommandButton(const FloatRectangle& bounds)
        {
                __pCommandButton->SetResizable(true);
                __pCommandButton->SetMovable(true);
-               SysLog(NID_UI_CTRL, "Command position changed!!!! bounds(%f, %f, %f, %f)", bounds.x, bounds.y, bounds.width, bounds.height);
+               SysLog(NID_UI_CTRL, "[EDIT]Command position changed!!!! bounds(%f, %f, %f, %f)", bounds.x, bounds.y, bounds.width, bounds.height);
                r = __pCommandButton->SetBounds(bounds);
 
                __pCommandButton->SetResizable(false);
@@ -6559,7 +6541,6 @@ _EditPresenter::SetKeypadCommandButton(const FloatRectangle& bounds)
 
        if (__pParentForm == false)
        {
-               __isKeypadCommandButtonVisible = false;
                return r;
        }
 
@@ -6592,7 +6573,7 @@ _EditPresenter::SetKeypadCommandButton(const FloatRectangle& bounds)
 
        __pCommandButton->SetResizable(true);
        __pCommandButton->SetMovable(true);
-       SysLog(NID_UI_CTRL, "Command created!!!! bounds(%f, %f, %f, %f)", bounds.x, bounds.y, bounds.width, bounds.height);
+       SysLog(NID_UI_CTRL, "[EDIT]Command created!!!! bounds(%f, %f, %f, %f)", bounds.x, bounds.y, bounds.width, bounds.height);
        r = __pCommandButton->SetBounds(bounds);
        SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
 
@@ -6652,18 +6633,18 @@ _EditPresenter::CheckInitialFooterVisibleState(void)
                if (pFooter->GetVisibleState() == false)
                {
                        __initialFooterVisibleStatus = EDIT_FOOTER_VISIBLE_STATUS_HIDE;
-                       SysLog(NID_UI_CTRL, "EDIT_FOOTER_VISIBLE_STATUS_HIDE");
+                       SysLog(NID_UI_CTRL, "[EDIT] CheckInitialFooterVisibleState - EDIT_FOOTER_VISIBLE_STATUS_HIDE");
                }
                else
                {
                        __initialFooterVisibleStatus = EDIT_FOOTER_VISIBLE_STATUS_SHOW;
-                       SysLog(NID_UI_CTRL, "EDIT_FOOTER_VISIBLE_STATUS_SHOW");
+                       SysLog(NID_UI_CTRL, "[EDIT] CheckInitialFooterVisibleState - EDIT_FOOTER_VISIBLE_STATUS_SHOW");
                }
        }
        else
        {
                __initialFooterVisibleStatus = EDIT_FOOTER_VISIBLE_STATUS_NONE;
-               SysLog(NID_UI_CTRL, "EDIT_FOOTER_VISIBLE_STATUS_NONE");
+               SysLog(NID_UI_CTRL, "[EDIT] CheckInitialFooterVisibleState - EDIT_FOOTER_VISIBLE_STATUS_NONE");
        }
 
        return;
@@ -6685,12 +6666,12 @@ _EditPresenter::SetFooterVisible(bool isVisible)
                {
                        if (isVisible)
                        {
-                               SysLog(NID_UI_CTRL, "SetFooterVisible TRUE!!!!!");
+                               SysLog(NID_UI_CTRL, "[EDIT] SetFooterVisible TRUE!!!!!");
                                __footerVisibleChanged = false;
                        }
                        else
                        {
-                               SysLog(NID_UI_CTRL, "SetFooterVisible FALSE!!!!!");
+                               SysLog(NID_UI_CTRL, "[EDIT] SetFooterVisible FALSE!!!!!");
                                __footerVisibleChanged = true;
                        }
 
@@ -6793,10 +6774,10 @@ _EditPresenter::GetKeypadBounds(FloatRectangle& bounds) const
        bounds = __pInputConnection->GetInputPanelBoundsF();
 
        _CoordinateSystem* pCoordSystem = _CoordinateSystem::GetInstance();
-       SysTryReturnResult(NID_UI_CTRL, pCoordSystem, E_SYSTEM, "Coordinate system load failed.");
+       SysTryReturnResult(NID_UI_CTRL, pCoordSystem, E_SYSTEM, "[EDIT] Coordinate system load failed.");
 
        _ICoordinateSystemTransformer* pXformer = pCoordSystem->GetInverseTransformer();
-       SysTryReturnResult(NID_UI_CTRL, pXformer, E_SYSTEM, "Coordinate system load failed.");
+       SysTryReturnResult(NID_UI_CTRL, pXformer, E_SYSTEM, "[EDIT] Coordinate system load failed.");
 
        bounds = pXformer->Transform(bounds);
 
@@ -6810,36 +6791,6 @@ _EditPresenter::GetClipboardHeight(void) const
 }
 
 bool
-_EditPresenter::IsKeypadRotating(_ControlOrientation orientation)
-{
-       FloatDimension screenSize;
-       FloatRectangle absKeypadBounds(0.0f, 0.0f, 0.0f, 0.0f);
-       _ControlManager* pControlManager = _ControlManager::GetInstance();
-
-       GetKeypadBounds(absKeypadBounds);
-
-       if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
-       {
-               screenSize.height = pControlManager->GetScreenSizeF().height;
-               screenSize.width = pControlManager->GetScreenSizeF().width;
-       }
-       else
-       {
-               screenSize.height = pControlManager->GetScreenSizeF().width;
-               screenSize.width = pControlManager->GetScreenSizeF().height;
-       }
-
-       if (absKeypadBounds.width == screenSize.width)
-       {
-               return false;
-       }
-       else
-       {
-               return true;
-       }
-}
-
-bool
 _EditPresenter::CheckKeypadExist(_ControlOrientation orientation)
 {
        FloatDimension screenSize;
@@ -6859,22 +6810,14 @@ _EditPresenter::CheckKeypadExist(_ControlOrientation orientation)
                screenSize.width = pControlManager->GetScreenSizeF().height;
        }
 
-       if (absKeypadBounds.width != 0 && absKeypadBounds.height != 0)
+       if ((absKeypadBounds.y != screenSize.height) && (absKeypadBounds.width == screenSize.width))
        {
-               if ((absKeypadBounds.y != screenSize.height))
-               {
-                       SysLog(NID_UI_CTRL, "KEYPAD EXIST!!!!Keypad(y: %f, w: %f, h: %f)", absKeypadBounds.y, absKeypadBounds.width, absKeypadBounds.height);
-                       return true;
-               }
-               else
-               {
-                       SysLog(NID_UI_CTRL, "NO KEYPAD!!!!Keypad(y: %f, w: %f, h: %f)", absKeypadBounds.y, absKeypadBounds.width, absKeypadBounds.height);
-                       return false;
-               }
+               SysLog(NID_UI_CTRL, "[EDIT] CheckKeypadExist: KEYPAD EXIST!!!!Keypad(y: %f, h: %f)", absKeypadBounds.y, absKeypadBounds.height);
+               return true;
        }
        else
        {
-               SysLog(NID_UI_CTRL, "NO KEYPAD!!!!Keypad(y: %f, w: %f, h: %f)", absKeypadBounds.y, absKeypadBounds.width, absKeypadBounds.height);
+               SysLog(NID_UI_CTRL, "[EDIT] CheckKeypadExist: NO KEYPAD!!!!Keypad(y: %f, h: %f)", absKeypadBounds.y, absKeypadBounds.height);
                return false;
        }
 }
@@ -6943,7 +6886,7 @@ _EditPresenter::ShowKeypad(bool focus)
        //layout rearrange
        if (__isUSBKeyboardConnected)
        {
-               SysLog(NID_UI_CTRL, "ShowKeypad called in USB ON mode!!!!");
+               SysLog(NID_UI_CTRL, "[EDIT]ShowKeypad called in USB ON mode!!!!");
 
                __isKeypadExist = CheckKeypadExist(__pEdit->GetOrientation()); //prediction alreaedy exists
 
@@ -6983,7 +6926,7 @@ _EditPresenter::ShowKeypad(bool focus)
        }
        else
        {
-               SysLog(NID_UI_CTRL, "ShowKeypad called in USB OFF mode!!!!");
+               SysLog(NID_UI_CTRL, "[EDIT]ShowKeypad called in USB OFF mode!!!!");
 
                __isKeypadExist = CheckKeypadExist(__pEdit->GetOrientation()); //call once only from here.
 
@@ -7070,36 +7013,17 @@ _EditPresenter::ChangeLayout(_ControlOrientation orientation)
                __pCopyPasteManager->Release();
        }
 
-       bool isScrollPanelBoundsReloaded = false;
-
-       if (__pParentPanel)
-       {
-               _ControlImpl* pParentPanelImpl = static_cast <_ControlImpl* >(__pParentPanel->GetUserData());
-               Rectangle builderBounds;
-               isScrollPanelBoundsReloaded= pParentPanelImpl->GetBuilderBounds(orientation, builderBounds);
-       }
-
        __rotated = true;
 
        CheckUSBKeyboardStatus();
 
        if (__isInputConnectionBound || __clipboardConnected)
        {
-               SysLog(NID_UI_CTRL, "-------------------ChangeLayout------------------------");
-
-               if (!isScrollPanelBoundsReloaded)
-               {
-                       SysLog(NID_UI_CTRL, "ScrollPanel bounds is not changed by UIBuilder, so forcely reset ScrollPanel's height");
-                       AdjustParentPanelHeight(true);
-               }
-               else
-               {
-                       SysLog(NID_UI_CTRL, "ScrollPanel bounds is changed by UIBuilder");
-               }
+               SysLog(NID_UI_CTRL, "[EDIT]-------------------ChangeLayout------------------------");
 
                if (__pParentForm)
                {
-                       SysLog(NID_UI_CTRL, "Form deflate RESET!!!!!!!!!!");
+                       SysLog(NID_UI_CTRL, "[EDIT] Form deflate RESET!!!!!!!!!!");
                        __pParentForm->DeflateClientRectHeight(0.0f);
                }
 
@@ -7110,18 +7034,13 @@ _EditPresenter::ChangeLayout(_ControlOrientation orientation)
 
                if (__isKeypadExist && ! __isClipboardExist) //only keypad exists, already get keypadbounds before callback [Causion]this timing clipboard height is still previous height
                {
-                       if (isScrollPanelBoundsReloaded)
-                       {
-                               __initialParentHeight = 0.0f;
-                       }
-
+                       __initialParentHeight = 0.0f;
                        ChangeLayoutInternal(orientation);
                        AdjustParentPanelHeight(false);
                        ScrollPanelToCursorPosition();
                }
                else // if clipboard exists, boundsChanged callback will delivered after rotate callback
                {
-                       /*
                        if (__isClipboardExist)
                        {
                                __initialParentHeight = 0.0f;
@@ -7135,17 +7054,6 @@ _EditPresenter::ChangeLayout(_ControlOrientation orientation)
                                        AdjustParentPanelHeight(false);
                                        ScrollPanelToCursorPosition();
                                }
-                       }*/
-
-                       if (!__isClipboardExist)
-                       {
-                               if (__isKeypadCommandButtonVisible)
-                               {
-                                       __initialParentHeight = 0.0f;
-                                       ChangeLayoutInternal(orientation);
-                                       AdjustParentPanelHeight(false);
-                                       ScrollPanelToCursorPosition();
-                               }
                        }
                }
        }
@@ -7168,7 +7076,7 @@ _EditPresenter::ChangeLayoutInternal(_ControlOrientation orientation, bool defla
        FloatRectangle keypadBounds(0.0f, 0.0f, 0.0f, 0.0f);
 
        _ControlManager* pControlManager = _ControlManager::GetInstance();
-       SysTryReturnResult(NID_UI_CTRL, pControlManager, E_SYSTEM, "Failed to get root.");
+       SysTryReturnResult(NID_UI_CTRL, pControlManager, E_SYSTEM, "[EDIT] Failed to get root.");
        FloatDimension screenSize;
        FloatRectangle commandButtonBounds(0.0f, 0.0f, 0.0f, 0.0f);
 
@@ -7220,11 +7128,11 @@ _EditPresenter::ChangeLayoutInternal(_ControlOrientation orientation, bool defla
                {
                        commandButtonBounds.width = screenSize.width;
                        float commandButtonHeight = 0.0f;
+                       GET_SHAPE_CONFIG(FOOTER::HEIGHT, orientation, commandButtonHeight);
+                       commandButtonBounds.height = commandButtonHeight;
 
                        if (__pParentForm)
                        {
-                               GET_SHAPE_CONFIG(FOOTER::HEIGHT, orientation, commandButtonHeight);
-                               commandButtonBounds.height = commandButtonHeight;
                                formDeflateHeight += commandButtonBounds.height;
 
                                if (__isKeypadExist || __isClipboardExist)
@@ -7236,15 +7144,27 @@ _EditPresenter::ChangeLayoutInternal(_ControlOrientation orientation, bool defla
                                {
                                        commandButtonBounds.y = screenSize.height - commandButtonBounds.height - __pParentForm->GetClientBoundsF().y;
                                }
-
-                               SetKeypadCommandButton(commandButtonBounds);
-
-                               if (__pCommandButton)
+                       }
+                       else
+                       {
+                               if (__isKeypadExist || __isClipboardExist)
                                {
-                                       __pCommandButton->SetVisibleState(true);
-                                       __pCommandButton->Invalidate();
+                                       commandButtonBounds.y = screenSize.height - shrinkedHeight - commandButtonBounds.height;
+                               }
+                               else
+                               {
+                                       commandButtonBounds.y = screenSize.height - commandButtonBounds.height;
                                }
                        }
+
+                       r = SetKeypadCommandButton(commandButtonBounds);
+                       SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+                       if (__pCommandButton)
+                       {
+                               __pCommandButton->SetVisibleState(true);
+                               __pCommandButton->Invalidate();
+                       }
                }
                else
                {
@@ -7260,7 +7180,7 @@ _EditPresenter::ChangeLayoutInternal(_ControlOrientation orientation, bool defla
 
        if (__pParentForm && deflateForm)
        {
-               SysLog(NID_UI_CTRL, "FormDeflateHeight:%f, KeypadExist(%d), ClipboardExist(%d), CommandButtonVisible(%d)",
+               SysLog(NID_UI_CTRL, "[EDIT]ChangeLayoutInternal: formDeflateHeight:%f, KeypadExist(%d), ClipboardExist(%d), CommandButtonVisible(%d)",
                        formDeflateHeight, __isKeypadExist, __isClipboardExist, __isKeypadCommandButtonVisible);
                __pParentForm->DeflateClientRectHeight(formDeflateHeight);
        }
@@ -7275,7 +7195,7 @@ _EditPresenter::OnScrollPanelBoundsChanged(void)
 }
 
 void
-_EditPresenter::AdjustParentPanelHeight(bool restore)
+_EditPresenter::AdjustParentPanelHeight(bool restore, bool panelResizeByPrediction)
 {
        if (__pParentPanel == null)
        {
@@ -7313,12 +7233,15 @@ _EditPresenter::AdjustParentPanelHeight(bool restore)
                screenSize.height = pControlManager->GetScreenSizeF().width;
        }
 
+       if (panelResizeByPrediction)
+               restore = false;
+
        if (restore)
        {
                if (__initialParentHeight)
                {
                        scrollPanelBounds.height = __initialParentHeight;
-                       SysLog(NID_UI_CTRL, "Rollback ScrollPanel's height to %f and Set __initialParentHeight to 'Zero' ", __initialParentHeight);
+
                        __initialParentHeight = 0.0f;
                        __pParentPanel->SetBounds(scrollPanelBounds);
                        __pParentPanel->Invalidate();
@@ -7367,69 +7290,51 @@ _EditPresenter::AdjustParentPanelHeight(bool restore)
                displayedPanelHeight = screenSize.height - commandButtonHeight - absScrollPanelBounds.y;
                gapY = (absKeypadBounds.y - commandButtonHeight)- absScrollPanelBounds.y;
 
-               bool isOverlapped = true;
-
-               if ((absKeypadBounds.y - commandButtonHeight) >= (absScrollPanelBounds.y + absScrollPanelBounds.height))
-               {
-                       isOverlapped = false;
-               }
-
-               SysLog(NID_UI_CTRL, "IsOverlapped:(%d), __initialParentHeight:(%f), gapY:(%f)", isOverlapped, __initialParentHeight, gapY);
-
-               if (!__initialParentHeight)
+               if (panelResizeByPrediction)
                {
-                       if (!isOverlapped)
+                       if ((absKeypadBounds.y - commandButtonHeight) >= (absScrollPanelBounds.y + absScrollPanelBounds.height))
                        {
                                return;
                        }
 
-                       if (gapY > 0.0f)
-                       {
-                               __initialParentHeight = scrollPanelBounds.height;
-
-                               SysLog(NID_UI_CTRL, "Set ScrollPanel's height to %f and Set __initialParentHeight:(%f)", gapY, __initialParentHeight);
-
-                               scrollPanelBounds.height = gapY;
-                               __pParentPanel->SetBounds(scrollPanelBounds);
-                               __pParentPanel->Invalidate();
-                       }
-               }
-               else
-               {
-                       if (!isOverlapped)
+                       if (__isUSBKeyboardConnected)
                        {
-                               if ((gapY < __initialParentHeight) && (gapY > 0.0f))
+                               if (gapY > 0.0f)
                                {
-                                       SysLog(NID_UI_CTRL, "Set ScrollPanel's height to %f", gapY);
-
                                        scrollPanelBounds.height = gapY;
                                        __pParentPanel->SetBounds(scrollPanelBounds);
                                        __pParentPanel->Invalidate();
-                                       return;
                                }
-                               else
+                       }
+                       else
+                       {
+                               if ((gapY > 0.0f) && __initialParentHeight)
                                {
-                                       if (gapY > __initialParentHeight)
-                                       {
-                                               SysLog(NID_UI_CTRL, "Set ScrollPanel's height to %f", __initialParentHeight);
-
-                                               scrollPanelBounds.height = __initialParentHeight;
-                                               __pParentPanel->SetBounds(scrollPanelBounds);
-                                               __pParentPanel->Invalidate();
-                                       }
-                                       return;
+                                       scrollPanelBounds.height = gapY;
+                                       __pParentPanel->SetBounds(scrollPanelBounds);
+                                       __pParentPanel->Invalidate();
                                }
                        }
+               }
+               else
+               {
+                       if ((absKeypadBounds.y - commandButtonHeight) >= (absScrollPanelBounds.y + absScrollPanelBounds.height))
+                       {
+                               return;
+                       }
 
-                       if (gapY > 0.0f)
+                       if ((gapY > 0) && (gapY < displayedPanelHeight) && !__initialParentHeight)
                        {
-                               SysLog(NID_UI_CTRL, "Set ScrollPanel's height to %f", gapY);
+                               __initialParentHeight = scrollPanelBounds.height;
+
                                scrollPanelBounds.height = gapY;
                                __pParentPanel->SetBounds(scrollPanelBounds);
                                __pParentPanel->Invalidate();
                        }
                }
        }
+
+       return;
 }
 
 result
@@ -7448,7 +7353,7 @@ _EditPresenter::HideKeypad(bool focus)
 
        if (__isUSBKeyboardConnected)
        {
-               SysLog(NID_UI_CTRL, "HideKeypad called in USB ON mode!!!!");
+               SysLog(NID_UI_CTRL, "[EDIT]HideKeypad called in USB ON mode!!!!");
                if (__pCommandButton && __isKeypadCommandButtonVisible)
                {
                        SetFooterVisible(true);
@@ -7457,7 +7362,7 @@ _EditPresenter::HideKeypad(bool focus)
 
                        if (__pParentForm)
                        {
-                               SysLog(NID_UI_CTRL, "Form deflate RESET!!!!!!!!!!");
+                               SysLog(NID_UI_CTRL, "[EDIT] Form deflate RESET!!!!!!!!!!");
                                __pParentForm->DeflateClientRectHeight(0.0f);
                        }
 
@@ -7468,7 +7373,7 @@ _EditPresenter::HideKeypad(bool focus)
        }
        else
        {
-               SysLog(NID_UI_CTRL, "HideKeypad called in USB OFF mode!!!!");
+               SysLog(NID_UI_CTRL, "[EDIT]HideKeypad called in USB OFF mode!!!!");
                if (__pCommandButton && __isKeypadCommandButtonVisible)
                {
                        if (!__isKeypadExist)
@@ -7477,7 +7382,7 @@ _EditPresenter::HideKeypad(bool focus)
 
                                if (__pParentForm)
                                {
-                                       SysLog(NID_UI_CTRL, "Form deflate RESET!!!!!!!!!!");
+                                       SysLog(NID_UI_CTRL, "[EDIT] Form deflate RESET!!!!!!!!!!");
                                        __pParentForm->DeflateClientRectHeight(0.0f);
                                }
                                __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_CLOSE);
@@ -7822,7 +7727,7 @@ _EditPresenter::SetEllipsisPosition(EllipsisPosition position)
        __pTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV);
 
        r = __pTextObject->SetTextObjectEllipsisType(ellipsisType);
-       SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, "Unable to Set ellipsis position.");
+       SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, "[EDIT] Unable to Set ellipsis position.");
 
        return r;
 }
@@ -7847,7 +7752,7 @@ _EditPresenter::OnFontChanged(Font* pFont)
        result r = E_SUCCESS;
 
        r = AdjustFont(*pFont, EDIT_FONT_CHANGE_ALL);
-       SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, GetLastResult(), "Unable to set font.");
+       SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, GetLastResult(), "[EDIT] Unable to set font.");
 
        __titleFontFaceName = pFont->GetFaceName();
 
@@ -7902,19 +7807,19 @@ _EditPresenter::SetTextSize(const int size)
        SysTryReturn(NID_UI_CTRL, fontImpl, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
        r = fontImpl->SetSize(size);
-       SysTryReturn(NID_UI_CTRL, !(IsFailed(r)), r, r, "SetSize is failed.");
+       SysTryReturn(NID_UI_CTRL, !(IsFailed(r)), r, r, "[EDIT] SetSize is failed.");
 
        if (__pTextObject)
        {
                r = __pTextObject->SetFont(__pFont, 0, __pTextObject->GetTextLength());
                __ContentTextStatus = EDIT_TEXT_STATUS_COMPOSE_NON;
-               SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Unable to set font.");
+               SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[EDIT] Unable to set font.");
        }
 
        if (IsGuideTextActivated())
        {
                r = __pGuideTextObject->SetFont(__pFont, 0, __pGuideTextObject->GetTextLength());
-               SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Unable to set font.");
+               SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[EDIT] Unable to set font.");
        }
 
        __contentFontSize = _CoordinateSystemUtils::ConvertToFloat(size);
@@ -7930,19 +7835,19 @@ _EditPresenter::SetTextSize(const float size)
        SysTryReturn(NID_UI_CTRL, fontImpl, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
        r = fontImpl->SetSize(size);
-       SysTryReturn(NID_UI_CTRL, !(IsFailed(r)), r, r, "SetSize is failed.");
+       SysTryReturn(NID_UI_CTRL, !(IsFailed(r)), r, r, "[EDIT] SetSize is failed.");
 
        if (__pTextObject)
        {
                r = __pTextObject->SetFont(__pFont, 0, __pTextObject->GetTextLength());
                __ContentTextStatus = EDIT_TEXT_STATUS_COMPOSE_NON;
-               SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Unable to set font.");
+               SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[EDIT] Unable to set font.");
        }
 
        if (IsGuideTextActivated())
        {
                r = __pGuideTextObject->SetFont(__pFont, 0, __pGuideTextObject->GetTextLength());
-               SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Unable to set font.");
+               SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[EDIT] Unable to set font.");
        }
 
        __contentFontSize = size;
@@ -7955,7 +7860,7 @@ _EditPresenter::SetFont(const Font& font)
        result r = E_SUCCESS;
 
        Font* pFont = _FontImpl::CloneN(const_cast <Font&>(font));
-       SysTryReturnResult(NID_UI_CTRL, pFont, GetLastResult(), "Unable to create font.");
+       SysTryReturnResult(NID_UI_CTRL, pFont, GetLastResult(), "[EDIT] Unable to create font.");
 
        __pFont = pFont;
 
@@ -7963,13 +7868,13 @@ _EditPresenter::SetFont(const Font& font)
        {
                r = __pTextObject->SetFont(__pFont, 0, __pTextObject->GetTextLength());
                __ContentTextStatus = EDIT_TEXT_STATUS_COMPOSE_NON;
-               SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, GetLastResult(), "Unable to set font.");
+               SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, GetLastResult(), "[EDIT] Unable to set font.");
        }
 
        if (IsGuideTextActivated())
        {
                r = __pGuideTextObject->SetFont(__pFont, 0, __pGuideTextObject->GetTextLength());
-               SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, GetLastResult(), "Unable to set font.");
+               SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, GetLastResult(), "[EDIT] Unable to set font.");
        }
 
        return r;
@@ -7990,17 +7895,17 @@ _EditPresenter::AdjustFont(Font& font, _EditFontChange fontChange)
                if (__pTitleTextObject)
                {
                        r = fontImpl->SetSize(__titleFontSize);
-                       SysTryReturn(NID_UI_CTRL, !(IsFailed(r)), r, r, "SetSize is failed.");
+                       SysTryReturn(NID_UI_CTRL, !(IsFailed(r)), r, r, "[EDIT] SetSize is failed.");
 
                        r = __pTitleTextObject->SetFont(pFont, 0, __pTitleTextObject->GetTextLength());
-                       SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Unable to set font.");
+                       SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[EDIT] Unable to set font.");
                }
        }
 
        if (fontChange == EDIT_FONT_CHANGE_CONTENT || fontChange == EDIT_FONT_CHANGE_ALL)
        {
                r = fontImpl->SetSize(__contentFontSize);
-               SysTryReturn(NID_UI_CTRL, !(IsFailed(r)), r, r, "SetSize is failed.");
+               SysTryReturn(NID_UI_CTRL, !(IsFailed(r)), r, r, "[EDIT] SetSize is failed.");
 
                unsigned long style = FONT_STYLE_PLAIN;
 
@@ -8028,13 +7933,13 @@ _EditPresenter::AdjustFont(Font& font, _EditFontChange fontChange)
                {
                        r = __pTextObject->SetFont(pFont, 0, __pTextObject->GetTextLength());
                        __ContentTextStatus = EDIT_TEXT_STATUS_COMPOSE_NON;
-                       SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Unable to set font.");
+                       SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[EDIT] Unable to set font.");
                }
 
                if (__pGuideTextObject)
                {
                        r = __pGuideTextObject->SetFont(pFont, 0, __pGuideTextObject->GetTextLength());
-                       SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Unable to set font.");
+                       SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[EDIT] Unable to set font.");
                }
        }
 
@@ -8076,7 +7981,7 @@ _EditPresenter::SetFontType(const String& typefaceName, unsigned long styleMask)
 
        Font* pFont = null;
        IList* systemFontList = Font::GetSystemFontListN();
-       SysTryReturnResult(NID_UI_CTRL, systemFontList, E_SYSTEM, "Unable to get system font list.\n");
+       SysTryReturnResult(NID_UI_CTRL, systemFontList, E_SYSTEM, "[EDIT] Unable to get system font list.\n");
 
        int fontListCount = systemFontList->GetCount();
        String tempFontFaceName;
@@ -8099,9 +8004,9 @@ _EditPresenter::SetFontType(const String& typefaceName, unsigned long styleMask)
                tempFontFaceName = *static_cast<String*>(systemFontList->GetAt(i));
 
                pFont = new (std::nothrow) Font;
-               SysTryCatch(NID_UI_CTRL, pFont, , r = E_OUT_OF_MEMORY, "Unable to get text information.\n");
+               SysTryCatch(NID_UI_CTRL, pFont, , r = E_OUT_OF_MEMORY, "[EDIT] Unable to get text information.\n");
                r = pFont->Construct(tempFontFaceName, fontStyle, textSize);
-               SysTryCatch(NID_UI_CTRL, !IsFailed(r), , r, "Unable to construct Font.\n");
+               SysTryCatch(NID_UI_CTRL, !IsFailed(r), , r, "[EDIT] Unable to construct Font.\n");
 
                // check font face name.
                if (typefaceName.Equals(pFont->GetFaceName(), true))
@@ -8114,7 +8019,7 @@ _EditPresenter::SetFontType(const String& typefaceName, unsigned long styleMask)
                pFont = null;
        }
 
-       SysTryCatch(NID_UI_CTRL, isFaceNameAvailable, , r = E_INVALID_ARG, "The unsupported font face name is given.\n");
+       SysTryCatch(NID_UI_CTRL, isFaceNameAvailable, , r = E_INVALID_ARG, "[EDIT] The unsupported font face name is given.\n");
 
        if (styleMask & TEXT_BOX_TEXT_STYLE_UNDERLINE)
        {
@@ -8138,7 +8043,7 @@ _EditPresenter::SetFontType(const String& typefaceName, unsigned long styleMask)
        {
                r = __pTextObject->SetFont(__pFont, 0, __pTextObject->GetTextLength());
                __ContentTextStatus = EDIT_TEXT_STATUS_COMPOSE_NON;
-               SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, GetLastResult(), "Unable to set font.");
+               SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, GetLastResult(), "[EDIT] Unable to set font.");
        }
 
        return r;
@@ -8206,13 +8111,13 @@ _EditPresenter::SetTextStyle(unsigned long textStyle)
        {
                r = __pTextObject->SetFont(__pFont, 0, __pTextObject->GetTextLength());
                __ContentTextStatus = EDIT_TEXT_STATUS_COMPOSE_NON;
-               SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Unable to set font.");
+               SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[EDIT] Unable to set font.");
        }
 
        if (IsGuideTextActivated())
        {
                r = __pGuideTextObject->SetFont(__pFont, 0, __pGuideTextObject->GetTextLength());
-               SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Unable to set font.");
+               SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[EDIT] Unable to set font.");
        }
 
        __contentTextStyle = textStyle;
@@ -8317,7 +8222,7 @@ _EditPresenter::SetTitleText(const String& title)
        if(fontImpl)
        {
                r = fontImpl->SetSize(__titleFontSize);
-               SysTryReturn(NID_UI_CTRL, !(IsFailed(r)), r, r, "SetSize is failed.");
+               SysTryReturn(NID_UI_CTRL, !(IsFailed(r)), r, r, "[EDIT] SetSize is failed.");
        }
        else
        {
@@ -8328,7 +8233,7 @@ _EditPresenter::SetTitleText(const String& title)
        __pTitleTextObject->SetFont(__pFont, 0, __pTitleTextObject->GetTextLength());
 
        r = fontImpl->SetSize(__contentFontSize);
-       SysTryReturn(NID_UI_CTRL, !(IsFailed(r)), r, r, "SetSize is failed.");
+       SysTryReturn(NID_UI_CTRL, !(IsFailed(r)), r, r, "[EDIT] SetSize is failed.");
 
        __pEdit->UpdateAccessibilityElement(EDIT_ACCESSIBILITY_ELEMENT_TYPE_TEXT);
 
@@ -10042,7 +9947,7 @@ _EditPresenter::GetTextImageRangeAt(int postion, int& startPosition, int& endPos
        startPosition = -1;
        endPosition = -1;
 
-       SysTryReturnResult(NID_UI_CTRL, postion >= 0 && postion <= length, E_OUT_OF_RANGE, "The given index is out-of-range.");
+       SysTryReturnResult(NID_UI_CTRL, postion >= 0 && postion <= length, E_OUT_OF_RANGE, "[EDIT] The given index is out-of-range.");
 
        _Text::TextElement* pTextElement = __pTextObject->GetElementAtTextIndex(postion);
        const TextSimple* pSimpleText = dynamic_cast <const TextSimple*>(pTextElement);
index da4bcbc..1808ce3 100644 (file)
@@ -404,7 +404,7 @@ _FooterImpl::SetButton(ButtonPosition position, const ButtonItem& button)
                if (position == BUTTON_POSITION_LEFT)
                {
                        SysTryReturnResult(NID_UI_CTRL, (IsMenuButtonSet() == false), E_SYSTEM,
-                                       "[E_SYSTEM] A Menu button exists.");
+                                       "[E_SYSTEM] A Option button exists.");
                }
 
                SysTryReturnResult(NID_UI_CTRL, (count <= FOOTER_MAX_ITEM_COUNT_WITH_BUTTON), E_SYSTEM,
@@ -1587,34 +1587,38 @@ _FooterImpl::ConvertFooterStyle(FooterStyle style)
 bool
 _FooterImpl::IsMenuButtonSet(void) const
 {
-       return GetCore().IsButtonSet(MENU_BUTTON);
+       return GetCore().IsButtonSet(OPTION_BUTTON);
 }
 
+
 ButtonItemStatus
 _FooterImpl::GetMenuButtonStatus(void) const
 {
        SysTryReturn(NID_UI_CTRL, (IsMenuButtonSet() == true), BUTTON_ITEM_STATUS_NORMAL, E_INVALID_OPERATION,
-                       "[E_INVALID_OPERATION] A Menu button doesn't exist");
+                       "[E_INVALID_OPERATION] A Option button doesn't exist");
 
        _ButtonStatus buttonStatus;
 
-       buttonStatus = GetCore().GetButtonStatus(MENU_BUTTON);
+       buttonStatus = GetCore().GetButtonStatus(OPTION_BUTTON);
 
        return ConvertButtonItemStatus(buttonStatus);
 }
 
+
 result
 _FooterImpl::RemoveMenuButton(void)
 {
-       return GetCore().RemoveButtonAt(MENU_BUTTON);
+       return GetCore().RemoveButtonAt(OPTION_BUTTON);
 }
 
+
 result
 _FooterImpl::SetMenuButtonEnabled(bool enable)
 {
-       return GetCore().SetButtonEnabled(MENU_BUTTON, enable);
+       return GetCore().SetButtonEnabled(OPTION_BUTTON, enable);
 }
 
+
 result
 _FooterImpl::SetMenuButton(void)
 {
@@ -1632,12 +1636,12 @@ _FooterImpl::SetMenuButton(void)
 
        if ((__style == FOOTER_STYLE_SEGMENTED_TEXT || __style == FOOTER_STYLE_SEGMENTED_ICON || __style == FOOTER_STYLE_SEGMENTED_ICON_TEXT) && GetItemCount() > 4)
        {
-               SysLogException(NID_UI_CTRL, E_SYSTEM, "[E_SYSTEM] Unable to set the menu button.");
+               SysLogException(NID_UI_CTRL, E_SYSTEM, "[E_SYSTEM] Unable to set the option button.");
                return E_SYSTEM;
        }
        else if ((__style == FOOTER_STYLE_BUTTON_ICON || __style == FOOTER_STYLE_BUTTON_TEXT || __style == FOOTER_STYLE_BUTTON_ICON_TEXT) && GetItemCount() > 5)
        {
-               SysLogException(NID_UI_CTRL, E_SYSTEM, "[E_SYSTEM] Unable to set the menu button.");
+               SysLogException(NID_UI_CTRL, E_SYSTEM, "[E_SYSTEM] Unable to set the option button.");
                return E_SYSTEM;
        }
 
@@ -1837,7 +1841,7 @@ _FooterImpl::SetMenuButton(void)
                delete pBackIconHighlightedEffectBitmap;
        }
 
-       return GetCore().SetButton(MENU_BUTTON, pButton);
+       return GetCore().SetButton(OPTION_BUTTON, pButton);
 }
 
 class _FooterMaker
index 487ff38..cbdfe0b 100644 (file)
@@ -360,7 +360,7 @@ _Form::SetFormMenuEventListener(_IFormMenuEventListener* pFormMenuEventListener)
        __pFormMenuEventListener = pFormMenuEventListener;
        if (__pFooter)
        {
-               __pFooter->SetMenuEventListener(*this, ID_MENU_BUTTON);
+               __pFooter->SetOptionEventListener(*this, ID_OPTION_BUTTON);
        }
 
        SetLastResult(E_SUCCESS);
@@ -2031,10 +2031,6 @@ _Form::IsIndicatorTranslucent(void) const
                        {
                                transparent = false;
                        }
-                       else
-                       {
-                               transparent = true;
-                       }
                }
        }
        else
@@ -2046,22 +2042,6 @@ _Form::IsIndicatorTranslucent(void) const
 }
 
 bool
-_Form::IsIndicatorAutoHide(void) const
-{
-       _Control* pParent = GetParent();
-       _Frame* pFrame = dynamic_cast<_Frame*>(pParent);
-
-       bool autohide = false;
-
-       if (pFrame && IsAttachedToMainTree())
-       {
-               autohide = __pIndicator->GetIndicatorAutoHide();
-       }
-
-       return autohide;
-}
-
-bool
 _Form::IsHeaderTranslucent(void) const
 {
        return __transparentHeader;
@@ -2785,7 +2765,7 @@ _Form::OnActionPerformed(const _Control& source, int actionId)
                        }
                }
                break;
-       case ID_MENU_BUTTON :
+       case ID_OPTION_BUTTON :
                if (__pFormMenuEventListener)
                {
                        __pFormMenuEventListener->OnFormMenuRequested(*this);
@@ -2936,7 +2916,7 @@ _Form::SetTabStyle(int style)
 }
 
 result
-_Form::SetIndicatorShowState(bool state)
+_Form::SetIndicatorShowState(bool state, bool hide)
 {
        result r = E_SUCCESS;
 
@@ -2959,7 +2939,7 @@ _Form::SetIndicatorShowState(bool state)
                        {
                                if (pFrame->GetShowMode(false) == FRAME_SHOW_MODE_FULL_SCREEN)
                                {
-                                       r = __pIndicator->SetIndicatorShowState(state);
+                                       r = __pIndicator->SetIndicatorShowState(state, hide);
                                        SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
                                }
                        }
@@ -2971,13 +2951,13 @@ _Form::SetIndicatorShowState(bool state)
                }
                else if (mode == FRAME_SHOW_MODE_FULL_SCREEN)
                {
-                       r = __pIndicator->SetIndicatorShowState(state);
+                       r = __pIndicator->SetIndicatorShowState(state, hide);
                        SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
                }
        }
        else if (!pFrame && IsAttachedToMainTree())
        {
-               r = __pIndicator->SetIndicatorShowState(false);
+               r = __pIndicator->SetIndicatorShowState(false, true);
        }
 
        __indicatorShowState = state;
@@ -2986,26 +2966,6 @@ _Form::SetIndicatorShowState(bool state)
 }
 
 result
-_Form::SetIndicatorAutoHide(bool autohide)
-{
-       result r = E_SUCCESS;
-
-       _Control* pParent = GetParent();
-       _Frame* pFrame = dynamic_cast<_Frame*>(pParent);
-
-       if (pFrame && IsAttachedToMainTree())
-       {
-               FrameShowMode mode = pFrame->GetShowMode();
-               if (mode == FRAME_SHOW_MODE_FULL_SCREEN)
-               {
-                       r = __pIndicator->SetIndicatorAutoHide(autohide);
-                       SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-               }
-       }
-       return r;
-}
-
-result
 _Form::SetIndicatorOpacity(_IndicatorOpacity opacity)
 {
        result r = E_SUCCESS;
@@ -3177,15 +3137,12 @@ _Form::AttachedToMainTree(void)
                                SetIndicatorShowState(__indicatorShowState);
                }
 
-               SetIndicatorAutoHide(false);
                r = GetLastResult();
                SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
        }
        else if (FORM_STYLE_INDICATOR_AUTO_HIDE & GetFormStyle())
        {
-               AddIndicatorObject();
-               SetIndicatorShowState(__indicatorShowState);
-               SetIndicatorAutoHide(true);
+               SetIndicatorShowState(__indicatorShowState, true);
        }
        else
        {
@@ -3531,21 +3488,7 @@ _Form::OnVisibleStateChanged(void)
 {
        if (GetVisibleState())
        {
-               if (FORM_STYLE_INDICATOR & GetFormStyle())
-               {
-                       SetIndicatorShowState(__indicatorShowState);
-                       SetIndicatorAutoHide(false);
-               }
-               else if (FORM_STYLE_INDICATOR_AUTO_HIDE & GetFormStyle())
-               {
-                       SetIndicatorShowState(true);
-                       SetIndicatorAutoHide(true);
-               }
-               else
-               {
-                       SetIndicatorShowState(false);
-                       SetIndicatorAutoHide(false);
-               }
+               SetIndicatorShowState(__indicatorShowState);
        }
 }
 
index de0c8d7..3475998 100644 (file)
@@ -328,21 +328,18 @@ _FormImpl::SetFormStyle(unsigned long formStyle)
        {
                GetCore().SetIndicatorShowState(true);
                indicatorBounds = GetCore().GetIndicatorBoundsF();
-               GetCore().SetIndicatorAutoHide(false);
                r = GetLastResult();
                SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
 
        }
        else if(FORM_STYLE_INDICATOR_AUTO_HIDE & formStyle)
        {
-               r = GetCore().SetIndicatorShowState(true);
-               r = GetCore().SetIndicatorAutoHide(true);
+               r = GetCore().SetIndicatorShowState(false, true);
                SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
        }
        else
        {
                r = GetCore().SetIndicatorShowState(false);
-               r = GetCore().SetIndicatorAutoHide(false);
                SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
        }
 
@@ -1193,6 +1190,7 @@ _FormImpl::OnChangeLayout(_ControlOrientation orientation)
                                {
                                        curPoint.y = portraitSize.width / portraitSize.height * prevPoint.y;
                                }
+
                        }
 
                        pFrameImpl->SetPosition(curPoint);
index d7d251f..cb1ba8d 100644 (file)
@@ -1867,7 +1867,11 @@ _IconListPresenter::DrawVerticalScrollList(void)
        __firstDrawnIndex = index;
        __firstDrawnItemFullyDrawn = _FloatCompareGE(itemRect.y, 0);
 
-       while (itemRect.y < endYPos)
+       float lastDrawnItemY = 0.0f;
+       int lastIndex = -1;
+       bool isUpdated = false;
+
+       while (itemRect.y < endYPos || index <= __lastDrawnIndex)
        {
                itemRect.x = __startPosOfAxis;
                while (itemRect.x < endXPos && index < itemCount)
@@ -1898,9 +1902,15 @@ _IconListPresenter::DrawVerticalScrollList(void)
                        itemRect.x += unitWidth;
                }
                itemRect.y += unitHeight;
+               if (itemRect.y >= endYPos && !isUpdated)
+               {
+                       isUpdated = true;
+                       lastIndex = index;
+                       lastDrawnItemY = itemRect.y;
+               }
        }
-       __lastDrawnIndex = index - 1;
-       __lastDrawnItemFullyDrawn = _FloatCompareGE(endYPos, itemRect.y);
+       __lastDrawnIndex = lastIndex - 1;
+       __lastDrawnItemFullyDrawn = _FloatCompareGE(endYPos, lastDrawnItemY);
 
        // Support Accessibility
        __RequestToDrawAccessibilityFocusUi = true;
index fe5af99..777694a 100644 (file)
@@ -57,10 +57,10 @@ static const int CONNECTION_INTERVAL = 1000;
 
 typedef enum
 {
-   _INDICATOR_TYPE_UNKNOWN, /**< Unknown indicator type mode */
-   _INDICATOR_TYPE_1, /**< Type 0 the the indicator */
-   _INDICATOR_TYPE_2, /**< Type 1 the indicator */
-} _IndicatorTypeMode;
+   INDICATOR_TYPE_UNKNOWN, /**< Unknown indicator type mode */
+   INDICATOR_TYPE_1, /**< Type 0 the the indicator */
+   INDICATOR_TYPE_2, /**< Type 1 the indicator */
+} IndicatorTypeMode;
 
 _Indicator*
 _Indicator::CreateIndicator(void)
@@ -93,7 +93,6 @@ _Indicator::_Indicator(void)
        , __pCurrentVisualElement(null)
        , __pWindow(null)
        , __showstate(false)
-       , __autohide(false)
        , __opacity(_INDICATOR_OPACITY_OPAQUE)
        , __orientation(_CONTROL_ORIENTATION_PORTRAIT)
 {
@@ -110,7 +109,7 @@ _Indicator::~_Indicator(void)
 }
 
 result
-_Indicator::SetIndicatorShowState(bool state)
+_Indicator::SetIndicatorShowState(bool state, bool hide)
 {
        result r = E_SUCCESS;
 
@@ -119,10 +118,18 @@ _Indicator::SetIndicatorShowState(bool state)
 
        if (__pWindow)
        {
-               r = pEcoreEvas->SetIndicatorShowState(*__pWindow, state);
-               SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+               if (hide)
+               {
+                       r = pEcoreEvas->SetIndicatorShowState(*__pWindow, true);
+               }
+               else
+               {
+                       r = pEcoreEvas->SetIndicatorShowState(*__pWindow, state);
+               }
        }
 
+       SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+
        __showstate = state;
 
        SetShowState(state);
@@ -136,35 +143,6 @@ _Indicator::SetIndicatorShowState(bool state)
 }
 
 result
-_Indicator::SetIndicatorAutoHide(bool autohide)
-{
-       Ecore_X_Window win;
-       if (__pWindow)
-       {
-               win = (Ecore_X_Window)__pWindow->GetNativeHandle();
-       }
-
-       Ecore_Evas *pPortraitEe = ecore_evas_object_ecore_evas_get(__pPortraitIndicatorEvasObject);
-       SysTryReturnResult(NID_UI_CTRL, pPortraitEe, E_SYSTEM, "[E_SYSTEM] Unable to get evas.");
-       Ecore_Evas *pLandscapeEe = ecore_evas_object_ecore_evas_get(__pLandscapeIndicatorEvasObject);
-       SysTryReturnResult(NID_UI_CTRL, pLandscapeEe, E_SYSTEM, "[E_SYSTEM] Unable to get evas.");
-
-       if (autohide)
-       {
-               Color bgColor(0x00000000);
-               SetBackgroundColor(_Colorf((float)bgColor.GetRed() / 255.0f, (float)bgColor.GetGreen() / 255.0f, (float)bgColor.GetBlue() / 255.0f, (float)bgColor.GetAlpha() / 255.0f));
-   ecore_x_e_illume_indicator_opacity_set(win, ECORE_X_ILLUME_INDICATOR_TRANSPARENT);
-       }
-       else
-       {
-               SetIndicatorOpacity(__opacity);
-               ecore_x_e_illume_indicator_opacity_set(win, ECORE_X_ILLUME_INDICATOR_OPAQUE);
-       }
-
-       __autohide = autohide;
-}
-
-result
 _Indicator::SetIndicatorOpacity(_IndicatorOpacity opacity)
 {
        result r = E_SUCCESS;
@@ -202,20 +180,9 @@ _Indicator::GetIndicatorShowState(void) const
 _IndicatorOpacity
 _Indicator::GetIndicatorOpacity(void) const
 {
-       if (__autohide)
-       {
-               return _INDICATOR_OPACITY_TRANSPARENT;
-       }
-
        return __opacity;
 }
 
-bool
-_Indicator::GetIndicatorAutoHide(void) const
-{
-       return __autohide;
-}
-
 Rectangle
 _Indicator::GetIndicatorBounds(void) const
 {
@@ -398,10 +365,7 @@ _Indicator::OnChangeLayout(_ControlOrientation orientation)
                SetClipChildrenEnabled(false);
        }
        __orientation = orientation;
-       if (!__autohide)
-       {
-               SetIndicatorOpacity(__opacity);
-       }
+       SetIndicatorOpacity(__opacity);
 
        _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
        int rotation = 0;
@@ -551,18 +515,18 @@ _Indicator::OnMessageHandle(Ecore_Evas *pEe, int msgDomain, int msgId, void *dat
                }*/
                if (msgId == MSG_ID_INDICATOR_TYPE)
                {
-                       _IndicatorTypeMode *pIndicatorTypeMode = (_IndicatorTypeMode*)(data);
+                       IndicatorTypeMode *pIndicatorTypeMode = (IndicatorTypeMode*)(data);
 
                        _Window* pWindow =      _ControlManager::GetInstance()->_ControlManager::GetTopVisibleWindow();
                        SysTryReturnVoidResult(NID_UI_CTRL, pWindow, E_INVALID_STATE, "[E_INVALID_STATE] Indicator is not attached main tree.");
 
                        Ecore_X_Window win = (Ecore_X_Window)pWindow->GetNativeHandle();
 
-                       if (*pIndicatorTypeMode == _INDICATOR_TYPE_1)
+                       if (*pIndicatorTypeMode == INDICATOR_TYPE_1)
                        {
                          ecore_x_e_illume_indicator_type_set(win, ECORE_X_ILLUME_INDICATOR_TYPE_1);
                        }
-                       else if (*pIndicatorTypeMode == _INDICATOR_TYPE_2)
+                       else if (*pIndicatorTypeMode == INDICATOR_TYPE_2)
                        {
                          ecore_x_e_illume_indicator_type_set   (win, ECORE_X_ILLUME_INDICATOR_TYPE_2);
                        }
index ac7ef50..805acfa 100644 (file)
@@ -422,7 +422,6 @@ _Popup::OnActivated(void)
 
        bool showstate = false;
        bool opacity = false;
-       bool autohide = false;
 
        _Control* pOwner = GetOwner();
        if (pOwner == null)
@@ -437,7 +436,6 @@ _Popup::OnActivated(void)
 
                        showstate = pForm->IsIndicatorVisible();
                        opacity = pForm->IsIndicatorTranslucent();
-                       autohide = pForm->IsIndicatorAutoHide();
                }
                else
                {
@@ -451,7 +449,6 @@ _Popup::OnActivated(void)
                {
                        showstate = pForm->IsIndicatorVisible();
                        opacity = pForm->IsIndicatorTranslucent();
-                       autohide = pForm->IsIndicatorAutoHide();
                }
 
                pOwner->LockInputEvent();
@@ -485,7 +482,6 @@ _Popup::OnActivated(void)
                {
                        __pIndicator->SetIndicatorOpacity(_INDICATOR_OPACITY_OPAQUE);
                }
-               __pIndicator->SetIndicatorAutoHide(autohide);
        }
 
        _Window::OnActivated();
@@ -502,6 +498,11 @@ _Popup::OnDeactivated(void)
 
        ReleaseTouchCapture();
 
+       if (__pIndicator)
+       {
+               __pIndicator->DeleteIndicatorObject();
+       }
+
        _Window::OnDeactivated();
 }
 
index 371e40c..c23535b 100644 (file)
@@ -330,21 +330,6 @@ _PopupImpl::OnChangeLayout(_ControlOrientation orientation)
 
        }
 
-       Layout* pLayout;
-
-       pLayout = GetPublicLayoutN();
-
-       if (pLayout != null)
-       {
-               Tizen::Ui::_SharedPtr<Tizen::Ui::_LayoutImpl> pLayoutImpl = _LayoutImpl::GetLayoutImpl(pLayout);
-
-               if (!pLayoutImpl.IsNull())
-               {
-                       r = GetCore().SetCurrentLayout(pLayoutImpl->GetCore());
-                       SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, "[E_SYSTEM] Failed to set up the current layout");
-               }
-       }
-
        float indicatorheight = 0.0f;
 
        const FloatDimension portraitSize = _ControlManager::GetInstance()->_ControlManager::GetScreenSizeF();
index 4fc662d..02a4ded 100644 (file)
@@ -105,7 +105,7 @@ _Toolbar::_Toolbar(void)
        , __pToolbarPresenter(null)
        , __pActionEventListener(null)
        , __pBackEventListener(null)
-       , __pMenuEventListener(null)
+       , __pOptionEventListener(null)
        , __pLongPressGesture(null)
        , __pFlickGesture(null)
        , __pToolbarBackgroundBitmap(null)
@@ -116,7 +116,7 @@ _Toolbar::_Toolbar(void)
        , __pItems(null)
        , __pTitleBadgeIcon(null)
        , __backActionId(-1)
-       , __menuActionId(-1)
+       , __optionActionId(-1)
        , __itemCount(0)
        , __style(TOOLBAR_TITLE)
        , __transparent(false)
@@ -133,7 +133,7 @@ _Toolbar::_Toolbar(void)
        __pButtonItems[RIGHT_BUTTON] = null;
        __pButtonItems[BACK_BUTTON] = null;
        __pButtonItems[MIDDLE_BUTTON] = null;
-       __pButtonItems[MENU_BUTTON] = null;
+       __pButtonItems[OPTION_BUTTON] = null;
 
        for (int i = 0; i < TOOLBAR_ANIMATION_POSITION_MAX; i++)
        {
@@ -208,9 +208,9 @@ _Toolbar::~_Toolbar(void)
                __pBackEventListener = null;
        }
 
-       if (__pMenuEventListener)
+       if (__pOptionEventListener)
        {
-               __pMenuEventListener = null;
+               __pOptionEventListener = null;
        }
 
        if (__pLongPressGesture != null)
@@ -1608,17 +1608,17 @@ _Toolbar::SetButton(ToolbarButton position, _Button* pButton)
                                pButton->SetPosition(FloatPoint((toolbarWidth - buttonWidth - horizontalMargin)/2, verticalMargin));
                                break;
 
-                       case MENU_BUTTON:
+                       case OPTION_BUTTON:
                                if (IsButtonSet(LEFT_BUTTON) == true)
                                {
                                        RemoveButtonAt(LEFT_BUTTON);
                                }
 
                                pButton->SetPosition(FloatPoint(0.0f, 0.0f));
-                               if (__pMenuEventListener)
+                               if (__pOptionEventListener)
                                {
-                                       pButton->AddActionEventListener(*__pMenuEventListener);
-                                       pButton->SetActionId(__menuActionId);
+                                       pButton->AddActionEventListener(*__pOptionEventListener);
+                                       pButton->SetActionId(__optionActionId);
                                }
                                break;
 
@@ -1627,7 +1627,7 @@ _Toolbar::SetButton(ToolbarButton position, _Button* pButton)
                }
        }
 
-       if (!(position == BACK_BUTTON || position == MENU_BUTTON) && __pActionEventListener != null)
+       if (!(position == BACK_BUTTON || position == OPTION_BUTTON) && __pActionEventListener != null)
        {
                pButton->AddActionEventListener(*__pActionEventListener);
        }
@@ -2866,8 +2866,8 @@ _Toolbar::AddAccessibilityElement(ToolbarButton position, _Button* pButton)
                case MIDDLE_BUTTON:
                        name = L"MiddleButtonText";
                        break;
-               case MENU_BUTTON:
-                       name = L"MenuButtonText";
+               case OPTION_BUTTON:
+                       name = L"OptionButtonText";
                        break;
                default:
                        return;
@@ -2894,9 +2894,9 @@ _Toolbar::AddAccessibilityElement(ToolbarButton position, _Button* pButton)
                        pButtonElement->SetLabel("Back");
                        pButtonElement->SetTrait("Button");
                }
-               else if (position == MENU_BUTTON)
+               else if (position == OPTION_BUTTON)
                {
-                       pButtonElement->SetLabel("Menu");
+                       pButtonElement->SetLabel("Option");
                        pButtonElement->SetTrait("Button");
                }
                else
@@ -3069,51 +3069,32 @@ _Toolbar::OnFocusModeStateChanged(void)
 {
        if (__itemCount == 0)
        {
-               if (__pButtonItems[LEFT_BUTTON] || __pButtonItems[MENU_BUTTON])
+               if (__pButtonItems[LEFT_BUTTON])
                {
                        if (__pButtonItems[RIGHT_BUTTON] || __pButtonItems[BACK_BUTTON])
                        {
-                               if (__highlightedItemIndex == __itemCount)
+                               if (__highlightedItemIndex == __itemCount && __pButtonItems[LEFT_BUTTON])
                                {
-                                       if (__pButtonItems[MENU_BUTTON])
-                                       {
-                                               __pButtonItems[MENU_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
-                                               __pButtonItems[MENU_BUTTON]->Invalidate();
-                                       }
-                                       else if (__pButtonItems[LEFT_BUTTON])
-                                       {
-                                               __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
-                                               __pButtonItems[LEFT_BUTTON]->Invalidate();
-                                       }
+                                       __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
+                                       __pButtonItems[LEFT_BUTTON]->Invalidate();
                                }
-                               else if (__highlightedItemIndex == __itemCount + 1)
+                               else if (__highlightedItemIndex == __itemCount + 1 && __pButtonItems[BACK_BUTTON])
                                {
-                                       if (__pButtonItems[BACK_BUTTON])
-                                       {
-                                               __pButtonItems[BACK_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
-                                               __pButtonItems[BACK_BUTTON]->Invalidate();
-                                       }
-                                       else if (__pButtonItems[RIGHT_BUTTON])
-                                       {
-                                               __pButtonItems[RIGHT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
-                                               __pButtonItems[RIGHT_BUTTON]->Invalidate();
-                                       }
+                                       __pButtonItems[BACK_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
+                                       __pButtonItems[BACK_BUTTON]->Invalidate();
+                               }
+                               else if (__highlightedItemIndex == __itemCount + 1 && __pButtonItems[RIGHT_BUTTON])
+                               {
+                                       __pButtonItems[RIGHT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
+                                       __pButtonItems[RIGHT_BUTTON]->Invalidate();
                                }
                        }
                        else
                        {
-                               if (__highlightedItemIndex == __itemCount)
+                               if (__highlightedItemIndex == __itemCount && __pButtonItems[LEFT_BUTTON])
                                {
-                                       if      (__pButtonItems[MENU_BUTTON])
-                                       {
-                                               __pButtonItems[MENU_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
-                                               __pButtonItems[MENU_BUTTON]->Invalidate();
-                                       }
-                                       else if (__pButtonItems[LEFT_BUTTON])
-                                       {
-                                               __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
-                                               __pButtonItems[LEFT_BUTTON]->Invalidate();
-                                       }
+                                       __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
+                                       __pButtonItems[LEFT_BUTTON]->Invalidate();
                                }
                        }
                }
@@ -3121,18 +3102,15 @@ _Toolbar::OnFocusModeStateChanged(void)
                {
                        if (__pButtonItems[RIGHT_BUTTON] || __pButtonItems[BACK_BUTTON])
                        {
-                               if (__highlightedItemIndex == __itemCount)
+                               if (__highlightedItemIndex == __itemCount && __pButtonItems[BACK_BUTTON])
                                {
-                                       if (__pButtonItems[BACK_BUTTON])
-                                       {
-                                               __pButtonItems[BACK_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
-                                               __pButtonItems[BACK_BUTTON]->Invalidate();
-                                       }
-                                       else if (__pButtonItems[RIGHT_BUTTON])
-                                       {
-                                               __pButtonItems[RIGHT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
-                                               __pButtonItems[RIGHT_BUTTON]->Invalidate();
-                                       }
+                                       __pButtonItems[BACK_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
+                                       __pButtonItems[BACK_BUTTON]->Invalidate();
+                               }
+                               else if (__highlightedItemIndex == __itemCount && __pButtonItems[RIGHT_BUTTON])
+                               {
+                                       __pButtonItems[RIGHT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
+                                       __pButtonItems[RIGHT_BUTTON]->Invalidate();
                                }
                        }
                }
@@ -3141,7 +3119,7 @@ _Toolbar::OnFocusModeStateChanged(void)
        {
                if (__highlightedItemIndex < __itemCount)
                {
-                       if (__pItems.at(__highlightedItemIndex))
+                       if(__pItems.at(__highlightedItemIndex))
                        {
                                __pItems.at(__highlightedItemIndex)->SetButtonStatus(_BUTTON_STATUS_NORMAL);
                                __pItems.at(__highlightedItemIndex)->Invalidate();
@@ -3149,51 +3127,32 @@ _Toolbar::OnFocusModeStateChanged(void)
                }
                else
                {
-                       if (__pButtonItems[LEFT_BUTTON] || __pButtonItems[MENU_BUTTON])
+                       if (__pButtonItems[LEFT_BUTTON])
                        {
                                if (__pButtonItems[RIGHT_BUTTON] || __pButtonItems[BACK_BUTTON])
                                {
-                                       if (__highlightedItemIndex == __itemCount)
+                                       if (__highlightedItemIndex == __itemCount && __pButtonItems[LEFT_BUTTON])
                                        {
-                                               if (__pButtonItems[MENU_BUTTON])
-                                               {
-                                                       __pButtonItems[MENU_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
-                                                       __pButtonItems[MENU_BUTTON]->Invalidate();
-                                               }
-                                               else if (__pButtonItems[LEFT_BUTTON])
-                                               {
-                                                       __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
-                                                       __pButtonItems[LEFT_BUTTON]->Invalidate();
-                                               }
+                                               __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
+                                               __pButtonItems[LEFT_BUTTON]->Invalidate();
                                        }
-                                       else if (__highlightedItemIndex == __itemCount + 1)
+                                       else if (__highlightedItemIndex == __itemCount + 1 && __pButtonItems[BACK_BUTTON])
                                        {
-                                               if (__pButtonItems[BACK_BUTTON])
-                                               {
-                                                       __pButtonItems[BACK_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
-                                                       __pButtonItems[BACK_BUTTON]->Invalidate();
-                                               }
-                                               else if (__pButtonItems[RIGHT_BUTTON])
-                                               {
-                                                       __pButtonItems[RIGHT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
-                                                       __pButtonItems[RIGHT_BUTTON]->Invalidate();
-                                               }
+                                               __pButtonItems[BACK_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
+                                               __pButtonItems[BACK_BUTTON]->Invalidate();
+                                       }
+                                       else if (__highlightedItemIndex == __itemCount + 1 && __pButtonItems[RIGHT_BUTTON])
+                                       {
+                                               __pButtonItems[RIGHT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
+                                               __pButtonItems[RIGHT_BUTTON]->Invalidate();
                                        }
                                }
                                else
                                {
-                                       if (__highlightedItemIndex == __itemCount)
+                                       if (__highlightedItemIndex == __itemCount && __pButtonItems[LEFT_BUTTON])
                                        {
-                                               if (__pButtonItems[MENU_BUTTON])
-                                               {
-                                                       __pButtonItems[MENU_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
-                                                       __pButtonItems[MENU_BUTTON]->Invalidate();
-                                               }
-                                               else if (__pButtonItems[LEFT_BUTTON])
-                                               {
-                                                       __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
-                                                       __pButtonItems[LEFT_BUTTON]->Invalidate();
-                                               }
+                                               __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
+                                               __pButtonItems[LEFT_BUTTON]->Invalidate();
                                        }
                                }
                        }
@@ -3201,18 +3160,15 @@ _Toolbar::OnFocusModeStateChanged(void)
                        {
                                if (__pButtonItems[RIGHT_BUTTON] || __pButtonItems[BACK_BUTTON])
                                {
-                                       if (__highlightedItemIndex == __itemCount)
+                                       if (__highlightedItemIndex == __itemCount && __pButtonItems[BACK_BUTTON])
                                        {
-                                               if (__pButtonItems[BACK_BUTTON])
-                                               {
-                                                       __pButtonItems[BACK_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
-                                                       __pButtonItems[BACK_BUTTON]->Invalidate();
-                                               }
-                                               else if (__pButtonItems[RIGHT_BUTTON])
-                                               {
-                                                       __pButtonItems[RIGHT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
-                                                       __pButtonItems[RIGHT_BUTTON]->Invalidate();
-                                               }
+                                               __pButtonItems[BACK_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
+                                               __pButtonItems[BACK_BUTTON]->Invalidate();
+                                       }
+                                       else if (__highlightedItemIndex == __itemCount && __pButtonItems[RIGHT_BUTTON])
+                                       {
+                                               __pButtonItems[RIGHT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
+                                               __pButtonItems[RIGHT_BUTTON]->Invalidate();
                                        }
                                }
                        }
@@ -3233,905 +3189,34 @@ _Toolbar::OnFocusModeStateChanged(void)
 bool
 _Toolbar::OnFocusGained(const _Control& source)
 {
-       if (__header == true && __style != TOOLBAR_TEXT) // right align
-       {
-               OnHeaderFocusGained(source);
-       }
-       else
-       {
-               OnFooterFocusGained(source);
-       }
-
-       return true;
-}
-
-result
-_Toolbar::OnHeaderFocusGained(const _Control& source)
-{
-       if (__itemCount == 0)
-       {
-               if (__pButtonItems[MENU_BUTTON] || __pButtonItems[LEFT_BUTTON])
-               {
-                       if (__pButtonItems[MENU_BUTTON])
-                       {
-                               if(__pButtonItems[MENU_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                               {
-                                       __pButtonItems[MENU_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                       __pButtonItems[MENU_BUTTON]->Invalidate();
-
-                                       __highlightedItemIndex = __itemCount;
-                               }
-                               else
-                               {
-                                       if (__pButtonItems[BACK_BUTTON] || __pButtonItems[RIGHT_BUTTON])
-                                       {
-                                               if (__pButtonItems[BACK_BUTTON])
-                                               {
-                                                       if(__pButtonItems[BACK_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                       {
-                                                               __pButtonItems[BACK_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                               __pButtonItems[BACK_BUTTON]->Invalidate();
-                                                       }
-                                               }
-                                               else if (__pButtonItems[RIGHT_BUTTON])
-                                               {
-                                                       if(__pButtonItems[RIGHT_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                       {
-                                                               __pButtonItems[RIGHT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                               __pButtonItems[RIGHT_BUTTON]->Invalidate();
-                                                       }
-                                               }
-
-                                               __highlightedItemIndex = __itemCount + 1;
-                                       }
-                               }
-                       }
-                       else if (__pButtonItems[LEFT_BUTTON])
-                       {
-                               if(__pButtonItems[LEFT_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                               {
-                                       __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                       __pButtonItems[LEFT_BUTTON]->Invalidate();
-
-                                       __highlightedItemIndex = __itemCount;
-                               }
-                               else
-                               {
-                                       if (__pButtonItems[BACK_BUTTON] || __pButtonItems[RIGHT_BUTTON])
-                                       {
-                                               if (__pButtonItems[BACK_BUTTON])
-                                               {
-                                                       if(__pButtonItems[BACK_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                       {
-                                                               __pButtonItems[BACK_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                               __pButtonItems[BACK_BUTTON]->Invalidate();
-                                                       }
-                                               }
-                                               else if (__pButtonItems[RIGHT_BUTTON])
-                                               {
-                                                       if(__pButtonItems[RIGHT_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                       {
-                                                               __pButtonItems[RIGHT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                               __pButtonItems[RIGHT_BUTTON]->Invalidate();
-                                                       }
-                                               }
-
-                                               __highlightedItemIndex = __itemCount + 1;
-                                       }
-                               }
-                       }
-               }
-               else if (__pButtonItems[BACK_BUTTON] || __pButtonItems[RIGHT_BUTTON])
-               {
-                       if (__pButtonItems[BACK_BUTTON])
-                       {
-                               if(__pButtonItems[BACK_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                               {
-                                       __pButtonItems[BACK_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                       __pButtonItems[BACK_BUTTON]->Invalidate();
-
-                                       __highlightedItemIndex = __itemCount;
-                               }
-                       }
-                       else if (__pButtonItems[RIGHT_BUTTON])
-                       {
-                               if(__pButtonItems[RIGHT_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                               {
-                                       __pButtonItems[RIGHT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                       __pButtonItems[RIGHT_BUTTON]->Invalidate();
-
-                                       __highlightedItemIndex = __itemCount;
-                               }
-                       }
-               }
-       }
-       else // itemCount != 0
-       {
-               if (__style == TOOLBAR_HEADER_SEGMENTED || __style ==TOOLBAR_HEADER_SEGMENTED_WITH_TITLE || __style == TOOLBAR_SEGMENTED
-                               || __style == TOOLBAR_TAB || __style == TOOLBAR_TAB_WITH_TITLE)
-               {
-                       __highlightedItemIndex = GetSelectedItemIndex();
-               }
-               else // not segmented
-               {
-                       __highlightedItemIndex = 0;
-               }
-
-               if (__pItems.at(__highlightedItemIndex))
-               {
-                       __pItems.at(__highlightedItemIndex)->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                       __pItems.at(__highlightedItemIndex)->Invalidate();
-               }
-       }
-
-       return E_SUCCESS;
-}
-
-result
-_Toolbar::OnFooterFocusGained(const _Control& source)
-{
-       __highlightedItemIndex = 0;
-
        if (__itemCount == 0)
        {
-               if (__pButtonItems[MENU_BUTTON] || __pButtonItems[LEFT_BUTTON])
+               if (__pButtonItems[LEFT_BUTTON])
                {
-                       if (__pButtonItems[MENU_BUTTON])
-                       {
-                               if(__pButtonItems[MENU_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                               {
-                                       __pButtonItems[MENU_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                       __pButtonItems[MENU_BUTTON]->Invalidate();
-
-                                       __highlightedItemIndex = __itemCount;
-                               }
-                               else
-                               {
-                                       if (__pButtonItems[BACK_BUTTON] || __pButtonItems[RIGHT_BUTTON])
-                                       {
-                                               if (__pButtonItems[BACK_BUTTON])
-                                               {
-                                                       if(__pButtonItems[BACK_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                       {
-                                                               __pButtonItems[BACK_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                               __pButtonItems[BACK_BUTTON]->Invalidate();
-                                                       }
-                                               }
-                                               else if (__pButtonItems[RIGHT_BUTTON])
-                                               {
-                                                       if(__pButtonItems[RIGHT_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                       {
-                                                               __pButtonItems[RIGHT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                               __pButtonItems[RIGHT_BUTTON]->Invalidate();
-                                                       }
-                                               }
-
-                                               __highlightedItemIndex = __itemCount + 1;
-                                       }
-                               }
-                       }
-                       else if (__pButtonItems[LEFT_BUTTON])
+                       if (__pButtonItems[RIGHT_BUTTON] || __pButtonItems[BACK_BUTTON])
                        {
-                               if(__pButtonItems[LEFT_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
+                               if (__highlightedItemIndex == __itemCount && __pButtonItems[LEFT_BUTTON])
+                               {
+                                       __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
+                                       __pButtonItems[LEFT_BUTTON]->Invalidate();
+                               }
+                               else if (__highlightedItemIndex == __itemCount + 1 && __pButtonItems[BACK_BUTTON])
+                               {
+                                       __pButtonItems[BACK_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
+                                       __pButtonItems[BACK_BUTTON]->Invalidate();
+                               }
+                               else if (__highlightedItemIndex == __itemCount + 1 && __pButtonItems[RIGHT_BUTTON])
+                               {
+                                       __pButtonItems[RIGHT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
+                                       __pButtonItems[RIGHT_BUTTON]->Invalidate();
+                               }
+                       }
+                       else
+                       {
+                               if (__highlightedItemIndex == __itemCount && __pButtonItems[LEFT_BUTTON])
                                {
                                        __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
                                        __pButtonItems[LEFT_BUTTON]->Invalidate();
-
-                                       __highlightedItemIndex = __itemCount;
-                               }
-                               else
-                               {
-                                       if (__pButtonItems[BACK_BUTTON] || __pButtonItems[RIGHT_BUTTON])
-                                       {
-                                               if (__pButtonItems[BACK_BUTTON])
-                                               {
-                                                       if(__pButtonItems[BACK_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                       {
-                                                               __pButtonItems[BACK_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                               __pButtonItems[BACK_BUTTON]->Invalidate();
-                                                       }
-                                               }
-                                               else if (__pButtonItems[RIGHT_BUTTON])
-                                               {
-                                                       if(__pButtonItems[RIGHT_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                       {
-                                                               __pButtonItems[RIGHT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                               __pButtonItems[RIGHT_BUTTON]->Invalidate();
-                                                       }
-                                               }
-
-                                               __highlightedItemIndex = __itemCount + 1;
-                                       }
-                               }
-                       }
-               }
-               else if (__pButtonItems[BACK_BUTTON] || __pButtonItems[RIGHT_BUTTON])
-               {
-                       if (__pButtonItems[BACK_BUTTON])
-                       {
-                               if(__pButtonItems[BACK_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                               {
-                                       __pButtonItems[BACK_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                       __pButtonItems[BACK_BUTTON]->Invalidate();
-
-                                       __highlightedItemIndex = __itemCount;
-                               }
-                       }
-                       else if (__pButtonItems[RIGHT_BUTTON])
-                       {
-                               if(__pButtonItems[RIGHT_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                               {
-                                       __pButtonItems[RIGHT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                       __pButtonItems[RIGHT_BUTTON]->Invalidate();
-
-                                       __highlightedItemIndex = __itemCount;
-                               }
-                       }
-               }
-       }
-       else // itemCount != 0
-       {
-               if (__style == TOOLBAR_HEADER_SEGMENTED || __style ==TOOLBAR_HEADER_SEGMENTED_WITH_TITLE || __style == TOOLBAR_SEGMENTED
-                               || __style == TOOLBAR_TAB || __style == TOOLBAR_TAB_WITH_TITLE)
-               {
-                       __highlightedItemIndex = GetSelectedItemIndex();
-
-                       if (__pItems.at(__highlightedItemIndex))
-                       {
-                               __pItems.at(__highlightedItemIndex)->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                               __pItems.at(__highlightedItemIndex)->Invalidate();
-                       }
-               }
-               else // not segmented
-               {
-                       if (__pButtonItems[MENU_BUTTON] || __pButtonItems[LEFT_BUTTON])
-                       {
-                               if (__pButtonItems[MENU_BUTTON])
-                               {
-                                       if(__pButtonItems[MENU_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                       {
-                                               __pButtonItems[MENU_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                               __pButtonItems[MENU_BUTTON]->Invalidate();
-
-                                               __highlightedItemIndex = __itemCount;
-                                       }
-                                       else
-                                       {
-                                               if (__pItems.at(__highlightedItemIndex))
-                                               {
-                                                       if (__pItems.at(__highlightedItemIndex)->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                       {
-                                                               __pItems.at(__highlightedItemIndex)->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                               __pItems.at(__highlightedItemIndex)->Invalidate();
-                                                       }
-                                                       else
-                                                       {
-                                                               for (__highlightedItemIndex = 0; __highlightedItemIndex < __itemCount; __highlightedItemIndex++)
-                                                               {
-                                                                       if (__pItems.at(__highlightedItemIndex)->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                                       {
-                                                                               __pItems.at(__highlightedItemIndex)->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                                               __pItems.at(__highlightedItemIndex)->Invalidate();
-
-                                                                               break;
-                                                                       }
-                                                               }
-
-                                                               if (__highlightedItemIndex == __itemCount)
-                                                               {
-                                                                       if (__pButtonItems[BACK_BUTTON])
-                                                                       {
-                                                                               if(__pButtonItems[BACK_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                                               {
-                                                                                       __pButtonItems[BACK_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                                                       __pButtonItems[BACK_BUTTON]->Invalidate();
-
-                                                                                       __highlightedItemIndex = __itemCount + 1;
-                                                                               }
-                                                                       }
-                                                                       else if (__pButtonItems[RIGHT_BUTTON])
-                                                                       {
-                                                                               if(__pButtonItems[RIGHT_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                                               {
-                                                                                       __pButtonItems[RIGHT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                                                       __pButtonItems[RIGHT_BUTTON]->Invalidate();
-
-                                                                                       __highlightedItemIndex = __itemCount + 1;
-                                                                               }
-                                                                       }
-                                                               }
-                                                       }
-                                               }
-                                       }
-                               }
-                               else if (__pButtonItems[LEFT_BUTTON])
-                               {
-                                       if(__pButtonItems[LEFT_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                       {
-                                               __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                               __pButtonItems[LEFT_BUTTON]->Invalidate();
-
-                                               __highlightedItemIndex = __itemCount;
-                                       }
-                                       else
-                                       {
-                                               if (__pItems.at(__highlightedItemIndex))
-                                               {
-                                                       if (__pItems.at(__highlightedItemIndex)->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                       {
-                                                               __pItems.at(__highlightedItemIndex)->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                               __pItems.at(__highlightedItemIndex)->Invalidate();
-                                                       }
-                                                       else
-                                                       {
-                                                               for (__highlightedItemIndex = 0; __highlightedItemIndex < __itemCount; __highlightedItemIndex++)
-                                                               {
-                                                                       if (__pItems.at(__highlightedItemIndex)->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                                       {
-                                                                               __pItems.at(__highlightedItemIndex)->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                                               __pItems.at(__highlightedItemIndex)->Invalidate();
-
-                                                                               break;
-                                                                       }
-                                                               }
-
-                                                               if (__highlightedItemIndex == __itemCount)
-                                                               {
-                                                                       if (__pButtonItems[BACK_BUTTON])
-                                                                       {
-                                                                               if(__pButtonItems[BACK_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                                               {
-                                                                                       __pButtonItems[BACK_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                                                       __pButtonItems[BACK_BUTTON]->Invalidate();
-
-                                                                                       __highlightedItemIndex = __itemCount + 1;
-                                                                               }
-                                                                       }
-                                                                       else if (__pButtonItems[RIGHT_BUTTON])
-                                                                       {
-                                                                               if(__pButtonItems[RIGHT_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                                               {
-                                                                                       __pButtonItems[RIGHT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                                                       __pButtonItems[RIGHT_BUTTON]->Invalidate();
-
-                                                                                       __highlightedItemIndex = __itemCount + 1;
-                                                                               }
-                                                                       }
-                                                               }
-                                                       }
-                                               }
-                                       }
-                               }
-                       }
-                       else
-                       {
-                               if (__pItems.at(__highlightedItemIndex))
-                               {
-                                       if (__pItems.at(__highlightedItemIndex)->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                       {
-                                               __pItems.at(__highlightedItemIndex)->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                               __pItems.at(__highlightedItemIndex)->Invalidate();
-                                       }
-                                       else
-                                       {
-                                               for (__highlightedItemIndex = 0; __highlightedItemIndex < __itemCount; __highlightedItemIndex++)
-                                               {
-                                                       if (__pItems.at(__highlightedItemIndex)->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                       {
-                                                               __pItems.at(__highlightedItemIndex)->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                               __pItems.at(__highlightedItemIndex)->Invalidate();
-
-                                                               break;
-                                                       }
-                                               }
-
-                                               if (__highlightedItemIndex == __itemCount)
-                                               {
-                                                       if (__pButtonItems[BACK_BUTTON])
-                                                       {
-                                                               if(__pButtonItems[BACK_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                               {
-                                                                       __pButtonItems[BACK_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                                       __pButtonItems[BACK_BUTTON]->Invalidate();
-
-                                                                       __highlightedItemIndex = __itemCount;
-                                                               }
-                                                       }
-                                                       else if (__pButtonItems[RIGHT_BUTTON])
-                                                       {
-                                                               if(__pButtonItems[RIGHT_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                               {
-                                                                       __pButtonItems[RIGHT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                                       __pButtonItems[RIGHT_BUTTON]->Invalidate();
-
-                                                                       __highlightedItemIndex = __itemCount;
-                                                               }
-                                                       }
-                                               }
-                                       }
-                               }
-                       }
-               }
-       }
-
-       return E_SUCCESS;
-}
-
-#if 0
-result
-_Toolbar::OnHeaderFocusGained(const _Control& source)
-{
-       if (__itemCount == 0)
-       {
-               if (__pButtonItems[LEFT_BUTTON] || __pButtonItems[MENU_BUTTON])
-               {
-                       if (__pButtonItems[RIGHT_BUTTON] || __pButtonItems[BACK_BUTTON])
-                       {
-                               if (__highlightedItemIndex == __itemCount)
-                               {
-                                       if (__pButtonItems[MENU_BUTTON])
-                                       {
-                                               if (__style == TOOLBAR_HEADER_SEGMENTED || __style ==TOOLBAR_HEADER_SEGMENTED_WITH_TITLE || __style == TOOLBAR_SEGMENTED
-                                                               || __style == TOOLBAR_TAB || __style == TOOLBAR_TAB_WITH_TITLE)
-                                               {
-                                                       if (__pItems.empty() == true)
-                                                       {
-                                                               if(__pButtonItems[MENU_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                               {
-                                                                       __pButtonItems[MENU_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                                       __pButtonItems[MENU_BUTTON]->Invalidate();
-                                                               }
-                                                               else
-                                                               {
-                                                                       __highlightedItemIndex++;
-                                                                       OnFocusGained(source);
-                                                               }
-                                                       }
-                                                       else
-                                                       {
-                                                               __highlightedItemIndex = GetSelectedItemIndex();
-
-                                                               if (__pItems.at(__highlightedItemIndex))
-                                                               {
-                                                                       __pItems.at(__highlightedItemIndex)->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                                       __pItems.at(__highlightedItemIndex)->Invalidate();
-                                                               }
-                                                       }
-                                               }
-                                               else // not segmented
-                                               {
-                                                       if (__pItems.empty() == true)
-                                                       {
-                                                               if(__pButtonItems[MENU_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                               {
-                                                                       __pButtonItems[MENU_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                                       __pButtonItems[MENU_BUTTON]->Invalidate();
-                                                               }
-                                                               else
-                                                               {
-                                                                       __highlightedItemIndex++;
-                                                                       OnFocusGained(source);
-                                                               }
-                                                       }
-                                                       else
-                                                       {
-                                                               if (__pItems.at(0))
-                                                               {
-                                                                       __pItems.at(0)->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                                       __pItems.at(0)->Invalidate();
-                                                               }
-                                                       }
-                                               }
-                                       }
-                                       else if (__pButtonItems[LEFT_BUTTON])
-                                       {
-                                               if (__style == TOOLBAR_HEADER_SEGMENTED || __style ==TOOLBAR_HEADER_SEGMENTED_WITH_TITLE || __style == TOOLBAR_SEGMENTED
-                                                               || __style == TOOLBAR_TAB || __style == TOOLBAR_TAB_WITH_TITLE)
-                                               {
-                                                       if (__pItems.empty() == true)
-                                                       {
-                                                               if(__pButtonItems[LEFT_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                               {
-                                                                       __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                                       __pButtonItems[LEFT_BUTTON]->Invalidate();
-                                                               }
-                                                               else
-                                                               {
-                                                                       __highlightedItemIndex++;
-                                                                       OnFocusGained(source);
-                                                               }
-                                                       }
-                                                       else
-                                                       {
-                                                               __highlightedItemIndex = GetSelectedItemIndex();
-
-                                                               if (__pItems.at(__highlightedItemIndex))
-                                                               {
-                                                                       __pItems.at(__highlightedItemIndex)->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                                       __pItems.at(__highlightedItemIndex)->Invalidate();
-                                                               }
-                                                       }
-                                               }
-                                               else // not segmented
-                                               {
-                                                       if (__pItems.empty() == true)
-                                                       {
-                                                               if(__pButtonItems[LEFT_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                               {
-                                                                       __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                                       __pButtonItems[LEFT_BUTTON]->Invalidate();
-                                                               }
-                                                               else
-                                                               {
-                                                                       __highlightedItemIndex++;
-                                                                       OnFocusGained(source);
-                                                               }
-                                                       }
-                                                       else
-                                                       {
-                                                               if (__pItems.at(0))
-                                                               {
-                                                                       __pItems.at(0)->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                                       __pItems.at(0)->Invalidate();
-                                                               }
-                                                       }
-                                               }
-                                       }
-                               }
-                               else if (__highlightedItemIndex == __itemCount + 1)
-                               {
-                                       if (__pButtonItems[BACK_BUTTON])
-                                       {
-                                               if(__pButtonItems[BACK_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                               {
-                                                       __pButtonItems[BACK_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                       __pButtonItems[BACK_BUTTON]->Invalidate();
-                                               }
-                                               else
-                                               {
-                                                       __highlightedItemIndex++;
-                                                       OnFocusGained(source);
-                                               }
-                                       }
-                                       else if (__pButtonItems[RIGHT_BUTTON])
-                                       {
-                                               if(__pButtonItems[RIGHT_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                               {
-                                                       __pButtonItems[RIGHT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                       __pButtonItems[RIGHT_BUTTON]->Invalidate();
-                                               }
-                                               else
-                                               {
-                                                       __highlightedItemIndex++;
-                                                       OnFocusGained(source);
-                                               }
-                                       }
-                               }
-                       }
-                       else
-                       {
-                               if (__highlightedItemIndex == __itemCount)
-                               {
-                                       if (__pButtonItems[MENU_BUTTON])
-                                       {
-                                               if(__pButtonItems[MENU_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                               {
-                                                       __pButtonItems[MENU_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                       __pButtonItems[MENU_BUTTON]->Invalidate();
-                                               }
-                                               else
-                                               {
-                                                       __highlightedItemIndex++;
-                                                       OnFocusGained(source);
-                                               }
-                                       }
-                                       else if (__pButtonItems[LEFT_BUTTON])
-                                       {
-                                               if(__pButtonItems[LEFT_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                               {
-                                                       __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                       __pButtonItems[LEFT_BUTTON]->Invalidate();
-                                               }
-                                               else
-                                               {
-                                                       __highlightedItemIndex++;
-                                                       OnFocusGained(source);
-                                               }
-                                       }
-                               }
-                       }
-               }
-               else
-               {
-                       if (__pButtonItems[RIGHT_BUTTON] || __pButtonItems[BACK_BUTTON])
-                       {
-                               if (__highlightedItemIndex == __itemCount)
-                               {
-                                       if (__pButtonItems[BACK_BUTTON])
-                                       {
-                                               if(__pButtonItems[BACK_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                               {
-                                                       __pButtonItems[BACK_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                       __pButtonItems[BACK_BUTTON]->Invalidate();
-                                               }
-                                               else
-                                               {
-                                                       __highlightedItemIndex++;
-                                                       OnFocusGained(source);
-                                               }
-                                       }
-                                       else if (__pButtonItems[RIGHT_BUTTON])
-                                       {
-                                               if(__pButtonItems[RIGHT_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                               {
-                                                       __pButtonItems[RIGHT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                       __pButtonItems[RIGHT_BUTTON]->Invalidate();
-                                               }
-                                               else
-                                               {
-                                                       __highlightedItemIndex++;
-                                                       OnFocusGained(source);
-                                               }
-                                       }
-                               }
-                       }
-               }
-       }
-       else
-       {
-               if (__highlightedItemIndex < __itemCount)
-               {
-                       if(__pItems.at(__highlightedItemIndex))
-                       {
-                               if(__pItems.at(__highlightedItemIndex)->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                               {
-                                       __pItems.at(__highlightedItemIndex)->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                       __pItems.at(__highlightedItemIndex)->Invalidate();
-                               }
-                               else
-                               {
-                                       __highlightedItemIndex++;
-                                       OnFocusGained(source);
-                               }
-                       }
-               }
-               else
-               {
-                       if (__pButtonItems[LEFT_BUTTON] || __pButtonItems[MENU_BUTTON])
-                       {
-                               if (__pButtonItems[RIGHT_BUTTON] || __pButtonItems[BACK_BUTTON])
-                               {
-                                       if (__highlightedItemIndex == __itemCount)
-                                       {
-                                               if (__pButtonItems[MENU_BUTTON])
-                                               {
-                                                       if(__pButtonItems[MENU_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                       {
-                                                               __pButtonItems[MENU_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                               __pButtonItems[MENU_BUTTON]->Invalidate();
-                                                       }
-                                                       else
-                                                       {
-                                                               __highlightedItemIndex++;
-                                                               OnFocusGained(source);
-                                                       }
-                                               }
-                                               else if (__pButtonItems[LEFT_BUTTON])
-                                               {
-                                                       if(__pButtonItems[LEFT_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                       {
-                                                               __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                               __pButtonItems[LEFT_BUTTON]->Invalidate();
-                                                       }
-                                                       else
-                                                       {
-                                                               __highlightedItemIndex++;
-                                                               OnFocusGained(source);
-                                                       }
-                                               }
-                                       }
-                                       else if (__highlightedItemIndex == __itemCount + 1)
-                                       {
-                                               if (__pButtonItems[BACK_BUTTON])
-                                               {
-                                                       if(__pButtonItems[BACK_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                       {
-                                                               __pButtonItems[BACK_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                               __pButtonItems[BACK_BUTTON]->Invalidate();
-                                                       }
-                                                       else
-                                                       {
-                                                               __highlightedItemIndex++;
-                                                               OnFocusGained(source);
-                                                       }
-                                               }
-                                               else if (__pButtonItems[RIGHT_BUTTON])
-                                               {
-                                                       if(__pButtonItems[RIGHT_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                       {
-                                                               __pButtonItems[RIGHT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                               __pButtonItems[RIGHT_BUTTON]->Invalidate();
-                                                       }
-                                                       else
-                                                       {
-                                                               __highlightedItemIndex++;
-                                                               OnFocusGained(source);
-                                                       }
-                                               }
-                                       }
-                               }
-                               else
-                               {
-                                       if (__highlightedItemIndex == __itemCount)
-                                       {
-                                               if (__pButtonItems[MENU_BUTTON])
-                                               {
-                                                       if(__pButtonItems[MENU_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                       {
-                                                               __pButtonItems[MENU_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                               __pButtonItems[MENU_BUTTON]->Invalidate();
-                                                       }
-                                                       else
-                                                       {
-                                                               __highlightedItemIndex++;
-                                                               OnFocusGained(source);
-                                                       }
-                                               }
-                                               else if (__pButtonItems[LEFT_BUTTON])
-                                               {
-                                                       if(__pButtonItems[LEFT_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                       {
-                                                               __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                               __pButtonItems[LEFT_BUTTON]->Invalidate();
-                                                       }
-                                                       else
-                                                       {
-                                                               __highlightedItemIndex++;
-                                                               OnFocusGained(source);
-                                                       }
-                                               }
-                                       }
-                               }
-                       }
-                       else
-                       {
-                               if (__pButtonItems[RIGHT_BUTTON] || __pButtonItems[BACK_BUTTON])
-                               {
-                                       if (__highlightedItemIndex == __itemCount)
-                                       {
-                                               if (__pButtonItems[BACK_BUTTON])
-                                               {
-                                                       if(__pButtonItems[BACK_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                       {
-                                                               __pButtonItems[BACK_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                               __pButtonItems[BACK_BUTTON]->Invalidate();
-                                                       }
-                                                       else
-                                                       {
-                                                               __highlightedItemIndex++;
-                                                               OnFocusGained(source);
-                                                       }
-                                               }
-                                               else if (__pButtonItems[RIGHT_BUTTON])
-                                               {
-                                                       if(__pButtonItems[RIGHT_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                       {
-                                                               __pButtonItems[RIGHT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                               __pButtonItems[RIGHT_BUTTON]->Invalidate();
-                                                       }
-                                                       else
-                                                       {
-                                                               __highlightedItemIndex++;
-                                                               OnFocusGained(source);
-                                                       }
-                                               }
-                                       }
-                               }
-                       }
-               }
-       }
-
-       return E_SUCCESS;
-}
-
-result
-_Toolbar::OnFooterFocusGained(const _Control& source)
-{
-       if (__itemCount == 0)
-       {
-               if (__pButtonItems[LEFT_BUTTON] || __pButtonItems[MENU_BUTTON])
-               {
-                       if (__pButtonItems[RIGHT_BUTTON] || __pButtonItems[BACK_BUTTON])
-                       {
-                               if (__highlightedItemIndex == __itemCount)
-                               {
-                                       if (__pButtonItems[MENU_BUTTON])
-                                       {
-                                               if(__pButtonItems[MENU_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                               {
-                                                       __pButtonItems[MENU_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                       __pButtonItems[MENU_BUTTON]->Invalidate();
-                                               }
-                                               else
-                                               {
-                                                       __highlightedItemIndex++;
-                                                       OnFocusGained(source);
-                                               }
-                                       }
-                                       else if (__pButtonItems[LEFT_BUTTON])
-                                       {
-                                               if(__pButtonItems[LEFT_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                               {
-                                                       __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                       __pButtonItems[LEFT_BUTTON]->Invalidate();
-                                               }
-                                               else
-                                               {
-                                                       __highlightedItemIndex++;
-                                                       OnFocusGained(source);
-                                               }
-                                       }
-                               }
-                               else if (__highlightedItemIndex == __itemCount + 1)
-                               {
-                                       if (__pButtonItems[BACK_BUTTON])
-                                       {
-                                               if(__pButtonItems[BACK_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                               {
-                                                       __pButtonItems[BACK_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                       __pButtonItems[BACK_BUTTON]->Invalidate();
-                                               }
-                                               else
-                                               {
-                                                       __highlightedItemIndex++;
-                                                       OnFocusGained(source);
-                                               }
-                                       }
-                                       else if (__pButtonItems[RIGHT_BUTTON])
-                                       {
-                                               if(__pButtonItems[RIGHT_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                               {
-                                                       __pButtonItems[RIGHT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                       __pButtonItems[RIGHT_BUTTON]->Invalidate();
-                                               }
-                                               else
-                                               {
-                                                       __highlightedItemIndex++;
-                                                       OnFocusGained(source);
-                                               }
-                                       }
-                               }
-                       }
-                       else
-                       {
-                               if (__highlightedItemIndex == __itemCount)
-                               {
-                                       if (__pButtonItems[MENU_BUTTON])
-                                       {
-                                               if(__pButtonItems[MENU_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                               {
-                                                       __pButtonItems[MENU_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                       __pButtonItems[MENU_BUTTON]->Invalidate();
-                                               }
-                                               else
-                                               {
-                                                       __highlightedItemIndex++;
-                                                       OnFocusGained(source);
-                                               }
-                                       }
-                                       else if (__pButtonItems[LEFT_BUTTON])
-                                       {
-                                               if(__pButtonItems[LEFT_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                               {
-                                                       __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                       __pButtonItems[LEFT_BUTTON]->Invalidate();
-                                               }
-                                               else
-                                               {
-                                                       __highlightedItemIndex++;
-                                                       OnFocusGained(source);
-                                               }
-                                       }
                                }
                        }
                }
@@ -4139,34 +3224,15 @@ _Toolbar::OnFooterFocusGained(const _Control& source)
                {
                        if (__pButtonItems[RIGHT_BUTTON] || __pButtonItems[BACK_BUTTON])
                        {
-                               if (__highlightedItemIndex == __itemCount)
+                               if (__highlightedItemIndex == __itemCount && __pButtonItems[BACK_BUTTON])
                                {
-                                       if (__pButtonItems[BACK_BUTTON])
-                                       {
-                                               if(__pButtonItems[BACK_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                               {
-                                                       __pButtonItems[BACK_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                       __pButtonItems[BACK_BUTTON]->Invalidate();
-                                               }
-                                               else
-                                               {
-                                                       __highlightedItemIndex++;
-                                                       OnFocusGained(source);
-                                               }
-                                       }
-                                       else if (__pButtonItems[RIGHT_BUTTON])
-                                       {
-                                               if(__pButtonItems[RIGHT_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                               {
-                                                       __pButtonItems[RIGHT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                       __pButtonItems[RIGHT_BUTTON]->Invalidate();
-                                               }
-                                               else
-                                               {
-                                                       __highlightedItemIndex++;
-                                                       OnFocusGained(source);
-                                               }
-                                       }
+                                       __pButtonItems[BACK_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
+                                       __pButtonItems[BACK_BUTTON]->Invalidate();
+                               }
+                               else if (__highlightedItemIndex == __itemCount && __pButtonItems[RIGHT_BUTTON])
+                               {
+                                       __pButtonItems[RIGHT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
+                                       __pButtonItems[RIGHT_BUTTON]->Invalidate();
                                }
                        }
                }
@@ -4177,113 +3243,38 @@ _Toolbar::OnFooterFocusGained(const _Control& source)
                {
                        if(__pItems.at(__highlightedItemIndex))
                        {
-                               if(__pItems.at(__highlightedItemIndex)->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                               {
-                                       __pItems.at(__highlightedItemIndex)->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                       __pItems.at(__highlightedItemIndex)->Invalidate();
-                               }
-                               else
-                               {
-                                       __highlightedItemIndex++;
-                                       OnFocusGained(source);
-                               }
+                               __pItems.at(__highlightedItemIndex)->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
+                               __pItems.at(__highlightedItemIndex)->Invalidate();
                        }
                }
                else
                {
-                       if (__pButtonItems[LEFT_BUTTON] || __pButtonItems[MENU_BUTTON])
+                       if (__pButtonItems[LEFT_BUTTON])
                        {
                                if (__pButtonItems[RIGHT_BUTTON] || __pButtonItems[BACK_BUTTON])
                                {
-                                       if (__highlightedItemIndex == __itemCount)
+                                       if (__highlightedItemIndex == __itemCount && __pButtonItems[LEFT_BUTTON])
                                        {
-                                               if (__pButtonItems[MENU_BUTTON])
-                                               {
-                                                       if(__pButtonItems[MENU_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                       {
-                                                               __pButtonItems[MENU_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                               __pButtonItems[MENU_BUTTON]->Invalidate();
-                                                       }
-                                                       else
-                                                       {
-                                                               __highlightedItemIndex++;
-                                                               OnFocusGained(source);
-                                                       }
-                                               }
-                                               else if (__pButtonItems[LEFT_BUTTON])
-                                               {
-                                                       if(__pButtonItems[LEFT_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                       {
-                                                               __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                               __pButtonItems[LEFT_BUTTON]->Invalidate();
-                                                       }
-                                                       else
-                                                       {
-                                                               __highlightedItemIndex++;
-                                                               OnFocusGained(source);
-                                                       }
-                                               }
+                                               __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
+                                               __pButtonItems[LEFT_BUTTON]->Invalidate();
                                        }
-                                       else if (__highlightedItemIndex == __itemCount + 1)
+                                       else if (__highlightedItemIndex == __itemCount + 1 && __pButtonItems[BACK_BUTTON])
                                        {
-                                               if (__pButtonItems[BACK_BUTTON])
-                                               {
-                                                       if(__pButtonItems[BACK_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                       {
-                                                               __pButtonItems[BACK_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                               __pButtonItems[BACK_BUTTON]->Invalidate();
-                                                       }
-                                                       else
-                                                       {
-                                                               __highlightedItemIndex++;
-                                                               OnFocusGained(source);
-                                                       }
-                                               }
-                                               else if (__pButtonItems[RIGHT_BUTTON])
-                                               {
-                                                       if(__pButtonItems[RIGHT_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                       {
-                                                               __pButtonItems[RIGHT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                               __pButtonItems[RIGHT_BUTTON]->Invalidate();
-                                                       }
-                                                       else
-                                                       {
-                                                               __highlightedItemIndex++;
-                                                               OnFocusGained(source);
-                                                       }
-                                               }
+                                               __pButtonItems[BACK_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
+                                               __pButtonItems[BACK_BUTTON]->Invalidate();
+                                       }
+                                       else if (__highlightedItemIndex == __itemCount + 1 && __pButtonItems[RIGHT_BUTTON])
+                                       {
+                                               __pButtonItems[RIGHT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
+                                               __pButtonItems[RIGHT_BUTTON]->Invalidate();
                                        }
                                }
                                else
                                {
-                                       if (__highlightedItemIndex == __itemCount)
+                                       if (__highlightedItemIndex == __itemCount && __pButtonItems[LEFT_BUTTON])
                                        {
-                                               if (__pButtonItems[MENU_BUTTON])
-                                               {
-                                                       if(__pButtonItems[MENU_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                       {
-                                                               __pButtonItems[MENU_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                               __pButtonItems[MENU_BUTTON]->Invalidate();
-                                                       }
-                                                       else
-                                                       {
-                                                               __highlightedItemIndex++;
-                                                               OnFocusGained(source);
-                                                       }
-                                               }
-                                               else if (__pButtonItems[LEFT_BUTTON])
-                                               {
-                                                       if(__pButtonItems[LEFT_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                       {
-                                                               __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                               __pButtonItems[LEFT_BUTTON]->Invalidate();
-                                                       }
-                                                       else
-                                                       {
-                                                               __highlightedItemIndex++;
-                                                               OnFocusGained(source);
-                                                       }
-                                               }
+                                               __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
+                                               __pButtonItems[LEFT_BUTTON]->Invalidate();
                                        }
                                }
                        }
@@ -4291,95 +3282,55 @@ _Toolbar::OnFooterFocusGained(const _Control& source)
                        {
                                if (__pButtonItems[RIGHT_BUTTON] || __pButtonItems[BACK_BUTTON])
                                {
-                                       if (__highlightedItemIndex == __itemCount)
+                                       if (__highlightedItemIndex == __itemCount && __pButtonItems[BACK_BUTTON])
                                        {
-                                               if (__pButtonItems[BACK_BUTTON])
-                                               {
-                                                       if(__pButtonItems[BACK_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                       {
-                                                               __pButtonItems[BACK_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                               __pButtonItems[BACK_BUTTON]->Invalidate();
-                                                       }
-                                                       else
-                                                       {
-                                                               __highlightedItemIndex++;
-                                                               OnFocusGained(source);
-                                                       }
-                                               }
-                                               else if (__pButtonItems[RIGHT_BUTTON])
-                                               {
-                                                       if(__pButtonItems[RIGHT_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                       {
-                                                               __pButtonItems[RIGHT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                               __pButtonItems[RIGHT_BUTTON]->Invalidate();
-                                                       }
-                                                       else
-                                                       {
-                                                               __highlightedItemIndex++;
-                                                               OnFocusGained(source);
-                                                       }
-                                               }
+                                               __pButtonItems[BACK_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
+                                               __pButtonItems[BACK_BUTTON]->Invalidate();
+                                       }
+                                       else if (__highlightedItemIndex == __itemCount && __pButtonItems[RIGHT_BUTTON])
+                                       {
+                                               __pButtonItems[RIGHT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
+                                               __pButtonItems[RIGHT_BUTTON]->Invalidate();
                                        }
                                }
                        }
                }
        }
 
-       return E_SUCCESS;
+       return true;
 }
 
-#endif
-
 bool
 _Toolbar::OnFocusLost(const _Control& source)
 {
        if (__itemCount == 0)
        {
-               if (__pButtonItems[LEFT_BUTTON] || __pButtonItems[MENU_BUTTON])
+               if (__pButtonItems[LEFT_BUTTON])
                {
                        if (__pButtonItems[RIGHT_BUTTON] || __pButtonItems[BACK_BUTTON])
                        {
-                               if (__highlightedItemIndex == __itemCount)
+                               if (__highlightedItemIndex == __itemCount && __pButtonItems[LEFT_BUTTON])
                                {
-                                       if (__pButtonItems[MENU_BUTTON])
-                                       {
-                                               __pButtonItems[MENU_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
-                                               __pButtonItems[MENU_BUTTON]->Invalidate();
-                                       }
-                                       else if (__pButtonItems[LEFT_BUTTON])
-                                       {
-                                               __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
-                                               __pButtonItems[LEFT_BUTTON]->Invalidate();
-                                       }
+                                       __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
+                                       __pButtonItems[LEFT_BUTTON]->Invalidate();
                                }
-                               else if (__highlightedItemIndex == __itemCount + 1)
+                               else if (__highlightedItemIndex == __itemCount + 1 && __pButtonItems[BACK_BUTTON])
                                {
-                                       if (__pButtonItems[BACK_BUTTON])
-                                       {
-                                               __pButtonItems[BACK_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
-                                               __pButtonItems[BACK_BUTTON]->Invalidate();
-                                       }
-                                       else if (__pButtonItems[RIGHT_BUTTON])
-                                       {
-                                               __pButtonItems[RIGHT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
-                                               __pButtonItems[RIGHT_BUTTON]->Invalidate();
-                                       }
+                                       __pButtonItems[BACK_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
+                                       __pButtonItems[BACK_BUTTON]->Invalidate();
+                               }
+                               else if (__highlightedItemIndex == __itemCount + 1 && __pButtonItems[RIGHT_BUTTON])
+                               {
+                                       __pButtonItems[RIGHT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
+                                       __pButtonItems[RIGHT_BUTTON]->Invalidate();
                                }
                        }
                        else
                        {
-                               if (__highlightedItemIndex == __itemCount)
+                               if (__highlightedItemIndex == __itemCount && __pButtonItems[LEFT_BUTTON])
                                {
-                                       if (__pButtonItems[MENU_BUTTON])
-                                       {
-                                               __pButtonItems[MENU_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
-                                               __pButtonItems[MENU_BUTTON]->Invalidate();
-                                       }
-                                       else if (__pButtonItems[LEFT_BUTTON])
-                                       {
-                                               __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
-                                               __pButtonItems[LEFT_BUTTON]->Invalidate();
-                                       }
+                                       __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
+                                       __pButtonItems[LEFT_BUTTON]->Invalidate();
                                }
                        }
                }
@@ -4387,18 +3338,15 @@ _Toolbar::OnFocusLost(const _Control& source)
                {
                        if (__pButtonItems[RIGHT_BUTTON] || __pButtonItems[BACK_BUTTON])
                        {
-                               if (__highlightedItemIndex == __itemCount)
+                               if (__highlightedItemIndex == __itemCount && __pButtonItems[BACK_BUTTON])
                                {
-                                       if (__pButtonItems[BACK_BUTTON])
-                                       {
-                                               __pButtonItems[BACK_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
-                                               __pButtonItems[BACK_BUTTON]->Invalidate();
-                                       }
-                                       else if (__pButtonItems[RIGHT_BUTTON])
-                                       {
-                                               __pButtonItems[RIGHT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
-                                               __pButtonItems[RIGHT_BUTTON]->Invalidate();
-                                       }
+                                       __pButtonItems[BACK_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
+                                       __pButtonItems[BACK_BUTTON]->Invalidate();
+                               }
+                               else if (__highlightedItemIndex == __itemCount && __pButtonItems[RIGHT_BUTTON])
+                               {
+                                       __pButtonItems[RIGHT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
+                                       __pButtonItems[RIGHT_BUTTON]->Invalidate();
                                }
                        }
                }
@@ -4415,51 +3363,32 @@ _Toolbar::OnFocusLost(const _Control& source)
                }
                else
                {
-                       if (__pButtonItems[LEFT_BUTTON] || __pButtonItems[MENU_BUTTON])
+                       if (__pButtonItems[LEFT_BUTTON])
                        {
                                if (__pButtonItems[RIGHT_BUTTON] || __pButtonItems[BACK_BUTTON])
                                {
-                                       if (__highlightedItemIndex == __itemCount)
+                                       if (__highlightedItemIndex == __itemCount && __pButtonItems[LEFT_BUTTON])
                                        {
-                                               if (__pButtonItems[MENU_BUTTON])
-                                               {
-                                                       __pButtonItems[MENU_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
-                                                       __pButtonItems[MENU_BUTTON]->Invalidate();
-                                               }
-                                               else if (__pButtonItems[LEFT_BUTTON])
-                                               {
-                                                       __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
-                                                       __pButtonItems[LEFT_BUTTON]->Invalidate();
-                                               }
+                                               __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
+                                               __pButtonItems[LEFT_BUTTON]->Invalidate();
                                        }
-                                       else if (__highlightedItemIndex == __itemCount + 1)
+                                       else if (__highlightedItemIndex == __itemCount + 1 && __pButtonItems[BACK_BUTTON])
                                        {
-                                               if (__pButtonItems[BACK_BUTTON])
-                                               {
-                                                       __pButtonItems[BACK_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
-                                                       __pButtonItems[BACK_BUTTON]->Invalidate();
-                                               }
-                                               else if (__pButtonItems[RIGHT_BUTTON])
-                                               {
-                                                       __pButtonItems[RIGHT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
-                                                       __pButtonItems[RIGHT_BUTTON]->Invalidate();
-                                               }
+                                               __pButtonItems[BACK_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
+                                               __pButtonItems[BACK_BUTTON]->Invalidate();
+                                       }
+                                       else if (__highlightedItemIndex == __itemCount + 1 && __pButtonItems[RIGHT_BUTTON])
+                                       {
+                                               __pButtonItems[RIGHT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
+                                               __pButtonItems[RIGHT_BUTTON]->Invalidate();
                                        }
                                }
                                else
                                {
-                                       if (__highlightedItemIndex == __itemCount)
+                                       if (__highlightedItemIndex == __itemCount && __pButtonItems[LEFT_BUTTON])
                                        {
-                                               if (__pButtonItems[MENU_BUTTON])
-                                               {
-                                                       __pButtonItems[MENU_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
-                                                       __pButtonItems[MENU_BUTTON]->Invalidate();
-                                               }
-                                               else if (__pButtonItems[LEFT_BUTTON])
-                                               {
-                                                       __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
-                                                       __pButtonItems[LEFT_BUTTON]->Invalidate();
-                                               }
+                                               __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
+                                               __pButtonItems[LEFT_BUTTON]->Invalidate();
                                        }
                                }
                        }
@@ -4467,18 +3396,15 @@ _Toolbar::OnFocusLost(const _Control& source)
                        {
                                if (__pButtonItems[RIGHT_BUTTON] || __pButtonItems[BACK_BUTTON])
                                {
-                                       if (__highlightedItemIndex == __itemCount)
+                                       if (__highlightedItemIndex == __itemCount && __pButtonItems[BACK_BUTTON])
                                        {
-                                               if (__pButtonItems[BACK_BUTTON])
-                                               {
-                                                       __pButtonItems[BACK_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
-                                                       __pButtonItems[BACK_BUTTON]->Invalidate();
-                                               }
-                                               else if (__pButtonItems[RIGHT_BUTTON])
-                                               {
-                                                       __pButtonItems[RIGHT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
-                                                       __pButtonItems[RIGHT_BUTTON]->Invalidate();
-                                               }
+                                               __pButtonItems[BACK_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
+                                               __pButtonItems[BACK_BUTTON]->Invalidate();
+                                       }
+                                       else if (__highlightedItemIndex == __itemCount && __pButtonItems[RIGHT_BUTTON])
+                                       {
+                                               __pButtonItems[RIGHT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
+                                               __pButtonItems[RIGHT_BUTTON]->Invalidate();
                                        }
                                }
                        }
@@ -4509,64 +3435,48 @@ _Toolbar::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
                {
                        if (__itemCount != 0)
                        {
-                               if (__highlightedItemIndex < (__itemCount - 1)) // 0,1
+                               if (__highlightedItemIndex < (__itemCount - 1))
                                {
                                        if (__pItems.at(__highlightedItemIndex) != null)
                                        {
                                                if (__highlightedItemIndex == selectedItemIndex)
                                                {
-                                                       if (__pItems.at(__highlightedItemIndex)->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                       {
-                                                               __pItems.at(__highlightedItemIndex)->SetButtonStatus(_BUTTON_STATUS_SELECTED, false);
-                                                               __pItems.at(__highlightedItemIndex)->Invalidate();
-                                                       }
+                                                       __pItems.at(__highlightedItemIndex)->SetButtonStatus(_BUTTON_STATUS_SELECTED, false);
+                                                       __pItems.at(__highlightedItemIndex)->Invalidate();
                                                }
                                                else
                                                {
-                                                       if (__pItems.at(__highlightedItemIndex)->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                       {
-                                                               __pItems.at(__highlightedItemIndex)->SetButtonStatus(_BUTTON_STATUS_NORMAL);
-                                                               __pItems.at(__highlightedItemIndex)->Invalidate();
-                                                       }
+                                                       __pItems.at(__highlightedItemIndex)->SetButtonStatus(_BUTTON_STATUS_NORMAL);
+                                                       __pItems.at(__highlightedItemIndex)->Invalidate();
                                                }
 
                                                __highlightedItemIndex++;
 
-                                               if (__pItems.at(__highlightedItemIndex)->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                               {
-                                                       __pItems.at(__highlightedItemIndex)->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                       __pItems.at(__highlightedItemIndex)->Invalidate();
-
-                                                       if (__highlightedItemIndex - __pToolbarPresenter->GetFirstLoadedItemIndex() == SEGMENTED_ITEM_MAX)
-                                                       {
-                                                               __pToolbarPresenter->SetItemFit(__highlightedItemIndex - (SEGMENTED_ITEM_MAX - 1));
-                                                       }
-                                               }
-                                               else
+                                               __pItems.at(__highlightedItemIndex)->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
+                                               __pItems.at(__highlightedItemIndex)->Invalidate();
+
+                                               if (__highlightedItemIndex - __pToolbarPresenter->GetFirstLoadedItemIndex() == SEGMENTED_ITEM_MAX)
                                                {
-                                                       OnKeyReleased(source, keyInfo);
+                                                       __pToolbarPresenter->SetItemFit(__highlightedItemIndex - (SEGMENTED_ITEM_MAX - 1));
                                                }
                                        }
                                }
-                               else // 2, L, R, B,
+                               else
                                {
-                                       if (__pButtonItems[LEFT_BUTTON] || __pButtonItems[RIGHT_BUTTON] || __pButtonItems[BACK_BUTTON])
+                                       if (__pButtonItems[LEFT_BUTTON] || __pButtonItems[RIGHT_BUTTON])
                                        {
-                                               if (__highlightedItemIndex == __itemCount - 1)
+                                               if (__highlightedItemIndex < __itemCount)
                                                {
                                                        if (__pItems.at(__highlightedItemIndex) != null)
                                                        {
                                                                if (__highlightedItemIndex == selectedItemIndex)
                                                                {
-                                                                       if (__pItems.at(__highlightedItemIndex)->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                                       {
-                                                                               __pItems.at(__highlightedItemIndex)->SetButtonStatus(_BUTTON_STATUS_SELECTED, false);
-                                                                               __pItems.at(__highlightedItemIndex)->Invalidate();
-                                                                       }
+                                                                       __pItems.at(__highlightedItemIndex)->SetButtonStatus(_BUTTON_STATUS_SELECTED, false);
+                                                                       __pItems.at(__highlightedItemIndex)->Invalidate();
                                                                }
                                                                else
                                                                {
-                                                                       if (__pItems.at(__highlightedItemIndex)->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
+                                                                       if (__highlightedItemIndex < __itemCount)
                                                                        {
                                                                                __pItems.at(__highlightedItemIndex)->SetButtonStatus(_BUTTON_STATUS_NORMAL);
                                                                                __pItems.at(__highlightedItemIndex)->Invalidate();
@@ -4575,84 +3485,52 @@ _Toolbar::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
                                                        }
                                                }
                                        }
-
-                                       if (__pButtonItems[LEFT_BUTTON])
+                                       else
                                        {
-                                               if (__pButtonItems[RIGHT_BUTTON] || __pButtonItems[BACK_BUTTON])
+                                               if (__highlightedItemIndex < __itemCount - 1)
                                                {
-                                                       if (__pButtonItems[BACK_BUTTON])
+                                                       if (__pItems.at(__highlightedItemIndex) != null)
                                                        {
-                                                               if (__highlightedItemIndex == __itemCount - 1)
+                                                               if (__highlightedItemIndex == selectedItemIndex)
                                                                {
-                                                                       __highlightedItemIndex++;
-
-                                                                       if (__pButtonItems[LEFT_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                                       {
-                                                                               __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                                               __pButtonItems[LEFT_BUTTON]->Invalidate();
-                                                                       }
-                                                                       else
-                                                                       {
-                                                                               OnKeyReleased(source, keyInfo);
-                                                                       }
+                                                                       __pItems.at(__highlightedItemIndex)->SetButtonStatus(_BUTTON_STATUS_SELECTED, false);
+                                                                       __pItems.at(__highlightedItemIndex)->Invalidate();
                                                                }
-                                                               else if (__highlightedItemIndex == __itemCount)
+                                                               else
                                                                {
-                                                                       __highlightedItemIndex++;
-
-                                                                       if (__pButtonItems[LEFT_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                                       {
-                                                                               __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
-                                                                               __pButtonItems[LEFT_BUTTON]->Invalidate();
-                                                                       }
-
-                                                                       if (__pButtonItems[BACK_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
+                                                                       if (__highlightedItemIndex < __itemCount)
                                                                        {
-                                                                               __pButtonItems[BACK_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                                               __pButtonItems[BACK_BUTTON]->Invalidate();
-                                                                       }
-                                                                       else
-                                                                       {
-                                                                               OnKeyReleased(source, keyInfo);
+                                                                               __pItems.at(__highlightedItemIndex)->SetButtonStatus(_BUTTON_STATUS_NORMAL);
+                                                                               __pItems.at(__highlightedItemIndex)->Invalidate();
                                                                        }
                                                                }
-                                                       }
-                                                       else if (__pButtonItems[RIGHT_BUTTON])
-                                                       {
-                                                               if (__highlightedItemIndex == __itemCount - 1)
-                                                               {
-                                                                       __highlightedItemIndex++;
 
-                                                                       if (__pButtonItems[LEFT_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                                       {
-                                                                               __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                                               __pButtonItems[LEFT_BUTTON]->Invalidate();
-                                                                       }
-                                                                       else
-                                                                       {
-                                                                               OnKeyReleased(source, keyInfo);
-                                                                       }
-                                                               }
-                                                               else if (__highlightedItemIndex == __itemCount)
+                                                               if (__highlightedItemIndex - __pToolbarPresenter->GetFirstLoadedItemIndex() == SEGMENTED_ITEM_MAX)
                                                                {
-                                                                       __highlightedItemIndex++;
+                                                                       __pToolbarPresenter->SetItemFit(__highlightedItemIndex - (SEGMENTED_ITEM_MAX - 1));
+                                                               }
+                                                       }
+                                               }
+                                       }
 
-                                                                       if (__pButtonItems[LEFT_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                                       {
-                                                                               __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
-                                                                               __pButtonItems[LEFT_BUTTON]->Invalidate();
-                                                                       }
+                                       if (__pButtonItems[LEFT_BUTTON])
+                                       {
+                                               if (__pButtonItems[RIGHT_BUTTON])
+                                               {
+                                                       if (__highlightedItemIndex == __itemCount - 1)
+                                                       {
+                                                               __highlightedItemIndex++;
+                                                               __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
+                                                               __pButtonItems[LEFT_BUTTON]->Invalidate();
+                                                       }
+                                                       else if (__highlightedItemIndex == __itemCount)
+                                                       {
+                                                               __highlightedItemIndex++;
+                                                               __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
+                                                               __pButtonItems[LEFT_BUTTON]->Invalidate();
 
-                                                                       if (__pButtonItems[RIGHT_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                                       {
-                                                                               __pButtonItems[RIGHT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                                               __pButtonItems[RIGHT_BUTTON]->Invalidate();
-                                                                       }
-                                                                       else
-                                                                       {
-                                                                               OnKeyReleased(source, keyInfo);
-                                                                       }
-                                                               }
+                                                               __pButtonItems[RIGHT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
+                                                               __pButtonItems[RIGHT_BUTTON]->Invalidate();
                                                        }
                                                }
                                                else
@@ -4660,56 +3538,20 @@ _Toolbar::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
                                                        if (__highlightedItemIndex == __itemCount - 1)
                                                        {
                                                                __highlightedItemIndex++;
-
-                                                               if (__pButtonItems[LEFT_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                               {
-                                                                       __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                                       __pButtonItems[LEFT_BUTTON]->Invalidate();
-                                                               }
-                                                               else
-                                                               {
-                                                                       OnKeyReleased(source, keyInfo);
-                                                               }
+                                                               __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
+                                                               __pButtonItems[LEFT_BUTTON]->Invalidate();
                                                        }
                                                }
                                        }
                                        else
                                        {
-                                               if (__pButtonItems[RIGHT_BUTTON] || __pButtonItems[BACK_BUTTON])
+                                               if (__pButtonItems[RIGHT_BUTTON])
                                                {
-                                                       if (__pButtonItems[BACK_BUTTON])
-                                                       {
-                                                               if (__highlightedItemIndex == __itemCount - 1)
-                                                               {
-                                                                       __highlightedItemIndex++;
-
-                                                                       if (__pButtonItems[BACK_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                                       {
-                                                                               __pButtonItems[BACK_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                                               __pButtonItems[BACK_BUTTON]->Invalidate();
-                                                                       }
-                                                                       else
-                                                                       {
-                                                                               OnKeyReleased(source, keyInfo);
-                                                                       }
-                                                               }
-                                                       }
-                                                       else if (__pButtonItems[RIGHT_BUTTON])
+                                                       if (__highlightedItemIndex == __itemCount - 1)
                                                        {
-                                                               if (__highlightedItemIndex == __itemCount - 1)
-                                                               {
-                                                                       __highlightedItemIndex++;
-
-                                                                       if (__pButtonItems[RIGHT_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                                       {
-                                                                               __pButtonItems[RIGHT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                                               __pButtonItems[RIGHT_BUTTON]->Invalidate();
-                                                                       }
-                                                                       else
-                                                                       {
-                                                                               OnKeyReleased(source, keyInfo);
-                                                                       }
-                                                               }
+                                                               __highlightedItemIndex++;
+                                                               __pButtonItems[RIGHT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
+                                                               __pButtonItems[RIGHT_BUTTON]->Invalidate();
                                                        }
                                                }
                                        }
@@ -4719,53 +3561,16 @@ _Toolbar::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
                        {
                                if (__pButtonItems[LEFT_BUTTON])
                                {
-                                       if (__pButtonItems[RIGHT_BUTTON] || __pButtonItems[BACK_BUTTON])
+                                       if (__pButtonItems[RIGHT_BUTTON])
                                        {
-                                               if (__pButtonItems[BACK_BUTTON])
-                                               {
-                                                       if (__highlightedItemIndex == 0)
-                                                       {
-                                                               __highlightedItemIndex++;
-
-                                                               if (__pButtonItems[LEFT_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                               {
-                                                                       __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
-                                                                       __pButtonItems[LEFT_BUTTON]->Invalidate();
-                                                               }
-
-                                                               if (__pButtonItems[BACK_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                               {
-                                                                       __pButtonItems[BACK_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                                       __pButtonItems[BACK_BUTTON]->Invalidate();
-                                                               }
-                                                               else
-                                                               {
-                                                                       OnKeyReleased(source, keyInfo);
-                                                               }
-                                                       }
-                                               }
-                                               else if (__pButtonItems[RIGHT_BUTTON])
+                                               if (__highlightedItemIndex == 0)
                                                {
-                                                       if (__highlightedItemIndex == 0)
-                                                       {
-                                                               __highlightedItemIndex++;
-
-                                                               if (__pButtonItems[RIGHT_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                               {
-                                                                       __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
-                                                                       __pButtonItems[LEFT_BUTTON]->Invalidate();
-                                                               }
+                                                       __highlightedItemIndex++;
+                                                       __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
+                                                       __pButtonItems[LEFT_BUTTON]->Invalidate();
 
-                                                               if (__pButtonItems[RIGHT_BUTTON]->GetButtonStatus() != _BUTTON_STATUS_DISABLED)
-                                                               {
-                                                                       __pButtonItems[RIGHT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                                       __pButtonItems[RIGHT_BUTTON]->Invalidate();
-                                                               }
-                                                               else
-                                                               {
-                                                                       OnKeyReleased(source, keyInfo);
-                                                               }
-                                                       }
+                                                       __pButtonItems[RIGHT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
+                                                       __pButtonItems[RIGHT_BUTTON]->Invalidate();
                                                }
                                        }
                                }
@@ -4775,22 +3580,14 @@ _Toolbar::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
                {
                        if (__itemCount != 0)
                        {
-                               if (__pButtonItems[LEFT_BUTTON] || __pButtonItems[MENU_BUTTON])
+                               if (__pButtonItems[LEFT_BUTTON])
                                {
                                        if (__pButtonItems[RIGHT_BUTTON] || __pButtonItems[BACK_BUTTON]) // L Item  R
                                        {
                                                if (__highlightedItemIndex == __itemCount)
                                                {
-                                                       if (__pButtonItems[MENU_BUTTON])
-                                                       {
-                                                               __pButtonItems[MENU_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
-                                                               __pButtonItems[MENU_BUTTON]->Invalidate();
-                                                       }
-                                                       else if (__pButtonItems[LEFT_BUTTON])
-                                                       {
-                                                               __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
-                                                               __pButtonItems[LEFT_BUTTON]->Invalidate();
-                                                       }
+                                                       __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
+                                                       __pButtonItems[LEFT_BUTTON]->Invalidate();
 
                                                        __highlightedItemIndex = 0;
 
@@ -4846,16 +3643,8 @@ _Toolbar::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
                                        {
                                                if (__highlightedItemIndex == __itemCount)
                                                {
-                                                       if (__pButtonItems[MENU_BUTTON])
-                                                       {
-                                                               __pButtonItems[MENU_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
-                                                               __pButtonItems[MENU_BUTTON]->Invalidate();
-                                                       }
-                                                       else if (__pButtonItems[LEFT_BUTTON])
-                                                       {
-                                                               __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
-                                                               __pButtonItems[LEFT_BUTTON]->Invalidate();
-                                                       }
+                                                       __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
+                                                       __pButtonItems[LEFT_BUTTON]->Invalidate();
 
                                                        __highlightedItemIndex = 0;
 
@@ -4882,7 +3671,7 @@ _Toolbar::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
                                                }
                                        }
                                }
-                               else // L is null
+                               else // __pButtonItems[LEFT_BUTTON] is null
                                {
                                        if (__pButtonItems[RIGHT_BUTTON] || __pButtonItems[BACK_BUTTON]) // Item  R
                                        {
@@ -4961,24 +3750,15 @@ _Toolbar::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
                        }
                        else // __itemCount = 0
                        {
-                               if (__pButtonItems[LEFT_BUTTON] || __pButtonItems[MENU_BUTTON])
+                               if (__pButtonItems[LEFT_BUTTON])
                                {
                                        if (__pButtonItems[RIGHT_BUTTON] || __pButtonItems[BACK_BUTTON])
                                        {
                                                if (__highlightedItemIndex == 0)
                                                {
                                                        __highlightedItemIndex++;
-
-                                                       if (__pButtonItems[MENU_BUTTON])
-                                                       {
-                                                               __pButtonItems[MENU_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
-                                                               __pButtonItems[MENU_BUTTON]->Invalidate();
-                                                       }
-                                                       else if (__pButtonItems[LEFT_BUTTON])
-                                                       {
-                                                               __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
-                                                               __pButtonItems[LEFT_BUTTON]->Invalidate();
-                                                       }
+                                                       __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_NORMAL);
+                                                       __pButtonItems[LEFT_BUTTON]->Invalidate();
 
                                                        if (__pButtonItems[BACK_BUTTON])
                                                        {
@@ -5065,7 +3845,7 @@ _Toolbar::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
                {
                        if (__itemCount != 0)
                        {
-                               if (__pButtonItems[LEFT_BUTTON] || __pButtonItems[MENU_BUTTON])
+                               if (__pButtonItems[LEFT_BUTTON])
                                {
                                        if (__pButtonItems[RIGHT_BUTTON] || __pButtonItems[BACK_BUTTON]) // L  Item  R
                                        {
@@ -5084,16 +3864,8 @@ _Toolbar::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
 
                                                        __highlightedItemIndex = __itemCount;
 
-                                                       if (__pButtonItems[MENU_BUTTON])
-                                                       {
-                                                               __pButtonItems[MENU_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                               __pButtonItems[MENU_BUTTON]->Invalidate();
-                                                       }
-                                                       else if (__pButtonItems[LEFT_BUTTON])
-                                                       {
-                                                               __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                               __pButtonItems[LEFT_BUTTON]->Invalidate();
-                                                       }
+                                                       __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
+                                                       __pButtonItems[LEFT_BUTTON]->Invalidate();
                                                }
                                                else if (__highlightedItemIndex < __itemCount)
                                                {
@@ -5149,16 +3921,8 @@ _Toolbar::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
 
                                                        __highlightedItemIndex = __itemCount;
 
-                                                       if (__pButtonItems[MENU_BUTTON])
-                                                       {
-                                                               __pButtonItems[MENU_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                               __pButtonItems[MENU_BUTTON]->Invalidate();
-                                                       }
-                                                       else if (__pButtonItems[LEFT_BUTTON])
-                                                       {
-                                                               __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                               __pButtonItems[LEFT_BUTTON]->Invalidate();
-                                                       }
+                                                       __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
+                                                       __pButtonItems[LEFT_BUTTON]->Invalidate();
                                                }
                                                else if (__highlightedItemIndex < __itemCount)
                                                {
@@ -5180,7 +3944,7 @@ _Toolbar::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
                                                }
                                        }
                                }
-                               else // L is null
+                               else // __pButtonItems[LEFT_BUTTON] is null
                                {
                                        if (__pButtonItems[RIGHT_BUTTON] || __pButtonItems[BACK_BUTTON]) // Item  R
                                        {
@@ -5259,7 +4023,7 @@ _Toolbar::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
                        }
                        else // __itemCount == 0
                        {
-                               if (__pButtonItems[LEFT_BUTTON] || __pButtonItems[MENU_BUTTON])
+                               if (__pButtonItems[LEFT_BUTTON])
                                {
                                        if (__pButtonItems[RIGHT_BUTTON] || __pButtonItems[BACK_BUTTON])
                                        {
@@ -5278,16 +4042,8 @@ _Toolbar::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
 
                                                        __highlightedItemIndex--;
 
-                                                       if (__pButtonItems[MENU_BUTTON])
-                                                       {
-                                                               __pButtonItems[MENU_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                               __pButtonItems[MENU_BUTTON]->Invalidate();
-                                                       }
-                                                       else if (__pButtonItems[LEFT_BUTTON])
-                                                       {
-                                                               __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                               __pButtonItems[LEFT_BUTTON]->Invalidate();
-                                                       }
+                                                       __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
+                                                       __pButtonItems[LEFT_BUTTON]->Invalidate();
                                                }
                                        }
                                }
@@ -5299,7 +4055,7 @@ _Toolbar::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
        {
                if (__itemCount != 0)
                {
-                       if (__pButtonItems[LEFT_BUTTON] || __pButtonItems[MENU_BUTTON])
+                       if (__pButtonItems[LEFT_BUTTON])
                        {
                                if (__pButtonItems[RIGHT_BUTTON] || __pButtonItems[BACK_BUTTON]) // L  Item  R
                                {
@@ -5309,12 +4065,7 @@ _Toolbar::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
                                                                || __style == TOOLBAR_TAB || __style == TOOLBAR_TAB_WITH_TITLE)
                                                {
                                                        SetItemSelected(__highlightedItemIndex, true, false);
-
-                                                       if (__pItems.empty() == false)
-                                                       {
-                                                               __pItems.at(__highlightedItemIndex)->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                               __pItems.at(__highlightedItemIndex)->Invalidate();
-                                                       }
+                                                       //__pItems.at(__highlightedItemIndex)->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
                                                }
                                                else
                                                {
@@ -5328,23 +4079,11 @@ _Toolbar::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
                                        }
                                        else if (__highlightedItemIndex == __itemCount)
                                        {
-                                               if (__pButtonItems[MENU_BUTTON])
-                                               {
-                                                       __pButtonItems[MENU_BUTTON]->SetButtonStatus(_BUTTON_STATUS_SELECTED);
+                                               __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_SELECTED);
 
-                                                       if (__pButtonItems[MENU_BUTTON] != null)
-                                                       {
-                                                               __pButtonItems[MENU_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                       }
-                                               }
-                                               else if (__pButtonItems[LEFT_BUTTON])
+                                               if (__pButtonItems[LEFT_BUTTON] != null)
                                                {
-                                                       __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_SELECTED);
-
-                                                       if (__pButtonItems[LEFT_BUTTON] != null)
-                                                       {
-                                                               __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                       }
+                                                       __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
                                                }
                                        }
                                        else if (__highlightedItemIndex == __itemCount + 1)
@@ -5377,12 +4116,7 @@ _Toolbar::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
                                                                || __style == TOOLBAR_TAB || __style == TOOLBAR_TAB_WITH_TITLE)
                                                {
                                                        SetItemSelected(__highlightedItemIndex, true, false);
-
-                                                       if (__pItems.empty() == false)
-                                                       {
-                                                               __pItems.at(__highlightedItemIndex)->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                               __pItems.at(__highlightedItemIndex)->Invalidate();
-                                                       }
+                                                       //__pItems.at(__highlightedItemIndex)->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
                                                }
                                                else
                                                {
@@ -5396,28 +4130,16 @@ _Toolbar::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
                                        }
                                        else if (__highlightedItemIndex == __itemCount)
                                        {
-                                               if (__pButtonItems[MENU_BUTTON])
-                                               {
-                                                       __pButtonItems[MENU_BUTTON]->SetButtonStatus(_BUTTON_STATUS_SELECTED);
+                                               __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_SELECTED);
 
-                                                       if (__pButtonItems[MENU_BUTTON] != null)
-                                                       {
-                                                               __pButtonItems[MENU_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                       }
-                                               }
-                                               else if (__pButtonItems[LEFT_BUTTON])
+                                               if (__pButtonItems[LEFT_BUTTON] != null)
                                                {
-                                                       __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_SELECTED);
-
-                                                       if (__pButtonItems[LEFT_BUTTON] != null)
-                                                       {
-                                                               __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                       }
+                                                       __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
                                                }
                                        }
                                }
                        }
-                       else // L is null
+                       else // __pButtonItems[LEFT_BUTTON] is null
                        {
                                if (__pButtonItems[RIGHT_BUTTON] || __pButtonItems[BACK_BUTTON]) // Item  R
                                {
@@ -5427,27 +4149,15 @@ _Toolbar::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
                                                                || __style == TOOLBAR_TAB || __style == TOOLBAR_TAB_WITH_TITLE)
                                                {
                                                        SetItemSelected(__highlightedItemIndex, true, false);
-
-                                                       if (__pItems.empty() == false)
-                                                       {
-                                                               __pItems.at(__highlightedItemIndex)->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                               __pItems.at(__highlightedItemIndex)->Invalidate();
-                                                       }
+                                                       //__pItems.at(__highlightedItemIndex)->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
                                                }
                                                else
                                                {
-                                                       _Button* beforeButton = dynamic_cast<_Button*>(__pItems.at(__highlightedItemIndex));
-
                                                        __pItems.at(__highlightedItemIndex)->SetButtonStatus(_BUTTON_STATUS_SELECTED);
 
-                                                       if (__highlightedItemIndex < __itemCount)
+                                                       if (__pItems.empty() == false)
                                                        {
-                                                               _Button* afterButton = dynamic_cast<_Button*>(__pItems.at(__highlightedItemIndex));
-
-                                                               if (afterButton != NULL && (afterButton == beforeButton))
-                                                               {
-                                                                       __pItems.at(__highlightedItemIndex)->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                               }
+                                                               __pItems.at(__highlightedItemIndex)->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
                                                        }
                                                }
                                        }
@@ -5481,12 +4191,7 @@ _Toolbar::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
                                                                || __style == TOOLBAR_TAB || __style == TOOLBAR_TAB_WITH_TITLE)
                                                {
                                                        SetItemSelected(__highlightedItemIndex, true, false);
-
-                                                       if (__pItems.empty() == false)
-                                                       {
-                                                               __pItems.at(__highlightedItemIndex)->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                               __pItems.at(__highlightedItemIndex)->Invalidate();
-                                                       }
+                                                       //__pItems.at(__highlightedItemIndex)->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
                                                }
                                                else
                                                {
@@ -5503,29 +4208,17 @@ _Toolbar::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
                }
                else // __itemCount == 0
                {
-                       if (__pButtonItems[LEFT_BUTTON] || __pButtonItems[MENU_BUTTON])
+                       if (__pButtonItems[LEFT_BUTTON])
                        {
                                if (__pButtonItems[RIGHT_BUTTON] || __pButtonItems[BACK_BUTTON]) // L   R
                                {
                                        if (__highlightedItemIndex == 0)
                                        {
-                                               if (__pButtonItems[MENU_BUTTON])
-                                               {
-                                                       __pButtonItems[MENU_BUTTON]->SetButtonStatus(_BUTTON_STATUS_SELECTED);
+                                               __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_SELECTED);
 
-                                                       if (__pButtonItems[MENU_BUTTON] != null)
-                                                       {
-                                                               __pButtonItems[MENU_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                       }
-                                               }
-                                               else if (__pButtonItems[LEFT_BUTTON])
+                                               if (__pButtonItems[LEFT_BUTTON] != null)
                                                {
-                                                       __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_SELECTED);
-
-                                                       if (__pButtonItems[LEFT_BUTTON] != null)
-                                                       {
-                                                               __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                       }
+                                                       __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
                                                }
                                        }
                                        else if (__highlightedItemIndex == 1)
@@ -5554,28 +4247,16 @@ _Toolbar::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
                                {
                                        if (__highlightedItemIndex == 0)
                                        {
-                                               if (__pButtonItems[MENU_BUTTON])
-                                               {
-                                                       __pButtonItems[MENU_BUTTON]->SetButtonStatus(_BUTTON_STATUS_SELECTED);
+                                               __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_SELECTED);
 
-                                                       if (__pButtonItems[MENU_BUTTON] != null)
-                                                       {
-                                                               __pButtonItems[MENU_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                       }
-                                               }
-                                               else if (__pButtonItems[LEFT_BUTTON])
+                                               if (__pButtonItems[LEFT_BUTTON] != null)
                                                {
-                                                       __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_SELECTED);
-
-                                                       if (__pButtonItems[LEFT_BUTTON] != null)
-                                                       {
-                                                               __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
-                                                       }
+                                                       __pButtonItems[LEFT_BUTTON]->SetButtonStatus(_BUTTON_STATUS_HIGHLIGHTED);
                                                }
                                        }
                                }
                        }
-                       else // L is null
+                       else // __pButtonItems[LEFT_BUTTON] is null
                        {
                                if (__pButtonItems[RIGHT_BUTTON] || __pButtonItems[BACK_BUTTON]) //  R
                                {
@@ -5739,18 +4420,18 @@ _Toolbar::RemoveActionEventListener(const Controls::_IActionEventListener& liste
 {
        __pActionEventListener = null;
 
-       //for (int i = 0; i < __itemCount; i++)
-       //{
-               //__pItems.at(i)->RemoveActionEventListener(listener);
-       //}
+       for (int i = 0; i < __itemCount; i++)
+       {
+               __pItems.at(i)->RemoveActionEventListener(listener);
+       }
 
-       //for (int j = 0; j < MIDDLE_BUTTON; j++)
-       //{
-       //      if (__pButtonItems[j])
-       //      {
-       //              __pButtonItems[j]->RemoveActionEventListener(listener);
-       //      }
-       //}
+       for (int j = 0; j < MIDDLE_BUTTON; j++)
+       {
+               if (__pButtonItems[j])
+               {
+                       __pButtonItems[j]->RemoveActionEventListener(listener);
+               }
+       }
 
        return;
 
@@ -5766,10 +4447,10 @@ _Toolbar::SetBackEventListener(const Controls::_IActionEventListener& listener,
 }
 
 void
-_Toolbar::SetMenuEventListener(const Controls::_IActionEventListener& listener, int actionId)
+_Toolbar::SetOptionEventListener(const Controls::_IActionEventListener& listener, int actionId)
 {
-       __menuActionId = actionId;
-       __pMenuEventListener = const_cast<_IActionEventListener*>(&listener);
+       __optionActionId = actionId;
+       __pOptionEventListener = const_cast<_IActionEventListener*>(&listener);
 
        return;
 }
@@ -6433,7 +5114,7 @@ _Toolbar::CalculateMinimumToolbarWidth(void)
                        GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_WIDTH, GetOrientation(), itemMinimumWidth);
                        totalWidth += itemMinimumWidth;
                }
-               else if (IsButtonSet(MENU_BUTTON))
+               else if (IsButtonSet(OPTION_BUTTON))
                {
                        GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_WIDTH, GetOrientation(), itemMinimumWidth);
                        totalWidth += itemMinimumWidth;
@@ -6528,7 +5209,7 @@ _Toolbar::CalculateMinimumToolbarWidthF(void)
                        GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_WIDTH, GetOrientation(), itemMinimumWidth);
                        totalWidth += itemMinimumWidth;
                }
-               else if (IsButtonSet(MENU_BUTTON))
+               else if (IsButtonSet(OPTION_BUTTON))
                {
                        GET_SHAPE_CONFIG(FOOTER::BUTTON_ITEM_WIDTH, GetOrientation(), itemMinimumWidth);
                        totalWidth += itemMinimumWidth;
@@ -7208,16 +5889,16 @@ _Toolbar::RearrangeItems(void)
                        {
                                if (__pButtonItems[BACK_BUTTON])  // L,B
                                {
-                                       if (__pButtonItems[MENU_BUTTON])
+                                       if (__pButtonItems[OPTION_BUTTON])
                                        {
                                                __pButtonItems[BACK_BUTTON]->SetBounds(FloatRectangle(__itemArea.width - footerButtonItemWidth - footerLeftMargin + rightTouchMargin,
                                                                (__itemArea.height - footerButtonItemHeight) / 2, footerButtonItemWidth, footerButtonItemHeight));
 
-                                               __pButtonItems[MENU_BUTTON]->SetBounds(FloatRectangle(footerLeftMargin - leftTouchMargin, (__itemArea.height - footerButtonItemHeight) / 2,
+                                               __pButtonItems[OPTION_BUTTON]->SetBounds(FloatRectangle(footerLeftMargin - leftTouchMargin, (__itemArea.height - footerButtonItemHeight) / 2,
                                                                footerButtonItemWidth, footerButtonItemHeight));
 
                                                __pButtonItems[BACK_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
-                                               __pButtonItems[MENU_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
+                                               __pButtonItems[OPTION_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
                                        }
                                        else
                                        {
@@ -7235,16 +5916,16 @@ _Toolbar::RearrangeItems(void)
                                {
                                        if (__style != TOOLBAR_SOFTKEY)
                                        {
-                                               if (__pButtonItems[MENU_BUTTON])
+                                               if (__pButtonItems[OPTION_BUTTON])
                                                {
                                                        __pButtonItems[RIGHT_BUTTON]->SetBounds(FloatRectangle(__itemArea.width - footerButtonItemWidth - footerLeftMargin + rightTouchMargin,
                                                                        (__itemArea.height - footerButtonItemHeight) / 2, footerButtonItemWidth, footerButtonItemHeight));
 
-                                                       __pButtonItems[MENU_BUTTON]->SetBounds(FloatRectangle(footerLeftMargin - leftTouchMargin, (__itemArea.height - footerButtonItemHeight) / 2,
+                                                       __pButtonItems[OPTION_BUTTON]->SetBounds(FloatRectangle(footerLeftMargin - leftTouchMargin, (__itemArea.height - footerButtonItemHeight) / 2,
                                                                                                                                                                footerButtonItemWidth, footerButtonItemHeight));
 
                                                        __pButtonItems[RIGHT_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
-                                                       __pButtonItems[MENU_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
+                                                       __pButtonItems[OPTION_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
                                                }
                                                else
                                                {
@@ -7287,12 +5968,12 @@ _Toolbar::RearrangeItems(void)
                        {
                                if (__pButtonItems[BACK_BUTTON]) // B
                                {
-                                       if (__pButtonItems[MENU_BUTTON])
+                                       if (__pButtonItems[OPTION_BUTTON])
                                        {
-                                               __pButtonItems[MENU_BUTTON]->SetBounds(FloatRectangle(footerLeftMargin - leftTouchMargin, (__itemArea.height - footerButtonItemHeight) / 2,
+                                               __pButtonItems[OPTION_BUTTON]->SetBounds(FloatRectangle(footerLeftMargin - leftTouchMargin, (__itemArea.height - footerButtonItemHeight) / 2,
                                                                footerButtonItemWidth, footerButtonItemHeight));
 
-                                               __pButtonItems[MENU_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
+                                               __pButtonItems[OPTION_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
                                        }
                                        __pButtonItems[BACK_BUTTON]->SetBounds(FloatRectangle(__itemArea.width - footerButtonItemWidth - footerLeftMargin + rightTouchMargin,
                                                        (__itemArea.height - footerButtonItemHeight) / 2, footerButtonItemWidth, footerButtonItemHeight));
@@ -7303,12 +5984,12 @@ _Toolbar::RearrangeItems(void)
                                {
                                        if (__style != TOOLBAR_SOFTKEY)
                                        {
-                                               if (__pButtonItems[MENU_BUTTON])
+                                               if (__pButtonItems[OPTION_BUTTON])
                                                {
-                                                       __pButtonItems[MENU_BUTTON]->SetBounds(FloatRectangle(footerLeftMargin - leftTouchMargin, (__itemArea.height - footerButtonItemHeight) / 2,
+                                                       __pButtonItems[OPTION_BUTTON]->SetBounds(FloatRectangle(footerLeftMargin - leftTouchMargin, (__itemArea.height - footerButtonItemHeight) / 2,
                                                                        footerButtonItemWidth, footerButtonItemHeight));
 
-                                                       __pButtonItems[MENU_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
+                                                       __pButtonItems[OPTION_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
                                                }
 
                                                __pButtonItems[RIGHT_BUTTON]->SetBounds(FloatRectangle(__itemArea.width - footerButtonItemWidth - footerLeftMargin + rightTouchMargin,
@@ -7336,16 +6017,16 @@ _Toolbar::RearrangeItems(void)
                {
                        if (__pButtonItems[BACK_BUTTON]) // L B
                        {
-                               if (__pButtonItems[MENU_BUTTON])
+                               if (__pButtonItems[OPTION_BUTTON])
                                {
                                        __pButtonItems[BACK_BUTTON]->SetBounds(FloatRectangle(__itemArea.width - footerButtonItemWidth - footerLeftMargin + rightTouchMargin,
                                                        (__itemArea.height - footerButtonItemHeight) / 2, footerButtonItemWidth, footerButtonItemHeight));
 
-                                       __pButtonItems[MENU_BUTTON]->SetBounds(FloatRectangle(footerLeftMargin - leftTouchMargin, (__itemArea.height - footerButtonItemHeight) / 2,
+                                       __pButtonItems[OPTION_BUTTON]->SetBounds(FloatRectangle(footerLeftMargin - leftTouchMargin, (__itemArea.height - footerButtonItemHeight) / 2,
                                                        footerButtonItemWidth, footerButtonItemHeight));
 
                                        __pButtonItems[BACK_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
-                                       __pButtonItems[MENU_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
+                                       __pButtonItems[OPTION_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
                                }
                                else
                                {
@@ -7363,12 +6044,12 @@ _Toolbar::RearrangeItems(void)
                        {
                                if (__style != TOOLBAR_SOFTKEY)
                                {
-                                       if (__pButtonItems[MENU_BUTTON])
+                                       if (__pButtonItems[OPTION_BUTTON])
                                        {
-                                               __pButtonItems[MENU_BUTTON]->SetBounds(FloatRectangle(footerLeftMargin - leftTouchMargin, (__itemArea.height - footerButtonItemHeight) / 2,
+                                               __pButtonItems[OPTION_BUTTON]->SetBounds(FloatRectangle(footerLeftMargin - leftTouchMargin, (__itemArea.height - footerButtonItemHeight) / 2,
                                                                footerButtonItemWidth, footerButtonItemHeight));
 
-                                               __pButtonItems[MENU_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
+                                               __pButtonItems[OPTION_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
                                        }
                                        else
                                        {
@@ -7396,11 +6077,11 @@ _Toolbar::RearrangeItems(void)
                {
                        if (__pButtonItems[BACK_BUTTON])
                        {
-                               if (__pButtonItems[MENU_BUTTON])
+                               if (__pButtonItems[OPTION_BUTTON])
                                {
-                                       __pButtonItems[MENU_BUTTON]->SetBounds(FloatRectangle(footerLeftMargin - leftTouchMargin, (__itemArea.height - footerButtonItemHeight) / 2,
+                                       __pButtonItems[OPTION_BUTTON]->SetBounds(FloatRectangle(footerLeftMargin - leftTouchMargin, (__itemArea.height - footerButtonItemHeight) / 2,
                                                        footerButtonItemWidth, footerButtonItemHeight));
-                                       __pButtonItems[MENU_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
+                                       __pButtonItems[OPTION_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
                                }
 
                                __pButtonItems[BACK_BUTTON]->SetBounds(FloatRectangle(__itemArea.width - footerButtonItemWidth - footerLeftMargin + rightTouchMargin,
@@ -7410,11 +6091,11 @@ _Toolbar::RearrangeItems(void)
                        }
                        else
                        {
-                               if (__pButtonItems[MENU_BUTTON])
+                               if (__pButtonItems[OPTION_BUTTON])
                                {
-                                       __pButtonItems[MENU_BUTTON]->SetBounds(FloatRectangle(footerLeftMargin - leftTouchMargin, (__itemArea.height - footerButtonItemHeight) / 2,
+                                       __pButtonItems[OPTION_BUTTON]->SetBounds(FloatRectangle(footerLeftMargin - leftTouchMargin, (__itemArea.height - footerButtonItemHeight) / 2,
                                                        footerButtonItemWidth, footerButtonItemHeight));
-                                       __pButtonItems[MENU_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
+                                       __pButtonItems[OPTION_BUTTON]->SetTouchMargin(leftTouchMargin, topTouchMargin, rightTouchMargin, bottomTouchMargin);
                                }
                        }
                }
@@ -7648,7 +6329,7 @@ _Toolbar::RearrangeFooterSegmentedItems(void)
        }
        else if (__itemCount == 3)
        {
-               if (__pButtonItems[LEFT_BUTTON] || __pButtonItems[MENU_BUTTON])
+               if (__pButtonItems[LEFT_BUTTON] || __pButtonItems[OPTION_BUTTON])
                {
                        if (__pButtonItems[RIGHT_BUTTON] || __pButtonItems[BACK_BUTTON])
                        {
@@ -7707,7 +6388,7 @@ _Toolbar::RearrangeFooterSegmentedItems(void)
        {
                if (__pButtonItems[BACK_BUTTON])
                {
-                       if (__pButtonItems[MENU_BUTTON])
+                       if (__pButtonItems[OPTION_BUTTON])
                        {
                                rightMargin = footerLeftMargin;
                                itemButtonRightGap = footerLeftMargin;
@@ -7723,7 +6404,7 @@ _Toolbar::RearrangeFooterSegmentedItems(void)
                }
                else
                {
-                       if (__pButtonItems[MENU_BUTTON])
+                       if (__pButtonItems[OPTION_BUTTON])
                        {
                                rightMargin = footerLeftMargin;
                                itemButtonRightGap = footerLeftMargin;
@@ -8122,7 +6803,7 @@ _Toolbar::RearrangeButtonItems(void)
        }
        else if (__itemCount == 3)
        {
-               if (__pButtonItems[LEFT_BUTTON] || __pButtonItems[MENU_BUTTON])
+               if (__pButtonItems[LEFT_BUTTON] || __pButtonItems[OPTION_BUTTON])
                {
                        if (__pButtonItems[RIGHT_BUTTON] || __pButtonItems[BACK_BUTTON])
                        {
@@ -8190,7 +6871,7 @@ _Toolbar::RearrangeButtonItems(void)
        {
                if (__pButtonItems[BACK_BUTTON])
                {
-                       if (__pButtonItems[MENU_BUTTON])
+                       if (__pButtonItems[OPTION_BUTTON])
                        {
                                tabRightMargin = footerLeftMargin;
                                itemButtonRightGap = footerLeftMargin;
@@ -8206,7 +6887,7 @@ _Toolbar::RearrangeButtonItems(void)
                }
                else
                {
-                       if (__pButtonItems[MENU_BUTTON])
+                       if (__pButtonItems[OPTION_BUTTON])
                        {
                                tabRightMargin = footerLeftMargin;
                                itemButtonRightGap = footerLeftMargin;
@@ -8260,7 +6941,7 @@ _Toolbar::RearrangeButtonItems(void)
        {
                if (__pButtonItems[BACK_BUTTON])
                {
-                       if (__pButtonItems[MENU_BUTTON])
+                       if (__pButtonItems[OPTION_BUTTON])
                        {
                                tabRightMargin = footerLeftMargin;
                                itemButtonRightGap = footerLeftMargin;
@@ -8276,7 +6957,7 @@ _Toolbar::RearrangeButtonItems(void)
                }
                else
                {
-                       if (__pButtonItems[MENU_BUTTON])
+                       if (__pButtonItems[OPTION_BUTTON])
                        {
                                tabRightMargin = footerLeftMargin;
                                itemButtonRightGap = footerLeftMargin;
index 67205a6..aa74c3c 100644 (file)
@@ -49,10 +49,6 @@ public:
        static result ReleaseInstance(void);
        static bool __wakeUpEventAdded;
 
-       // For restoring gl context
-       typedef void (*RestoreContextCallback)(void);
-       static void SetRestoreContextCallback(RestoreContextCallback pRestoreContextCallback);
-       static void RestoreContext(void);
 public:
        _RootVisualElement* CreateRoot(void);
 
@@ -84,7 +80,6 @@ private:
        static int __eventType;
        static void* __pWakeUpEventHandler;
        static _DisplayManager* __pInstance;
-       static RestoreContextCallback __pRestoreContextCallback;
 }; // _DisplayManager
 
 }}} //namespace Tizen { namespace Ui { namespace Animations
index d8363f0..bdacda0 100644 (file)
@@ -227,7 +227,6 @@ public:
        result GetKeypadBounds(Tizen::Graphics::FloatRectangle& bounds) const;
        float GetClipboardHeight(void) const;
        bool CheckKeypadExist(_ControlOrientation orientation);
-       bool IsKeypadRotating(_ControlOrientation orientation);
        KeypadStyle GetKeypadStyle(void) const;
        int GetTextLimitLength(void) const;
        int GetMaxLineCount(void) const;
@@ -426,7 +425,7 @@ private:
        result OnTitleSlidingTimerExpired(void);
        result OnFlickTimerExpired(void);
        bool IsDelimiter(wchar_t character) const;
-       void AdjustParentPanelHeight(bool restore);
+       void AdjustParentPanelHeight(bool restore, bool panelResizeByPrediction = false);
        result ChangeLayoutInternal(_ControlOrientation orientation, bool deflateForm = true);
        _Button* CreateCommandButtonItemN(int actionId, const Tizen::Base::String& text);
        void CheckInitialFooterVisibleState(void);
index a40ec80..633414a 100644 (file)
@@ -135,7 +135,6 @@ public:
        bool IsHeaderVisible(void) const;
        bool IsFooterVisible(void) const;
        bool IsIndicatorTranslucent(void) const;
-       bool IsIndicatorAutoHide(void) const;
        bool IsHeaderTranslucent(void) const;
        bool IsFooterTranslucent(void) const;
        bool IsTabTranslucent(void) const;
@@ -181,8 +180,7 @@ public:
        void CreateSoftkey(unsigned long formStyle);
        void SetTabStyle(int style);
 
-       result SetIndicatorShowState(bool state);
-       result SetIndicatorAutoHide(bool autohide);
+       result SetIndicatorShowState(bool state, bool hide = false);
        result SetIndicatorOpacity(_IndicatorOpacity opacity);
 
        virtual bool OnMousePressed(const _Control& source, const _MouseInfo& mouseinfo);
@@ -310,7 +308,7 @@ private:
 
        //Back button action ID
        static const int ID_BACK_BUTTON = -10;
-       static const int ID_MENU_BUTTON = -20;
+       static const int ID_OPTION_BUTTON = -20;
 
        //For Focus UI
        mutable std::unique_ptr<Tizen::Base::Collection::IListT<_Control*> > __pFocusControlList;
index 43b1d4f..76fd916 100644 (file)
@@ -51,12 +51,10 @@ public:
 
                static _Indicator* CreateIndicator(void);
 
-               result SetIndicatorShowState(bool state);
-               result SetIndicatorAutoHide(bool autohide);
+               result SetIndicatorShowState(bool state, bool hide = false);
                result SetIndicatorOpacity(_IndicatorOpacity opacity);
                bool GetIndicatorShowState(void) const;
                _IndicatorOpacity GetIndicatorOpacity(void) const;
-               bool GetIndicatorAutoHide(void) const;
                result AddIndicatorObject(_Control* pControl, _Window* pWindow);
                result DeleteIndicatorObject(void);
                result ChangeCurrentVisualElement(Tizen::Ui::Animations::_VisualElement* pVisualElement);
@@ -86,7 +84,6 @@ private:
                Tizen::Ui::Animations::_VisualElement* __pCurrentVisualElement;
                _Window* __pWindow;
                bool __showstate;
-               bool __autohide;
                _IndicatorOpacity __opacity;
                Tizen::Ui::_ControlOrientation __orientation;
 
index 9b99d33..60af50b 100644 (file)
@@ -81,7 +81,7 @@ enum ToolbarButton
        RIGHT_BUTTON,
        MIDDLE_BUTTON,
        BACK_BUTTON,
-       MENU_BUTTON,
+       OPTION_BUTTON,
        BUTTON_MAX
 };
 
@@ -362,7 +362,7 @@ public:
 
        void SetBackEventListener(const Tizen::Ui::Controls::_IActionEventListener& listener, int actionId);
 
-       void SetMenuEventListener(const Tizen::Ui::Controls::_IActionEventListener& listener, int actionId);
+       void SetOptionEventListener(const Tizen::Ui::Controls::_IActionEventListener& listener, int actionId);
 
        virtual result OnAttachedToMainTree(void);
 
@@ -445,10 +445,6 @@ private:
 
        result InitToolbarColor(void);
 
-       result OnHeaderFocusGained(const _Control& source);
-
-       result OnFooterFocusGained(const _Control& source);
-
 private:
        bool __header;
 
@@ -458,7 +454,7 @@ private:
 
        Tizen::Ui::Controls::_IActionEventListener* __pBackEventListener;
 
-       Tizen::Ui::Controls::_IActionEventListener* __pMenuEventListener;
+       Tizen::Ui::Controls::_IActionEventListener* __pOptionEventListener;
 
        _TouchLongPressGestureDetector* __pLongPressGesture;
 
@@ -521,7 +517,7 @@ private:
 
        int __backActionId;
 
-       int __menuActionId;
+       int __optionActionId;
 
        int __itemCount;