page3
Geometry and variables for the teacher sliding line pixmap
There is some text to type in the teachers line and the line is as long as the text....
Visible area of this sliding line
m_xCursorTeacher
m_marginCursor
m_xCursorTPixmap
When the teacher's line is created, at the end and begin of the text a space of size m_maringCursor is added.
Note that the cursor is actually not drawn in the teacher's line, but directly below in the students line. However, the
teacher's line is used to determine the position of the cursor depending on how much has been typed so far.
m_xFrameTeacher = m_xCursorTPixmap - m_xCursorTeacher
is the coordinate inside the pixmap of the frame that is copied to the widget when the sliding is done
(resting position)
m_xFrameTeacher
m_marginCursor
m_teacherTextLen
Sliding the teacher text into place...
Only part of the teacher's text is copied onto the widget. The final position is given by:
m_xTeacherFrame = m_xTeacherPixmap - m_xCursorTeacher
and is updated whenever something is typed or the texts are changed. The old/current
position is stored in m_xTeacherFrameCurrent.
Whenever m_xTeacherFrame != m_xTeacherFrameCurrent, the sliding function slide() is
called that gradually moves the frame from m_xTeacherFrameCurrent to m_xTeacherFrame.