///////////////////////////////////////////////////////////////////// static constructor /////////////////////////////////////////////////////////////////////
| 256 | // static constructor |
| 257 | ////////////////////////////////////////////////////////////////////////// |
| 258 | TextFieldEx* TextFieldEx::create(std::string_view placeholder, |
| 259 | std::string_view fontName, |
| 260 | float fontSize, |
| 261 | float cursorWidth, |
| 262 | const Color4B& cursorColor) |
| 263 | { |
| 264 | TextFieldEx* ret = new TextFieldEx(); |
| 265 | if (ret && ret->initWithPlaceHolder("", fontName, fontSize, cursorWidth, cursorColor)) |
| 266 | { |
| 267 | ret->autorelease(); |
| 268 | if (placeholder.size() > 0) |
| 269 | { |
| 270 | ret->setPlaceholderText(placeholder); |
| 271 | } |
| 272 | return ret; |
| 273 | } |
| 274 | AX_SAFE_DELETE(ret); |
| 275 | return nullptr; |
| 276 | } |
| 277 | |
| 278 | ////////////////////////////////////////////////////////////////////////// |
| 279 | // initialize |
nothing calls this directly
no test coverage detected