]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/minifram.cpp
Use wxMBConvUTF8 when G_FILENAME_ENCODING is UTF-8, and set
[wxWidgets.git] / src / gtk / minifram.cpp
index c23782237b723898a8acfda7244baa3b9d2b8c0b..139f1433c1bf0f984c59f2822f59d95834ddd9ae 100644 (file)
@@ -7,10 +7,13 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
-#pragma implementation "minifram.h"
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
+    #pragma implementation "minifram.h"
 #endif
 
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #include "wx/minifram.h"
 
 #if wxUSE_MINIFRAME
 #include "wx/minifram.h"
 
 #if wxUSE_MINIFRAME
@@ -66,6 +69,7 @@ static void DrawFrame( GtkWidget *widget, int x, int y, int w, int h )
 // "expose_event" of m_mainWidget
 //-----------------------------------------------------------------------------
 
 // "expose_event" of m_mainWidget
 //-----------------------------------------------------------------------------
 
+extern "C" {
 static void gtk_window_own_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_event, wxFrame *win )
 {
     if (g_isIdle) wxapp_install_idle_handler();
 static void gtk_window_own_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_event, wxFrame *win )
 {
     if (g_isIdle) wxapp_install_idle_handler();
@@ -106,12 +110,14 @@ static void gtk_window_own_expose_callback( GtkWidget *widget, GdkEventExpose *g
         dc.DrawText( win->GetTitle(), 6, 3 );
     }
 }
         dc.DrawText( win->GetTitle(), 6, 3 );
     }
 }
+}
 
 //-----------------------------------------------------------------------------
 // "draw" of m_mainWidget
 //-----------------------------------------------------------------------------
 
 #ifndef __WXGTK20__
 
 //-----------------------------------------------------------------------------
 // "draw" of m_mainWidget
 //-----------------------------------------------------------------------------
 
 #ifndef __WXGTK20__
+extern "C" {
 static void gtk_window_own_draw_callback( GtkWidget *widget, GdkRectangle *WXUNUSED(rect), wxFrame *win )
 {
     if (g_isIdle) wxapp_install_idle_handler();
 static void gtk_window_own_draw_callback( GtkWidget *widget, GdkRectangle *WXUNUSED(rect), wxFrame *win )
 {
     if (g_isIdle) wxapp_install_idle_handler();
@@ -151,12 +157,14 @@ static void gtk_window_own_draw_callback( GtkWidget *widget, GdkRectangle *WXUNU
         dc.DrawText( win->GetTitle(), 6, 3 );
     }
 }
         dc.DrawText( win->GetTitle(), 6, 3 );
     }
 }
+}
 #endif
 
 //-----------------------------------------------------------------------------
 // "button_press_event" of m_mainWidget
 //-----------------------------------------------------------------------------
 
 #endif
 
 //-----------------------------------------------------------------------------
 // "button_press_event" of m_mainWidget
 //-----------------------------------------------------------------------------
 
+extern "C" {
 static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton *gdk_event, wxMiniFrame *win )
 {
     if (g_isIdle) wxapp_install_idle_handler();
 static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton *gdk_event, wxMiniFrame *win )
 {
     if (g_isIdle) wxapp_install_idle_handler();
@@ -200,11 +208,13 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
 
     return TRUE;
 }
 
     return TRUE;
 }
+}
 
 //-----------------------------------------------------------------------------
 // "button_release_event" of m_mainWidget
 //-----------------------------------------------------------------------------
 
 
 //-----------------------------------------------------------------------------
 // "button_release_event" of m_mainWidget
 //-----------------------------------------------------------------------------
 
+extern "C" {
 static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButton *gdk_event, wxMiniFrame *win )
 {
     if (g_isIdle) wxapp_install_idle_handler();
 static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButton *gdk_event, wxMiniFrame *win )
 {
     if (g_isIdle) wxapp_install_idle_handler();
@@ -233,11 +243,13 @@ static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButto
 
     return TRUE;
 }
 
     return TRUE;
 }
+}
 
 //-----------------------------------------------------------------------------
 // "motion_notify_event" of m_mainWidget
 //-----------------------------------------------------------------------------
 
 
 //-----------------------------------------------------------------------------
 // "motion_notify_event" of m_mainWidget
 //-----------------------------------------------------------------------------
 
+extern "C" {
 static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion *gdk_event, wxMiniFrame *win )
 {
     if (g_isIdle) wxapp_install_idle_handler();
 static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion *gdk_event, wxMiniFrame *win )
 {
     if (g_isIdle) wxapp_install_idle_handler();
@@ -266,17 +278,20 @@ static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion
 
     return TRUE;
 }
 
     return TRUE;
 }
+}
 
 //-----------------------------------------------------------------------------
 // "clicked" of X system button
 //-----------------------------------------------------------------------------
 
 
 //-----------------------------------------------------------------------------
 // "clicked" of X system button
 //-----------------------------------------------------------------------------
 
+extern "C" {
 static void gtk_button_clicked_callback( GtkWidget *WXUNUSED(widget), wxMiniFrame *mf )
 {
     if (g_isIdle) wxapp_install_idle_handler();
 
     mf->Close();
 }
 static void gtk_button_clicked_callback( GtkWidget *WXUNUSED(widget), wxMiniFrame *mf )
 {
     if (g_isIdle) wxapp_install_idle_handler();
 
     mf->Close();
 }
+}
 
 //-----------------------------------------------------------------------------
 // wxMiniFrame
 
 //-----------------------------------------------------------------------------
 // wxMiniFrame
@@ -386,4 +401,15 @@ bool wxMiniFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title
     return TRUE;
 }
 
     return TRUE;
 }
 
+void wxMiniFrame::SetTitle( const wxString &title )
+{
+    wxFrame::SetTitle( title );
+    
+#ifdef __WXGTK20__
+    gdk_window_invalidate_rect( GTK_PIZZA(m_mainWidget)->bin_window, NULL, true );
+#else
+    gtk_widget_draw( m_mainWidget, (GdkRectangle*) NULL );
+#endif
+}
+
 #endif
 #endif