-wxFileDialog::wxFileDialog(wxWindow *parent,
- const wxString& message,
- const wxString& defaultDir,
- const wxString& defaultFile,
- const wxString& wildCard,
- long style,
- const wxPoint& pos ) :
- wxDialog( parent, -1, message )
-{
- wxBeginBusyCursor();
-
- m_message = message;
- m_dialogStyle = style;
- m_dir = defaultDir;
- if (m_dir.IsEmpty()) m_dir = wxGetUserHome();
- m_path = defaultDir;
- m_path += _T("/");
- m_path += defaultFile;
- m_fileName = defaultFile;
- m_wildCard = wildCard;
- m_filterIndex = 0;
-
- wxBoxSizer *mainsizer = new wxBoxSizer( wxVERTICAL );
-
- wxBoxSizer *buttonsizer = new wxBoxSizer( wxHORIZONTAL );
-
- buttonsizer->Add( new wxButton( this, ID_LIST_MODE, "List" ), 0, wxALL, 5 );
- buttonsizer->Add( new wxButton( this, ID_REPORT_MODE, "Report" ), 0, wxALL, 5 );
- buttonsizer->Add( new wxButton( this, ID_ICON_MODE, "Icon" ), 0, wxALL, 5 );
- buttonsizer->Add( 30, 5 );
- buttonsizer->Add( new wxButton( this, ID_UP_DIR, "Up" ), 0, wxALL, 5 );
- buttonsizer->Add( new wxButton( this, ID_PARENT_DIR, "Home" ), 0, wxALL, 5 );
- buttonsizer->Add( new wxButton( this, -1, "New..." ), 0, wxALL, 5 );
- mainsizer->Add( buttonsizer, 0, wxALL | wxALIGN_RIGHT, 5 );
-
- m_list = new wxFileCtrl( this, ID_LIST_CTRL, "/", wxDefaultPosition, wxSize(200,180),
- wxLC_LIST | wxSUNKEN_BORDER | wxLC_SINGLE_SEL );
- mainsizer->Add( m_list, 1, wxEXPAND | wxALL, 10 );
-
- wxBoxSizer *textsizer = new wxBoxSizer( wxHORIZONTAL );
- m_text = new wxTextCtrl( this, -1, m_fileName );
- textsizer->Add( m_text, 1, wxCENTER|wxALL, 10 );
- textsizer->Add( new wxButton( this, wxID_OK, _("OK") ), 0, wxCENTER | wxLEFT|wxRIGHT|wxTOP, 10 );
- mainsizer->Add( textsizer, 0, wxEXPAND );
-
- wxBoxSizer *choicesizer = new wxBoxSizer( wxHORIZONTAL );
- m_choice = new wxChoice( this, -1 );
- m_choice->Append( "*.txt" );
- choicesizer->Add( m_choice, 1, wxCENTER|wxALL, 10 );
- choicesizer->Add( new wxButton( this, wxID_CANCEL, _("Cancel") ), 0, wxCENTER | wxALL, 10 );
- mainsizer->Add( choicesizer, 0, wxEXPAND );
-
- SetAutoLayout( TRUE );