]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/minifram.cpp
fix wxCheckListBox which was completely broken by the Unicode changes
[wxWidgets.git] / src / gtk1 / minifram.cpp
index 53d01860b9c86552f945c785208fad415add3e7c..2e98dd832e54b497823460f37eca4cbe5e3a68a2 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "gtk/gtk.h"
 #include "wx/gtk/win_gtk.h"
+#include "wx/gtk/private.h"
 
 #include <gdk/gdk.h>
 #include <gdk/gdkprivate.h>
@@ -100,7 +101,7 @@ static void gtk_window_own_expose_callback( GtkWidget *widget, GdkEventExpose *g
         gdk_draw_string( pizza->bin_window, font, gc,
                          6,
                          3+font->ascent,
-                         win->m_title.mb_str() );
+                         wxGTK_CONV( win->m_title ) );
 
         gdk_gc_unref( gc );
     }
@@ -144,7 +145,7 @@ static void gtk_window_own_draw_callback( GtkWidget *widget, GdkRectangle *WXUNU
         gdk_draw_string( pizza->bin_window, font, gc,
                          6,
                          3+font->ascent,
-                         win->m_title.mb_str() );
+                         wxGTK_CONV( win->m_title ) );
 
         gdk_gc_unref( gc );
     }
@@ -164,6 +165,13 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
 
     if (win->m_isDragging) return TRUE;
 
+    GtkPizza *pizza = GTK_PIZZA(widget);
+    if (gdk_event->window != pizza->bin_window) return TRUE;
+    
+    GdkFont *font = wxSMALL_FONT->GetInternalFont(1.0);
+    int height = font->ascent + font->descent+1;
+    if (gdk_event->y > height) return TRUE;
+        
     gdk_window_raise( win->m_widget->window );
 
     gdk_pointer_grab( widget->window, FALSE,
@@ -303,7 +311,7 @@ bool wxMiniFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title
       const wxPoint &pos, const wxSize &size,
       long style, const wxString &name )
 {
-    style = style | wxCAPTION | wxFRAME_FLOAT_ON_PARENT;
+    style = style | wxCAPTION;
 
     if ((style & wxCAPTION) || (style & wxTINY_CAPTION_HORIZ) || (style & wxTINY_CAPTION_VERT))
         m_miniTitle = 13;
@@ -317,6 +325,11 @@ bool wxMiniFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title
 
     wxFrame::Create( parent, id, title, pos, size, style, name );
 
+    if (m_parent && (GTK_IS_WINDOW(m_parent->m_widget)))
+    {
+        gtk_window_set_transient_for( GTK_WINDOW(m_widget), GTK_WINDOW(m_parent->m_widget) );
+    }
+    
     if ((style & wxSYSTEM_MENU) &&
         ((style & wxCAPTION) || (style & wxTINY_CAPTION_HORIZ) || (style & wxTINY_CAPTION_VERT)))
     {