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:
@@ -336,7 +336,6 @@ void MyCanvas::OnDraw(wxDC& dc)
|
||||
wxBrush wB;
|
||||
wxPoint points[6];
|
||||
wxColour wC;
|
||||
wxFont wF;
|
||||
|
||||
dc.SetFont(*wxSWISS_FONT);
|
||||
dc.SetPen(*wxGREEN_PEN);
|
||||
@@ -399,8 +398,10 @@ void MyCanvas::OnDraw(wxDC& dc)
|
||||
dc.DrawText(wxT("This is a Red string"), 50, 200);
|
||||
dc.DrawRotatedText(wxT("This is a 45 deg string"), 50, 200, 45);
|
||||
dc.DrawRotatedText(wxT("This is a 90 deg string"), 50, 200, 90);
|
||||
wF = wxFont ( 18, wxROMAN, wxITALIC, wxBOLD, false, wxT("Times New Roman"));
|
||||
dc.SetFont(wF);
|
||||
dc.SetFont(wxFontInfo(18)
|
||||
.FaceName("Times New Roman")
|
||||
.Family(wxFONTFAMILY_ROMAN)
|
||||
.Italic().Bold());
|
||||
dc.SetTextForeground (wC);
|
||||
dc.DrawText(wxT("This is a Times-style string"), 50, 60);
|
||||
#if wxUSE_STATUSBAR
|
||||
@@ -455,8 +456,10 @@ void MyCanvas::OnDraw(wxDC& dc)
|
||||
break;
|
||||
|
||||
case 5:
|
||||
wF = wxFont ( 18, wxROMAN, wxITALIC, wxBOLD, false, wxT("Times New Roman"));
|
||||
dc.SetFont(wF);
|
||||
dc.SetFont(wxFontInfo(18)
|
||||
.FaceName("Times New Roman")
|
||||
.Family(wxFONTFAMILY_ROMAN)
|
||||
.Italic().Bold());
|
||||
dc.DrawLine(0, 0, 200, 200);
|
||||
dc.DrawLine(200, 0, 0, 200);
|
||||
dc.DrawText(wxT("This is an 18pt string"), 50, 60);
|
||||
|
Reference in New Issue
Block a user