MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / AcceptEntry

Method AcceptEntry

Source/TextEntry.cpp:602–627  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

600}
601
602void TextEntry::AcceptEntry(bool pressedEnter)
603{
604 if (!pressedEnter && mRequireEnterToAccept)
605 {
606 CancelEntry();
607 return;
608 }
609
610 if (mVarCString)
611 StringCopy(mVarCString, mString, MAX_TEXTENTRY_LENGTH);
612 if (mVarString)
613 *mVarString = mString;
614 if (mVarInt && mString[0] != 0)
615 {
616 *mVarInt = ofClamp(ofToInt(mString), mIntMin, mIntMax);
617 StringCopy(mString, ofToString(*mVarInt).c_str(), MAX_TEXTENTRY_LENGTH);
618 }
619 if (mVarFloat && mString[0] != 0)
620 {
621 *mVarFloat = ofClamp(ofToFloat(mString), mFloatMin, mFloatMax);
622 StringCopy(mString, ofToString(*mVarFloat).c_str(), MAX_TEXTENTRY_LENGTH);
623 }
624
625 if (mListener)
626 mListener->TextEntryComplete(this);
627}
628
629void TextEntry::CancelEntry()
630{

Callers 1

Calls 6

StringCopyFunction · 0.85
ofClampFunction · 0.85
ofToIntFunction · 0.85
ofToStringFunction · 0.85
ofToFloatFunction · 0.85
TextEntryCompleteMethod · 0.45

Tested by

no test coverage detected