]> git.saurik.com Git - wxWidgets.git/commitdiff
resize mdi and notebook client
authorRobert Roebling <robert@roebling.de>
Mon, 13 Jul 1998 23:30:59 +0000 (23:30 +0000)
committerRobert Roebling <robert@roebling.de>
Mon, 13 Jul 1998 23:30:59 +0000 (23:30 +0000)
bitmap resizing (used in imagelist)
draw spline bug

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@262 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

18 files changed:
include/wx/generic/listctrl.h
include/wx/gtk/window.h
include/wx/gtk1/window.h
samples/controls/controls.cpp
samples/mdi/mdi.cpp
samples/mdi/mdi.h
src/generic/listctrl.cpp
src/gtk/bitmap.cpp
src/gtk/dc.cpp
src/gtk/mdi.cpp
src/gtk/notebook.cpp
src/gtk/window.cpp
src/gtk1/bitmap.cpp
src/gtk1/dc.cpp
src/gtk1/mdi.cpp
src/gtk1/notebook.cpp
src/gtk1/window.cpp
user/wxFile/filectrl.cpp

index aefb6506849352cbf4b6120c54e3469bcdac7146..ccd8b5c78a388e01a6c5b293e21c950a0268e58c 100644 (file)
@@ -594,6 +594,7 @@ class wxListCtrl: public wxControl
     bool GetItemPosition( long item, wxPoint& pos ) const; // not supported in wxGLC
     bool SetItemPosition( long item, const wxPoint& pos ); // not supported in wxGLC
     int GetItemCount(void);
+    void SetItemSpacing( int spacing, bool isSmall = FALSE );
     int GetItemSpacing( bool isSmall );
     int GetSelectedItemCount(void);
 //  wxColour GetTextColour(void) const; // wxGLC has colours for every Item (see wxListItem)
index 482556b62607ac3cf6628910046b40dd8c4aa6b4..84a3ddcddf581facc3868b632657a4917046eab9 100644 (file)
@@ -222,6 +222,7 @@ class wxWindow: public wxEvtHandler
     bool            m_hasScrolling;
     bool            m_hasVMT;
     bool            m_sizeSet;
+    bool            m_resizing;
     
   public:  // Layout section
   
index 482556b62607ac3cf6628910046b40dd8c4aa6b4..84a3ddcddf581facc3868b632657a4917046eab9 100644 (file)
@@ -222,6 +222,7 @@ class wxWindow: public wxEvtHandler
     bool            m_hasScrolling;
     bool            m_hasVMT;
     bool            m_sizeSet;
+    bool            m_resizing;
     
   public:  // Layout section
   
index 7db58c82196efc4113d5f4af1cf23e25115bbf2f..7ecbdf18d92f6d1335d2331459b3317f2a1d267d 100644 (file)
@@ -180,7 +180,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) :
   m_combo = new wxComboBox( panel, ID_COMBO, "This", wxPoint(10,10), wxSize(120,-1), 9, choices );
   m_notebook->AddPage(panel, "wxComboBox");
   
-  wxTextCtrl *text = new wxTextCtrl( m_notebook, ID_TEXT, "Write text here.", wxPoint(0,20), wxSize(120,100), wxTE_MULTILINE );
+  wxTextCtrl *text = new wxTextCtrl( m_notebook, ID_TEXT, "Write text here.", wxPoint(10,10), wxSize(120,100), wxTE_MULTILINE );
   m_notebook->AddPage( text, "wxTextCtrl" );
 }
 
index ed177ee94b78d12facc84d22616cb6cd30ed897b..97b0a355ab48380ea28c19b72c972371d9770706 100644 (file)
@@ -206,7 +206,7 @@ void MyCanvas::OnDraw(wxDC& dc)
   points[0].x = 200; points[0].y = 300;
   points[1].x = 100; points[1].y = 400;
   points[2].x = 300; points[2].y = 400;
-
+  
   dc.DrawPolygon(3, points);
 }
 
@@ -271,6 +271,7 @@ void MyFrame::OnSize(wxSizeEvent& event)
 
 BEGIN_EVENT_TABLE(MyChild, wxMDIChildFrame)
   EVT_MENU(MDI_CHILD_QUIT, MyChild::OnQuit)
+  EVT_SIZE( MyChild::OnSize)
 END_EVENT_TABLE()
 
 MyChild::MyChild(wxMDIParentFrame *parent, const wxString& title, const wxPoint& pos, const wxSize& size,
@@ -286,7 +287,15 @@ MyChild::~MyChild(void)
   my_children.DeleteObject(this);
 }
 
