[wxVTK] wxVTK/src wxVTKRenderWindowInteractor.cxx,1.51,1.52
Brought to you by:
malat
From: tim_hutton <tim...@us...> - 2012-02-07 21:49:01
|
Update of /cvsroot/wxvtk/wxVTK/src In directory vz-cvs-4.sog:/tmp/cvs-serv17473 Modified Files: wxVTKRenderWindowInteractor.cxx Log Message: FIX: updated for wx2.9 Index: wxVTKRenderWindowInteractor.cxx =================================================================== RCS file: /cvsroot/wxvtk/wxVTK/src/wxVTKRenderWindowInteractor.cxx,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** wxVTKRenderWindowInteractor.cxx 2 Dec 2011 17:46:56 -0000 1.51 --- wxVTKRenderWindowInteractor.cxx 7 Feb 2012 21:48:59 -0000 1.52 *************** *** 38,41 **** --- 38,46 ---- #endif + #if defined(__WXMAC__) && wxCHECK_VERSION(2,9,0) + // ControlDown has been changed to mean Command key down + #define ControlDown RawControlDown + #endif + #ifdef __WXMAC__ #ifdef __WXCOCOA__ *************** *** 68,85 **** #ifdef __WXGTK__ ! # include <gdk/gdkx.h> // GDK_WINDOW_XWINDOW is found here in wxWidgets 2.8.0 ! # include "gdk/gdkprivate.h" ! #if wxCHECK_VERSION(2, 8, 0) ! #ifdef __WXGTK20__ ! #include <wx/gtk/win_gtk.h> ! #else ! #include <wx/gtk1/win_gtk.h> ! #endif ! #else ! #include <wx/gtk/win_gtk.h> ! #endif ! #define GetXWindow(wxwin) (wxwin)->m_wxwindow ? \ GDK_WINDOW_XWINDOW(GTK_PIZZA((wxwin)->m_wxwindow)->bin_window) : \ GDK_WINDOW_XWINDOW((wxwin)->m_widget->window) #endif --- 73,101 ---- #ifdef __WXGTK__ ! #include <gdk/gdkx.h> // GDK_WINDOW_XWINDOW is found here in wxWidgets 2.8.0 ! #include "gdk/gdkprivate.h" ! ! #if wxCHECK_VERSION(2, 9, 0) ! // thanks to: http://thomasfischer.biz/?p=382 ! #include <wx/gtk/private/win_gtk.h> ! #define piz(wxwin) WX_PIZZA((wxwin)->m_wxwindow) ! #define GetXWindow(wxwin) (wxwin)->m_wxwindow ? \ ! GDK_WINDOW_XWINDOW(((GtkWidget*)piz(wxwin))->window) : \ ! GDK_WINDOW_XWINDOW((wxwin)->m_widget->window) ! #else ! #if wxCHECK_VERSION(2, 8, 0) ! #ifdef __WXGTK20__ ! #include <wx/gtk/win_gtk.h> ! #else ! #include <wx/gtk1/win_gtk.h> ! #endif ! #else ! #include <wx/gtk/win_gtk.h> ! #endif ! ! #define GetXWindow(wxwin) (wxwin)->m_wxwindow ? \ GDK_WINDOW_XWINDOW(GTK_PIZZA((wxwin)->m_wxwindow)->bin_window) : \ GDK_WINDOW_XWINDOW((wxwin)->m_widget->window) + #endif #endif *************** *** 154,162 **** //--------------------------------------------------------------------------- #if defined(__WXGTK__) && defined(USE_WXGLCANVAS) ! wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor() : wxGLCanvas(0, -1, wxDefaultPosition, wxDefaultSize, 0, wxT("wxVTKRenderWindowInteractor"), wxvtk_attributes), vtkRenderWindowInteractor() #else ! wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor() : wxWindow(), vtkRenderWindowInteractor() #endif //__WXGTK__ , timer(this, ID_wxVTKRenderWindowInteractor_TIMER) , ActiveButton(wxEVT_NULL) --- 170,186 ---- //--------------------------------------------------------------------------- + wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor() + #if defined(__WXGTK__) && defined(USE_WXGLCANVAS) ! #if wxCHECK_VERSION(2, 9, 0) // the order of the parameters to wxGLCanvas::wxGLCanvas has changed ! : wxGLCanvas(0, -1, wxvtk_attributes, wxDefaultPosition, wxDefaultSize, 0, wxT("wxVTKRenderWindowInteractor")), ! #else ! : wxGLCanvas(0, -1, wxDefaultPosition, wxDefaultSize, 0, wxT("wxVTKRenderWindowInteractor"), wxvtk_attributes), ! #endif #else ! : wxWindow(), #endif //__WXGTK__ + + vtkRenderWindowInteractor() , timer(this, ID_wxVTKRenderWindowInteractor_TIMER) , ActiveButton(wxEVT_NULL) *************** *** 182,189 **** const wxString &name) #if defined(__WXGTK__) && defined(USE_WXGLCANVAS) ! : wxGLCanvas(parent, id, pos, size, style, name, wxvtk_attributes), vtkRenderWindowInteractor() #else ! : wxWindow(parent, id, pos, size, style, name), vtkRenderWindowInteractor() #endif //__WXGTK__ , timer(this, ID_wxVTKRenderWindowInteractor_TIMER) , ActiveButton(wxEVT_NULL) --- 206,218 ---- const wxString &name) #if defined(__WXGTK__) && defined(USE_WXGLCANVAS) ! #if wxCHECK_VERSION(2, 9, 0) // the order of the parameters to wxGLCanvas::wxGLCanvas has changed ! : wxGLCanvas(parent, id, wxvtk_attributes, pos, size, style, name) ! #else ! : wxGLCanvas(parent, id, pos, size, style, name, wxvtk_attributes) ! #endif #else ! : wxWindow(parent, id, pos, size, style, name) #endif //__WXGTK__ + , vtkRenderWindowInteractor() , timer(this, ID_wxVTKRenderWindowInteractor_TIMER) , ActiveButton(wxEVT_NULL) *************** *** 362,366 **** // __WXMSW__ is for Win32 ! //__WXMAC__ stands for using Carbon C-headers, using either the CarbonLib/CFM or the native Mach-O builds (which then also use the latest features available) // __WXGTK__ is for both gtk 1.2.x and gtk 2.x #if defined(__WXMSW__) || defined(__WXMAC__) --- 391,395 ---- // __WXMSW__ is for Win32 ! // __WXMAC__ is for Carbon or Cocoa builds // __WXGTK__ is for both gtk 1.2.x and gtk 2.x #if defined(__WXMSW__) || defined(__WXMAC__) *************** *** 368,388 **** #endif //__WXMSW__ ! //__WXCOCOA__ stands for using the objective-c Cocoa API ! #ifdef __WXCOCOA__ // Here is how to find the NSWindow wxTopLevelWindow* toplevel = dynamic_cast<wxTopLevelWindow*>(wxGetTopLevelParent( this ) ); if (toplevel != NULL ) { ! // AKT: use new Cocoa code if wxOSX 2.9.x ! #if wxCHECK_VERSION(2, 9, 0) ! handle_tmp = (long)toplevel->GetWXWindow(); ! #else ! handle_tmp = (long)toplevel->GetNSWindow(); ! #endif } // The NSView will be deducted from // [(NSWindow*)Handle contentView] // if only I knew how to write that in c++ ! #endif //__WXCOCOA__ // Find and return the actual X-Window. --- 397,412 ---- #endif //__WXMSW__ ! // using above GetHandle() works fine with wxOSX 2.9.x ! #if defined(__WXCOCOA__) && !wxCHECK_VERSION(2, 9, 0) // Here is how to find the NSWindow wxTopLevelWindow* toplevel = dynamic_cast<wxTopLevelWindow*>(wxGetTopLevelParent( this ) ); if (toplevel != NULL ) { ! handle_tmp = (long)toplevel->GetNSWindow(); } // The NSView will be deducted from // [(NSWindow*)Handle contentView] // if only I knew how to write that in c++ ! #endif //__WXCOCOA__ && !wxCHECK_VERSION(2, 9, 0) // Find and return the actual X-Window. *************** *** 419,423 **** // glContext (because the display is closed). The Get -> Set makes this VTK // object think someone else is responsible for the display. ! this->RenderWindow->SetDisplayId(this->RenderWindow->GetGenericDisplayId()); } // get vtk to render to the wxWindows --- 443,451 ---- // glContext (because the display is closed). The Get -> Set makes this VTK // object think someone else is responsible for the display. ! #ifdef __WXCOCOA__ ! // avoid "Method not implemented" messages in Console ! #else ! this->RenderWindow->SetDisplayId(this->RenderWindow->GetGenericDisplayId()); ! #endif } // get vtk to render to the wxWindows *************** *** 427,435 **** // See also: http://sourceforge.net/mailarchive/forum.php?thread_id=31690967&forum_id=41789 #ifdef __WXCOCOA__ ! vtkCocoaRenderWindow * rwin = vtkCocoaRenderWindow::SafeDownCast(RenderWindow); ! if( rwin ) ! { ! rwin->UpdateContext(); ! } #else vtkCarbonRenderWindow* rwin = vtkCarbonRenderWindow::SafeDownCast(RenderWindow); --- 455,466 ---- // See also: http://sourceforge.net/mailarchive/forum.php?thread_id=31690967&forum_id=41789 #ifdef __WXCOCOA__ ! #if !wxCHECK_VERSION(2, 9, 0) ! // this doesn't seem necessary with wxOSX 2.9.x ! vtkCocoaRenderWindow * rwin = vtkCocoaRenderWindow::SafeDownCast(RenderWindow); ! if( rwin ) ! { ! rwin->UpdateContext(); ! } ! #endif #else vtkCarbonRenderWindow* rwin = vtkCarbonRenderWindow::SafeDownCast(RenderWindow); |