]> git.saurik.com Git - wxWidgets.git/blobdiff - src/cocoa/filedlg.mm
missing commit
[wxWidgets.git] / src / cocoa / filedlg.mm
index 0070821f25602d7ae8fbd74c0aaa90e9fa450c73..e953896a7b79d264ac34eb2a5f344b6dcfe11cde 100644 (file)
@@ -33,6 +33,7 @@
 
 #include "wx/cocoa/autorelease.h"
 #include "wx/cocoa/string.h"
 
 #include "wx/cocoa/autorelease.h"
 #include "wx/cocoa/string.h"
+#include "wx/modalhook.h"
 
 #import <AppKit/NSOpenPanel.h>
 #import <AppKit/NSSavePanel.h>
 
 #import <AppKit/NSOpenPanel.h>
 #import <AppKit/NSSavePanel.h>
@@ -48,11 +49,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);
 
@@ -69,7 +76,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 & wxFD_SAVE)
+    if (HasFlag(wxFD_SAVE))
     {
         SetNSPanel([NSSavePanel savePanel]);
 
     {
         SetNSPanel([NSSavePanel savePanel]);
 
@@ -93,7 +100,7 @@ wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
         SetNSPanel([NSOpenPanel openPanel]);
         [m_cocoaNSWindow setTitle:wxNSStringWithWxString(message)];
 
         SetNSPanel([NSOpenPanel openPanel]);
         [m_cocoaNSWindow setTitle:wxNSStringWithWxString(message)];
 
-        [(NSOpenPanel*)m_cocoaNSWindow setAllowsMultipleSelection:(m_dialogStyle & wxFD_MULTIPLE)];
+        [(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];
@@ -162,8 +169,8 @@ void wxFileDialog::GetPaths(wxArrayString& paths) const
     paths.Empty();
 
     wxString dir(m_dir);
     paths.Empty();
 
     wxString dir(m_dir);
-    if ( m_dir.Last() != _T('\\') )
-        dir += _T('\\');
+    if ( m_dir.Last() != wxT('\\') )
+        dir += wxT('\\');
 
     size_t count = m_fileNames.GetCount();
     for ( size_t n = 0; n < count; n++ )
 
     size_t count = m_fileNames.GetCount();
     for ( size_t n = 0; n < count; n++ )
@@ -183,20 +190,22 @@ 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() )
     if ( !ext.empty() )
-        m_fileName << _T('.') << ext;
+        m_fileName << wxT('.') << ext;
 }
 
 int wxFileDialog::ShowModal()
 {
 }
 
 int wxFileDialog::ShowModal()
 {
+    WX_HOOK_MODAL_DIALOG();
+
     wxAutoNSAutoreleasePool thePool;
 
     m_fileNames.Empty();
 
     int nResult;
 
     wxAutoNSAutoreleasePool thePool;
 
     m_fileNames.Empty();
 
     int nResult;
 
-    if (m_dialogStyle & wxFD_SAVE)
+    if (HasFlag(wxFD_SAVE))
     {
         nResult = [GetNSSavePanel()
                     runModalForDirectory:wxNSStringWithWxString(m_dir)
     {
         nResult = [GetNSSavePanel()
                     runModalForDirectory:wxNSStringWithWxString(m_dir)