-void MyChild::OnQuit(wxCommandEvent& event)
+void MyChild::OnSize(wxSizeEvent& WXUNUSED(event))
+{
+  int x = 0;
+  int y = 0;
+  GetClientSize( &x, &y );
+  if (canvas) canvas->SetSize( x, y );
+}
+
+void MyChild::OnQuit(wxCommandEvent& WXUNUSED(event))
 {
       Close(TRUE);
 }
index 37736994225321aff839c42ce201fa23f17ecd59..47d61ee24eb57ed6d29a8aa8d2eda899b1623ab3 100644 (file)
@@ -77,6 +77,7 @@ class MyChild: public wxMDIChildFrame
     MyChild(wxMDIParentFrame *parent, const wxString& title, const wxPoint& pos, const wxSize& size, const long style);
     ~MyChild(void);
     bool OnClose(void);
+    void OnSize(wxSizeEvent& event);
     void OnActivate(wxActivateEvent& event);
     void OnQuit(wxCommandEvent& event);
 
index 13075f33dfa3e4c2d3fd28ad7ad33b82ceb0d69b..788670089a0707dfc0fc1be694a91e11b37aba7a 100644 (file)
@@ -1314,12 +1314,12 @@ void wxListMainWindow::DrawImage( int index, wxPaintDC *dc, int x, int y )
 {
   if ((m_mode & wxLC_ICON) && (m_normal_image_list))
   {
-    m_normal_image_list->Draw( index, *dc, x, y );
+    m_normal_image_list->Draw( index, *dc, x, y, wxIMAGELIST_DRAW_TRANSPARENT );
     return;
   };
   if ((m_mode & wxLC_SMALL_ICON) && (m_small_image_list))
   {
-    m_small_image_list->Draw( index, *dc, x, y );
+    m_small_image_list->Draw( index, *dc, x, y, wxIMAGELIST_DRAW_TRANSPARENT );
   };
 };
 
@@ -2212,6 +2212,11 @@ int wxListCtrl::GetItemCount(void)
   return m_mainWin->GetItemCount();
 };
 
+void wxListCtrl::SetItemSpacing( int spacing, bool isSmall )
+{
+  m_mainWin->SetItemSpacing( spacing, isSmall );
+};
+
 int wxListCtrl::GetItemSpacing( bool isSmall )
 {
   return m_mainWin->GetItemSpacing( isSmall );
index 7ae387a2f5968f063e75b413cee7ec904f6b4b7c..d2241e591d093489b6b99e7201180fc3a0464b51 100644 (file)
@@ -278,8 +278,6 @@ void wxBitmap::Resize( int height, int width )
 {
   if (!Ok()) return;
   
-  return;
-  
 #ifdef USE_GDK_IMLIB
   
   if (M_BMPDATA->m_bitmap) return;  // not supported for bitmaps
index b50ade747a938b27d2eb14055abdda594e191795..faba4faab6364825c06ec9e87b3bcc02eeca0381 100644 (file)
@@ -136,11 +136,17 @@ void wxDC::DrawLines( wxList *list, long xoffset, long yoffset )
 void wxDC::DrawSpline( long x1, long y1, long x2, long y2, long x3, long y3 )
 {
   wxList list;
-  list.DeleteContents(TRUE);
   list.Append( (wxObject*)new wxPoint(x1, y1) );
   list.Append( (wxObject*)new wxPoint(x2, y2) );
   list.Append( (wxObject*)new wxPoint(x3, y3) );
   DrawSpline(&list);
+  wxNode *node = list.First();
+  while (node)
+  {
+    wxPoint *p = (wxPoint*)node->Data();
+    delete p;
+    node = node->Next();
+  };
 };
 
 void wxDC::DrawSpline( wxList *points )
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 );
 };
index 39bb7904177fe195eff3799f266912dbd697ed6f..9b6ec68ef5a00bef51911d74e3e515df0c9eba46 100644 (file)
@@ -69,6 +69,40 @@ static void gtk_notebook_page_change_callback(GtkNotebook *WXUNUSED(widget),
   notebook->ProcessEvent(event);
 }
 
