]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/mdi.cpp
fixed SetRange/GetValue
[wxWidgets.git] / src / gtk1 / mdi.cpp
index 3ec3c31969c621c4a4142fba4b623a2a6613b862..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)
@@ -28,9 +43,9 @@ wxMDIParentFrame::wxMDIParentFrame(void)
 };
 
 wxMDIParentFrame::wxMDIParentFrame( wxWindow *parent,
-      const wxWindowID id, const wxString& title,
+      wxWindowID id, const wxString& title,
       const wxPoint& pos, const wxSize& size,
-      const long style, const wxString& name )
+      long style, const wxString& name )
 {
   m_clientWindow = NULL;
   m_currentChild = NULL;
@@ -43,9 +58,9 @@ wxMDIParentFrame::~wxMDIParentFrame(void)
 };
 
 bool wxMDIParentFrame::Create( wxWindow *parent,
-      const wxWindowID id, const wxString& title,
+      wxWindowID id, const wxString& title,
       const wxPoint& pos, const wxSize& size,
-      const long style, const wxString& name )
+      long style, const wxString& name )
 {
   wxFrame::Create( parent, id, title, pos, size, style, name );
   
@@ -112,11 +127,11 @@ wxMDIChildFrame::wxMDIChildFrame(void)
 };
 
 wxMDIChildFrame::wxMDIChildFrame( wxMDIParentFrame *parent,
-      const wxWindowID id, const wxString& title,
-      const wxPoint& pos, const wxSize& size,
-      const long style, const wxString& name )
+      wxWindowID id, const wxString& title,
+      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)
@@ -124,12 +139,12 @@ wxMDIChildFrame::~wxMDIChildFrame(void)
 };
 
 bool wxMDIChildFrame::Create( wxMDIParentFrame *parent,
-      const wxWindowID id, const wxString& title,
-      const wxPoint& pos, const wxSize& size,
-      const long style, const wxString& name )
+      wxWindowID id, const wxString& title,
+      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) )
@@ -150,7 +165,7 @@ wxMDIClientWindow::wxMDIClientWindow(void)
 {
 };
 
-wxMDIClientWindow::wxMDIClientWindow( wxMDIParentFrame *parent, const long style )
+wxMDIClientWindow::wxMDIClientWindow( wxMDIParentFrame *parent, long style )
 {
   CreateClient( parent, style );
 };
@@ -159,7 +174,7 @@ wxMDIClientWindow::~wxMDIClientWindow(void)
 {
 };
 
-bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, const long style )
+bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style )
 {
   m_needParent = TRUE;
   
@@ -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 );
 };