Merging Slider focus ui changes into tizen_2.2.
authorkishorekumar Dachinamoorthy <kishore.d@samsung.com>
Thu, 6 Jun 2013 04:39:06 +0000 (10:09 +0530)
committerkishorekumar Dachinamoorthy <kishore.d@samsung.com>
Thu, 6 Jun 2013 07:09:07 +0000 (12:39 +0530)
Change-Id: Ibc9941680e039d37984729678d21923ca405b76d

res/common/usr/share/osp/bitmaps/480x800/00_slider_handle_focus.png [new file with mode: 0644]
src/ui/controls/FUiCtrl_Slider.cpp
src/ui/inc/FUiCtrl_Slider.h

diff --git a/res/common/usr/share/osp/bitmaps/480x800/00_slider_handle_focus.png b/res/common/usr/share/osp/bitmaps/480x800/00_slider_handle_focus.png
new file mode 100644 (file)
index 0000000..95bd5fd
Binary files /dev/null and b/res/common/usr/share/osp/bitmaps/480x800/00_slider_handle_focus.png differ
index ce5fdb6..6ba81fc 100644 (file)
@@ -306,6 +306,67 @@ _Slider::OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo)
 }
 
 void
+_Slider::OnDrawFocus(void)
+{
+       __pSliderPresenter->SetFocusMode(true);
+       Invalidate();
+
+       return;
+}
+
+bool
+_Slider::OnFocusGained(const _Control& source)
+{
+       __pSliderPresenter->SetFocusMode(true);
+       Invalidate();
+
+       return true;
+}
+
+bool
+_Slider::OnFocusLost(const _Control& source)
+{
+       __pSliderPresenter->SetFocusMode(false);
+       Invalidate();
+
+       return true;
+}
+
+void
+_Slider::OnFocusModeStateChanged()
+{
+       __pSliderPresenter->SetFocusMode(false);
+       Invalidate();
+}
+
+bool
+_Slider::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
+{
+       if(__pSliderPresenter->GetFocusMode() == false)
+       {
+               return false;
+       }
+
+       _KeyCode keyCode = keyInfo.GetKeyCode();
+
+       if (keyCode == _KEY_RIGHT)
+       {
+               SetValue(GetValue() + 1);
+               Invalidate();
+               return true;
+       }
+
+       if (keyCode == _KEY_LEFT)
+       {
+               SetValue(GetValue() - 1);
+               Invalidate();
+               return true;
+       }
+
+       return false;
+}
+
+void
 _Slider::OnBoundsChanged(void)
 {
        __pSliderPresenter->OnBoundsChanged();
index 9e69819..55d22b8 100644 (file)
@@ -128,10 +128,16 @@ public:
        virtual bool OnTouchReleased(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
        virtual bool OnTouchMoved(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
        virtual bool OnTouchCanceled(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
+       virtual void OnDrawFocus(void);
+       virtual bool OnFocusGained(const _Control& source);
+       virtual bool OnFocusLost(const _Control &source);
+       virtual bool OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo);
+
        virtual void OnBoundsChanged(void);
        virtual void OnChangeLayout(Tizen::Ui::_ControlOrientation orientation);
        virtual void OnDraw(void);
        virtual result OnAttachedToMainTree(void);
+       virtual void OnFocusModeStateChanged(void);
 
        virtual void OnFontChanged(Tizen::Graphics::Font* pFont);
        virtual void OnFontInfoRequested(unsigned long& style, float& size);