2005-05-04 18:57:50 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/dirdlg.h
|
|
|
|
// Purpose: wxDirDialog base class
|
|
|
|
// Author: Robert Roebling
|
|
|
|
// Modified by:
|
|
|
|
// Created:
|
|
|
|
// Copyright: (c) Robert Roebling
|
|
|
|
// Licence: wxWindows Licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-15 00:23:28 +00:00
|
|
|
#ifndef _WX_DIRDLG_H_BASE_
|
|
|
|
#define _WX_DIRDLG_H_BASE_
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2016-01-05 00:29:19 +00:00
|
|
|
#include "wx/defs.h"
|
|
|
|
|
2001-06-26 20:59:19 +00:00
|
|
|
#if wxUSE_DIRDLG
|
|
|
|
|
2002-05-04 13:17:36 +00:00
|
|
|
#include "wx/dialog.h"
|
|
|
|
|
1999-09-05 15:14:50 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// constants
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2008-03-26 15:06:00 +00:00
|
|
|
extern WXDLLIMPEXP_DATA_CORE(const char) wxDirDialogNameStr[];
|
|
|
|
extern WXDLLIMPEXP_DATA_CORE(const char) wxDirDialogDefaultFolderStr[];
|
|
|
|
extern WXDLLIMPEXP_DATA_CORE(const char) wxDirSelectorPromptStr[];
|
2006-01-16 14:59:55 +00:00
|
|
|
|
2006-05-28 23:32:12 +00:00
|
|
|
#define wxDD_CHANGE_DIR 0x0100
|
2006-05-28 23:34:47 +00:00
|
|
|
#define wxDD_DIR_MUST_EXIST 0x0200
|
|
|
|
|
|
|
|
// deprecated, on by default now, use wxDD_DIR_MUST_EXIST to disable it
|
|
|
|
#define wxDD_NEW_DIR_BUTTON 0
|
1999-09-05 15:14:50 +00:00
|
|
|
|
2015-08-27 15:48:54 +00:00
|
|
|
#define wxDD_DEFAULT_STYLE (wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
|
2002-05-04 12:38:51 +00:00
|
|
|
|
2006-04-30 09:44:29 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
// wxDirDialogBase
|
|
|
|
//-------------------------------------------------------------------------
|
2002-05-04 12:38:51 +00:00
|
|
|
|
2008-03-26 15:06:00 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxDirDialogBase : public wxDialog
|
2002-05-04 12:38:51 +00:00
|
|
|
{
|
|
|
|
public:
|
2006-05-06 20:10:11 +00:00
|
|
|
wxDirDialogBase() {}
|
2002-05-04 12:38:51 +00:00
|
|
|
wxDirDialogBase(wxWindow *parent,
|
2006-04-30 09:44:29 +00:00
|
|
|
const wxString& title = wxDirSelectorPromptStr,
|
2002-05-04 12:38:51 +00:00
|
|
|
const wxString& defaultPath = wxEmptyString,
|
|
|
|
long style = wxDD_DEFAULT_STYLE,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& sz = wxDefaultSize,
|
2006-04-30 09:44:29 +00:00
|
|
|
const wxString& name = wxDirDialogNameStr)
|
2006-05-06 20:10:11 +00:00
|
|
|
{
|
|
|
|
Create(parent, title, defaultPath, style, pos, sz, name);
|
|
|
|
}
|
2002-05-04 12:38:51 +00:00
|
|
|
|
2006-04-30 09:44:29 +00:00
|
|
|
virtual ~wxDirDialogBase() {}
|
2002-05-04 12:38:51 +00:00
|
|
|
|
2006-05-06 20:10:11 +00:00
|
|
|
|
|
|
|
bool Create(wxWindow *parent,
|
|
|
|
const wxString& title = wxDirSelectorPromptStr,
|
|
|
|
const wxString& defaultPath = wxEmptyString,
|
|
|
|
long style = wxDD_DEFAULT_STYLE,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& sz = wxDefaultSize,
|
|
|
|
const wxString& name = wxDirDialogNameStr)
|
|
|
|
{
|
|
|
|
if (!wxDialog::Create(parent, wxID_ANY, title, pos, sz, style, name))
|
|
|
|
return false;
|
|
|
|
m_path = defaultPath;
|
|
|
|
m_message = title;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2006-04-30 09:44:29 +00:00
|
|
|
virtual void SetMessage(const wxString& message) { m_message = message; }
|
|
|
|
virtual void SetPath(const wxString& path) { m_path = path; }
|
|
|
|
|
|
|
|
virtual wxString GetMessage() const { return m_message; }
|
|
|
|
virtual wxString GetPath() const { return m_path; }
|
|
|
|
|
|
|
|
protected:
|
|
|
|
wxString m_message;
|
|
|
|
wxString m_path;
|
2002-05-04 12:38:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2004-09-13 17:53:47 +00:00
|
|
|
// Universal and non-port related switches with need for generic implementation
|
2006-05-05 12:23:38 +00:00
|
|
|
#if defined(__WXUNIVERSAL__)
|
|
|
|
#include "wx/generic/dirdlgg.h"
|
|
|
|
#define wxDirDialog wxGenericDirDialog
|
2014-05-16 13:01:35 +00:00
|
|
|
#elif defined(__WXMSW__) && !wxUSE_OLE
|
2001-11-19 23:53:21 +00:00
|
|
|
#include "wx/generic/dirdlgg.h"
|
2004-09-13 17:53:47 +00:00
|
|
|
#define wxDirDialog wxGenericDirDialog
|
|
|
|
#elif defined(__WXMSW__)
|
2006-05-28 23:32:12 +00:00
|
|
|
#include "wx/msw/dirdlg.h" // Native MSW
|
2007-11-05 22:31:24 +00:00
|
|
|
#elif defined(__WXGTK20__)
|
2006-05-28 23:32:12 +00:00
|
|
|
#include "wx/gtk/dirdlg.h" // Native GTK for gtk2.4
|
2006-04-30 09:44:29 +00:00
|
|
|
#elif defined(__WXGTK__)
|
2006-05-04 12:02:10 +00:00
|
|
|
#include "wx/generic/dirdlgg.h"
|
|
|
|
#define wxDirDialog wxGenericDirDialog
|
1998-08-15 00:23:28 +00:00
|
|
|
#elif defined(__WXMAC__)
|
2008-06-11 19:17:41 +00:00
|
|
|
#include "wx/osx/dirdlg.h" // Native Mac
|
2004-09-13 17:53:47 +00:00
|
|
|
#elif defined(__WXMOTIF__) || \
|
2014-07-03 22:03:21 +00:00
|
|
|
defined(__WXX11__)
|
2006-05-28 23:32:12 +00:00
|
|
|
#include "wx/generic/dirdlgg.h" // Other ports use generic implementation
|
2002-05-04 12:38:51 +00:00
|
|
|
#define wxDirDialog wxGenericDirDialog
|
2014-08-24 01:50:11 +00:00
|
|
|
#elif defined(__WXQT__)
|
|
|
|
#include "wx/qt/dirdlg.h"
|
2002-05-04 12:38:51 +00:00
|
|
|
#endif
|
|
|
|
|
2001-10-30 16:58:42 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// common ::wxDirSelector() function
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2008-03-26 15:06:00 +00:00
|
|
|
WXDLLIMPEXP_CORE wxString
|
2001-10-30 16:58:42 +00:00
|
|
|
wxDirSelector(const wxString& message = wxDirSelectorPromptStr,
|
|
|
|
const wxString& defaultPath = wxEmptyString,
|
2002-05-04 12:38:51 +00:00
|
|
|
long style = wxDD_DEFAULT_STYLE,
|
2001-10-30 16:58:42 +00:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
wxWindow *parent = NULL);
|
|
|
|
|
2001-06-26 20:59:19 +00:00
|
|
|
#endif // wxUSE_DIRDLG
|
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
#endif
|
1998-08-15 00:23:28 +00:00
|
|
|
// _WX_DIRDLG_H_BASE_
|