]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/glcanvas.cpp
fix for wxSYS_COLOUR_LISTBOX representation
[wxWidgets.git] / src / msw / glcanvas.cpp
index 0f24a7cff6e3d2ce985e4cc48707b6b40fc0dc50..3b037573382a76df81b6c3e80cbebfa2a3d1e246 100644 (file)
@@ -125,9 +125,9 @@ void wxGLContext::SetColour(const char *colour)
  * wxGLCanvas implementation
  */
 
-IMPLEMENT_CLASS(wxGLCanvas, wxScrolledWindow)
+IMPLEMENT_CLASS(wxGLCanvas, wxWindow)
 
-BEGIN_EVENT_TABLE(wxGLCanvas, wxScrolledWindow)
+BEGIN_EVENT_TABLE(wxGLCanvas, wxWindow)
     EVT_SIZE(wxGLCanvas::OnSize)
     EVT_PALETTE_CHANGED(wxGLCanvas::OnPaletteChanged)
     EVT_QUERY_NEW_PALETTE(wxGLCanvas::OnQueryNewPalette)
@@ -135,7 +135,7 @@ END_EVENT_TABLE()
 
 wxGLCanvas::wxGLCanvas(wxWindow *parent, wxWindowID id,
     const wxPoint& pos, const wxSize& size, long style, const wxString& name,
-    int *attribList, const wxPalette& palette) : wxScrolledWindow()
+    int *attribList, const wxPalette& palette) : wxWindow()
 {
   m_glContext = (wxGLContext*) NULL;
 
@@ -143,8 +143,8 @@ wxGLCanvas::wxGLCanvas(wxWindow *parent, wxWindowID id,
 
   if ( ret )
   {
-    SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
-    SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT));
+    SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
+    SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
   }
 
   m_hDC = (WXHDC) ::GetDC((HWND) GetHWND());
@@ -159,7 +159,7 @@ wxGLCanvas::wxGLCanvas( wxWindow *parent,
               const wxGLContext *shared, wxWindowID id,
               const wxPoint& pos, const wxSize& size, long style, const wxString& name,
               int *attribList, const wxPalette& palette )
-  : wxScrolledWindow()
+  : wxWindow()
 {
   m_glContext = (wxGLContext*) NULL;
 
@@ -167,8 +167,8 @@ wxGLCanvas::wxGLCanvas( wxWindow *parent,
 
   if ( ret )
   {
-    SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
-    SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT));
+    SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
+    SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
   }
 
   m_hDC = (WXHDC) ::GetDC((HWND) GetHWND());
@@ -184,7 +184,7 @@ wxGLCanvas::wxGLCanvas( wxWindow *parent,
 wxGLCanvas::wxGLCanvas( wxWindow *parent, const wxGLCanvas *shared, wxWindowID id,
                         const wxPoint& pos, const wxSize& size, long style, const wxString& name,
                         int *attribList, const wxPalette& palette ):
-  wxScrolledWindow()
+  wxWindow()
 {
   m_glContext = (wxGLContext*) NULL;
 
@@ -192,8 +192,8 @@ wxGLCanvas::wxGLCanvas( wxWindow *parent, const wxGLCanvas *shared, wxWindowID i
 
   if ( ret )
   {
-    SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
-    SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT));
+    SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
+    SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
   }
 
   m_hDC = (WXHDC) ::GetDC((HWND) GetHWND());
@@ -351,11 +351,11 @@ static void AdjustPFDForAttributes(PIXELFORMATDESCRIPTOR& pfd, int *attribList)
         case WX_GL_LEVEL:
           // this member looks like it may be obsolete
           if (attribList[arg] > 0) {
-            pfd.iLayerType = PFD_OVERLAY_PLANE;
+            pfd.iLayerType = (BYTE)PFD_OVERLAY_PLANE;
           } else if (attribList[arg] < 0) {
-            pfd.iLayerType = PFD_UNDERLAY_PLANE;
+            pfd.iLayerType = (BYTE)PFD_UNDERLAY_PLANE;
           } else {
-            pfd.iLayerType = PFD_MAIN_PLANE;
+            pfd.iLayerType = (BYTE)PFD_MAIN_PLANE;
           }
           arg++;
           break;
@@ -522,19 +522,6 @@ void wxGLCanvas::SwapBuffers()
 
 void wxGLCanvas::OnSize(wxSizeEvent& event)
 {
-  int width, height;
-  GetClientSize(& width, & height);
-
-  if (m_glContext)
-  {
-    m_glContext->SetCurrent();
-
-    glViewport(0, 0, (GLint)width, (GLint)height);
-    glMatrixMode(GL_PROJECTION);
-    glLoadIdentity();
-    glFrustum( -1.0, 1.0, -1.0, 1.0, 5.0, 15.0 );
-    glMatrixMode(GL_MODELVIEW);
-  }
 }
 
 void wxGLCanvas::SetCurrent()