#endif
#include "wx/filename.h"
+#include "wx/modalhook.h"
#include "wx/cocoa/autorelease.h"
#include "wx/cocoa/string.h"
wxTopLevelWindows.Append(this);
m_message = message;
- m_dialogStyle = style;
+
+ SetWindowStyle(style);
m_parent = parent;
m_path = defaultPath;
//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]);
[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];
}
int wxDirDialog::ShowModal()
{
+ WX_HOOK_MODAL_DIALOG();
+
wxAutoNSAutoreleasePool thePool;
m_fileNames.Empty();
int nResult;
- if (m_dialogStyle & wxFD_SAVE)
+ if (HasFlag(wxFD_SAVE))
{
nResult = [GetNSSavePanel()
runModalForDirectory:wxNSStringWithWxString(m_dir)