-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpaint.h
46 lines (42 loc) · 1.19 KB
/
paint.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#pragma once
#include <wx/gdicmn.h>
#include <wx/wx.h>
#include <wx/overlay.h>
#include <vector>
#include "path.h"
#include "enum.h"
class PaintWindow : public wxWindow
{
public:
PaintWindow(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size);
virtual ~PaintWindow() noexcept {}
void setTool(Tools tool);
Tools getTool() const;
void ShowSaveDialog();
int currentPenSize{1};
int currentEraserSize{10};
int maxPenSize{30};
int minPenSize{1};
int maxEraserSize{100};
int minEraserSize{1};
bool isDrawing{true};
bool isErasing{false};
wxColour penColor{*wxBLACK};
wxColour eraserColor{*wxWHITE};
void setDrawingMode(bool status);
private:
void OnPaint(wxPaintEvent &);
void DrawOnContext(wxGraphicsContext *gc);
void OnMouseDown(wxMouseEvent &);
void OnMouseMove(wxMouseEvent &);
void OnMouseUp(wxMouseEvent &);
void OnMouseLeave(wxMouseEvent &);
bool isMouseMoving{};
std::vector<Path> squiggles;
Tools currentTool = Tools::Pen;
wxMenu contextMenu;
void BuildContextMenu();
void OnContextMenuEvent(wxContextMenuEvent &);
bool showEraser{false};
wxPoint eraserPos{-1, -1};
};