Fixes for deprecation and other warnings in samples and demos.

See https://github.com/wxWidgets/wxWidgets/pull/617
This commit is contained in:
Vadim Zeitlin
2017-11-26 17:30:49 +01:00
33 changed files with 233 additions and 198 deletions

View File

@@ -218,8 +218,7 @@ BombsCanvas::BombsCanvas(wxFrame *parent, BombsGame *game)
m_game = game; m_game = game;
int sx, sy; int sx, sy;
wxClientDC dc(this); wxClientDC dc(this);
wxFont font= BOMBS_FONT; dc.SetFont(BOMBS_FONT);
dc.SetFont(font);
wxCoord chw, chh; wxCoord chw, chh;
wxString buf = wxT("M"); wxString buf = wxT("M");

View File

@@ -118,7 +118,7 @@ private:
* BombsCanvas::x_cell and y_cell * BombsCanvas::x_cell and y_cell
*/ */
#define BOMBS_FONT wxFont(14, wxROMAN, wxNORMAL, wxNORMAL) #define BOMBS_FONT wxFont(wxFontInfo(14).Family(wxFONTFAMILY_ROMAN))
#endif // #ifndef _WX_DEMOS_BOMBS_BOMBS_H_ #endif // #ifndef _WX_DEMOS_BOMBS_BOMBS_H_

View File

