]> git.saurik.com Git - wxWidgets.git/blobdiff - src/cocoa/filedlg.mm
add virtual DoGetTextExtent() to allow calling the overloaded wxWindowBase::GetTextEx...
[wxWidgets.git] / src / cocoa / filedlg.mm
index 3df7bc908432c131f0081576f5579793c632a67b..d3d988c21591b339d139dea9dcc88a8f95e1d2fa 100644 (file)
 
 #if wxUSE_FILEDLG
 
 
 #if wxUSE_FILEDLG
 
+#include "wx/filedlg.h"
+
 #ifndef WX_PRECOMP
     #include "wx/msgdlg.h"
 #ifndef WX_PRECOMP
     #include "wx/msgdlg.h"
-    #include "wx/filedlg.h"
     #include "wx/app.h"
 #endif
     #include "wx/app.h"
 #endif
+
 #include "wx/filename.h"
 
 #include "wx/cocoa/autorelease.h"
 #include "wx/filename.h"
 
 #include "wx/cocoa/autorelease.h"
@@ -46,11 +48,17 @@ IMPLEMENT_CLASS(wxCocoaFileDialog, wxFileDialogBase)
 // wxFileDialog
 // ----------------------------------------------------------------------------
 
 // wxFileDialog
 // ----------------------------------------------------------------------------
 
-wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
-        const wxString& defaultDir, const wxString& defaultFileName,
-        const wxString& wildCard, long style, const wxPoint& pos)
-:   wxFileDialogBase(parent, message, defaultDir, defaultFileName,
-        wildCard, style, pos)
+wxFileDialog::wxFileDialog(wxWindow *parent,
+                           const wxString& message,
+                           const wxString& defaultDir,
+                           const wxString& defaultFileName,
+                           const wxString& wildCard,
+                           long style,
+                           const wxPoint& pos,
+                           const wxSize& sz,
+                           const wxString& name)
+            : wxFileDialogBase(parent, message, defaultDir, defaultFileName,
+                               wildCard, style, pos, sz, name)
 {
     wxTopLevelWindows.Append(this);
 
 {
     wxTopLevelWindows.Append(this);
 
@@ -67,7 +75,7 @@ wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
 
     //If the user requests to save - use a NSSavePanel
     //else use a NSOpenPanel
 
     //If the user requests to save - use a NSSavePanel
     //else use a NSOpenPanel
-    if (m_dialogStyle & wxSAVE)
+    if (HasFlag(wxFD_SAVE))
     {
         SetNSPanel([NSSavePanel savePanel]);
 
     {
         SetNSPanel([NSSavePanel savePanel]);
 
@@ -86,12 +94,12 @@ wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
         // dialogs are all that useful, anyway :)
         //
     }
         // dialogs are all that useful, anyway :)
         //
     }
-    else //m_dialogStyle & wxOPEN
+    else //m_dialogStyle & wxFD_OPEN
     {
         SetNSPanel([NSOpenPanel openPanel]);
         [m_cocoaNSWindow setTitle:wxNSStringWithWxString(message)];
 
     {
         SetNSPanel([NSOpenPanel openPanel]);
         [m_cocoaNSWindow setTitle:wxNSStringWithWxString(message)];
 
-        [(NSOpenPanel*)m_cocoaNSWindow setAllowsMultipleSelection:(m_dialogStyle & wxMULTIPLE)];
+        [(NSOpenPanel*)m_cocoaNSWindow setAllowsMultipleSelection:(HasFlag(wxFD_MULTIPLE))];
         [(NSOpenPanel*)m_cocoaNSWindow setResolvesAliases:YES];
         [(NSOpenPanel*)m_cocoaNSWindow setCanChooseFiles:YES];
         [(NSOpenPanel*)m_cocoaNSWindow setCanChooseDirectories:NO];
         [(NSOpenPanel*)m_cocoaNSWindow setResolvesAliases:YES];
         [(NSOpenPanel*)m_cocoaNSWindow setCanChooseFiles:YES];
         [(NSOpenPanel*)m_cocoaNSWindow setCanChooseDirectories:NO];
@@ -181,7 +189,7 @@ void wxFileDialog::GetFilenames(wxArrayString& files) const
 void wxFileDialog::SetPath(const wxString& path)
 {
     wxString ext;
 void wxFileDialog::SetPath(const wxString& path)
 {
     wxString ext;
-    wxSplitPath(path, &m_dir, &m_fileName, &ext);
+    wxFileName::SplitPath(path, &m_dir, &m_fileName, &ext);
     if ( !ext.empty() )
         m_fileName << _T('.') << ext;
 }
     if ( !ext.empty() )
         m_fileName << _T('.') << ext;
 }
@@ -194,7 +202,7 @@ int wxFileDialog::ShowModal()
 
     int nResult;
 
 
     int nResult;
 
-    if (m_dialogStyle & wxSAVE)
+    if (HasFlag(wxFD_SAVE))
     {
         nResult = [GetNSSavePanel()
                     runModalForDirectory:wxNSStringWithWxString(m_dir)
     {
         nResult = [GetNSSavePanel()
                     runModalForDirectory:wxNSStringWithWxString(m_dir)
@@ -206,7 +214,7 @@ int wxFileDialog::ShowModal()
             m_path = m_fileNames[0];
         }
     }
             m_path = m_fileNames[0];
         }
     }
-    else //m_dialogStyle & wxOPEN
+    else //m_dialogStyle & wxFD_OPEN
     {
         nResult = [(NSOpenPanel*)m_cocoaNSWindow
                     runModalForDirectory:wxNSStringWithWxString(m_dir)
     {
         nResult = [(NSOpenPanel*)m_cocoaNSWindow
                     runModalForDirectory:wxNSStringWithWxString(m_dir)
@@ -228,4 +236,3 @@ int wxFileDialog::ShowModal()
 }
 
 #endif // wxUSE_FILEDLG
 }
 
 #endif // wxUSE_FILEDLG
-