{
if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*__pBackgroundNormalBitmap[status]))
{
- r = canvas.DrawNinePatchedBitmap(__windowBounds, *__pBackgroundNormalBitmap[status]);
+ r = canvas.DrawNinePatchedBitmap(FloatRectangle(0.0f, 0.0f, __windowBounds.width, __windowBounds.height), *__pBackgroundNormalBitmap[status]);
SysTryReturnVoidResult(NID_UI_CTRL, (r == E_SUCCESS), r, "[%s] Propagating.", GetErrorMessage(r));
}
else
{
- r = canvas.DrawBitmap(__windowBounds, *__pBackgroundNormalBitmap[status]);
+ FloatPoint position(0.0f, 0.0f);
+ position.x = (__windowBounds.width - __pBackgroundNormalBitmap[status]->GetWidthF()) / 2;
+ position.y = (__windowBounds.height - __pBackgroundNormalBitmap[status]->GetHeightF()) / 2;
+ r = canvas.DrawBitmap(position, *__pBackgroundNormalBitmap[status]);
SysTryReturnVoidResult(NID_UI_CTRL, (r == E_SUCCESS), r, "[%s] Propagating.", GetErrorMessage(r));
}
}
{
if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*__pBackgroundEffectBitmap[status]))
{
- r = canvas.DrawNinePatchedBitmap(__windowBounds, *__pBackgroundEffectBitmap[status]);
+ r = canvas.DrawNinePatchedBitmap(FloatRectangle(0.0f, 0.0f, __windowBounds.width, __windowBounds.height), *__pBackgroundEffectBitmap[status]);
SysTryReturnVoidResult(NID_UI_CTRL, (r == E_SUCCESS), r, "[%s] Propagating.", GetErrorMessage(r));
}
else
{
- r = canvas.DrawBitmap(__windowBounds, *__pBackgroundEffectBitmap[status]);
+ r = canvas.DrawBitmap(FloatPoint(0.0f, 0.0f), *__pBackgroundEffectBitmap[status]);
SysTryReturnVoidResult(NID_UI_CTRL, (r == E_SUCCESS), r, "[%s] Propagating.", GetErrorMessage(r));
}
}
r = __pTextObject->SetForegroundColor(__textColor[status], 0, __pTextObject->GetTextLength());
SysTryReturnVoidResult(NID_UI_CTRL, (r == E_SUCCESS), r, "[%s] Propagating.", GetErrorMessage(r));
- r = __pTextObject->SetBounds(__windowBounds);
+ r = __pTextObject->SetBounds(FloatRectangle(0.0f, 0.0f, __windowBounds.width, __windowBounds.height));
SysTryReturnVoidResult(NID_UI_CTRL, (r == E_SUCCESS), r, "[%s] Propagating.", GetErrorMessage(r));
r = __pTextObject->Draw(*_CanvasImpl::GetInstance(canvas));
for (int i = 0; i < __outputBoxMaxCount; i++)
{
- DrawDateTimeDisplayBox(*pCanvas, i);
+ Canvas *pBoxCanvas = pVisualElement->GetCanvasN(__pDisplayBox[i]->GetDisplayBoxBounds());
+ SysTryReturnResult(NID_UI_CTRL, (pBoxCanvas != null), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+ DrawDateTimeDisplayBox(*pBoxCanvas, i);
+ delete pBoxCanvas;
+ }
+
+ Canvas *pAmPmCanvas = null;
+ if (__pPmBox != null)
+ {
+ pAmPmCanvas = pVisualElement->GetCanvasN(__pPmBox->GetDisplayBoxBounds());
+ SysTryReturnResult(NID_UI_CTRL, (pAmPmCanvas != null), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
}
if ((__pickerStyle & DATETIME_OUTPUT_STYLE_DATE) && (__pickerStyle & DATETIME_OUTPUT_STYLE_TIME))
{
DrawDividers(*pCanvas);
DrawColon(*pCanvas);
- DrawPm(*pCanvas);
+ DrawPm(*pAmPmCanvas);
}
else if (__pickerStyle & DATETIME_OUTPUT_STYLE_TIME)
{
DrawColon(*pCanvas);
- DrawPm(*pCanvas);
+ DrawPm(*pAmPmCanvas);
}
+ delete pAmPmCanvas;
+
if (unlikely(_AccessibilityManager::IsActivated()))
{
SetAccessibilityElementText();
}
else
{
- canvas.DrawBitmap(bounds, *__pBgNormalBitmap);
+ canvas.DrawBitmap(FloatPoint(bounds.x, bounds.y), *__pBgNormalBitmap);
SysTryReturnVoidResult(NID_UI_CTRL, (r == E_SUCCESS), r, "[%s] Propagating.", GetErrorMessage(r));
}
}
}
else
{
- canvas.DrawBitmap(bounds, *__pBgEffectBitmap);
+ canvas.DrawBitmap(FloatPoint(bounds.x, bounds.y), *__pBgEffectBitmap);
SysTryReturnVoidResult(NID_UI_CTRL, (r == E_SUCCESS), r, "[%s] Propagating.", GetErrorMessage(r));
}
}
{
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;
}
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));
}
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)
{
}
result
-_EditTimePresenter::DrawResourceBitmap(Canvas& canvas, const FloatRectangle& bounds, Bitmap* pBitmap)
+_EditTimePresenter::DrawResourceBitmap(Canvas& canvas, const FloatRectangle& bounds, Bitmap* pBitmap, bool isCustomBitmap)
{
result r = E_SUCCESS;
}
else
{
- r = canvas.DrawBitmap(bounds, *pBitmap);
+ if (isCustomBitmap)
+ {
+ Canvas *pContentCanvas = __pEditTime->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 (!__24hours)
{
- r = DrawResourceBitmap(*pCanvas, ampmBounds, pReplacementBitmap);
+ r = DrawResourceBitmap(*pCanvas, ampmBounds, pReplacementBitmap, isCustomBitmap);
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
if (!isCustomBitmap)
{
FloatRectangle bounds(0.0f, 0.0f, 0.0f, 0.0f);
+ Canvas* pContentCanvas = null;
Canvas* pCanvas = __pEditTime->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_HOUR)
{
}
else
{
- r = pCanvas->DrawBitmap(bounds, *__pContentBgHighlightedColorReplacementBitmap);
+ pContentCanvas = __pEditTime->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;
}
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)
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)
{
result DrawTitle(Tizen::Graphics::Canvas& canvas);
result DrawText(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::FloatRectangle& bounds, const Tizen::Base::String& text, _DateTimeId boxId = DATETIME_ID_NONE);
result DrawContentBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::FloatRectangle& bounds, _DateTimeId displayBoxId);
- result DrawResourceBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::FloatRectangle& bounds, Tizen::Graphics::Bitmap* pBitmap);
+ result DrawResourceBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::FloatRectangle& bounds, Tizen::Graphics::Bitmap* pBitmap, bool isCustomBitmap = false);
_DateTimeId GetBoxIdFromPosition(const Tizen::Graphics::FloatPoint& point) const;
private:
result DrawColon(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::FloatRectangle& bounds);
_DateTimeId GetBoxIdFromPosition(const Tizen::Graphics::FloatPoint& point) const;
result LoadResource(void);
- result DrawResourceBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::FloatRectangle& bounds, Tizen::Graphics::Bitmap* pBitmap);
+ result DrawResourceBitmap(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::FloatRectangle& bounds, Tizen::Graphics::Bitmap* pBitmap, bool isCustomBitmap = false);
float GetTimeElementWidth(void) const;
private: