wxDirDialog now has the same ctor under all platforms and also uses the

correct default title string


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15367 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2002-05-04 12:38:51 +00:00
parent 3f0fb1d416
commit e78d4a23c2
8 changed files with 81 additions and 49 deletions

View File

@@ -9,8 +9,38 @@
WXDLLEXPORT_DATA(extern const wxChar*) wxDirDialogNameStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxDirDialogDefaultFolderStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxDirSelectorPromptStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxEmptyString;
#define wxDD_DEFAULT_STYLE \
(wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxDD_NEW_DIR_BUTTON)
/*
The interface (TODO: make the other classes really derive from it!) is
something like this:
class WXDLLEXPORT wxDirDialogBase : public wxDialog
{
public:
wxDirDialogBase(wxWindow *parent,
const wxString& title = wxFileSelectorPromptStr,
const wxString& defaultPath = wxEmptyString,
long style = wxDD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
const wxSize& sz = wxDefaultSize,
const wxString& name = _T("dirdialog"));
void SetMessage(const wxString& message);
void SetPath(const wxString& path);
void SetStyle(long style);
wxString GetMessage() const;
wxString GetPath() const;
long GetStyle() const;
};
*/
#if defined(__WXMSW__)
#if defined(__WIN16__) || (defined(__GNUWIN32__) && !wxUSE_NORLANDER_HEADERS) || defined(__SALFORDC__) || !wxUSE_OLE
#include "wx/generic/dirdlgg.h"
@@ -32,16 +62,18 @@ WXDLLEXPORT_DATA(extern const wxChar*) wxEmptyString;
#include "wx/generic/dirdlgg.h"
#endif
#if !defined(__WXMSW__) && !defined(__WXMAC__)
#define wxDirDialog wxGenericDirDialog
#endif
// ----------------------------------------------------------------------------
// common ::wxDirSelector() function
// ----------------------------------------------------------------------------
WXDLLEXPORT_DATA(extern const wxChar*) wxDirSelectorPromptStr;
WXDLLEXPORT wxString
wxDirSelector(const wxString& message = wxDirSelectorPromptStr,
const wxString& defaultPath = wxEmptyString,
long style = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxDD_NEW_DIR_BUTTON,
long style = wxDD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
wxWindow *parent = NULL);

View File

@@ -19,11 +19,6 @@
#pragma interface "dirdlgg.h"
#endif
#include "wx/defs.h"
#if wxUSE_DIRDLG
#include "wx/dialog.h"
class WXDLLEXPORT wxGenericDirCtrl;
class WXDLLEXPORT wxTextCtrl;
class WXDLLEXPORT wxTreeEvent;
@@ -35,13 +30,15 @@ class WXDLLEXPORT wxTreeEvent;
class WXDLLEXPORT wxGenericDirDialog: public wxDialog
{
public:
wxGenericDirDialog(): wxDialog() {}
wxGenericDirDialog(wxWindow* parent, const wxString& title,
wxGenericDirDialog() : wxDialog() { }
wxGenericDirDialog(wxWindow* parent,
const wxString& title = wxDirSelectorPromptStr,
const wxString& defaultPath = wxEmptyString,
long style = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxDD_NEW_DIR_BUTTON,
long style = wxDD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
const wxSize& sz = wxSize(450, 550),
const wxString& name = _T("dialog"));
const wxString& name = wxDirDialogNameStr);
//// Accessors
inline void SetMessage(const wxString& message) { m_message = message; }
@@ -76,10 +73,4 @@ protected:
DECLARE_EVENT_TABLE()
};
#if !defined(__WXMSW__) && !defined(__WXMAC__)
#define wxDirDialog wxGenericDirDialog
#endif
#endif // wxUSE_DIRDLG
#endif // _WX_DIRDLGG_H_

View File

