From ba681060f36767a2682b8547871af2c6f8159955 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 24 Jan 1999 23:31:39 +0000 Subject: [PATCH] 1. wxLoad/SaveFileSelector return "wxString" instead of "char *" 2. WXDLLEXPORT was misplaced in a couple of places (hopefully my chanegs won't break compilation for other compilers) 3. Some VC++ warnings suppressed in socket code git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1464 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/date.h | 2 +- include/wx/filedlg.h | 36 +++++++++++++++++ include/wx/generic/fontdlgg.h | 6 +-- include/wx/gtk/filedlg.h | 15 ------- include/wx/gtk1/filedlg.h | 15 ------- include/wx/msw/filedlg.h | 40 ++++++------------- include/wx/qt/filedlg.h | 18 --------- include/wx/stubs/filedlg.h | 18 --------- src/common/date.cpp | 2 +- src/common/docview.cpp | 70 ++++++++++++++++---------------- src/common/socket.cpp | 14 +++++++ src/common/string.cpp | 2 +- src/generic/dcpsg.cpp | 5 ++- src/generic/prntdlgg.cpp | 18 ++++----- src/msw/app.cpp | 2 +- src/msw/bmpbuttn.cpp | 2 +- src/msw/filedlg.cpp | 75 +++++++++++++++++++---------------- src/msw/statbr95.cpp | 12 +++--- 18 files changed, 164 insertions(+), 188 deletions(-) diff --git a/include/wx/date.h b/include/wx/date.h index 86c503ec49..49936f064d 100644 --- a/include/wx/date.h +++ b/include/wx/date.h @@ -82,7 +82,7 @@ class WXDLLEXPORT wxDate: public wxObject friend bool WXDLLEXPORT operator == (const wxDate &dt1, const wxDate &dt2); friend bool WXDLLEXPORT operator != (const wxDate &dt1, const wxDate &dt2); - friend ostream& WXDLLEXPORT operator << (ostream &os, const wxDate &dt); + friend ostream WXDLLEXPORT & operator << (ostream &os, const wxDate &dt); wxString FormatDate (int type=-1) const; void SetFormat (int format); diff --git a/include/wx/filedlg.h b/include/wx/filedlg.h index cfb3737190..179638097c 100644 --- a/include/wx/filedlg.h +++ b/include/wx/filedlg.h @@ -15,5 +15,41 @@ #include "wx/stubs/filedlg.h" #endif +// File selector - backward compatibility +WXDLLEXPORT wxString +wxFileSelector(const char *message = wxFileSelectorPromptStr, + const char *default_path = NULL, + const char *default_filename = NULL, + const char *default_extension = NULL, + const char *wildcard = wxFileSelectorDefaultWildcardStr, + int flags = 0, + wxWindow *parent = NULL, + int x = -1, int y = -1); + +// An extended version of wxFileSelector +WXDLLEXPORT wxString +wxFileSelectorEx(const char *message = wxFileSelectorPromptStr, + const char *default_path = NULL, + const char *default_filename = NULL, + int *indexDefaultExtension = NULL, + const char *wildcard = wxFileSelectorDefaultWildcardStr, + int flags = 0, + wxWindow *parent = NULL, + int x = -1, int y = -1); + +// Ask for filename to load +WXDLLEXPORT wxString +wxLoadFileSelector(const char *what, + const char *extension, + const char *default_name = (const char *)NULL, + wxWindow *parent = (wxWindow *) NULL); + +// Ask for filename to save +WXDLLEXPORT wxString +wxSaveFileSelector(const char *what, + const char *extension, + const char *default_name = (const char *) NULL, + wxWindow *parent = (wxWindow *) NULL); + #endif // _WX_FILEDLG_H_BASE_ diff --git a/include/wx/generic/fontdlgg.h b/include/wx/generic/fontdlgg.h index 6bb9b29fa7..b02d7093b0 100644 --- a/include/wx/generic/fontdlgg.h +++ b/include/wx/generic/fontdlgg.h @@ -85,9 +85,9 @@ class WXDLLEXPORT wxGenericFontDialog: public wxDialog DECLARE_EVENT_TABLE() }; -char* WXDLLEXPORT wxFontFamilyIntToString(int family); -char* WXDLLEXPORT wxFontWeightIntToString(int weight); -char* WXDLLEXPORT wxFontStyleIntToString(int style); +char WXDLLEXPORT *wxFontFamilyIntToString(int family); +char WXDLLEXPORT *wxFontWeightIntToString(int weight); +char WXDLLEXPORT *wxFontStyleIntToString(int style); int WXDLLEXPORT wxFontFamilyStringToInt(char *family); int WXDLLEXPORT wxFontWeightStringToInt(char *weight); int WXDLLEXPORT wxFontStyleStringToInt(char *style); diff --git a/include/wx/gtk/filedlg.h b/include/wx/gtk/filedlg.h index 5337b50c94..78e4e84eb5 100644 --- a/include/wx/gtk/filedlg.h +++ b/include/wx/gtk/filedlg.h @@ -76,20 +76,5 @@ class wxFileDialog: public wxDialog #define wxHIDE_READONLY 8 #define wxFILE_MUST_EXIST 16 -// File selector - backward compatibility - -char* wxFileSelector(const char *message = wxFileSelectorPromptStr, const char *default_path = (const char *) NULL, - const char *default_filename = (const char *) NULL, const char *default_extension = (const char *) NULL, - const char *wildcard = wxFileSelectorDefaultWildcardStr, int flags = 0, - wxWindow *parent = (wxWindow *) NULL, int x = -1, int y = -1); - -char* wxLoadFileSelector(const char *what, const char *extension, const char *default_name = (const char *) NULL, - wxWindow *parent = (wxWindow *) NULL); - -char* wxSaveFileSelector(const char *what, const char *extension, const char *default_name = (const char *) NULL, - wxWindow *parent = (wxWindow *) NULL); - - - #endif // __GTKFILEDLGH__ diff --git a/include/wx/gtk1/filedlg.h b/include/wx/gtk1/filedlg.h index 5337b50c94..78e4e84eb5 100644 --- a/include/wx/gtk1/filedlg.h +++ b/include/wx/gtk1/filedlg.h @@ -76,20 +76,5 @@ class wxFileDialog: public wxDialog #define wxHIDE_READONLY 8 #define wxFILE_MUST_EXIST 16 -// File selector - backward compatibility - -char* wxFileSelector(const char *message = wxFileSelectorPromptStr, const char *default_path = (const char *) NULL, - const char *default_filename = (const char *) NULL, const char *default_extension = (const char *) NULL, - const char *wildcard = wxFileSelectorDefaultWildcardStr, int flags = 0, - wxWindow *parent = (wxWindow *) NULL, int x = -1, int y = -1); - -char* wxLoadFileSelector(const char *what, const char *extension, const char *default_name = (const char *) NULL, - wxWindow *parent = (wxWindow *) NULL); - -char* wxSaveFileSelector(const char *what, const char *extension, const char *default_name = (const char *) NULL, - wxWindow *parent = (wxWindow *) NULL); - - - #endif // __GTKFILEDLGH__ diff --git a/include/wx/msw/filedlg.h b/include/wx/msw/filedlg.h index 45b040e6c7..89c919c1c4 100644 --- a/include/wx/msw/filedlg.h +++ b/include/wx/msw/filedlg.h @@ -6,7 +6,7 @@ // Created: 01/02/97 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_FILEDLG_H_ @@ -28,15 +28,7 @@ WXDLLEXPORT_DATA(extern const char*) wxFileSelectorDefaultWildcardStr; class WXDLLEXPORT wxFileDialog: public wxDialog { DECLARE_DYNAMIC_CLASS(wxFileDialog) -protected: - wxString m_message; - long m_dialogStyle; - wxWindow * m_parent; - wxString m_dir; - wxString m_path; // Full path - wxString m_fileName; - wxString m_wildCard; - int m_filterIndex; + public: wxFileDialog(wxWindow *parent, const wxString& message = wxFileSelectorPromptStr, const wxString& defaultDir = wxEmptyString, const wxString& defaultFile = wxEmptyString, const wxString& wildCard = wxFileSelectorDefaultWildcardStr, @@ -59,6 +51,16 @@ public: inline int GetFilterIndex(void) const { return m_filterIndex ; } int ShowModal(void); + +protected: + wxString m_message; + long m_dialogStyle; + wxWindow * m_parent; + wxString m_dir; + wxString m_path; // Full path + wxString m_fileName; + wxString m_wildCard; + int m_filterIndex; }; #define wxOPEN 0x0001 @@ -67,23 +69,5 @@ public: #define wxHIDE_READONLY 0x0008 #define wxFILE_MUST_EXIST 0x0010 -// File selector - backward compatibility -WXDLLEXPORT char* wxFileSelector(const char *message = wxFileSelectorPromptStr, const char *default_path = NULL, - const char *default_filename = NULL, const char *default_extension = NULL, - const char *wildcard = wxFileSelectorDefaultWildcardStr, int flags = 0, - wxWindow *parent = NULL, int x = -1, int y = -1); - -// An extended version of wxFileSelector -WXDLLEXPORT char* wxFileSelectorEx(const char *message = wxFileSelectorPromptStr, const char *default_path = NULL, - const char *default_filename = NULL, int *indexDefaultExtension = NULL, - const char *wildcard = wxFileSelectorDefaultWildcardStr, int flags = 0, - wxWindow *parent = NULL, int x = -1, int y = -1); - -// Generic file load dialog -WXDLLEXPORT char* wxLoadFileSelector(const char *what, const char *extension, const char *default_name = NULL, wxWindow *parent = NULL); - -// Generic file save dialog -WXDLLEXPORT char* wxSaveFileSelector(const char *what, const char *extension, const char *default_name = NULL, wxWindow *parent = NULL); - #endif // _WX_FILEDLG_H_ diff --git a/include/wx/qt/filedlg.h b/include/wx/qt/filedlg.h index 0259f2d943..1abeed4d68 100644 --- a/include/wx/qt/filedlg.h +++ b/include/wx/qt/filedlg.h @@ -67,23 +67,5 @@ public: #define wxHIDE_READONLY 0x0008 #define wxFILE_MUST_EXIST 0x0010 -// File selector - backward compatibility -char* WXDLLEXPORT wxFileSelector(const char *message = wxFileSelectorPromptStr, const char *default_path = NULL, - const char *default_filename = NULL, const char *default_extension = NULL, - const char *wildcard = wxFileSelectorDefaultWildcardStr, int flags = 0, - wxWindow *parent = NULL, int x = -1, int y = -1); - -// An extended version of wxFileSelector -char* WXDLLEXPORT wxFileSelectorEx(const char *message = wxFileSelectorPromptStr, const char *default_path = NULL, - const char *default_filename = NULL, int *indexDefaultExtension = NULL, - const char *wildcard = wxFileSelectorDefaultWildcardStr, int flags = 0, - wxWindow *parent = NULL, int x = -1, int y = -1); - -// Generic file load dialog -char* WXDLLEXPORT wxLoadFileSelector(const char *what, const char *extension, const char *default_name = NULL, wxWindow *parent = NULL); - -// Generic file save dialog -char* WXDLLEXPORT wxSaveFileSelector(const char *what, const char *extension, const char *default_name = NULL, wxWindow *parent = NULL); - #endif // _WX_FILEDLG_H_ diff --git a/include/wx/stubs/filedlg.h b/include/wx/stubs/filedlg.h index 0259f2d943..1abeed4d68 100644 --- a/include/wx/stubs/filedlg.h +++ b/include/wx/stubs/filedlg.h @@ -67,23 +67,5 @@ public: #define wxHIDE_READONLY 0x0008 #define wxFILE_MUST_EXIST 0x0010 -// File selector - backward compatibility -char* WXDLLEXPORT wxFileSelector(const char *message = wxFileSelectorPromptStr, const char *default_path = NULL, - const char *default_filename = NULL, const char *default_extension = NULL, - const char *wildcard = wxFileSelectorDefaultWildcardStr, int flags = 0, - wxWindow *parent = NULL, int x = -1, int y = -1); - -// An extended version of wxFileSelector -char* WXDLLEXPORT wxFileSelectorEx(const char *message = wxFileSelectorPromptStr, const char *default_path = NULL, - const char *default_filename = NULL, int *indexDefaultExtension = NULL, - const char *wildcard = wxFileSelectorDefaultWildcardStr, int flags = 0, - wxWindow *parent = NULL, int x = -1, int y = -1); - -// Generic file load dialog -char* WXDLLEXPORT wxLoadFileSelector(const char *what, const char *extension, const char *default_name = NULL, wxWindow *parent = NULL); - -// Generic file save dialog -char* WXDLLEXPORT wxSaveFileSelector(const char *what, const char *extension, const char *default_name = NULL, wxWindow *parent = NULL); - #endif // _WX_FILEDLG_H_ diff --git a/src/common/date.cpp b/src/common/date.cpp index bd67ec071a..2b248eab65 100644 --- a/src/common/date.cpp +++ b/src/common/date.cpp @@ -279,7 +279,7 @@ bool WXDLLEXPORT operator != (const wxDate &dt1, const wxDate &dt2) // Ostream operations //////////////////////////////////////////////////////////////// -ostream& WXDLLEXPORT operator << (ostream &os, const wxDate &dt) +ostream WXDLLEXPORT & operator << (ostream &os, const wxDate &dt) { return os << (const char *) dt.FormatDate(); } diff --git a/src/common/docview.cpp b/src/common/docview.cpp index 26281bef27..ae846c0c8f 100644 --- a/src/common/docview.cpp +++ b/src/common/docview.cpp @@ -194,18 +194,21 @@ bool wxDocument::Save(void) bool wxDocument::SaveAs(void) { - wxDocTemplate *docTemplate = GetDocumentTemplate(); - if (!docTemplate) - return FALSE; - - char *tmp = wxFileSelector(_("Save as"), docTemplate->GetDirectory(), GetFilename(), - docTemplate->GetDefaultExtension(), docTemplate->GetFileFilter(), - wxSAVE|wxOVERWRITE_PROMPT, GetDocumentWindow()); + wxDocTemplate *docTemplate = GetDocumentTemplate(); + if (!docTemplate) + return FALSE; - if (!tmp) - return FALSE; - else - { + wxString tmp = wxFileSelector(_("Save as"), + docTemplate->GetDirectory(), + GetFilename(), + docTemplate->GetDefaultExtension(), + docTemplate->GetFileFilter(), + wxSAVE | wxOVERWRITE_PROMPT, + GetDocumentWindow()); + + if (tmp.IsEmpty()) + return FALSE; + wxString fileName(tmp); wxString path(""); wxString name(""); @@ -231,8 +234,8 @@ bool wxDocument::SaveAs(void) view->OnChangeFilename(); node = node->Next(); } - } - return OnSaveDocument(m_documentFile); + + return OnSaveDocument(m_documentFile); } bool wxDocument::OnSaveDocument(const wxString& file) @@ -1144,33 +1147,30 @@ wxDocTemplate *wxDocManager::SelectDocumentPath(wxDocTemplate **WXUNUSED(templat { // We can only have multiple filters in Windows #ifdef __WXMSW__ - char *descrBuf = new char[1000]; // FIXME static buffer - descrBuf[0] = 0; - int i; - for (i = 0; i < noTemplates; i++) - { - if (templates[i]->IsVisible()) + wxString descrBuf; + + int i; + for (i = 0; i < noTemplates; i++) { - strcat(descrBuf, templates[i]->GetDescription()); - strcat(descrBuf, " ("); - strcat(descrBuf, templates[i]->GetFileFilter()); - strcat(descrBuf, ") "); - strcat(descrBuf, "|"); - strcat(descrBuf, templates[i]->GetFileFilter()); - strcat(descrBuf, "|"); + if (templates[i]->IsVisible()) + { + // add a '|' to separate this filter from the previous one + if ( !descrBuf.IsEmpty() ) + descrBuf << '|'; + + descrBuf << templates[i]->GetDescription() + << " (" << templates[i]->GetFileFilter() << ") |" + << templates[i]->GetFileFilter(); + } } - } - int len = strlen(descrBuf); - if (len > 0) - // Omit final "|" - descrBuf[len-1] = 0; #else - char* descrBuf = copystring("*.*"); + wxString descrBuf = "*.*"; #endif - char *pathTmp = wxFileSelector(_("Select a file"), "", "", "", descrBuf, 0, wxTheApp->GetTopWindow()); - delete[] descrBuf; - if (pathTmp) + wxString pathTmp = wxFileSelector(_("Select a file"), "", "", "", + descrBuf, 0, wxTheApp->GetTopWindow()); + + if (!pathTmp.IsEmpty()) { path = pathTmp; char *theExt = FindExtension((char *)(const char *)path); diff --git a/src/common/socket.cpp b/src/common/socket.cpp index 6b1d1992a2..e4d22c8e4a 100644 --- a/src/common/socket.cpp +++ b/src/common/socket.cpp @@ -439,6 +439,11 @@ wxSocketBase& wxSocketBase::WriteMsg(const char *buffer, size_t nbytes) { SockMsg msg; + // warning about 'cast truncates constant value' +#ifdef _MSC_VER + #pragma warning(disable: 4310) +#endif // _MSC_VER + msg.sig[0] = (char) 0xad; msg.sig[1] = (char) 0xde; msg.sig[2] = (char) 0xed; @@ -462,6 +467,10 @@ wxSocketBase& wxSocketBase::WriteMsg(const char *buffer, size_t nbytes) Write((char *)&msg, sizeof(msg)); return *this; + +#ifdef _MSC_VER + #pragma warning(default: 4310) +#endif // _MSC_VER } wxSocketBase& wxSocketBase::Unread(const char *buffer, size_t nbytes) @@ -1602,7 +1611,12 @@ LRESULT APIENTRY _EXPORT wxSocketHandlerWndProc(HWND hWnd, UINT message, case FD_CONNECT: sk_req = wxSocketBase::EVT_CONNECT; break; + + default: + wxFAIL_MSG("invalid socket event"); + return (LRESULT)0; } + sock->OnRequest(sk_req); return (LRESULT)0; diff --git a/src/common/string.cpp b/src/common/string.cpp index d9937efe17..5329f085e2 100644 --- a/src/common/string.cpp +++ b/src/common/string.cpp @@ -80,7 +80,7 @@ static const struct } g_strEmpty = { {-1, 0, 0}, '\0' }; // empty C style string: points to 'string data' byte of g_strEmpty -extern const char *g_szNul = &g_strEmpty.dummy; +extern const char WXDLLEXPORT *g_szNul = &g_strEmpty.dummy; // ---------------------------------------------------------------------------- // conditional compilation diff --git a/src/generic/dcpsg.cpp b/src/generic/dcpsg.cpp index 60758bcb9b..55ba6d7768 100644 --- a/src/generic/dcpsg.cpp +++ b/src/generic/dcpsg.cpp @@ -335,12 +335,13 @@ bool wxPostScriptDC::PrinterDialog(wxWindow *parent) } else if ((m_filename == "") && (wxThePrintSetupData->GetPrinterMode() == PS_FILE)) { - char *file = wxSaveFileSelector (_("PostScript"), "ps"); - if (!file) + wxString file = wxSaveFileSelector (_("PostScript"), "ps"); + if ( file.IsEmpty() ) { m_ok = FALSE; return FALSE; } + wxThePrintSetupData->SetPrinterFile(file); m_filename = file; m_ok = TRUE; diff --git a/src/generic/prntdlgg.cpp b/src/generic/prntdlgg.cpp index f7dc47a9df..5a89abe6e5 100644 --- a/src/generic/prntdlgg.cpp +++ b/src/generic/prntdlgg.cpp @@ -156,14 +156,14 @@ void wxGenericPrintDialog::OnOK(wxCommandEvent& WXUNUSED(event)) { wxThePrintSetupData->SetPrinterMode(PS_FILE); - char *f = wxFileSelector(_("PostScript file"), - wxPathOnly(wxThePrintSetupData->GetPrinterFile()), - wxFileNameFromPath(wxThePrintSetupData->GetPrinterFile()), - "ps", "*.ps", 0, this); - if (f) - wxThePrintSetupData->SetPrinterFile(f); - else - return; + wxString f = wxFileSelector(_("PostScript file"), + wxPathOnly(wxThePrintSetupData->GetPrinterFile()), + wxFileNameFromPath(wxThePrintSetupData->GetPrinterFile()), + "ps", "*.ps", 0, this); + if ( f.IsEmpty() ) + return; + + wxThePrintSetupData->SetPrinterFile(f); } else wxThePrintSetupData->SetPrinterMode(PS_PRINTER); @@ -425,7 +425,7 @@ void wxGenericPageSetupDialog::OnPrinter(wxCommandEvent& WXUNUSED(event)) wxPrintData data; data.SetSetupDialog(TRUE); wxPrintDialog *printDialog = new wxPrintDialog(this, & data); - int ret = printDialog->ShowModal(); + printDialog->ShowModal(); printDialog->Destroy(); diff --git a/src/msw/app.cpp b/src/msw/app.cpp index 591578c2b8..acb3f169f9 100644 --- a/src/msw/app.cpp +++ b/src/msw/app.cpp @@ -260,7 +260,7 @@ bool wxApp::Initialize() // This is to foil optimizations in Visual C++ that // throw out dummy.obj. -#if defined(_MSC_VER) && !defined(WXMAKINGDLL) +#if 0 && defined(_MSC_VER) && !defined(WXMAKINGDLL) extern char wxDummyChar; if (wxDummyChar) wxDummyChar++; #endif diff --git a/src/msw/bmpbuttn.cpp b/src/msw/bmpbuttn.cpp index ef88967086..6af2e7c60d 100644 --- a/src/msw/bmpbuttn.cpp +++ b/src/msw/bmpbuttn.cpp @@ -97,8 +97,8 @@ void wxBitmapButton::SetBitmapLabel(const wxBitmap& bitmap) bool wxBitmapButton::MSWOnDraw(WXDRAWITEMSTRUCT *item) { - long style = GetWindowLong((HWND) GetHWND(), GWL_STYLE); #if defined(__WIN95__) + long style = GetWindowLong((HWND) GetHWND(), GWL_STYLE); if (style & BS_BITMAP) { // Should we call Default() here? diff --git a/src/msw/filedlg.cpp b/src/msw/filedlg.cpp index af6471df6f..5b63931fe4 100644 --- a/src/msw/filedlg.cpp +++ b/src/msw/filedlg.cpp @@ -10,30 +10,30 @@ ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ -#pragma implementation "filedlg.h" + #pragma implementation "filedlg.h" #endif // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif #ifndef WX_PRECOMP -#include -#include "wx/defs.h" -#include "wx/utils.h" -#include "wx/msgdlg.h" -#include "wx/dialog.h" -#include "wx/filedlg.h" -#include "wx/intl.h" + #include + #include "wx/defs.h" + #include "wx/utils.h" + #include "wx/msgdlg.h" + #include "wx/dialog.h" + #include "wx/filedlg.h" + #include "wx/intl.h" #endif #include #if !defined(__WIN32__) || defined(__SALFORDC__) -#include + #include #endif #include "wx/msw/private.h" @@ -43,13 +43,17 @@ #include #if !USE_SHARED_LIBRARY -IMPLEMENT_CLASS(wxFileDialog, wxDialog) + IMPLEMENT_CLASS(wxFileDialog, wxDialog) #endif -char *wxFileSelector(const char *title, - const char *defaultDir, const char *defaultFileName, - const char *defaultExtension, const char *filter, int flags, - wxWindow *parent, int x, int y) +wxString wxFileSelector(const char *title, + const char *defaultDir, + const char *defaultFileName, + const char *defaultExtension, + const char *filter, + int flags, + wxWindow *parent, + int x, int y) { // In the original implementation, defaultExtension is passed to the // lpstrDefExt member of OPENFILENAME. This extension, if non-NULL, is @@ -120,7 +124,7 @@ char *wxFileSelector(const char *title, return wxBuffer; } else - return NULL; + return wxGetEmptyString(); } # if __BORLANDC__ @@ -144,7 +148,7 @@ char *wxFileSelector(const char *title, # endif -char *wxFileSelectorEx(const char *title, +wxString wxFileSelectorEx(const char *title, const char *defaultDir, const char *defaultFileName, int* defaultFilterIndex, @@ -165,7 +169,7 @@ char *wxFileSelectorEx(const char *title, return wxBuffer; } else - return NULL; + return wxGetEmptyString(); } wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message, @@ -328,17 +332,16 @@ int wxFileDialog::ShowModal(void) } -// Generic file load/save dialog -static char * -wxDefaultFileSelector(bool load, const char *what, const char *extension, const char *default_name, wxWindow *parent) +// Generic file load/save dialog (for internal use only) +static +wxString wxDefaultFileSelector(bool load, + const char *what, + const char *extension, + const char *default_name, + wxWindow *parent) { - wxString prompt; - wxString str; - if (load) - str = _("Load %s file"); - else - str = _("Save %s file"); + wxString str = load ? _("Load %s file") : _("Save %s file"); prompt.Printf(str, what); const char *ext = extension; @@ -352,18 +355,20 @@ wxDefaultFileSelector(bool load, const char *what, const char *extension, const } // Generic file load dialog -char * -wxLoadFileSelector(const char *what, const char *extension, const char *default_name, wxWindow *parent) +WXDLLEXPORT wxString wxLoadFileSelector(const char *what, + const char *extension, + const char *default_name, + wxWindow *parent) { - return wxDefaultFileSelector(TRUE, what, extension, default_name, parent); + return wxDefaultFileSelector(TRUE, what, extension, default_name, parent); } - // Generic file save dialog -char * -wxSaveFileSelector(const char *what, const char *extension, const char *default_name, wxWindow *parent) +WXDLLEXPORT wxString wxSaveFileSelector(const char *what, + const char *extension, + const char *default_name, + wxWindow *parent) { - return wxDefaultFileSelector(FALSE, what, extension, default_name, parent); + return wxDefaultFileSelector(FALSE, what, extension, default_name, parent); } - diff --git a/src/msw/statbr95.cpp b/src/msw/statbr95.cpp index a040fbaed1..312fabcea2 100644 --- a/src/msw/statbr95.cpp +++ b/src/msw/statbr95.cpp @@ -48,7 +48,7 @@ #undef GetClassName #endif -#if wxUSE_NATIVE_STATUSBAR +#if wxUSE_NATIVE_STATUSBAR #if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxStatusBar95, wxStatusBar); @@ -236,7 +236,9 @@ void wxStatusBar95::OnSize(wxSizeEvent& event) SetFieldsWidth(); } -#endif - // __WIN95__ -#endif - // wxUSE_NATIVE_STATUSBAR +#endif // wxUSE_NATIVE_STATUSBAR + +#else + #error "wxStatusBar95 is only available under Windows 95 and later." +#endif // __WIN95__ + -- 2.45.2