From e9ce104e4a7406d15cf5d016cb5eef88e3b20c8f Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Thu, 23 Jul 2020 20:30:36 +0200 Subject: [PATCH 1/4] CMake: add headers test --- build/cmake/tests/CMakeLists.txt | 1 + build/cmake/tests/headers/CMakeLists.txt | 25 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 build/cmake/tests/headers/CMakeLists.txt diff --git a/build/cmake/tests/CMakeLists.txt b/build/cmake/tests/CMakeLists.txt index 8065a14edf..9974184b21 100644 --- a/build/cmake/tests/CMakeLists.txt +++ b/build/cmake/tests/CMakeLists.txt @@ -14,5 +14,6 @@ if(wxUSE_GUI AND wxBUILD_TESTS STREQUAL "ALL") add_subdirectory(drawing) add_subdirectory(gui) +add_subdirectory(headers) endif() diff --git a/build/cmake/tests/headers/CMakeLists.txt b/build/cmake/tests/headers/CMakeLists.txt new file mode 100644 index 0000000000..a04d219e47 --- /dev/null +++ b/build/cmake/tests/headers/CMakeLists.txt @@ -0,0 +1,25 @@ +############################################################################# +# Name: build/cmake/tests/headers/CMakeLists.txt +# Purpose: CMake file for headers test +# Author: Maarten Bent +# Created: 2020-07-23 +# Copyright: (c) 2020 wxWidgets development team +# Licence: wxWindows licence +############################################################################# + +set(TEST_SRC + test.cpp + testableframe.cpp + allheaders.cpp + + testprec.h + testableframe.h + allheaders.h + ) + +wx_add_test(test_headers ${TEST_SRC}) +wx_exe_link_libraries(test_headers wxcore) +if(wxUSE_SOCKETS) + wx_exe_link_libraries(test_headers wxnet) +endif() +wx_test_enable_precomp(test_headers) From b5737510fd4a43f8a54623da3d1ce41fec933d00 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Thu, 23 Jul 2020 20:33:46 +0200 Subject: [PATCH 2/4] Fix warning C4193: no matching pragma pop and push Mention wx/dvrenderers.h in the exclude list, as described in PR1312. --- tests/allheaders.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/allheaders.h b/tests/allheaders.h index 004f9eb285..fd4a87d3e5 100644 --- a/tests/allheaders.h +++ b/tests/allheaders.h @@ -5,14 +5,18 @@ Excluded headers: #include + #include #include #include #include #include - #include #include + #include */ +#include +#include + #include #include #include @@ -20,7 +24,6 @@ #include #include #include -#include #include #include #include @@ -36,7 +39,6 @@ #include #include #include -#include #include #include #include From ea102bb2728516cfc5e4781bf58fb38f30426eae Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Thu, 23 Jul 2020 22:51:02 +0200 Subject: [PATCH 3/4] Add missing wxOVERRIDE to wxNonOwnedWindow::Reparent --- include/wx/msw/nonownedwnd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/wx/msw/nonownedwnd.h b/include/wx/msw/nonownedwnd.h index 1aeeb6f0d6..953077eeed 100644 --- a/include/wx/msw/nonownedwnd.h +++ b/include/wx/msw/nonownedwnd.h @@ -22,7 +22,7 @@ public: wxNonOwnedWindow(); virtual ~wxNonOwnedWindow(); - virtual bool Reparent(wxWindowBase* newParent); + virtual bool Reparent(wxWindowBase* newParent) wxOVERRIDE; virtual void InheritAttributes() wxOVERRIDE; protected: From 2aadfd882ae11a3b0a6bd6620432daa1b2814696 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Thu, 23 Jul 2020 22:53:12 +0200 Subject: [PATCH 4/4] Fix unused private field warnings in Forty demo Fix drawing score list without wxUSE_GRID. --- demos/forty/scoredg.cpp | 9 ++++----- demos/forty/scoredg.h | 3 --- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/demos/forty/scoredg.cpp b/demos/forty/scoredg.cpp index 60533afbe8..6af72b53e2 100644 --- a/demos/forty/scoredg.cpp +++ b/demos/forty/scoredg.cpp @@ -85,7 +85,7 @@ void ScoreCanvas::OnDraw(wxDC& dc) { dc.SetFont(* m_font); - const wxChar* str = m_text; + const wxChar* str = m_text.c_str(); unsigned int tab = 0; unsigned int tabstops[] = { 5, 100, 150, 200 }; @@ -106,7 +106,7 @@ void ScoreCanvas::OnDraw(wxDC& dc) while (*str && *str >= ' ') *dest++ = *str++; *dest = '\0'; - dc.DrawText(text, tabstops[tab], y); + dc.DrawText(text, FromDIP(tabstops[tab]), y); if (*str == '\t') { @@ -131,8 +131,7 @@ wxEND_EVENT_TABLE() ScoreDialog::ScoreDialog(wxWindow* parent, ScoreFile* file) : wxDialog(parent, wxID_ANY, _("Scores"), - wxDefaultPosition, wxSize(400, 300)), - m_scoreFile(file) + wxDefaultPosition, wxSize(400, 300)) { // create grid with players wxArrayString players; @@ -177,7 +176,7 @@ ScoreDialog::ScoreDialog(wxWindow* parent, ScoreFile* file) : list->EnableEditing(false); sz.x = wxDefaultCoord; #else - ScoreCanvas* list = new ScoreCanvas(this, m_scoreFile, wxDefaultPosition, sz); + ScoreCanvas* list = new ScoreCanvas(this, file, wxDefaultPosition, sz); #endif list->SetInitialSize(sz); diff --git a/demos/forty/scoredg.h b/demos/forty/scoredg.h index 06a3b69ef4..90e3394c42 100644 --- a/demos/forty/scoredg.h +++ b/demos/forty/scoredg.h @@ -24,9 +24,6 @@ protected: void OnCloseWindow(wxCloseEvent& event); private: - ScoreFile* m_scoreFile; - wxButton* m_OK; - wxDECLARE_EVENT_TABLE(); };