compilation warning removed
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1564 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -26,37 +26,36 @@ extern const char *wxFileSelectorDefaultWildcardStr;
|
|||||||
|
|
||||||
class wxFileDialog: public wxDialog
|
class wxFileDialog: public wxDialog
|
||||||
{
|
{
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxFileDialog)
|
DECLARE_DYNAMIC_CLASS(wxFileDialog)
|
||||||
|
|
||||||
friend void gtk_filedialog_ok_callback( GtkWidget *widget, gpointer data );
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
wxFileDialog() { }
|
||||||
|
|
||||||
wxFileDialog() {};
|
wxFileDialog(wxWindow *parent,
|
||||||
|
const wxString& message = wxFileSelectorPromptStr,
|
||||||
wxFileDialog(wxWindow *parent, const wxString& message = wxFileSelectorPromptStr,
|
const wxString& defaultDir = "",
|
||||||
const wxString& defaultDir = "", const wxString& defaultFile = "",
|
const wxString& defaultFile = "",
|
||||||
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
|
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
|
||||||
long style = 0, const wxPoint& pos = wxDefaultPosition);
|
long style = 0,
|
||||||
|
const wxPoint& pos = wxDefaultPosition);
|
||||||
|
|
||||||
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 SetDirectory(const wxString& dir) { m_dir = dir; }
|
void SetDirectory(const wxString& dir) { m_dir = dir; }
|
||||||
inline void SetFilename(const wxString& name) { m_fileName = name; }
|
void SetFilename(const wxString& name) { m_fileName = name; }
|
||||||
inline void SetWildcard(const wxString& wildCard) { m_wildCard = wildCard; }
|
void SetWildcard(const wxString& wildCard) { m_wildCard = wildCard; }
|
||||||
inline void SetStyle(long style) { m_dialogStyle = style; }
|
void SetStyle(long style) { m_dialogStyle = style; }
|
||||||
inline void SetFilterIndex(int filterIndex) { m_filterIndex = filterIndex; }
|
void SetFilterIndex(int filterIndex) { m_filterIndex = filterIndex; }
|
||||||
|
|
||||||
inline wxString GetMessage(void) const { return m_message; }
|
wxString GetMessage() const { return m_message; }
|
||||||
inline wxString GetPath(void) const { return m_path; }
|
wxString GetPath() const { return m_path; }
|
||||||
inline wxString GetDirectory(void) const { return m_dir; }
|
wxString GetDirectory() const { return m_dir; }
|
||||||
inline wxString GetFilename(void) const { return m_fileName; }
|
wxString GetFilename() const { return m_fileName; }
|
||||||
inline wxString GetWildcard(void) const { return m_wildCard; }
|
wxString GetWildcard() const { return m_wildCard; }
|
||||||
inline long GetStyle(void) const { return m_dialogStyle; }
|
long GetStyle() const { return m_dialogStyle; }
|
||||||
inline int GetFilterIndex(void) const { return m_filterIndex ; }
|
int GetFilterIndex() const { return m_filterIndex ; }
|
||||||
|
|
||||||
int ShowModal(void);
|
int ShowModal();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
@@ -26,37 +26,36 @@ extern const char *wxFileSelectorDefaultWildcardStr;
|
|||||||
|
|
||||||
class wxFileDialog: public wxDialog
|
class wxFileDialog: public wxDialog
|
||||||
{
|
{
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxFileDialog)
|
DECLARE_DYNAMIC_CLASS(wxFileDialog)
|
||||||
|
|
||||||
friend void gtk_filedialog_ok_callback( GtkWidget *widget, gpointer data );
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
wxFileDialog() { }
|
||||||
|
|
||||||
wxFileDialog() {};
|
wxFileDialog(wxWindow *parent,
|
||||||
|
const wxString& message = wxFileSelectorPromptStr,
|
||||||
wxFileDialog(wxWindow *parent, const wxString& message = wxFileSelectorPromptStr,
|
const wxString& defaultDir = "",
|
||||||
const wxString& defaultDir = "", const wxString& defaultFile = "",
|
const wxString& defaultFile = "",
|
||||||
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
|
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
|
||||||
long style = 0, const wxPoint& pos = wxDefaultPosition);
|
long style = 0,
|
||||||
|
const wxPoint& pos = wxDefaultPosition);
|
||||||
|
|
||||||
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 SetDirectory(const wxString& dir) { m_dir = dir; }
|
void SetDirectory(const wxString& dir) { m_dir = dir; }
|
||||||
inline void SetFilename(const wxString& name) { m_fileName = name; }
|
void SetFilename(const wxString& name) { m_fileName = name; }
|
||||||
inline void SetWildcard(const wxString& wildCard) { m_wildCard = wildCard; }
|
void SetWildcard(const wxString& wildCard) { m_wildCard = wildCard; }
|
||||||
inline void SetStyle(long style) { m_dialogStyle = style; }
|
void SetStyle(long style) { m_dialogStyle = style; }
|
||||||
inline void SetFilterIndex(int filterIndex) { m_filterIndex = filterIndex; }
|
void SetFilterIndex(int filterIndex) { m_filterIndex = filterIndex; }
|
||||||
|
|
||||||
inline wxString GetMessage(void) const { return m_message; }
|
wxString GetMessage() const { return m_message; }
|
||||||
inline wxString GetPath(void) const { return m_path; }
|
wxString GetPath() const { return m_path; }
|
||||||
inline wxString GetDirectory(void) const { return m_dir; }
|
wxString GetDirectory() const { return m_dir; }
|
||||||
inline wxString GetFilename(void) const { return m_fileName; }
|
wxString GetFilename() const { return m_fileName; }
|
||||||
inline wxString GetWildcard(void) const { return m_wildCard; }
|
wxString GetWildcard() const { return m_wildCard; }
|
||||||
inline long GetStyle(void) const { return m_dialogStyle; }
|
long GetStyle() const { return m_dialogStyle; }
|
||||||
inline int GetFilterIndex(void) const { return m_filterIndex ; }
|
int GetFilterIndex() const { return m_filterIndex ; }
|
||||||
|
|
||||||
int ShowModal(void);
|
int ShowModal();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
@@ -52,10 +52,17 @@ void gtk_filedialog_ok_callback( GtkWidget *WXUNUSED(widget), gpointer data )
|
|||||||
|
|
||||||
if( (style & wxSAVE ) && ( style&wxOVERWRITE_PROMPT ) )
|
if( (style & wxSAVE ) && ( style&wxOVERWRITE_PROMPT ) )
|
||||||
{
|
{
|
||||||
if(wxFileExists(gtk_file_selection_get_filename(GTK_FILE_SELECTION(dialog->m_widget) )))
|
char *filename = gtk_file_selection_get_filename(
|
||||||
|
GTK_FILE_SELECTION(dialog->m_widget)
|
||||||
|
);
|
||||||
|
|
||||||
|
if(wxFileExists( filename ))
|
||||||
{
|
{
|
||||||
if(wxMessageBox(_("File exists. Overwrite?"),
|
wxString msg;
|
||||||
_("Confirm"), wxYES_NO) != wxYES)
|
msg.Printf(_("File '%s' already exists, do you really want to "
|
||||||
|
"overwrite it?"), filename);
|
||||||
|
|
||||||
|
if( wxMessageBox(msg, _("Confirm"), wxYES_NO) != wxYES)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -52,10 +52,17 @@ void gtk_filedialog_ok_callback( GtkWidget *WXUNUSED(widget), gpointer data )
|
|||||||
|
|
||||||
if( (style & wxSAVE ) && ( style&wxOVERWRITE_PROMPT ) )
|
if( (style & wxSAVE ) && ( style&wxOVERWRITE_PROMPT ) )
|
||||||
{
|
{
|
||||||
if(wxFileExists(gtk_file_selection_get_filename(GTK_FILE_SELECTION(dialog->m_widget) )))
|
char *filename = gtk_file_selection_get_filename(
|
||||||
|
GTK_FILE_SELECTION(dialog->m_widget)
|
||||||
|
);
|
||||||
|
|
||||||
|
if(wxFileExists( filename ))
|
||||||
{
|
{
|
||||||
if(wxMessageBox(_("File exists. Overwrite?"),
|
wxString msg;
|
||||||
_("Confirm"), wxYES_NO) != wxYES)
|
msg.Printf(_("File '%s' already exists, do you really want to "
|
||||||
|
"overwrite it?"), filename);
|
||||||
|
|
||||||
|
if( wxMessageBox(msg, _("Confirm"), wxYES_NO) != wxYES)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user