__selectedIndex = __focusedIndex;
_ContextMenuItem* pItem = __pModel->GetItem(__focusedIndex);
- pItem->SetFocused(true);
- Draw();
+ if (pItem != null)
+ {
+ pItem->SetFocused(true);
+ Draw();
+ }
break;
}
const Tizen::Graphics::Bitmap* normalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap,
const Tizen::Graphics::Bitmap* pHighlightedBitmap)
{
+ _ContextMenuItem* pItem = null;
+ result r = E_SUCCESS;
+
if (text.GetLength() == 0 && normalBitmap == null && pPressedBitmap == null)
{
return E_INVALID_ARG;
}
- result r = __pContextMenu->GetScrollPanel()->DetachChild(*__pModel->GetItem(index));
+ pItem = __pModel->GetItem(index);
+ r = GetLastResult();
+ SysTryReturn(NID_UI_CTRL, pItem != null, r, r, "Failed to get the item.");
+
+ r = __pContextMenu->GetScrollPanel()->DetachChild(*pItem);
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to detach item.");
- _ContextMenuItem* pItem = null;
pItem = CreateItem(text, actionId, normalBitmap, pPressedBitmap, pHighlightedBitmap);
SysTryReturn(NID_UI_CTRL, pItem != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "The memory is insufficient.");
result
_ContextMenuListPresenter::DeleteItem(int index)
{
+ _ContextMenuItem* pItem = null;
+ result r = E_SUCCESS;
+
if (__pContextMenu->GetItemCount() <= 0)
{
SysLogException(NID_UI_CTRL, E_INVALID_STATE, "Invalid argument.");
return E_INVALID_STATE;
}
- result r = __pContextMenu->GetScrollPanel()->DetachChild(*__pModel->GetItem(index));
+ pItem = __pModel->GetItem(index);
+ r = GetLastResult();
+ SysTryReturn(NID_UI_CTRL, pItem != null, r, r, "Failed to get the item.");
+
+ r = __pContextMenu->GetScrollPanel()->DetachChild(*pItem);
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to detach item.");
r = __pModel->RemoveItem(index);
{
_ContextMenuItem* pItem = null;
pItem = __pModel->GetItem(__selectedIndex);
+ if (pItem == null)
+ {
+ return true;
+ }
__selectedIndex = -1;
__focusedIndex = -1;
SysTryReturnVoidResult(NID_UI_CTRL, (pContainer != null), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
_AccessibilityElement* pAccessibilityElement = null;
- __accessibilityElements.GetAt(index, pAccessibilityElement);
- if (pAccessibilityElement != null)
+ if (__accessibilityElements.GetAt(index, pAccessibilityElement) == E_SUCCESS)
{
__accessibilityElements.RemoveAt(index);
pContainer->RemoveElement(*pAccessibilityElement);
__pAccessibilityElement->SetTraitWithStringId("IDS_TPLATFORM_BODY_IMAGE");
}
- if (__pAccessibilityElement != null && itemIndex >= 0)
+ if (itemIndex >= 0)
{
if (swapElement)
{
// Set Visual element for this element
_VisualElement* pVE = new (std::nothrow) _VisualElement();
+ SysTryReturn(NID_UI_CTRL, (pVE != null), E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+
pVE->Construct();
pVE->SetImplicitAnimationEnabled(false);
pVE->SetContentProvider(&__hitTestVEDelegator);
element.pBitmapElement->pBitmap[LISTVIEW_ITEM_STATUS_HIGHLIGHTED] = pCloneHighlightedBitmap;
pVE = new (std::nothrow) _VisualElement();
+ SysTryCatch(NID_UI_CTRL, pVE, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+
pVE->Construct();
pVE->SetImplicitAnimationEnabled(false);
pVE->SetContentProvider(&__hitTestVEDelegator);
element.pCustomElement->pCustom = const_cast<_ICustomElement*>(pCustom);
_VisualElement* pVE = new (std::nothrow) _VisualElement();
+ SysTryReturn(NID_UI_CTRL, (pVE != null), E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
pVE->Construct();
pVE->SetImplicitAnimationEnabled(false);
pVE->SetContentProvider(&__hitTestVEDelegator);
result r = E_SUCCESS;
int opacity = 0;
- Bitmap* pBitmap = null;
Bitmap* pNormalBitmap = null;
Bitmap* pPressedBitmap = null;
Bitmap* pDisabledBitmap = null;
if (__pHandleNormalEffectBitmap == null)
{
- r = GET_BITMAP_CONFIG_N(SLIDER::HANDLE_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pBitmap);
+ r = GET_BITMAP_CONFIG_N(SLIDER::HANDLE_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pHandleNormalEffectBitmap);
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
-
- __pHandleNormalEffectBitmap = pBitmap;
}
if (__pHandlePressedEffectBitmap == null)
{
- r = GET_BITMAP_CONFIG_N(SLIDER::HANDLE_BG_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pBitmap);
+ r = GET_BITMAP_CONFIG_N(SLIDER::HANDLE_BG_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, __pHandlePressedEffectBitmap);
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
-
- __pHandlePressedEffectBitmap = pBitmap;
}
if (__pHandleDisabledEffectBitmap == null)
{
- r = GET_BITMAP_CONFIG_N(SLIDER::HANDLE_BG_EFFECT_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pBitmap);
+ r = GET_BITMAP_CONFIG_N(SLIDER::HANDLE_BG_EFFECT_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, __pHandleDisabledEffectBitmap);
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
-
- __pHandleDisabledEffectBitmap = pBitmap;
}
if (__pHandleHighlightedEffectBitmap == null)
{
- r = GET_BITMAP_CONFIG_N(SLIDER::HANDLE_BG_EFFECT_HIGHLIGHTED, BITMAP_PIXEL_FORMAT_ARGB8888, pBitmap);
+ r = GET_BITMAP_CONFIG_N(SLIDER::HANDLE_BG_EFFECT_HIGHLIGHTED, BITMAP_PIXEL_FORMAT_ARGB8888, __pHandleHighlightedEffectBitmap);
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
-
- __pHandleHighlightedEffectBitmap = pBitmap;
}
delete pNormalBitmap;
delete pDisabledBitmap;
delete pHighlightedBitmap;
- delete pBitmap;
-
delete __pResourceBgTopBitmap;
__pResourceBgTopBitmap = null;
switch (keyCode)
{
case _KEY_LEFT:
- if (pFocusList == null)
- {
- break;
- }
-
if (IsFocused())
{
if (pChildControl == null)
break;
case _KEY_RIGHT:
- if (pFocusList == null)
- {
- break;
- }
-
if (IsFocused())
{
if (pChildControl == null)