SetAccessibilityElement();
}
+ GetAccessibilityContainer()->Activate(false);
+
return r;
CATCH:
{
GET_COLOR_CONFIG(TABLEVIEW::GROUPITEM_BG_PRESSED, __colorItemBg[TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED]);
}
+ GetAccessibilityContainer()->Activate(true);
}
}
void
_TableViewItem::OnChildAttached(const _Control& child)
{
- _AccessibilityContainer* pContainer = const_cast<_Control*>(&child)->GetAccessibilityContainer();
- pContainer->Activate(false);
-
_Control* pControl = const_cast<_Control*>(&child);
+ _AccessibilityContainer* pContainer = pControl->GetAccessibilityContainer();
+
+ if (__individualSelectionControls.Contains(child))
+ {
+ pContainer->Activate(true);
+ }
+ else
+ {
+ pContainer->Activate(false);
+
+ if(!(pControl == static_cast<_Control*>(__pItemAnnexLeftDivider)
+ || pControl == static_cast<_Control*>(__pItemAnnexRightDivider)
+ || pControl == static_cast<_Control*>(__pItemCover)
+ || pControl == static_cast<_Control*>(__pItemDivider)
+ || pControl== static_cast<_Control*>(__pItemTopDivider)))
+ {
+ GetAccessibilityContainer()->Activate(true);
+ }
+ }
+
pControl->SetTouchPressThreshold(SENSITIVE);
FloatRectangle bounds = child.GetBoundsF();
_AccessibilityContainer* pContainer = const_cast<_Control*>(&control)->GetAccessibilityContainer();
pContainer->Activate(true);
+ int controlCount = 0;
+ for(int i=0; i<GetChildCount(); i++)
+ {
+ _Control* pChildControl = GetChild(i);
+ if(pChildControl == static_cast<_Control*>(__pItemAnnexLeftDivider)
+ || pChildControl == static_cast<_Control*>(__pItemAnnexRightDivider)
+ || pChildControl == static_cast<_Control*>(__pItemCover)
+ || pChildControl == static_cast<_Control*>(__pItemDivider)
+ || pChildControl== static_cast<_Control*>(__pItemTopDivider))
+ {
+ continue;
+ }
+
+ controlCount++;
+ }
+
+ if(controlCount == 0 || __individualSelectionControls.GetCount() == controlCount)
+ {
+ GetAccessibilityContainer()->Activate(false);
+ }
+ else
+ {
+ GetAccessibilityContainer()->Activate(true);
+ }
}
else
{
_TableViewItem::SetAccessibilityElement(void)
{
_AccessibilityContainer* pContainer = GetAccessibilityContainer();
+
if(pContainer != null)
{
if(__pAccessibilityElement == null)
}
break;
- case _KEY_RIGHT:
- if (pFocusedControl != null)
- {
- pChildControl = GetNextFocusChildControl(*pFocusedControl);
- }
- break;
+ case _KEY_RIGHT:
+ if (pFocusedControl != null)
+ {
+ pChildControl = GetNextFocusChildControl(*pFocusedControl);
+ }
+ break;
- default:
- return false;
- }
+ case _KEY_ENTER:
+ if (&source == this)
+ {
+ __pressedControl = TABLE_VIEW_ITEM_PRESSED_ITEM;
+ }
+ else if (&source == GetLabelCore(__pItemAnnex))
+ {
+ __pressedControl = TABLE_VIEW_ITEM_PRESSED_ANNEX;
+ }
+ else if (IsIndividualSelectionEnabled(source))
+ {
+ __pressedControl = TABLE_VIEW_ITEM_PRESSED_INDIVIDUAL;
+ }
+ else
+ {
+ __pressedControl = TABLE_VIEW_ITEM_PRESSED_NONE;
+ }
+ __itemSelected = true;
+ FireItemTouchPressed();
+ break;
- if (pFocusedControl != null)
- {
- if (pChildControl)
- {
- pChildControl->SetFocused(true);
- pChildControl->DrawFocus();
- }
- else
- {
- _Control* pParentControl = pFocusedControl->GetParent();
- pParentControl->SetFocused(true);
- pParentControl->DrawFocus();
- }
- }
+ default:
+ return false;
+ }
- return true;
+ if (keyCode == _KEY_LEFT || keyCode == _KEY_RIGHT)
+ {
+ if (pFocusedControl != null)
+ {
+ if (pChildControl)
+ {
+ pChildControl->SetFocused(true);
+ pChildControl->DrawFocus();
+ }
+ else
+ {
+ _Control* pParentControl = pFocusedControl->GetParent();
+ pParentControl->SetFocused(true);
+ pParentControl->DrawFocus();
+ }
+ }
+ }
+ return true;
}
bool
_TableViewItem::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
{
- _KeyCode keyCode = keyInfo.GetKeyCode();
+ _KeyCode keyCode = keyInfo.GetKeyCode();
- if (keyCode == _KEY_LEFT || keyCode == _KEY_RIGHT)
+ switch (keyCode)
+ {
+ case _KEY_ENTER:
+ if (&source == this)
+ {
+ __releasedControl = TABLE_VIEW_ITEM_PRESSED_ITEM;
+ }
+ else if (&source == GetLabelCore(__pItemAnnex))
+ {
+ __releasedControl = TABLE_VIEW_ITEM_PRESSED_ANNEX;
+ }
+ else if (IsIndividualSelectionEnabled(source))
+ {
+ __releasedControl = TABLE_VIEW_ITEM_PRESSED_INDIVIDUAL;
+ }
+ else
+ {
+ __releasedControl = TABLE_VIEW_ITEM_PRESSED_NONE;
+ }
+ break;
+
+ default:
+ return false;
+ }
+
+ if(keyCode == _KEY_ENTER)
+ {
+ _TableView* pParent = dynamic_cast<_TableView*>(GetParent());
+ pParent->StopExpandCollapseAnimation();
+ FireItemTouchReleased();
+ return true;
+ }
+ else if (keyCode == _KEY_LEFT || keyCode == _KEY_RIGHT)
{
return true;
}
}
break;
- case _KEY_ENTER:
- if (pFocusedControl != null)
- {
- pItem = dynamic_cast<_TableViewItem*>(pFocusedControl);
- if (pItem != null)
- {
- TableViewNotifyType eventType = TABLEVIEW_NOTIFY_TYPE_SELECTED_ITEM;
- int annexStyle = pItem->GetItemStyle();
- pItem->GetItemIndex(itemPos.groupIndex, itemPos.itemIndex);
- if ((annexStyle == TABLE_VIEW_ANNEX_STYLE_MARK)
- || (annexStyle == TABLE_VIEW_ANNEX_STYLE_RADIO)
- || (annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING))
- {
- if (pItem->IsChecked())
- {
- eventType = TABLEVIEW_NOTIFY_TYPE_ANNEX_UNCHECK;
- }
- else
- {
- eventType = TABLEVIEW_NOTIFY_TYPE_ANNEX_CHECK;
- }
- }
- else if (__pTableView->GetTableViewStyle() == TABLE_VIEW_STYLE_GROUPED && itemPos.itemIndex == -1)
- {
- if (IsGroupExpanded(itemPos.groupIndex))
- {
- CollapseGroup(itemPos.groupIndex, false);
- }
- else
- {
- ExpandGroup(itemPos.groupIndex, false);
- }
- eventType = TABLEVIEW_NOTIFY_TYPE_NONE;
- }
- __pTableView->FireTableViewItemEvent(itemPos.groupIndex, itemPos.itemIndex, eventType, pItem);
- }
- }
- break;
-
default:
return false;
}
{
_KeyCode keyCode = keyInfo.GetKeyCode();
- if (keyCode == _KEY_UP || keyCode == _KEY_DOWN || keyCode == _KEY_ENTER)
+ if (keyCode == _KEY_UP || keyCode == _KEY_DOWN)
{
return true;
}