added wxGetFontFromUser() similar to wxGetColourFromUser()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13723 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -82,6 +82,7 @@ All (GUI):
|
|||||||
- support for multiple images in one file added to wxImage (TIFF and ICO formats)
|
- support for multiple images in one file added to wxImage (TIFF and ICO formats)
|
||||||
- support for CUR and ANI files in wxImage added (Chris Elliott)
|
- support for CUR and ANI files in wxImage added (Chris Elliott)
|
||||||
- wxTextCtrl::GetRange() added
|
- wxTextCtrl::GetRange() added
|
||||||
|
- added wxGetFontFromUser() convenience function
|
||||||
|
|
||||||
wxMSW:
|
wxMSW:
|
||||||
|
|
||||||
|
@@ -15,6 +15,11 @@
|
|||||||
# include "wx/os2/fontdlg.h"
|
# include "wx/os2/fontdlg.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// get the colour from user and return it
|
||||||
|
wxFont WXDLLEXPORT
|
||||||
|
wxGetFontFromUser(wxWindow *parent = (wxWindow *)NULL,
|
||||||
|
const wxFont& fontInit = wxNullFont);
|
||||||
|
|
||||||
#endif // wxUSE_FONTDLG
|
#endif // wxUSE_FONTDLG
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -68,6 +68,7 @@
|
|||||||
|
|
||||||
#if wxUSE_GUI
|
#if wxUSE_GUI
|
||||||
#include "wx/colordlg.h"
|
#include "wx/colordlg.h"
|
||||||
|
#include "wx/fontdlg.h"
|
||||||
#include "wx/notebook.h"
|
#include "wx/notebook.h"
|
||||||
#include "wx/frame.h"
|
#include "wx/frame.h"
|
||||||
#include "wx/statusbr.h"
|
#include "wx/statusbr.h"
|
||||||
@@ -982,6 +983,28 @@ wxColour wxGetColourFromUser(wxWindow *parent, const wxColour& colInit)
|
|||||||
|
|
||||||
#endif // wxUSE_COLOURDLG
|
#endif // wxUSE_COLOURDLG
|
||||||
|
|
||||||
|
#if wxUSE_FONTDLG
|
||||||
|
|
||||||
|
wxFont wxGetFontFromUser(wxWindow *parent, const wxFont& fontInit)
|
||||||
|
{
|
||||||
|
wxFontData data;
|
||||||
|
if ( fontInit.Ok() )
|
||||||
|
{
|
||||||
|
data.SetInitialFont(fontInit);
|
||||||
|
}
|
||||||
|
|
||||||
|
wxFont fontRet;
|
||||||
|
wxFontDialog dialog(parent, &data);
|
||||||
|
if ( dialog.ShowModal() == wxID_OK )
|
||||||
|
{
|
||||||
|
fontRet = dialog.GetFontData().GetChosenFont();
|
||||||
|
}
|
||||||
|
//else: leave it invalid
|
||||||
|
|
||||||
|
return fontRet;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // wxUSE_FONTDLG
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// missing C RTL functions (FIXME shouldn't be here at all)
|
// missing C RTL functions (FIXME shouldn't be here at all)
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user