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
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// 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
|
|
|
|
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
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2006-01-16 14:59:55 +00:00
|
|
|
extern WXDLLEXPORT_DATA(const wxChar) wxDirDialogNameStr[];
|
|
|
|
extern WXDLLEXPORT_DATA(const wxChar) wxDirDialogDefaultFolderStr[];
|
|
|
|
extern WXDLLEXPORT_DATA(const wxChar) wxDirSelectorPromptStr[];
|
|
|
|
|
1999-09-05 15:14:50 +00:00
|
|
|
|
2005-04-02 21:40:59 +00:00
|
|
|
#ifdef __WXWINCE__
|
|
|
|
#define wxDD_DEFAULT_STYLE \
|
|
|
|
(wxDEFAULT_DIALOG_STYLE | wxDD_NEW_DIR_BUTTON)
|
|
|
|
#else
|
|
|
|
#define wxDD_DEFAULT_STYLE \
|
|
|
|
(wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxDD_NEW_DIR_BUTTON)
|
|
|
|
#endif
|
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
|
|
|
|
|
|
|
class WXDLLEXPORT wxDirDialogBase : public wxDialog
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
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-04-30 12:32:29 +00:00
|
|
|
: wxDialog(parent, wxID_ANY, title, pos, sz, style, name)
|
|
|
|
, m_path(defaultPath)
|
|
|
|
{}
|
2006-04-30 09:44:29 +00:00
|
|
|
wxDirDialogBase() {}
|
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-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 void SetStyle(long style) { SetWindowStyle(style); }
|
|
|
|
|
|
|
|
virtual wxString GetMessage() const { return m_message; }
|
|
|
|
virtual wxString GetPath() const { return m_path; }
|
|
|
|
virtual long GetStyle() const { return GetWindowStyle(); }
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
#elif defined(__WXMSW__) && (defined(__SALFORDC__) || \
|
|
|
|
!wxUSE_OLE || \
|
|
|
|
(defined (__GNUWIN32__) && !wxUSE_NORLANDER_HEADERS))
|
2004-09-13 17:53:47 +00:00
|
|
|
|
2001-11-19 23:53:21 +00:00
|
|
|
#include "wx/generic/dirdlgg.h"
|
2004-09-13 17:53:47 +00:00
|
|
|
#define wxDirDialog wxGenericDirDialog
|
2004-09-29 08:03:26 +00:00
|
|
|
|
2004-12-05 18:56:29 +00:00
|
|
|
// MS PocketPC or MS Smartphone
|
|
|
|
#elif defined(__WXMSW__) && defined(__WXWINCE__) && !defined(__HANDHELDPC__)
|
2004-09-29 08:03:26 +00:00
|
|
|
|
|
|
|
#include "wx/generic/dirdlgg.h"
|
|
|
|
#define wxDirDialog wxGenericDirDialog
|
2004-09-13 17:53:47 +00:00
|
|
|
|
|
|
|
// Native MSW
|
|
|
|
#elif defined(__WXMSW__)
|
|
|
|
|
|
|
|
#include "wx/msw/dirdlg.h"
|
|
|
|
|
2006-05-04 12:02:10 +00:00
|
|
|
// Native GTK for gtk2.x and generic for gtk1.x
|
2006-04-30 09:44:29 +00:00
|
|
|
#elif defined(__WXGTK__)
|
|
|
|
|
2006-05-04 12:02:10 +00:00
|
|
|
#if defined( __WXGTK20__ )
|
2006-04-30 09:44:29 +00:00
|
|
|
#include "wx/gtk/dirdlg.h"
|
|
|
|
#define wxDirDialog wxDirDialogGTK
|
2006-05-04 12:02:10 +00:00
|
|
|
#else
|
|
|
|
#include "wx/generic/dirdlgg.h"
|
|
|
|
#define wxDirDialog wxGenericDirDialog
|
|
|
|
#endif
|
2006-04-30 09:44:29 +00:00
|
|
|
|
2004-09-13 17:53:47 +00:00
|
|
|
// Native Mac
|
1998-08-15 00:23:28 +00:00
|
|
|
#elif defined(__WXMAC__)
|
2004-09-13 17:53:47 +00:00
|
|
|
|
2001-10-30 16:58:42 +00:00
|
|
|
#include "wx/mac/dirdlg.h"
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2006-03-12 15:30:52 +00:00
|
|
|
// Native Cocoa
|
|
|
|
#elif defined(__WXCOCOA__)
|
|
|
|
|
|
|
|
#include "wx/cocoa/dirdlg.h"
|
|
|
|
|
2004-09-13 17:53:47 +00:00
|
|
|
// Other ports use generic implementation
|
|
|
|
#elif defined(__WXMOTIF__) || \
|
|
|
|
defined(__WXX11__) || \
|
|
|
|
defined(__WXMGL__) || \
|
|
|
|
defined(__WXCOCOA__) || \
|
|
|
|
defined(__WXPM__)
|
|
|
|
|
|
|
|
#include "wx/generic/dirdlgg.h"
|
2002-05-04 12:38:51 +00:00
|
|
|
#define wxDirDialog wxGenericDirDialog
|
2004-09-13 17:53:47 +00:00
|
|
|
|
2002-05-04 12:38:51 +00:00
|
|
|
#endif
|
|
|
|
|
2001-10-30 16:58:42 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// common ::wxDirSelector() function
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
WXDLLEXPORT wxString
|
|
|
|
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_
|