+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;
+  };
+  
+/*
+  printf( "OnResize from " );
+  if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
+    printf( win->GetClassInfo()->GetClassName() );
+  printf( " .\n" );
+    
+  printf( "  Old: X: %d  Y: %d ", win->m_x, win->m_y );
+  printf( "  W: %d  H: %d ", win->m_width, win->m_height );
+  printf( " .\n" );
+    
+  printf( "  New: X: %d  Y: %d ", alloc->x, alloc->y );
+  printf( "  W: %d  H: %d ", alloc->width, alloc->height );
+  printf( " .\n" );
+*/
+  
+  win->SetSize( alloc->x, alloc->y, alloc->width, alloc->height );
+  
+/*
+  printf( "  Res: X: %d  Y: %d ", win->m_x, win->m_y );
+  printf( "  W: %d  H: %d ", win->m_width, win->m_height );
+  printf( " .\n" );
+*/    
+};
+  
 //-----------------------------------------------------------------------------
 // wxNotebook
 //-----------------------------------------------------------------------------
@@ -370,7 +404,6 @@ void wxNotebook::AddChild( wxWindow *win )
 
   m_children.Append(win);
 
-
   wxNotebookPage *page = new wxNotebookPage();
 
   page->m_id = GetPageCount();
@@ -384,7 +417,10 @@ void wxNotebook::AddChild( wxWindow *win )
     (GtkNotebookPage*) (g_list_last(GTK_NOTEBOOK(m_widget)->children)->data);
 
   page->m_parent = GTK_NOTEBOOK(m_widget);
-
+  
+  gtk_signal_connect( GTK_OBJECT(win->m_widget), "size_allocate",
+    GTK_SIGNAL_FUNC(gtk_page_size_callback), (gpointer)win );
+  
   if (!page->m_page)
   {
      wxLogFatalError( "Notebook page creation error" );
@@ -404,12 +440,12 @@ void wxNotebook::OnSize(wxSizeEvent& event)
     // @@@@ the numbers I substract here are completely arbitrary, instead we
     // should somehow calculate the size of the page from the size of the
     // notebook
-    page->SetSize(event.GetSize().GetX() - 5,
+/*    page->SetSize(event.GetSize().GetX() - 5,
                                  event.GetSize().GetY() - 30);
 
     if ( page->GetAutoLayout() )
       page->Layout();
-
+*/
     node = node->Next();
   };
 }
