diff options
author | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2020-06-09 18:38:21 -0300 |
---|---|---|
committer | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2020-06-09 18:38:21 -0300 |
commit | 4fdcfe16959a610a928064df73281f509425cbbf (patch) | |
tree | 2f2484a5162313f472d80e85b9a4c6392213347e /Project/ControlEditorDC.cpp | |
parent | 8321d2612f6ee88bafd97c1bf08fb9f0b7a9db5b (diff) | |
parent | 5e68e62fb23f15f26e24823bf21b012ab4dfd1e0 (diff) | |
download | PSP.git-4fdcfe16959a610a928064df73281f509425cbbf.tar.gz PSP.git-4fdcfe16959a610a928064df73281f509425cbbf.tar.xz PSP.git-4fdcfe16959a610a928064df73281f509425cbbf.zip |
Merge branch 'master' of https://github.com/Thales1330/PSP
Diffstat (limited to 'Project/ControlEditorDC.cpp')
-rw-r--r-- | Project/ControlEditorDC.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Project/ControlEditorDC.cpp b/Project/ControlEditorDC.cpp new file mode 100644 index 0000000..84e212d --- /dev/null +++ b/Project/ControlEditorDC.cpp @@ -0,0 +1,31 @@ +#include "ControlEditorDC.h" +#include "Camera.h" + +ControlEditorDC::ControlEditorDC(wxWindow* parent, int ioflags) : ControlEditor(parent, nullptr, ioflags) +{ + BuildControlElementPanel(); + m_camera = new Camera(); + m_selectionRect = wxRect2DDouble(0, 0, 0, 0); + // m_camera->SetScale(1.2); + m_ioFlags = ioflags; + + this->GetSizer()->Remove(this->GetSizer()->GetChildren()[0]->GetId()); // remove m_glCanvas object from sizer + + delete m_glCanvas; // Delete GLCanvas to allow drawing with wxDC + m_glCanvas = nullptr; + SetBackgroundColour(wxColour(255, 255, 255)); + SetBackgroundStyle(wxBG_STYLE_PAINT); // To allow wxBufferedPaintDC works properly. + Redraw(); +} + +ControlEditorDC::~ControlEditorDC() +{ + // Recreate the GLCanvas. This is necessary to prevent WorkspaceBase destructor access nullpr. + // Also avoid the code editing of WorkspaceBase, since is automatically generated by wxCrafter. + // TODO(?): Find a better way to solve this problem. + m_glCanvas = new wxGLCanvas(this); +} + +void ControlEditorDC::OnPaint(wxPaintEvent& event) +{ +} |