1999-08-17 15:55:25 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2006-04-25 17:31:27 +00:00
|
|
|
// Name: wx/generic/filedlgg.h
|
2003-04-03 13:10:08 +00:00
|
|
|
// Purpose: wxGenericFileDialog
|
1999-08-17 15:55:25 +00:00
|
|
|
// Author: Robert Roebling
|
|
|
|
// Modified by:
|
|
|
|
// Created: 8/17/99
|
|
|
|
// Copyright: (c) Robert Roebling
|
|
|
|
// RCS-ID: $Id$
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
1999-08-17 15:55:25 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_FILEDLGG_H_
|
|
|
|
#define _WX_FILEDLGG_H_
|
|
|
|
|
2003-04-03 13:10:08 +00:00
|
|
|
#include "wx/listctrl.h"
|
2003-04-06 19:57:51 +00:00
|
|
|
#include "wx/datetime.h"
|
2005-09-26 00:21:03 +00:00
|
|
|
#include "wx/filefn.h"
|
2006-04-25 17:31:27 +00:00
|
|
|
#include "wx/filedlg.h"
|
2007-09-17 00:14:34 +00:00
|
|
|
#include "wx/generic/filectrlg.h"
|
1999-08-17 15:55:25 +00:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// classes
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2007-07-09 10:09:52 +00:00
|
|
|
class WXDLLIMPEXP_FWD_CORE wxBitmapButton;
|
2007-09-17 00:14:34 +00:00
|
|
|
class WXDLLIMPEXP_FWD_CORE wxGenericFileCtrl;
|
2007-07-09 10:09:52 +00:00
|
|
|
class WXDLLIMPEXP_FWD_CORE wxGenericFileDialog;
|
2007-09-17 00:14:34 +00:00
|
|
|
class WXDLLIMPEXP_FWD_CORE wxFileCtrlEvent;
|
1999-08-17 15:55:25 +00:00
|
|
|
|
|
|
|
//-------------------------------------------------------------------------
|
2003-06-14 13:31:49 +00:00
|
|
|
// wxGenericFileDialog
|
1999-08-17 15:55:25 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
2003-07-19 17:22:05 +00:00
|
|
|
class WXDLLEXPORT wxGenericFileDialog: public wxFileDialogBase
|
1999-08-17 15:55:25 +00:00
|
|
|
{
|
|
|
|
public:
|
2005-03-08 00:29:56 +00:00
|
|
|
wxGenericFileDialog() : wxFileDialogBase() { Init(); }
|
1999-08-17 15:55:25 +00:00
|
|
|
|
2003-04-03 13:10:08 +00:00
|
|
|
wxGenericFileDialog(wxWindow *parent,
|
2005-03-08 00:29:56 +00:00
|
|
|
const wxString& message = wxFileSelectorPromptStr,
|
2003-07-19 17:22:05 +00:00
|
|
|
const wxString& defaultDir = wxEmptyString,
|
|
|
|
const wxString& defaultFile = wxEmptyString,
|
2005-03-08 00:29:56 +00:00
|
|
|
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
|
2006-05-28 23:32:12 +00:00
|
|
|
long style = wxFD_DEFAULT_STYLE,
|
2005-03-08 00:29:56 +00:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
2006-05-28 23:32:12 +00:00
|
|
|
const wxSize& sz = wxDefaultSize,
|
|
|
|
const wxString& name = wxFileDialogNameStr,
|
2005-03-08 00:29:56 +00:00
|
|
|
bool bypassGenericImpl = false );
|
|
|
|
|
2004-12-05 20:30:18 +00:00
|
|
|
bool Create( wxWindow *parent,
|
|
|
|
const wxString& message = wxFileSelectorPromptStr,
|
2005-03-08 00:29:56 +00:00
|
|
|
const wxString& defaultDir = wxEmptyString,
|
|
|
|
const wxString& defaultFile = wxEmptyString,
|
2004-12-05 20:30:18 +00:00
|
|
|
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
|
2006-05-28 23:32:12 +00:00
|
|
|
long style = wxFD_DEFAULT_STYLE,
|
2005-03-08 00:29:56 +00:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
2006-05-28 23:32:12 +00:00
|
|
|
const wxSize& sz = wxDefaultSize,
|
|
|
|
const wxString& name = wxFileDialogNameStr,
|
2005-03-08 00:29:56 +00:00
|
|
|
bool bypassGenericImpl = false );
|
|
|
|
|
2003-04-03 13:10:08 +00:00
|
|
|
virtual ~wxGenericFileDialog();
|
1999-08-17 15:55:25 +00:00
|
|
|
|
2003-07-19 17:22:05 +00:00
|
|
|
virtual void SetMessage(const wxString& message) { SetTitle(message); }
|
2007-10-05 23:54:40 +00:00
|
|
|
virtual void SetPath(const wxString& path)
|
|
|
|
{ m_filectrl->SetPath(path); }
|
|
|
|
virtual void SetFilterIndex(int filterIndex)
|
|
|
|
{ m_filectrl->SetFilterIndex(filterIndex); }
|
|
|
|
virtual void SetWildcard(const wxString& wildCard)
|
|
|
|
{ m_filectrl->SetWildcard(wildCard); }
|
|
|
|
|
|
|
|
virtual wxString GetPath() const
|
|
|
|
{ return m_filectrl->GetPath(); }
|
|
|
|
virtual void GetPaths(wxArrayString& paths) const
|
|
|
|
{ return m_filectrl->GetPaths(paths); }
|
|
|
|
virtual wxString GetDirectory() const
|
|
|
|
{ return m_filectrl->GetDirectory(); }
|
|
|
|
virtual wxString GetFilename() const
|
|
|
|
{ return m_filectrl->GetFilename(); }
|
|
|
|
virtual void GetFilenames(wxArrayString& files) const
|
|
|
|
{ return m_filectrl->GetFilenames(files); }
|
|
|
|
virtual wxString GetWildcard() const
|
|
|
|
{ return m_filectrl->GetWildcard(); }
|
|
|
|
virtual int GetFilterIndex() const
|
|
|
|
{ return m_filectrl->GetFilterIndex(); }
|
1999-09-18 16:39:08 +00:00
|
|
|
|
2002-09-07 19:24:45 +00:00
|
|
|
// implementation only from now on
|
|
|
|
// -------------------------------
|
|
|
|
|
|
|
|
virtual int ShowModal();
|
2004-03-01 22:54:20 +00:00
|
|
|
virtual bool Show( bool show = true );
|
2002-09-07 19:24:45 +00:00
|
|
|
|
1999-08-17 15:55:25 +00:00
|
|
|
void OnList( wxCommandEvent &event );
|
|
|
|
void OnReport( wxCommandEvent &event );
|
|
|
|
void OnUp( wxCommandEvent &event );
|
|
|
|
void OnHome( wxCommandEvent &event );
|
2007-09-17 00:14:34 +00:00
|
|
|
void OnOk( wxCommandEvent &event );
|
1999-08-18 11:40:40 +00:00
|
|
|
void OnNew( wxCommandEvent &event );
|
2007-09-17 00:14:34 +00:00
|
|
|
void OnFileActivated( wxFileCtrlEvent &event);
|
2003-04-06 19:57:51 +00:00
|
|
|
|
2004-12-05 20:30:18 +00:00
|
|
|
private:
|
2007-09-19 12:24:05 +00:00
|
|
|
// if true, don't use this implementation at all
|
2004-12-05 20:30:18 +00:00
|
|
|
bool m_bypassGenericImpl;
|
1999-09-18 16:39:08 +00:00
|
|
|
|
|
|
|
protected:
|
2007-09-19 12:24:05 +00:00
|
|
|
// update the state of m_upDirButton and m_newDirButton depending on the
|
|
|
|
// currently selected directory
|
|
|
|
void OnUpdateButtonsUI(wxUpdateUIEvent& event);
|
2002-12-04 14:11:26 +00:00
|
|
|
|
2007-09-17 00:14:34 +00:00
|
|
|
wxString m_filterExtension;
|
|
|
|
wxGenericFileCtrl *m_filectrl;
|
|
|
|
wxBitmapButton *m_upDirButton;
|
|
|
|
wxBitmapButton *m_newDirButton;
|
1999-09-18 16:39:08 +00:00
|
|
|
|
1999-08-17 15:55:25 +00:00
|
|
|
private:
|
2005-03-08 00:29:56 +00:00
|
|
|
void Init();
|
2007-09-19 12:24:05 +00:00
|
|
|
|
2003-04-03 13:10:08 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxGenericFileDialog)
|
1999-08-17 15:55:25 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
2000-01-16 00:31:41 +00:00
|
|
|
|
2003-04-03 13:10:08 +00:00
|
|
|
// these variables are preserved between wxGenericFileDialog calls
|
2002-09-07 19:24:45 +00:00
|
|
|
static long ms_lastViewStyle; // list or report?
|
|
|
|
static bool ms_lastShowHidden; // did we show hidden files?
|
1999-08-17 15:55:25 +00:00
|
|
|
};
|
|
|
|
|
2007-07-28 00:08:01 +00:00
|
|
|
#ifdef wxHAS_GENERIC_FILEDIALOG
|
2003-04-03 13:10:08 +00:00
|
|
|
|
|
|
|
class WXDLLEXPORT wxFileDialog: public wxGenericFileDialog
|
|
|
|
{
|
|
|
|
public:
|
2004-01-15 13:49:22 +00:00
|
|
|
wxFileDialog() {}
|
2003-04-03 13:10:08 +00:00
|
|
|
|
|
|
|
wxFileDialog(wxWindow *parent,
|
|
|
|
const wxString& message = wxFileSelectorPromptStr,
|
2004-06-17 16:22:36 +00:00
|
|
|
const wxString& defaultDir = wxEmptyString,
|
|
|
|
const wxString& defaultFile = wxEmptyString,
|
2003-04-03 13:10:08 +00:00
|
|
|
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
|
|
|
|
long style = 0,
|
2004-01-15 13:49:22 +00:00
|
|
|
const wxPoint& pos = wxDefaultPosition)
|
|
|
|
:wxGenericFileDialog(parent, message, defaultDir, defaultFile, wildCard, style, pos)
|
|
|
|
{
|
|
|
|
}
|
2005-02-08 12:37:49 +00:00
|
|
|
|
2004-12-05 20:30:18 +00:00
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxFileDialog)
|
2003-04-03 13:10:08 +00:00
|
|
|
};
|
|
|
|
|
2007-07-28 00:08:01 +00:00
|
|
|
#endif // wxHAS_GENERIC_FILEDIALOG
|
1999-08-17 15:55:25 +00:00
|
|
|
|
2003-06-14 13:31:49 +00:00
|
|
|
#endif // _WX_FILEDLGG_H_
|