]> git.saurik.com Git - wxWidgets.git/commitdiff
added internal callback when toplevel windows move for opengl canvas
authorStefan Csomor <csomor@advancedconcepts.ch>
Sun, 4 Nov 2001 20:54:39 +0000 (20:54 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Sun, 4 Nov 2001 20:54:39 +0000 (20:54 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12317 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/glcanvas.cpp
src/mac/carbon/window.cpp
src/mac/glcanvas.cpp
src/mac/window.cpp

index 1629d068b66e6eb2c2bac929cd2d442730fb4ed5..8edf2fc38e9c533c57b9a84b9f381fbabdb82462 100644 (file)
@@ -263,6 +263,11 @@ void wxGLCanvas::SetViewport()
 }
 
 void wxGLCanvas::OnSize(wxSizeEvent& event)
+{
+  MacUpdateView() ;
+}
+
+void wxGLCanvas::MacUpdateView()
 {
   if (m_glContext)
   {
@@ -277,6 +282,18 @@ void wxGLCanvas::OnSize(wxSizeEvent& event)
   }
 }
 
+void wxGLCanvas::MacSuperChangedPosition()
+{
+  MacUpdateView() ;
+  wxWindow::MacSuperChangedPosition() ;
+}
+
+void wxGLCanvas::MacTopLevelWindowChangedPosition()
+{
+  MacUpdateView() ;
+  wxWindow::MacTopLevelWindowChangedPosition() ;
+}
+
 void wxGLCanvas::SetCurrent()
 {
   if (m_glContext)
index 41c65765be6c3016f490173643c77c12431c7928..97326af879fd493f0cc7d8b4fd12e6838f4737e9 100644 (file)
@@ -617,6 +617,8 @@ void wxWindowMac::DoMoveWindow(int x, int y, int width, int height)
                                frame->PositionStatusBar();
                                frame->PositionToolBar();
                        }
+                       if ( doMove )
+                               wxWindowMac::MacTopLevelWindowChangedPosition() ; // like this only children will be notified
                }
                else
                {
@@ -2194,6 +2196,19 @@ void wxWindowMac::MacSuperChangedPosition()
        }
 }
 
+void wxWindowMac::MacTopLevelWindowChangedPosition() 
+{
+       // only screen-absolute structures have to be moved i.e. glcanvas
+
+       wxNode *node = GetChildren().First();
+       while ( node )
+       {
+               wxWindowMac *child = (wxWindowMac *)node->Data();
+               child->MacTopLevelWindowChangedPosition() ;
+               node = node->Next();
+       }
+}
+
 bool wxWindowMac::MacSetPortFocusParams( const Point & localOrigin, const Rect & clipRect, WindowRef window , wxWindowMac* win ) 
 {
        if ( window == NULL )
index 1629d068b66e6eb2c2bac929cd2d442730fb4ed5..8edf2fc38e9c533c57b9a84b9f381fbabdb82462 100644 (file)
@@ -263,6 +263,11 @@ void wxGLCanvas::SetViewport()
 }
 
 void wxGLCanvas::OnSize(wxSizeEvent& event)
+{
+  MacUpdateView() ;
+}
+
+void wxGLCanvas::MacUpdateView()
 {
   if (m_glContext)
   {
@@ -277,6 +282,18 @@ void wxGLCanvas::OnSize(wxSizeEvent& event)
   }
 }
 
+void wxGLCanvas::MacSuperChangedPosition()
+{
+  MacUpdateView() ;
+  wxWindow::MacSuperChangedPosition() ;
+}
+
+void wxGLCanvas::MacTopLevelWindowChangedPosition()
+{
+  MacUpdateView() ;
+  wxWindow::MacTopLevelWindowChangedPosition() ;
+}
+
 void wxGLCanvas::SetCurrent()
 {
   if (m_glContext)
index 41c65765be6c3016f490173643c77c12431c7928..97326af879fd493f0cc7d8b4fd12e6838f4737e9 100644 (file)
@@ -617,6 +617,8 @@ void wxWindowMac::DoMoveWindow(int x, int y, int width, int height)
                                frame->PositionStatusBar();
                                frame->PositionToolBar();
                        }
+                       if ( doMove )
+                               wxWindowMac::MacTopLevelWindowChangedPosition() ; // like this only children will be notified
                }
                else
                {
@@ -2194,6 +2196,19 @@ void wxWindowMac::MacSuperChangedPosition()
        }
 }
 
+void wxWindowMac::MacTopLevelWindowChangedPosition() 
+{
+       // only screen-absolute structures have to be moved i.e. glcanvas
+
+       wxNode *node = GetChildren().First();
+       while ( node )
+       {
+               wxWindowMac *child = (wxWindowMac *)node->Data();
+               child->MacTopLevelWindowChangedPosition() ;
+               node = node->Next();
+       }
+}
+
 bool wxWindowMac::MacSetPortFocusParams( const Point & localOrigin, const Rect & clipRect, WindowRef window , wxWindowMac* win ) 
 {
        if ( window == NULL )