Fix for N_SE-52834
authorGaurav Bhatt <gaurav.bhatt@samsung.com>
Mon, 23 Sep 2013 06:52:34 +0000 (12:22 +0530)
committerGaurav Bhatt <gaurav.bhatt@samsung.com>
Mon, 23 Sep 2013 06:52:34 +0000 (12:22 +0530)
Change-Id: I6d793667a20bf2fd90f82e0016874bac50fb97e7
Signed-off-by: Gaurav Bhatt <gaurav.bhatt@samsung.com>
inc/ClSettingForm.h
src/ClSettingForm.cpp

index c2c2e76..d9ea594 100644 (file)
@@ -37,6 +37,7 @@ class SettingForm
        , public virtual Tizen::Ui::Controls::ISectionTableViewItemEventListener
        , public virtual Tizen::Ui::Controls::ISectionTableViewItemProvider
        , public virtual Tizen::Ui::Scenes::ISceneEventListener
+       , public virtual Tizen::Ui::ITouchEventListener
 {
 public:
        result Initialize(void);
@@ -77,6 +78,16 @@ public:
                                                                           const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs);
        virtual void OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId,
                                                                                const Tizen::Ui::Scenes::SceneId& nextSceneId);
+       virtual void OnTouchPressed(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition,
+                                                                       const Tizen::Ui::TouchEventInfo & touchInfo);
+       virtual void OnTouchReleased(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition,
+                                                                       const Tizen::Ui::TouchEventInfo& touchInfo);
+       virtual void OnTouchMoved(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition,
+                                                               const Tizen::Ui::TouchEventInfo& touchInfo);
+       virtual void OnTouchFocusIn(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition,
+                                                                       const Tizen::Ui::TouchEventInfo& touchInfo);
+       virtual void OnTouchFocusOut(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition,
+                                                                       const Tizen::Ui::TouchEventInfo& touchInfo);
 private:
        Tizen::Ui::Controls::TableViewItem* CreateLockTimeZoneOnOffItemN(int itemWidth, bool isOn);
        Tizen::Ui::Controls::TableViewItem* CreateLockTimeZoneSelectionItemN(int itemWidth);
@@ -95,6 +106,7 @@ private:
        Tizen::Ui::Controls::SectionTableView* __pTableView;
        Tizen::Ui::Controls::Label* __pLabelLockTimeZone;
        Tizen::Ui::Controls::Label* __pLabelFirstDayOfWeek;
+       Tizen::Ui::Controls::Label* __pSubText;
        Tizen::Ui::Controls::Label* __pLabelFirstDayOfWeekExpandIcon;
        CalendarSelectorPopup* __pCalendarSelectorPopup;
        Tizen::Base::Runtime::Thread* __pThread;
index 8cd6548..e7bcda8 100644 (file)
@@ -81,6 +81,7 @@ static const int W_FIRST_DAY_OF_WEEK_ITEM_ICON_MARGIN = 26;
 static const int FONT_SIZE_DETAIL02 = 44;
 static const int FONT_SIZE_DETAIL03 = 32;
 static const unsigned int COLOR_DETAIL03 = Color32<128, 128, 128>::Value;
+static const unsigned int COLOR_PRESS = Color32<255, 255, 255>::Value;
 static const int H_MARGIN = 8;
 static const float H_ICON_SCALE = 0.514;
 static const int IDA_SETTING_FORM_PARSE_VCS_FILE_COMPLETE = 90001;
@@ -125,6 +126,7 @@ SettingForm::SettingForm(void)
        : __pTableView(null)
        , __pLabelLockTimeZone(null)
        , __pLabelFirstDayOfWeek(null)
+       , __pSubText(null)
        , __pLabelFirstDayOfWeekExpandIcon(null)
        , __pCalendarSelectorPopup(null)
        , __pThread(null)
@@ -484,6 +486,21 @@ SettingForm::DeleteItem(int sectionIndex, int itemIndex, TableViewItem* pItem)
                }
                break;
        }
+       if (sectionIndex == 0 && itemIndex == 0)
+       {
+               if (__pSubText)
+               {
+                       __pSubText->RemoveTouchEventListener(*this);
+               }
+               if (__pLabelFirstDayOfWeek)
+               {
+                       __pLabelFirstDayOfWeek->RemoveTouchEventListener(*this);
+               }
+               if (__pLabelFirstDayOfWeekExpandIcon)
+               {
+                       __pLabelFirstDayOfWeekExpandIcon->RemoveTouchEventListener(*this);
+               }
+       }
        delete pItem;
        return true;
 }
@@ -730,6 +747,36 @@ SettingForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& ne
 
 }
 
+void
+SettingForm::OnTouchPressed(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo & touchInfo)
+{
+       __pSubText->SetTextColor(Color(COLOR_PRESS));
+       __pSubText->Invalidate(false);
+}
+
+void
+SettingForm::OnTouchReleased(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
+{
+       __pSubText->SetTextColor(Color(COLOR_DETAIL03));
+       __pSubText->Invalidate(false);
+}
+
+void
+SettingForm::OnTouchMoved(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
+{
+       __pSubText->SetTextColor(Color(COLOR_DETAIL03));
+       __pSubText->Invalidate(false);
+}
+void
+SettingForm::OnTouchFocusIn(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition,
+                                                                       const Tizen::Ui::TouchEventInfo& touchInfo)
+{
+}
+void
+SettingForm::OnTouchFocusOut(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition,
+                                                                       const Tizen::Ui::TouchEventInfo& touchInfo)
+{
+}
 TableViewItem*
 SettingForm::CreateLockTimeZoneOnOffItemN(int itemWidth, bool isOn)
 {
@@ -782,6 +829,8 @@ SettingForm::CreateFirstDayOfWeekExpanderItemN(int itemWidth, bool isSundayFirst
        pLabel->SetTextConfig(FONT_SIZE_DETAIL03, LABEL_TEXT_STYLE_NORMAL);
        pLabel->SetTextColor(Color(COLOR_DETAIL03));
        pLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
+       __pSubText = pLabel;
+       __pSubText->AddTouchEventListener(*this);
        pItem->AddControl(pLabel);
 
        Label* pFirstDayOfWeekLabel = new (std::nothrow) Label();
@@ -789,6 +838,7 @@ SettingForm::CreateFirstDayOfWeekExpanderItemN(int itemWidth, bool isSundayFirst
                                                                        (isSundayFirst == true) ? ResourceManager::GetString(IDS_CLD_BODY_SUNDAY) : ResourceManager::GetString(IDS_CLD_BODY_MONDAY));
        pFirstDayOfWeekLabel->SetTextConfig(__fontSize, LABEL_TEXT_STYLE_NORMAL);
        pFirstDayOfWeekLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
+       pFirstDayOfWeekLabel->AddTouchEventListener(*this);
        pItem->AddControl(pFirstDayOfWeekLabel);
        __pLabelFirstDayOfWeek = pFirstDayOfWeekLabel;
 
@@ -797,6 +847,7 @@ SettingForm::CreateFirstDayOfWeekExpanderItemN(int itemWidth, bool isSundayFirst
                                                                                                                                Y_FIRST_DAY_OF_WEEK_ITEM_ICON,
                                                                                                                                __itemHeight * H_ICON_SCALE,
                                                                                                                                __itemHeight * H_ICON_SCALE), L"");
+       __pLabelFirstDayOfWeekExpandIcon->AddTouchEventListener(*this);
        Bitmap* pButtonIcon = ResourceManager::GetBitmapN(IDB_ALL_DAY_EVENT_LIST_EXPAND_CLOSED);
        if (pButtonIcon != null)
        {