| 160 | } |
| 161 | |
| 162 | void Entry::HandleTextEvent( char32_t character ) { |
| 163 | if( m_max_length > 0 && static_cast<int>( m_string.getSize() ) >= m_max_length ) { |
| 164 | return; |
| 165 | } |
| 166 | |
| 167 | if( character > 0x1f && character != 0x7f ) { |
| 168 | // not a control character |
| 169 | m_string.insert( static_cast<std::size_t>( m_cursor_position ), character ); |
| 170 | MoveCursor( 1 ); |
| 171 | |
| 172 | GetSignals().Emit( OnTextChanged ); |
| 173 | } |
| 174 | } |
| 175 | |
| 176 | void Entry::HandleKeyEvent( sf::Keyboard::Key /*key*/, sf::Keyboard::Scancode scancode, bool press ) { |
| 177 | if( !press || !HasFocus() ) { |