]> git.saurik.com Git - wxWidgets.git/commitdiff
1. wxLoad/SaveFileSelector return "wxString" instead of "char *"
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 24 Jan 1999 23:31:39 +0000 (23:31 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 24 Jan 1999 23:31:39 +0000 (23:31 +0000)
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

18 files changed:
include/wx/date.h
include/wx/filedlg.h
include/wx/generic/fontdlgg.h
include/wx/gtk/filedlg.h
include/wx/gtk1/filedlg.h
include/wx/msw/filedlg.h
include/wx/qt/filedlg.h
include/wx/stubs/filedlg.h
src/common/date.cpp
src/common/docview.cpp
src/common/socket.cpp
src/common/string.cpp
src/generic/dcpsg.cpp
src/generic/prntdlgg.cpp
src/msw/app.cpp
src/msw/bmpbuttn.cpp
src/msw/filedlg.cpp
src/msw/statbr95.cpp

index 86c503ec4910ed3c0d3b32e2c97fbd9ca65a776c..49936f064de3e882fb57d81aef7b98c856f120ec 100644 (file)
@@ -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);
index cfb3737190eb7a84c3c10635fc257a1fcad64fb9..179638097ccb0de988ae5c3f8a911f8d1ec573cb 100644 (file)
 #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_
index 6bb9b29fa7e4d7869802bf3880b70a19ea831456..b02d7093b01ffd69f5c5472c34c6f24cae3e9d99 100644 (file)
@@ -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);
index 5337b50c94f7410d6644516867c69a7ec0f07dd4..78e4e84eb5c67790b097952e9912083e2efdbc1d 100644 (file)
@@ -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__
index 5337b50c94f7410d6644516867c69a7ec0f07dd4..78e4e84eb5c67790b097952e9912083e2efdbc1d 100644 (file)
@@ -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__
index 45b040e6c77d142d768d03c6d00053f3fd25a848..89c919c1c403b5505b31bf9baee10a908ebd4d77 100644 (file)
@@ -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_
index 0259f2d9435524d0d84917ff347e79aad4336f34..1abeed4d687e2a63a0b6160332a4fc9a68d81747 100644 (file)
@@ -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_
index 0259f2d9435524d0d84917ff347e79aad4336f34..1abeed4d687e2a63a0b6160332a4fc9a68d81747 100644 (file)
@@ -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_
index bd67ec071a02ddd1b0f4c47f697cd5346130fbc1..2b248eab657d52d41095120fabb7221c2115f5a2 100644 (file)
@@ -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();
 }
index 26281bef2704e43633e926d9eb2bc5f929e0dc47..ae846c0c8fdac6793336c59e6a17bce2a063c2f2 100644 (file)
@@ -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);
index 6b1d1992a21ab8f9d7b799616aa015b6cc9b5f36..e4d22c8e4a24a1c2c8e6c58b8edb0ae3246443e3 100644 (file)
@@ -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;
index d9937efe17bd82315152f9e1e65c666234e264f0..5329f085e2a062bfa271e9282dac0a1278fa45a8 100644 (file)
@@ -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
index 60758bcb9b1815a4ca4b0f702e6f1a7c8f5ba4be..55ba6d7768e28dfa69ad0bddcf441d62899bfebe 100644 (file)
@@ -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;
index f7dc47a9dff2b8e9054beff5c5a13a842ba1ecf6..5a89abe6e5491c06eab1ab5c871d2bcf965ce857 100644 (file)
@@ -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();
 
index 591578c2b830343b3691dae38f6674d5bdab1f34..acb3f169f9e82906012ca257942716fdb7b1df1b 100644 (file)
@@ -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
index ef88967086133445d697be1191004726e0e65f1a..6af2e7c60d888734f573b26d109ce0183b0d6459 100644 (file)
@@ -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?
index af6471df6fa285ef694eb670bb5bdc6ed41c6135..5b63931fe431ffc30986e0e465c50c91de91b1c8 100644 (file)
 /////////////////////////////////////////////////////////////////////////////
 
 #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 <stdio.h>
-#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 <stdio.h>
+    #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 <windows.h>
 
 #if !defined(__WIN32__) || defined(__SALFORDC__)
-#include <commdlg.h>
+    #include <commdlg.h>
 #endif
 
 #include "wx/msw/private.h"
 #include <string.h>
 
 #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);
 }
 
-
index a040fbaed1b36ab9344cafcb4bf39668df26f9c0..312fabcea26fd0bb9f76a9bbe6c2206f924884fd 100644 (file)
@@ -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__
+