]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/mdi.cpp
fixed underline for drawing text, as suggested by Chris Breeze
[wxWidgets.git] / src / gtk1 / mdi.cpp
index f82bf73350b7bd701d2b02798dcc8ce0b217c6c1..160828e8cd4120d2f26e785f8160de0d2835472c 100644 (file)
 // wxMDIParentFrame
 //-----------------------------------------------------------------------------
 
+static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxWindow *win )
+{ 
+  if ((win->m_x == alloc->x) &&
+      (win->m_y == alloc->y) &&
+      (win->m_width == alloc->width) &&
+      (win->m_height == alloc->height))
+  {
+    return;
+  };
+  
+  win->SetSize( alloc->x, alloc->y, alloc->width, alloc->height );
+};
+
+//-----------------------------------------------------------------------------
+
 IMPLEMENT_DYNAMIC_CLASS(wxMDIParentFrame,wxFrame)
 
 wxMDIParentFrame::wxMDIParentFrame(void)
@@ -113,10 +128,10 @@ wxMDIChildFrame::wxMDIChildFrame(void)
 
 wxMDIChildFrame::wxMDIChildFrame( wxMDIParentFrame *parent,
       wxWindowID id, const wxString& title,
-      const wxPoint& pos, const wxSize& size,
+      const wxPoint& WXUNUSED(pos), const wxSize& size,
       long style, const wxString& name )
 {
-  Create( parent, id, title, pos, size, style, name );
+  Create( parent, id, title, wxDefaultPosition, size, style, name );
 };
 
 wxMDIChildFrame::~wxMDIChildFrame(void)
@@ -125,11 +140,11 @@ wxMDIChildFrame::~wxMDIChildFrame(void)
 
 bool wxMDIChildFrame::Create( wxMDIParentFrame *parent,
       wxWindowID id, const wxString& title,
-      const wxPoint& pos, const wxSize& size,
+      const wxPoint& WXUNUSED(pos), const wxSize& size,
       long style, const wxString& name )
 {
   m_title = title;
-  return wxPanel::Create( parent->GetClientWindow(), id, pos, size, style, name );
+  return wxPanel::Create( parent->GetClientWindow(), id, wxDefaultPosition, size, style, name );
 };
 
 void wxMDIChildFrame::SetMenuBar( wxMenuBar *WXUNUSED(menu_bar) )
@@ -191,6 +206,9 @@ void wxMDIClientWindow::AddChild( wxWindow *child )
   GtkWidget *label_widget;
   label_widget = gtk_label_new( s );
   gtk_misc_set_alignment( GTK_MISC(label_widget), 0.0, 0.5 );
+  
+  gtk_signal_connect( GTK_OBJECT(child->m_widget), "size_allocate",
+    GTK_SIGNAL_FUNC(gtk_page_size_callback), (gpointer)child );
 
   gtk_notebook_append_page( GTK_NOTEBOOK(m_widget), child->m_widget, label_widget );
 };