add support for custom controls in file dialog in wxGTK and generic versions; also allow using generic dialogs in the sample with wxGTK2 (patch 1846837)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52252 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-03-02 14:33:47 +00:00
parent 77c950fdad
commit 8ce68f7fc0
13 changed files with 216 additions and 110 deletions

View File

@@ -131,6 +131,11 @@ static void gtk_filedialog_update_preview_callback(GtkFileChooser *chooser,
} // extern "C"
static void wxInsertChildInFileDialog(wxWindow* WXUNUSED(parent),
wxWindow* WXUNUSED(child))
{
}
//-----------------------------------------------------------------------------
// wxFileDialog
@@ -151,6 +156,7 @@ wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
const wxString& name)
: wxFileDialogBase()
{
m_insertCallback = wxInsertChildInFileDialog;
parent = GetParentForModalDialog(parent);
if (!wxFileDialogBase::Create(parent, message, defaultDir, defaultFileName,
@@ -276,6 +282,7 @@ wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
}
}
void wxFileDialog::OnFakeOk(wxCommandEvent& WXUNUSED(event))
{
EndDialog(wxID_OK);
@@ -283,12 +290,19 @@ void wxFileDialog::OnFakeOk(wxCommandEvent& WXUNUSED(event))
int wxFileDialog::ShowModal()
{
return wxDialog::ShowModal();
}
if (CreateExtraControl())
{
GtkWidget *control = m_extraControl->m_widget;
bool wxFileDialog::Show( bool show )
{
return wxDialog::Show( show );
// see wxNotebook::InsertPage() for explaination
// why gtk_widget_unparent() is not used here
control->parent = NULL;
gtk_widget_show(control);
gtk_file_chooser_set_extra_widget(GTK_FILE_CHOOSER(m_widget), control);
}
return wxDialog::ShowModal();
}
void wxFileDialog::DoSetSize(int WXUNUSED(x), int WXUNUSED(y),