From 639003a8b63e7955159b0d3747a38e2ecbd9c15a Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Thu, 18 Aug 2022 13:52:13 +0000 Subject: [PATCH] Show pixel filter name not number on cycle Save the wxChoice* for the pixel filter name selection list in the XRC and use it to display the filter name in the status message on pixel filter cycle instead of the filter number. Signed-off-by: Rafael Kitover --- src/wx/cmdevents.cpp | 2 +- src/wx/guiinit.cpp | 4 ++++ src/wx/wxvbam.h | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/wx/cmdevents.cpp b/src/wx/cmdevents.cpp index e5942767..a58782bb 100644 --- a/src/wx/cmdevents.cpp +++ b/src/wx/cmdevents.cpp @@ -2766,7 +2766,7 @@ EVT_HANDLER_MASK(ChangeFilter, "Change Pixel Filter", CMDEN_NREC_ANY) } wxString msg; - msg.Printf(_("Using pixel filter #%d"), gopts.filter); + msg.Printf(_("Using pixel filter %s"), pixel_filters->GetString(gopts.filter)); systemScreenMessage(msg); } diff --git a/src/wx/guiinit.cpp b/src/wx/guiinit.cpp index aa816a0c..01ff93d0 100644 --- a/src/wx/guiinit.cpp +++ b/src/wx/guiinit.cpp @@ -3701,6 +3701,10 @@ bool MainFrame::BindControls() rb->Hide(); #endif ch = GetValidatedChild(d, "Filter", wxGenericValidator(&gopts.filter)); + + // Save the Filters choice control to extract the names from the XRC. + pixel_filters = ch; + // these two are filled and/or hidden at dialog load time wxControl* pll; wxChoice* pl; diff --git a/src/wx/wxvbam.h b/src/wx/wxvbam.h index f81588ca..5c9334e3 100644 --- a/src/wx/wxvbam.h +++ b/src/wx/wxvbam.h @@ -382,6 +382,8 @@ private: // Load a named wxDialog from the XRC file wxDialog* LoadXRCropertySheetDialog(const char* name); + wxChoice* pixel_filters = nullptr; + #include "cmdhandlers.h" };