The DrawDocument class

The DrawDocument class extends the StandardDocument framework, similar to the circle application. It catches the mouse events, overrides the file methods, implements cut, copy, and paste, as well as cursor handling:

DrawDocument.h

class DrawDocument : public StandardDocument { 
  public: 
    DrawDocument(WindowShow windowShow); 
    ~DrawDocument(); 

Similar to the circle application, we catch mouse action with the OnMouseDown, OnMouseMove, and OnMouseUp methods. However, in this application, we also catch double-clicks with the OnDoubleClick method. When the user double-clicks on a figure, it takes individual actions:

 void OnMouseDown(MouseButton mouseButtons, Point mousePoint, bool shiftPressed, bool controlPressed); void OnMouseMove(MouseButton ...

Get C++ Windows Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.