int tokenCount = __pTokenList->GetCount();
float tokenLeftMargin = 0.0f;
- float tokenRighttMargin = 0.0f;
+ float tokenRightMargin = 0.0f;
float tokenTopMargin = 0.0f;
float tokenBottomMargin = 0.0f;
float tokenHeight = 0.0f;
_ControlOrientation orientation = __pTokenEdit->GetOrientation();
GET_SHAPE_CONFIG(TOKENEDIT::LEFT_MARGIN, orientation, tokenLeftMargin);
- GET_SHAPE_CONFIG(TOKENEDIT::RIGHT_MARGIN, orientation, tokenRighttMargin);
+ GET_SHAPE_CONFIG(TOKENEDIT::RIGHT_MARGIN, orientation, tokenRightMargin);
GET_SHAPE_CONFIG(TOKENEDIT::TOP_MARGIN, orientation, tokenTopMargin);
GET_SHAPE_CONFIG(TOKENEDIT::BOTTOM_MARGIN, orientation, tokenBottomMargin);
GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_HEIGHT, orientation, tokenHeight);
pToken->displayRect.x = __descriptionTextRectForScroll.x + __descriptionTextRectForScroll.width + descriptionTextRightMargin;
pToken->displayRect.y = __descriptionTextRectForScroll.y + __scrollValue;
}
- else // Set description text.
+ else // Set description text.
{
- pToken->displayRect.x = tokenTextLeftMargin + __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_LEFT_MARGIN);
+ pToken->displayRect.x = tokenLeftMargin + __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_LEFT_MARGIN);
pToken->displayRect.y = tokenTopMargin + __scrollValue + __pTokenEdit->GetVerticalMarginF(EDIT_TEXT_TOP_MARGIN) + __lineSpacing;
}
findPrevTokenLoopFlag = false;
}
- float tempTextWidth = tokenEditBounds.width - pPreviousToken->displayRect.x - pPreviousToken->displayRect.width - tokenHorizontalSpacing - tokenTextRightMargin - __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN);
+ float tempTextWidth = tokenEditBounds.width - pPreviousToken->displayRect.x - pPreviousToken->displayRect.width - tokenHorizontalSpacing - tokenRightMargin - __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN);
if (tokenTextLeftMargin + pToken->GetTextPixelWidth() + tokenTextRightMargin > tempTextWidth) // Line change
{
- pToken->displayRect.x = tokenTextLeftMargin + __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_LEFT_MARGIN);
+ pToken->displayRect.x = tokenLeftMargin + __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_LEFT_MARGIN);
pToken->displayRect.y = pPreviousToken->displayRect.y + tokenHeight + tokenVerticalSpacing + __lineSpacing;
__lineAdded++;
}
{
result r = E_SUCCESS;
+ float tokenLeftMargin = 0.0f;
+ float tokenRightMargin = 0.0f;
float tokenTopMargin = 0.0f;
float tokenHeight = 0.0f;
float tokenMinWidth = 0.0f;
float descriptionTextRightMargin = 0.0f;
_ControlOrientation orientation = GetEditView()->GetOrientation();
+ GET_SHAPE_CONFIG(TOKENEDIT::LEFT_MARGIN, orientation, tokenLeftMargin);
+ GET_SHAPE_CONFIG(TOKENEDIT::RIGHT_MARGIN, orientation, tokenRightMargin);
GET_SHAPE_CONFIG(TOKENEDIT::TOP_MARGIN, orientation, tokenTopMargin);
GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_HEIGHT, orientation, tokenHeight);
GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_MIN_WIDTH, orientation, tokenMinWidth);
if (__pTokenEdit->GetTitleText().GetLength())
{
FloatRectangle descriptionTextRect = GetDescriptionTextRect();
-
tokenTextRect.x = descriptionTextRect.x + descriptionTextRect.width + descriptionTextRightMargin;
- tokenTextRect.width -= (tokenTextLeftMargin + tokenTextRightMargin + descriptionTextRect.width + descriptionTextRightMargin + 2.0f * __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN));
}
else
{
- tokenTextRect.x = tokenTextLeftMargin + __pTokenEdit->GetHorizontalMargin(EDIT_TEXT_LEFT_MARGIN);
- tokenTextRect.width -= (tokenTextLeftMargin + tokenTextRightMargin + 2 * __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN));
+ tokenTextRect.x = tokenLeftMargin + __pTokenEdit->GetHorizontalMargin(EDIT_TEXT_LEFT_MARGIN);
}
tokenTextRect.y = tokenTopMargin + __pTokenEdit->GetVerticalMarginF(EDIT_TEXT_TOP_MARGIN) + textBoundsAlignValue;
+ tokenTextRect.width -= tokenTextRect.x + tokenRightMargin + __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN);
tokenTextRect.height = textObjectMaxHeight;
SetTextBounds(tokenTextRect);
-
return r;
}
SysTryReturn(NID_UI_CTRL, pToken, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred. The _Token instance is null");
float tempTextRectWidth = 0.0f;
- tempTextRectWidth = tokenEditBounds.width - pToken->displayRect.x - pToken->displayRect.width - tokenHorizontalSpacing - __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN);
+ tempTextRectWidth = tokenEditBounds.width - pToken->displayRect.x - pToken->displayRect.width - tokenHorizontalSpacing - tokenRightMargin - __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN);
if (tokenMinWidth > tempTextRectWidth) // Line change
{
- tokenTextRect.x = tokenTextLeftMargin + __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_LEFT_MARGIN);
+ tokenTextRect.x = tokenLeftMargin + __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_LEFT_MARGIN);
tokenTextRect.y = pToken->displayRect.y + tokenHeight + tokenVerticalSpacing + __lineSpacing + textBoundsAlignValue;
- tokenTextRect.width = tokenEditBounds.width - tokenTextLeftMargin - tokenTextRightMargin - 2 * __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN);
}
else
{
tokenTextRect.x = pToken->displayRect.x + pToken->displayRect.width + tokenHorizontalSpacing;
tokenTextRect.y = pToken->displayRect.y + textBoundsAlignValue;
- tokenTextRect.width = tokenEditBounds.width - pToken->displayRect.x - pToken->displayRect.width -
- tokenTextRightMargin - __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN) - tokenTextLeftMargin;
}
+ tokenTextRect.width -= tokenTextRect.x + tokenRightMargin + __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN);
tokenTextRect.height = textObjectMaxHeight;
SetTextBounds(tokenTextRect);
result r = E_SUCCESS;
TextSimple* pSimpleText = null;
+ float leftMargin = 0.0f;
float tokenTopMargin = 0.0f;
float tokenHeight = 0.0f;
float tokenVerticalSpacing = 0.0f;
_ControlOrientation orientation = __pTokenEdit->GetOrientation();
GET_SHAPE_CONFIG(TOKENEDIT::TOP_MARGIN, orientation, tokenTopMargin);
+ GET_SHAPE_CONFIG(TOKENEDIT::LEFT_MARGIN, orientation, leftMargin);
GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_HEIGHT, orientation, tokenHeight);
GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_VERTICAL_SPACING, orientation, tokenVerticalSpacing);
GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_TEXT_LEFT_MARGIN, orientation, tokenTextLeftMargin);
r = __pDescriptionTextTextObject->SetAlignment(TEXT_OBJECT_ALIGNMENT_CENTER | TEXT_OBJECT_ALIGNMENT_MIDDLE);
r = __pDescriptionTextTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_NONE);
- __descriptionTextRect.x = tokenTextLeftMargin + __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_LEFT_MARGIN);
+ __descriptionTextRect.x = leftMargin + __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_LEFT_MARGIN);
__descriptionTextRect.y = tokenTopMargin + __pTokenEdit->GetVerticalMarginF(EDIT_TEXT_TOP_MARGIN);
if (textSize.width > tokenTitleWidth)
{
{
result r = E_SUCCESS;
- float tokenTextRightMargin = 0.0f;
+ float tokenRightMargin = 0.0f;
float tokenMinimumSize = 0.0f;
_ControlOrientation orientation = __pTokenEdit->GetOrientation();
- GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_TEXT_RIGHT_MARGIN, orientation, tokenTextRightMargin);
+ GET_SHAPE_CONFIG(TOKENEDIT::RIGHT_MARGIN, orientation, tokenRightMargin);
GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_MIN_WIDTH, orientation, tokenMinimumSize);
_Token* pToken = null;
FloatRectangle tokenEditBounds = __pTokenEdit->GetBoundsF();
FloatRectangle tokenRect = pToken->displayRect;
- float remainWidth = tokenEditBounds.width - tokenTextRightMargin - __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN);;
+ float remainWidth = tokenEditBounds.width - tokenRightMargin - __pTokenEdit->GetHorizontalMarginF(EDIT_TEXT_RIGHT_MARGIN);
+
float dspTokenWidth = tokenRect.x + tokenRect.width;
float dspTokenGap = dspTokenWidth - remainWidth;