X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dee1a63ff52bfe4da396187f8438aa1a29796737..b93328d84228c097e125b0082b486da2aa0d1c22:/src/common/utilscmn.cpp diff --git a/src/common/utilscmn.cpp b/src/common/utilscmn.cpp index 0831170f37..c0d7e529c8 100644 --- a/src/common/utilscmn.cpp +++ b/src/common/utilscmn.cpp @@ -82,6 +82,13 @@ #include "wx/msw/wince/time.h" #endif +#ifdef __WXMAC__ +#include "wx/mac/private.h" +#ifndef __DARWIN__ +#include "InternetConfig.h" +#endif +#endif + #if !defined(__MWERKS__) && !defined(__WXWINCE__) #include #include @@ -526,6 +533,8 @@ bool wxLaunchDefaultBrowser(const wxString& urlOrig, int flags) url.Prepend(wxT("http://")); #if defined(__WXMSW__) + +#if wxUSE_IPC if ( flags & wxBROWSER_NEW_WINDOW ) { // ShellExecuteEx() opens the URL in an existing window by default so @@ -583,6 +592,7 @@ bool wxLaunchDefaultBrowser(const wxString& urlOrig, int flags) } } } +#endif // wxUSE_IPC WinStruct sei; sei.lpFile = url.c_str(); @@ -604,6 +614,34 @@ bool wxLaunchDefaultBrowser(const wxString& urlOrig, int flags) #endif // __WXDEBUG__ return true; } +#elif defined(__WXMAC__) + OSStatus err; + ICInstance inst; + SInt32 startSel; + SInt32 endSel; + + err = ICStart(&inst, 'STKA'); // put your app creator code here + if (err == noErr) { +#if !TARGET_CARBON + err = ICFindConfigFile(inst, 0, nil); +#endif + if (err == noErr) + { + ConstStr255Param hint = 0; + startSel = 0; + endSel = url.Length(); + err = ICLaunchURL(inst, hint, url.fn_str(), endSel, &startSel, &endSel); + if (err != noErr) + wxLogDebug(wxT("ICLaunchURL error %d"), (int) err); + } + ICStop(inst); + return true; + } + else + { + wxLogDebug(wxT("ICStart error %d"), (int) err); + return false; + } #elif wxUSE_MIMETYPE // Non-windows way wxFileType *ft = wxTheMimeTypesManager->GetFileTypeFromExtension (_T("html")); @@ -951,7 +989,7 @@ wxString wxGetPasswordFromUser(const wxString& message, #if wxUSE_COLOURDLG -wxColour wxGetColourFromUser(wxWindow *parent, const wxColour& colInit) +wxColour wxGetColourFromUser(wxWindow *parent, const wxColour& colInit, const wxString& caption) { wxColourData data; data.SetChooseFull(true); @@ -962,6 +1000,8 @@ wxColour wxGetColourFromUser(wxWindow *parent, const wxColour& colInit) wxColour colRet; wxColourDialog dialog(parent, &data); + if (!caption.IsEmpty()) + dialog.SetTitle(caption); if ( dialog.ShowModal() == wxID_OK ) { colRet = dialog.GetColourData().GetColour(); @@ -975,7 +1015,7 @@ wxColour wxGetColourFromUser(wxWindow *parent, const wxColour& colInit) #if wxUSE_FONTDLG -wxFont wxGetFontFromUser(wxWindow *parent, const wxFont& fontInit) +wxFont wxGetFontFromUser(wxWindow *parent, const wxFont& fontInit, const wxString& caption) { wxFontData data; if ( fontInit.Ok() ) @@ -985,6 +1025,8 @@ wxFont wxGetFontFromUser(wxWindow *parent, const wxFont& fontInit) wxFont fontRet; wxFontDialog dialog(parent, data); + if (!caption.IsEmpty()) + dialog.SetTitle(caption); if ( dialog.ShowModal() == wxID_OK ) { fontRet = dialog.GetFontData().GetChosenFont();