So far, we could
only paint rings in one color, now it is time to change that. Let us add a field m_nextColor
to the document class and initialize it with the white color. We also modify the function MouseDown
and OnDraw
.
CRingDoc::CRingDoc() : m_nextColor(WHITE) { // Empty. } void CRingDoc::MouseDown(CPoint point) { m_pointArray.Add(point); m_colorArray.Add(m_nextColor); UpdateAllViews(NULL); }
When we created the application with theApplication Wizard, we got a standard menu bar. We can modify it by editing the resource file resource.rc
manually, or we can use the tool Resource View.
We can add mnemonic markers for the menus and items by preceding the character with an ampersand (&
), and we can set a tabulator between words with \t
. Then we pick a name for the menu items, lets us choose ID_COLOR_WHITE, ID_COLOR_GREY, and ID_COLOR_BLACK...