[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 817f08a: Expunge ancient wx version checks
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 817f08a: Expunge ancient wx version checks |
Date: |
Thu, 9 Mar 2017 17:30:57 -0500 (EST) |
branch: master
commit 817f08ae221954cd35e7f6f5a05be5824151ed11
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Expunge ancient wx version checks
---
census_document.cpp | 19 -------------------
census_document.hpp | 3 ---
census_view.cpp | 6 ------
gpt_document.cpp | 21 ---------------------
gpt_document.hpp | 3 ---
illustration_document.cpp | 39 ---------------------------------------
illustration_document.hpp | 3 ---
mec_document.cpp | 21 ---------------------
mec_document.hpp | 3 ---
multidimgrid_any.cpp | 2 --
mvc_controller.cpp | 7 -------
mvc_controller.hpp | 5 -----
single_choice_popup_menu.cpp | 6 ------
skeleton.cpp | 19 -------------------
transferor.cpp | 7 -------
wx_checks.cpp | 6 +++---
wx_workarounds.hpp | 32 --------------------------------
17 files changed, 3 insertions(+), 199 deletions(-)
diff --git a/census_document.cpp b/census_document.cpp
index bf2d381..3ef8ae7 100644
--- a/census_document.cpp
+++ b/census_document.cpp
@@ -75,25 +75,6 @@ bool CensusDocument::OnCreate(wxString const& filename, long
int flags)
return wxDocument::OnCreate(filename, flags);
}
-#if !wxCHECK_VERSION(2,9,0)
-bool CensusDocument::OnNewDocument()
-{
- Modify(true);
- SetDocumentSaved(false);
-
-#if wxCHECK_VERSION(2,8,8)
- wxString const name = GetDocumentManager()->MakeNewDocumentName();
-#else // !wxCHECK_VERSION(2,8,8)
- wxString name;
- GetDocumentManager()->MakeDefaultName(name);
-#endif // !wxCHECK_VERSION(2,8,8)
- SetTitle(name);
- SetFilename(name, true);
-
- return true;
-}
-#endif // !wxCHECK_VERSION(2,9,0)
-
/// See documentation for IllustrationDocument::DoOpenDocument().
bool CensusDocument::DoOpenDocument(wxString const&)
diff --git a/census_document.hpp b/census_document.hpp
index df9d844..15c2c5a 100644
--- a/census_document.hpp
+++ b/census_document.hpp
@@ -48,9 +48,6 @@ class CensusDocument
// wxDocument overrides.
bool OnCreate(wxString const& filename, long int flags) override;
-#if !wxCHECK_VERSION(2,9,0)
- virtual bool OnNewDocument();
-#endif // !wxCHECK_VERSION(2,9,0)
bool DoOpenDocument(wxString const& filename) override;
bool DoSaveDocument(wxString const& filename) override;
diff --git a/census_view.cpp b/census_view.cpp
index b17140b..ea224ae 100644
--- a/census_view.cpp
+++ b/census_view.cpp
@@ -1522,12 +1522,6 @@ void CensusView::UponDeleteCells(wxCommandEvent&)
}
LMI_ASSERT(cell_parms().size() == n_items - n_sel_items);
-#if !wxCHECK_VERSION(2,9,3)
- // Remove selection to work around wx-2.9.2 bug in GetSelections()
- // (we'll set it again below).
- list_window_->UnselectAll();
-#endif
-
// Send notifications about changes to the wxDataViewCtrl model. Two things
// changed: some rows were deleted and cell number of some rows shifted
// accordingly.
diff --git a/gpt_document.cpp b/gpt_document.cpp
index bda17fa..9dd676a 100644
--- a/gpt_document.cpp
+++ b/gpt_document.cpp
@@ -74,27 +74,6 @@ bool gpt_document::OnCreate(wxString const& filename, long
int flags)
return wxDocument::OnCreate(filename, flags);
}
-#if !wxCHECK_VERSION(2,9,0)
-/// See the documentation for similar class IllustrationDocument.
-
-bool gpt_document::OnNewDocument()
-{
- Modify(true);
- SetDocumentSaved(false);
-
-#if wxCHECK_VERSION(2,8,8)
- wxString const name = GetDocumentManager()->MakeNewDocumentName();
-#else // !wxCHECK_VERSION(2,8,8)
- wxString name;
- GetDocumentManager()->MakeDefaultName(name);
-#endif // !wxCHECK_VERSION(2,8,8)
- SetTitle(name);
- SetFilename(name, true);
-
- return true;
-}
-#endif // !wxCHECK_VERSION(2,9,0)
-
/// See the documentation for similar class IllustrationDocument.
bool gpt_document::DoOpenDocument(wxString const&)
diff --git a/gpt_document.hpp b/gpt_document.hpp
index 6702511..b68c2f0 100644
--- a/gpt_document.hpp
+++ b/gpt_document.hpp
@@ -51,9 +51,6 @@ class gpt_document
// wxDocument overrides.
bool OnCreate(wxString const& filename, long int flags) override;
-#if !wxCHECK_VERSION(2,9,0)
- virtual bool OnNewDocument();
-#endif // !wxCHECK_VERSION(2,9,0)
bool DoOpenDocument(wxString const& filename) override;
bool DoSaveDocument(wxString const& filename) override;
diff --git a/illustration_document.cpp b/illustration_document.cpp
index e67e6b8..314f002 100644
--- a/illustration_document.cpp
+++ b/illustration_document.cpp
@@ -103,45 +103,6 @@ bool IllustrationDocument::OnCreate(wxString const&
filename, long int flags)
return wxDocument::OnCreate(filename, flags);
}
-#if !wxCHECK_VERSION(2,9,0)
-/// Formerly, wxDocument::OnNewDocument() called OnSaveModified().
-/// That would seem appropriate if an existing document were being
-/// overlaid, but the function is designed to create an entirely new
-/// document. It was a problem here because this class sets the dirty
-/// flag earlier. wxDocument::OnNewDocument() also clears the dirty
-/// flag, but it seems more sensible to set it. For these and perhaps
-/// other reasons, the base-class function must not be called here.
-///
-/// Setting the dirty flag peremptorily here was intemperate. The
-/// behavior with wx-2.9 or later is preferable: the dirty flag is set
-/// iff any change is made, so that when no change is made...
-/// File | New | Illustration
-/// OK
-/// File | Close
-/// ...this messagebox...
-/// "Do you want to save changes to unnamed1?"
-/// is no longer presented.
-
-bool IllustrationDocument::OnNewDocument()
-{
- Modify(true);
-// SOMEDAY !! Search for "SetDocumentSaved" on the mailing list and
-// resolve the issues discussed there.
- SetDocumentSaved(false);
-
-#if wxCHECK_VERSION(2,8,8)
- wxString const name = GetDocumentManager()->MakeNewDocumentName();
-#else // !wxCHECK_VERSION(2,8,8)
- wxString name;
- GetDocumentManager()->MakeDefaultName(name);
-#endif // !wxCHECK_VERSION(2,8,8)
- SetTitle(name);
- SetFilename(name, true);
-
- return true;
-}
-#endif // !wxCHECK_VERSION(2,9,0)
-
/// Override wx's built-in file management: doc_ handles that.
///
/// Override DoOpenDocument() instead of OnOpenDocument(): the latter
diff --git a/illustration_document.hpp b/illustration_document.hpp
index 4bb6fdc..a3fb354 100644
--- a/illustration_document.hpp
+++ b/illustration_document.hpp
@@ -64,9 +64,6 @@ class IllustrationDocument
// wxDocument overrides.
bool OnCreate(wxString const& filename, long int flags) override;
-#if !wxCHECK_VERSION(2,9,0)
- virtual bool OnNewDocument();
-#endif // !wxCHECK_VERSION(2,9,0)
bool DoOpenDocument(wxString const& filename) override;
bool DoSaveDocument(wxString const& filename) override;
diff --git a/mec_document.cpp b/mec_document.cpp
index d6f67f1..62b35d7 100644
--- a/mec_document.cpp
+++ b/mec_document.cpp
@@ -74,27 +74,6 @@ bool mec_document::OnCreate(wxString const& filename, long
int flags)
return wxDocument::OnCreate(filename, flags);
}
-#if !wxCHECK_VERSION(2,9,0)
-/// See the documentation for similar class IllustrationDocument.
-
-bool mec_document::OnNewDocument()
-{
- Modify(true);
- SetDocumentSaved(false);
-
-#if wxCHECK_VERSION(2,8,8)
- wxString const name = GetDocumentManager()->MakeNewDocumentName();
-#else // !wxCHECK_VERSION(2,8,8)
- wxString name;
- GetDocumentManager()->MakeDefaultName(name);
-#endif // !wxCHECK_VERSION(2,8,8)
- SetTitle(name);
- SetFilename(name, true);
-
- return true;
-}
-#endif // !wxCHECK_VERSION(2,9,0)
-
/// See the documentation for similar class IllustrationDocument.
bool mec_document::DoOpenDocument(wxString const&)
diff --git a/mec_document.hpp b/mec_document.hpp
index a04fc23..9242d2b 100644
--- a/mec_document.hpp
+++ b/mec_document.hpp
@@ -51,9 +51,6 @@ class mec_document
// wxDocument overrides.
bool OnCreate(wxString const& filename, long int flags) override;
-#if !wxCHECK_VERSION(2,9,0)
- virtual bool OnNewDocument();
-#endif // !wxCHECK_VERSION(2,9,0)
bool DoOpenDocument(wxString const& filename) override;
bool DoSaveDocument(wxString const& filename) override;
diff --git a/multidimgrid_any.cpp b/multidimgrid_any.cpp
index bbf998a..11b8d59 100644
--- a/multidimgrid_any.cpp
+++ b/multidimgrid_any.cpp
@@ -462,14 +462,12 @@ void MultiDimGrid::DoRefreshTableData()
wxWindowUpdateLocker update_locker(this);
grid().SetTable(grid().GetTable(), false);
-# if wxCHECK_VERSION(2,8,8)
// Automatically adjust the width of the column of row labels.
//
// Note that there's no point in doing the same for columns using
// SetColLabelSize(), because that would only affect _height_ of
// columns labels, but we need to adjust their width.
grid().SetRowLabelSize(wxGRID_AUTOSIZE);
-# endif // wxCHECK_VERSION(2,8,8)
// Adjust size of the data columns so that both the label and the
// data fit in it. At the same time, we want to keep some sensible
diff --git a/mvc_controller.cpp b/mvc_controller.cpp
index 5c0894b..650a7c1 100644
--- a/mvc_controller.cpp
+++ b/mvc_controller.cpp
@@ -892,10 +892,3 @@ bool MvcController::Validate()
return diagnosis.empty();
}
-#if !wxCHECK_VERSION(2,5,4)
-wxWindow* MvcController::FindWindow(long int window_id) const
-{
- return const_cast<MvcController*>(this)->wxDialog::FindWindow(window_id);
-}
-#endif // !wxCHECK_VERSION(2,5,4)
-
diff --git a/mvc_controller.hpp b/mvc_controller.hpp
index 068a363..a683bc5 100644
--- a/mvc_controller.hpp
+++ b/mvc_controller.hpp
@@ -454,11 +454,6 @@ class MvcController final
// Auxiliary functions to extend wxWindow::FindWindow().
-#if !wxCHECK_VERSION(2,5,4)
- // Workaround: this function was not const until wx-2.5.4 .
- wxWindow* FindWindow(long int window_id) const;
-#endif // !wxCHECK_VERSION(2,5,4)
-
template<typename T>
T& WindowFromXrcName(char const*) const;
diff --git a/single_choice_popup_menu.cpp b/single_choice_popup_menu.cpp
index 49ee4b3..4ce027e 100644
--- a/single_choice_popup_menu.cpp
+++ b/single_choice_popup_menu.cpp
@@ -50,13 +50,7 @@ SingleChoicePopupMenu::SingleChoicePopupMenu
(0
,choices.GetCount()
,wxEVT_COMMAND_MENU_SELECTED
-#if wxCHECK_VERSION(2,6,0)
,wxCommandEventHandler(SingleChoicePopupMenu::UponMenuChoice)
-#else // !wxCHECK_VERSION(2,6,0)
- ,reinterpret_cast<wxObjectEventFunction>
- (&SingleChoicePopupMenu::UponMenuChoice
- )
-#endif // !wxCHECK_VERSION(2,6,0)
);
}
diff --git a/skeleton.cpp b/skeleton.cpp
index 0703521..5bfcb07 100644
--- a/skeleton.cpp
+++ b/skeleton.cpp
@@ -112,11 +112,7 @@ void load_xrc_file_from_data_directory
,char const* xrc_filename
)
{
-#if wxCHECK_VERSION(2,9,0)
if(!xml_resources.LoadFile(wxFileName(AddDataDir(xrc_filename))))
-#else // !wxCHECK_VERSION(2,9,0)
- if(!xml_resources.Load(AddDataDir(xrc_filename)))
-#endif // !wxCHECK_VERSION(2,9,0)
{
alarum() << "Unable to load xml resources." << LMI_FLUSH;
}
@@ -203,9 +199,7 @@ Skeleton::Skeleton()
{
SetAppName("lmi_wx");
-#if wxCHECK_VERSION(2,9,0)
SetAppDisplayName("lmi...");
-#endif // wxCHECK_VERSION(2,9,0)
SetVendorName("lmi");
config_ = wxConfigBase::Get();
@@ -614,11 +608,7 @@ bool Skeleton::OnExceptionInMainLoop()
#if !(defined __GNUC__ && LMI_GCC_VERSION < 30405)
throw;
#else // defined __GNUC__ && LMI_GCC_VERSION < 30405
-# if wxCHECK_VERSION(2,7,0)
return wxAppBase::OnExceptionInMainLoop();
-# else // !wxCHECK_VERSION(2,7,0)
- return wxAppConsole::OnExceptionInMainLoop();
-# endif // !wxCHECK_VERSION(2,7,0)
#endif // defined __GNUC__ && LMI_GCC_VERSION < 30405
}
catch(...)
@@ -752,9 +742,7 @@ bool Skeleton::OnInit()
frame_->CreateStatusBar();
frame_->Bind(wxEVT_MENU_OPEN, &Skeleton::UponMenuOpen, this);
-#if defined LMI_MSW || wxCHECK_VERSION(2,8,10)
frame_->DragAcceptFiles(true);
-#endif // defined LMI_MSW || wxCHECK_VERSION(2,8,10)
frame_->Centre(wxBOTH);
frame_->Maximize(true);
@@ -1189,14 +1177,7 @@ void
Skeleton::UponWindowTileHorizontally(wxCommandEvent&)
void Skeleton::UponWindowTileVertically(wxCommandEvent&)
{
-#if wxCHECK_VERSION(2,6,0)
frame_->Tile(wxVERTICAL);
-#else // !wxCHECK_VERSION(2,6,0)
- warning()
- << "Vertical tiling not supported in this old wx version."
- << LMI_FLUSH
- ;
-#endif // !wxCHECK_VERSION(2,6,0)
}
bool Skeleton::ProcessCommandLine()
diff --git a/transferor.cpp b/transferor.cpp
index e0542a7..d0f9637 100644
--- a/transferor.cpp
+++ b/transferor.cpp
@@ -294,13 +294,6 @@ namespace
}
else
{
-#if !wxCHECK_VERSION(2,6,2)
- // For dropdown comboboxes, scrolling through the list
- // selects the highlighted item immediately, with wx
- // versions prior to 2.6.2 . This error directive may be
- // suppressed if living with that problem is acceptable.
-# error Outdated library: wx-2.6.2 or greater is required.
-#endif // !wxCHECK_VERSION(2,6,2)
data = control.GetStringSelection().ToStdString(wxConvUTF8);
}
return true;
diff --git a/wx_checks.cpp b/wx_checks.cpp
index 30897ea..de78acc 100644
--- a/wx_checks.cpp
+++ b/wx_checks.cpp
@@ -25,9 +25,9 @@
#include <wx/defs.h>
-#if !wxCHECK_VERSION(2,5,4) // wx prior to version 2.5.4 .
-# error Outdated library: wx-2.5.4 or greater is required.
-#endif // wx prior to version 2.5.4 .
+#if !wxCHECK_VERSION(3,1,0) // wx prior to version 3.1.0 .
+# error Outdated library: wx-3.1.0 or greater is required.
+#endif // wx prior to version 3.1.0 .
// Require certain optional wx components.
diff --git a/wx_workarounds.hpp b/wx_workarounds.hpp
index 3d3aeda..ff2406a 100644
--- a/wx_workarounds.hpp
+++ b/wx_workarounds.hpp
@@ -26,37 +26,5 @@
#include <wx/defs.h>
-// These string-comparison operators became unnecessary in wx-2.5.4,
-// and harmful in wx-2.6.0:
-// http://lists.gnu.org/archive/html/lmi/2005-08/msg00002.html
-
-#if !wxCHECK_VERSION(2,5,4) // wx prior to version 2.5.4 .
-
-# include <wx/string.h>
-
-# include <string>
-
-inline bool operator==(std::string const& s, wxString const& w)
-{
- return s == w.c_str();
-}
-
-inline bool operator==(wxString const& w, std::string const& s)
-{
- return s == w.c_str();
-}
-
-inline bool operator!=(std::string const& s, wxString const& w)
-{
- return s != w.c_str();
-}
-
-inline bool operator!=(wxString const& w, std::string const& s)
-{
- return s != w.c_str();
-}
-
-#endif // wx prior to version 2.5.4 .
-
#endif // wx_workarounds_hpp
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lmi-commits] [lmi] master 817f08a: Expunge ancient wx version checks,
Greg Chicares <=