]> git.saurik.com Git - wxWidgets.git/commitdiff
fix sizing of extra control
authorPaul Cornett <paulcor@bullseye.com>
Thu, 7 Aug 2008 06:51:10 +0000 (06:51 +0000)
committerPaul Cornett <paulcor@bullseye.com>
Thu, 7 Aug 2008 06:51:10 +0000 (06:51 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55004 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/gtk/filedlg.h
src/gtk/filedlg.cpp

index 38090b16e16ae7b198e5876f1ab4073bda9cc72c..f81d91ca69106ee34bc1637a52177c42f42dbaf1 100644 (file)
@@ -7,8 +7,8 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifndef __GTKFILEDLGH__
-#define __GTKFILEDLGH__
+#ifndef _WX_GTKFILEDLG_H_
+#define _WX_GTKFILEDLG_H_
 
 #include "wx/gtk/filectrl.h"    // for wxGtkFileChooser
 
@@ -60,11 +60,13 @@ protected:
 
 
 private:
-    DECLARE_DYNAMIC_CLASS(wxFileDialog)
-    DECLARE_EVENT_TABLE()
     void OnFakeOk( wxCommandEvent &event );
+    void OnSize(wxSizeEvent&);
 
     wxGtkFileChooser    m_fc;
+
+    DECLARE_DYNAMIC_CLASS(wxFileDialog)
+    DECLARE_EVENT_TABLE()
 };
 
-#endif // __GTKFILEDLGH__
+#endif // _WX_GTKFILEDLG_H_
index f7f6d51fb77739fe4a10cd91c5e5b3533c23eb6b..62fc00864ac85c74969cabff6f65cbe39b8b1af8 100644 (file)
@@ -145,6 +145,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxFileDialog,wxFileDialogBase)
 
 BEGIN_EVENT_TABLE(wxFileDialog,wxFileDialogBase)
     EVT_BUTTON(wxID_OK, wxFileDialog::OnFakeOk)
+    EVT_SIZE(wxFileDialog::OnSize)
 END_EVENT_TABLE()
 
 wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
@@ -294,9 +295,7 @@ int wxFileDialog::ShowModal()
     {
         GtkWidget *control = m_extraControl->m_widget;
 
-        // see wxNotebook::InsertPage() for explaination
-        // why gtk_widget_unparent() is not used here
-        control->parent = NULL;
+        wxASSERT(control->parent == NULL);
 
         gtk_widget_show(control);
         gtk_file_chooser_set_extra_widget(GTK_FILE_CHOOSER(m_widget), control);
@@ -311,6 +310,12 @@ void wxFileDialog::DoSetSize(int WXUNUSED(x), int WXUNUSED(y),
 {
 }
 
+void wxFileDialog::OnSize(wxSizeEvent&)
+{
+    // avoid calling DoLayout(), which will set the (wrong) size of
+    // m_extraControl, its size is managed by GtkFileChooser
+}
+
 wxString wxFileDialog::GetPath() const
 {
     return m_fc.GetPath();