-// wxGenericDirDialog implementation
-// This should be moved into dirdlgg.cpp eventually
-
-BEGIN_EVENT_TABLE(wxGenericDirDialog, wxDialog)
- EVT_BUTTON(wxID_OK, wxGenericDirDialog::OnOK)
- EVT_CLOSE(wxGenericDirDialog::OnCloseWindow)
-END_EVENT_TABLE()
-
-wxGenericDirDialog::wxGenericDirDialog(wxWindow* parent, const wxString& title,
- const wxString& defaultPath, long style, const wxPoint& pos, const wxSize& sz, const wxString& name):
- wxDialog(parent, ID_DIRCTRL, title, pos, sz, style, name)
-{
- wxBusyCursor cursor;
-
- wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );
-
- // 1) dir ctrl
- m_dirCtrl = new wxGenericDirCtrl(this, ID_DIRCTRL,
- defaultPath, wxPoint(5, 5),
- wxSize(300, 200), wxDIRCTRL_DIR_ONLY|wxSUNKEN_BORDER);
-
- topsizer->Add( m_dirCtrl, 1, wxTOP|wxLEFT|wxRIGHT | wxEXPAND, 10 );
-
- // 2) TODO: text control for entering path?
-
-#if wxUSE_STATLINE
- // 3) Static line
- topsizer->Add( new wxStaticLine( this, -1 ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 );
-#endif
-
- // 4) Buttons
- wxSizer* buttonsizer = new wxBoxSizer( wxHORIZONTAL );
- wxButton* okButton = new wxButton(this, wxID_OK, _("OK"));
- buttonsizer->Add( okButton, 0, wxLEFT|wxRIGHT, 10 );
- wxButton* cancelButton = new wxButton(this, wxID_CANCEL, _("Cancel"));
- buttonsizer->Add( cancelButton, 0, wxLEFT|wxRIGHT, 10 );
-
-/* TODO: new directory button
- wxButton* newButton = new wxButton( this, ID_NEW, _("New...") );
- buttonsizer->Add( newButton, 0, wxLEFT|wxRIGHT, 10 );
-*/
- topsizer->Add( buttonsizer, 0, wxALL | wxCENTER, 10 );
-
- okButton->SetDefault();
- m_dirCtrl->SetFocus();
-
- SetAutoLayout( TRUE );
- SetSizer( topsizer );
-
- topsizer->SetSizeHints( this );
- topsizer->Fit( this );
-
- Centre( wxBOTH );
-}
-
-void wxGenericDirDialog::OnCloseWindow(wxCloseEvent& event)
-{
- EndModal(wxID_CANCEL);
-}
-
-void wxGenericDirDialog::OnOK(wxCommandEvent& event)
-{
- EndModal(wxID_OK);
-}
-
-void wxGenericDirDialog::SetPath(const wxString& path)
-{
- m_dirCtrl->SetPath(path);
-}
-
-wxString wxGenericDirDialog::GetPath(void) const
-{
- return m_dirCtrl->GetPath();
-}