#include <stdlib.h>
#include <FBaseSysLog.h>
-#include <FBaseFloat.h>
#include "FUi_UiBuilder.h"
#include "FUi_UiBuilderControlLayout.h"
#include "FUi_CoordinateSystemUtils.h"
if (x.IsEmpty() == false)
{
- Base::Float::Parse(x, floatX);
+ floatX = _CoordinateSystemUtils::ConvertToFloat(x);
}
if (y.IsEmpty() == false)
{
- Base::Float::Parse(y, floatY);
+ floatY = _CoordinateSystemUtils::ConvertToFloat(y);
}
if (width.IsEmpty() == false)
{
- Base::Float::Parse(width, floatWidth);
+ floatWidth = _CoordinateSystemUtils::ConvertToFloat(width);
}
if (height.IsEmpty() == false)
{
- Base::Float::Parse(height, floatHeight);
+ floatHeight = _CoordinateSystemUtils::ConvertToFloat(height);
}
__floatRect.x = floatX;
#include "FUi_UiBuilder.h"
#include "FUiCtrl_ButtonImpl.h"
#include "FUiCtrl_Button.h"
+#include "FUi_CoordinateSystemUtils.h"
using namespace Tizen::App;
using namespace Tizen::Base;
if (pControl->GetElement(L"NormalBitmapX", elementString))
{
- Base::Float::Parse(elementString, position.x);
+ position.x = _CoordinateSystemUtils::ConvertToFloat(elementString);
if ((position.x < 0.0f) || (position.x > ((Control*) (GetContainer()))->GetBoundsF().width - ((Control*) (GetContainer()))->GetBoundsF().x))
{
position.x = 0.0f;
if (pControl->GetElement(L"NormalBitmapY", elementString))
{
- Base::Float::Parse(elementString, position.y);
+ position.y = _CoordinateSystemUtils::ConvertToFloat(elementString);
if (position.y < 0.0f || (position.y > ((Control*) (GetContainer()))->GetBoundsF().width - ((Control*) (GetContainer()))->GetBoundsF().x))
{
position.y = 0.0f;
pPressedBitmap = LoadBitmapN(elementString);
if (pControl->GetElement(L"PressedBitmapX", elementString))
{
- Base::Float::Parse(elementString, position.x);
+ position.x = _CoordinateSystemUtils::ConvertToFloat(elementString);
if ((position.x < 0.0f) || (position.x > ((Control*) (GetContainer()))->GetBoundsF().width - ((Control*) (GetContainer()))->GetBoundsF().x))
{
position.x = 0.0f;
if (pControl->GetElement(L"PressedBitmapY", elementString))
{
- Base::Float::Parse(elementString, position.y);
+ position.y = _CoordinateSystemUtils::ConvertToFloat(elementString);
if (position.y < 0.0f || (position.y > ((Control*) (GetContainer()))->GetBoundsF().width - ((Control*) (GetContainer()))->GetBoundsF().x))
{
position.y = 0.0f;
pDisabledBitmap = LoadBitmapN(elementString);
if (pControl->GetElement(L"DisabledBitmapX", elementString))
{
- Base::Float::Parse(elementString, position.x);
+ position.x = _CoordinateSystemUtils::ConvertToFloat(elementString);
if ((position.x < 0.0f) || (position.x > ((Control*) (GetContainer()))->GetBoundsF().width - ((Control*) (GetContainer()))->GetBoundsF().x))
{
position.x = 0.0f;
if (pControl->GetElement(L"DisabledBitmapY", elementString))
{
- Base::Float::Parse(elementString, position.y);
+ position.y = _CoordinateSystemUtils::ConvertToFloat(elementString);
if (position.y < 0.0f || (position.y > ((Control*) (GetContainer()))->GetBoundsF().width - ((Control*) (GetContainer()))->GetBoundsF().x))
{
position.y = 0.0f;
{
_ICoordinateSystemTransformer* pTransform = GetTransformer();
- Base::Float::Parse(elementString, size);
+ size = _CoordinateSystemUtils::ConvertToFloat(elementString);
if (pTransform)
{
if (pControl->GetElement(L"textSize", elementString))
{
- Base::Float::Parse(elementString, fontSize);
+ fontSize = _CoordinateSystemUtils::ConvertToFloat(elementString);
_ICoordinateSystemTransformer* pTransform = GetTransformer();
if (pTransform)
{
if (pControl->GetElement(L"horizontalMargin", elementString))
{
- Base::Float::Parse(elementString, horizontalMargin);
+ horizontalMargin= _CoordinateSystemUtils::ConvertToFloat(elementString);
r = pEditArea->SetMargin(EDIT_MARGIN_TYPE_HORIZONTAL, horizontalMargin);
}
if (pControl->GetElement(L"verticalMargin", elementString))
{
- Base::Float::Parse(elementString, verticalMargin);
+ verticalMargin= _CoordinateSystemUtils::ConvertToFloat(elementString);
r = pEditArea->SetMargin(EDIT_MARGIN_TYPE_VERTICAL, verticalMargin);
}
#include "FUiCtrl_PublicScrollPanelEvent.h"
#include "FUiCtrl_PublicTextBlockEvent.h"
#include "FUiCtrl_PublicTextEvent.h"
+#include "FUi_CoordinateSystemUtils.h"
using namespace Tizen::App;
using namespace Tizen::Base;
if (pControl->GetElement(L"textSize", elementString))
{
- Base::Float::Parse(elementString, fontSize);
+ fontSize = _CoordinateSystemUtils::ConvertToFloat(elementString);
_ICoordinateSystemTransformer* pTransform = GetTransformer();
if (pTransform)
{
if (pControl->GetElement(L"horizontalMargin", elementString))
{
- Base::Float::Parse(elementString, horizontalMargin);
+ horizontalMargin = _CoordinateSystemUtils::ConvertToFloat(elementString);
r = pEditField->SetMargin(EDIT_MARGIN_TYPE_HORIZONTAL, horizontalMargin);
}
if (pControl->GetElement(L"verticalMargin", elementString))
{
- Base::Float::Parse(elementString, verticalMargin);
+ verticalMargin = _CoordinateSystemUtils::ConvertToFloat(elementString);
r = pEditField->SetMargin(EDIT_MARGIN_TYPE_VERTICAL, verticalMargin);
}
if (pControl->GetElement(L"textSize", elementString))
{
- Base::Float::Parse(elementString, textSize);
+ textSize = _CoordinateSystemUtils::ConvertToFloat(elementString);
_ICoordinateSystemTransformer* pTransform = GetTransformer();
if (pTransform)
{
if (pControl->GetElement(L"verticalMargin", elementString))
{
- Base::Float::Parse(elementString, verticalMarin);
+ verticalMarin = _CoordinateSystemUtils::ConvertToFloat(elementString);
r = pExpandableEditArea->SetMargin(EDIT_MARGIN_TYPE_VERTICAL, verticalMarin);
}
if (pControl->GetElement(L"horizontalMargin", elementString))
{
- Base::Float::Parse(elementString, horizontalMargin);
+ horizontalMargin = _CoordinateSystemUtils::ConvertToFloat(elementString);
r = pExpandableEditArea->SetMargin(EDIT_MARGIN_TYPE_HORIZONTAL, horizontalMargin);
}
if (pControl->GetElement("lineWidth", elementString))
{
- Float::Parse(elementString, lineWidth);
+ lineWidth = _CoordinateSystemUtils::ConvertToFloat(elementString);
}
rect = pControlProperty->GetRectF();
#include "FUiCtrl_IconListViewItemEventArg.h"
#include "FUiCtrl_ScrollEvent.h"
#include "FUiCtrl_ScrollEventArg.h"
+#include "FUi_CoordinateSystemUtils.h"
using namespace Tizen::Base;
using namespace Tizen::Graphics;
// Get ItemBitmapSize(width)
if (pControl->GetElement("itemBitmapWidth", elementString))
{
- Base::Float::Parse(elementString, itemBitmapSize.width);
+ itemBitmapSize.width = _CoordinateSystemUtils::ConvertToFloat(elementString);
}
// Get ItemBitmapSize(height)
if (pControl->GetElement("itemBitmapHeight", elementString))
{
- Base::Float::Parse(elementString, itemBitmapSize.height);
+ itemBitmapSize.height = _CoordinateSystemUtils::ConvertToFloat(elementString);
}
// Get style
if (pControl->GetElement("itemHorizontalSpacing", elementString))
{
float spacing = 0.0f;
- Base::Float::Parse(elementString, spacing);
+ spacing = _CoordinateSystemUtils::ConvertToFloat(elementString);
pIconListView->SetItemSpacing(spacing, pIconListView->GetItemVerticalSpacingF());
}
if (pControl->GetElement("itemVerticalSpacing", elementString))
{
float spacing = 0.0f;
- Base::Float::Parse(elementString, spacing);
+ spacing = _CoordinateSystemUtils::ConvertToFloat(elementString);
pIconListView->SetItemSpacing(pIconListView->GetItemHorizontalSpacingF(), spacing);
}
if (pControl->GetElement("itemTextSize", elementString))
{
float size = 0.0f;
- Base::Float::Parse(elementString, size);
+ size = _CoordinateSystemUtils::ConvertToFloat(elementString);
_ICoordinateSystemTransformer* pTransform = GetTransformer();
if (pTransform)
{
#include "FUi_UiBuilder.h"
#include "FUiCtrl_LabelImpl.h"
#include "FUiCtrl_Label.h"
+#include "FUi_CoordinateSystemUtils.h"
using namespace Tizen::App;
if (pControl->GetElement(L"textSize", elementString))
{
- Base::Float::Parse(elementString, size);
+ size = _CoordinateSystemUtils::ConvertToFloat(elementString);
_ICoordinateSystemTransformer* pTransform = GetTransformer();
if (pTransform)
{
#include "FUiCtrl_ScrollEvent.h"
#include "FUiCtrl_ScrollEventArg.h"
#include "FUiCtrl_ScrollPanelImpl.h"
+#include "FUi_CoordinateSystemUtils.h"
using namespace Tizen::App;
using namespace Tizen::Graphics;
if (pControl->GetElement(L"clientAreaWidth", elementString) || pControl->GetElement(L"ClientAreaWidth", elementString))
{
float width = 0.0f;
- Base::Float::Parse(elementString, width);
+ width = _CoordinateSystemUtils::ConvertToFloat(elementString);
pScrollPanel->SetClientAreaWidth(width);
}
}
if (pControl->GetElement(L"clientAreaHeight", elementString) || pControl->GetElement(L"ClientAreaHeight", elementString))
{
float height = 0.0f;
- Base::Float::Parse(elementString, height);
+ height = _CoordinateSystemUtils::ConvertToFloat(elementString);
pScrollPanel->SetClientAreaWidth(height);
}
}
if (pControl->GetElement("searchFieldTextSize", elementString))
{
- Base::Float::Parse(elementString, searchFieldTextSize);
+ searchFieldTextSize = _CoordinateSystemUtils::ConvertToFloat(elementString);
_ICoordinateSystemTransformer* pTransform = GetTransformer();
if (pTransform)
{
if (pControl->GetElement("minDividerPosition", elementString))
{
- Base::Float::Parse(elementString, minDividerPosition);
+ minDividerPosition = _CoordinateSystemUtils::ConvertToFloat(elementString);
pSplitPanel->SetMinimumDividerPosition(minDividerPosition);
}
if (pControl->GetElement("maxDividerPosition", elementString))
{
- Base::Float::Parse(elementString, maxDividerPosition);
+ maxDividerPosition = _CoordinateSystemUtils::ConvertToFloat(elementString);
pSplitPanel->SetMaximumDividerPosition(maxDividerPosition);
}
if (pControl->GetElement("dividerPosition", elementString))
{
- Base::Float::Parse(elementString, dividerPosition);
+ dividerPosition = _CoordinateSystemUtils::ConvertToFloat(elementString);
pSplitPanel->SetDividerPosition(dividerPosition);
}
#include "FUiCtrl_TextBoxImpl.h"
#include "FUiCtrl_PublicTextBlockEvent.h"
#include "FUiCtrl_PublicLinkEvent.h"
+#include "FUi_CoordinateSystemUtils.h"
using namespace Tizen::Base;
using namespace Tizen::Base::Runtime;
if (pControl->GetElement("textSize", elementString))
{
- Base::Float::Parse(elementString, textSize);
+ textSize = _CoordinateSystemUtils::ConvertToFloat(elementString);
_ICoordinateSystemTransformer* pTransform = GetTransformer();
if (pTransform)
{
if (pControl->GetElement("lineSpacingExtra", elementString))
{
- Base::Float::Parse(elementString, lineSpacingExtra);
-
+ lineSpacingExtra = _CoordinateSystemUtils::ConvertToFloat(elementString);
if (pControl->GetElement("lineSpacingMultiplier", elementString))
{
Base::Integer::Parse(elementString, lineSpacingMultiplier);
#define _FUI_INTERNAL_COORDINATE_SYSTEM_UTILS_H_
#include <math.h>
+#include <unique_ptr.h>
#include <FBaseSysLog.h>
#include <FBaseErrors.h>
+#include <FBase_StringConverter.h>
#include <FGrpFloatRectangle.h>
#include <FGrpFloatPoint.h>
#include <FGrpFloatDimension.h>
}
static float
+ ConvertToFloat(const Tizen::Base::String& floatString)
+ {
+ if (floatString.IsEmpty() == true)
+ {
+ return 0.0f;
+ }
+ std::unique_ptr<char[]> pFloatChar(Tizen::Base::_StringConverter::CopyToCharArrayN(floatString.GetPointer()));
+ float convertFolat = atof(pFloatChar.get());
+ return convertFolat;
+ }
+
+ static float
ConvertToFloat(int scalar)
{
return scalar;
#include <FGrp_BitmapImpl.h>
#include "FUi_UiBuilderControlMaker.h"
#include "FUi_UiBuilder.h"
+#include "FUi_CoordinateSystemUtils.h"
using namespace Tizen::Base;
using namespace Tizen::Ui;
if (pControlProperty->GetLayoutElement(tempString, gridLayoutContainerPropertyValue))
{
- Float::Parse(gridLayoutContainerPropertyValue, layoutParam.columnSpacing);
+ layoutParam.columnSpacing = _CoordinateSystemUtils::ConvertToFloat(gridLayoutContainerPropertyValue);
r = layout.SetColumnSpacing(i - 1, layoutParam.columnSpacing);
if (IsFailed(r))
{
if (pControlProperty->GetLayoutElement(tempString, gridLayoutContainerPropertyValue))
{
- Float::Parse(gridLayoutContainerPropertyValue, layoutParam.rowSpacing);
+ layoutParam.rowSpacing = _CoordinateSystemUtils::ConvertToFloat(gridLayoutContainerPropertyValue);
r = layout.SetRowSpacing(i - 1, layoutParam.rowSpacing);
if (IsFailed(r))
{
if (pControlProperty->GetLayoutElement(L"marginLeft", gridLayoutValue))
{
marginSet = true;
- Float::Parse(gridLayoutValue, layoutParam.marginLeft);
+ layoutParam.marginLeft = _CoordinateSystemUtils::ConvertToFloat(gridLayoutValue);
if (pTransform)
{
if (pControlProperty->GetLayoutElement(L"marginRight", gridLayoutValue))
{
marginSet = true;
- Float::Parse(gridLayoutValue, layoutParam.marginRight);
+ layoutParam.marginRight = _CoordinateSystemUtils::ConvertToFloat(gridLayoutValue);
if (pTransform)
{
if (pControlProperty->GetLayoutElement(L"marginTop", gridLayoutValue))
{
marginSet = true;
- Float::Parse(gridLayoutValue, layoutParam.marginTop);
+ layoutParam.marginTop = _CoordinateSystemUtils::ConvertToFloat(gridLayoutValue);
if (pTransform)
{
if (pControlProperty->GetLayoutElement(L"marginBottom", gridLayoutValue))
{
marginSet = true;
- Float::Parse(gridLayoutValue, layoutParam.marginBottom);
+ layoutParam.marginBottom = _CoordinateSystemUtils::ConvertToFloat(gridLayoutValue);
if (pTransform)
{
if (pControlProperty->GetLayoutElement(L"height", horizontalBoxLayoutValue))
{
- Float::Parse(horizontalBoxLayoutValue, layoutParam.height);
+ layoutParam.height = _CoordinateSystemUtils::ConvertToFloat(horizontalBoxLayoutValue);
if (pTransform)
{
if (pControlProperty->GetLayoutElement(L"verticalTopMargin", horizontalBoxLayoutValue))
{
marginSet = true;
- Float::Parse(horizontalBoxLayoutValue, layoutParam.verticalTopMargin);
+ layoutParam.verticalTopMargin = _CoordinateSystemUtils::ConvertToFloat(horizontalBoxLayoutValue);
if (pTransform)
{
if (pControlProperty->GetLayoutElement(L"verticalBottomMargin", horizontalBoxLayoutValue))
{
marginSet = true;
- Float::Parse(horizontalBoxLayoutValue, layoutParam.verticalBottomMargin);
+ layoutParam.verticalBottomMargin = _CoordinateSystemUtils::ConvertToFloat(horizontalBoxLayoutValue);
if (pTransform)
{
if (pControlProperty->GetLayoutElement(L"spacing", horizontalBoxLayoutValue))
{
- Float::Parse(horizontalBoxLayoutValue, layoutParam.spacing);
+ layoutParam.spacing = _CoordinateSystemUtils::ConvertToFloat(horizontalBoxLayoutValue);
if (pTransform)
{
if (pControlProperty->GetLayoutElement(L"weight", horizontalBoxLayoutValue))
{
- Float::Parse(horizontalBoxLayoutValue, layoutParam.weight);
+ layoutParam.weight = _CoordinateSystemUtils::ConvertToFloat(horizontalBoxLayoutValue);
layout.SetWeight(control, layoutParam.weight);
}
else
if (pControlProperty->GetLayoutElement(L"width", horizontalBoxLayoutValue))
{
- Float::Parse(horizontalBoxLayoutValue, layoutParam.width);
+ layoutParam.width = _CoordinateSystemUtils::ConvertToFloat(horizontalBoxLayoutValue);
if (pTransform)
{
if (pControlProperty->GetLayoutElement(L"height", verticalBoxLayoutValue))
{
- Float::Parse(verticalBoxLayoutValue, layoutParam.height);
+ layoutParam.height = _CoordinateSystemUtils::ConvertToFloat(verticalBoxLayoutValue);
if (pTransform)
{
if (pControlProperty->GetLayoutElement(L"horizontalLeftMargin", verticalBoxLayoutValue))
{
marginSet = true;
- Float::Parse(verticalBoxLayoutValue, layoutParam.horizontalLeftMargin);
+ layoutParam.horizontalLeftMargin = _CoordinateSystemUtils::ConvertToFloat(verticalBoxLayoutValue);
if (pTransform)
{
layoutParam.horizontalLeftMargin = pTransform->Transform(layoutParam.horizontalLeftMargin);
if (pControlProperty->GetLayoutElement(L"horizontalRightMargin", verticalBoxLayoutValue))
{
marginSet = true;
- Float::Parse(verticalBoxLayoutValue, layoutParam.horizontalRightMargin);
+ layoutParam.horizontalRightMargin = _CoordinateSystemUtils::ConvertToFloat(verticalBoxLayoutValue);
if (pTransform)
{
layoutParam.horizontalRightMargin = pTransform->Transform(layoutParam.horizontalRightMargin);
if (pControlProperty->GetLayoutElement(L"spacing", verticalBoxLayoutValue))
{
- Float::Parse(verticalBoxLayoutValue, layoutParam.spacing);
+ layoutParam.spacing = _CoordinateSystemUtils::ConvertToFloat(verticalBoxLayoutValue);
if (pTransform)
{
layoutParam.spacing = pTransform->Transform(layoutParam.spacing);
if (pControlProperty->GetLayoutElement(L"weight", verticalBoxLayoutValue))
{
- Float::Parse(verticalBoxLayoutValue, layoutParam.weight);
+ layoutParam.weight = _CoordinateSystemUtils::ConvertToFloat(verticalBoxLayoutValue);
layout.SetWeight(control, layoutParam.weight);
}
else
if (pControlProperty->GetLayoutElement(L"width", verticalBoxLayoutValue))
{
- Float::Parse(verticalBoxLayoutValue, layoutParam.width);
+ layoutParam.width = _CoordinateSystemUtils::ConvertToFloat(verticalBoxLayoutValue);
if (pTransform)
{
layoutParam.width = pTransform->Transform(layoutParam.width);
if (pControlProperty->GetLayoutElement(L"marginLeft", relativeLayoutValue))
{
marginSet = true;
- Float::Parse(relativeLayoutValue, layoutParam.marginLeft);
+ layoutParam.marginLeft = _CoordinateSystemUtils::ConvertToFloat(relativeLayoutValue);
if (pTransform)
{
if (pControlProperty->GetLayoutElement(L"marginRight", relativeLayoutValue))
{
marginSet = true;
- Float::Parse(relativeLayoutValue, layoutParam.marginRight);
+ layoutParam.marginRight = _CoordinateSystemUtils::ConvertToFloat(relativeLayoutValue);
if (pTransform)
{
if (pControlProperty->GetLayoutElement(L"marginTop", relativeLayoutValue))
{
marginSet = true;
- Float::Parse(relativeLayoutValue, layoutParam.marginTop);
+ layoutParam.marginTop = _CoordinateSystemUtils::ConvertToFloat(relativeLayoutValue);
if (pTransform)
{
if (pControlProperty->GetLayoutElement(L"marginBottom", relativeLayoutValue))
{
marginSet = true;
- Float::Parse(relativeLayoutValue, layoutParam.marginBottom);
+ layoutParam.marginBottom = _CoordinateSystemUtils::ConvertToFloat(relativeLayoutValue);
if (pTransform)
{