Fix warnings and modernize demo code
Fix wxFont, wxPen and wxBrush style deprecation warnings. Add wxFALLTHROUGH to resolve implicit fallthrough warnings in switch statements. Fix build error when using long for GetTextExtent (with wxUSE_GRID 0). Remove unused icon from fractal demo.
This commit is contained in:
@@ -127,9 +127,7 @@ void Card::SetScale(double scale)
|
||||
void Card::Erase(wxDC& dc, int x, int y)
|
||||
{
|
||||
wxPen* pen = wxThePenList->FindOrCreatePen(
|
||||
FortyApp::BackgroundColour(),
|
||||
1,
|
||||
wxSOLID
|
||||
FortyApp::BackgroundColour()
|
||||
);
|
||||
dc.SetPen(* pen);
|
||||
dc.SetBrush(FortyApp::BackgroundBrush());
|
||||
@@ -169,7 +167,7 @@ void Card::Draw(wxDC& dc, int x, int y)
|
||||
dc.SetBackground(* wxRED_BRUSH);
|
||||
dc.SetBackgroundMode(wxSOLID);
|
||||
wxBrush* brush = wxTheBrushList->FindOrCreateBrush(
|
||||
*wxBLACK, wxCROSSDIAG_HATCH
|
||||
*wxBLACK, wxBRUSHSTYLE_CROSSDIAG_HATCH
|
||||
);
|
||||
dc.SetBrush(* brush);
|
||||
|
||||
@@ -283,6 +281,7 @@ void Card::Draw(wxDC& dc, int x, int y)
|
||||
symsize * m_suit,
|
||||
sympos,
|
||||
wxCOPY);
|
||||
wxFALLTHROUGH;
|
||||
case 2:
|
||||
dc.Blit((wxCoord)(x - symdist + m_width / 2),
|
||||
(wxCoord)(y - symdist + m_height / 4),
|
||||
@@ -311,6 +310,7 @@ void Card::Draw(wxDC& dc, int x, int y)
|
||||
symsize * m_suit,
|
||||
sympos,
|
||||
wxCOPY);
|
||||
wxFALLTHROUGH;
|
||||
case 4:
|
||||
dc.Blit((wxCoord)(x - symdist + m_width / 4),
|
||||
(wxCoord)(y - symdist + m_height / 4),
|
||||
@@ -355,6 +355,7 @@ void Card::Draw(wxDC& dc, int x, int y)
|
||||
symsize * m_suit,
|
||||
sympos2,
|
||||
wxCOPY);
|
||||
wxFALLTHROUGH;
|
||||
case 7:
|
||||
dc.Blit((wxCoord)(x - symdist + 5 * m_width / 10),
|
||||
(wxCoord)(y - symdist + 3 * m_height / 8),
|
||||
@@ -364,6 +365,7 @@ void Card::Draw(wxDC& dc, int x, int y)
|
||||
symsize * m_suit,
|
||||
sympos,
|
||||
wxCOPY);
|
||||
wxFALLTHROUGH;
|
||||
case 6:
|
||||
dc.Blit((wxCoord)(x - symdist + m_width / 4),
|
||||
(wxCoord)(y - symdist + m_height / 4),
|
||||
@@ -421,6 +423,7 @@ void Card::Draw(wxDC& dc, int x, int y)
|
||||
symsize * m_suit,
|
||||
sympos2,
|
||||
wxCOPY);
|
||||
wxFALLTHROUGH;
|
||||
case 9:
|
||||
dc.Blit((wxCoord)(x - symdist + m_width / 4),
|
||||
(wxCoord)(y - symdist2 + m_height / 4),
|
||||
@@ -497,7 +500,9 @@ void Card::Draw(wxDC& dc, int x, int y)
|
||||
wxCOPY);
|
||||
break;
|
||||
case 11:
|
||||
wxFALLTHROUGH;
|
||||
case 12:
|
||||
wxFALLTHROUGH;
|
||||
case 13:
|
||||
memoryDC.SelectObject(*m_pictureBmap);
|
||||
int picwidth = 40,picheight = 45;
|
||||
@@ -544,7 +549,7 @@ void Card::Draw(wxDC& dc, int x, int y)
|
||||
//+-------------------------------------------------------------+
|
||||
void Card::DrawNullCard(wxDC& dc, int x, int y)
|
||||
{
|
||||
wxPen* pen = wxThePenList->FindOrCreatePen(FortyApp::TextColour(), 1, wxSOLID);
|
||||
wxPen* pen = wxThePenList->FindOrCreatePen(FortyApp::TextColour());
|
||||
dc.SetBrush(FortyApp::BackgroundBrush());
|
||||
dc.SetPen(*pen);
|
||||
dc.DrawRoundedRectangle(x, y, m_width, m_height, 4);
|
||||
|
Reference in New Issue
Block a user