... The elds are set by
the user and are used when a new gure is added to the drawing. Similar to
m_iApplicationState, the values of m_nextColor and m_bNextFill are accessed
by the constructor ... character at the caret
position. In either case, we increment the caret index by one and re-calculate the text
by calling GenerateCaretArray.
void TextFigure::CharDown(UINT uChar, CDC* pDC,...
... iArraySize, Double);//2,4 ,6, 8,10
PrintArray(numberArray, iArraySize);
// Squares every value in the array.
ApplyArray(numberArray, iArraySize, Square);//4, 16, 36, 64,100
PrintArray(numberArray, ... DecreaseSpeed(int iSpeed);
Object-Oriented Programming in C++
[ 66 ]
Stacks and Linked Lists
A stack is very valuable in a number of applications and it can be implemented with
a linke...
... by several applications, we must destroy it. When we gain
focus, we have to create a new caret.
void Caret::OnKillFocus()
{
m_pFocusView = NULL;
::DestroyCaret();
}
Ring: A Demonstration Example
[ ... application was stored in the registry.
Finally, we saved and loaded the rings by using Serialization.
•
•
•
•
•
•
Chapter 6
[ 155 ]
The View Class
CTetrisView is the view class of t...
... crossed one are
given by the integer pairs in the directions arrays.
First of all, we need do dene the color of each gure. We do so by using the
COLORREF type.
Chapter 6
[ 163 ]
class Figure
{
... File type long name. This
implies that we can start the application in Windows Explorer by choosing the
application, or by choosing one of the documents (a le with the extension...
... m_pTargetSetMatrix->RemoveTargets(home);
m_sourceSet.RemoveAll();
}
The Calc Application
[ 266 ]
The source set of a formula is the union of all its references. In the case of addition,
subtraction, ... are a few problems. Let us test if the string "1 * 2 + 3" is
accepted by the grammar. We can test that by doing a derivation, where we start with
the start symbol (Formul...
... cells one by one.
We start by dening a test cell matrix and a test target set matrix, which are copies of
the document elds m_cellMatrix and m_tSetMatrix.
Then we paste the cells one by one. ... one pixel rst,
WM_LBUTTON is sent, which is caught by OnLButtonDown, then one or more
WM_MOUSEMOVE messages are sent, which are caught by OnMouseMove. Finally
WM_LBUTTONDOWN is sent,...
... Application
[ 362 ]
The unit of choice in this application is hundredths of millimeters (MM_HIMETRIC).
As a letter 2 16 times 297 millimeter, its total width and height are 21 ,60 0 and 27,900 ... Position::operator!=(const Position& position) const
{
return !(*this == position);
}
The Word Application
[ 366 ]
The method OnNewDocument does the work of a constructor. It creates and init...
... lists
about 66
example 66 -70
STL 127
streams
ifstream 82
istream 82
ofstream 82
osstream 82
struct 50
subclass 50
T
templates
about 77, 78
example 78-80
tetris, MFC application wizard
about 144, 1 46
color ... 98
serialization 99, 100
visual studio 88
while statement 30, 31
word, MFC application wizard
about 329, 331
document class 361 -391
line class 332, 333
page class 360 , 361...