2005-05-04 14:57:50 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/dirdlg.h
|
|
|
|
// Purpose: wxDirDialog base class
|
|
|
|
// Author: Robert Roebling
|
|
|
|
// Modified by:
|
|
|
|
// Created:
|
|
|
|
// Copyright: (c) Robert Roebling
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Licence: wxWindows Licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-14 20:23:28 -04:00
|
|
|
#ifndef _WX_DIRDLG_H_BASE_
|
|
|
|
#define _WX_DIRDLG_H_BASE_
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2001-06-26 16:59:19 -04:00
|
|
|
#if wxUSE_DIRDLG
|
|
|
|
|
2002-05-04 09:17:36 -04:00
|
|
|
#include "wx/dialog.h"
|
|
|
|
|
1999-09-05 11:14:50 -04:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// constants
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2006-01-16 09:59:55 -05:00
|
|
|
extern WXDLLEXPORT_DATA(const wxChar) wxDirDialogNameStr[];
|
|
|
|
extern WXDLLEXPORT_DATA(const wxChar) wxDirDialogDefaultFolderStr[];
|
|
|
|
extern WXDLLEXPORT_DATA(const wxChar) wxDirSelectorPromptStr[];
|
|
|
|
|
2006-05-28 19:32:12 -04:00
|
|
|
#define wxDD_CHANGE_DIR 0x0100
|
2006-05-28 19:34:47 -04: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 11:14:50 -04:00
|
|
|
|
2005-04-02 16:40:59 -05:00
|
|
|
#ifdef __WXWINCE__
|
2006-05-28 19:32:12 -04:00
|
|
|
#define wxDD_DEFAULT_STYLE wxDEFAULT_DIALOG_STYLE
|
2005-04-02 16:40:59 -05:00
|
|
|
#else
|
2006-05-28 19:32:12 -04:00
|
|
|
#define wxDD_DEFAULT_STYLE (wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
|
2005-04-02 16:40:59 -05:00
|
|
|
#endif
|
2002-05-04 08:38:51 -04:00
|
|
|
|
2006-04-30 05:44:29 -04:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
// wxDirDialogBase
|
|
|
|
//-------------------------------------------------------------------------
|
2002-05-04 08:38:51 -04:00
|
|
|
|
|
|
|
class WXDLLEXPORT wxDirDialogBase : public wxDialog
|
|
|
|
{
|
|
|
|
public:
|
2006-05-06 16:10:11 -04:00
|
|
|
wxDirDialogBase() {}
|
2002-05-04 08:38:51 -04:00
|
|
|
wxDirDialogBase(wxWindow *parent,
|
2006-04-30 05:44:29 -04:00
|
|
|
const wxString& title = wxDirSelectorPromptStr,
|
2002-05-04 08:38:51 -04:00
|
|
|
const wxString& defaultPath = wxEmptyString,
|
|
|
|
long style = wxDD_DEFAULT_STYLE,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& sz = wxDefaultSize,
|
2006-04-30 05:44:29 -04:00
|
|
|
const wxString& name = wxDirDialogNameStr)
|
2006-05-06 16:10:11 -04:00
|
|
|
{
|
|
|
|
Create(parent, title, defaultPath, style, pos, sz, name);
|
|
|
|
}
|
2002-05-04 08:38:51 -04:00
|
|
|
|
2006-04-30 05:44:29 -04:00
|
|
|
virtual ~wxDirDialogBase() {}
|
2002-05-04 08:38:51 -04:00
|
|
|
|
2006-05-06 16:10:11 -04: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 05:44:29 -04: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 08:38:51 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2004-09-13 13:53:47 -04:00
|
|
|
// Universal and non-port related switches with need for generic implementation
|
2006-05-05 08:23:38 -04:00
|
|
|
#if defined(__WXUNIVERSAL__)
|
|
|
|
#include "wx/generic/dirdlgg.h"
|
|
|
|
#define wxDirDialog wxGenericDirDialog
|
|
|
|
#elif defined(__WXMSW__) && (defined(__SALFORDC__) || \
|
|
|
|
!wxUSE_OLE || \
|
|
|
|
(defined (__GNUWIN32__) && !wxUSE_NORLANDER_HEADERS))
|
2001-11-19 18:53:21 -05:00
|
|
|
#include "wx/generic/dirdlgg.h"
|
2004-09-13 13:53:47 -04:00
|
|
|
#define wxDirDialog wxGenericDirDialog
|
2004-12-05 13:56:29 -05:00
|
|
|
#elif defined(__WXMSW__) && defined(__WXWINCE__) && !defined(__HANDHELDPC__)
|
2006-05-28 19:32:12 -04:00
|
|
|
#include "wx/generic/dirdlgg.h" // MS PocketPC or MS Smartphone
|
2004-09-29 04:03:26 -04:00
|
|
|
#define wxDirDialog wxGenericDirDialog
|
2004-09-13 13:53:47 -04:00
|
|
|
#elif defined(__WXMSW__)
|
2006-05-28 19:32:12 -04:00
|
|
|
#include "wx/msw/dirdlg.h" // Native MSW
|
|
|
|
#elif defined(__WXGTK24__)
|
|
|
|
#include "wx/gtk/dirdlg.h" // Native GTK for gtk2.4
|
2006-04-30 05:44:29 -04:00
|
|
|
#elif defined(__WXGTK__)
|
2006-05-04 08:02:10 -04:00
|
|
|
#include "wx/generic/dirdlgg.h"
|
|
|
|
#define wxDirDialog wxGenericDirDialog
|
1998-08-14 20:23:28 -04:00
|
|
|
#elif defined(__WXMAC__)
|
2006-05-28 19:32:12 -04:00
|
|
|
#include "wx/mac/dirdlg.h" // Native Mac
|
2006-03-12 10:30:52 -05:00
|
|
|
#elif defined(__WXCOCOA__)
|
2006-05-28 19:32:12 -04:00
|
|
|
#include "wx/cocoa/dirdlg.h" // Native Cocoa
|
2004-09-13 13:53:47 -04:00
|
|
|
#elif defined(__WXMOTIF__) || \
|
|
|
|
defined(__WXX11__) || \
|
|
|
|
defined(__WXMGL__) || \
|
|
|
|
defined(__WXCOCOA__) || \
|
|
|
|
defined(__WXPM__)
|
2006-05-28 19:32:12 -04:00
|
|
|
#include "wx/generic/dirdlgg.h" // Other ports use generic implementation
|
2002-05-04 08:38:51 -04:00
|
|
|
#define wxDirDialog wxGenericDirDialog
|
|
|
|
#endif
|
|
|
|
|
2001-10-30 11:58:42 -05:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// common ::wxDirSelector() function
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
WXDLLEXPORT wxString
|
|
|
|
wxDirSelector(const wxString& message = wxDirSelectorPromptStr,
|
|
|
|
const wxString& defaultPath = wxEmptyString,
|
2002-05-04 08:38:51 -04:00
|
|
|
long style = wxDD_DEFAULT_STYLE,
|
2001-10-30 11:58:42 -05:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
wxWindow *parent = NULL);
|
|
|
|
|
2001-06-26 16:59:19 -04:00
|
|
|
#endif // wxUSE_DIRDLG
|
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
#endif
|
1998-08-14 20:23:28 -04:00
|
|
|
// _WX_DIRDLG_H_BASE_
|