MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / newTextValid

Method newTextValid

source/windowing/StarTextBoxWidget.cpp:444–452  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

442}
443
444bool TextBoxWidget::newTextValid(String const& text) const {
445 if (!text.regexMatch(m_regex))
446 return false;
447 if ((m_maxWidth != -1) && !m_overfillMode) {
448 context()->setTextStyle(m_textStyle);
449 return context()->stringInterfaceWidth(text) <= m_maxWidth;
450 }
451 return true;
452}
453
454}

Callers

nothing calls this directly

Calls 3

regexMatchMethod · 0.80
setTextStyleMethod · 0.80
stringInterfaceWidthMethod · 0.80

Tested by

no test coverage detected