result r = E_SUCCESS;
FloatRectangle editBounds;
- int horizontalMargin = 0;
- int verticalMargin = 0;
- int iconHorizontalMargin = 0;
- int textHorizontalMargin = 0;
- int iconWidth = 0;
- int textSize = 0;
- int searchFieldMinWidth = 0;
- int searchBarMinHeight = 0;
+ float horizontalMargin = 0.0f;
+ float verticalMargin = 0.0f;
+ float iconHorizontalMargin = 0.0f;
+ float textHorizontalMargin = 0.0f;
+ float iconWidth = 0.0f;
+ float textSize = 0.0f;
+ float searchFieldMinWidth = 0.0f;
+ float searchBarMinHeight = 0.0f;
FloatRectangle searchBarBounds = GetBoundsF();
_ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
GET_SHAPE_CONFIG(SEARCHBAR::SEARCH_FIELD_MIN_WIDTH, orientation, searchFieldMinWidth);
GET_SHAPE_CONFIG(SEARCHBAR::MIN_HEIGHT, orientation, searchBarMinHeight);
- int searchFieldMinHeight = searchBarMinHeight - (verticalMargin * 2);
+ float searchFieldMinHeight = searchBarMinHeight - (verticalMargin * 2.0f);
- editBounds.x = _CoordinateSystemUtils::ConvertToFloat(horizontalMargin);
- editBounds.y = _CoordinateSystemUtils::ConvertToFloat(verticalMargin);
+ editBounds.x = horizontalMargin;
+ editBounds.y = verticalMargin;
editBounds.width = searchBarBounds.width - (editBounds.x * 2.0f);
editBounds.height = searchBarBounds.height - (editBounds.y * 2.0f);
{
result r = E_SUCCESS;
- int textSize = 0;
+ float textSize = 0.0f;
String cancelButtonText;
_ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
{
result r = E_SUCCESS;
- int horizontalMargin = 0;
- int buttonLeftMargin = 0;
- int buttonRightMargin = 0;
- int buttonMinWidth = 0;
- int searchFieldMinWidth = 0;
- int buttonVerticalMargin = 0;
- int searchBarMinHeight = 0;
- int buttonWidth = 0;
- int buttonHeight = 0;
+ float horizontalMargin = 0.0f;
+ float buttonLeftMargin = 0.0f;
+ float buttonRightMargin = 0.0f;
+ float buttonMinWidth = 0.0f;
+ float searchFieldMinWidth = 0.0f;
+ float buttonVerticalMargin = 0.0f;
+ float searchBarMinHeight = 0.0f;
+ float buttonWidth = 0.0f;
+ float buttonHeight = 0.0f;
FloatRectangle cancelButtonBounds;
FloatRectangle searchBarBounds = GetBoundsF();
GET_SHAPE_CONFIG(SEARCHBAR::VERTICAL_MARGIN, orientation, buttonVerticalMargin);
GET_SHAPE_CONFIG(SEARCHBAR::MIN_HEIGHT, orientation, searchBarMinHeight);
- cancelButtonBounds.width = _CoordinateSystemUtils::ConvertToFloat(buttonWidth);
- cancelButtonBounds.height = _CoordinateSystemUtils::ConvertToFloat(buttonHeight);
+ cancelButtonBounds.width = buttonWidth;
+ cancelButtonBounds.height = buttonHeight;
float buttonResizableSearchBarWidth = (horizontalMargin + searchFieldMinWidth +
cancelButtonBounds.width + buttonLeftMargin + buttonRightMargin);
r = __pCancelButton->SetBounds(cancelButtonBounds);
return r;
-
}
void
{
result r = E_SUCCESS;
- float horizontalMargin = 0;
- float verticalMargin = 0;
- float buttonLeftMargin = 0;
- float buttonRightMargin = 0;
- float buttonMinWidth = 0;
- float searchFieldMinWidth = 0;
- float buttonVerticalMargin = 0;
- float searchBarMinHeight = 0;
- float buttonWidth = 0;
- float buttonHeight = 0;
+ float horizontalMargin = 0.0f;
+ float verticalMargin = 0.0f;
+ float buttonLeftMargin = 0.0f;
+ float buttonRightMargin = 0.0f;
+ float buttonMinWidth = 0.0f;
+ float searchFieldMinWidth = 0.0f;
+ float buttonVerticalMargin = 0.0f;
+ float searchBarMinHeight = 0.0f;
+ float buttonWidth = 0.0f;
+ float buttonHeight = 0.0f;
FloatRectangle cancelButtonBounds;
FloatRectangle searchBarBounds = GetBoundsF();
GET_SHAPE_CONFIG(SEARCHBAR::VERTICAL_MARGIN, orientation, buttonVerticalMargin);
GET_SHAPE_CONFIG(SEARCHBAR::MIN_HEIGHT, orientation, searchBarMinHeight);
- cancelButtonBounds.height = buttonHeight ;
+ cancelButtonBounds.height = buttonHeight;
FloatRectangle editBounds;
editBounds.height = searchBarBounds.height - (editBounds.y * 2.0f);
editBounds.height = (editBounds.height > searchBarMinHeight) ? editBounds.height : searchBarMinHeight;
- editBounds.width = searchBarBounds.width - cancelButtonWidth - (2 * horizontalMargin) - buttonLeftMargin;
+ editBounds.width = searchBarBounds.width - cancelButtonWidth - horizontalMargin - buttonLeftMargin - buttonRightMargin;
if (editBounds.width < searchFieldMinWidth)
{
cancelButtonBounds.y = buttonVerticalMargin;
}
- if (cancelButtonWidth < buttonMinWidth)
+ float remainingWidth = searchBarBounds.width - editBounds.width - horizontalMargin - buttonLeftMargin - buttonRightMargin;
+
+ if (remainingWidth < buttonMinWidth)
{
cancelButtonBounds.width = buttonMinWidth;
}
isCustomBitmap = IS_CUSTOM_BITMAP(SEARCHBAR::ICON_NORMAL);
- int iconMarginH = 0;
- int iconWidth = 0;
- int iconHeight = 0;
+ float iconMarginH = 0.0f;
+ float iconWidth = 0.0f;
+ float iconHeight = 0.0f;
_ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
GET_SHAPE_CONFIG(SEARCHBAR::ICON_HORIZONTAL_MARGIN, orientation, iconMarginH);
GET_SHAPE_CONFIG(SEARCHBAR::ICON_WIDTH, orientation, iconWidth);
GET_SHAPE_CONFIG(SEARCHBAR::ICON_HEIGHT, orientation, iconHeight);
- iconBounds.x = _CoordinateSystemUtils::ConvertToFloat(iconMarginH);
+ iconBounds.x = iconMarginH;
iconBounds.y = (__pEdit->GetBoundsF().height - iconWidth) / 2.0f;
- iconBounds.width = _CoordinateSystemUtils::ConvertToFloat(iconWidth);
- iconBounds.height = _CoordinateSystemUtils::ConvertToFloat(iconHeight);
+ iconBounds.width = iconWidth;
+ iconBounds.height = iconHeight;
__pIconElement->SetBounds(FloatRectangle(iconBounds.x, iconBounds.y, iconBounds.width, iconBounds.height));
- pIconCanvas = __pIconElement->GetCanvasN(FloatRectangle(0, 0, iconBounds.width, iconBounds.height));
+ pIconCanvas = __pIconElement->GetCanvasN(FloatRectangle(0.0f, 0.0f, iconBounds.width, iconBounds.height));
SysTryReturnResult(NID_UI_CTRL, pIconCanvas != null, GetLastResult(), "Propagating.");
pIconCanvas->SetBackgroundColor(Color(0));
{
__pEdit->SetCursorDisabled(false);
- float buttonWidth = 0;
+ float buttonWidth = 0.0f;
_ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_WIDTH, orientation, buttonWidth);
return;
}
- int horizontalMargin = 0;
- int buttonRightMargin = 0;
- int buttonLeftMargin = 0;
- int buttonWidth = 0;
- int searchFieldMinWidth = 0;
+ float horizontalMargin = 0.0f;
+ float buttonRightMargin = 0.0f;
+ float buttonLeftMargin = 0.0f;
+ float buttonWidth = 0.0f;
+ float searchFieldMinWidth = 0.0f;
_ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
GET_SHAPE_CONFIG(SEARCHBAR::HORIZONTAL_MARGIN, orientation, horizontalMargin);
GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_RIGHT_MARGIN, orientation, buttonRightMargin);
GET_SHAPE_CONFIG(SEARCHBAR::SEARCH_FIELD_MIN_WIDTH, orientation, searchFieldMinWidth);
GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_WIDTH, orientation, buttonWidth);
- int buttonResizableSearchBarWidth = (horizontalMargin + searchFieldMinWidth +
+ float buttonResizableSearchBarWidth = (horizontalMargin + searchFieldMinWidth +
buttonWidth + buttonLeftMargin + buttonRightMargin);
if (__pSearchBar->GetBoundsF().width < buttonResizableSearchBarWidth)
float cancelButtonWidth = 0.0f;
cancelButtonWidth = __pCancelButton->GetTextExtentSizeF() + __pCancelButton->GetRightTouchMarginF() + __pCancelButton->GetLeftTouchMarginF() + __pCancelButton->GetRightMarginF() + __pCancelButton->GetLeftMarginF();
-
if (cancelButtonWidth > buttonWidth)
{
__pSearchBar->RecalculateButtonBounds();
void
_SearchBarPresenter::InitializeViewModeLayout(void)
{
- int horizontalMargin = 0;
- int verticalMargin = 0;
- int searchFieldMinWidth = 0;
- int searchBarMinHeight = 0;
+ float horizontalMargin = 0.0f;
+ float verticalMargin = 0.0f;
+ float searchFieldMinWidth = 0.0f;
+ float searchBarMinHeight = 0.0f;
_ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
GET_SHAPE_CONFIG(SEARCHBAR::HORIZONTAL_MARGIN, orientation, horizontalMargin);
GET_SHAPE_CONFIG(SEARCHBAR::SEARCH_FIELD_MIN_WIDTH, orientation, searchFieldMinWidth);
GET_SHAPE_CONFIG(SEARCHBAR::MIN_HEIGHT, orientation, searchBarMinHeight);
- int searchFieldMinHeight = searchBarMinHeight - (verticalMargin * 2);
+ float searchFieldMinHeight = searchBarMinHeight - (verticalMargin * 2.0f);
- __searchFieldBounds.x = _CoordinateSystemUtils::ConvertToFloat(horizontalMargin);
- __searchFieldBounds.y = _CoordinateSystemUtils::ConvertToFloat(verticalMargin);
- __searchFieldBounds.width = __pSearchBar->GetBoundsF().width - (horizontalMargin * 2);
- __searchFieldBounds.height = __pSearchBar->GetBoundsF().height - (verticalMargin * 2);
+ __searchFieldBounds.x = horizontalMargin;
+ __searchFieldBounds.y = verticalMargin;
+ __searchFieldBounds.width = __pSearchBar->GetBoundsF().width - (horizontalMargin * 2.0f);
+ __searchFieldBounds.height = __pSearchBar->GetBoundsF().height - (verticalMargin * 2.0f);
__searchFieldBounds.width = (__searchFieldBounds.width > searchFieldMinWidth) ? __searchFieldBounds.width : searchFieldMinWidth;
__searchFieldBounds.height = (__searchFieldBounds.height > searchFieldMinHeight) ? __searchFieldBounds.height : searchFieldMinHeight;
if (GetMode() == SEARCH_BAR_MODE_INPUT)
{
- float buttonWidth = 0;
+ float buttonWidth = 0.0f;
_ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
GET_SHAPE_CONFIG(SEARCHBAR::BUTTON_WIDTH, orientation, buttonWidth);
float cancelButtonWidth = 0.0f;