]> git.saurik.com Git - wxWidgets.git/commitdiff
Added caption parameter to wxGetFontFromUser and wxGetColourFromUser.
authorJulian Smart <julian@anthemion.co.uk>
Mon, 2 Jan 2006 14:26:36 +0000 (14:26 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Mon, 2 Jan 2006 14:26:36 +0000 (14:26 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36623 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
docs/latex/wx/function.tex
include/wx/colordlg.h
include/wx/fontdlg.h
src/common/utilscmn.cpp

index 3b115f5e134c338ed1ddf700ca98863455a121c2..db153c5031cbd75c6b66393fd5c8116fc6d94d28 100644 (file)
@@ -44,6 +44,7 @@ All (GUI):
 - Added space after list item number in wxHTML.
 - Implemented <sub> and <sup> handling in wxHTML (based on patch
   by Sandro Sigala)
 - Added space after list item number in wxHTML.
 - Implemented <sub> and <sup> handling in wxHTML (based on patch
   by Sandro Sigala)
+- Added caption parameter to wxGetFontFromUser and wxGetColourFromUser.
 
 wxMSW:
 
 
 wxMSW:
 
index 98e11967dc0ca7fc688753ab96068bcb1651dc0a..cc3f336e885d5ff39a6923b7f4be48522994d924 100644 (file)
@@ -1904,7 +1904,7 @@ See also \helpref{wxIsBusy}{wxisbusy}, \helpref{wxBusyCursor}{wxbusycursor}.
 
 \membersection{::wxGetColourFromUser}\label{wxgetcolourfromuser}
 
 
 \membersection{::wxGetColourFromUser}\label{wxgetcolourfromuser}
 
-\func{wxColour}{wxGetColourFromUser}{\param{wxWindow *}{parent}, \param{const wxColour\& }{colInit}}
+\func{wxColour}{wxGetColourFromUser}{\param{wxWindow *}{parent}, \param{const wxColour\& }{colInit}, \param{const wxString\& }{caption = wxEmptyString}}
 
 Shows the colour selection dialog and returns the colour selected by user or
 invalid colour (use \helpref{wxColour::Ok}{wxcolourok} to test whether a colour
 
 Shows the colour selection dialog and returns the colour selected by user or
 invalid colour (use \helpref{wxColour::Ok}{wxcolourok} to test whether a colour
@@ -1916,6 +1916,8 @@ is valid) if the dialog was cancelled.
 
 \docparam{colInit}{If given, this will be the colour initially selected in the dialog.}
 
 
 \docparam{colInit}{If given, this will be the colour initially selected in the dialog.}
 
+\docparam{caption}{If given, this will be used for the dialog caption.}
+
 \wxheading{Include files}
 
 <wx/colordlg.h>
 \wxheading{Include files}
 
 <wx/colordlg.h>
@@ -1923,7 +1925,7 @@ is valid) if the dialog was cancelled.
 
 \membersection{::wxGetFontFromUser}\label{wxgetfontfromuser}
 
 
 \membersection{::wxGetFontFromUser}\label{wxgetfontfromuser}
 
-\func{wxFont}{wxGetFontFromUser}{\param{wxWindow *}{parent}, \param{const wxFont\& }{fontInit}}
+\func{wxFont}{wxGetFontFromUser}{\param{wxWindow *}{parent}, \param{const wxFont\& }{fontInit}, \param{const wxString\& }{caption = wxEmptyString}}
 
 Shows the font selection dialog and returns the font selected by user or
 invalid font (use \helpref{wxFont::Ok}{wxfontok} to test whether a font
 
 Shows the font selection dialog and returns the font selected by user or
 invalid font (use \helpref{wxFont::Ok}{wxfontok} to test whether a font
@@ -1935,6 +1937,8 @@ is valid) if the dialog was cancelled.
 
 \docparam{fontInit}{If given, this will be the font initially selected in the dialog.}
 
 
 \docparam{fontInit}{If given, this will be the font initially selected in the dialog.}
 
+\docparam{caption}{If given, this will be used for the dialog caption.}
+
 \wxheading{Include files}
 
 <wx/fontdlg.h>
 \wxheading{Include files}
 
 <wx/fontdlg.h>
index 6992910c67a7539b6e8cf1f81d1053a9dfa9f882..8fb0ff6af241fa48908285c70ee0e5d5fcf1cf87 100644 (file)
@@ -33,7 +33,7 @@
 // get the colour from user and return it
 wxColour WXDLLEXPORT
 wxGetColourFromUser(wxWindow *parent = (wxWindow *)NULL,
 // get the colour from user and return it
 wxColour WXDLLEXPORT
 wxGetColourFromUser(wxWindow *parent = (wxWindow *)NULL,
-                    const wxColour& colInit = wxNullColour);
+                    const wxColour& colInit = wxNullColour, const wxString& caption = wxEmptyString);
 
 #endif // wxUSE_COLOURDLG
 
 
 #endif // wxUSE_COLOURDLG
 
index e0d5c8209ff74dc88aa7682a15474f833a3c341b..26dc4924f41260c350b35a131e4ae64aaf3296ec 100644 (file)
@@ -102,7 +102,7 @@ protected:
 // cancelled
 wxFont WXDLLEXPORT
 wxGetFontFromUser(wxWindow *parent = (wxWindow *)NULL,
 // cancelled
 wxFont WXDLLEXPORT
 wxGetFontFromUser(wxWindow *parent = (wxWindow *)NULL,
-                  const wxFont& fontInit = wxNullFont);
+                  const wxFont& fontInit = wxNullFont, const wxString& caption = wxEmptyString);
 
 #endif // wxUSE_FONTDLG
 
 
 #endif // wxUSE_FONTDLG
 
index b048ccd3c6e617ebffabefdb593d7a95d3b15872..c0d7e529c8f6a2c36421e8c99e1841b373cb9585 100644 (file)
 #include "wx/msw/wince/time.h"
 #endif
 
 #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 <sys/types.h>
     #include <sys/stat.h>
 #if !defined(__MWERKS__) && !defined(__WXWINCE__)
     #include <sys/types.h>
     #include <sys/stat.h>
@@ -607,6 +614,34 @@ bool wxLaunchDefaultBrowser(const wxString& urlOrig, int flags)
 #endif // __WXDEBUG__
         return true;
     }
 #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"));
 #elif wxUSE_MIMETYPE
     // Non-windows way
     wxFileType *ft = wxTheMimeTypesManager->GetFileTypeFromExtension (_T("html"));
@@ -954,7 +989,7 @@ wxString wxGetPasswordFromUser(const wxString& message,
 
 #if wxUSE_COLOURDLG
 
 
 #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);
 {
     wxColourData data;
     data.SetChooseFull(true);
@@ -965,6 +1000,8 @@ wxColour wxGetColourFromUser(wxWindow *parent, const wxColour& colInit)
 
     wxColour colRet;
     wxColourDialog dialog(parent, &data);
 
     wxColour colRet;
     wxColourDialog dialog(parent, &data);
+    if (!caption.IsEmpty())
+        dialog.SetTitle(caption);
     if ( dialog.ShowModal() == wxID_OK )
     {
         colRet = dialog.GetColourData().GetColour();
     if ( dialog.ShowModal() == wxID_OK )
     {
         colRet = dialog.GetColourData().GetColour();
@@ -978,7 +1015,7 @@ wxColour wxGetColourFromUser(wxWindow *parent, const wxColour& colInit)
 
 #if wxUSE_FONTDLG
 
 
 #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() )
 {
     wxFontData data;
     if ( fontInit.Ok() )
@@ -988,6 +1025,8 @@ wxFont wxGetFontFromUser(wxWindow *parent, const wxFont& fontInit)
 
     wxFont fontRet;
     wxFontDialog dialog(parent, data);
 
     wxFont fontRet;
     wxFontDialog dialog(parent, data);
+    if (!caption.IsEmpty())
+        dialog.SetTitle(caption);
     if ( dialog.ShowModal() == wxID_OK )
     {
         fontRet = dialog.GetFontData().GetChosenFont();
     if ( dialog.ShowModal() == wxID_OK )
     {
         fontRet = dialog.GetFontData().GetChosenFont();