From 4b59bea3dd0a8df4eecb61862647572caab49690 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Thu, 11 Nov 1999 15:41:43 +0000 Subject: [PATCH] Fixed optical bug in wxListCtrl, Added dnd.wxr to install script, Fixed two problems in wxGLCanvas. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4475 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- Makefile.in | 5 +++- distrib/msw/tmake/unx.t | 1 + samples/dnd/dnd.cpp | 1 + src/generic/listctrl.cpp | 2 +- utils/glcanvas/gtk/glcanvas.cpp | 44 ++++++++++++++++++++------------- utils/glcanvas/gtk/glcanvas.h | 1 + 6 files changed, 35 insertions(+), 19 deletions(-) diff --git a/Makefile.in b/Makefile.in index b3b5d62abc..f28036562e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,5 +1,5 @@ # -# This file was automatically generated by tmake at 16:44, 1999/11/05 +# This file was automatically generated by tmake at 15:47, 1999/11/11 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE UNX.T! # @@ -1651,6 +1651,7 @@ MSW_GUIOBJS = \ filedlg.o \ font.o \ fontdlg.o \ + fontenum.o \ fontutil.o \ frame.o \ gauge95.o \ @@ -1739,6 +1740,7 @@ MSW_GUIDEPS = \ filedlg.d \ font.d \ fontdlg.d \ + fontenum.d \ fontutil.d \ frame.d \ gauge95.d \ @@ -2325,6 +2327,7 @@ SAMPLES_DIST: cp $(SAMPDIR)/dialogs/*.txt $(DISTDIR)/samples/dialogs mkdir $(DISTDIR)/samples/dnd cp $(SAMPDIR)/dnd/Makefile.in $(DISTDIR)/samples/dnd + cp $(SAMPDIR)/dnd/*.wxr $(DISTDIR)/samples/dnd cp $(SAMPDIR)/dnd/*.cpp $(DISTDIR)/samples/dnd cp $(SAMPDIR)/dnd/*.xpm $(DISTDIR)/samples/dnd cp $(SAMPDIR)/dnd/*.txt $(DISTDIR)/samples/dnd diff --git a/distrib/msw/tmake/unx.t b/distrib/msw/tmake/unx.t index f91ad22925..3d05cfaad7 100644 --- a/distrib/msw/tmake/unx.t +++ b/distrib/msw/tmake/unx.t @@ -818,6 +818,7 @@ SAMPLES_DIST: cp $(SAMPDIR)/dialogs/*.txt $(DISTDIR)/samples/dialogs mkdir $(DISTDIR)/samples/dnd cp $(SAMPDIR)/dnd/Makefile.in $(DISTDIR)/samples/dnd + cp $(SAMPDIR)/dnd/*.wxr $(DISTDIR)/samples/dnd cp $(SAMPDIR)/dnd/*.cpp $(DISTDIR)/samples/dnd cp $(SAMPDIR)/dnd/*.xpm $(DISTDIR)/samples/dnd cp $(SAMPDIR)/dnd/*.txt $(DISTDIR)/samples/dnd diff --git a/samples/dnd/dnd.cpp b/samples/dnd/dnd.cpp index 8490b93ee0..a7a8274f31 100644 --- a/samples/dnd/dnd.cpp +++ b/samples/dnd/dnd.cpp @@ -804,6 +804,7 @@ void DnDFrame::OnPaint(wxPaintEvent& WXUNUSED(event)) void DnDFrame::OnUpdateUIPasteText(wxUpdateUIEvent& event) { event.Enable( wxTheClipboard->IsSupported(wxDF_TEXT) ); +// event.Enable( TRUE ); } void DnDFrame::OnUpdateUIPasteBitmap(wxUpdateUIEvent& event) diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 9c67a8be91..0e6d33926f 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -872,7 +872,7 @@ void wxListHeaderWindow::OnMouse( wxMouseEvent &event ) m_minX = 0; bool hit_border = FALSE; int xpos = 0; - for (int j = 0; j < m_owner->GetColumnCount(); j++) + for (int j = 0; j < m_owner->GetColumnCount()-1; j++) { xpos += m_owner->GetColumnWidth( j ); m_column = j; diff --git a/utils/glcanvas/gtk/glcanvas.cpp b/utils/glcanvas/gtk/glcanvas.cpp index 735da31179..811c0fcb80 100644 --- a/utils/glcanvas/gtk/glcanvas.cpp +++ b/utils/glcanvas/gtk/glcanvas.cpp @@ -50,11 +50,14 @@ IMPLEMENT_CLASS(wxGLContext,wxObject) wxGLContext::wxGLContext( bool WXUNUSED(isRGB), wxWindow *win, const wxPalette& WXUNUSED(palette) ) { m_window = win; - m_widget = ((wxGLCanvas*)win)->m_glWidget; - - wxCHECK_RET( g_vi, "invalid visual for OpenGl" ); + m_widget = win->m_wxwindow; + + wxGLCanvas *gc = (wxGLCanvas*) win; + XVisualInfo *vi = (XVisualInfo *) gc->m_vi; + + wxCHECK_RET( vi, "invalid visual for OpenGl" ); - m_glContext = glXCreateContext( GDK_DISPLAY(), g_vi, None, GL_TRUE ); + m_glContext = glXCreateContext( GDK_DISPLAY(), vi, None, GL_TRUE ); wxCHECK_RET( m_glContext, "Couldn't create OpenGl context" ); } @@ -66,15 +69,17 @@ wxGLContext::wxGLContext( ) { m_window = win; - m_widget = ((wxGLCanvas*)win)->m_glWidget; - - wxCHECK_RET( g_vi, "invalid visual for OpenGl" ); + m_widget = win->m_wxwindow; + + wxGLCanvas *gc = (wxGLCanvas*) win; + XVisualInfo *vi = (XVisualInfo *) gc->m_vi; + + wxCHECK_RET( vi, "invalid visual for OpenGl" ); if( other != 0 ) - m_glContext = glXCreateContext( GDK_DISPLAY(), g_vi, other->m_glContext, - GL_TRUE ); + m_glContext = glXCreateContext( GDK_DISPLAY(), vi, other->m_glContext, GL_TRUE ); else - m_glContext = glXCreateContext( GDK_DISPLAY(), g_vi, None, GL_TRUE ); + m_glContext = glXCreateContext( GDK_DISPLAY(), vi, None, GL_TRUE ); wxCHECK_RET( m_glContext, "Couldn't create OpenGl context" ); } @@ -146,9 +151,6 @@ gtk_glwindow_realized_callback( GtkWidget * WXUNUSED(widget), wxGLCanvas *win ) { win->m_glContext = new wxGLContext( TRUE, win, wxNullPalette, win->m_sharedContext ); - XFree( g_vi ); - g_vi = (XVisualInfo*) NULL; - return FALSE; } @@ -243,6 +245,7 @@ bool wxGLCanvas::Create( wxWindow *parent, const wxPalette& palette) { m_sharedContext = (wxGLContext*)shared; // const_cast + m_glContext = (wxGLContext*) NULL; m_exposed = FALSE; m_noExpose = TRUE; @@ -290,12 +293,14 @@ bool wxGLCanvas::Create( wxWindow *parent, Display *dpy = GDK_DISPLAY(); - g_vi = glXChooseVisual( dpy, DefaultScreen(dpy), attribList ); + XVisualInfo *vi = glXChooseVisual( dpy, DefaultScreen(dpy), attribList ); + + m_vi = vi; // safe for later use - wxCHECK_MSG( g_vi, FALSE, "required visual couldn't be found" ); + wxCHECK_MSG( m_vi, FALSE, "required visual couldn't be found" ); - GdkVisual *visual = gdkx_visual_get( g_vi->visualid ); - GdkColormap *colormap = gdk_colormap_new( gdkx_visual_get(g_vi->visualid), TRUE ); + GdkVisual *visual = gdkx_visual_get( vi->visualid ); + GdkColormap *colormap = gdk_colormap_new( gdkx_visual_get(vi->visualid), TRUE ); gtk_widget_push_colormap( colormap ); gtk_widget_push_visual( visual ); @@ -326,6 +331,11 @@ bool wxGLCanvas::Create( wxWindow *parent, wxGLCanvas::~wxGLCanvas() { + XVisualInfo *vi = (XVisualInfo *) m_vi; + + if (vi) + XFree( vi ); + if (m_glContext) delete m_glContext; } diff --git a/utils/glcanvas/gtk/glcanvas.h b/utils/glcanvas/gtk/glcanvas.h index 9b8e910bd5..f426e65dda 100644 --- a/utils/glcanvas/gtk/glcanvas.h +++ b/utils/glcanvas/gtk/glcanvas.h @@ -132,6 +132,7 @@ public: wxGLContext *m_glContext, *m_sharedContext; + void *m_vi; GtkWidget *m_glWidget; bool m_exposed; -- 2.47.2