summaryrefslogtreecommitdiffstats
path: root/Project/WorkspaceBase.cpp
diff options
context:
space:
mode:
authorThales Lima Oliveira <thaleslima.ufu@gmail.com>2016-07-30 00:29:03 -0300
committerThales Lima Oliveira <thaleslima.ufu@gmail.com>2016-07-30 00:29:03 -0300
commit3a246308dcd76f70a1b6c3e6b08f0d597b255dba (patch)
tree62f42b83f39ffb0b32db5c658e0e1da428b8e6c6 /Project/WorkspaceBase.cpp
parentd1b893e6757270b0f246a7657d7b6701dcea3b87 (diff)
downloadPSP.git-3a246308dcd76f70a1b6c3e6b08f0d597b255dba.tar.gz
PSP.git-3a246308dcd76f70a1b6c3e6b08f0d597b255dba.tar.xz
PSP.git-3a246308dcd76f70a1b6c3e6b08f0d597b255dba.zip
Adding the basics graphics elements
The base is done, bus under contruction
Diffstat (limited to 'Project/WorkspaceBase.cpp')
-rw-r--r--Project/WorkspaceBase.cpp56
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);
+
+}