@@ -16,33 +16,34 @@
#pragma interface "dirdlg.h"
#endif
#include "wx/dialog.h"
WXDLLEXPORT_DATA(extern const char*) wxFileSelectorPromptStr;
class WXDLLEXPORT wxDirDialog: public wxDialog
class WXDLLEXPORT wxDirDialog : public wxDialog
{
DECLARE_DYNAMIC_CLASS(wxDirDialog)
public:
wxDirDialog(wxWindow *parent, const wxString& message = wxFileSelectorPromptStr,
const wxString& defaultPath = "",
long style = 0, const wxPoint& pos = wxDefaultPosition);
wxDirDialog(wxWindow *parent,
const wxString& message = wxDirSelectorPromptStr,
const wxString& defaultPath = _T(""),
long style = 0,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
const wxString& name = wxDirDialogNameStr);
inline void SetMessage(const wxString& message) { m_message = message; }
inline void SetPath(const wxString& path) { m_path = path; }
inline void SetStyle(long style) { m_dialogStyle = style; }
void SetMessage(const wxString& message) { m_message = message; }
void SetPath(const wxString& path) { m_path = path; }
void SetStyle(long style) { m_dialogStyle = style; }
inline wxString GetMessage() const { return m_message; }
inline wxString GetPath() const { return m_path; }
inline long GetStyle() const { return m_dialogStyle; }
wxString GetMessage() const { return m_message; }
wxString GetPath() const { return m_path; }
long GetStyle() const { return m_dialogStyle; }
int ShowModal();
virtual int ShowModal();
protected:
wxString m_message;
long m_dialogStyle;
wxWindow * m_parent;
wxString m_path;
DECLARE_DYNAMIC_CLASS(wxDirDialog)
};
#endif

View File

@@ -16,18 +16,16 @@
#pragma interface "dirdlg.h"
#endif
#include "wx/dialog.h"
WXDLLEXPORT_DATA(extern const wxChar*) wxFileSelectorPromptStr;
class WXDLLEXPORT wxDirDialog : public wxDialog
{
public:
wxDirDialog(wxWindow *parent,
const wxString& message = wxFileSelectorPromptStr,
const wxString& message = wxDirSelectorPromptStr,
const wxString& defaultPath = wxEmptyString,
long style = 0,
const wxPoint& pos = wxDefaultPosition);
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
const wxString& name = wxDirDialogNameStr);
void SetMessage(const wxString& message) { m_message = message; }
void SetPath(const wxString& path);

View File

@@ -36,8 +36,8 @@
#endif
#include "wx/statline.h"
#include "wx/generic/dirctrlg.h"
#include "wx/generic/dirdlgg.h"
#include "wx/dirctrl.h"
#include "wx/dirdlg.h"
#include "wx/artprov.h"
#include "wx/bmpbuttn.h"

View File

@@ -32,9 +32,13 @@
IMPLEMENT_CLASS(wxDirDialog, wxDialog)
#endif
wxDirDialog::wxDirDialog(wxWindow *parent, const wxString& message,
const wxString& defaultPath,
long style, const wxPoint& pos)
wxDirDialog::wxDirDialog(wxWindow *parent,
const wxString& message,
const wxString& defaultPath,
long style,
const wxPoint& WXUNUSED(pos),
const wxSize& WXUNUSED(size),
const wxString& WXUNUSED(name))
{
wxASSERT_MSG( NavServicesAvailable() , "Navigation Services are not running" ) ;
m_message = message;

View File

@@ -32,9 +32,13 @@
IMPLEMENT_CLASS(wxDirDialog, wxDialog)
#endif
wxDirDialog::wxDirDialog(wxWindow *parent, const wxString& message,
const wxString& defaultPath,
long style, const wxPoint& pos)
wxDirDialog::wxDirDialog(wxWindow *parent,
const wxString& message,
const wxString& defaultPath,
long style,
const wxPoint& WXUNUSED(pos),
const wxSize& WXUNUSED(size),
const wxString& WXUNUSED(name))
{
wxASSERT_MSG( NavServicesAvailable() , "Navigation Services are not running" ) ;
m_message = message;

View File

@@ -81,7 +81,9 @@ wxDirDialog::wxDirDialog(wxWindow *parent,
const wxString& message,
const wxString& defaultPath,
long WXUNUSED(style),
const wxPoint& WXUNUSED(pos))
const wxPoint& WXUNUSED(pos),
const wxSize& WXUNUSED(size),
const wxString& WXUNUSED(name))
{
m_message = message;
m_parent = parent;