Reader small image

You're reading from  C++ Windows Programming

Product typeBook
Published inSep 2016
Reading LevelIntermediate
PublisherPackt
ISBN-139781786464224
Edition1st Edition
Languages
Right arrow
Author (1)
Stefan Björnander
Stefan Björnander
author image
Stefan Björnander

Stefan Björnander is the author of the books Microsoft Windows C++ and C++ Windows Programming. He holds a Master of Engineering and a Licentiate in Computer Science. He has worked as a software developer and as a teacher in computer science and mathematics for many years.
Read more about Stefan Björnander

Right arrow

The CalcDocument class


The CalcDocument class is the main class of the application. It catches mouse and keyboard events, handles scrolling and painting, and processes menu actions. However, the cell-level operations are handled by the Cell class, which we will cover in Chapter 9, Formula Interpretation.

The user can mark one or several cells, in which case, the private field calcMode is set to Mark. The user can also edit the text in one cell, in which case the calcMode field is set to Edit. Similar to the word processor in the previous chapters, we refer to the current value of the calcMode field in expressions such as in mark mode and in edit mode.

class CalcDocument : public StandardDocument { 
  public: 
    CalcDocument(WindowShow windowShow);       

The OnMouseDown, OnMouseMove, and OnDoubleClick methods catch the mouse actions in the same way as in the previous applications. Note that we do not override the OnMouseUp method. Contrary to the word processor of Chapter...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
C++ Windows Programming
Published in: Sep 2016Publisher: PacktISBN-13: 9781786464224

Author (1)

author image
Stefan Björnander

Stefan Björnander is the author of the books Microsoft Windows C++ and C++ Windows Programming. He holds a Master of Engineering and a Licentiate in Computer Science. He has worked as a software developer and as a teacher in computer science and mathematics for many years.
Read more about Stefan Björnander