... of the application. In
C++, an object is dened by its class. A class can be considered a blueprint for one
or more objects with the same features. A class is dened by methods and elds. A ... perform conditional programming by checking the value of
macros. In the following example, we dene a system integer according to the
underlying operating system.
#ifdef WINDOWS
#define SY...
... tmLastChar;
TCHAR tmDefaultChar;
TCHAR tmBreakChar;
BYTE tmItalic;
BYTE tmUnderlined;
BYTE tmStruckOut;
BYTE tmPitchAndFamily;
BYTE tmCharSet;
} TEXTMETRIC, *PTEXTMETRIC;
BOOL GetTextMetrics(TEXTMETRIC* ... messages in Windows. Here follows a table with the most
common ones. Note that we do not have to catch every message. We just catch those
we are interested in, the rest...
...
line to 5 millimeters and the height of a page to 50 millimeters.
RingView.cpp
void CRingView::OnInitialUpdate()
{
CScrollView::OnInitialUpdate();
CSize sizeTotal;
CSize sizeLine (50 0, 50 0);
... 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 the a...
... 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,...
... Calc Application
[ 252 ]
This is a good start, but there 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, ... EOL
1
4 2
Chapter 8
[ 2 85 ]
The method EvaluateValue is called when some of the source cell of the call has
been altered. If the cell holds a formula, its value is evaluated by calling Eva...
... 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,...
... and height are 21,600 and 27,900
logical units. The paper has, however, a margin of 25 millimeters, or 2 ,50 0 logical
units, which implies that the actual width and height are the dimensions ... utility classes Font and
Set from Chapter 5 Utility Classes and Line from this chapter. ParagraphPtrArray
holds an array of pointers to paragraphs. It is used by the document class.
A paragr...