Don't use deprecated wxBOLD, wxNORMAL and similar constants.

Replace them with wxFONTWEIGHT_BOLD, wxFONTSTYLE_NORMAL or wxFONTWEIGHT_NORMAL
and equivalents in the code of the library itself and in the samples.

Also simplify font construction using wxFontInfo where possible to avoid
specifying these constants at all if they are not needed.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75590 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-01-11 14:25:30 +00:00
parent 7696081c90
commit d66e7af9aa
21 changed files with 192 additions and 198 deletions

View File

@@ -583,9 +583,9 @@ static const wxChar* const gs_fp_es_style_labels[] = {
};
static const long gs_fp_es_style_values[] = {
wxNORMAL,
wxSLANT,
wxITALIC
wxFONTSTYLE_NORMAL,
wxFONTSTYLE_SLANT,
wxFONTSTYLE_ITALIC
};
static const wxChar* const gs_fp_es_weight_labels[] = {
@@ -596,9 +596,9 @@ static const wxChar* const gs_fp_es_weight_labels[] = {
};
static const long gs_fp_es_weight_values[] = {
wxNORMAL,
wxLIGHT,
wxBOLD
wxFONTWEIGHT_NORMAL,
wxFONTWEIGHT_LIGHT,
wxFONTWEIGHT_BOLD
};
// Class body is in advprops.h
@@ -806,9 +806,7 @@ void wxFontProperty::OnCustomPaint(wxDC& dc,
dc.DrawRectangle( rect );
wxFont oldFont = dc.GetFont();
wxFont drawFont(oldFont.GetPointSize(),
wxDEFAULT,wxNORMAL,wxBOLD,false,drawFace);
dc.SetFont(drawFont);
dc.SetFont(wxFontInfo(oldFont.GetPointSize().Bold().FaceName(drawFace));
dc.SetTextForeground( wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT) );
dc.DrawText( wxT("Aa"), rect.x+2, rect.y+1 );