making cocoa build again
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40007 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
9804d5404a
commit
747592e7cb
@ -61,7 +61,21 @@ public:
|
|||||||
|
|
||||||
// Set() functions
|
// Set() functions
|
||||||
void Set( WX_NSColor aColor );
|
void Set( WX_NSColor aColor );
|
||||||
|
|
||||||
|
// reroute the inherited ones
|
||||||
|
void Set(unsigned char red, unsigned char green, unsigned char blue)
|
||||||
|
{ wxColourBase::Set(red,green,blue); }
|
||||||
|
|
||||||
|
// implemented in colourcmn.cpp
|
||||||
|
bool Set(const wxChar *str)
|
||||||
|
{ return wxColourBase::Set(str); }
|
||||||
|
|
||||||
|
bool Set(const wxString &str)
|
||||||
|
{ return wxColourBase::Set(str); }
|
||||||
|
|
||||||
|
void Set(unsigned long colRGB)
|
||||||
|
{ wxColourBase::Set(colRGB); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// puts the object in an invalid, uninitialized state
|
// puts the object in an invalid, uninitialized state
|
||||||
void Init();
|
void Init();
|
||||||
|
@ -56,7 +56,8 @@ wxDirDialog::wxDirDialog(wxWindow *parent, const wxString& message,
|
|||||||
wxTopLevelWindows.Append(this);
|
wxTopLevelWindows.Append(this);
|
||||||
|
|
||||||
m_message = message;
|
m_message = message;
|
||||||
m_dialogStyle = style;
|
|
||||||
|
SetWindowStyle(style);
|
||||||
m_parent = parent;
|
m_parent = parent;
|
||||||
m_path = defaultPath;
|
m_path = defaultPath;
|
||||||
|
|
||||||
@ -70,7 +71,7 @@ wxDirDialog::wxDirDialog(wxWindow *parent, const wxString& message,
|
|||||||
|
|
||||||
//If the user requests to save - use a NSSavePanel
|
//If the user requests to save - use a NSSavePanel
|
||||||
//else use a NSOpenPanel
|
//else use a NSOpenPanel
|
||||||
if (m_dialogStyle & wxFD_SAVE)
|
if (HasFlag(wxFD_SAVE))
|
||||||
{
|
{
|
||||||
SetNSPanel([NSSavePanel savePanel]);
|
SetNSPanel([NSSavePanel savePanel]);
|
||||||
|
|
||||||
@ -91,7 +92,7 @@ wxDirDialog::wxDirDialog(wxWindow *parent, const wxString& message,
|
|||||||
[GetNSSavePanel() setPrompt:@"Open"];
|
[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];
|
[(NSOpenPanel*)m_cocoaNSWindow setCanCreateDirectories:YES];
|
||||||
}
|
}
|
||||||
@ -109,7 +110,7 @@ int wxDirDialog::ShowModal()
|
|||||||
|
|
||||||
int nResult;
|
int nResult;
|
||||||
|
|
||||||
if (m_dialogStyle & wxFD_SAVE)
|
if (HasFlag(wxFD_SAVE))
|
||||||
{
|
{
|
||||||
nResult = [GetNSSavePanel()
|
nResult = [GetNSSavePanel()
|
||||||
runModalForDirectory:wxNSStringWithWxString(m_dir)
|
runModalForDirectory:wxNSStringWithWxString(m_dir)
|
||||||
|
@ -48,11 +48,17 @@ IMPLEMENT_CLASS(wxCocoaFileDialog, wxFileDialogBase)
|
|||||||
// wxFileDialog
|
// wxFileDialog
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
|
wxFileDialog::wxFileDialog(wxWindow *parent,
|
||||||
const wxString& defaultDir, const wxString& defaultFileName,
|
const wxString& message,
|
||||||
const wxString& wildCard, long style, const wxPoint& pos)
|
const wxString& defaultDir,
|
||||||
: wxFileDialogBase(parent, message, defaultDir, defaultFileName,
|
const wxString& defaultFileName,
|
||||||
wildCard, style, pos)
|
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 +75,7 @@ wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
|
|||||||
|
|
||||||
//If the user requests to save - use a NSSavePanel
|
//If the user requests to save - use a NSSavePanel
|
||||||
//else use a NSOpenPanel
|
//else use a NSOpenPanel
|
||||||
if (m_dialogStyle & wxFD_SAVE)
|
if (HasFlag(wxFD_SAVE))
|
||||||
{
|
{
|
||||||
SetNSPanel([NSSavePanel savePanel]);
|
SetNSPanel([NSSavePanel savePanel]);
|
||||||
|
|
||||||
@ -93,7 +99,7 @@ wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
|
|||||||
SetNSPanel([NSOpenPanel openPanel]);
|
SetNSPanel([NSOpenPanel openPanel]);
|
||||||
[m_cocoaNSWindow setTitle:wxNSStringWithWxString(message)];
|
[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 setResolvesAliases:YES];
|
||||||
[(NSOpenPanel*)m_cocoaNSWindow setCanChooseFiles:YES];
|
[(NSOpenPanel*)m_cocoaNSWindow setCanChooseFiles:YES];
|
||||||
[(NSOpenPanel*)m_cocoaNSWindow setCanChooseDirectories:NO];
|
[(NSOpenPanel*)m_cocoaNSWindow setCanChooseDirectories:NO];
|
||||||
@ -196,7 +202,7 @@ int wxFileDialog::ShowModal()
|
|||||||
|
|
||||||
int nResult;
|
int nResult;
|
||||||
|
|
||||||
if (m_dialogStyle & wxFD_SAVE)
|
if (HasFlag(wxFD_SAVE))
|
||||||
{
|
{
|
||||||
nResult = [GetNSSavePanel()
|
nResult = [GetNSSavePanel()
|
||||||
runModalForDirectory:wxNSStringWithWxString(m_dir)
|
runModalForDirectory:wxNSStringWithWxString(m_dir)
|
||||||
|
@ -109,6 +109,7 @@ wxString wxStandardPathsCF::GetFromFunc(wxCFURLRef (*func)(wxCFBundleRef)) const
|
|||||||
|
|
||||||
wxString wxStandardPathsCF::GetDocumentsDir() const
|
wxString wxStandardPathsCF::GetDocumentsDir() const
|
||||||
{
|
{
|
||||||
|
#ifdef __WXMAC__
|
||||||
return wxMacFindFolderNoSeparator
|
return wxMacFindFolderNoSeparator
|
||||||
(
|
(
|
||||||
#if TARGET_API_MAC_OSX
|
#if TARGET_API_MAC_OSX
|
||||||
@ -119,6 +120,9 @@ wxString wxStandardPathsCF::GetDocumentsDir() const
|
|||||||
kDocumentsFolderType,
|
kDocumentsFolderType,
|
||||||
kCreateFolder
|
kCreateFolder
|
||||||
);
|
);
|
||||||
|
#else
|
||||||
|
return wxFileName::GetHomeDir() + wxT("/Documents");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user