| 137 | } |
| 138 | |
| 139 | void EditBoxImplCommon::setInactiveText(const char* pText) |
| 140 | { |
| 141 | if (EditBox::InputFlag::PASSWORD == _editBoxInputFlag) |
| 142 | { |
| 143 | std::string passwordString; |
| 144 | for (size_t i = 0, len = strlen(pText); i < len; ++i) |
| 145 | passwordString.append(PASSWORD_CHAR); |
| 146 | _label->setString(passwordString); |
| 147 | } |
| 148 | else |
| 149 | { |
| 150 | _label->setString(pText); |
| 151 | } |
| 152 | // Clip the text width to fit to the text box |
| 153 | const auto maxSize = applyPadding(_editBox->getContentSize()); |
| 154 | Vec2 labelSize = _label->getContentSize(); |
| 155 | if (labelSize.width > maxSize.width || labelSize.height > maxSize.height) |
| 156 | { |
| 157 | _label->setDimensions(maxSize.width, maxSize.height); |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | void EditBoxImplCommon::setFont(const char* pFontName, int fontSize) |
| 162 | { |
nothing calls this directly
no test coverage detected