pSimpleText = new (std::nothrow)TextSimple(null, 0, TEXT_ELEMENT_SOURCE_TYPE_EXTERNAL);
SysTryReturn(NID_UI_CTRL, (pSimpleText != null), E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ pSimpleText->SetTextShadowEnabled(true);
+ pSimpleText->SetTextShadowOffset(FloatPoint(0.0f, -1.0f));
+
__textObject.AppendElement(*pSimpleText);
__textObject.SetFont(__pFont, 0, __textObject.GetTextLength());
{
FloatRectangle bounds(0.0f, 0.0f, 0.0f, 0.0f);
+ Canvas* pContentCanvas = null;
Canvas* pCanvas = __pEditDate->GetCanvasN();
- SysTryReturnResult(NID_UI_CTRL, (pCanvas != null), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Unable to create canvas.");
+ SysTryReturnResult(NID_UI_CTRL, (pCanvas != null), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
if (__focusId == DATETIME_ID_DAY)
{
}
else
{
- r = pCanvas->DrawBitmap(bounds, *__pContentBgHighlightedColorReplacementBitmap);
+ pContentCanvas = __pEditDate->GetCanvasN(bounds);
+ SysTryCatch(NID_UI_CTRL, (pContentCanvas != null), , GetLastResult(), "[%s]Propagating.", GetErrorMessage(GetLastResult()));
+
+ bounds.x = (bounds.width - __pContentBgHighlightedColorReplacementBitmap->GetWidthF()) / 2;
+ bounds.y = (bounds.height - __pContentBgHighlightedColorReplacementBitmap->GetHeightF()) / 2;
+
+ r = pContentCanvas->DrawBitmap(FloatPoint(bounds.x, bounds.y), *__pContentBgHighlightedColorReplacementBitmap);
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
+ delete pContentCanvas;
}
delete pCanvas;
CATCH:
delete pCanvas;
+ delete pContentCanvas;
return r;
}
pSimpleText = new (std::nothrow)TextSimple((const_cast <wchar_t*>(text.GetPointer())), text.GetLength(), TEXT_ELEMENT_SOURCE_TYPE_EXTERNAL);
SysTryReturn(NID_UI_CTRL, (pSimpleText != null), E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ pSimpleText->SetTextShadowEnabled(true);
+ pSimpleText->SetTextShadowOffset(FloatPoint(0.0f, -1.0f));
+
__textObject.RemoveAll();
if (__isFocused && __focusId == boxId)
{
pEffectBitmap = __pContentBgEffectPressedBitmap;
}
- r = DrawResourceBitmap(canvas, bounds, pReplacementBitmap);
+ r = DrawResourceBitmap(canvas, bounds, pReplacementBitmap, isCustomBitmap);
SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
if (!isCustomBitmap)
}
result
-_EditDatePresenter::DrawResourceBitmap(Canvas& canvas, const FloatRectangle& bounds, Bitmap* pBitmap)
+_EditDatePresenter::DrawResourceBitmap(Canvas& canvas, const FloatRectangle& bounds, Bitmap* pBitmap, bool isCustomBitmap)
{
result r = E_SUCCESS;
}
else
{
- r = canvas.DrawBitmap(bounds, *pBitmap);
+ if (isCustomBitmap)
+ {
+ Canvas *pContentCanvas = __pEditDate->GetCanvasN(bounds);
+ SysTryReturnResult(NID_UI_CTRL, (pContentCanvas != null), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+ FloatPoint position;
+
+ position.x = (bounds.width - pBitmap->GetWidthF()) / 2;
+ position.y = (bounds.height - pBitmap->GetHeightF()) / 2;
+ r = pContentCanvas->DrawBitmap(position, *pBitmap);
+ delete pContentCanvas;
+ }
+ else
+ {
+ r = canvas.DrawBitmap(FloatPoint(bounds.x, bounds.y), *pBitmap);
+ }
+
SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
}
if (__isEnterKeyPressed)
{
__isEnterKeyPressed = false;
- __isFocused = true;
+
+ if (__pEditDate->IsFocusModeStateEnabled())
+ {
+ __isFocused = true;
+ }
}
int localeDateFormat = dateTimeUtils.GetLocaleDateFormat();
if (__focusId == DATETIME_ID_NONE)
_EditDatePresenter::OnFocusModeStateChanged(void)
{
__isFocused = false;
+ __isEnterKeyPressed = false;
__focusId = DATETIME_ID_NONE;
__pEditDate->Invalidate();
return;
}
bool
-_EditDatePresenter::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
+_EditDatePresenter::OnKeyReleased(const _Control& source, const _KeyCode& keyCode)
{
if (!__isFocused)
{
int displayValue = -1;
_DateTimeId boxId = DATETIME_ID_NONE;
- _KeyCode keyCode = keyInfo.GetKeyCode();
switch (keyCode)
{
pCanvas->Clear();
rect.x = 0.0f;
rect.y = 0.0f;
- r = DrawResourceBitmap(*pCanvas, rect, __pContentBgPressedColorReplacementBitmap);
isCustomBitmap = IS_CUSTOM_BITMAP(EDITTIME::CONTENT_BG_PRESSED);
+ r = DrawResourceBitmap(*pCanvas, rect, __pContentBgPressedColorReplacementBitmap, isCustomBitmap);
if (!isCustomBitmap)
{
pOldSimpleText = new (std::nothrow)TextSimple((const_cast <wchar_t*>(__lastSelectedValue.GetPointer())), __lastSelectedValue.GetLength(), TEXT_ELEMENT_SOURCE_TYPE_EXTERNAL);
SysTryCatch(NID_UI_CTRL, (pOldSimpleText != null), , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ pOldSimpleText->SetTextShadowEnabled(true);
+ pOldSimpleText->SetTextShadowOffset(FloatPoint(0.0f, -1.0f));
+
pCanvas = pOldVisualElement->GetCanvasN();
r = GetLastResult();
SysTryCatch(NID_UI_CTRL, (pCanvas != null), , r, "[%s] Propagating.", GetErrorMessage(r));
pNewSimpleText = new (std::nothrow)TextSimple((const_cast <wchar_t*>(newValue.GetPointer())), newValue.GetLength(), TEXT_ELEMENT_SOURCE_TYPE_EXTERNAL);
SysTryCatch(NID_UI_CTRL, (pNewSimpleText != null), , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ pNewSimpleText->SetTextShadowEnabled(true);
+ pNewSimpleText->SetTextShadowOffset(FloatPoint(0.0f, -1.0f));
+
pCanvas = pNewVisualElement->GetCanvasN();
r = GetLastResult();
SysTryCatch(NID_UI_CTRL, (pCanvas != null), , r, "[%s] Propagating.", GetErrorMessage(r));