MCPcopy Create free account
hub / github.com/TankOs/SFGUI / HandleTextEvent

Method HandleTextEvent

src/SFGUI/SpinButton.cpp:168–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166}
167
168void SpinButton::HandleTextEvent( char32_t character ) {
169 if( isdigit( static_cast<int>( character ) ) ) {
170 Entry::HandleTextEvent( character );
171 return;
172 }
173
174 if( ( character == '.' ) && ( GetText().find( "." ) == sf::String::InvalidPos ) ) {
175 Entry::HandleTextEvent( character );
176 return;
177 }
178
179 if( ( character == '-' ) && ( GetText().find( "-" ) == sf::String::InvalidPos ) && ( GetCursorPosition() == 0 ) ) {
180 Entry::HandleTextEvent( character );
181 return;
182 }
183}
184
185void SpinButton::HandleKeyEvent( sf::Keyboard::Key key, sf::Keyboard::Scancode scancode, bool press ) {
186 Entry::HandleKeyEvent( key, scancode, press );

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected