X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1ab440bc203fc700744039abdcff12bdd6ac6f0a..06a32e049c1bad9249079ad2e91659303424a774:/src/cocoa/dirdlg.mm diff --git a/src/cocoa/dirdlg.mm b/src/cocoa/dirdlg.mm index 69112c5bc8..bc4613aa22 100644 --- a/src/cocoa/dirdlg.mm +++ b/src/cocoa/dirdlg.mm @@ -31,6 +31,7 @@ #endif #include "wx/filename.h" +#include "wx/testing.h" #include "wx/cocoa/autorelease.h" #include "wx/cocoa/string.h" @@ -56,7 +57,8 @@ wxDirDialog::wxDirDialog(wxWindow *parent, const wxString& message, wxTopLevelWindows.Append(this); m_message = message; - m_dialogStyle = style; + + SetWindowStyle(style); m_parent = parent; m_path = defaultPath; @@ -70,7 +72,7 @@ wxDirDialog::wxDirDialog(wxWindow *parent, const wxString& message, //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]); @@ -91,7 +93,7 @@ wxDirDialog::wxDirDialog(wxWindow *parent, const wxString& message, [GetNSSavePanel() setPrompt:@"Open"]; } - if (m_dialogStyle & wxDD_NEW_DIR_BUTTON) //m_dialogStyle & wxDD_NEW_DIR_BUTTON + if (HasFlag(wxDD_NEW_DIR_BUTTON)) //m_dialogStyle & wxDD_NEW_DIR_BUTTON { [(NSOpenPanel*)m_cocoaNSWindow setCanCreateDirectories:YES]; } @@ -103,13 +105,15 @@ wxDirDialog::~wxDirDialog() int wxDirDialog::ShowModal() { + WX_TESTING_SHOW_MODAL_HOOK(); + wxAutoNSAutoreleasePool thePool; m_fileNames.Empty(); int nResult; - if (m_dialogStyle & wxFD_SAVE) + if (HasFlag(wxFD_SAVE)) { nResult = [GetNSSavePanel() runModalForDirectory:wxNSStringWithWxString(m_dir)