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

Method MoveCursor

src/SFGUI/Entry.cpp:146–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144}
145
146void Entry::MoveCursor( int delta ) {
147 if( delta && ( m_cursor_position + delta >= 0 ) && ( m_cursor_position + delta <= static_cast<int>( m_string.getSize() ) ) ) {
148 m_cursor_position += delta;
149
150 if( m_cursor_position < m_visible_offset ) {
151 m_visible_offset = m_cursor_position;
152 }
153
154 // Make cursor visible.
155 m_elapsed_time = 0.f;
156 m_cursor_status = true;
157
158 RecalculateVisibleString();
159 }
160}
161
162void Entry::HandleTextEvent( char32_t character ) {
163 if( m_max_length > 0 && static_cast<int>( m_string.getSize() ) >= m_max_length ) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected