]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed optical bug in wxListCtrl,
authorRobert Roebling <robert@roebling.de>
Thu, 11 Nov 1999 15:41:43 +0000 (15:41 +0000)
committerRobert Roebling <robert@roebling.de>
Thu, 11 Nov 1999 15:41:43 +0000 (15:41 +0000)
  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
distrib/msw/tmake/unx.t
samples/dnd/dnd.cpp
src/generic/listctrl.cpp
utils/glcanvas/gtk/glcanvas.cpp
utils/glcanvas/gtk/glcanvas.h

index b3b5d62abc32abb7fc5cd61ce826f2732932422a..f28036562ee38b969d947330057a034634cc54a5 100644 (file)
@@ -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
index f91ad229259ccb82566c4046850ad30a1394ca00..3d05cfaad7d9647427ffb3234fa383e74dfec619 100644 (file)
@@ -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
index 8490b93ee090c849de74a4b75a3f5b70042b9704..a7a8274f31b5cf90e816940746c55698458c0471 100644 (file)
@@ -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)
index 9c67a8be91ccd574781fce8e6fe17ed04680a3a5..0e6d33926faa1c9bf5add05e23501eda97b8e18c 100644 (file)
@@ -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;
index 735da31179d5bf745f09420ff8314474067df113..811c0fcb803453ef697a0e527e13b1cce4a56bcd 100644 (file)
@@ -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;
 }
 
index 9b8e910bd50fe760cce28834873c81d32c937a33..f426e65ddaff34120aa59528aa6134ac4043a806 100644 (file)
@@ -132,6 +132,7 @@ public:
   
     wxGLContext      *m_glContext,
                      *m_sharedContext;
+    void             *m_vi;
     GtkWidget        *m_glWidget;
     bool              m_exposed;