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 mouseButtons, Point mousePoint, bool shiftPressed, bool controlPressed); void OnDoubleClick(MouseButton mouseButtons, Point mousePoint, bool...