TextFigure
is a direct sub class of Figure
. It manages the text. The users can move and edit the text, they can also change the font of the text.
The field m_ptText
represents the upper left corner of the text, in logical units. m_szText
is the size of the text, also in logical units. The field m_stText
is the actual text; m_stPreviousText
is used to resume the original text in case the user aborts the editing by pressing the Esc key. GenererateCaretArray
is called every time the text is changed (change of font or addition or removal of a character) and calculates the size and position for each character in the text. The horizontal positions (x values) relative to the beginning of the text are stored in m_caretArray
. The field m_font
is the font of the text and m_iAverageWidth
holds the average width of the font, roughly the width of the z character. It is used by the caret in the keyboard overwrite state. Finally, m_eDragMode
is used to give the cursor the correct...