@@ -33,14 +33,6 @@ void BombsCanvas::DrawField(wxDC *dc, int xc1, int yc1, int xc2, int yc2)
wxString buf; wxString buf;
wxCoord chw, chh; wxCoord chw, chh;
wxColour wxYellow = wxTheColourDatabase->Find(wxT("YELLOW"));
wxColour wxFocused = wxTheColourDatabase->Find(wxT("GREY"));
wxPen *bluePen = wxThePenList->FindOrCreatePen(*wxBLUE, 1, wxSOLID);
wxBrush *focusedBrush = wxTheBrushList->FindOrCreateBrush(wxFocused, wxSOLID);
wxBrush *yellowBrush = wxTheBrushList->FindOrCreateBrush(wxYellow, wxSOLID);
dc->SetPen(*wxBLACK_PEN); dc->SetPen(*wxBLACK_PEN);
int x, y; int x, y;
@@ -52,8 +44,7 @@ void BombsCanvas::DrawField(wxDC *dc, int xc1, int yc1, int xc2, int yc2)
dc->DrawLine(0, y*m_cellHeight*Y_UNIT, xMax, y*m_cellHeight*Y_UNIT); dc->DrawLine(0, y*m_cellHeight*Y_UNIT, xMax, y*m_cellHeight*Y_UNIT);
wxFont font= BOMBS_FONT; dc->SetFont(BOMBS_FONT);
dc->SetFont(font);
for(x=xc1; x<=xc2; x++) for(x=xc1; x<=xc2; x++)
for(y=yc1; y<=yc2; y++) for(y=yc1; y<=yc2; y++)
@@ -63,7 +54,7 @@ void BombsCanvas::DrawField(wxDC *dc, int xc1, int yc1, int xc2, int yc2)
dc->SetPen(*wxBLACK_PEN); dc->SetPen(*wxBLACK_PEN);
if (m_game->IsFocussed(x, y)) if (m_game->IsFocussed(x, y))
dc->SetBrush(*focusedBrush); dc->SetBrush(*wxMEDIUM_GREY_BRUSH);
else else
dc->SetBrush(*wxLIGHT_GREY_BRUSH); dc->SetBrush(*wxLIGHT_GREY_BRUSH);
@@ -94,7 +85,7 @@ void BombsCanvas::DrawField(wxDC *dc, int xc1, int yc1, int xc2, int yc2)
{ {
dc->SetPen(*wxBLACK_PEN); dc->SetPen(*wxBLACK_PEN);
if (m_game->IsFocussed(x, y)) if (m_game->IsFocussed(x, y))
dc->SetBrush(*focusedBrush); dc->SetBrush(*wxMEDIUM_GREY_BRUSH);
else else
dc->SetBrush(*wxLIGHT_GREY_BRUSH); dc->SetBrush(*wxLIGHT_GREY_BRUSH);
@@ -116,7 +107,7 @@ void BombsCanvas::DrawField(wxDC *dc, int xc1, int yc1, int xc2, int yc2)
y*m_cellHeight*Y_UNIT + (m_cellHeight*Y_UNIT-chh)/2); y*m_cellHeight*Y_UNIT + (m_cellHeight*Y_UNIT-chh)/2);
if (m_game->IsExploded(x,y)) if (m_game->IsExploded(x,y))
{ {
dc->SetPen(*bluePen); dc->SetPen(*wxBLUE_PEN);
dc->DrawLine(x*m_cellWidth*X_UNIT, y*m_cellHeight*Y_UNIT, dc->DrawLine(x*m_cellWidth*X_UNIT, y*m_cellHeight*Y_UNIT,
(x+1)*m_cellWidth*X_UNIT, (y+1)*m_cellHeight*Y_UNIT); (x+1)*m_cellWidth*X_UNIT, (y+1)*m_cellHeight*Y_UNIT);
dc->DrawLine(x*m_cellWidth*X_UNIT, (y+1)*m_cellHeight*Y_UNIT, dc->DrawLine(x*m_cellWidth*X_UNIT, (y+1)*m_cellHeight*Y_UNIT,
@@ -127,11 +118,11 @@ void BombsCanvas::DrawField(wxDC *dc, int xc1, int yc1, int xc2, int yc2)
{ {
dc->SetPen(*wxBLACK_PEN); dc->SetPen(*wxBLACK_PEN);
if (m_game->IsFocussed(x, y)) if (m_game->IsFocussed(x, y))
dc->SetBrush(*focusedBrush); dc->SetBrush(*wxMEDIUM_GREY_BRUSH);
else if (m_game->IsSelected(x,y)) else if (m_game->IsSelected(x,y))
dc->SetBrush(*wxWHITE_BRUSH); dc->SetBrush(*wxWHITE_BRUSH);
else else
dc->SetBrush(*yellowBrush); dc->SetBrush(*wxYELLOW_BRUSH);
dc->DrawRectangle( x*m_cellWidth*X_UNIT, y*m_cellHeight*Y_UNIT, dc->DrawRectangle( x*m_cellWidth*X_UNIT, y*m_cellHeight*Y_UNIT,
m_cellWidth*X_UNIT+1, m_cellHeight*Y_UNIT+1); m_cellWidth*X_UNIT+1, m_cellHeight*Y_UNIT+1);

View File

@@ -42,9 +42,9 @@ FortyCanvas::FortyCanvas(wxWindow* parent, const wxPoint& pos, const wxSize& siz
SetScrollbars(0, 0, 0, 0); SetScrollbars(0, 0, 0, 0);
#ifdef __WXGTK__ #ifdef __WXGTK__
m_font = wxTheFontList->FindOrCreateFont(12, wxROMAN, wxNORMAL, wxNORMAL); m_font = wxTheFontList->FindOrCreateFont(wxFontInfo(12).Family(wxFONTFAMILY_ROMAN));
#else #else
m_font = wxTheFontList->FindOrCreateFont(10, wxSWISS, wxNORMAL, wxNORMAL); m_font = wxTheFontList->FindOrCreateFont(wxFontInfo(10).Family(wxFONTFAMILY_SWISS));
#endif #endif
SetBackgroundColour(FortyApp::BackgroundColour()); SetBackgroundColour(FortyApp::BackgroundColour());

View File

@@ -127,9 +127,7 @@ void Card::SetScale(double scale)
void Card::Erase(wxDC& dc, int x, int y) void Card::Erase(wxDC& dc, int x, int y)
{ {
wxPen* pen = wxThePenList->FindOrCreatePen( wxPen* pen = wxThePenList->FindOrCreatePen(
FortyApp::BackgroundColour(), FortyApp::BackgroundColour()
1,
wxSOLID
); );
dc.SetPen(* pen); dc.SetPen(* pen);
dc.SetBrush(FortyApp::BackgroundBrush()); dc.SetBrush(FortyApp::BackgroundBrush());
@@ -169,7 +167,7 @@ void Card::Draw(wxDC& dc, int x, int y)
dc.SetBackground(* wxRED_BRUSH); dc.SetBackground(* wxRED_BRUSH);
dc.SetBackgroundMode(wxSOLID); dc.SetBackgroundMode(wxSOLID);
wxBrush* brush = wxTheBrushList->FindOrCreateBrush( wxBrush* brush = wxTheBrushList->FindOrCreateBrush(
*wxBLACK, wxCROSSDIAG_HATCH *wxBLACK, wxBRUSHSTYLE_CROSSDIAG_HATCH
); );
dc.SetBrush(* brush); dc.SetBrush(* brush);
@@ -283,6 +281,7 @@ void Card::Draw(wxDC& dc, int x, int y)
symsize * m_suit, symsize * m_suit,
sympos, sympos,
wxCOPY); wxCOPY);
wxFALLTHROUGH;
case 2: case 2:
dc.Blit((wxCoord)(x - symdist + m_width / 2), dc.Blit((wxCoord)(x - symdist + m_width / 2),
(wxCoord)(y - symdist + m_height / 4), (wxCoord)(y - symdist + m_height / 4),
@@ -311,6 +310,7 @@ void Card::Draw(wxDC& dc, int x, int y)
symsize * m_suit, symsize * m_suit,
sympos, sympos,
wxCOPY); wxCOPY);
wxFALLTHROUGH;
case 4: case 4:
dc.Blit((wxCoord)(x - symdist + m_width / 4), dc.Blit((wxCoord)(x - symdist + m_width / 4),
(wxCoord)(y - symdist + m_height / 4), (wxCoord)(y - symdist + m_height / 4),
@@ -355,6 +355,7 @@ void Card::Draw(wxDC& dc, int x, int y)
symsize * m_suit, symsize * m_suit,
sympos2, sympos2,
wxCOPY); wxCOPY);
wxFALLTHROUGH;
case 7: case 7:
dc.Blit((wxCoord)(x - symdist + 5 * m_width / 10), dc.Blit((wxCoord)(x - symdist + 5 * m_width / 10),
(wxCoord)(y - symdist + 3 * m_height / 8), (wxCoord)(y - symdist + 3 * m_height / 8),
@@ -364,6 +365,7 @@ void Card::Draw(wxDC& dc, int x, int y)
symsize * m_suit, symsize * m_suit,
sympos, sympos,
wxCOPY); wxCOPY);
wxFALLTHROUGH;
case 6: case 6:
dc.Blit((wxCoord)(x - symdist + m_width / 4), dc.Blit((wxCoord)(x - symdist + m_width / 4),
(wxCoord)(y - symdist + m_height / 4), (wxCoord)(y - symdist + m_height / 4),
@@ -421,6 +423,7 @@ void Card::Draw(wxDC& dc, int x, int y)
symsize * m_suit, symsize * m_suit,
sympos2, sympos2,
wxCOPY); wxCOPY);
wxFALLTHROUGH;
case 9: case 9:
dc.Blit((wxCoord)(x - symdist + m_width / 4), dc.Blit((wxCoord)(x - symdist + m_width / 4),
(wxCoord)(y - symdist2 + m_height / 4), (wxCoord)(y - symdist2 + m_height / 4),
@@ -497,7 +500,9 @@ void Card::Draw(wxDC& dc, int x, int y)
wxCOPY); wxCOPY);
break; break;
case 11: case 11:
wxFALLTHROUGH;
case 12: case 12:
wxFALLTHROUGH;
case 13: case 13:
memoryDC.SelectObject(*m_pictureBmap); memoryDC.SelectObject(*m_pictureBmap);
int picwidth = 40,picheight = 45; 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) 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.SetBrush(FortyApp::BackgroundBrush());
dc.SetPen(*pen); dc.SetPen(*pen);
dc.DrawRoundedRectangle(x, y, m_width, m_height, 4); dc.DrawRoundedRectangle(x, y, m_width, m_height, 4);

View File

@@ -112,7 +112,7 @@ const wxBrush& FortyApp::BackgroundBrush()
{ {
if (!m_backgroundBrush) if (!m_backgroundBrush)
{ {
m_backgroundBrush = new wxBrush(BackgroundColour(), wxSOLID); m_backgroundBrush = new wxBrush(BackgroundColour());
} }
return *m_backgroundBrush; return *m_backgroundBrush;

View File

@@ -215,7 +215,7 @@ void Game::DoMove(wxDC& dc, Pile* src, Pile* dest)
void Game::DisplayScore(wxDC& dc) void Game::DisplayScore(wxDC& dc)
{ {
wxColour bgColour = FortyApp::BackgroundColour(); wxColour bgColour = FortyApp::BackgroundColour();
wxPen* pen = wxThePenList->FindOrCreatePen(bgColour, 1, wxSOLID); wxPen* pen = wxThePenList->FindOrCreatePen(bgColour);
dc.SetTextBackground(bgColour); dc.SetTextBackground(bgColour);
dc.SetTextForeground(FortyApp::TextColour()); dc.SetTextForeground(FortyApp::TextColour());
dc.SetBrush(FortyApp::BackgroundBrush()); dc.SetBrush(FortyApp::BackgroundBrush());

View File

@@ -47,9 +47,9 @@ ScoreCanvas::ScoreCanvas(wxWindow* parent, ScoreFile* scoreFile, const wxPoint&
{ {
SetBackgroundColour(*wxWHITE); SetBackgroundColour(*wxWHITE);
#ifdef __WXGTK__ #ifdef __WXGTK__
m_font = wxTheFontList->FindOrCreateFont(12, wxROMAN, wxNORMAL, wxNORMAL); m_font = wxTheFontList->FindOrCreateFont(wxFontInfo(12).Family(wxFONTFAMILY_ROMAN));
#else #else
m_font = wxTheFontList->FindOrCreateFont(10, wxSWISS, wxNORMAL, wxNORMAL); m_font = wxTheFontList->FindOrCreateFont(wxFontInfo(10).Family(wxFONTFAMILY_SWISS));
#endif #endif
wxArrayString players; wxArrayString players;
@@ -92,7 +92,7 @@ void ScoreCanvas::OnDraw(wxDC& dc)
// get the line spacing for the current font // get the line spacing for the current font
int lineSpacing; int lineSpacing;
{ {
long w, h; wxCoord w, h;
dc.GetTextExtent(wxT("Testing"), &w, &h); dc.GetTextExtent(wxT("Testing"), &w, &h);
lineSpacing = (int)h; lineSpacing = (int)h;
} }

View File

@@ -149,16 +149,16 @@ MyCanvas::MyCanvas(wxFrame *frame):
wxWindow(frame, wxID_ANY) wxWindow(frame, wxID_ANY)
{ {
wxColour wxCol1(255,255,255); wxColour wxCol1(255,255,255);
SnowPen = wxPen(wxCol1, 2, wxSOLID); SnowPen = wxPen(wxCol1, 2);
wxColour wxCol2(128,0,0); wxColour wxCol2(128,0,0);
MtnPen = wxPen(wxCol2, 1, wxSOLID); MtnPen = wxPen(wxCol2);
wxColour wxCol3(0,128,0); wxColour wxCol3(0,128,0);
GreenPen = wxPen(wxCol3, 1, wxSOLID); GreenPen = wxPen(wxCol3);
wxColour wxCol4(0,0,128); wxColour wxCol4(0,0,128);
WaterBrush = wxBrush(wxCol4, wxSOLID); WaterBrush = wxBrush(wxCol4);
} }
void MyCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) void MyCanvas::OnPaint(wxPaintEvent& WXUNUSED(event))

View File

@@ -1,4 +1,2 @@
wxSTD_FRAME ICON "mondrian.ico"
#include "wx/msw/wx.rc" #include "wx/msw/wx.rc"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 766 B

View File

@@ -99,9 +99,9 @@ MainWindow *TheMainWindow = NULL;
// Create the fonts // Create the fonts
void MainWindow::CreateFonts() void MainWindow::CreateFonts()
{ {
m_normalFont = wxTheFontList->FindOrCreateFont(pointSize, wxSWISS, wxNORMAL, wxNORMAL); m_normalFont = wxTheFontList->FindOrCreateFont(wxFontInfo(pointSize).Family(wxFONTFAMILY_SWISS));
m_boldFont = wxTheFontList->FindOrCreateFont(pointSize, wxSWISS, wxNORMAL, wxBOLD); m_boldFont = wxTheFontList->FindOrCreateFont(wxFontInfo(pointSize).Family(wxFONTFAMILY_SWISS).Bold());
m_italicFont = wxTheFontList->FindOrCreateFont(pointSize, wxSWISS, wxITALIC, wxNORMAL); m_italicFont = wxTheFontList->FindOrCreateFont(wxFontInfo(pointSize).Family(wxFONTFAMILY_SWISS).Italic());
} }
wxBEGIN_EVENT_TABLE(MainWindow, wxFrame) wxBEGIN_EVENT_TABLE(MainWindow, wxFrame)
@@ -119,7 +119,7 @@ MainWindow::MainWindow(wxFrame *frame, wxWindowID id, const wxString& title,
ReadPreferences(); ReadPreferences();
CreateFonts(); CreateFonts();
SetIcon(wxpoem_xpm); SetIcon(wxICON(wxpoem));
m_corners[0] = new wxIcon( corner1_xpm ); m_corners[0] = new wxIcon( corner1_xpm );
m_corners[1] = new wxIcon( corner2_xpm ); m_corners[1] = new wxIcon( corner2_xpm );
@@ -788,7 +788,7 @@ bool LoadPoem(const wxChar *file_name, long position)
} }
wxSprintf(buf, wxT("%s.dat"), file_name); wxSprintf(buf, wxT("%s.dat"), file_name);
data_file = wxFopen(buf, wxT("r")); data_file = wxFopen(buf, wxT("rb"));
if (data_file == NULL) if (data_file == NULL)
{ {
@@ -862,7 +862,7 @@ long MainWindow::DoSearch(void)
if (data_filename) if (data_filename)
wxSprintf(buf, wxT("%s.dat"), data_filename); wxSprintf(buf, wxT("%s.dat"), data_filename);
file = wxFopen(buf, wxT("r")); file = wxFopen(buf, wxT("rb"));
if (! (data_filename && file)) if (! (data_filename && file))
{ {
wxSprintf(error_buf, wxT("Poetry data file %s not found\n"), buf); wxSprintf(error_buf, wxT("Poetry data file %s not found\n"), buf);
@@ -948,7 +948,7 @@ bool Compile(void)
if (data_filename) if (data_filename)
wxSprintf(buf, wxT("%s.dat"), data_filename); wxSprintf(buf, wxT("%s.dat"), data_filename);
file = wxFopen(buf, wxT("r")); file = wxFopen(buf, wxT("rb"));
if (! (data_filename && file)) if (! (data_filename && file))
{ {
wxSprintf(error_buf, wxT("Poetry data file %s not found\n"), buf); wxSprintf(error_buf, wxT("Poetry data file %s not found\n"), buf);

View File

@@ -1,137 +1,137 @@
135 135
0 0
448 432
706 678
886 849
1046 1000
1354 1289
1754 1676
2127 2036
2806 2695
3376 3247
3992 3839
4381 4214
4620 4444
5195 5002
5918 5705
6165 5943
6801 6559
7497 7236
8216 7935
8687 8387
9145 8826
9398 9065
10065 9712
10397 10030
10631 10251
10881 10488
11290 10879
11589 11165
11981 11541
12126 11679
12807 12341
13441 12952
14112 13601
14568 14037
15238 14685
15927 15355
16617 16023
17092 16480
17415 16789
18121 17472
18775 18104
19327 18634
19870 19160
20557 19828
21198 20450
21657 20892
22441 21651
22949 22144
23526 22697
23701 22863
23954 23105
24362 23495
24535 23659
24743 23858
24921 24027
27139 26188
27335 26375
27576 26605
28162 27170
28342 27341
28766 27752
28935 27912
29132 28100
29339 28298
29543 28493
29765 28705
29989 28919
30422 29336
31079 29969
31624 30491
32028 30876
32667 31495
34127 32918
34595 33373
34937 33703
35071 33830
35295 34045
35482 34223
35745 34477
36172 34889
36665 35367
37076 35760
37225 35898
37812 36461
38323 36950
38810 37417
40525 39079
40914 39455
41585 40104
42287 40787
44104 42555
45220 43641
46627 45010
47212 45571
47952 46287
48559 46870
49044 47331
49535 47808
50201 48457
51482 49704
52736 50924
53914 52070
54701 52830
55477 53582
55990 54076
56254 54328
56527 54590
57020 55064
57428 55453
57625 55643
58263 56256
59074 57048
59747 57698
60702 58621
61439 59337
62934 60780
63483 61314
63698 61518
64019 61825
64311 62104
64531 62315
64687 62462
65222 62980
65419 63167
66021 63748
66876 64581
67342 65034
67664 65343
68721 66368
69524 67140
70788 68358
71483 69033
72201 69732
72922 70434
73604 71096

View File

@@ -1,4 +1,4 @@
aaaa ICON "wxpoem.ico" wxpoem ICON "wxpoem.ico"
#include "wx/msw/wx.rc" #include "wx/msw/wx.rc"

View File

@@ -558,6 +558,12 @@ public:
wxFontEncoding encoding = wxFONTENCODING_DEFAULT) wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{ return FindOrCreateFont(pointSize, (wxFontFamily)family, (wxFontStyle)style, { return FindOrCreateFont(pointSize, (wxFontFamily)family, (wxFontStyle)style,
(wxFontWeight)weight, underline, face, encoding); } (wxFontWeight)weight, underline, face, encoding); }
wxFont *FindOrCreateFont(const wxFontInfo& fontInfo)
{ return FindOrCreateFont(fontInfo.GetPointSize(), fontInfo.GetFamily(),
fontInfo.GetStyle(), fontInfo.GetWeight(),
fontInfo.IsUnderlined(), fontInfo.GetFaceName(),
fontInfo.GetEncoding()); }
}; };
extern WXDLLIMPEXP_DATA_CORE(wxFontList*) wxTheFontList; extern WXDLLIMPEXP_DATA_CORE(wxFontList*) wxTheFontList;

View File

@@ -1261,6 +1261,14 @@ public:
wxFontWeight weight, bool underline = false, wxFontWeight weight, bool underline = false,
const wxString& facename = wxEmptyString, const wxString& facename = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT); wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
/**
Finds a font of the given specification, or creates one and adds it to the
list. See the @ref wxFont "wxFont constructor" for details of the arguments.
@since 3.1.1
*/
wxFont* FindOrCreateFont(const wxFontInfo& fontInfo);
}; };

View File

@@ -1375,6 +1375,7 @@ void MyFrame::OnNotebookPageClose(wxAuiNotebookEvent& evt)
void MyFrame::OnNotebookPageClosed(wxAuiNotebookEvent& evt) void MyFrame::OnNotebookPageClosed(wxAuiNotebookEvent& evt)
{ {
wxAuiNotebook* ctrl = (wxAuiNotebook*)evt.GetEventObject(); wxAuiNotebook* ctrl = (wxAuiNotebook*)evt.GetEventObject();
wxUnusedVar(ctrl);
// selection should always be a valid index // selection should always be a valid index
wxASSERT_MSG( ctrl->GetSelection() < (int)ctrl->GetPageCount(), wxASSERT_MSG( ctrl->GetSelection() < (int)ctrl->GetPageCount(),

View File

@@ -1344,8 +1344,9 @@ void MyListCtrl::OnListKeyDown(wxListEvent& event)
{ {
InsertItemInReportView(event.GetIndex()); InsertItemInReportView(event.GetIndex());
} }
break;
} }
//else: fall through wxFALLTHROUGH;
default: default:
LogEvent(event, wxT("OnListKeyDown")); LogEvent(event, wxT("OnListKeyDown"));

View File

@@ -912,6 +912,7 @@ void FormMain::OnPropertyGridColDragging( wxPropertyGridEvent& event )
void FormMain::OnPropertyGridColEndDrag( wxPropertyGridEvent& event ) void FormMain::OnPropertyGridColEndDrag( wxPropertyGridEvent& event )
{ {
wxUnusedVar(event);
wxLogDebug(wxT("Splitter %i resize ended"), event.GetColumn()); wxLogDebug(wxT("Splitter %i resize ended"), event.GetColumn());
} }
@@ -1788,6 +1789,7 @@ wxEND_EVENT_TABLE()
void wxMyPropertyGridPage::OnPropertySelect( wxPropertyGridEvent& event ) void wxMyPropertyGridPage::OnPropertySelect( wxPropertyGridEvent& event )
{ {
wxPGProperty* p = event.GetProperty(); wxPGProperty* p = event.GetProperty();
wxUnusedVar(p);
wxLogDebug(wxT("wxMyPropertyGridPage::OnPropertySelect('%s' is %s"), wxLogDebug(wxT("wxMyPropertyGridPage::OnPropertySelect('%s' is %s"),
p->GetName().c_str(), p->GetName().c_str(),
IsPropertySelected(p)? wxT("selected"): wxT("unselected")); IsPropertySelected(p)? wxT("selected"): wxT("unselected"));

View File

@@ -32,7 +32,7 @@
#include "wx/url.h" #include "wx/url.h"
#include "wx/sstream.h" #include "wx/sstream.h"
#include "wx/thread.h" #include "wx/thread.h"
#include <memory> #include "wx/scopedptr.h"
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
// resources // resources
@@ -594,7 +594,7 @@ void DoDownload(const wxString& urlname)
// Try to get the input stream (connects to the given URL) // Try to get the input stream (connects to the given URL)
wxLogMessage("Establishing connection to \"%s\"...", urlname); wxLogMessage("Establishing connection to \"%s\"...", urlname);
const std::auto_ptr<wxInputStream> data(url.GetInputStream()); const wxScopedPtr<wxInputStream> data(url.GetInputStream());
if ( !data.get() ) if ( !data.get() )
{ {
wxLogError("Failed to retrieve URL \"%s\"", urlname); wxLogError("Failed to retrieve URL \"%s\"", urlname);

View File

@@ -3932,6 +3932,7 @@ void wxDataViewMainWindow::OnChar( wxKeyEvent &event )
break; break;
} }
// else: fall through to WXK_F2 handling // else: fall through to WXK_F2 handling
wxFALLTHROUGH;
} }
case WXK_F2: case WXK_F2:

View File

@@ -664,6 +664,7 @@ void wxVListBox::OnKeyDown(wxKeyEvent& event)
// events for the tabs on MSW // events for the tabs on MSW
HandleAsNavigationKey(event); HandleAsNavigationKey(event);
// fall through to default // fall through to default
wxFALLTHROUGH;
#endif #endif
default: default:
event.Skip(); event.Skip();

View File

@@ -329,6 +329,7 @@ bool wxComboBox::MSWCommand(WXUINT param, WXWORD id)
// fall through: for compatibility with wxGTK, also send the text // fall through: for compatibility with wxGTK, also send the text
// update event when the selection changes (this also seems more // update event when the selection changes (this also seems more
// logical as the text does change) // logical as the text does change)
wxFALLTHROUGH;
case CBN_EDITCHANGE: case CBN_EDITCHANGE:
if ( m_allowTextEvents ) if ( m_allowTextEvents )

View File

@@ -182,6 +182,7 @@ wxFontEncoding wxGetFontEncFromCharSet(int cs)
default: default:
wxFAIL_MSG( wxT("unexpected Win32 charset") ); wxFAIL_MSG( wxT("unexpected Win32 charset") );
// fall through and assume the system charset // fall through and assume the system charset
wxFALLTHROUGH;
case DEFAULT_CHARSET: case DEFAULT_CHARSET:
fontEncoding = wxFONTENCODING_SYSTEM; fontEncoding = wxFONTENCODING_SYSTEM;

View File

@@ -95,6 +95,7 @@ wxBuddyTextWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
if ( (WXHWND)wParam == spin->GetHWND() ) if ( (WXHWND)wParam == spin->GetHWND() )
break; break;
//else: fall through //else: fall through
wxFALLTHROUGH;
case WM_KILLFOCUS: case WM_KILLFOCUS:
case WM_CHAR: case WM_CHAR:

View File

@@ -460,6 +460,7 @@ public:
if ( image != -1 ) if ( image != -1 )
break; break;
//else: fall through //else: fall through
wxFALLTHROUGH;
case wxTreeItemIcon_Selected: case wxTreeItemIcon_Selected:
case wxTreeItemIcon_Expanded: case wxTreeItemIcon_Expanded:

View File

@@ -1090,6 +1090,7 @@ wxString wxGetOsDescription()
break; break;
} }
//else: must be XP, fall through //else: must be XP, fall through
wxFALLTHROUGH;
case 1: case 1:
str = "Windows XP"; str = "Windows XP";

View File

@@ -988,10 +988,11 @@ long wxExecute(const wxString& cmd, int flags, wxProcess *handler,
{ {
default: default:
wxFAIL_MSG( wxT("unexpected WaitForInputIdle() return code") ); wxFAIL_MSG( wxT("unexpected WaitForInputIdle() return code") );
// fall through wxFALLTHROUGH;
case WAIT_FAILED: case WAIT_FAILED:
wxLogLastError(wxT("WaitForInputIdle() in wxExecute")); wxLogLastError(wxT("WaitForInputIdle() in wxExecute"));
wxFALLTHROUGH;
case WAIT_TIMEOUT: case WAIT_TIMEOUT:
wxLogDebug(wxT("Timeout too small in WaitForInputIdle")); wxLogDebug(wxT("Timeout too small in WaitForInputIdle"));

View File

@@ -5075,8 +5075,10 @@ bool wxWindowMSW::HandleSize(int WXUNUSED(w), int WXUNUSED(h), WXUINT wParam)
default: default:
wxFAIL_MSG( wxT("unexpected WM_SIZE parameter") ); wxFAIL_MSG( wxT("unexpected WM_SIZE parameter") );
// fall through nevertheless // fall through nevertheless
wxFALLTHROUGH;
case SIZE_MAXHIDE: case SIZE_MAXHIDE:
wxFALLTHROUGH;
case SIZE_MAXSHOW: case SIZE_MAXSHOW:
// we're not interested in these messages at all // we're not interested in these messages at all
break; break;
@@ -5088,6 +5090,7 @@ bool wxWindowMSW::HandleSize(int WXUNUSED(w), int WXUNUSED(h), WXUINT wParam)
case SIZE_MAXIMIZED: case SIZE_MAXIMIZED:
/* processed = */ HandleMaximize(); /* processed = */ HandleMaximize();
// fall through to send a normal size event as well // fall through to send a normal size event as well
wxFALLTHROUGH;
case SIZE_RESTORED: case SIZE_RESTORED:
// don't use w and h parameters as they specify the client size // don't use w and h parameters as they specify the client size
@@ -5097,6 +5100,7 @@ bool wxWindowMSW::HandleSize(int WXUNUSED(w), int WXUNUSED(h), WXUINT wParam)
event.SetEventObject(this); event.SetEventObject(this);
processed = HandleWindowEvent(event); processed = HandleWindowEvent(event);
break;
} }
return processed; return processed;
@@ -6195,60 +6199,70 @@ WXWORD WXToVK(int wxk, bool *isExtended)
{ {
case WXK_PAGEUP: case WXK_PAGEUP:
extended = true; extended = true;
wxFALLTHROUGH;
case WXK_NUMPAD_PAGEUP: case WXK_NUMPAD_PAGEUP:
vk = VK_PRIOR; vk = VK_PRIOR;
break; break;
case WXK_PAGEDOWN: case WXK_PAGEDOWN:
extended = true; extended = true;
wxFALLTHROUGH;
case WXK_NUMPAD_PAGEDOWN: case WXK_NUMPAD_PAGEDOWN:
vk = VK_NEXT; vk = VK_NEXT;
break; break;
case WXK_END: case WXK_END:
extended = true; extended = true;
wxFALLTHROUGH;
case WXK_NUMPAD_END: case WXK_NUMPAD_END:
vk = VK_END; vk = VK_END;
break; break;
case WXK_HOME: case WXK_HOME:
extended = true; extended = true;
wxFALLTHROUGH;
case WXK_NUMPAD_HOME: case WXK_NUMPAD_HOME:
vk = VK_HOME; vk = VK_HOME;
break; break;
case WXK_LEFT: case WXK_LEFT:
extended = true; extended = true;
wxFALLTHROUGH;
case WXK_NUMPAD_LEFT: case WXK_NUMPAD_LEFT:
vk = VK_LEFT; vk = VK_LEFT;
break; break;
case WXK_UP: case WXK_UP:
extended = true; extended = true;
wxFALLTHROUGH;
case WXK_NUMPAD_UP: case WXK_NUMPAD_UP:
vk = VK_UP; vk = VK_UP;
break; break;
case WXK_RIGHT: case WXK_RIGHT:
extended = true; extended = true;
wxFALLTHROUGH;
case WXK_NUMPAD_RIGHT: case WXK_NUMPAD_RIGHT:
vk = VK_RIGHT; vk = VK_RIGHT;
break; break;
case WXK_DOWN: case WXK_DOWN:
extended = true; extended = true;
wxFALLTHROUGH;
case WXK_NUMPAD_DOWN: case WXK_NUMPAD_DOWN:
vk = VK_DOWN; vk = VK_DOWN;
break; break;
case WXK_INSERT: case WXK_INSERT:
extended = true; extended = true;
wxFALLTHROUGH;
case WXK_NUMPAD_INSERT: case WXK_NUMPAD_INSERT:
vk = VK_INSERT; vk = VK_INSERT;
break; break;
case WXK_DELETE: case WXK_DELETE:
extended = true; extended = true;
wxFALLTHROUGH;
case WXK_NUMPAD_DELETE: case WXK_NUMPAD_DELETE:
vk = VK_DELETE; vk = VK_DELETE;
break; break;
@@ -6264,6 +6278,7 @@ WXWORD WXToVK(int wxk, bool *isExtended)
{ {
vk = (WXWORD)wxk; vk = (WXWORD)wxk;
} }
break;
} }
if ( isExtended ) if ( isExtended )

View File

@@ -1628,6 +1628,7 @@ void wxRibbonMSWArtProvider::DrawScrollButton(
{ {
case wxRIBBON_SCROLL_BTN_LEFT: case wxRIBBON_SCROLL_BTN_LEFT:
rect.x++; rect.x++;
wxFALLTHROUGH;
case wxRIBBON_SCROLL_BTN_RIGHT: case wxRIBBON_SCROLL_BTN_RIGHT:
rect.y--; rect.y--;
rect.width--; rect.width--;

View File

@@ -396,7 +396,7 @@ void wxEmulatorContainer::OnEraseBackground(wxEraseEvent& event)
dc = new wxClientDC(this); dc = new wxClientDC(this);
} }
dc->SetBackground(wxBrush(wxGetApp().m_emulatorInfo.m_emulatorBackgroundColour, wxSOLID)); dc->SetBackground(wxBrush(wxGetApp().m_emulatorInfo.m_emulatorBackgroundColour));
dc->Clear(); dc->Clear();
if (!event.GetDC()) if (!event.GetDC())

View File

@@ -119,15 +119,15 @@ bool hvApp::OnInit()
} }
else if ( argStr.Find( wxT("--Style") ) >= 0 ) else if ( argStr.Find( wxT("--Style") ) >= 0 )
{ {
long i; long style;
wxString numb = argStr.AfterLast(wxT('e')); wxString numb = argStr.AfterLast(wxT('e'));
if ( !(numb.ToLong(&i) ) ) if ( !(numb.ToLong(&style) ) )
{ {
wxLogError( wxT("Integer conversion failed for --Style") ); wxLogError( wxT("Integer conversion failed for --Style") );
} }
else else
{ {
istyle = i; istyle = style;
} }
} }
else else

View File

@@ -58,29 +58,29 @@ void PenStyleComboBox::OnDrawItem( wxDC& dc,
r.Deflate(3); r.Deflate(3);
r.height -= 2; r.height -= 2;
int penStyle = wxSOLID; wxPenStyle penStyle = wxPENSTYLE_SOLID;
// if ( item == 1 ) // if ( item == 1 )
// penStyle = wxTRANSPARENT; // penStyle = wxPENSTYLE_TRANSPARENT;
// else if ( item == 2 ) // else if ( item == 2 )
// penStyle = wxDOT; // penStyle = wxPENSTYLE_DOT;
// else if ( item == 3 ) // else if ( item == 3 )
// penStyle = wxLONG_DASH; // penStyle = wxPENSTYLE_LONG_DASH;
// else if ( item == 4 ) // else if ( item == 4 )
// penStyle = wxSHORT_DASH; // penStyle = wxPENSTYLE_SHORT_DASH;
if ( item == 0 ) if ( item == 0 )
penStyle = wxDOT_DASH; penStyle = wxPENSTYLE_DOT_DASH;
else if ( item == 1 ) else if ( item == 1 )
penStyle = wxBDIAGONAL_HATCH; penStyle = wxPENSTYLE_BDIAGONAL_HATCH;
else if ( item == 2 ) else if ( item == 2 )
penStyle = wxCROSSDIAG_HATCH; penStyle = wxPENSTYLE_CROSSDIAG_HATCH;
// else if ( item == 8 ) // else if ( item == 8 )
// penStyle = wxFDIAGONAL_HATCH; // penStyle = wxPENSTYLE_FDIAGONAL_HATCH;
// else if ( item == 9 ) // else if ( item == 9 )
// penStyle = wxCROSS_HATCH; // penStyle = wxPENSTYLE_CROSS_HATCH;
// else if ( item == 10 ) // else if ( item == 10 )
// penStyle = wxHORIZONTAL_HATCH; // penStyle = wxPENSTYLE_HORIZONTAL_HATCH;
// else if ( item == 11 ) // else if ( item == 11 )
// penStyle = wxVERTICAL_HATCH; // penStyle = wxPENSTYLE_VERTICAL_HATCH;
wxPen pen( dc.GetTextForeground(), 3, penStyle ); wxPen pen( dc.GetTextForeground(), 3, penStyle );