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*) wxDirDialogNameStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxDirDialogDefaultFolderStr; WXDLLEXPORT_DATA(extern const wxChar*) wxDirDialogDefaultFolderStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxDirSelectorPromptStr;
WXDLLEXPORT_DATA(extern const wxChar*) wxEmptyString; 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(__WXMSW__)
#if defined(__WIN16__) || (defined(__GNUWIN32__) && !wxUSE_NORLANDER_HEADERS) || defined(__SALFORDC__) || !wxUSE_OLE #if defined(__WIN16__) || (defined(__GNUWIN32__) && !wxUSE_NORLANDER_HEADERS) || defined(__SALFORDC__) || !wxUSE_OLE
#include "wx/generic/dirdlgg.h" #include "wx/generic/dirdlgg.h"
@@ -32,16 +62,18 @@ WXDLLEXPORT_DATA(extern const wxChar*) wxEmptyString;
#include "wx/generic/dirdlgg.h" #include "wx/generic/dirdlgg.h"
#endif #endif
#if !defined(__WXMSW__) && !defined(__WXMAC__)
#define wxDirDialog wxGenericDirDialog
#endif
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// common ::wxDirSelector() function // common ::wxDirSelector() function
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
WXDLLEXPORT_DATA(extern const wxChar*) wxDirSelectorPromptStr;
WXDLLEXPORT wxString WXDLLEXPORT wxString
wxDirSelector(const wxString& message = wxDirSelectorPromptStr, wxDirSelector(const wxString& message = wxDirSelectorPromptStr,
const wxString& defaultPath = wxEmptyString, 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 wxPoint& pos = wxDefaultPosition,
wxWindow *parent = NULL); wxWindow *parent = NULL);

View File

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

View File

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

View File

@@ -16,18 +16,16 @@
#pragma interface "dirdlg.h" #pragma interface "dirdlg.h"
#endif #endif
#include "wx/dialog.h"
WXDLLEXPORT_DATA(extern const wxChar*) wxFileSelectorPromptStr;
class WXDLLEXPORT wxDirDialog : public wxDialog class WXDLLEXPORT wxDirDialog : public wxDialog
{ {
public: public:
wxDirDialog(wxWindow *parent, wxDirDialog(wxWindow *parent,
const wxString& message = wxFileSelectorPromptStr, const wxString& message = wxDirSelectorPromptStr,
const wxString& defaultPath = wxEmptyString, const wxString& defaultPath = wxEmptyString,
long style = 0, 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 SetMessage(const wxString& message) { m_message = message; }
void SetPath(const wxString& path); void SetPath(const wxString& path);

View File

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

View File

@@ -32,9 +32,13 @@
IMPLEMENT_CLASS(wxDirDialog, wxDialog) IMPLEMENT_CLASS(wxDirDialog, wxDialog)
#endif #endif
wxDirDialog::wxDirDialog(wxWindow *parent, const wxString& message, wxDirDialog::wxDirDialog(wxWindow *parent,
const wxString& defaultPath, const wxString& message,
long style, const wxPoint& pos) 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" ) ; wxASSERT_MSG( NavServicesAvailable() , "Navigation Services are not running" ) ;
m_message = message; m_message = message;

View File

@@ -32,9 +32,13 @@
IMPLEMENT_CLASS(wxDirDialog, wxDialog) IMPLEMENT_CLASS(wxDirDialog, wxDialog)
#endif #endif
wxDirDialog::wxDirDialog(wxWindow *parent, const wxString& message, wxDirDialog::wxDirDialog(wxWindow *parent,
const wxString& defaultPath, const wxString& message,
long style, const wxPoint& pos) 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" ) ; wxASSERT_MSG( NavServicesAvailable() , "Navigation Services are not running" ) ;
m_message = message; m_message = message;

View File

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