From: Stefan Csomor Date: Wed, 5 Jul 2006 13:10:46 +0000 (+0000) Subject: making cocoa build again X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/747592e7cb116a051e0964860a7e03a297704574 making cocoa build again git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40007 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/cocoa/colour.h b/include/wx/cocoa/colour.h index db7a4e9444..f0e3829a73 100644 --- a/include/wx/cocoa/colour.h +++ b/include/wx/cocoa/colour.h @@ -61,7 +61,21 @@ public: // Set() functions 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: // puts the object in an invalid, uninitialized state void Init(); diff --git a/src/cocoa/dirdlg.mm b/src/cocoa/dirdlg.mm index 69112c5bc8..1c3c95d8a5 100644 --- a/src/cocoa/dirdlg.mm +++ b/src/cocoa/dirdlg.mm @@ -56,7 +56,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 +71,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 +92,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]; } @@ -109,7 +110,7 @@ int wxDirDialog::ShowModal() int nResult; - if (m_dialogStyle & wxFD_SAVE) + if (HasFlag(wxFD_SAVE)) { nResult = [GetNSSavePanel() runModalForDirectory:wxNSStringWithWxString(m_dir) diff --git a/src/cocoa/filedlg.mm b/src/cocoa/filedlg.mm index 0070821f25..57a8a2fbaf 100644 --- a/src/cocoa/filedlg.mm +++ b/src/cocoa/filedlg.mm @@ -48,11 +48,17 @@ IMPLEMENT_CLASS(wxCocoaFileDialog, wxFileDialogBase) // 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); @@ -69,7 +75,7 @@ wxFileDialog::wxFileDialog(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]); @@ -93,7 +99,7 @@ wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& 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]; @@ -196,7 +202,7 @@ int wxFileDialog::ShowModal() int nResult; - if (m_dialogStyle & wxFD_SAVE) + if (HasFlag(wxFD_SAVE)) { nResult = [GetNSSavePanel() runModalForDirectory:wxNSStringWithWxString(m_dir) diff --git a/src/mac/corefoundation/stdpaths_cf.cpp b/src/mac/corefoundation/stdpaths_cf.cpp index 2b2cf9cba0..d4068cc2fa 100644 --- a/src/mac/corefoundation/stdpaths_cf.cpp +++ b/src/mac/corefoundation/stdpaths_cf.cpp @@ -109,6 +109,7 @@ wxString wxStandardPathsCF::GetFromFunc(wxCFURLRef (*func)(wxCFBundleRef)) const wxString wxStandardPathsCF::GetDocumentsDir() const { +#ifdef __WXMAC__ return wxMacFindFolderNoSeparator ( #if TARGET_API_MAC_OSX @@ -119,6 +120,9 @@ wxString wxStandardPathsCF::GetDocumentsDir() const kDocumentsFolderType, kCreateFolder ); +#else + return wxFileName::GetHomeDir() + wxT("/Documents"); +#endif } // ----------------------------------------------------------------------------