Color
_GroupContainerPresenter::GetParentColor(void) const
{
- Color parentBgColor = Color(0, 0, 0, 0);
- _Form* pForm = null;
-
_Control* pParentControl = __pGroupContainer->GetParent();
-
- if (pParentControl)
+ if (!pParentControl)
{
- parentBgColor = pParentControl->GetBackgroundColor();
- pForm = dynamic_cast<_Form*>(pParentControl);
+ return Color(0, 0, 0, 0);
}
+ Color parentBgColor = pParentControl->GetBackgroundColor();
+ _Form* pForm = dynamic_cast<_Form*>(pParentControl);
+
while (pForm == null && parentBgColor.GetAlpha() == 0x00)
{
pParentControl = pParentControl->GetParent();
-
- if (pParentControl)
+ if (!pParentControl)
{
- pForm = dynamic_cast<_Form*>(pParentControl);
- parentBgColor = pParentControl->GetBackgroundColor();
+ break;
}
+
+ pForm = dynamic_cast<_Form*>(pParentControl);
+ parentBgColor = pParentControl->GetBackgroundColor();
}
return parentBgColor;
, __pLongPressedGesture(null)
{
__pTouchManager = _TouchManager::GetInstance();
- SysTryReturnVoidResult(NID_UI, (__pTouchManager != null), E_SYSTEM, "[E_SYSTEM] System error occurred.");
+ SysTryReturnVoidResult(NID_UI_CTRL, (__pTouchManager != null), E_SYSTEM, "[E_SYSTEM] System error occurred.");
// Add _TouchLongPressGestureDetector
__pLongPressedGesture = new (std::nothrow) _TouchLongPressGestureDetector();
SysTryReturnVoidResult(NID_UI_CTRL, (__pLongPressedGesture != null), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
__core.AddGestureDetector(*__pLongPressedGesture);
- __pLongPressedGesture->AddGestureListener(*this);
+ result r = __pLongPressedGesture->AddGestureListener(*this);
+ SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] propagating.", GetErrorMessage(r));
}
virtual ~_GroupedListViewPropagatedTouchEventListener(void)
memset(&itemStatus, 0, sizeof(_ListViewItemStatus));
bool needChangeEventTarget = false;
- if (pListViewItem->IsItemSelected())
+ if (pListViewItem != null && pListViewItem->IsItemSelected())
{
needChangeEventTarget = true;
}
, __pLongPressedGesture(null)
{
__pTouchManager = _TouchManager::GetInstance();
- SysTryReturnVoidResult(NID_UI, (__pTouchManager != null), E_SYSTEM, "[E_SYSTEM] System error occurred.");
+ SysTryReturnVoidResult(NID_UI_CTRL, (__pTouchManager != null), E_SYSTEM, "[E_SYSTEM] System error occurred.");
// Add _TouchLongPressGestureDetector
__pLongPressedGesture = new (std::nothrow) _TouchLongPressGestureDetector();
SysTryReturnVoidResult(NID_UI_CTRL, (__pLongPressedGesture != null), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
__core.AddGestureDetector(*__pLongPressedGesture);
- __pLongPressedGesture->AddGestureListener(*this);
+ result r = __pLongPressedGesture->AddGestureListener(*this);
+ SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] propagating.", GetErrorMessage(r));
}
virtual ~_ListViewPropagatedTouchEventListener(void)
memset(&itemStatus, 0, sizeof(_ListViewItemStatus));
bool needChangeEventTarget = false;
- if (pListViewItem->IsItemSelected())
+ if (pListViewItem != null && pListViewItem->IsItemSelected())
{
needChangeEventTarget = true;
}
controlOrientation = _CONTROL_ORIENTATION_LANDSCAPE;
GetBuilderBoundsF(controlOrientation, builderBounds);
}
- SetBounds(builderBounds);
+ result r = SetBounds(builderBounds);
+ if (r != E_SUCCESS)
+ {
+ SysLogException(NID_UI_CTRL, r, "[%s] SetBounds failed", GetErrorMessage(r));
+ }
+
SetChildBuilderBouds(this, controlOrientation);
}
}
for (int i = 0; i < itemCount; i++)
{
_TabBarItem* pItem = __pTabBarModel->GetItemAt(i);
+ if (pItem == null)
+ {
+ result r = GetLastResult();
+ SysLogException(NID_UI_CTRL, r, "[%s] The current value of pItem is null", GetErrorMessage(r));
+
+ continue;
+ }
+
_AccessibilityElement* pElement = pItem->GetAccessibilityElement();
if (pElement == null)
{
handlerBounds.x = backgroundBounds.x + annexMargin;
}
- nextHandlerBounds = handlerBounds.x + (position - __annexOnOffTouchPosition);
- annexAbsoluteBoundsStart = __pItemAnnex->GetBoundsF().x;
- annexAbsoluteBoundsEnd = __pItemAnnex->GetBoundsF().x + __pItemAnnex->GetBoundsF().width + annexMargin;
-
- if((annexAbsoluteBoundsStart + nextHandlerBounds + handlerBounds.width) < annexAbsoluteBoundsEnd &&
- (annexAbsoluteBoundsStart + nextHandlerBounds) > annexAbsoluteBoundsStart)
- {
- handlerBounds.x = nextHandlerBounds;
- __annexOnOffHandlerLastPosition = annexAbsoluteBoundsStart + nextHandlerBounds;
- }
- else if(_FloatCompareGE((annexAbsoluteBoundsStart + nextHandlerBounds + handlerBounds.width), annexAbsoluteBoundsEnd))
+ if (__pItemAnnex != null)
{
- handlerBounds.x = backgroundBounds.width - handlerBounds.width - annexMargin;
- }
- else if(_FloatCompareLE((annexAbsoluteBoundsStart + nextHandlerBounds), annexAbsoluteBoundsStart))
- {
- handlerBounds.x = backgroundBounds.x + annexMargin;
+ nextHandlerBounds = handlerBounds.x + (position - __annexOnOffTouchPosition);
+ annexAbsoluteBoundsStart = __pItemAnnex->GetBoundsF().x;
+ annexAbsoluteBoundsEnd = __pItemAnnex->GetBoundsF().x + __pItemAnnex->GetBoundsF().width + annexMargin;
+
+ if((annexAbsoluteBoundsStart + nextHandlerBounds + handlerBounds.width) < annexAbsoluteBoundsEnd &&
+ (annexAbsoluteBoundsStart + nextHandlerBounds) > annexAbsoluteBoundsStart)
+ {
+ handlerBounds.x = nextHandlerBounds;
+ __annexOnOffHandlerLastPosition = annexAbsoluteBoundsStart + nextHandlerBounds;
+ }
+ else if(_FloatCompareGE((annexAbsoluteBoundsStart + nextHandlerBounds + handlerBounds.width), annexAbsoluteBoundsEnd))
+ {
+ handlerBounds.x = backgroundBounds.width - handlerBounds.width - annexMargin;
+ }
+ else if(_FloatCompareLE((annexAbsoluteBoundsStart + nextHandlerBounds), annexAbsoluteBoundsStart))
+ {
+ handlerBounds.x = backgroundBounds.x + annexMargin;
+ }
}
DrawBitmap(*pCanvas, handlerBounds, *pOnOffButtonHandler);