]> git.saurik.com Git - wxWidgets.git/commit - src/gtk/font.cpp
Add wxFontInfo class to allow using named parameters for wxFont creation.
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 30 Apr 2013 10:27:38 +0000 (10:27 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 30 Apr 2013 10:27:38 +0000 (10:27 +0000)
commitb960795ea82b702f302e99e547416cb573865413
tree2666dfcf9574e3060b3d9d79537b0106451af94d
parent659ca93c425faabda30fce9dee68b38cb6868d14
Add wxFontInfo class to allow using named parameters for wxFont creation.

This helper class allows to create wxFonts using shorter and more readable
code, e.g.

wxFont font(12, wxFONTFLAG_DEFAULT,
    wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, true,
    "DejaVu Sans");

can now be written simply as

wxFont font(wxFontInfo(12).FaceName("DejaVu Sans").Underlined());

Remove the ctor from font flags added in r70445 as it's not needed any longer
now that we have this one and adding it resulted in compilation errors in the
existing code which compiled with 2.8 because of ambiguities between that ctor
and wxFont(int size, int family, int style, int weight. bool underlined, ...)
one, e.g.

wxFont(12, wxFONTFAMILY_SWISS, wxNORMAL, wxNORMAL)

didn't compile any more but it does compile again now.

See #9907.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73885 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
15 files changed:
docs/changes.txt
include/wx/cocoa/font.h
include/wx/dfb/font.h
include/wx/font.h
include/wx/gtk/font.h
include/wx/gtk1/font.h
include/wx/motif/font.h
include/wx/msw/font.h
include/wx/os2/font.h
include/wx/osx/font.h
include/wx/x11/font.h
interface/wx/font.h
samples/font/font.cpp
src/gtk/font.cpp
src/msw/font.cpp