diff options
Diffstat (limited to 'Project/WorkspaceBase.cpp')
-rw-r--r-- | Project/WorkspaceBase.cpp | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/Project/WorkspaceBase.cpp b/Project/WorkspaceBase.cpp new file mode 100644 index 0000000..9e34efc --- /dev/null +++ b/Project/WorkspaceBase.cpp @@ -0,0 +1,56 @@ +////////////////////////////////////////////////////////////////////// +// This file was auto-generated by codelite's wxCrafter Plugin +// wxCrafter project file: Workspace.wxcp +// Do not modify this file by hand! +////////////////////////////////////////////////////////////////////// + +#include "WorkspaceBase.h" + + +// Declare the bitmap loading function +extern void wxC52C4InitBitmapResources(); + +static bool bBitmapLoaded = false; + + +WorkspaceBase::WorkspaceBase(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style) + : wxPanel(parent, id, pos, size, style) +{ + if ( !bBitmapLoaded ) { + // We need to initialise the default bitmap handler + wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler); + wxC52C4InitBitmapResources(); + bBitmapLoaded = true; + } + + wxBoxSizer* boxSizer_lvl_1_1 = new wxBoxSizer(wxVERTICAL); + this->SetSizer(boxSizer_lvl_1_1); + + int *m_glCanvasAttr = new int[ 5 ]; + m_glCanvasAttr[0] = WX_GL_SAMPLE_BUFFERS; + m_glCanvasAttr[1] = 1; + m_glCanvasAttr[2] = WX_GL_SAMPLES; + m_glCanvasAttr[3] = 4; + m_glCanvasAttr[4] = 0; + m_glCanvas = new wxGLCanvas(this, wxID_ANY, m_glCanvasAttr, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + wxDELETEA( m_glCanvasAttr ); + + boxSizer_lvl_1_1->Add(m_glCanvas, 1, wxEXPAND, WXC_FROM_DIP(5)); + + SetName(wxT("WorkspaceBase")); + SetSize(500,300); + if (GetSizer()) { + GetSizer()->Fit(this); + } + // Connect events + m_glCanvas->Connect(wxEVT_PAINT, wxPaintEventHandler(WorkspaceBase::OnPaint), NULL, this); + m_glCanvas->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(WorkspaceBase::OnLeftClickDown), NULL, this); + +} + +WorkspaceBase::~WorkspaceBase() +{ + m_glCanvas->Disconnect(wxEVT_PAINT, wxPaintEventHandler(WorkspaceBase::OnPaint), NULL, this); + m_glCanvas->Disconnect(wxEVT_LEFT_DOWN, wxMouseEventHandler(WorkspaceBase::OnLeftClickDown), NULL, this); + +} |