move wxGet{Colour,Font}FromUser() out of utilscmn.cpp so they don't have to be in every app that links statically

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73066 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Paul Cornett
2012-11-30 06:56:50 +00:00
parent dab61056c8
commit f81bc2ba5e
3 changed files with 86 additions and 85 deletions

View File

@@ -67,3 +67,29 @@ wxFontData& wxFontData::operator=(const wxFontData& data)
return *this;
}
#endif // wxUSE_FONTDLG || wxUSE_FONTPICKERCTRL
#if wxUSE_FONTDLG
#include "wx/fontdlg.h"
wxFont wxGetFontFromUser(wxWindow *parent, const wxFont& fontInit, const wxString& caption)
{
wxFontData data;
if ( fontInit.IsOk() )
{
data.SetInitialFont(fontInit);
}
wxFont fontRet;
wxFontDialog dialog(parent, data);
if (!caption.empty())
dialog.SetTitle(caption);
if ( dialog.ShowModal() == wxID_OK )
{
fontRet = dialog.GetFontData().GetChosenFont();
}
//else: leave it invalid
return fontRet;
}
#endif // wxUSE_FONTDLG