Fix MSVC14 warnings about a shadowed variable in the printing sample.
Just to suppress some harmless warnings.
This commit is contained in:
@@ -700,20 +700,20 @@ void MyPrintout::DrawPageTwo()
|
|||||||
{ // GetTextExtent demo:
|
{ // GetTextExtent demo:
|
||||||
wxString words[7] = { wxT("This "), wxT("is "), wxT("GetTextExtent "),
|
wxString words[7] = { wxT("This "), wxT("is "), wxT("GetTextExtent "),
|
||||||
wxT("testing "), wxT("string. "), wxT("Enjoy "), wxT("it!") };
|
wxT("testing "), wxT("string. "), wxT("Enjoy "), wxT("it!") };
|
||||||
wxCoord w, h;
|
|
||||||
long x = 200, y= 250;
|
long x = 200, y= 250;
|
||||||
|
|
||||||
dc->SetFont(wxFontInfo(15).Family(wxFONTFAMILY_SWISS));
|
dc->SetFont(wxFontInfo(15).Family(wxFONTFAMILY_SWISS));
|
||||||
|
|
||||||
for (int i = 0; i < 7; i++)
|
for (int i = 0; i < 7; i++)
|
||||||
{
|
{
|
||||||
|
wxCoord wordWidth, wordHeight;
|
||||||
wxString word = words[i];
|
wxString word = words[i];
|
||||||
word.Remove( word.Len()-1, 1 );
|
word.Remove( word.Len()-1, 1 );
|
||||||
dc->GetTextExtent(word, &w, &h);
|
dc->GetTextExtent(word, &wordWidth, &wordHeight);
|
||||||
dc->DrawRectangle(x, y, w, h);
|
dc->DrawRectangle(x, y, wordWidth, wordHeight);
|
||||||
dc->GetTextExtent(words[i], &w, &h);
|
dc->GetTextExtent(words[i], &wordWidth, &wordHeight);
|
||||||
dc->DrawText(words[i], x, y);
|
dc->DrawText(words[i], x, y);
|
||||||
x += w;
|
x += wordWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user