index c9832cefa80f6e73a64dc64f13a96404d5e7bb05..74ab35d9c7a6a3af5f781417996d6f02ac3e21eb 100644 (file)
@@ -108,7 +108,9 @@ void gtk_window_draw_callback( GtkWidget *WXUNUSED(widget), GdkRectangle *rect,
 
 //-----------------------------------------------------------------------------
 // size 
-//      I don't any longer intercept GTK's internal resize events (except frames)
+//      I don't any longer intercept GTK's internal resize events, except 
+//      for frames and from within MDI and tabbed windows (client area
+//      size determined internally by GTK, not wxWin).
 
 /*
 void gtk_window_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxWindow *win )
@@ -730,6 +732,7 @@ wxWindow::wxWindow()
   m_drawingOffsetX = 0;
   m_drawingOffsetY = 0;
   m_pDropTarget = NULL;
+  m_resizing = FALSE;
 };
 
 wxWindow::wxWindow( wxWindow *parent, wxWindowID id,
@@ -913,6 +916,7 @@ void wxWindow::PreCreation( wxWindow *parent, wxWindowID id,
   m_drawingOffsetX = 0;
   m_drawingOffsetY = 0;
   m_pDropTarget = NULL;
+  m_resizing = FALSE;
 }
 
 void wxWindow::PostCreation(void)
@@ -1059,6 +1063,9 @@ void wxWindow::ImplementSetPosition(void)
 
 void wxWindow::SetSize( int x, int y, int width, int height, int sizeFlags )
 {
+  if (m_resizing) return; // I don't like recursions
+  m_resizing = TRUE;
+  
   int newX = x;
   int newY = y;
   int newW = width;
@@ -1099,6 +1106,8 @@ void wxWindow::SetSize( int x, int y, int width, int height, int sizeFlags )
   wxSizeEvent event( wxSize(m_width,m_height), GetId() );
   event.SetEventObject( this );
   ProcessEvent( event );
+  
+  m_resizing = FALSE;
 };
 
 void wxWindow::SetSize( int width, int height )
@@ -1113,8 +1122,8 @@ void wxWindow::Move( int x, int y )
 
 void wxWindow::GetSize( int *width, int *height ) const
 {
-  (*width) = m_width;
-  (*height) = m_height;
+  if (width) (*width) = m_width;
+  if (height) (*height) = m_height;
 };
 
 void wxWindow::SetClientSize( int width, int height )
@@ -1423,6 +1432,8 @@ void wxWindow::AddChild( wxWindow *child )
     };
   };
   
+  // wxNotebooks are very special, so they have their own AddChild
+  
   if (IsKindOf(CLASSINFO(wxNotebook)))
   {
     wxNotebook *tab = (wxNotebook*)this;
@@ -1828,7 +1839,7 @@ void wxWindow::SetScrollbar( int orient, int pos, int thumbVisible,
     m_vAdjust->page_increment = (float)(wxMax(fthumb-2,0));
     m_vAdjust->page_size = fthumb;
   };
+  
   if (m_wxwindow->window)
   {  
     if (orient == wxHORIZONTAL)
index 7ae387a2f5968f063e75b413cee7ec904f6b4b7c..d2241e591d093489b6b99e7201180fc3a0464b51 100644 (file)
@@ -278,8 +278,6 @@ void wxBitmap::Resize( int height, int width )
 {
   if (!Ok()) return;
   
-  return;
-  
 #ifdef USE_GDK_IMLIB
   
   if (M_BMPDATA->m_bitmap) return;  // not supported for bitmaps
index b50ade747a938b27d2eb14055abdda594e191795..faba4faab6364825c06ec9e87b3bcc02eeca0381 100644 (file)
@@ -136,11 +136,17 @@ void wxDC::DrawLines( wxList *list, long xoffset, long yoffset )
 void wxDC::DrawSpline( long x1, long y1, long x2, long y2, long x3, long y3 )
 {
   wxList list;
-  list.DeleteContents(TRUE);
   list.Append( (wxObject*)new wxPoint(x1, y1) );
   list.Append( (wxObject*)new wxPoint(x2, y2) );
   list.Append( (wxObject*)new wxPoint(x3, y3) );
   DrawSpline(&list);
+  wxNode *node = list.First();
+  while (node)
+  {
+    wxPoint *p = (wxPoint*)node->Data();
+    delete p;
+    node = node->Next();
+  };
 };
 
 void wxDC::DrawSpline( wxList *points )
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 );
 };
index 39bb7904177fe195eff3799f266912dbd697ed6f..9b6ec68ef5a00bef51911d74e3e515df0c9eba46 100644 (file)
@@ -69,6 +69,40 @@ static void gtk_notebook_page_change_callback(GtkNotebook *WXUNUSED(widget),
   notebook->ProcessEvent(event);
 }
 
+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;
+  };
+  
+/*
+  printf( "OnResize from " );
+  if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
+    printf( win->GetClassInfo()->GetClassName() );
+  printf( " .\n" );
+    
+  printf( "  Old: X: %d  Y: %d ", win->m_x, win->m_y );
+  printf( "  W: %d  H: %d ", win->m_width, win->m_height );
+  printf( " .\n" );
+    
+  printf( "  New: X: %d  Y: %d ", alloc->x, alloc->y );
+  printf( "  W: %d  H: %d ", alloc->width, alloc->height );
+  printf( " .\n" );
+*/
+  
+  win->SetSize( alloc->x, alloc->y, alloc->width, alloc->height );
+  
+/*
+  printf( "  Res: X: %d  Y: %d ", win->m_x, win->m_y );
+  printf( "  W: %d  H: %d ", win->m_width, win->m_height );
+  printf( " .\n" );
+*/    
+};
+  
 //-----------------------------------------------------------------------------
 // wxNotebook
 //-----------------------------------------------------------------------------
@@ -370,7 +404,6 @@ void wxNotebook::AddChild( wxWindow *win )
 
   m_children.Append(win);
 
-
   wxNotebookPage *page = new wxNotebookPage();
 
   page->m_id = GetPageCount();
@@ -384,7 +417,10 @@ void wxNotebook::AddChild( wxWindow *win )
     (GtkNotebookPage*) (g_list_last(GTK_NOTEBOOK(m_widget)->children)->data);
 
   page->m_parent = GTK_NOTEBOOK(m_widget);
