#include "FUiCtrl_TableView.h"
#include "FUi_CoordinateSystemUtils.h"
#include "FUi_Math.h"
+#include "FUiCtrl_LabelImpl.h"
using namespace Tizen::Base;
using namespace Tizen::Base::Runtime;
GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth);
GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, annexHeight);
- __pItemAnnex = _Label::CreateLabelN();
+ __pItemAnnex = new (std::nothrow) Label();
r = GetLastResult();
SysTryReturn(NID_UI_CTRL, __pItemAnnex != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
GET_SHAPE_CONFIG(TABLEVIEW::ITEM_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, leftMargin);
float itemHeight = ((__customHeight > 0) ? __customHeight : GetBoundsF().height);
- __pItemAnnex->SetBounds(FloatRectangle(leftMargin, ((itemHeight - annexHeight) / 2), annexWidth, annexHeight));
+ __pItemAnnex->Construct(FloatRectangle(leftMargin, ((itemHeight - annexHeight) / 2), annexWidth, annexHeight), L"");
__pItemAnnex->SetBackgroundColor(Color(0, 0, 0, 0));
- AttachSystemChild(*__pItemAnnex);
+ AttachSystemChild(*GetLabelCore(__pItemAnnex));
}
return r;
GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth);
GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, annexHeight);
- __pItemAnnex = _Label::CreateLabelN();
+ __pItemAnnex = new (std::nothrow) Label();
r = GetLastResult();
SysTryReturn(NID_UI_CTRL, __pItemAnnex != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
GET_SHAPE_CONFIG(TABLEVIEW::ITEM_LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, leftMargin);
float itemHeight = ((__customHeight > 0) ? __customHeight : GetBoundsF().height);
- __pItemAnnex->SetBounds(FloatRectangle(leftMargin, ((itemHeight - annexHeight) / 2), annexWidth, annexHeight));
+ __pItemAnnex->Construct(FloatRectangle(leftMargin, ((itemHeight - annexHeight) / 2), annexWidth, annexHeight), L"");
__pItemAnnex->SetBackgroundColor(Color(0, 0, 0, 0));
- AttachSystemChild(*__pItemAnnex);
+ AttachSystemChild(*GetLabelCore(__pItemAnnex));
}
return r;
GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_ONOFF_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth);
GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_ONOFF_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, annexHeight);
- __pItemAnnex = _Label::CreateLabelN();
+ __pItemAnnex = new (std::nothrow) Label();
r = GetLastResult();
SysTryReturn(NID_UI_CTRL, __pItemAnnex != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
leftMargin += __pDrawingProperty->scrollMargin;
float itemHeight = ((__customHeight > 0) ? __customHeight : GetBoundsF().height);
- __pItemAnnex->SetBounds(FloatRectangle((GetBoundsF().width - annexWidth - leftMargin), ((itemHeight - annexHeight) / 2), annexWidth, annexHeight));
+ __pItemAnnex->Construct(FloatRectangle((GetBoundsF().width - annexWidth - leftMargin), ((itemHeight - annexHeight) / 2), annexWidth, annexHeight), L"");
__pItemAnnex->SetBackgroundColor(Color(0, 0, 0, 0));
- AttachSystemChild(*__pItemAnnex);
+ AttachSystemChild(*GetLabelCore(__pItemAnnex));
}
return r;
GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_MORE_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, annexWidth);
GET_SHAPE_CONFIG(TABLEVIEW::ITEM_ANNEX_MORE_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, annexHeight);
- __pItemAnnex = _Label::CreateLabelN();
+ __pItemAnnex = new (std::nothrow) Label();
r = GetLastResult();
SysTryReturn(NID_UI_CTRL, __pItemAnnex != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
leftMargin += __pDrawingProperty->scrollMargin;
float itemHeight = ((__customHeight > 0) ? __customHeight : GetBoundsF().height);
- __pItemAnnex->SetBounds(FloatRectangle((GetBoundsF().width - annexWidth - leftMargin), ((itemHeight - annexHeight) / 2), annexWidth, annexHeight));
+ __pItemAnnex->Construct(FloatRectangle((GetBoundsF().width - annexWidth - leftMargin), ((itemHeight - annexHeight) / 2), annexWidth, annexHeight), L"");
__pItemAnnex->SetBackgroundColor(Color(0, 0, 0, 0));
- AttachSystemChild(*__pItemAnnex);
+ AttachSystemChild(*GetLabelCore(__pItemAnnex));
}
return r;
}
+_Label*
+_TableViewItem::GetLabelCore(Label* label)
+{
+ if(label == null)
+ {
+ return null;
+ }
+
+ _LabelImpl* pImpl = _LabelImpl::GetInstance(*label);
+ return &pImpl->GetCore();
+}
+
void
_TableViewItem::ExposeContextItem(FloatRectangle itemBounds, float targetWidth)
{
{
__pressedControl = TABLE_VIEW_ITEM_PRESSED_ITEM;
}
- else if (&source == __pItemAnnex)
+ else if (&source == GetLabelCore(__pItemAnnex))
{
__pressedControl = TABLE_VIEW_ITEM_PRESSED_ANNEX;
{
__releasedControl = TABLE_VIEW_ITEM_PRESSED_ITEM;
}
- else if (&source == __pItemAnnex)
+ else if (&source == GetLabelCore(__pItemAnnex))
{
__releasedControl = TABLE_VIEW_ITEM_PRESSED_ANNEX;
}
SetItemChanged(true);
Invalidate();
}
- else if (&source == __pItemAnnex)
+ else if (&source == GetLabelCore(__pItemAnnex))
{
if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_DETAILED)
{
if ((__annexStyle == TABLE_VIEW_ANNEX_STYLE_MARK) || (__annexStyle == TABLE_VIEW_ANNEX_STYLE_RADIO))
{
- if (__pItemAnnex == &child)
+ if (GetLabelCore(__pItemAnnex) == &child)
{
return;
}
bounds.x += (leftMargin * 2) + annexWidth;
pControl->SetBounds(bounds);
}
- else if((__annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING) || (__annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER))
- {
- pControl->SetTouchPressThreshold(SENSITIVE);
- }
}
void
__individualSelectionControls.Remove(child, false);
}
- if (&child == __pSimpleItemText)
+ _Label* pSimpleItemTextCore = GetLabelCore(__pSimpleItemText);
+ _Label* pSimpleItemBitmapCore = GetLabelCore(__pSimpleItemBitmap);
+
+ if (&child == pSimpleItemTextCore)
{
__pSimpleItemText = null;
}
- if (&child == __pSimpleItemBitmap)
+ if (&child == pSimpleItemBitmapCore)
{
__pSimpleItemBitmap = null;
}
float annexWidth = 0.0f;
float annexHeight = 0.0f;
- Color canvasBackgroundColor;
-
if (__drawingStatus == TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL)
{
r = GET_BITMAP_CONFIG_N(TABLEVIEW::CHECKBOX_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pCheckBoxBg);
pCanvas = new (std::nothrow) Canvas();
SysTryCatch(NID_UI_CTRL, pCanvas != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
- GET_COLOR_CONFIG(TABLEVIEW::ITEM_ANNEX_CANVAS_BG_NORMAL, canvasBackgroundColor);
-
r = pCanvas->Construct(bounds);
pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
pCanvas->Clear();
if(__pItemAnnex)
{
__pItemAnnex->SetBackgroundBitmap(*pMergeBitmap);
- __pItemAnnex->Invalidate();
+ __pItemAnnex->Invalidate(false);
}
CATCH:
FloatRectangle bounds;
float annexWidth = 0.0f;
float annexHeight = 0.0f;
- Color canvasBackgroundColor;
if(__enabledState)
{
pCanvas = new (std::nothrow) Canvas();
SysTryCatch(NID_UI_CTRL, pCanvas != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
- GET_COLOR_CONFIG(TABLEVIEW::ITEM_ANNEX_CANVAS_BG_NORMAL, canvasBackgroundColor);
-
pCanvas->Construct(bounds);
pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
pCanvas->Clear();
_BitmapImpl::ConvertToNonpremultiplied(*pMergeBitmap, true);
__pItemAnnex->SetBackgroundBitmap(*pMergeBitmap);
- __pItemAnnex->Invalidate();
+ __pItemAnnex->Invalidate(false);
CATCH:
delete pCheckBox;
FloatRectangle bounds;
float annexWidth = 0.0f;
float annexHeight = 0.0f;
- Color canvasBackgroundColor;
if(__enabledState)
{
pCanvas = new (std::nothrow) Canvas();
SysTryCatch(NID_UI_CTRL, pCanvas != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
- GET_COLOR_CONFIG(TABLEVIEW::ITEM_ANNEX_CANVAS_BG_NORMAL, canvasBackgroundColor);
-
pCanvas->Construct(bounds);
pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
pCanvas->Clear();
_BitmapImpl::ConvertToNonpremultiplied(*pMergeBitmap, true);
__pItemAnnex->SetBackgroundBitmap(*pMergeBitmap);
- __pItemAnnex->Invalidate();
+ __pItemAnnex->Invalidate(false);
CATCH:
delete pRadioButton;
float annexWidth = 0.0f;
float annexHeight = 0.0f;
float annexMargin = 0.0f;
- Color canvasBackgroundColor;
if (IsChecked() == true)
{
pCanvas = new (std::nothrow) Canvas();
SysTryCatch(NID_UI_CTRL, pCanvas != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
- GET_COLOR_CONFIG(TABLEVIEW::ITEM_ANNEX_CANVAS_BG_NORMAL, canvasBackgroundColor);
-
pCanvas->Construct(bounds);
pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
pCanvas->Clear();
_BitmapImpl::ConvertToNonpremultiplied(*pMergeBitmap, true);
__pItemAnnex->SetBackgroundBitmap(*pMergeBitmap);
- __pItemAnnex->Invalidate();
+ __pItemAnnex->Invalidate(false);
CATCH:
delete pOnOffButton;
float annexMargin = 0.0f;
float annexAbsoluteBoundsStart = 0.0f;
float annexAbsoluteBoundsEnd = 0.0f;
- Color canvasBackgroundColor;
float nextHandlerBounds = 0;
r = GET_BITMAP_CONFIG_N(TABLEVIEW::ONOFFBUTTON_HANDLER, BITMAP_PIXEL_FORMAT_ARGB8888, pOnOffButtonHandler);
pCanvas = new (std::nothrow) Canvas();
SysTryCatch(NID_UI_CTRL, pCanvas != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
- GET_COLOR_CONFIG(TABLEVIEW::ITEM_ANNEX_CANVAS_BG_NORMAL, canvasBackgroundColor);
-
pCanvas->Construct(bounds);
pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
pCanvas->Clear();
_BitmapImpl::ConvertToNonpremultiplied(*pMergeBitmap, true);
__pItemAnnex->SetBackgroundBitmap(*pMergeBitmap);
- __pItemAnnex->Invalidate();
+ __pItemAnnex->Invalidate(false);
CATCH:
delete pOnOffButton;
FloatRectangle bounds;
float annexWidth = 0.0f;
float annexHeight = 0.0f;
- Color canvasBackgroundColor;
bool themeBackgroundBitmap = false;
themeBackgroundBitmap = IS_CUSTOM_BITMAP(TABLEVIEW::CIRCLE_BUTTON_BG_NORMAL);
pCanvas = new (std::nothrow) Canvas();
SysTryCatch(NID_UI_CTRL, pCanvas != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
- GET_COLOR_CONFIG(TABLEVIEW::ITEM_ANNEX_CANVAS_BG_NORMAL, canvasBackgroundColor);
-
pCanvas->Construct(bounds);
pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
pCanvas->Clear();
_BitmapImpl::ConvertToNonpremultiplied(*pMergeBitmap, true);
__pItemAnnex->SetBackgroundBitmap(*pMergeBitmap);
- __pItemAnnex->Invalidate();
+ __pItemAnnex->Invalidate(false);
CATCH:
delete pDetail;
}
__pSimpleItemText->SetTextColor(textColor);
- __pSimpleItemText->Invalidate();
+ __pSimpleItemText->Invalidate(false);
}
}
result
__pSimpleItemBitmap->SetBackgroundBitmap(*pBitmap);
__pSimpleItemBitmap->SetBounds(bitmapRect);
- if (!__pSimpleItemBitmap->HasParent())
+ _Label* pSimpleItemBitmapCore = GetLabelCore(__pSimpleItemBitmap);
+ if (!pSimpleItemBitmapCore->HasParent())
{
- r = AttachChild(*__pSimpleItemBitmap);
+ r = AttachChild(*pSimpleItemBitmapCore);
SysTryReturn(NID_UI_CTRL, __pSimpleItemBitmap != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
}
}
__pSimpleItemText->SetText(text);
__pSimpleItemText->SetBounds(textRect);
- if (!__pSimpleItemText->HasParent())
+ _Label* pSimpleItemTextCore = GetLabelCore(__pSimpleItemText);
+ if (!pSimpleItemTextCore->HasParent())
{
- r = AttachChild(*__pSimpleItemText);
+ r = AttachChild(*pSimpleItemTextCore);
SysTryReturn(NID_UI_CTRL, __pSimpleItemText != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
}
}
if (__pSimpleItemText == null)
{
- __pSimpleItemText = _Label::CreateLabelN();
+ __pSimpleItemText = new (std::nothrow) Label();
r = GetLastResult();
SysTryReturn(NID_UI_CTRL, __pSimpleItemText != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ __pSimpleItemText->Construct(FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f), L"");
+
__pSimpleItemText->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
__pSimpleItemText->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
if (__itemType == TABLE_VIEW_ITEM_TYPE_TITLE)
{
if (__pSimpleItemBitmap == null)
{
- __pSimpleItemBitmap = _Label::CreateLabelN();
+ __pSimpleItemBitmap = new (std::nothrow) Label();
+
+ r = GetLastResult();
SysTryReturn(NID_UI_CTRL, __pSimpleItemBitmap != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ __pSimpleItemText->Construct(FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f), L"");
+
__pSimpleItemText->SetBackgroundColor(Color(0, 0, 0, 0));
}
GET_COLOR_CONFIG(TABLEVIEW::GROUPITEM_TEXT_NORMAL, textColor);
GET_SHAPE_CONFIG(TABLEVIEW::GROUPITEM_DEFAULT_TEXT_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, contentsHeight);
- __pHeaderFooterItemText = _Label::CreateLabelN();
+ __pHeaderFooterItemText = new (std::nothrow) Label();
r = GetLastResult();
SysTryReturn(NID_UI_CTRL, __pHeaderFooterItemText != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
- __pHeaderFooterItemText->SetTextHorizontalAlignment(alignment);
- __pHeaderFooterItemText->SetTextColor(textColor);
- __pHeaderFooterItemText->SetBackgroundColor(Color(0, 0, 0, 0));
-
if (isHeader)
{
positionY = GetBoundsF().height - contentsHeight;
}
+ __pHeaderFooterItemText->Construct(FloatRectangle(0.0f, positionY, GetBoundsF().width, contentsHeight), text);
- __pHeaderFooterItemText->SetBounds(FloatRectangle(0.0f, positionY, GetBoundsF().width, contentsHeight));
+ __pHeaderFooterItemText->SetTextHorizontalAlignment(alignment);
+ __pHeaderFooterItemText->SetTextColor(textColor);
+ __pHeaderFooterItemText->SetBackgroundColor(Color(0, 0, 0, 0));
- AttachChild(*__pHeaderFooterItemText);
+ _Label* pHeaderFooterItemTextCore = GetLabelCore(__pHeaderFooterItemText);
+ AttachChild(*pHeaderFooterItemTextCore);
}
- __pHeaderFooterItemText->SetText(text);
-
return E_SUCCESS;
}
if (__pHeaderFooterItemText != null)
{
__pHeaderFooterItemText->SetTextHorizontalAlignment(alignment);
- __pHeaderFooterItemText->Invalidate();
+ __pHeaderFooterItemText->Invalidate(false);
}
return E_SUCCESS;
// h align
if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING || __annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER || __annexStyle == TABLE_VIEW_ANNEX_STYLE_DETAILED)
{
- if (__pItemAnnex->HasParent())
+ _Label* pAnnexCore = GetLabelCore(__pItemAnnex);
+ if (pAnnexCore->HasParent())
{
FloatRectangle annexBounds = __pItemAnnex->GetBoundsF();
float annexPositionX = annexBounds.x;