fixed wxfileDialog::SetPath() (which didn't do anything before)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17460 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: filedlg.h
|
||||
// Name: wx/msw/filedlg.h
|
||||
// Purpose: wxFileDialog class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
@@ -28,12 +28,16 @@ WXDLLEXPORT_DATA(extern const wxChar*) wxFileSelectorDefaultWildcardStr;
|
||||
class WXDLLEXPORT wxFileDialog: public wxDialog
|
||||
{
|
||||
public:
|
||||
wxFileDialog(wxWindow *parent, const wxString& message = wxFileSelectorPromptStr,
|
||||
const wxString& defaultDir = wxEmptyString, const wxString& defaultFile = wxEmptyString, const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
|
||||
long style = 0, const wxPoint& pos = wxDefaultPosition);
|
||||
wxFileDialog(wxWindow *parent,
|
||||
const wxString& message = wxFileSelectorPromptStr,
|
||||
const wxString& defaultDir = wxEmptyString,
|
||||
const wxString& defaultFile = wxEmptyString,
|
||||
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
|
||||
long style = 0,
|
||||
const wxPoint& pos = wxDefaultPosition);
|
||||
|
||||
void SetMessage(const wxString& message) { m_message = message; }
|
||||
void SetPath(const wxString& path) { m_path = path; }
|
||||
void SetPath(const wxString& path);
|
||||
void SetDirectory(const wxString& dir) { m_dir = dir; }
|
||||
void SetFilename(const wxString& name) { m_fileName = name; }
|
||||
void SetWildcard(const wxString& wildCard) { m_wildCard = wildCard; }
|
||||
@@ -50,7 +54,7 @@ public:
|
||||
long GetStyle() const { return m_dialogStyle; }
|
||||
int GetFilterIndex() const { return m_filterIndex ; }
|
||||
|
||||
int ShowModal();
|
||||
virtual int ShowModal();
|
||||
|
||||
protected:
|
||||
wxString m_message;
|
||||
|
@@ -35,6 +35,7 @@
|
||||
#include "wx/msgdlg.h"
|
||||
#include "wx/dialog.h"
|
||||
#include "wx/filedlg.h"
|
||||
#include "wx/filefn.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/app.h"
|
||||
@@ -197,9 +198,13 @@ wxString wxFileSelectorEx(const wxChar *title,
|
||||
return filename;
|
||||
}
|
||||
|
||||
wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
|
||||
const wxString& defaultDir, const wxString& defaultFileName, const wxString& wildCard,
|
||||
long style, const wxPoint& WXUNUSED(pos))
|
||||
wxFileDialog::wxFileDialog(wxWindow *parent,
|
||||
const wxString& message,
|
||||
const wxString& defaultDir,
|
||||
const wxString& defaultFileName,
|
||||
const wxString& wildCard,
|
||||
long style,
|
||||
const wxPoint& WXUNUSED(pos))
|
||||
{
|
||||
m_message = message;
|
||||
m_dialogStyle = style;
|
||||
@@ -228,6 +233,14 @@ void wxFileDialog::GetPaths(wxArrayString& paths) const
|
||||
}
|
||||
}
|
||||
|
||||
void wxFileDialog::SetPath(const wxString& path)
|
||||
{
|
||||
wxString ext;
|
||||
wxSplitPath(path, &m_dir, &m_fileName, &ext);
|
||||
if ( !ext.empty() )
|
||||
m_fileName << _T('.') << ext;
|
||||
}
|
||||
|
||||
int wxFileDialog::ShowModal()
|
||||
{
|
||||
HWND hWnd = 0;
|
||||
|
Reference in New Issue
Block a user