-
+  
+  gtk_signal_connect( GTK_OBJECT(win->m_widget), "size_allocate",
+    GTK_SIGNAL_FUNC(gtk_page_size_callback), (gpointer)win );
+  
   if (!page->m_page)
   {
      wxLogFatalError( "Notebook page creation error" );
@@ -404,12 +440,12 @@ void wxNotebook::OnSize(wxSizeEvent& event)
     // @@@@ the numbers I substract here are completely arbitrary, instead we
     // should somehow calculate the size of the page from the size of the
     // notebook
-    page->SetSize(event.GetSize().GetX() - 5,
+/*    page->SetSize(event.GetSize().GetX() - 5,
                                  event.GetSize().GetY() - 30);
 
     if ( page->GetAutoLayout() )
       page->Layout();
-
+*/
     node = node->Next();
   };
 }
index c9832cefa80f6e73a64dc64f13a96404d5e7bb05..74ab35d9c7a6a3af5f781417996d6f02ac3e21eb 100644 (file)
@@ -108,7 +108,9 @@ void gtk_window_draw_callback( GtkWidget *WXUNUSED(widget), GdkRectangle *rect,
 
 //-----------------------------------------------------------------------------
 // size 
-//      I don't any longer intercept GTK's internal resize events (except frames)
+//      I don't any longer intercept GTK's internal resize events, except 
+//      for frames and from within MDI and tabbed windows (client area
+//      size determined internally by GTK, not wxWin).
 
 /*
 void gtk_window_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxWindow *win )
@@ -730,6 +732,7 @@ wxWindow::wxWindow()
   m_drawingOffsetX = 0;
   m_drawingOffsetY = 0;
   m_pDropTarget = NULL;
+  m_resizing = FALSE;
 };
 
 wxWindow::wxWindow( wxWindow *parent, wxWindowID id,
@@ -913,6 +916,7 @@ void wxWindow::PreCreation( wxWindow *parent, wxWindowID id,
   m_drawingOffsetX = 0;
   m_drawingOffsetY = 0;
   m_pDropTarget = NULL;
+  m_resizing = FALSE;
 }
 
 void wxWindow::PostCreation(void)
@@ -1059,6 +1063,9 @@ void wxWindow::ImplementSetPosition(void)
 
 void wxWindow::SetSize( int x, int y, int width, int height, int sizeFlags )
 {
+  if (m_resizing) return; // I don't like recursions
+  m_resizing = TRUE;
+  
   int newX = x;
   int newY = y;
   int newW = width;
@@ -1099,6 +1106,8 @@ void wxWindow::SetSize( int x, int y, int width, int height, int sizeFlags )
   wxSizeEvent event( wxSize(m_width,m_height), GetId() );
   event.SetEventObject( this );
   ProcessEvent( event );
+  
+  m_resizing = FALSE;
 };
 
 void wxWindow::SetSize( int width, int height )
@@ -1113,8 +1122,8 @@ void wxWindow::Move( int x, int y )
 
 void wxWindow::GetSize( int *width, int *height ) const
 {
-  (*width) = m_width;
-  (*height) = m_height;
+  if (width) (*width) = m_width;
+  if (height) (*height) = m_height;
 };
 
 void wxWindow::SetClientSize( int width, int height )
@@ -1423,6 +1432,8 @@ void wxWindow::AddChild( wxWindow *child )
     };
   };
   
+  // wxNotebooks are very special, so they have their own AddChild
+  
   if (IsKindOf(CLASSINFO(wxNotebook)))
   {
     wxNotebook *tab = (wxNotebook*)this;
@@ -1828,7 +1839,7 @@ void wxWindow::SetScrollbar( int orient, int pos, int thumbVisible,
     m_vAdjust->page_increment = (float)(wxMax(fthumb-2,0));
     m_vAdjust->page_size = fthumb;
   };
+  
   if (m_wxwindow->window)
   {  
     if (orient == wxHORIZONTAL)
index 79630252e18ac2cc9e968c976f27db1857e2b0fa..3dcbf7050dba2b2d47da49ccd84b3bd523a98943 100644 (file)
@@ -222,7 +222,8 @@ wxFileCtrl::wxFileCtrl( wxWindow *win, const wxWindowID id, const wxString &dirN
       const long style, const wxString &name ) :
   wxListCtrl( win, id, pos, size, style, name )
 {
-  wxImageList *imageList = new wxImageList();
+  SetItemSpacing( 20 );
+  wxImageList *imageList = new wxImageList( 18, 18 );
   imageList->Add( wxBitmap( folder_xpm ) );
   imageList->Add( wxBitmap( txt_xpm ) );
   imageList->Add( wxBitmap( list_xpm ) );