From e18fc3664650accd4a1fd03f167c9a045e2d6795 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Fri, 4 Feb 2022 16:24:26 -0800 Subject: [PATCH] wxT rework for common directory --- common/advanced_config.cpp | 22 +- common/array_axis.cpp | 8 +- common/asset_archive.cpp | 2 +- common/base_screen.cpp | 6 +- common/base_units.cpp | 4 +- common/bitmap_store.cpp | 10 +- common/build_version.cpp | 96 ++-- common/common.cpp | 2 +- common/dialog_about/AboutDialog_main.cpp | 468 +++++++++--------- common/dialog_about/dialog_about.cpp | 6 +- common/dialog_shim.cpp | 8 +- common/dialogs/dialog_configure_paths.cpp | 12 +- common/dialogs/panel_hotkeys_editor.cpp | 2 +- common/dialogs/panel_setup_netclasses.cpp | 2 +- common/dialogs/wx_html_report_panel.cpp | 30 +- common/drawing_sheet/drawing_sheet_parser.cpp | 4 +- common/drawing_sheet/ds_painter.cpp | 4 +- common/eda_base_frame.cpp | 46 +- common/eda_draw_frame.cpp | 8 +- common/eda_pattern_match.cpp | 42 +- common/eda_shape.cpp | 16 +- common/env_paths.cpp | 6 +- common/env_vars.cpp | 42 +- common/exceptions.cpp | 2 +- common/executable_names.cpp | 28 +- common/filename_resolver.cpp | 160 +++--- common/footprint_filter.cpp | 2 +- common/footprint_info.cpp | 4 +- common/fp_lib_table.cpp | 2 +- common/gal/dpi_scaling.cpp | 12 +- common/gal/gal_display_options.cpp | 10 +- common/gal/opengl/cached_container_gpu.cpp | 12 +- common/gal/opengl/cached_container_ram.cpp | 2 +- common/gal/opengl/opengl_gal.cpp | 10 +- common/gal/opengl/utils.cpp | 34 +- common/hash_eda.cpp | 2 +- common/hotkeys_basic.cpp | 16 +- common/kicad_curl/kicad_curl_easy.cpp | 18 +- common/kiid.cpp | 4 +- common/launch_ext.cpp | 2 +- common/lib_table_base.cpp | 6 +- common/lib_tree_model.cpp | 2 +- common/lib_tree_model_adapter.cpp | 6 +- common/lockfile.cpp | 18 +- common/paths.cpp | 34 +- common/pgm_base.cpp | 56 +-- common/plotters/GERBER_plotter.cpp | 8 +- common/plotters/HPGL_plotter.cpp | 2 +- common/plotters/PDF_plotter.cpp | 2 +- common/plotters/common_plot_functions.cpp | 2 +- common/plugins/altium/altium_parser.cpp | 8 +- common/plugins/altium/altium_parser.h | 2 +- common/plugins/altium/altium_parser_utils.cpp | 14 +- .../cadstar/cadstar_archive_parser.cpp | 6 +- common/plugins/eagle/eagle_parser.cpp | 394 +++++++-------- common/preview_items/arc_assistant.cpp | 2 +- common/preview_items/preview_utils.cpp | 4 +- common/preview_items/ruler_item.cpp | 8 +- common/preview_items/two_point_assistant.cpp | 8 +- common/project.cpp | 8 +- common/property_mgr.cpp | 6 +- common/refdes_utils.cpp | 2 +- common/reporter.cpp | 2 +- common/scintilla_tricks.cpp | 2 +- common/search_stack.cpp | 4 +- common/searchhelpfilefullpath.cpp | 22 +- common/single_top.cpp | 6 +- common/string_utils.cpp | 78 +-- common/tool/action_manager.cpp | 16 +- common/tool/action_menu.cpp | 10 +- common/tool/action_toolbar.cpp | 6 +- common/tool/common_control.cpp | 56 +-- common/tool/common_tools.cpp | 6 +- common/tool/tool_action.cpp | 2 +- common/tool/tool_dispatcher.cpp | 14 +- common/tool/tool_event.cpp | 2 +- common/tool/tool_manager.cpp | 36 +- common/trace_helpers.cpp | 24 +- common/utf8.cpp | 8 +- common/validators.cpp | 2 +- common/view/view.cpp | 4 +- common/widgets/color_swatch.cpp | 2 +- common/widgets/footprint_choice.cpp | 10 +- common/widgets/footprint_select_widget.cpp | 4 +- common/widgets/grid_bitmap_toggle.cpp | 2 +- common/widgets/number_badge.cpp | 4 +- common/widgets/split_button.cpp | 2 +- common/widgets/ui_common.cpp | 4 +- common/widgets/widget_hotkey_list.cpp | 12 +- common/widgets/wx_ellipsized_static_text.cpp | 2 +- common/widgets/wx_grid.cpp | 6 +- common/wildcards_and_files_ext.cpp | 12 +- 92 files changed, 1062 insertions(+), 1062 deletions(-) diff --git a/common/advanced_config.cpp b/common/advanced_config.cpp index 362d03fb14..a652bd18a2 100644 --- a/common/advanced_config.cpp +++ b/common/advanced_config.cpp @@ -194,7 +194,7 @@ static const wxChar AllowManualCanvasScale[] = wxT( "AllowManualCanvasScale" ); */ wxString dumpParamCfg( const PARAM_CFG& aParam ) { - wxString s = aParam.m_Ident + ": "; + wxString s = aParam.m_Ident + wxT( ": " ); /* * This implementation is rather simplistic, but it is @@ -217,9 +217,9 @@ wxString dumpParamCfg( const PARAM_CFG& aParam ) s << *static_cast( aParam ).m_Pt_param; break; case paramcfg_id::PARAM_BOOL: - s << ( *static_cast( aParam ).m_Pt_param ? "true" : "false" ); + s << ( *static_cast( aParam ).m_Pt_param ? wxT( "true" ) : wxT( "false" ) ); break; - default: s << "Unsupported PARAM_CFG variant: " << aParam.m_Type; + default: s << wxT( "Unsupported PARAM_CFG variant: " ) << aParam.m_Type; } return s; @@ -249,14 +249,14 @@ static void dumpCfg( const std::vector& aArray ) */ static wxFileName getAdvancedCfgFilename() { - const static wxString cfg_filename{ "kicad_advanced" }; + const static wxString cfg_filename{ wxT( "kicad_advanced" ) }; return wxFileName( SETTINGS_MANAGER::GetUserSettingsPath(), cfg_filename ); } ADVANCED_CFG::ADVANCED_CFG() { - wxLogTrace( AdvancedConfigMask, "Init advanced config" ); + wxLogTrace( AdvancedConfigMask, wxT( "Init advanced config" ) ); // Init defaults - this is done in case the config doesn't exist, // then the values will remain as set here. @@ -313,7 +313,7 @@ void ADVANCED_CFG::loadFromConfigFile() if( !k_advanced.FileExists() ) { - wxLogTrace( AdvancedConfigMask, "File does not exist %s", k_advanced.GetFullPath() ); + wxLogTrace( AdvancedConfigMask, wxT( "File does not exist %s" ), k_advanced.GetFullPath() ); // load the defaults wxConfig emptyConfig; @@ -322,9 +322,9 @@ void ADVANCED_CFG::loadFromConfigFile() return; } - wxLogTrace( AdvancedConfigMask, "Loading advanced config from: %s", k_advanced.GetFullPath() ); + wxLogTrace( AdvancedConfigMask, wxT( "Loading advanced config from: %s" ), k_advanced.GetFullPath() ); - wxFileConfig file_cfg( "", "", k_advanced.GetFullPath() ); + wxFileConfig file_cfg( wxT( "" ), wxT( "" ), k_advanced.GetFullPath() ); loadSettings( file_cfg ); } @@ -414,14 +414,14 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg ) // Special case for trace mask setting...we just grab them and set them immediately // Because we even use wxLogTrace inside of advanced config - wxString traceMasks = ""; - configParams.push_back( new PARAM_CFG_WXSTRING( true, AC_KEYS::TraceMasks, &traceMasks, "" ) ); + wxString traceMasks = wxT( "" ); + configParams.push_back( new PARAM_CFG_WXSTRING( true, AC_KEYS::TraceMasks, &traceMasks, wxT( "" ) ) ); // Load the config from file wxConfigLoadSetups( &aCfg, configParams ); // Now actually set the trace masks - wxStringTokenizer traceMaskTokenizer( traceMasks, "," ); + wxStringTokenizer traceMaskTokenizer( traceMasks, wxT( "," ) ); while( traceMaskTokenizer.HasMoreTokens() ) { diff --git a/common/array_axis.cpp b/common/array_axis.cpp index 507a2bfc4a..80c55f64a5 100644 --- a/common/array_axis.cpp +++ b/common/array_axis.cpp @@ -42,10 +42,10 @@ ARRAY_AXIS::ARRAY_AXIS() : m_type( NUMBERING_TYPE::NUMBERING_NUMERIC ), m_offset const wxString& ARRAY_AXIS::GetAlphabet() const { - static const wxString alphaNumeric = "0123456789"; - static const wxString alphaHex = "0123456789ABCDEF"; - static const wxString alphaFull = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - static const wxString alphaNoIOSQXZ = "ABCDEFGHJKLMNPRTUVWY"; + static const wxString alphaNumeric = wxT( "0123456789" ); + static const wxString alphaHex = wxT( "0123456789ABCDEF" ); + static const wxString alphaFull = wxT( "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ); + static const wxString alphaNoIOSQXZ = wxT( "ABCDEFGHJKLMNPRTUVWY" ); switch( m_type ) { diff --git a/common/asset_archive.cpp b/common/asset_archive.cpp index 65c3922925..05f7e13b0d 100644 --- a/common/asset_archive.cpp +++ b/common/asset_archive.cpp @@ -87,7 +87,7 @@ bool ASSET_ARCHIVE::Load() long ASSET_ARCHIVE::GetFileContents( const wxString& aFilePath, const unsigned char* aDest, size_t aMaxLen ) { - wxFAIL_MSG( "Unimplemented" ); + wxFAIL_MSG( wxT( "Unimplemented" ) ); return 0; } diff --git a/common/base_screen.cpp b/common/base_screen.cpp index dbfe507f30..af06d8b791 100644 --- a/common/base_screen.cpp +++ b/common/base_screen.cpp @@ -73,7 +73,7 @@ const wxString& BASE_SCREEN::GetPageNumber() const static wxString pageNumber; if( m_pageNumber.IsEmpty() ) - pageNumber.Printf( "%d", m_virtualPageNumber ); + pageNumber.Printf( wxT( "%d" ), m_virtualPageNumber ); else pageNumber = m_pageNumber; @@ -86,9 +86,9 @@ const wxString& BASE_SCREEN::GetPageNumber() const void BASE_SCREEN::Show( int nestLevel, std::ostream& os ) const { // for now, make it look like XML, expand on this later. - NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() << ">\n"; + NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() << wxT( ">\n" ); - NestedSpace( nestLevel, os ) << "\n"; + NestedSpace( nestLevel, os ) << wxT( "\n" ); } #endif diff --git a/common/base_units.cpp b/common/base_units.cpp index 6e09de66f5..f8e1c55941 100644 --- a/common/base_units.cpp +++ b/common/base_units.cpp @@ -181,7 +181,7 @@ wxString MessageTextFromValue( EDA_UNITS aUnits, double aValue, bool aAddUnitLab if( aAddUnitLabel ) { - text += " "; + text += wxT( " " ); text += GetAbbreviatedUnitsLabel( aUnits, aType ); } @@ -352,7 +352,7 @@ double DoubleValueFromString( EDA_UNITS aUnits, const wxString& aTextValue, EDA_ { aUnits = EDA_UNITS::INCHES; } - else if( unit == "oz" ) // 1 oz = 1.37 mils + else if( unit == wxT( "oz" ) ) // 1 oz = 1.37 mils { aUnits = EDA_UNITS::MILS; dtmp *= 1.37; diff --git a/common/bitmap_store.cpp b/common/bitmap_store.cpp index 65b48fc26d..7a43d55881 100644 --- a/common/bitmap_store.cpp +++ b/common/bitmap_store.cpp @@ -101,7 +101,7 @@ BITMAP_STORE::BITMAP_STORE() { wxFileName path( PATHS::GetStockDataPath() + wxT( "/resources" ), IMAGE_ARCHIVE ); - wxLogTrace( traceBitmaps, "Loading bitmaps from " + path.GetFullPath() ); + wxLogTrace( traceBitmaps, wxT( "Loading bitmaps from " ) + path.GetFullPath() ); m_archive = std::make_unique( path.GetFullPath() ); @@ -148,8 +148,8 @@ wxImage BITMAP_STORE::getImage( BITMAPS aBitmapId, int aHeight ) if( count < 0 ) { - wxLogTrace( traceBitmaps, "Bitmap for %d, %d, %s has an info tag with file %s," - "but that file could not be found in the archive!", + wxLogTrace( traceBitmaps, wxT( "Bitmap for %d, %d, %s has an info tag with file %s," ) + wxT( "but that file could not be found in the archive!" ), aBitmapId, aHeight, m_theme ); data = s_imageNotFound; count = sizeof( s_imageNotFound ); @@ -205,7 +205,7 @@ wxString BITMAP_STORE::computeBitmapName( BITMAPS aBitmapId, int aHeight ) { if( !m_bitmapInfoCache.count( aBitmapId ) ) { - wxLogTrace( traceBitmaps, "No bitmap info available for %d", aBitmapId ); + wxLogTrace( traceBitmaps, wxT( "No bitmap info available for %d" ), aBitmapId ); return wxEmptyString; } @@ -225,7 +225,7 @@ wxString BITMAP_STORE::computeBitmapName( BITMAPS aBitmapId, int aHeight ) if( fn.IsEmpty() ) { - wxLogTrace( traceBitmaps, "No bitmap found matching ID %d, height %d, theme %s", + wxLogTrace( traceBitmaps, wxT( "No bitmap found matching ID %d, height %d, theme %s" ), aBitmapId, aHeight, m_theme ); return m_bitmapInfoCache.at( aBitmapId ).begin()->filename; } diff --git a/common/build_version.cpp b/common/build_version.cpp index ff3c87e68c..02c5486f2b 100644 --- a/common/build_version.cpp +++ b/common/build_version.cpp @@ -95,42 +95,42 @@ wxString GetVersionInfoData( const wxString& aTitle, bool aHtml, bool aBrief ) wxString aMsg; // DO NOT translate information in the msg_version string - wxString eol = aHtml ? "
" : "\n"; + wxString eol = aHtml ? wxT( "
" ) : wxT( "\n" ); // Tabs instead of spaces for the plaintext version for shorter string length - wxString indent4 = aHtml ? "    " : "\t"; + wxString indent4 = aHtml ? wxT( "    " ) : wxT( "\t" ); -#define ON "ON" << eol -#define OFF "OFF" << eol +#define ON wxT( "ON" ) << eol +#define OFF wxT( "OFF" ) << eol wxString version; - version << ( KIPLATFORM::APP::IsOperatingSystemUnsupported() ? "(UNSUPPORTED)" + version << ( KIPLATFORM::APP::IsOperatingSystemUnsupported() ? wxT( "(UNSUPPORTED)" ) : GetBuildVersion() ) #ifdef DEBUG - << ", debug" + << wxT( ", debug" ) #else - << ", release" + << wxT( ", release" ) #endif - << " build"; + << wxT( " build" ); wxPlatformInfo platform; - aMsg << "Application: " << aTitle; + aMsg << wxT( "Application: " ) << aTitle; #if defined( KICAD_BUILD_ARCH_X64 ) - aMsg << " (64-bit)"; + aMsg << wxT( " (64-bit)" ); #elif defined( KICAD_BUILD_ARCH_X86 ) - aMsg << " (32-bit)"; + aMsg << wxT( " (32-bit)" ); #elif defined( KICAD_BUILD_ARCH_ARM ) - aMsg << " (ARM 32-bit)"; + aMsg << wxT( " (ARM 32-bit)" ); #elif defined( KICAD_BUILD_ARCH_ARM64 ) - aMsg << " (ARM 64-bit)"; + aMsg << wxT( " (ARM 64-bit)" ); #endif aMsg << eol << eol; - aMsg << "Version: " << version << eol << eol; - aMsg << "Libraries:" << eol; + aMsg << wxT( "Version: " ) << version << eol << eol; + aMsg << wxT( "Libraries:" ) << eol; aMsg << indent4 << wxGetLibraryVersionInfo().GetVersionString() << eol; @@ -139,26 +139,26 @@ wxString GetVersionInfoData( const wxString& aTitle, bool aHtml, bool aBrief ) aMsg << eol; - aMsg << "Platform: " << wxGetOsDescription() << ", " - << GetPlatformGetBitnessName() << ", " - << platform.GetEndiannessName() << ", " + aMsg << wxT( "Platform: " ) << wxGetOsDescription() << wxT( ", " ) + << GetPlatformGetBitnessName() << wxT( ", " ) + << platform.GetEndiannessName() << wxT( ", " ) << platform.GetPortIdName(); #ifdef __WXGTK__ - aMsg << ", " << wxGetenv( "XDG_SESSION_DESKTOP" ) - << ", " << wxGetenv( "XDG_SESSION_TYPE" ); + aMsg << wxT( ", " ) << wxGetenv( wxT( "XDG_SESSION_DESKTOP" ) ) + << wxT( ", " ) << wxGetenv( wxT( "XDG_SESSION_TYPE" ) ); #endif aMsg << eol << eol; if( !aBrief ) { - aMsg << "Build Info:" << eol; - aMsg << indent4 << "Date: " << GetBuildDate() << eol; + aMsg << wxT( "Build Info:" ) << eol; + aMsg << indent4 << wxT( "Date: " ) << GetBuildDate() << eol; } - aMsg << indent4 << "wxWidgets: " << wxVERSION_NUM_DOT_STRING << " ("; - aMsg << __WX_BO_UNICODE __WX_BO_STL __WX_BO_WXWIN_COMPAT_2_8 ")"; + aMsg << indent4 << wxT( "wxWidgets: " ) << wxVERSION_NUM_DOT_STRING << wxT( " (" ); + aMsg << __WX_BO_UNICODE __WX_BO_STL __WX_BO_WXWIN_COMPAT_2_8 wxT( ")" ); // Get the GTK+ version where possible. #ifdef __WXGTK__ @@ -166,68 +166,68 @@ wxString GetVersionInfoData( const wxString& aTitle, bool aHtml, bool aBrief ) major = wxPlatformInfo().Get().GetToolkitMajorVersion(); minor = wxPlatformInfo().Get().GetToolkitMinorVersion(); - aMsg << " GTK+ " << major << "." << minor; + aMsg << wxT( " GTK+ " ) << major << wxT( "." ) << minor; #endif aMsg << eol; - aMsg << indent4 << "Boost: " << ( BOOST_VERSION / 100000 ) << wxT( "." ) + aMsg << indent4 << wxT( "Boost: " ) << ( BOOST_VERSION / 100000 ) << wxT( "." ) << ( BOOST_VERSION / 100 % 1000 ) << wxT( "." ) << ( BOOST_VERSION % 100 ) << eol; #ifdef KICAD_USE_OCC - aMsg << indent4 << "OCC: " << OCC_VERSION_COMPLETE << eol; + aMsg << indent4 << wxT( "OCC: " ) << OCC_VERSION_COMPLETE << eol; #endif - aMsg << indent4 << "Curl: " << GetCurlLibVersion() << eol; + aMsg << indent4 << wxT( "Curl: " ) << GetCurlLibVersion() << eol; #if defined( KICAD_SPICE ) #if defined( NGSPICE_BUILD_VERSION ) - aMsg << indent4 << "ngspice: " << NGSPICE_BUILD_VERSION << eol; + aMsg << indent4 << wxT( "ngspice: " ) << NGSPICE_BUILD_VERSION << eol; #elif defined( NGSPICE_HAVE_CONFIG_H ) #undef HAVE_STRNCASECMP /* is redefined in ngspice/config.h */ #include - aMsg << indent4 << "ngspice: " << PACKAGE_VERSION << eol; + aMsg << indent4 << wxT( "ngspice: " ) << PACKAGE_VERSION << eol; #elif defined( NGSPICE_PACKAGE_VERSION ) - aMsg << indent4 << "ngspice: " << NGSPICE_PACKAGE_VERSION << eol; + aMsg << indent4 << wxT( "ngspice: " ) << NGSPICE_PACKAGE_VERSION << eol; #else - aMsg << indent4 << "ngspice: " << "unknown" << eol; + aMsg << indent4 << wxT( "ngspice: " ) << wxT( "unknown" ) << eol; #endif #endif - aMsg << indent4 << "Compiler: "; + aMsg << indent4 << wxT( "Compiler: " ); #if defined(__clang__) - aMsg << "Clang " << __clang_major__ << "." << __clang_minor__ << "." << __clang_patchlevel__; + aMsg << wxT( "Clang " ) << __clang_major__ << wxT( "." ) << __clang_minor__ << wxT( "." ) << __clang_patchlevel__; #elif defined(__GNUG__) - aMsg << "GCC " << __GNUC__ << "." << __GNUC_MINOR__ << "." << __GNUC_PATCHLEVEL__; + aMsg << wxT( "GCC " ) << __GNUC__ << wxT( "." ) << __GNUC_MINOR__ << wxT( "." ) << __GNUC_PATCHLEVEL__; #elif defined(_MSC_VER) - aMsg << "Visual C++ " << _MSC_VER; + aMsg << wxT( "Visual C++ " ) << _MSC_VER; #elif defined(__INTEL_COMPILER) - aMsg << "Intel C++ " << __INTEL_COMPILER; + aMsg << wxT( "Intel C++ " ) << __INTEL_COMPILER; #else - aMsg << "Other Compiler "; + aMsg << wxT( "Other Compiler " ); #endif #if defined(__GXX_ABI_VERSION) - aMsg << " with C++ ABI " << __GXX_ABI_VERSION << eol; + aMsg << wxT( " with C++ ABI " ) << __GXX_ABI_VERSION << eol; #else - aMsg << " without C++ ABI" << eol; + aMsg << wxT( " without C++ ABI" ) << eol; #endif aMsg << eol; // Add build settings config (build options): - aMsg << "Build settings:" << eol; + aMsg << wxT( "Build settings:" ) << eol; #ifdef KICAD_USE_OCC - aMsg << indent4 << "KICAD_USE_OCC=" << ON; + aMsg << indent4 << wxT( "KICAD_USE_OCC=" ) << ON; #endif #ifdef KICAD_USE_EGL - aMsg << indent4 << "KICAD_USE_EGL=" << ON; + aMsg << indent4 << wxT( "KICAD_USE_EGL=" ) << ON; #endif - aMsg << indent4 << "KICAD_SPICE="; + aMsg << indent4 << wxT( "KICAD_SPICE=" ); #ifdef KICAD_SPICE aMsg << ON; #else @@ -235,12 +235,12 @@ wxString GetVersionInfoData( const wxString& aTitle, bool aHtml, bool aBrief ) #endif #ifndef NDEBUG - aMsg << indent4 << "KICAD_STDLIB_DEBUG="; + aMsg << indent4 << wxT( "KICAD_STDLIB_DEBUG=" ); #ifdef KICAD_STDLIB_DEBUG aMsg << ON; #else aMsg << OFF; - aMsg << indent4 << "KICAD_STDLIB_LIGHT_DEBUG="; + aMsg << indent4 << wxT( "KICAD_STDLIB_LIGHT_DEBUG=" ); #ifdef KICAD_STDLIB_LIGHT_DEBUG aMsg << ON; #else @@ -248,14 +248,14 @@ wxString GetVersionInfoData( const wxString& aTitle, bool aHtml, bool aBrief ) #endif #endif - aMsg << indent4 << "KICAD_SANITIZE_ADDRESS="; + aMsg << indent4 << wxT( "KICAD_SANITIZE_ADDRESS=" ); #ifdef KICAD_SANITIZE_ADDRESS aMsg << ON; #else aMsg << OFF; #endif - aMsg << indent4 << "KICAD_SANITIZE_THREADS="; + aMsg << indent4 << wxT( "KICAD_SANITIZE_THREADS=" ); #ifdef KICAD_SANITIZE_THREADS aMsg << ON; #else diff --git a/common/common.cpp b/common/common.cpp index 5ea1bcd868..fcdbbbb4cc 100644 --- a/common/common.cpp +++ b/common/common.cpp @@ -102,7 +102,7 @@ wxString ExpandTextVars( const wxString& aSource, else { // Token not resolved: leave the reference unchanged - newbuf.append( "${" + token + "}" ); + newbuf.append( wxT( "${" ) + token + wxT( "}" ) ); } } else diff --git a/common/dialog_about/AboutDialog_main.cpp b/common/dialog_about/AboutDialog_main.cpp index 8cda23f0ee..b55993753e 100644 --- a/common/dialog_about/AboutDialog_main.cpp +++ b/common/dialog_about/AboutDialog_main.cpp @@ -68,14 +68,14 @@ static void buildKicadAboutBanner( EDA_BASE_FRAME* aParent, ABOUT_APP_INFO& aInf /* KiCad build version */ wxString version; - version << ( KIPLATFORM::APP::IsOperatingSystemUnsupported() ? "(UNSUPPORTED)" + version << ( KIPLATFORM::APP::IsOperatingSystemUnsupported() ? wxT( "(UNSUPPORTED)" ) : GetBuildVersion() ) #ifdef DEBUG - << ", debug" + << wxT( ", debug" ) #else - << ", release" + << wxT( ", release" ) #endif - << " build"; + << wxT( " build" ); aInfo.SetBuildVersion( version ); aInfo.SetBuildDate( GetBuildDate() ); @@ -93,15 +93,15 @@ static void buildKicadAboutBanner( EDA_BASE_FRAME* aParent, ABOUT_APP_INFO& aInf // Just in case someone builds KiCad with the platform native of Boost instead of // the version included with the KiCad source. - libVersion << "and Boost " << ( BOOST_VERSION / 100000 ) << "." - << ( BOOST_VERSION / 100 % 1000 ) << "." << ( BOOST_VERSION % 100 ) - << "\n"; + libVersion << wxT( "and Boost " ) << ( BOOST_VERSION / 100000 ) << wxT( "." ) + << ( BOOST_VERSION / 100 % 1000 ) << wxT( "." ) << ( BOOST_VERSION % 100 ) + << wxT( "\n" ); // Operating System Information wxPlatformInfo platformInfo; - libVersion << "Platform: " << wxGetOsDescription() << ", " + libVersion << wxT( "Platform: " ) << wxGetOsDescription() << wxT( ", " ) // TODO (ISM): Readd conditional once our wx fork and flatpaks are running released 3.1.5 #if 0 && wxCHECK_VERSION( 3, 1, 5 ) << platformInfo.GetBitnessName(); @@ -117,64 +117,64 @@ static void buildKicadAboutBanner( EDA_BASE_FRAME* aParent, ABOUT_APP_INFO& aInf wxString description; /* short description */ - description << "

"; - description << "" + description << wxT( "

" ); + description << wxT( "" ) << _( "Description" ) - << ""; // bold & underlined font for caption + << wxT( "" ); // bold & underlined font for caption - description << "

" + description << wxT( "

" ) << _( "The KiCad EDA Suite is a set of open source applications for the " "creation of electronic schematics and printed circuit boards." ) - << "

"; + << wxT( "

" ); - description << "

"; + description << wxT( "

" ); /* websites */ - description << "

" + description << wxT( "

" ) << _( "KiCad on the web" ) - << ""; // bold & underlined font for caption + << wxT( "" ); // bold & underlined font for caption // bullet-ed list with some http links - description << "

    "; - description << "
  • " + description << wxT( "
      " ); + description << wxT( "
    • " ) << _( "The official KiCad website - " ) - << HtmlHyperlink( "http://www.kicad.org" ) - << "
    • "; - description << "
    • " + << HtmlHyperlink( wxT( "http://www.kicad.org" ) ) + << wxT( "
    • " ); + description << wxT( "
    • " ) << _( "Developer website - " ) - << HtmlHyperlink( "https://go.kicad.org/dev" ) - << "
    • "; + << HtmlHyperlink( wxT( "https://go.kicad.org/dev" ) ) + << wxT( "" ); - description << "
    • " + description << wxT( "
    • " ) << _("Official KiCad library repositories - " ) - << HtmlHyperlink( "https://go.kicad.org/libraries" ) - << "
    • "; + << HtmlHyperlink( wxT( "https://go.kicad.org/libraries" ) ) + << wxT( "" ); - description << "

    "; + description << wxT( "

" ); - description << "

" + description << wxT( "

" ) << _( "Bug tracker" ) - << ""; // bold & underlined font caption + << wxT( "" ); // bold & underlined font caption // bullet-ed list with some http links - description << "

    "; - description << "
  • " + description << wxT( "
      " ); + description << wxT( "
    • " ) << _( "Report or examine bugs - " ) - << HtmlHyperlink( "https://go.kicad.org/bugs" ) - << "
    • "; - description << "

    "; + << HtmlHyperlink( wxT( "https://go.kicad.org/bugs" ) ) + << wxT( "
  • " ); + description << wxT( "

" ); - description << "

" + description << wxT( "

" ) << _( "KiCad users group and community" ) - << ""; // bold & underlined font caption + << wxT( "" ); // bold & underlined font caption - description << "

    "; - description << "
  • " + description << wxT( "
      " ); + description << wxT( "
    • " ) << _( "KiCad forum - " ) - << HtmlHyperlink( "https://go.kicad.org/forum" ) - << "
    • "; + << HtmlHyperlink( wxT( "https://go.kicad.org/forum" ) ) + << wxT( "" ); - description << "

    "; + description << wxT( "

" ); aInfo.SetDescription( description ); @@ -182,12 +182,12 @@ static void buildKicadAboutBanner( EDA_BASE_FRAME* aParent, ABOUT_APP_INFO& aInf // License information also HTML formatted: wxString license; license - << "
" + << wxT( "
" ) << HtmlNewline( 4 ) << _( "The complete KiCad EDA Suite is released under the" ) << HtmlNewline( 2 ) - << HtmlHyperlink( "http://www.gnu.org/licenses", + << HtmlHyperlink( wxT( "http://www.gnu.org/licenses" ), _( "GNU General Public License (GPL) version 3 or any later version" ) ) - << "
"; + << wxT( "
" ); aInfo.SetLicense( license ); @@ -208,20 +208,20 @@ static void buildKicadAboutBanner( EDA_BASE_FRAME* aParent, ABOUT_APP_INFO& aInf #define LEAD_DEV _( "Lead Development Team" ) #define FORMER_DEV _( "Lead Development Alumni" ) #define CONTRIB_DEV _( "Additional Contributions By") - aInfo.AddDeveloper( new CONTRIBUTOR( "Jean-Pierre Charras", LEAD_DEV, nullptr ) ); - aInfo.AddDeveloper( new CONTRIBUTOR( "Wayne Stambaugh", LEAD_DEV, nullptr ) ); + aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Jean-Pierre Charras" ), LEAD_DEV, nullptr ) ); + aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Wayne Stambaugh" ), LEAD_DEV, nullptr ) ); // Alphabetical after the first two - aInfo.AddDeveloper( new CONTRIBUTOR( "Jon Evans", LEAD_DEV, nullptr ) ); + aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Jon Evans" ), LEAD_DEV, nullptr ) ); aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Roberto Fernandez Bautista" ), LEAD_DEV, nullptr ) ); - aInfo.AddDeveloper( new CONTRIBUTOR( "Seth Hillbrand", LEAD_DEV, nullptr ) ); - aInfo.AddDeveloper( new CONTRIBUTOR( "Ian McInerney", LEAD_DEV, nullptr ) ); + aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Seth Hillbrand" ), LEAD_DEV, nullptr ) ); + aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Ian McInerney" ), LEAD_DEV, nullptr ) ); aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Orson (Maciej Sumiński)" ), LEAD_DEV, nullptr ) ); - aInfo.AddDeveloper( new CONTRIBUTOR( "Mark Roszko", LEAD_DEV, nullptr ) ); - aInfo.AddDeveloper( new CONTRIBUTOR( "Thomas Pointhuber", LEAD_DEV, nullptr ) ); - aInfo.AddDeveloper( new CONTRIBUTOR( "Mikolaj Wielgus", LEAD_DEV, nullptr ) ); - aInfo.AddDeveloper( new CONTRIBUTOR( "Tomasz Wlostowski", LEAD_DEV, nullptr ) ); - aInfo.AddDeveloper( new CONTRIBUTOR( "Jeff Young", LEAD_DEV, nullptr ) ); + aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Mark Roszko" ), LEAD_DEV, nullptr ) ); + aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Thomas Pointhuber" ), LEAD_DEV, nullptr ) ); + aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Mikolaj Wielgus" ), LEAD_DEV, nullptr ) ); + aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Tomasz Wlostowski" ), LEAD_DEV, nullptr ) ); + aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Jeff Young" ), LEAD_DEV, nullptr ) ); aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "John Beard" ), FORMER_DEV, nullptr ) ); aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Dick Hollenbeck" ), FORMER_DEV, nullptr ) ); @@ -533,13 +533,13 @@ static void buildKicadAboutBanner( EDA_BASE_FRAME* aParent, ABOUT_APP_INFO& aInf aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Nick Østergaard" ), CONTRIB_DEV, nullptr ) ); // The document writers - aInfo.AddDocWriter( new CONTRIBUTOR( "Jean-Pierre Charras" ) ); - aInfo.AddDocWriter( new CONTRIBUTOR( "Marco Ciampa" ) ); - aInfo.AddDocWriter( new CONTRIBUTOR( "Jon Evans" ) ); - aInfo.AddDocWriter( new CONTRIBUTOR( "Dick Hollenbeck" ) ); - aInfo.AddDocWriter( new CONTRIBUTOR( "Igor Plyatov" ) ); - aInfo.AddDocWriter( new CONTRIBUTOR( "Wayne Stambaugh" ) ); - aInfo.AddDocWriter( new CONTRIBUTOR( "Fabrizio Tappero" ) ); + aInfo.AddDocWriter( new CONTRIBUTOR( wxT( "Jean-Pierre Charras" ) ) ); + aInfo.AddDocWriter( new CONTRIBUTOR( wxT( "Marco Ciampa" ) ) ); + aInfo.AddDocWriter( new CONTRIBUTOR( wxT( "Jon Evans" ) ) ); + aInfo.AddDocWriter( new CONTRIBUTOR( wxT( "Dick Hollenbeck" ) ) ); + aInfo.AddDocWriter( new CONTRIBUTOR( wxT( "Igor Plyatov" ) ) ); + aInfo.AddDocWriter( new CONTRIBUTOR( wxT( "Wayne Stambaugh" ) ) ); + aInfo.AddDocWriter( new CONTRIBUTOR( wxT( "Fabrizio Tappero" ) ) ); /* The translators * As category the language to which the translation was done is used @@ -547,339 +547,339 @@ static void buildKicadAboutBanner( EDA_BASE_FRAME* aParent, ABOUT_APP_INFO& aInf aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Martin Kratoška" ), wxEmptyString, wxEmptyString, - "Czech (CS)" ) ); + wxT( "Czech (CS)" ) ) ); aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Radek Kuznik" ), wxEmptyString, wxEmptyString, - "Czech (CS)" ) ); + wxT( "Czech (CS)" ) ) ); aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Roman Ondráček" ), wxEmptyString, wxEmptyString, - "Czech (CS)" ) ); + wxT( "Czech (CS)" ) ) ); aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Jan Straka" ), wxEmptyString, wxEmptyString, - "Czech (CS)" ) ); + wxT( "Czech (CS)" ) ) ); aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Jan Vykydal" ), wxEmptyString, wxEmptyString, - "Czech (CS)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Jonathan Haas", + wxT( "Czech (CS)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Jonathan Haas" ), wxEmptyString, wxEmptyString, - "German (DE)" ) ); + wxT( "German (DE)" ) ) ); aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Mark Hämmerling" ), wxEmptyString, wxEmptyString, - "German (DE)" ) ); + wxT( "German (DE)" ) ) ); aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Mathias Neumann" ), wxEmptyString, wxEmptyString, - "German (DE)" ) ); + wxT( "German (DE)" ) ) ); aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Dominik Wernberger" ), wxEmptyString, wxEmptyString, - "German (DE)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Manolis Stefanis", + wxT( "German (DE)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Manolis Stefanis" ), wxEmptyString, wxEmptyString, - "Greek (el_GR)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Athanasios Vlastos", + wxT( "Greek (el_GR)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Athanasios Vlastos" ), wxEmptyString, wxEmptyString, - "Greek (el_GR)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Milonas Kostas", + wxT( "Greek (el_GR)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Milonas Kostas" ), wxEmptyString, wxEmptyString, - "Greek (el_GR)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Michail Misirlis", + wxT( "Greek (el_GR)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Michail Misirlis" ), wxEmptyString, wxEmptyString, - "Greek (el_GR)" ) ); + wxT( "Greek (el_GR)" ) ) ); aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Adolfo Jayme Barrientos" ), wxEmptyString, wxEmptyString, - "Spanish (ES)" ) ); + wxT( "Spanish (ES)" ) ) ); aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Roberto Fernandez Bautista" ), wxEmptyString, wxEmptyString, - "Spanish (ES)" ) ); + wxT( "Spanish (ES)" ) ) ); aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Augusto Fraga Giachero" ), wxEmptyString, wxEmptyString, - "Spanish (ES)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Pedro Martin del Valle", + wxT( "Spanish (ES)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Pedro Martin del Valle" ), wxEmptyString, wxEmptyString, - "Spanish (ES)" ) ); + wxT( "Spanish (ES)" ) ) ); aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Iñigo Figuero" ), wxEmptyString, wxEmptyString, - "Spanish (ES)" ) ); + wxT( "Spanish (ES)" ) ) ); aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Iñigo Zuluaga" ), wxEmptyString, wxEmptyString, - "Spanish (ES)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Vesa Solonen", + wxT( "Spanish (ES)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Vesa Solonen" ), wxEmptyString, wxEmptyString, - "Finnish (FI)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Alex Gellen", + wxT( "Finnish (FI)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Alex Gellen" ), wxEmptyString, wxEmptyString, - "Finnish (FI)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "J. Lavoie", + wxT( "Finnish (FI)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "J. Lavoie" ), wxEmptyString, wxEmptyString, - "Finnish (FI)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Purkka Koodari", + wxT( "Finnish (FI)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Purkka Koodari" ), wxEmptyString, wxEmptyString, - "Finnish (FI)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Ola Rinta-Koski", + wxT( "Finnish (FI)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Ola Rinta-Koski" ), wxEmptyString, wxEmptyString, - "Finnish (FI)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Riku Viitanen", + wxT( "Finnish (FI)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Riku Viitanen" ), wxEmptyString, wxEmptyString, - "Finnish (FI)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Simo Mattila", + wxT( "Finnish (FI)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Simo Mattila" ), wxEmptyString, wxEmptyString, - "Finnish (FI)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Jean-Pierre Charras", + wxT( "Finnish (FI)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Jean-Pierre Charras" ), wxEmptyString, wxEmptyString, - "French (FR)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Marco Ciampa", + wxT( "French (FR)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Marco Ciampa" ), wxEmptyString, wxEmptyString, - "Italian (IT)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Hiroshi Tokita", + wxT( "Italian (IT)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Hiroshi Tokita" ), wxEmptyString, wxEmptyString, - "Japanese (JA)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Kenta Yonekura", + wxT( "Japanese (JA)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Kenta Yonekura" ), wxEmptyString, wxEmptyString, - "Japanese (JA)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Ji Yoon Choi", - wxEmptyString, - wxEmptyString, - "Japanese (JA)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Hidemichi Gotou", - wxEmptyString, - wxEmptyString, - "Japanese (JA)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Kaoru Zenyouji", - wxEmptyString, - wxEmptyString, - "Japanese (JA)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Kinichiro Inoguchi", - wxEmptyString, - wxEmptyString, - "Japanese (JA)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Norio Suzuki", - wxEmptyString, - wxEmptyString, - "Japanese (JA)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "starfort-jp", - wxEmptyString, - wxEmptyString, - "Japanese (JA)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( wxT( "킴슨김랑기" ), - wxEmptyString, - wxEmptyString, - "Korean (KO)" ) ); + wxT( "Japanese (JA)" ) ) ); aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Ji Yoon Choi" ), wxEmptyString, wxEmptyString, - "Korean (KO)" ) ); + wxT( "Japanese (JA)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Hidemichi Gotou" ), + wxEmptyString, + wxEmptyString, + wxT( "Japanese (JA)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Kaoru Zenyouji" ), + wxEmptyString, + wxEmptyString, + wxT( "Japanese (JA)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Kinichiro Inoguchi" ), + wxEmptyString, + wxEmptyString, + wxT( "Japanese (JA)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Norio Suzuki" ), + wxEmptyString, + wxEmptyString, + wxT( "Japanese (JA)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "starfort-jp" ), + wxEmptyString, + wxEmptyString, + wxT( "Japanese (JA)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "킴슨김랑기" ), + wxEmptyString, + wxEmptyString, + wxT( "Korean (KO)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Ji Yoon Choi" ), + wxEmptyString, + wxEmptyString, + wxT( "Korean (KO)" ) ) ); aInfo.AddTranslator( new CONTRIBUTOR( wxT( "jeongsuAn" ), wxEmptyString, wxEmptyString, - "Korean (KO)" ) ); + wxT( "Korean (KO)" ) ) ); aInfo.AddTranslator( new CONTRIBUTOR( wxT( "이상수" ), wxEmptyString, wxEmptyString, - "Korean (KO)" ) ); + wxT( "Korean (KO)" ) ) ); aInfo.AddTranslator( new CONTRIBUTOR( wxT( "jehunseo" ), wxEmptyString, wxEmptyString, - "Korean (KO)" ) ); + wxT( "Korean (KO)" ) ) ); aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Uibeom Jung" ), wxEmptyString, wxEmptyString, - "Korean (KO)" ) ); + wxT( "Korean (KO)" ) ) ); aInfo.AddTranslator( new CONTRIBUTOR( wxT( "박준언" ), wxEmptyString, wxEmptyString, - "Korean (KO)" ) ); + wxT( "Korean (KO)" ) ) ); aInfo.AddTranslator( new CONTRIBUTOR( wxT( "방준영" ), wxEmptyString, wxEmptyString, - "Korean (KO)" ) ); + wxT( "Korean (KO)" ) ) ); aInfo.AddTranslator( new CONTRIBUTOR( wxT( "박기정" ), wxEmptyString, wxEmptyString, - "Korean (KO)" ) ); + wxT( "Korean (KO)" ) ) ); aInfo.AddTranslator( new CONTRIBUTOR( wxT( "hokim" ), wxEmptyString, wxEmptyString, - "Korean (KO)" ) ); + wxT( "Korean (KO)" ) ) ); aInfo.AddTranslator( new CONTRIBUTOR( wxT( "강명구" ), wxEmptyString, wxEmptyString, - "Korean (KO)" ) ); + wxT( "Korean (KO)" ) ) ); aInfo.AddTranslator( new CONTRIBUTOR( wxT( "서범기" ), wxEmptyString, wxEmptyString, - "Korean (KO)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Arend-Jan van Hilten", + wxT( "Korean (KO)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Arend-Jan van Hilten" ), wxEmptyString, wxEmptyString, - "Dutch (NL)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "CJ van der Hoeven", + wxT( "Dutch (NL)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "CJ van der Hoeven" ), wxEmptyString, wxEmptyString, - "Dutch (NL)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Pim Jansen", + wxT( "Dutch (NL)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Pim Jansen" ), wxEmptyString, wxEmptyString, - "Dutch (NL)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Allan Nordhøy", + wxT( "Dutch (NL)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Allan Nordhøy" ), wxEmptyString, wxEmptyString, - "Norwegian (NO)" ) ); + wxT( "Norwegian (NO)" ) ) ); aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Mateusz Skowroński" ), wxEmptyString, wxEmptyString, - "Polish (PL)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Kerusey Karyu", + wxT( "Polish (PL)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Kerusey Karyu" ), wxEmptyString, wxEmptyString, - "Polish (PL)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Mark Roszko", + wxT( "Polish (PL)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Mark Roszko" ), wxEmptyString, wxEmptyString, - "Polish (PL)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "ZbeeGin", + wxT( "Polish (PL)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "ZbeeGin" ), wxEmptyString, wxEmptyString, - "Polish (PL)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Augusto Fraga Giachero", + wxT( "Polish (PL)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Augusto Fraga Giachero" ), wxEmptyString, wxEmptyString, - "Brazilian Portuguese (PT_BR)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Wellington Terumi Uemura", + wxT( "Brazilian Portuguese (PT_BR)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Wellington Terumi Uemura" ), wxEmptyString, wxEmptyString, - "Brazilian Portuguese (PT_BR)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Augusto Fraga Giachero", + wxT( "Brazilian Portuguese (PT_BR)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Augusto Fraga Giachero" ), wxEmptyString, wxEmptyString, - "Portuguese (PT)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Renie Marquet", + wxT( "Portuguese (PT)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Renie Marquet" ), wxEmptyString, wxEmptyString, - "Portuguese (PT)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Rafael Silva", + wxT( "Portuguese (PT)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Rafael Silva" ), wxEmptyString, wxEmptyString, - "Portuguese (PT)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Igor Plyatov", + wxT( "Portuguese (PT)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Igor Plyatov" ), wxEmptyString, wxEmptyString, - "Russian (RU)" ) ); + wxT( "Russian (RU)" ) ) ); aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Дмитрий Дёмин" ), wxEmptyString, wxEmptyString, - "Russian (RU)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Andrey Fedorushkov", + wxT( "Russian (RU)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Andrey Fedorushkov" ), wxEmptyString, wxEmptyString, - "Russian (RU)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Eldar Khayrullin", + wxT( "Russian (RU)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Eldar Khayrullin" ), wxEmptyString, wxEmptyString, - "Russian (RU)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Konstantin Baranovskiy", + wxT( "Russian (RU)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Konstantin Baranovskiy" ), wxEmptyString, wxEmptyString, - "Russian (RU)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Axel Henriksson", + wxT( "Russian (RU)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Axel Henriksson" ), wxEmptyString, wxEmptyString, - "Swedish (SV)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Richard Jonsson", + wxT( "Swedish (SV)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Richard Jonsson" ), wxEmptyString, wxEmptyString, - "Swedish (SV)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Allan Nordhøy", + wxT( "Swedish (SV)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Allan Nordhøy" ), wxEmptyString, wxEmptyString, - "Swedish (SV)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Boonchai Kingrungped", + wxT( "Swedish (SV)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Boonchai Kingrungped" ), wxEmptyString, wxEmptyString, - "Thai (TH)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Liu Guang", + wxT( "Thai (TH)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Liu Guang" ), wxEmptyString, wxEmptyString, - "Simplified Chinese (zh_CN)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Taotieren", + wxT( "Simplified Chinese (zh_CN)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Taotieren" ), wxEmptyString, wxEmptyString, - "Simplified Chinese (zh_CN)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Dingzhong Chen", + wxT( "Simplified Chinese (zh_CN)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Dingzhong Chen" ), wxEmptyString, wxEmptyString, - "Simplified Chinese (zh_CN)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "David Chen", + wxT( "Simplified Chinese (zh_CN)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "David Chen" ), wxEmptyString, wxEmptyString, - "Simplified Chinese (zh_CN)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Rigo Ligo", + wxT( "Simplified Chinese (zh_CN)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Rigo Ligo" ), wxEmptyString, wxEmptyString, - "Simplified Chinese (zh_CN)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Tian Yunhao", + wxT( "Simplified Chinese (zh_CN)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Tian Yunhao" ), wxEmptyString, wxEmptyString, - "Simplified Chinese (zh_CN)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "David Chen", + wxT( "Simplified Chinese (zh_CN)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "David Chen" ), wxEmptyString, wxEmptyString, - "Traditional Chinese (zh_TW)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "kai chiao chuang", + wxT( "Traditional Chinese (zh_TW)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "kai chiao chuang" ), wxEmptyString, wxEmptyString, - "Traditional Chinese (zh_TW)" ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Taotieren", + wxT( "Traditional Chinese (zh_TW)" ) ) ); + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Taotieren" ), wxEmptyString, wxEmptyString, - "Traditional Chinese (zh_TW)" ) ); + wxT( "Traditional Chinese (zh_TW)" ) ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Remy Halvick", + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Remy Halvick" ), wxEmptyString, wxEmptyString, - "Other" ) ); + wxT( "Other" ) ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "David J S Briscoe", + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "David J S Briscoe" ), wxEmptyString, wxEmptyString, - "Other" ) ); + wxT( "Other" ) ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Dominique Laigle", + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Dominique Laigle" ), wxEmptyString, wxEmptyString, - "Other" ) ); + wxT( "Other" ) ) ); - aInfo.AddTranslator( new CONTRIBUTOR( "Paul Burke", + aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Paul Burke" ), wxEmptyString, wxEmptyString, - "Other" ) ); + wxT( "Other" ) ) ); // Program credits for 3d models @@ -899,33 +899,33 @@ static void buildKicadAboutBanner( EDA_BASE_FRAME* aParent, ABOUT_APP_INFO& aInf aInfo.AddLibrarian( new CONTRIBUTOR( wxT( "Evan Shultz"), LIBRARIANS, aInfo.CreateKiBitmap( BITMAPS::library ) ) ); #define MODELS_3D_CONTRIBUTION _( "3D models by" ) - aInfo.AddLibrarian( new CONTRIBUTOR( "Scripts by Maui", - "https://github.com/easyw", - "https://gitlab.com/kicad/libraries/kicad-packages3D-generator", + aInfo.AddLibrarian( new CONTRIBUTOR( wxT( "Scripts by Maui" ), + wxT( "https://github.com/easyw" ), + wxT( "https://gitlab.com/kicad/libraries/kicad-packages3D-generator" ), MODELS_3D_CONTRIBUTION, aInfo.CreateKiBitmap( BITMAPS::three_d ) ) ); - aInfo.AddLibrarian( new CONTRIBUTOR( "GitLab contributors", + aInfo.AddLibrarian( new CONTRIBUTOR( wxT( "GitLab contributors" ), wxEmptyString, - "https://gitlab.com/kicad/libraries/kicad-packages3D/-/graphs/master", + wxT( "https://gitlab.com/kicad/libraries/kicad-packages3D/-/graphs/master" ), MODELS_3D_CONTRIBUTION, aInfo.CreateKiBitmap( BITMAPS::three_d ) ) ); #define SYMBOL_LIB_CONTRIBUTION _( "Symbols by" ) - aInfo.AddLibrarian( new CONTRIBUTOR( "GitLab contributors", + aInfo.AddLibrarian( new CONTRIBUTOR( wxT( "GitLab contributors" ), wxEmptyString, - "https://gitlab.com/kicad/libraries/kicad-symbols/-/graphs/master", + wxT( "https://gitlab.com/kicad/libraries/kicad-symbols/-/graphs/master" ), SYMBOL_LIB_CONTRIBUTION, aInfo.CreateKiBitmap( BITMAPS::add_component ) ) ); #define FOOTPRINT_LIB_CONTRIBUTION _( "Footprints by" ) - aInfo.AddLibrarian( new CONTRIBUTOR( "Scripts by Thomas Pointhuber", + aInfo.AddLibrarian( new CONTRIBUTOR( wxT( "Scripts by Thomas Pointhuber" ), wxEmptyString, - "https://gitlab.com/kicad/libraries/kicad-footprint-generator", + wxT( "https://gitlab.com/kicad/libraries/kicad-footprint-generator" ), FOOTPRINT_LIB_CONTRIBUTION, aInfo.CreateKiBitmap( BITMAPS::module ) ) ); - aInfo.AddLibrarian( new CONTRIBUTOR( "GitLab contributors", + aInfo.AddLibrarian( new CONTRIBUTOR( wxT( "GitLab contributors" ), wxEmptyString, - "https://gitlab.com/kicad/libraries/kicad-footprints/-/graphs/master", + wxT( "https://gitlab.com/kicad/libraries/kicad-footprints/-/graphs/master" ), FOOTPRINT_LIB_CONTRIBUTION, aInfo.CreateKiBitmap( BITMAPS::module ) ) ); @@ -939,16 +939,16 @@ static void buildKicadAboutBanner( EDA_BASE_FRAME* aParent, ABOUT_APP_INFO& aInf wxEmptyString, wxEmptyString, ICON_CONTRIBUTION ) ); - aInfo.AddArtist( new CONTRIBUTOR( "Fabrizio Tappero", + aInfo.AddArtist( new CONTRIBUTOR( wxT( "Fabrizio Tappero" ), wxEmptyString, wxEmptyString, ICON_CONTRIBUTION ) ); // Program credits for package developers. - aInfo.AddPackager( new CONTRIBUTOR( "Steven Falco" ) ); - aInfo.AddPackager( new CONTRIBUTOR( "Jean-Samuel Reynaud" ) ); - aInfo.AddPackager( new CONTRIBUTOR( "Bernhard Stegmaier" ) ); - aInfo.AddPackager( new CONTRIBUTOR( "Adam Wolf" ) ); + aInfo.AddPackager( new CONTRIBUTOR( wxT( "Steven Falco" ) ) ); + aInfo.AddPackager( new CONTRIBUTOR( wxT( "Jean-Samuel Reynaud" ) ) ); + aInfo.AddPackager( new CONTRIBUTOR( wxT( "Bernhard Stegmaier" ) ) ); + aInfo.AddPackager( new CONTRIBUTOR( wxT( "Adam Wolf" ) ) ); aInfo.AddPackager( new CONTRIBUTOR( wxT( "Nick Østergaard" ) ) ); } @@ -981,9 +981,9 @@ static wxString HtmlHyperlink( const wxString& aUrl, const wxString& aDescriptio wxString hyperlink = wxEmptyString; if( aDescription.IsEmpty() ) - hyperlink << "" << aUrl << ""; + hyperlink << wxT( "" ) << aUrl << wxT( "" ); else - hyperlink << "" << aDescription << ""; + hyperlink << wxT( "" ) << aDescription << wxT( "" ); return hyperlink; } @@ -1001,7 +1001,7 @@ static wxString HtmlNewline( const unsigned int aCount ) wxString newlineTags = wxEmptyString; for( size_t i = 0; i"; + newlineTags << wxT( "
" ); return newlineTags; } diff --git a/common/dialog_about/dialog_about.cpp b/common/dialog_about/dialog_about.cpp index 5a5b2b08c1..c0acdb10b2 100644 --- a/common/dialog_about/dialog_about.cpp +++ b/common/dialog_about/dialog_about.cpp @@ -84,7 +84,7 @@ DIALOG_ABOUT::DIALOG_ABOUT( EDA_BASE_FRAME *aParent, ABOUT_APP_INFO& aAppInfo ) m_titleName = aParent->GetAboutTitle(); m_staticTextAppTitle->SetLabel( m_titleName ); m_staticTextCopyright->SetLabel( m_info.GetCopyright() ); - m_staticTextBuildVersion->SetLabel( "Version: " + m_info.GetBuildVersion() ); + m_staticTextBuildVersion->SetLabel( wxT( "Version: " ) + m_info.GetBuildVersion() ); m_staticTextLibVersion->SetLabel( m_info.GetLibVersion() ); SetTitle( wxString::Format( _( "About %s" ), m_titleName ) ); @@ -222,7 +222,7 @@ void DIALOG_ABOUT::createNotebookPageByCategory( wxNotebook* aParent, const wxSt // Of course the padding is different depending on the platform so we adjust the // padding accordingly. #if defined( __WXGTK__ ) - padding += " "; + padding += wxT( " " ); #endif wxPanel* outerPanel = new wxPanel( aParent ); wxBoxSizer* outerSizer = new wxBoxSizer( wxVERTICAL ); @@ -419,7 +419,7 @@ void DIALOG_ABOUT::createNotebookHtmlPage( wxNotebook* aParent, const wxString& wxStaticText* DIALOG_ABOUT::wxStaticTextRef( wxScrolledWindow* aParent, const wxString& aReference ) { wxStaticText* text = new wxStaticText( aParent, wxID_ANY, - wxT( "(" ) + aReference + wxT( ")" ) ); + wxT( "(wxT( " ) + aReference + wxT( " ))" ) ); return text; } diff --git a/common/dialog_shim.cpp b/common/dialog_shim.cpp index a5aff9ec8b..873ce88875 100644 --- a/common/dialog_shim.cpp +++ b/common/dialog_shim.cpp @@ -399,8 +399,8 @@ void DIALOG_SHIM::OnPaint( wxPaintEvent &event ) void DIALOG_SHIM::OnModify() { - if( !GetTitle().StartsWith( "*" ) ) - SetTitle( "*" + GetTitle() ); + if( !GetTitle().StartsWith( wxT( "*" ) ) ) + SetTitle( wxT( "*" ) + GetTitle() ); } @@ -488,8 +488,8 @@ void DIALOG_SHIM::EndQuasiModal( int retCode ) if( !IsQuasiModal() ) { - wxFAIL_MSG( "either DIALOG_SHIM::EndQuasiModal called twice or ShowQuasiModal" - "wasn't called" ); + wxFAIL_MSG( wxT( "either DIALOG_SHIM::EndQuasiModal called twice or ShowQuasiModal" ) + wxT( "wasn't called" ) ); return; } diff --git a/common/dialogs/dialog_configure_paths.cpp b/common/dialogs/dialog_configure_paths.cpp index 9c4d65d69b..6a6156efef 100644 --- a/common/dialogs/dialog_configure_paths.cpp +++ b/common/dialogs/dialog_configure_paths.cpp @@ -153,7 +153,7 @@ bool DIALOG_CONFIGURE_PATHS::TransferDataToWindow() for( auto it = paths->begin(); it != paths->end(); ++it ) { - if ( !( *it ).m_Alias.StartsWith( "${" ) && !( *it ).m_Alias.StartsWith( "$(" ) ) + if ( !( *it ).m_Alias.StartsWith( wxT( "${" ) ) && !( *it ).m_Alias.StartsWith( wxT( "$(" ) ) ) { AppendSearchPath( it->m_Alias, it->m_Pathvar, it->m_Description ); @@ -172,7 +172,7 @@ bool DIALOG_CONFIGURE_PATHS::TransferDataToWindow() const wxString& path = it->second.GetValue(); AppendEnvVar( it->first, path, it->second.GetDefinedExternally() ); - if( m_curdir.IsEmpty() && !path.StartsWith( "${" ) && !path.StartsWith( "$(" ) ) + if( m_curdir.IsEmpty() && !path.StartsWith( wxT( "${" ) ) && !path.StartsWith( wxT( "$(" ) ) ) m_curdir = path; } @@ -639,19 +639,19 @@ void DIALOG_CONFIGURE_PATHS::OnHelp( wxCommandEvent& event ) "level. Environment variables defined at the system or user level " "take precedence over the ones defined in this table. This means the " "values in this table are ignored." ); - msg << "

"; + msg << wxT( "

" ); msg << _( "To ensure environment variable names are valid on all platforms, the name field " "will only accept upper case letters, digits, and the underscore characters." ); - msg << ""; + msg << wxT( "
" ); for( const auto& var : ENV_VAR::GetPredefinedEnvVars() ) { - msg << "

" << var << ""; + msg << wxT( "

" ) << var << wxT( "" ); const auto desc = ENV_VAR::LookUpEnvVarHelp( var ); if( desc.size() > 0 ) - msg << ": " << desc; + msg << wxT( ": " ) << desc; } diff --git a/common/dialogs/panel_hotkeys_editor.cpp b/common/dialogs/panel_hotkeys_editor.cpp index cb520b011f..ef35f7217b 100644 --- a/common/dialogs/panel_hotkeys_editor.cpp +++ b/common/dialogs/panel_hotkeys_editor.cpp @@ -231,7 +231,7 @@ void PANEL_HOTKEYS_EDITOR::dumpHotkeys() wxFileName fn( filename ); - wxFFileOutputStream fileStream( fn.GetFullPath(), "w" ); + wxFFileOutputStream fileStream( fn.GetFullPath(), wxT( "w" ) ); wxTextOutputStream stream( fileStream ); if( !fn.IsDirWritable() || ( fn.Exists() && !fn.IsFileWritable() ) ) diff --git a/common/dialogs/panel_setup_netclasses.cpp b/common/dialogs/panel_setup_netclasses.cpp index def7f5b1a1..def0c53c63 100644 --- a/common/dialogs/panel_setup_netclasses.cpp +++ b/common/dialogs/panel_setup_netclasses.cpp @@ -384,7 +384,7 @@ static void gridRowToNetclass( EDA_UNITS aUnits, wxGrid* grid, int row, const NE nc->SetSchematicColor( wxColour( grid->GetCellValue( row, GRID_SCHEMATIC_COLOR ) ) ); nc->SetLineStyle( g_lineStyleNames.Index( grid->GetCellValue( row, GRID_LINESTYLE ) ) ); - wxASSERT_MSG( nc->GetLineStyle() >= 0, "Line style name not found." ); + wxASSERT_MSG( nc->GetLineStyle() >= 0, wxT( "Line style name not found." ) ); } diff --git a/common/dialogs/wx_html_report_panel.cpp b/common/dialogs/wx_html_report_panel.cpp index 5d07b7b10c..b22e5df984 100644 --- a/common/dialogs/wx_html_report_panel.cpp +++ b/common/dialogs/wx_html_report_panel.cpp @@ -189,20 +189,20 @@ wxString WX_HTML_REPORT_PANEL::generateHtml( const REPORT_LINE& aLine ) switch( aLine.severity ) { case RPT_SEVERITY_ERROR: - retv = "" + _( "Error:" ) + " " - "" + aLine.message + "
"; + retv = wxT( "" ) + _( "Error:" ) + " " + wxT( "" ) + aLine.message + wxT( "
" ); break; case RPT_SEVERITY_WARNING: - retv = "" + _( "Warning:" ) + wxS( " " ) + aLine.message + "
"; + retv = wxT( "" ) + _( "Warning:" ) + wxS( " " ) + aLine.message + "
"; break; case RPT_SEVERITY_INFO: - retv = "" + aLine.message + "
"; + retv = wxT( "" ) + aLine.message + wxT( "
" ); break; case RPT_SEVERITY_ACTION: - retv = "" + aLine.message + "
"; + retv = wxT( "" ) + aLine.message + wxT( "
" ); break; default: - retv = "" + aLine.message + "
"; + retv = wxT( "" ) + aLine.message + wxT( "
" ); } } else @@ -210,26 +210,26 @@ wxString WX_HTML_REPORT_PANEL::generateHtml( const REPORT_LINE& aLine ) switch( aLine.severity ) { case RPT_SEVERITY_ERROR: - retv = "" + _( "Error:" ) + " " - "" + aLine.message + "
"; + retv = wxT( "" ) + _( "Error:" ) + " " + wxT( "" ) + aLine.message + wxT( "
" ); break; case RPT_SEVERITY_WARNING: - retv = "" + _( "Warning:" ) + wxS( " " ) + aLine.message + "
"; + retv = wxT( "" ) + _( "Warning:" ) + wxS( " " ) + aLine.message + "
"; break; case RPT_SEVERITY_INFO: - retv = "" + aLine.message + "
"; + retv = wxT( "" ) + aLine.message + wxT( "
" ); break; case RPT_SEVERITY_ACTION: - retv = "" + aLine.message + "
"; + retv = wxT( "" ) + aLine.message + wxT( "
" ); break; default: - retv = "" + aLine.message + "
"; + retv = wxT( "" ) + aLine.message + wxT( "
" ); } } // wxHtmlWindow fails to do correct baseline alignment between Japanese/Chinese cells and // Roman cells. This keeps the line in a single cell. - retv.Replace( " ", " " ); + retv.Replace( wxT( " " ), wxT( " " ) ); return retv; } @@ -250,7 +250,7 @@ wxString WX_HTML_REPORT_PANEL::generatePlainText( const REPORT_LINE& aLine ) void WX_HTML_REPORT_PANEL::onRightClick( wxMouseEvent& event ) { wxMenu popup; - popup.Append( wxID_COPY, "Copy" ); + popup.Append( wxID_COPY, wxT( "Copy" ) ); PopupMenu( &popup ); } @@ -376,7 +376,7 @@ void WX_HTML_REPORT_PANEL::onBtnSaveToFile( wxCommandEvent& event ) if( fn.GetExt().IsEmpty() ) fn.SetExt( "txt" ); - wxFFile f( fn.GetFullPath(), "wb" ); + wxFFile f( fn.GetFullPath(), wxT( "wb" ) ); if( !f.IsOpened() ) { diff --git a/common/drawing_sheet/drawing_sheet_parser.cpp b/common/drawing_sheet/drawing_sheet_parser.cpp index 0b39e0a106..00c4787ddc 100644 --- a/common/drawing_sheet/drawing_sheet_parser.cpp +++ b/common/drawing_sheet/drawing_sheet_parser.cpp @@ -899,7 +899,7 @@ bool DS_DATA_MODEL::LoadDrawingSheet( const wxString& aFullFileName, bool Append } } - wxFFile wksFile( fullFileName, "rb" ); + wxFFile wksFile( fullFileName, wxT( "rb" ) ); if( ! wksFile.IsOpened() ) { @@ -939,7 +939,7 @@ bool DS_DATA_MODEL::LoadDrawingSheet( const wxString& aFullFileName, bool Append } catch( const std::bad_alloc& ) { - wxLogMessage( "Memory exhaustion reading drawing sheet" ); + wxLogMessage( wxT( "Memory exhaustion reading drawing sheet" ) ); return false; } } diff --git a/common/drawing_sheet/ds_painter.cpp b/common/drawing_sheet/ds_painter.cpp index ad4ad58f4d..7976286dc6 100644 --- a/common/drawing_sheet/ds_painter.cpp +++ b/common/drawing_sheet/ds_painter.cpp @@ -142,12 +142,12 @@ wxString DS_DRAW_ITEM_LIST::BuildFullText( const wxString& aTextbase ) } else if( token->IsSameAs( wxT( "PAPER" ) ) ) { - *token = m_paperFormat ? *m_paperFormat : wxString( "" ); + *token = m_paperFormat ? *m_paperFormat : wxString( wxT( "" ) ); tokenUpdated = true; } else if( token->IsSameAs( wxT( "LAYER" ) ) ) { - *token = m_sheetLayer ? *m_sheetLayer : wxString( "" ); + *token = m_sheetLayer ? *m_sheetLayer : wxString( wxT( "" ) ); tokenUpdated = true; } else if( m_titleBlock ) diff --git a/common/eda_base_frame.cpp b/common/eda_base_frame.cpp index 9fa852edee..a21b03d72b 100644 --- a/common/eda_base_frame.cpp +++ b/common/eda_base_frame.cpp @@ -183,7 +183,7 @@ wxWindow* EDA_BASE_FRAME::findQuasiModalDialog() // so we have to look for it separately. if( m_ident == FRAME_SCH ) { - wxWindow* cvpcb = wxWindow::FindWindowByName( "CvpcbFrame" ); + wxWindow* cvpcb = wxWindow::FindWindowByName( wxT( "CvpcbFrame" ) ); if( cvpcb ) return cvpcb; @@ -332,7 +332,7 @@ bool EDA_BASE_FRAME::doAutoSave() void EDA_BASE_FRAME::OnCharHook( wxKeyEvent& aKeyEvent ) { - wxLogTrace( kicadTraceKeyEvent, "EDA_BASE_FRAME::OnCharHook %s", dump( aKeyEvent ) ); + wxLogTrace( kicadTraceKeyEvent, wxT( "EDA_BASE_FRAME::OnCharHook %s" ), dump( aKeyEvent ) ); // Key events can be filtered here. // Currently no filtering is made. @@ -535,7 +535,7 @@ void EDA_BASE_FRAME::OnSize( wxSizeEvent& aEvent ) if( m_displayIndex >= 0 && currentDisplay >= 0 && currentDisplay != m_displayIndex ) { - wxLogTrace( traceDisplayLocation, "OnSize: current display changed %d to %d", + wxLogTrace( traceDisplayLocation, wxT( "OnSize: current display changed %d to %d" ), m_displayIndex, currentDisplay ); m_displayIndex = currentDisplay; ensureWindowIsOnScreen(); @@ -569,7 +569,7 @@ void EDA_BASE_FRAME::LoadWindowState( const WINDOW_STATE& aState ) m_frameSize.x = aState.size_x; m_frameSize.y = aState.size_y; - wxLogTrace( traceDisplayLocation, "Config position (%d, %d) with size (%d, %d)", + wxLogTrace( traceDisplayLocation, wxT( "Config position (%d, %d) with size (%d, %d)" ), m_framePos.x, m_framePos.y, m_frameSize.x, m_frameSize.y ); // Ensure minimum size is set if the stored config was zero-initialized @@ -578,15 +578,15 @@ void EDA_BASE_FRAME::LoadWindowState( const WINDOW_STATE& aState ) m_frameSize = defaultSize( m_ident ); wasDefault = true; - wxLogTrace( traceDisplayLocation, "Using minimum size (%d, %d)", + wxLogTrace( traceDisplayLocation, wxT( "Using minimum size (%d, %d)" ), m_frameSize.x, m_frameSize.y ); } - wxLogTrace( traceDisplayLocation, "Number of displays: %d", wxDisplay::GetCount() ); + wxLogTrace( traceDisplayLocation, wxT( "Number of displays: %d" ), wxDisplay::GetCount() ); if( aState.display >= wxDisplay::GetCount() ) { - wxLogTrace( traceDisplayLocation, "Previous display not found" ); + wxLogTrace( traceDisplayLocation, wxT( "Previous display not found" ) ); // If it isn't attached, use the first display // Warning wxDisplay has 2 ctor variants. the parameter needs a type: @@ -622,11 +622,11 @@ void EDA_BASE_FRAME::LoadWindowState( const WINDOW_STATE& aState ) upperLeft.y > yLimBottom ) { m_framePos = wxDefaultPosition; - wxLogTrace( traceDisplayLocation, "Resetting to default position" ); + wxLogTrace( traceDisplayLocation, wxT( "Resetting to default position" ) ); } } - wxLogTrace( traceDisplayLocation, "Final window position (%d, %d) with size (%d, %d)", + wxLogTrace( traceDisplayLocation, wxT( "Final window position (%d, %d) with size (%d, %d)" ), m_framePos.x, m_framePos.y, m_frameSize.x, m_frameSize.y ); SetSize( m_framePos.x, m_framePos.y, m_frameSize.x, m_frameSize.y ); @@ -634,7 +634,7 @@ void EDA_BASE_FRAME::LoadWindowState( const WINDOW_STATE& aState ) // Center the window if we reset to default if( m_framePos.x == -1 ) { - wxLogTrace( traceDisplayLocation, "Centering window" ); + wxLogTrace( traceDisplayLocation, wxT( "Centering window" ) ); Center(); m_framePos = GetPosition(); } @@ -646,7 +646,7 @@ void EDA_BASE_FRAME::LoadWindowState( const WINDOW_STATE& aState ) // Maximize if we were maximized before if( aState.maximized || ( wasDefault && m_maximizeByDefault ) ) { - wxLogTrace( traceDisplayLocation, "Maximizing window" ); + wxLogTrace( traceDisplayLocation, wxT( "Maximizing window" ) ); Maximize(); } @@ -662,13 +662,13 @@ void EDA_BASE_FRAME::ensureWindowIsOnScreen() wxSize size = GetWindowSize(); wxLogTrace( traceDisplayLocation, - "ensureWindowIsOnScreen: clientArea (%d, %d) w %d h %d", clientSize.x, clientSize.y, + wxT( "ensureWindowIsOnScreen: clientArea (%d, %d) w %d h %d" ), clientSize.x, clientSize.y, clientSize.width, clientSize.height ); if( pos.y < clientSize.y ) { wxLogTrace( traceDisplayLocation, - "ensureWindowIsOnScreen: y pos %d below minimum, setting to %d", pos.y, + wxT( "ensureWindowIsOnScreen: y pos %d below minimum, setting to %d" ), pos.y, clientSize.y ); pos.y = clientSize.y; } @@ -676,7 +676,7 @@ void EDA_BASE_FRAME::ensureWindowIsOnScreen() if( pos.x < clientSize.x ) { wxLogTrace( traceDisplayLocation, - "ensureWindowIsOnScreen: x pos %d is off the client rect, setting to %d", pos.x, + wxT( "ensureWindowIsOnScreen: x pos %d is off the client rect, setting to %d" ), pos.x, clientSize.x ); pos.x = clientSize.x; } @@ -685,7 +685,7 @@ void EDA_BASE_FRAME::ensureWindowIsOnScreen() { int newWidth = clientSize.width - ( pos.x - clientSize.x ); wxLogTrace( traceDisplayLocation, - "ensureWindowIsOnScreen: effective width %d above available %d, setting to %d", + wxT( "ensureWindowIsOnScreen: effective width %d above available %d, setting to %d" ), pos.x + size.x, clientSize.width, newWidth ); size.x = newWidth; } @@ -694,12 +694,12 @@ void EDA_BASE_FRAME::ensureWindowIsOnScreen() { int newHeight = clientSize.height - ( pos.y - clientSize.y ); wxLogTrace( traceDisplayLocation, - "ensureWindowIsOnScreen: effective height %d above available %d, setting to %d", + wxT( "ensureWindowIsOnScreen: effective height %d above available %d, setting to %d" ), pos.y + size.y, clientSize.height, newHeight ); size.y = newHeight; } - wxLogTrace( traceDisplayLocation, "Updating window position (%d, %d) with size (%d, %d)", + wxLogTrace( traceDisplayLocation, wxT( "Updating window position (%d, %d) with size (%d, %d)" ), pos.x, pos.y, size.x, size.y ); SetSize( pos.x, pos.y, size.x, size.y ); @@ -748,9 +748,9 @@ void EDA_BASE_FRAME::SaveWindowSettings( WINDOW_SETTINGS* aCfg ) aCfg->state.maximized = IsMaximized(); aCfg->state.display = wxDisplay::GetFromWindow( this ); - wxLogTrace( traceDisplayLocation, "Saving window maximized: %s", - IsMaximized() ? "true" : "false" ); - wxLogTrace( traceDisplayLocation, "Saving config position (%d, %d) with size (%d, %d)", + wxLogTrace( traceDisplayLocation, wxT( "Saving window maximized: %s" ), + IsMaximized() ? wxT( "true" ) : wxT( "false" ) ); + wxLogTrace( traceDisplayLocation, wxT( "Saving config position (%d, %d) with size (%d, %d)" ), m_framePos.x, m_framePos.y, m_frameSize.x, m_frameSize.y ); // TODO(JE) should auto-save in common settings be overwritten by every app? @@ -845,7 +845,7 @@ void EDA_BASE_FRAME::CreateInfoBar() #else m_infoBar = new WX_INFOBAR( this, &m_auimgr ); - m_auimgr.AddPane( m_infoBar, EDA_PANE().InfoBar().Name( "InfoBar" ).Top().Layer(1) ); + m_auimgr.AddPane( m_infoBar, EDA_PANE().InfoBar().Name( wxT( "InfoBar" ) ).Top().Layer(1) ); #endif } @@ -860,7 +860,7 @@ void EDA_BASE_FRAME::FinishAUIInitialization() m_auimgr.Update(); // We don't want the infobar displayed right away - m_auimgr.GetPane( "InfoBar" ).Hide(); + m_auimgr.GetPane( wxT( "InfoBar" ) ).Hide(); m_auimgr.Update(); #endif } @@ -1224,7 +1224,7 @@ void EDA_BASE_FRAME::OnMaximize( wxMaximizeEvent& aEvent ) m_normalFrameSize = GetWindowSize(); m_normalFramePos = GetPosition(); wxLogTrace( traceDisplayLocation, - "Maximizing window - Saving position (%d, %d) with size (%d, %d)", + wxT( "Maximizing window - Saving position (%d, %d) with size (%d, %d)" ), m_normalFramePos.x, m_normalFramePos.y, m_normalFrameSize.x, m_normalFrameSize.y ); } diff --git a/common/eda_draw_frame.cpp b/common/eda_draw_frame.cpp index c1b2460219..e55033de17 100644 --- a/common/eda_draw_frame.cpp +++ b/common/eda_draw_frame.cpp @@ -356,7 +356,7 @@ void EDA_DRAW_FRAME::PrintPage( const RENDER_SETTINGS* aSettings ) void EDA_DRAW_FRAME::OnSelectGrid( wxCommandEvent& event ) { - wxCHECK_RET( m_gridSelectBox, "m_gridSelectBox uninitialized" ); + wxCHECK_RET( m_gridSelectBox, wxT( "m_gridSelectBox uninitialized" ) ); int idx = m_gridSelectBox->GetCurrentSelection(); @@ -453,7 +453,7 @@ void EDA_DRAW_FRAME::UpdateZoomSelectBox() void EDA_DRAW_FRAME::OnSelectZoom( wxCommandEvent& event ) { - wxCHECK_RET( m_zoomSelectBox, "m_zoomSelectBox uninitialized" ); + wxCHECK_RET( m_zoomSelectBox, wxT( "m_zoomSelectBox uninitialized" ) ); int id = m_zoomSelectBox->GetCurrentSelection(); @@ -519,7 +519,7 @@ void EDA_DRAW_FRAME::DisplayGridMsg() { wxString line; - line.Printf( "grid %s", + line.Printf( wxT( "grid %s" ), MessageTextFromValue( GetUserUnits(), GetCanvas()->GetGAL()->GetGridSize().x, false ) ); @@ -990,7 +990,7 @@ bool EDA_DRAW_FRAME::LibraryFileBrowser( bool doOpen, wxFileName& aFilename, { // Ensure the file has a dummy name, otherwise GTK will display the regex from the filter if( aFilename.GetName().empty() ) - aFilename.SetName( "Library" ); + aFilename.SetName( wxT( "Library" ) ); if( !aIsGlobal && GetMruPath().IsEmpty() ) { diff --git a/common/eda_pattern_match.cpp b/common/eda_pattern_match.cpp index 7e45900799..720e1451eb 100644 --- a/common/eda_pattern_match.cpp +++ b/common/eda_pattern_match.cpp @@ -143,7 +143,7 @@ bool EDA_PATTERN_MATCH_WILDCARD::SetPattern( const wxString& aPattern ) } else if( to_replace.Find( c ) != wxNOT_FOUND ) { - regex += "\\"; + regex += wxT( "\\" ); regex += c; } else @@ -192,7 +192,7 @@ bool EDA_PATTERN_MATCH_WILDCARD_EXPLICIT::SetPattern( const wxString& aPattern ) } else if( to_replace.Find( c ) != wxNOT_FOUND ) { - regex += "\\"; + regex += wxT( "\\" ); regex += c; } else @@ -221,20 +221,20 @@ bool EDA_PATTERN_MATCH_RELATIONAL::SetPattern( const wxString& aPattern ) m_key = key.Lower(); - if( rel == "<" ) + if( rel == wxT( "<" ) ) m_relation = LT; - else if( rel == "<=" ) + else if( rel == wxT( "<=" ) ) m_relation = LE; - else if( rel == "=" ) + else if( rel == wxT( "=" ) ) m_relation = EQ; - else if( rel == ">=" ) + else if( rel == wxT( ">=" ) ) m_relation = GE; - else if( rel == ">" ) + else if( rel == wxT( ">" ) ) m_relation = GT; else return false; - if( val == "" ) + if( val == wxT( "" ) ) { // Matching on empty values keeps the match list from going empty when // the user types the relational operator character, which helps prevent @@ -333,19 +333,19 @@ wxRegEx EDA_PATTERN_MATCH_RELATIONAL::m_regex_description( wxRegEx EDA_PATTERN_MATCH_RELATIONAL::m_regex_search( R"(^(\w+)(<|<=|=|>=|>)([-+]?[\d.]*)(\w*)$)", wxRE_ADVANCED ); const std::map EDA_PATTERN_MATCH_RELATIONAL::m_units = { - { "p", 1e-12 }, - { "n", 1e-9 }, - { "u", 1e-6 }, - { "m", 1e-3 }, - { "", 1. }, - { "k", 1e3 }, - { "meg",1e6 }, - { "g", 1e9 }, - { "t", 1e12 }, - { "ki", 1024. }, - { "mi", 1048576. }, - { "gi", 1073741824. }, - { "ti", 1099511627776. } }; + { wxT( "p" ), 1e-12 }, + { wxT( "n" ), 1e-9 }, + { wxT( "u" ), 1e-6 }, + { wxT( "m" ), 1e-3 }, + { wxT( "" ), 1. }, + { wxT( "k" ), 1e3 }, + { wxT( "meg" ),1e6 }, + { wxT( "g" ), 1e9 }, + { wxT( "t" ), 1e12 }, + { wxT( "ki" ), 1024. }, + { wxT( "mi" ), 1048576. }, + { wxT( "gi" ), 1073741824. }, + { wxT( "ti" ), 1099511627776. } }; EDA_COMBINED_MATCHER::EDA_COMBINED_MATCHER( const wxString& aPattern ) diff --git a/common/eda_shape.cpp b/common/eda_shape.cpp index 53a51bce81..b0250ed3cb 100644 --- a/common/eda_shape.cpp +++ b/common/eda_shape.cpp @@ -72,13 +72,13 @@ wxString EDA_SHAPE::SHAPE_T_asString() const { switch( m_shape ) { - case SHAPE_T::SEGMENT: return "S_SEGMENT"; - case SHAPE_T::RECT: return "S_RECT"; - case SHAPE_T::ARC: return "S_ARC"; - case SHAPE_T::CIRCLE: return "S_CIRCLE"; - case SHAPE_T::POLY: return "S_POLYGON"; - case SHAPE_T::BEZIER: return "S_CURVE"; - case SHAPE_T::LAST: return "!S_LAST!"; // Synthetic value, but if we come across it then + case SHAPE_T::SEGMENT: return wxT( "S_SEGMENT" ); + case SHAPE_T::RECT: return wxT( "S_RECT" ); + case SHAPE_T::ARC: return wxT( "S_ARC" ); + case SHAPE_T::CIRCLE: return wxT( "S_CIRCLE" ); + case SHAPE_T::POLY: return wxT( "S_POLYGON" ); + case SHAPE_T::BEZIER: return wxT( "S_CURVE" ); + case SHAPE_T::LAST: return wxT( "!S_LAST!" ); // Synthetic value, but if we come across it then // we're going to want to know. } @@ -572,7 +572,7 @@ void EDA_SHAPE::ShapeGetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vectorGetProjectPath() ); else - return NormalizePath( aFilePath, aEnvVars, "" ); + return NormalizePath( aFilePath, aEnvVars, wxT( "" ) ); } diff --git a/common/env_vars.cpp b/common/env_vars.cpp index cc6d502a9c..dcce96e8a4 100644 --- a/common/env_vars.cpp +++ b/common/env_vars.cpp @@ -34,14 +34,14 @@ using STRING_MAP = std::map; * (where they are originally defined) */ static const ENV_VAR::ENV_VAR_LIST predefinedEnvVars = { - "KIPRJMOD", - "KICAD6_SYMBOL_DIR", - "KICAD6_3DMODEL_DIR", - "KICAD6_FOOTPRINT_DIR", - "KICAD6_TEMPLATE_DIR", - "KICAD_USER_TEMPLATE_DIR", - "KICAD_PTEMPLATES", - "KICAD6_3RD_PARTY", + wxT( "KIPRJMOD" ), + wxT( "KICAD6_SYMBOL_DIR" ), + wxT( "KICAD6_3DMODEL_DIR" ), + wxT( "KICAD6_FOOTPRINT_DIR" ), + wxT( "KICAD6_TEMPLATE_DIR" ), + wxT( "KICAD_USER_TEMPLATE_DIR" ), + wxT( "KICAD_PTEMPLATES" ), + wxT( "KICAD6_3RD_PARTY" ), }; @@ -67,40 +67,40 @@ static void initialiseEnvVarHelp( STRING_MAP& aMap ) { // Set up dynamically, as we want to be able to use _() translations, // which can't be done statically - aMap["KICAD6_FOOTPRINT_DIR"] = + aMap[wxT( "KICAD6_FOOTPRINT_DIR" )] = _( "The base path of locally installed system " "footprint libraries (.pretty folders)."); - aMap["KICAD6_3DMODEL_DIR"] = + aMap[wxT( "KICAD6_3DMODEL_DIR" )] = _( "The base path of system footprint 3D shapes (.3Dshapes folders)."); - aMap["KICAD6_SYMBOL_DIR"] = + aMap[wxT( "KICAD6_SYMBOL_DIR" )] = _( "The base path of the locally installed symbol libraries."); - aMap["KICAD6_TEMPLATE_DIR"] = + aMap[wxT( "KICAD6_TEMPLATE_DIR" )] = _( "A directory containing project templates installed with KiCad."); - aMap["KICAD_USER_TEMPLATE_DIR"] = + aMap[wxT( "KICAD_USER_TEMPLATE_DIR" )] = _( "Optional. Can be defined if you want to create your own project " "templates folder."); - aMap["KICAD6_3RD_PARTY"] = + aMap[wxT( "KICAD6_3RD_PARTY" )] = _( "A directory containing 3rd party plugins, libraries and other " "downloadable content."); - aMap["KIPRJMOD"] = + aMap[wxT( "KIPRJMOD" )] = _("Internally defined by KiCad (cannot be edited) and is set " "to the absolute path of the currently loaded project file. This environment " "variable can be used to define files and paths relative to the currently loaded " "project. For instance, ${KIPRJMOD}/libs/footprints.pretty can be defined as a " "folder containing a project specific footprint library named footprints.pretty." ); - aMap["KICAD6_SCRIPTING_DIR"] = + aMap[wxT( "KICAD6_SCRIPTING_DIR" )] = _( "A directory containing system-wide scripts installed with KiCad" ); - aMap["KICAD6_USER_SCRIPTING_DIR"] = + aMap[wxT( "KICAD6_USER_SCRIPTING_DIR" )] = _( "A directory containing user-specific scripts installed with KiCad" ); // Deprecated vars - aMap["KICAD_PTEMPLATES"] = + aMap[wxT( "KICAD_PTEMPLATES" )] = _( "Deprecated version of KICAD_TEMPLATE_DIR."); - aMap["KISYS3DMOD"] = + aMap[wxT( "KISYS3DMOD" )] = _( "Deprecated version of KICAD6_3DMODEL_DIR." ); - aMap["KISYSMOD"] = + aMap[wxT( "KISYSMOD" )] = _( "Deprecated version of KICAD6_FOOTPRINT_DIR." ); - aMap["KICAD_SYMBOL_DIR"] = + aMap[wxT( "KICAD_SYMBOL_DIR" )] = _( "Deprecated version of KICAD_SYMBOL_DIR."); } diff --git a/common/exceptions.cpp b/common/exceptions.cpp index d3e00a2308..62f1e7ebb7 100644 --- a/common/exceptions.cpp +++ b/common/exceptions.cpp @@ -30,7 +30,7 @@ const wxString IO_ERROR::What() const { #ifdef DEBUG - return wxString( "IO_ERROR: " ) + Problem() + "\n\n" + Where(); + return wxString( wxT( "IO_ERROR: " ) ) + Problem() + wxT( "\n\n" ) + Where(); #else return Problem(); #endif diff --git a/common/executable_names.cpp b/common/executable_names.cpp index f5475c5919..7028863ef4 100644 --- a/common/executable_names.cpp +++ b/common/executable_names.cpp @@ -28,19 +28,19 @@ // TODO Executable names TODO #ifdef __WINDOWS__ -const wxString CVPCB_EXE ( "cvpcb.exe" ); -const wxString PCBNEW_EXE ( "pcbnew.exe" ); -const wxString EESCHEMA_EXE ( "eeschema.exe" ); -const wxString GERBVIEW_EXE ( "gerbview.exe" ); -const wxString BITMAPCONVERTER_EXE ( "bitmap2component.exe" ); -const wxString PCB_CALCULATOR_EXE ( "pcb_calculator.exe" ); -const wxString PL_EDITOR_EXE ( "pl_editor.exe" ); +const wxString CVPCB_EXE ( wxT( "cvpcb.exe" ) ); +const wxString PCBNEW_EXE ( wxT( "pcbnew.exe" ) ); +const wxString EESCHEMA_EXE ( wxT( "eeschema.exe" ) ); +const wxString GERBVIEW_EXE ( wxT( "gerbview.exe" ) ); +const wxString BITMAPCONVERTER_EXE ( wxT( "bitmap2component.exe" ) ); +const wxString PCB_CALCULATOR_EXE ( wxT( "pcb_calculator.exe" ) ); +const wxString PL_EDITOR_EXE ( wxT( "pl_editor.exe" ) ); #else -const wxString CVPCB_EXE ( "cvpcb" ); -const wxString PCBNEW_EXE ( "pcbnew" ); -const wxString EESCHEMA_EXE ( "eeschema" ); -const wxString GERBVIEW_EXE ( "gerbview" ); -const wxString BITMAPCONVERTER_EXE ( "bitmap2component" ); -const wxString PCB_CALCULATOR_EXE ( "pcb_calculator" ); -const wxString PL_EDITOR_EXE ( "pl_editor" ); +const wxString CVPCB_EXE ( wxT( "cvpcb" ) ); +const wxString PCBNEW_EXE ( wxT( "pcbnew" ) ); +const wxString EESCHEMA_EXE ( wxT( "eeschema" ) ); +const wxString GERBVIEW_EXE ( wxT( "gerbview" ) ); +const wxString BITMAPCONVERTER_EXE ( wxT( "bitmap2component" ) ); +const wxString PCB_CALCULATOR_EXE ( wxT( "pcb_calculator" ) ); +const wxString PL_EDITOR_EXE ( wxT( "pl_editor" ) ); #endif diff --git a/common/filename_resolver.cpp b/common/filename_resolver.cpp index b0bc877e8a..20124c4920 100644 --- a/common/filename_resolver.cpp +++ b/common/filename_resolver.cpp @@ -44,7 +44,7 @@ #define ERRFLG_RELPATH (2) #define ERRFLG_ENVPATH (4) -#define MASK_3D_RESOLVER "3D_RESOLVER" +#define MASK_3D_RESOLVER wxT( "3D_RESOLVER" ) static std::mutex mutex_resolver; @@ -64,7 +64,7 @@ bool FILENAME_RESOLVER::Set3DConfigDir( const wxString& aConfigDir ) if( aConfigDir.empty() ) return false; - wxFileName cfgdir( ExpandEnvVarSubstitutions( aConfigDir, m_project ), "" ); + wxFileName cfgdir( ExpandEnvVarSubstitutions( aConfigDir, m_project ), wxT( "" ) ); cfgdir.Normalize(); @@ -85,7 +85,7 @@ bool FILENAME_RESOLVER::SetProject( PROJECT* aProject, bool* flgChanged ) if( !aProject ) return false; - wxFileName projdir( ExpandEnvVarSubstitutions( aProject->GetProjectPath(), aProject ), "" ); + wxFileName projdir( ExpandEnvVarSubstitutions( aProject->GetProjectPath(), aProject ), wxT( "" ) ); projdir.Normalize(); @@ -100,8 +100,8 @@ bool FILENAME_RESOLVER::SetProject( PROJECT* aProject, bool* flgChanged ) if( m_paths.empty() ) { SEARCH_PATH al; - al.m_Alias = "${KIPRJMOD}"; - al.m_Pathvar = "${KIPRJMOD}"; + al.m_Alias = wxT( "${KIPRJMOD}" ); + al.m_Pathvar = wxT( "${KIPRJMOD}" ); al.m_Pathexp = m_curProjDir; m_paths.push_back( al ); @@ -129,7 +129,7 @@ bool FILENAME_RESOLVER::SetProject( PROJECT* aProject, bool* flgChanged ) ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; ostr << " * [INFO] changed project dir to "; ostr << m_paths.front().m_Pathexp.ToUTF8(); - wxLogTrace( MASK_3D_RESOLVER, "%s\n", ostr.str().c_str() ); + wxLogTrace( MASK_3D_RESOLVER, wxT( "%s\n" ), ostr.str().c_str() ); } #endif @@ -168,8 +168,8 @@ bool FILENAME_RESOLVER::createPathList() // the user may change this later with a call to SetProjectDir() SEARCH_PATH lpath; - lpath.m_Alias = "${KIPRJMOD}"; - lpath.m_Pathvar = "${KIPRJMOD}"; + lpath.m_Alias = wxT( "${KIPRJMOD}" ); + lpath.m_Pathvar = wxT( "${KIPRJMOD}" ); lpath.m_Pathexp = m_curProjDir; m_paths.push_back( lpath ); wxFileName fndummy; @@ -188,7 +188,7 @@ bool FILENAME_RESOLVER::createPathList() } else { - fndummy.Assign( pathVal, "" ); + fndummy.Assign( pathVal, wxT( "" ) ); fndummy.Normalize(); lpath.m_Pathexp = fndummy.GetFullPath(); } @@ -210,12 +210,12 @@ bool FILENAME_RESOLVER::createPathList() return false; #ifdef DEBUG - wxLogTrace( MASK_3D_RESOLVER, " * [3D model] search paths:\n" ); + wxLogTrace( MASK_3D_RESOLVER, wxT( " * [3D model] search paths:\n" ) ); std::list< SEARCH_PATH >::const_iterator sPL = m_paths.begin(); while( sPL != m_paths.end() ) { - wxLogTrace( MASK_3D_RESOLVER, " + %s : '%s'\n", (*sPL).m_Alias.GetData(), + wxLogTrace( MASK_3D_RESOLVER, wxT( " + %s : '%s'\n" ), (*sPL).m_Alias.GetData(), (*sPL).m_Pathexp.GetData() ); ++sPL; } @@ -274,7 +274,7 @@ wxString FILENAME_RESOLVER::ResolvePath( const wxString& aFileName ) // special case: if a path begins with ${ENV_VAR} but is not in the resolver's path list // then add it. - if( aFileName.StartsWith( "${" ) || aFileName.StartsWith( "$(" ) ) + if( aFileName.StartsWith( wxT( "${" ) ) || aFileName.StartsWith( wxT( "$(" ) ) ) checkEnvVarPath( aFileName ); return tname; @@ -282,15 +282,15 @@ wxString FILENAME_RESOLVER::ResolvePath( const wxString& aFileName ) // if a path begins with ${ENV_VAR}/$(ENV_VAR) and is not resolved then the file either does // not exist or the ENV_VAR is not defined - if( aFileName.StartsWith( "${" ) || aFileName.StartsWith( "$(" ) ) + if( aFileName.StartsWith( wxT( "${" ) ) || aFileName.StartsWith( wxT( "$(" ) ) ) { if( !( m_errflags & ERRFLG_ENVPATH ) ) { m_errflags |= ERRFLG_ENVPATH; - wxString errmsg = "[3D File Resolver] No such path; ensure the environment var is defined"; - errmsg.append( "\n" ); + wxString errmsg = wxT( "[3D File Resolver] No such path; ensure the environment var is defined" ); + errmsg.append( wxT( "\n" ) ); errmsg.append( tname ); - errmsg.append( "\n" ); + errmsg.append( wxT( "\n" ) ); wxLogTrace( tracePathsAndFiles, errmsg ); } @@ -306,9 +306,9 @@ wxString FILENAME_RESOLVER::ResolvePath( const wxString& aFileName ) // been checked. This case accounts for partial paths which do not contain ${KIPRJMOD}. // This check is performed before checking the path relative to ${KICAD6_3DMODEL_DIR} so that // users can potentially override a model within ${KICAD6_3DMODEL_DIR}. - if( !m_paths.begin()->m_Pathexp.empty() && !tname.StartsWith( ":" ) ) + if( !m_paths.begin()->m_Pathexp.empty() && !tname.StartsWith( wxT( ":" ) ) ) { - tmpFN.Assign( m_paths.begin()->m_Pathexp, "" ); + tmpFN.Assign( m_paths.begin()->m_Pathexp, wxT( "" ) ); wxString fullPath = tmpFN.GetPathWithSep() + tname; fullPath = ExpandEnvVarSubstitutions( fullPath, m_project ); @@ -324,10 +324,10 @@ wxString FILENAME_RESOLVER::ResolvePath( const wxString& aFileName ) } // check the partial path relative to ${KICAD6_3DMODEL_DIR} (legacy behavior) - if( !tname.StartsWith( ":" ) ) + if( !tname.StartsWith( wxT( ":" ) ) ) { wxFileName fpath; - wxString fullPath( "${KICAD6_3DMODEL_DIR}" ); + wxString fullPath( wxT( "${KICAD6_3DMODEL_DIR}" ) ); fullPath.Append( fpath.GetPathSeparator() ); fullPath.Append( tname ); fullPath = ExpandEnvVarSubstitutions( fullPath, m_project ); @@ -352,10 +352,10 @@ wxString FILENAME_RESOLVER::ResolvePath( const wxString& aFileName ) // this can happen if the file was intended to be relative to ${KICAD6_3DMODEL_DIR} // but ${KICAD6_3DMODEL_DIR} is not set or is incorrect. m_errflags |= ERRFLG_RELPATH; - wxString errmsg = "[3D File Resolver] No such path"; - errmsg.append( "\n" ); + wxString errmsg = wxT( "[3D File Resolver] No such path" ); + errmsg.append( wxT( "\n" ) ); errmsg.append( tname ); - errmsg.append( "\n" ); + errmsg.append( wxT( "\n" ) ); wxLogTrace( tracePathsAndFiles, errmsg ); } @@ -365,7 +365,7 @@ wxString FILENAME_RESOLVER::ResolvePath( const wxString& aFileName ) for( const SEARCH_PATH& path : m_paths ) { // ${ENV_VAR} paths have already been checked; skip them - if( path.m_Alias.StartsWith( "${" ) || path.m_Alias.StartsWith( "$(" ) ) + if( path.m_Alias.StartsWith( wxT( "${" ) ) || path.m_Alias.StartsWith( wxT( "$(" ) ) ) continue; if( path.m_Alias == alias && !path.m_Pathexp.empty() ) @@ -392,10 +392,10 @@ wxString FILENAME_RESOLVER::ResolvePath( const wxString& aFileName ) if( !( m_errflags & ERRFLG_ALIAS ) ) { m_errflags |= ERRFLG_ALIAS; - wxString errmsg = "[3D File Resolver] No such path; ensure the path alias is defined"; - errmsg.append( "\n" ); + wxString errmsg = wxT( "[3D File Resolver] No such path; ensure the path alias is defined" ); + errmsg.append( wxT( "\n" ) ); errmsg.append( tname.substr( 1 ) ); - errmsg.append( "\n" ); + errmsg.append( wxT( "\n" ) ); wxLogTrace( tracePathsAndFiles, errmsg ); } @@ -420,15 +420,15 @@ bool FILENAME_RESOLVER::addPath( const SEARCH_PATH& aPath ) tpath.m_Pathvar.erase( tpath.m_Pathvar.length() - 1 ); #endif - wxFileName path( ExpandEnvVarSubstitutions( tpath.m_Pathvar, m_project ), "" ); + wxFileName path( ExpandEnvVarSubstitutions( tpath.m_Pathvar, m_project ), wxT( "" ) ); path.Normalize(); if( !path.DirExists() ) { - if( aPath.m_Pathvar == "${KICAD6_3DMODEL_DIR}" - || aPath.m_Pathvar == "${KIPRJMOD}" || aPath.m_Pathvar == "$(KIPRJMOD)" - || aPath.m_Pathvar == "${KISYS3DMOD}" || aPath.m_Pathvar == "$(KISYS3DMOD)" ) + if( aPath.m_Pathvar == wxT( "${KICAD6_3DMODEL_DIR}" ) + || aPath.m_Pathvar == wxT( "${KIPRJMOD}" ) || aPath.m_Pathvar == wxT( "$(KIPRJMOD)" ) + || aPath.m_Pathvar == wxT( "${KISYS3DMOD}" ) || aPath.m_Pathvar == wxT( "$(KISYS3DMOD)" ) ) { // suppress the message if the missing pathvar is a system variable } @@ -465,10 +465,10 @@ bool FILENAME_RESOLVER::addPath( const SEARCH_PATH& aPath ) wxString msg = _( "Alias: " ); msg.append( tpath.m_Alias ); msg.append( wxT( "\n" ) ); - msg.append( _( "This path:" ) + wxS( " " ) ); + msg.append( _( "This path:wxT( " ) + wxS( " ) " ) ); msg.append( tpath.m_Pathvar ); msg.append( wxT( "\n" ) ); - msg.append( _( "Existing path:" ) + wxS( " " ) ); + msg.append( _( "Existing path:wxT( " ) + wxS( " ) " ) ); msg.append( sPL->m_Pathvar ); wxMessageBox( msg, _( "Bad alias (duplicate name)" ) ); @@ -489,9 +489,9 @@ bool FILENAME_RESOLVER::readPathList() { std::ostringstream ostr; ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - wxString errmsg = "3D configuration directory is unknown"; - ostr << " * " << errmsg.ToUTF8(); - wxLogTrace( MASK_3D_RESOLVER, "%s\n", ostr.str().c_str() ); + wxString errmsg = wxT( "3D configuration directory is unknown" ); + ostr << wxT( " * " ) << errmsg.ToUTF8(); + wxLogTrace( MASK_3D_RESOLVER, wxT( "%s\n" ), ostr.str().c_str() ); return false; } @@ -508,10 +508,10 @@ bool FILENAME_RESOLVER::readPathList() { std::ostringstream ostr; ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - wxString errmsg = "no 3D configuration file"; + wxString errmsg = wxT( "no 3D configuration file" ); ostr << " * " << errmsg.ToUTF8() << " '"; ostr << cfgname.ToUTF8() << "'"; - wxLogTrace( MASK_3D_RESOLVER, "%s\n", ostr.str().c_str() ); + wxLogTrace( MASK_3D_RESOLVER, wxT( "%s\n" ), ostr.str().c_str() ); return false; } @@ -521,9 +521,9 @@ bool FILENAME_RESOLVER::readPathList() { std::ostringstream ostr; ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - wxString errmsg = "Could not open configuration file"; + wxString errmsg = wxT( "Could not open configuration file" ); ostr << " * " << errmsg.ToUTF8() << " '" << cfgname.ToUTF8() << "'"; - wxLogTrace( MASK_3D_RESOLVER, "%s\n", ostr.str().c_str() ); + wxLogTrace( MASK_3D_RESOLVER, wxT( "%s\n" ), ostr.str().c_str() ); return false; } @@ -566,9 +566,9 @@ bool FILENAME_RESOLVER::readPathList() // Don't add KICAD6_3DMODEL_DIR, one of its legacy equivalents, or KIPRJMOD from a // config file. They're system variables are are defined at runtime. - if( al.m_Alias == "${KICAD6_3DMODEL_DIR}" - || al.m_Alias == "${KIPRJMOD}" || al.m_Alias == "$(KIPRJMOD)" - || al.m_Alias == "${KISYS3DMOD}" || al.m_Alias == "$(KISYS3DMOD)" ) + if( al.m_Alias == wxT( "${KICAD6_3DMODEL_DIR}" ) + || al.m_Alias == wxT( "${KIPRJMOD}" ) || al.m_Alias == wxT( "$(KIPRJMOD)" ) + || al.m_Alias == wxT( "${KISYS3DMOD}" ) || al.m_Alias == wxT( "$(KISYS3DMOD)" ) ) { continue; } @@ -600,7 +600,7 @@ bool FILENAME_RESOLVER::WritePathList( const wxString& aDir, const wxString& aFi ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; wxString errmsg = _( "3D configuration directory is unknown" ); ostr << " * " << errmsg.ToUTF8(); - wxLogTrace( MASK_3D_RESOLVER, "%s\n", ostr.str().c_str() ); + wxLogTrace( MASK_3D_RESOLVER, wxT( "%s\n" ), ostr.str().c_str() ); wxMessageBox( errmsg, _( "Write 3D search path list" ) ); return false; @@ -613,7 +613,7 @@ bool FILENAME_RESOLVER::WritePathList( const wxString& aDir, const wxString& aFi // skip all ${ENV_VAR} alias names while( sPL != m_paths.end() - && ( sPL->m_Alias.StartsWith( "${" ) || sPL->m_Alias.StartsWith( "$(" ) ) ) + && ( sPL->m_Alias.StartsWith( wxT( "${" ) ) || sPL->m_Alias.StartsWith( wxT( "$(" ) ) ) ) { ++sPL; } @@ -631,7 +631,7 @@ bool FILENAME_RESOLVER::WritePathList( const wxString& aDir, const wxString& aFi ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; wxString errmsg = _( "Could not open configuration file" ); ostr << " * " << errmsg.ToUTF8() << " '" << cfgname.ToUTF8() << "'"; - wxLogTrace( MASK_3D_RESOLVER, "%s\n", ostr.str().c_str() ); + wxLogTrace( MASK_3D_RESOLVER, wxT( "%s\n" ), ostr.str().c_str() ); wxMessageBox( errmsg, _( "Write 3D search path list" ) ); return false; @@ -677,17 +677,17 @@ void FILENAME_RESOLVER::checkEnvVarPath( const wxString& aPath ) { bool useParen = false; - if( aPath.StartsWith( "$(" ) ) + if( aPath.StartsWith( wxT( "$(" ) ) ) useParen = true; - else if( !aPath.StartsWith( "${" ) ) + else if( !aPath.StartsWith( wxT( "${" ) ) ) return; size_t pEnd; if( useParen ) - pEnd = aPath.find( ")" ); + pEnd = aPath.find( wxT( ")" ) ); else - pEnd = aPath.find( "}" ); + pEnd = aPath.find( wxT( "}" ) ); if( pEnd == wxString::npos ) return; @@ -704,7 +704,7 @@ void FILENAME_RESOLVER::checkEnvVarPath( const wxString& aPath ) if( sPL->m_Alias == envar ) return; - if( !sPL->m_Alias.StartsWith( "${" ) ) + if( !sPL->m_Alias.StartsWith( wxT( "${" ) ) ) break; ++sPL; @@ -713,7 +713,7 @@ void FILENAME_RESOLVER::checkEnvVarPath( const wxString& aPath ) SEARCH_PATH lpath; lpath.m_Alias = envar; lpath.m_Pathvar = lpath.m_Alias; - wxFileName tmpFN( ExpandEnvVarSubstitutions( lpath.m_Alias, m_project ), "" ); + wxFileName tmpFN( ExpandEnvVarSubstitutions( lpath.m_Alias, m_project ), wxT( "" ) ); wxUniChar psep = tmpFN.GetPathSeparator(); tmpFN.Normalize(); @@ -758,7 +758,7 @@ wxString FILENAME_RESOLVER::ShortenPath( const wxString& aFullPathName ) wxFileName fpath; // in the case of aliases, ensure that we use the most recent definition - if( sL->m_Alias.StartsWith( "${" ) || sL->m_Alias.StartsWith( "$(" ) ) + if( sL->m_Alias.StartsWith( wxT( "${" ) ) || sL->m_Alias.StartsWith( wxT( "$(" ) ) ) { wxString tpath = ExpandEnvVarSubstitutions( sL->m_Alias, m_project ); @@ -789,19 +789,19 @@ wxString FILENAME_RESOLVER::ShortenPath( const wxString& aFullPathName ) fname.Replace( wxT( "\\" ), wxT( "/" ) ); #endif - if( sL->m_Alias.StartsWith( "${" ) || sL->m_Alias.StartsWith( "$(" ) ) + if( sL->m_Alias.StartsWith( wxT( "${" ) ) || sL->m_Alias.StartsWith( wxT( "$(" ) ) ) { // old style ENV_VAR tname = sL->m_Alias; - tname.Append( "/" ); + tname.Append( wxT( "/" ) ); tname.append( fname ); } else { // new style alias - tname = ":"; + tname = wxT( ":" ); tname.append( sL->m_Alias ); - tname.append( ":" ); + tname.append( wxT( ":" ) ); tname.append( fname ); } @@ -864,9 +864,9 @@ static bool getHollerith( const std::string& aString, size_t& aIndex, wxString& { std::ostringstream ostr; ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - wxString errmsg = "bad Hollerith string on line"; + wxString errmsg = wxT( "bad Hollerith string on line" ); ostr << " * " << errmsg.ToUTF8() << "\n'" << aString << "'"; - wxLogTrace( MASK_3D_RESOLVER, "%s\n", ostr.str().c_str() ); + wxLogTrace( MASK_3D_RESOLVER, wxT( "%s\n" ), ostr.str().c_str() ); return false; } @@ -877,9 +877,9 @@ static bool getHollerith( const std::string& aString, size_t& aIndex, wxString& { std::ostringstream ostr; ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - wxString errmsg = "missing opening quote mark in config file"; + wxString errmsg = wxT( "missing opening quote mark in config file" ); ostr << " * " << errmsg.ToUTF8() << "\n'" << aString << "'"; - wxLogTrace( MASK_3D_RESOLVER, "%s\n", ostr.str().c_str() ); + wxLogTrace( MASK_3D_RESOLVER, wxT( "%s\n" ), ostr.str().c_str() ); return false; } @@ -890,9 +890,9 @@ static bool getHollerith( const std::string& aString, size_t& aIndex, wxString& { std::ostringstream ostr; ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - wxString errmsg = "invalid entry (unexpected end of line)"; + wxString errmsg = wxT( "invalid entry (unexpected end of line)" ); ostr << " * " << errmsg.ToUTF8() << "\n'" << aString << "'"; - wxLogTrace( MASK_3D_RESOLVER, "%s\n", ostr.str().c_str() ); + wxLogTrace( MASK_3D_RESOLVER, wxT( "%s\n" ), ostr.str().c_str() ); return false; } @@ -906,9 +906,9 @@ static bool getHollerith( const std::string& aString, size_t& aIndex, wxString& { std::ostringstream ostr; ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - wxString errmsg = "bad Hollerith string on line"; + wxString errmsg = wxT( "bad Hollerith string on line" ); ostr << " * " << errmsg.ToUTF8() << "\n'" << aString << "'"; - wxLogTrace( MASK_3D_RESOLVER, "%s\n", ostr.str().c_str() ); + wxLogTrace( MASK_3D_RESOLVER, wxT( "%s\n" ), ostr.str().c_str() ); return false; } @@ -922,9 +922,9 @@ static bool getHollerith( const std::string& aString, size_t& aIndex, wxString& { std::ostringstream ostr; ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - wxString errmsg = "invalid entry (unexpected end of line)"; + wxString errmsg = wxT( "invalid entry (unexpected end of line)" ); ostr << " * " << errmsg.ToUTF8() << "\n'" << aString << "'"; - wxLogTrace( MASK_3D_RESOLVER, "%s\n", ostr.str().c_str() ); + wxLogTrace( MASK_3D_RESOLVER, wxT( "%s\n" ), ostr.str().c_str() ); return false; } @@ -939,9 +939,9 @@ static bool getHollerith( const std::string& aString, size_t& aIndex, wxString& { std::ostringstream ostr; ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n"; - wxString errmsg = "missing closing quote mark in config file"; + wxString errmsg = wxT( "missing closing quote mark in config file" ); ostr << " * " << errmsg.ToUTF8() << "\n'" << aString << "'"; - wxLogTrace( MASK_3D_RESOLVER, "%s\n", ostr.str().c_str() ); + wxLogTrace( MASK_3D_RESOLVER, wxT( "%s\n" ), ostr.str().c_str() ); return false; } @@ -1015,9 +1015,9 @@ bool FILENAME_RESOLVER::ValidateFileName( const wxString& aFileName, bool& hasAl // environment string before testing aliasEnd = wxString::npos; - if( aFileName.StartsWith( "${" ) ) + if( aFileName.StartsWith( wxT( "${" ) ) ) aliasEnd = aFileName.find( '}' ); - else if( aFileName.StartsWith( "$(" ) ) + else if( aFileName.StartsWith( wxT( "$(" ) ) ) aliasEnd = aFileName.find( ')' ); if( aliasEnd != wxString::npos ) @@ -1031,8 +1031,8 @@ bool FILENAME_RESOLVER::ValidateFileName( const wxString& aFileName, bool& hasAl // So remove separators wxString lpath_no_sep = lpath; #ifdef __WINDOWS__ - lpath_no_sep.Replace( "/", " " ); - lpath_no_sep.Replace( "\\", " " ); + lpath_no_sep.Replace( wxT( "/" ), wxT( " " ) ); + lpath_no_sep.Replace( wxT( "\\" ), wxT( " " ) ); // A disk identifier is allowed, and therefore remove its separator if( lpath_no_sep.Length() > 1 && lpath_no_sep[1] == ':' ) @@ -1064,32 +1064,32 @@ bool FILENAME_RESOLVER::GetKicadPaths( std::list< wxString >& paths ) const while( mS != mE ) { // filter out URLs, template directories, and known system paths - if( mS->first == wxString( "KICAD_PTEMPLATES" ) - || mS->first == wxString( "KICAD6_FOOTPRINT_DIR" ) ) + if( mS->first == wxString( wxT( "KICAD_PTEMPLATES" ) ) + || mS->first == wxString( wxT( "KICAD6_FOOTPRINT_DIR" ) ) ) { ++mS; continue; } - if( wxString::npos != mS->second.GetValue().find( wxString( "://" ) ) ) + if( wxString::npos != mS->second.GetValue().find( wxString( wxT( "://" ) ) ) ) { ++mS; continue; } - wxString tmp( "${" ); + wxString tmp( wxT( "${" ) ); tmp.Append( mS->first ); - tmp.Append( "}" ); + tmp.Append( wxT( "}" ) ); paths.push_back( tmp ); - if( tmp == "${KICAD6_3DMODEL_DIR}" ) + if( tmp == wxT( "${KICAD6_3DMODEL_DIR}" ) ) hasKisys3D = true; ++mS; } if( !hasKisys3D ) - paths.emplace_back("${KICAD6_3DMODEL_DIR}" ); + paths.emplace_back(wxT( "${KICAD6_3DMODEL_DIR}" ) ); return true; } diff --git a/common/footprint_filter.cpp b/common/footprint_filter.cpp index bc41b25837..ebf11550ec 100644 --- a/common/footprint_filter.cpp +++ b/common/footprint_filter.cpp @@ -139,7 +139,7 @@ bool FOOTPRINT_FILTER_IT::FootprintFilterMatch( FOOTPRINT_INFO& aItem ) // If the filter contains a ':' character, include the library name in the pattern if( each_filter->GetPattern().Contains( ":" ) ) { - name = aItem.GetLibNickname().Lower() + ":"; + name = aItem.GetLibNickname().Lower() + wxT( ":" ); } name += aItem.GetFootprintName().Lower(); diff --git a/common/footprint_info.cpp b/common/footprint_info.cpp index 99e02ef434..abd7ccab60 100644 --- a/common/footprint_info.cpp +++ b/common/footprint_info.cpp @@ -107,7 +107,7 @@ void FOOTPRINT_LIST::DisplayErrors( wxTopLevelWindow* aWindow ) wxString tmp = error->Problem(); // Preserve new lines in error messages so queued errors don't run together. - tmp.Replace( "\n", "
" ); + tmp.Replace( wxT( "\n" ), wxT( "
" ) ); msg += wxT( "

" ) + tmp + wxT( "

" ); } @@ -148,7 +148,7 @@ FOOTPRINT_LIST* FOOTPRINT_LIST::GetInstance( KIWAY& aKiway ) return nullptr; if( !footprintInfo->GetCount() ) - footprintInfo->ReadCacheFromFile( aKiway.Prj().GetProjectPath() + "fp-info-cache" ); + footprintInfo->ReadCacheFromFile( aKiway.Prj().GetProjectPath() + wxT( "fp-info-cache" ) ); return footprintInfo; } diff --git a/common/fp_lib_table.cpp b/common/fp_lib_table.cpp index 2668b9a210..88fdd0b462 100644 --- a/common/fp_lib_table.cpp +++ b/common/fp_lib_table.cpp @@ -474,7 +474,7 @@ FOOTPRINT* FP_LIB_TABLE::FootprintLoadWithOptionalNickname( const LIB_ID& aFootp const wxString FP_LIB_TABLE::GlobalPathEnvVariableName() { - return "KICAD6_FOOTPRINT_DIR"; + return wxT( "KICAD6_FOOTPRINT_DIR" ); } diff --git a/common/gal/dpi_scaling.cpp b/common/gal/dpi_scaling.cpp index 66124b919f..8152f42ba5 100644 --- a/common/gal/dpi_scaling.cpp +++ b/common/gal/dpi_scaling.cpp @@ -59,7 +59,7 @@ static OPT getKiCadConfiguredScale( const COMMON_SETTINGS& aConfig ) if( scale ) { - wxLogTrace( traceHiDpi, "Scale factor (configured): %f", *scale ); + wxLogTrace( traceHiDpi, wxT( "Scale factor (configured): %f" ), *scale ); } return scale; @@ -85,7 +85,7 @@ static OPT getEnvironmentScale() if( scale ) { - wxLogTrace( traceHiDpi, "Scale factor (environment): %f", *scale ); + wxLogTrace( traceHiDpi, wxT( "Scale factor (environment): %f" ), *scale ); } return scale; @@ -118,14 +118,14 @@ double DPI_SCALING::GetScaleFactor() const // On Linux, this will not work until WX 3.2 and GTK >= 3.10 // Otherwise it returns 1.0 val = KIPLATFORM::UI::GetSystemScaleFactor( m_window ); - wxLogTrace( traceHiDpi, "Scale factor (WX): %f", *val ); + wxLogTrace( traceHiDpi, wxT( "Scale factor (WX): %f" ), *val ); } if( !val ) { // Nothing else we can do, give it a default value val = GetDefaultScaleFactor(); - wxLogTrace( traceHiDpi, "Scale factor (default): %f", *val ); + wxLogTrace( traceHiDpi, wxT( "Scale factor (default): %f" ), *val ); } return *val; @@ -141,14 +141,14 @@ bool DPI_SCALING::GetCanvasIsAutoScaled() const } const bool automatic = getKiCadConfiguredScale( *m_config ) == boost::none; - wxLogTrace( traceHiDpi, "Scale is automatic: %d", automatic ); + wxLogTrace( traceHiDpi, wxT( "Scale is automatic: %d" ), automatic ); return automatic; } void DPI_SCALING::SetDpiConfig( bool aAuto, double aValue ) { - wxCHECK_RET( m_config != nullptr, "Setting DPI config without a config store." ); + wxCHECK_RET( m_config != nullptr, wxT( "Setting DPI config without a config store." ) ); const double value = aAuto ? 0.0 : aValue; diff --git a/common/gal/gal_display_options.cpp b/common/gal/gal_display_options.cpp index ea5b55e4c8..3e28556a06 100644 --- a/common/gal/gal_display_options.cpp +++ b/common/gal/gal_display_options.cpp @@ -74,7 +74,7 @@ GAL_DISPLAY_OPTIONS::GAL_DISPLAY_OPTIONS() void GAL_DISPLAY_OPTIONS::ReadWindowSettings( WINDOW_SETTINGS& aCfg ) { - wxLogTrace( traceGalDispOpts, "Reading app-specific options" ); + wxLogTrace( traceGalDispOpts, wxT( "Reading app-specific options" ) ); m_gridStyle = UTIL::GetValFromConfig( gridStyleConfigVals, aCfg.grid.style ); m_gridSnapping = UTIL::GetValFromConfig( gridSnapConfigVals, aCfg.grid.snap ); @@ -91,7 +91,7 @@ void GAL_DISPLAY_OPTIONS::ReadWindowSettings( WINDOW_SETTINGS& aCfg ) void GAL_DISPLAY_OPTIONS::ReadCommonConfig( COMMON_SETTINGS& aSettings, wxWindow* aWindow ) { - wxLogTrace( traceGalDispOpts, "Reading common config" ); + wxLogTrace( traceGalDispOpts, wxT( "Reading common config" ) ); gl_antialiasing_mode = static_cast( aSettings.m_Graphics.opengl_aa_mode ); @@ -109,7 +109,7 @@ void GAL_DISPLAY_OPTIONS::ReadCommonConfig( COMMON_SETTINGS& aSettings, wxWindow void GAL_DISPLAY_OPTIONS::ReadConfig( COMMON_SETTINGS& aCommonConfig, WINDOW_SETTINGS& aWindowConfig, wxWindow* aWindow ) { - wxLogTrace( traceGalDispOpts, "Reading common and app config" ); + wxLogTrace( traceGalDispOpts, wxT( "Reading common and app config" ) ); ReadWindowSettings( aWindowConfig ); @@ -119,7 +119,7 @@ void GAL_DISPLAY_OPTIONS::ReadConfig( COMMON_SETTINGS& aCommonConfig, void GAL_DISPLAY_OPTIONS::WriteConfig( WINDOW_SETTINGS& aCfg ) { - wxLogTrace( traceGalDispOpts, "Writing window settings" ); + wxLogTrace( traceGalDispOpts, wxT( "Writing window settings" ) ); aCfg.grid.style = UTIL::GetConfigForVal( gridStyleConfigVals, m_gridStyle ); aCfg.grid.snap = UTIL::GetConfigForVal( gridSnapConfigVals, m_gridSnapping ); @@ -143,7 +143,7 @@ void GAL_DISPLAY_OPTIONS::UpdateScaleFactor() void GAL_DISPLAY_OPTIONS::NotifyChanged() { - wxLogTrace( traceGalDispOpts, "Change notification" ); + wxLogTrace( traceGalDispOpts, wxT( "Change notification" ) ); Notify( &GAL_DISPLAY_OPTIONS_OBSERVER::OnGalDisplayOptionsChanged, *this ); } diff --git a/common/gal/opengl/cached_container_gpu.cpp b/common/gal/opengl/cached_container_gpu.cpp index 96f0a61547..b5fc0c9be2 100644 --- a/common/gal/opengl/cached_container_gpu.cpp +++ b/common/gal/opengl/cached_container_gpu.cpp @@ -62,12 +62,12 @@ CACHED_CONTAINER_GPU::CACHED_CONTAINER_GPU( unsigned int aSize ) : // disable glCopyBuffer, causes crashes/freezes on certain driver versions // Note, Intel's GL_VENDOR string varies depending on GPU/driver generation // But generally always starts with Intel at least - if( vendor.StartsWith( "Intel" ) || vendor.Contains( "etnaviv" ) ) + if( vendor.StartsWith( wxT( "Intel" ) ) || vendor.Contains( "etnaviv" ) ) { m_useCopyBuffer = false; } - KI_TRACE( traceGalProfile, "VBO initial size: %d\n", m_currentSize ); + KI_TRACE( traceGalProfile, wxT( "VBO initial size: %d\n" ), m_currentSize ); glGenBuffers( 1, &m_glBufferHandle ); glBindBuffer( GL_ARRAY_BUFFER, m_glBufferHandle ); @@ -213,14 +213,14 @@ bool CACHED_CONTAINER_GPU::defragmentResize( unsigned int aNewSize ) #ifdef KICAD_GAL_PROFILE totalTime.Stop(); - wxLogTrace( traceGalCachedContainerGpu, "Defragmented container storing %d vertices / %.1f ms", + wxLogTrace( traceGalCachedContainerGpu, wxT( "Defragmented container storing %d vertices / %.1f ms" ), m_currentSize - m_freeSpace, totalTime.msecs() ); #endif /* KICAD_GAL_PROFILE */ m_freeSpace += ( aNewSize - m_currentSize ); m_currentSize = aNewSize; - KI_TRACE( traceGalProfile, "VBO size %d used %d\n", m_currentSize, AllItemsSize() ); + KI_TRACE( traceGalProfile, wxT( "VBO size %d used %d\n" ), m_currentSize, AllItemsSize() ); // Now there is only one big chunk of free memory m_freeChunks.clear(); @@ -280,14 +280,14 @@ bool CACHED_CONTAINER_GPU::defragmentResizeMemcpy( unsigned int aNewSize ) #ifdef KICAD_GAL_PROFILE totalTime.Stop(); - wxLogTrace( traceGalCachedContainerGpu, "Defragmented container storing %d vertices / %.1f ms", + wxLogTrace( traceGalCachedContainerGpu, wxT( "Defragmented container storing %d vertices / %.1f ms" ), m_currentSize - m_freeSpace, totalTime.msecs() ); #endif /* KICAD_GAL_PROFILE */ m_freeSpace += ( aNewSize - m_currentSize ); m_currentSize = aNewSize; - KI_TRACE( traceGalProfile, "VBO size %d used: %d \n", m_currentSize, AllItemsSize() ); + KI_TRACE( traceGalProfile, wxT( "VBO size %d used: %d \n" ), m_currentSize, AllItemsSize() ); // Now there is only one big chunk of free memory m_freeChunks.clear(); diff --git a/common/gal/opengl/cached_container_ram.cpp b/common/gal/opengl/cached_container_ram.cpp index 74528ad7ea..6c4406e12f 100644 --- a/common/gal/opengl/cached_container_ram.cpp +++ b/common/gal/opengl/cached_container_ram.cpp @@ -118,7 +118,7 @@ bool CACHED_CONTAINER_RAM::defragmentResize( unsigned int aNewSize ) #ifdef KICAD_GAL_PROFILE totalTime.Stop(); - wxLogTrace( traceGalCachedContainer, "Defragmented container storing %d vertices / %.1f ms", + wxLogTrace( traceGalCachedContainer, wxT( "Defragmented container storing %d vertices / %.1f ms" ), m_currentSize - m_freeSpace, totalTime.msecs() ); #endif /* KICAD_GAL_PROFILE */ diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp index 1e00243e84..63356abcc0 100644 --- a/common/gal/opengl/opengl_gal.cpp +++ b/common/gal/opengl/opengl_gal.cpp @@ -452,7 +452,7 @@ void OPENGL_GAL::BeginDrawing() } catch( const std::runtime_error& ) { - wxLogVerbose( "Could not create a framebuffer for overlays.\n" ); + wxLogVerbose( wxT( "Could not create a framebuffer for overlays.\n" ) ); m_overlayBuffer = 0; } @@ -579,7 +579,7 @@ void OPENGL_GAL::BeginDrawing() void OPENGL_GAL::EndDrawing() { - wxASSERT_MSG( m_isContextLocked, "What happened to the context lock?" ); + wxASSERT_MSG( m_isContextLocked, wxT( "What happened to the context lock?" ) ); PROF_TIMER cntTotal("gl-end-total"); PROF_TIMER cntEndCached("gl-end-cached"); @@ -629,7 +629,7 @@ void OPENGL_GAL::EndDrawing() cntTotal.Stop(); - KI_TRACE( traceGalProfile, "Timing: %s %s %s %s %s %s\n", cntTotal.to_string(), + KI_TRACE( traceGalProfile, wxT( "Timing: %s %s %s %s %s %s\n" ), cntTotal.to_string(), cntEndCached.to_string(), cntEndNoncached.to_string(), cntEndOverlay.to_string(), cntComposite.to_string(), cntSwap.to_string() ); } @@ -637,7 +637,7 @@ void OPENGL_GAL::EndDrawing() void OPENGL_GAL::LockContext( int aClientCookie ) { - wxASSERT_MSG( !m_isContextLocked, "Context already locked." ); + wxASSERT_MSG( !m_isContextLocked, wxT( "Context already locked." ) ); m_isContextLocked = true; m_lockClientCookie = aClientCookie; @@ -2232,7 +2232,7 @@ void OPENGL_GAL::init() { wxASSERT( IsShownOnScreen() ); - wxASSERT_MSG( m_isContextLocked, "This should only be called from within a locked context." ); + wxASSERT_MSG( m_isContextLocked, wxT( "This should only be called from within a locked context." ) ); // IsDisplayAttr() handles WX_GL_{MAJOR,MINOR}_VERSION correctly only in 3.0.4 // starting with 3.1.0 one should use wxGLContext::IsOk() (done by GL_CONTEXT_MANAGER) diff --git a/common/gal/opengl/utils.cpp b/common/gal/opengl/utils.cpp index e91d9d87e8..24ff323a35 100644 --- a/common/gal/opengl/utils.cpp +++ b/common/gal/opengl/utils.cpp @@ -74,41 +74,41 @@ int checkGlError( const std::string& aInfo, const char* aFile, int aLine, bool a switch( status ) { case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT: - errorMsg = "The framebuffer attachment points are incomplete."; + errorMsg = wxT( "The framebuffer attachment points are incomplete." ); break; case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT: - errorMsg = "No images attached to the framebuffer."; + errorMsg = wxT( "No images attached to the framebuffer." ); break; case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT: - errorMsg = "The framebuffer does not have at least one image attached to it."; + errorMsg = wxT( "The framebuffer does not have at least one image attached to it." ); break; case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT: - errorMsg = "The framebuffer read buffer is incomplete."; + errorMsg = wxT( "The framebuffer read buffer is incomplete." ); break; case GL_FRAMEBUFFER_UNSUPPORTED_EXT: - errorMsg = "The combination of internal formats of the attached images violates " - "an implementation dependent set of restrictions."; + errorMsg = wxT( "The combination of internal formats of the attached images violates " ) + wxT( "an implementation dependent set of restrictions." ); break; case GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT: - errorMsg = "GL_RENDERBUFFER_SAMPLES is not the same for all attached render " - "buffers."; + errorMsg = wxT( "GL_RENDERBUFFER_SAMPLES is not the same for all attached render " ) + wxT( "buffers." ); break; case GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT: - errorMsg = "Framebuffer incomplete layer targets errors."; + errorMsg = wxT( "Framebuffer incomplete layer targets errors." ); break; case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT: - errorMsg = "Framebuffer attachments have different dimensions"; + errorMsg = wxT( "Framebuffer attachments have different dimensions" ); break; default: - errorMsg.Printf( "Unknown incomplete framebuffer error id %X", status ); + errorMsg.Printf( wxT( "Unknown incomplete framebuffer error id %X" ), status ); } } else @@ -140,7 +140,7 @@ int checkGlError( const std::string& aInfo, const char* aFile, int aLine, bool a if( aThrow ) { wxLogTrace( traceGalOpenGlError, wxT( "Throwing exception for glGetError() '%s' " - "in file '%s' on line %d." ), + wxT( "in file '%s' on line %d." ) ), errorMsg, aFile, aLine ); @@ -154,7 +154,7 @@ int checkGlError( const std::string& aInfo, const char* aFile, int aLine, bool a aFile, aLine ); - DisplayErrorMessage( nullptr, "OpenGL Error", errorMsg ); + DisplayErrorMessage( nullptr, wxT( "OpenGL Error" ), errorMsg ); } } @@ -170,13 +170,13 @@ static void GLAPIENTRY debugMsgCallback( GLenum aSource, GLenum aType, GLuint aI { switch( aSeverity ) { - case GL_DEBUG_SEVERITY_HIGH: wxLogDebug( "OpenGL ERROR: " ); break; - case GL_DEBUG_SEVERITY_MEDIUM: wxLogDebug( "OpenGL WARNING: " ); break; - case GL_DEBUG_SEVERITY_LOW: wxLogDebug( "OpenGL INFO: " ); break; + case GL_DEBUG_SEVERITY_HIGH: wxLogDebug( wxT( "OpenGL ERROR: " ) ); break; + case GL_DEBUG_SEVERITY_MEDIUM: wxLogDebug( wxT( "OpenGL WARNING: " ) ); break; + case GL_DEBUG_SEVERITY_LOW: wxLogDebug( wxT( "OpenGL INFO: " ) ); break; case GL_DEBUG_SEVERITY_NOTIFICATION: return; } - wxLogDebug( "%s\n", aMessage ); + wxLogDebug( wxT( "%s\n" ), aMessage ); } diff --git a/common/hash_eda.cpp b/common/hash_eda.cpp index 7105c53ebf..07299628b5 100644 --- a/common/hash_eda.cpp +++ b/common/hash_eda.cpp @@ -182,7 +182,7 @@ size_t hash_fp_item( const EDA_ITEM* aItem, int aFlags ) break; default: - wxASSERT_MSG( false, "Unhandled type in function hash_fp_item() (exporter_gencad.cpp)" ); + wxASSERT_MSG( false, wxT( "Unhandled type in function hash_fp_item() (exporter_gencad.cpp)" ) ); } return ret; diff --git a/common/hotkeys_basic.cpp b/common/hotkeys_basic.cpp index e993b74729..db4f4ebf33 100644 --- a/common/hotkeys_basic.cpp +++ b/common/hotkeys_basic.cpp @@ -329,7 +329,7 @@ void ReadHotKeyConfig( const wxString& aFileName, std::map& aH if( fileName.IsEmpty() ) { - wxFileName fn( "user" ); + wxFileName fn( wxT( "user" ) ); fn.SetExt( HotkeyFileExtension ); fn.SetPath( SETTINGS_MANAGER::GetUserSettingsPath() ); fileName = fn.GetFullPath(); @@ -338,19 +338,19 @@ void ReadHotKeyConfig( const wxString& aFileName, std::map& aH if( !wxFile::Exists( fileName ) ) return; - wxFFile file( fileName, "rb" ); + wxFFile file( fileName, wxT( "rb" ) ); if( !file.IsOpened() ) // There is a problem to open file return; wxString input; file.ReadAll( &input ); - input.Replace( "\r\n", "\n" ); // Convert Windows files to Unix line-ends - wxStringTokenizer fileTokenizer( input, "\n", wxTOKEN_STRTOK ); + input.Replace( wxT( "\r\n" ), wxT( "\n" ) ); // Convert Windows files to Unix line-ends + wxStringTokenizer fileTokenizer( input, wxT( "\n" ), wxTOKEN_STRTOK ); while( fileTokenizer.HasMoreTokens() ) { - wxStringTokenizer lineTokenizer( fileTokenizer.GetNextToken(), "\t" ); + wxStringTokenizer lineTokenizer( fileTokenizer.GetNextToken(), wxT( "\t" ) ); wxString cmdName = lineTokenizer.GetNextToken(); wxString keyName = lineTokenizer.GetNextToken(); @@ -364,7 +364,7 @@ void ReadHotKeyConfig( const wxString& aFileName, std::map& aH int WriteHotKeyConfig( const std::map& aActionMap ) { std::map hotkeys; - wxFileName fn( "user" ); + wxFileName fn( wxT( "user" ) ); fn.SetExt( HotkeyFileExtension ); fn.SetPath( SETTINGS_MANAGER::GetUserSettingsPath() ); @@ -418,7 +418,7 @@ int ReadLegacyHotkeyConfigFile( const wxString& aFilename, std::map( CURLOPT_USERAGENT, user_agent.ToStdString().c_str() ); setOption( CURLOPT_ACCEPT_ENCODING, "gzip,deflate" ); } diff --git a/common/kiid.cpp b/common/kiid.cpp index d37fbd1c46..529b9ae573 100644 --- a/common/kiid.cpp +++ b/common/kiid.cpp @@ -88,7 +88,7 @@ KIID::KIID() } catch( const boost::uuids::entropy_error& ) { - wxLogFatalError( "A Boost UUID entropy exception was thrown in %s:%s.", + wxLogFatalError( wxT( "A Boost UUID entropy exception was thrown in %s:%s." ), __FILE__, __FUNCTION__ ); } #endif @@ -140,7 +140,7 @@ KIID::KIID( const wxString& aString ) : m_uuid(), m_cached_timestamp( 0 ) } catch( const boost::uuids::entropy_error& ) { - wxLogFatalError( "A Boost UUID entropy exception was thrown in %s:%s.", + wxLogFatalError( wxT( "A Boost UUID entropy exception was thrown in %s:%s." ), __FILE__, __FUNCTION__ ); } #endif diff --git a/common/launch_ext.cpp b/common/launch_ext.cpp index 1f543a981d..7ed013fd78 100644 --- a/common/launch_ext.cpp +++ b/common/launch_ext.cpp @@ -37,7 +37,7 @@ bool LaunchExternal( const wxString& aPath ) wxString PATH, xdg_open; - if( wxGetEnv( "PATH", &PATH ) && wxFindFileInPath( &xdg_open, PATH, "xdg-open" ) ) + if( wxGetEnv( wxT( "PATH" ), &PATH ) && wxFindFileInPath( &xdg_open, PATH, wxT( "xdg-open" ) ) ) { const char* argv[3]; argv[0] = xdg_open.fn_str(); diff --git a/common/lib_table_base.cpp b/common/lib_table_base.cpp index 4544e869c5..c3431e3357 100644 --- a/common/lib_table_base.cpp +++ b/common/lib_table_base.cpp @@ -88,7 +88,7 @@ void LIB_TABLE_ROW::Format( OUTPUTFORMATTER* out, int nestLevel ) const if( !GetIsEnabled() ) { - extraOptions += "(disabled)"; + extraOptions += wxT( "(disabled)" ); } out->Print( nestLevel, "(lib (name %s)(type %s)(uri %s)(options %s)(descr %s)%s)\n", @@ -206,7 +206,7 @@ LIB_TABLE_ROW* LIB_TABLE::findRow( const wxString& aNickName, bool aCheckIfEnabl for( const std::pair& entry : cur->nickIndex ) { wxString legacyLibName = entry.first; - legacyLibName.Replace( " ", "_" ); + legacyLibName.Replace( wxT( " " ), wxT( "_" ) ); if( legacyLibName == aNickName ) { @@ -236,7 +236,7 @@ const LIB_TABLE_ROW* LIB_TABLE::FindRowByURI( const wxString& aURI ) { wxString tmp = cur->rows[i].GetFullURI( true ); - if( tmp.Find( "://" ) != wxNOT_FOUND ) + if( tmp.Find( wxT( "://" ) ) != wxNOT_FOUND ) { if( tmp == aURI ) return &cur->rows[i]; // found as URI diff --git a/common/lib_tree_model.cpp b/common/lib_tree_model.cpp index 107040e19e..6c2f7ec00f 100644 --- a/common/lib_tree_model.cpp +++ b/common/lib_tree_model.cpp @@ -146,7 +146,7 @@ LIB_TREE_NODE_UNIT::LIB_TREE_NODE_UNIT( LIB_TREE_NODE* aParent, LIB_TREE_ITEM* a m_Unit = aUnit; m_LibId = aParent->m_LibId; - m_Name = namePrefix + " " + aItem->GetUnitReference( aUnit ); + m_Name = namePrefix + wxT( " " ) + aItem->GetUnitReference( aUnit ); m_Desc = wxEmptyString; m_MatchName = wxEmptyString; diff --git a/common/lib_tree_model_adapter.cpp b/common/lib_tree_model_adapter.cpp index f65448b886..d13621a653 100644 --- a/common/lib_tree_model_adapter.cpp +++ b/common/lib_tree_model_adapter.cpp @@ -90,7 +90,7 @@ LIB_TREE_MODEL_ADAPTER::LIB_TREE_MODEL_ADAPTER( EDA_BASE_FRAME* aParent, // Read the pinned entries from the project config PROJECT_FILE& project = m_parent->Kiway().Prj().GetProjectFile(); - std::vector& entries = ( m_pinnedKey == "pinned_symbol_libs" ) ? + std::vector& entries = ( m_pinnedKey == wxT( "pinned_symbol_libs" ) ) ? project.m_PinnedSymbolLibs : project.m_PinnedFootprintLibs; @@ -117,7 +117,7 @@ void LIB_TREE_MODEL_ADAPTER::SavePinnedItems() { PROJECT_FILE& project = m_parent->Kiway().Prj().GetProjectFile(); - std::vector& entries = ( m_pinnedKey == "pinned_symbol_libs" ) ? + std::vector& entries = ( m_pinnedKey == wxT( "pinned_symbol_libs" ) ) ? project.m_PinnedSymbolLibs : project.m_PinnedFootprintLibs; @@ -283,7 +283,7 @@ void LIB_TREE_MODEL_ADAPTER::AttachTo( wxDataViewCtrl* aDataViewCtrl ) // The extent of the text doesn't take into account the space on either side // in the header, so artificially pad it - wxSize partHeadMinWidth = KIUI::GetTextSize( partHead + "MMM", aDataViewCtrl ); + wxSize partHeadMinWidth = KIUI::GetTextSize( partHead + wxT( "MMM" ), aDataViewCtrl ); // Ensure the part column is wider than the smallest allowable width if( m_colWidths[PART_COL] < partHeadMinWidth.x ) diff --git a/common/lockfile.cpp b/common/lockfile.cpp index c6ec67793c..fc02f8ecc4 100644 --- a/common/lockfile.cpp +++ b/common/lockfile.cpp @@ -39,12 +39,12 @@ std::unique_ptr LockFile( const wxString& aFileName ) fn.MakeAbsolute(); - wxString lockFileName = fn.GetFullPath() + ".lock"; + wxString lockFileName = fn.GetFullPath() + wxT( ".lock" ); - lockFileName.Replace( "/", "_" ); + lockFileName.Replace( wxT( "/" ), wxT( "_" ) ); // We can have filenames coming from Windows, so also convert Windows separator - lockFileName.Replace( "\\", "_" ); + lockFileName.Replace( wxT( "\\" ), wxT( "_" ) ); auto p = std::make_unique( lockFileName, GetKicadLockFilePath() ); @@ -65,24 +65,24 @@ wxString GetKicadLockFilePath() #if defined( __WXMAC__ ) // In OSX use the standard per user cache directory - lockpath.AppendDir( "Library" ); - lockpath.AppendDir( "Caches" ); - lockpath.AppendDir( "kicad" ); + lockpath.AppendDir( wxT( "Library" ) ); + lockpath.AppendDir( wxT( "Caches" ) ); + lockpath.AppendDir( wxT( "kicad" ) ); #elif defined( __UNIX__ ) wxString envstr; // Try first the standard XDG_RUNTIME_DIR, falling back to XDG_CACHE_HOME - if( wxGetEnv( "XDG_RUNTIME_DIR", &envstr ) && !envstr.IsEmpty() ) + if( wxGetEnv( wxT( "XDG_RUNTIME_DIR" ), &envstr ) && !envstr.IsEmpty() ) { lockpath.AssignDir( envstr ); } - else if( wxGetEnv( "XDG_CACHE_HOME", &envstr ) && !envstr.IsEmpty() ) + else if( wxGetEnv( wxT( "XDG_CACHE_HOME" ), &envstr ) && !envstr.IsEmpty() ) { lockpath.AssignDir( envstr ); } else { // If all fails, just use ~/.cache - lockpath.AppendDir( ".cache" ); + lockpath.AppendDir( wxT( ".cache" ) ); } lockpath.AppendDir( wxString::Format( "kicad_v%s", GetMajorMinorVersion() ) ); diff --git a/common/paths.cpp b/common/paths.cpp index c2e37a557e..3f6c74df5a 100644 --- a/common/paths.cpp +++ b/common/paths.cpp @@ -30,9 +30,9 @@ // lowercase or pretty case depending on platform #if defined( __WXMAC__ ) || defined( __WXMSW__ ) -#define KICAD_PATH_STR "KiCad" +#define KICAD_PATH_STR wxT( "KiCad" ) #else -#define KICAD_PATH_STR "kicad" +#define KICAD_PATH_STR wxT( "kicad" ) #endif @@ -55,7 +55,7 @@ wxString PATHS::GetUserPluginsPath() wxFileName tmp; getUserDocumentPath( tmp ); - tmp.AppendDir( "plugins" ); + tmp.AppendDir( wxT( "plugins" ) ); return tmp.GetPath(); } @@ -66,7 +66,7 @@ wxString PATHS::GetUserPlugins3DPath() wxFileName tmp; tmp.AssignDir( PATHS::GetUserPluginsPath() ); - tmp.AppendDir( "3d" ); + tmp.AppendDir( wxT( "3d" ) ); return tmp.GetPath(); } @@ -77,7 +77,7 @@ wxString PATHS::GetUserScriptingPath() wxFileName tmp; getUserDocumentPath( tmp ); - tmp.AppendDir( "scripting" ); + tmp.AppendDir( wxT( "scripting" ) ); return tmp.GetPath(); } @@ -88,7 +88,7 @@ wxString PATHS::GetUserTemplatesPath() wxFileName tmp; getUserDocumentPath( tmp ); - tmp.AppendDir( "template" ); + tmp.AppendDir( wxT( "template" ) ); return tmp.GetPathWithSep(); } @@ -99,7 +99,7 @@ wxString PATHS::GetDefaultUserSymbolsPath() wxFileName tmp; getUserDocumentPath( tmp ); - tmp.AppendDir( "symbols" ); + tmp.AppendDir( wxT( "symbols" ) ); return tmp.GetPath(); } @@ -110,7 +110,7 @@ wxString PATHS::GetDefaultUserFootprintsPath() wxFileName tmp; getUserDocumentPath( tmp ); - tmp.AppendDir( "footprints" ); + tmp.AppendDir( wxT( "footprints" ) ); return tmp.GetPath(); } @@ -121,7 +121,7 @@ wxString PATHS::GetDefaultUser3DModelsPath() wxFileName tmp; getUserDocumentPath( tmp ); - tmp.AppendDir( "3dmodels" ); + tmp.AppendDir( wxT( "3dmodels" ) ); return tmp.GetPath(); } @@ -131,7 +131,7 @@ wxString PATHS::GetDefault3rdPartyPath() wxFileName tmp; getUserDocumentPath( tmp ); - tmp.AppendDir( "3rdparty" ); + tmp.AppendDir( wxT( "3rdparty" ) ); return tmp.GetPath(); } @@ -141,7 +141,7 @@ wxString PATHS::GetDefaultUserProjectsPath() wxFileName tmp; getUserDocumentPath( tmp ); - tmp.AppendDir( "projects" ); + tmp.AppendDir( wxT( "projects" ) ); return tmp.GetPath(); } @@ -263,7 +263,7 @@ wxString PATHS::GetStockPlugins3DPath() // KICAD_PLUGINDIR = CMAKE_INSTALL_FULL_LIBDIR path is the absolute path // corresponding to the install path used for constructing KICAD_USER_PLUGIN wxString tfname = wxString::FromUTF8Unchecked( KICAD_PLUGINDIR ); - fn.Assign( tfname, "" ); + fn.Assign( tfname, wxT( "" ) ); fn.AppendDir( wxT( "kicad" ) ); fn.AppendDir( wxT( "plugins" ) ); #elif defined( __WXMAC__ ) @@ -273,7 +273,7 @@ wxString PATHS::GetStockPlugins3DPath() fn.AppendDir( wxT( "plugins" ) ); #endif - fn.AppendDir( "3d" ); + fn.AppendDir( wxT( "3d" ) ); return fn.GetPathWithSep(); } @@ -309,7 +309,7 @@ wxString PATHS::GetDocumentationPath() #if defined( __WXMAC__ ) path = GetOSXKicadDataDir(); #elif defined( __WXMSW__ ) - path = getWindowsKiCadRoot() + "share/doc/kicad"; + path = getWindowsKiCadRoot() + wxT( "share/doc/kicad" ); #else path = wxString::FromUTF8Unchecked( KICAD_DOCS ); #endif @@ -360,9 +360,9 @@ wxString PATHS::GetOSXKicadUserDataDir() wxFileName udir( wxStandardPaths::Get().GetUserDataDir(), wxEmptyString ); // Since appname is different if started via launcher or standalone binary - // map all to "kicad" here + // map all to wxT( "kicad" ) here udir.RemoveLastDir(); - udir.AppendDir( "kicad" ); + udir.AppendDir( wxT( "kicad" ) ); return udir.GetPath(); } @@ -407,7 +407,7 @@ wxString PATHS::GetOSXKicadDataDir() #ifdef __WXWINDOWS__ wxString PATHS::getWindowsKiCadRoot() { - wxFileName root( Pgm().GetExecutablePath() + "/../" ); + wxFileName root( Pgm().GetExecutablePath() + wxT( "/../" ) ); root.Normalize(); return root.GetPathWithSep(); diff --git a/common/pgm_base.cpp b/common/pgm_base.cpp index e7583bfd62..2a1d5ec000 100644 --- a/common/pgm_base.cpp +++ b/common/pgm_base.cpp @@ -98,7 +98,7 @@ LANGUAGE_DESCR LanguagesList[] = wxT( "简体中文" ), true }, { wxLANGUAGE_CHINESE_TRADITIONAL, ID_LANGUAGE_CHINESE_TRADITIONAL, wxT( "繁體中文" ), false }, - { 0, 0, "", false } // Sentinel + { 0, 0, wxT( "" ), false } // Sentinel }; #undef _ #define _(s) wxGetTranslation((s)) @@ -151,13 +151,13 @@ const wxString& PGM_BASE::GetTextEditor( bool aCanShowFileChooser ) if( !editorname ) { - if( !wxGetEnv( "EDITOR", &editorname ) ) + if( !wxGetEnv( wxT( "EDITOR" ), &editorname ) ) { // If there is no EDITOR variable set, try the desktop default #ifdef __WXMAC__ - editorname = "/usr/bin/open -e"; + editorname = wxT( "/usr/bin/open -e" ); #elif __WXX11__ - editorname = "/usr/bin/xdg-open"; + editorname = wxT( "/usr/bin/xdg-open" ); #endif } } @@ -215,7 +215,7 @@ bool PGM_BASE::InitPgm( bool aHeadless, bool aSkipPyInit ) wxInitAllImageHandlers(); #ifndef __WINDOWS__ - if( wxString( wxGetenv( "HOME" ) ).IsEmpty() ) + if( wxString( wxGetenv( wxT( "HOME" ) ) ).IsEmpty() ) { DisplayErrorMessage( nullptr, _( "Environment variable HOME is empty. " "Unable to continue." ) ); @@ -226,7 +226,7 @@ bool PGM_BASE::InitPgm( bool aHeadless, bool aSkipPyInit ) // Init KiCad environment // the environment variable KICAD (if exists) gives the kicad path: // something like set KICAD=d:\kicad - bool isDefined = wxGetEnv( "KICAD", &m_kicad_env ); + bool isDefined = wxGetEnv( wxT( "KICAD" ), &m_kicad_env ); if( isDefined ) // ensure m_kicad_env ends by "/" { @@ -237,7 +237,7 @@ bool PGM_BASE::InitPgm( bool aHeadless, bool aSkipPyInit ) } // Init parameters for configuration - App().SetVendorName( "KiCad" ); + App().SetVendorName( wxT( "KiCad" ) ); App().SetAppName( pgm_name ); // Install some image handlers, mainly for help @@ -351,7 +351,7 @@ void PGM_BASE::loadCommonSettings() for( const std::pair it : GetCommonSettings()->m_Env.vars ) { - wxLogTrace( traceEnvVars, "PGM_BASE::loadSettings: Found entry %s = %s", + wxLogTrace( traceEnvVars, wxT( "PGM_BASE::loadSettings: Found entry %s = %s" ), it.first, it.second.GetValue() ); // Do not store the env var PROJECT_VAR_NAME ("KIPRJMOD") definition if for some reason @@ -408,7 +408,7 @@ bool PGM_BASE::SetLanguage( wxString& aErrMsg, bool first_time ) } // dictionary file name without extend (full name is kicad.mo) - wxString dictionaryName( "kicad" ); + wxString dictionaryName( wxT( "kicad" ) ); delete m_locale; m_locale = new wxLocale; @@ -417,7 +417,7 @@ bool PGM_BASE::SetLanguage( wxString& aErrMsg, bool first_time ) // false just because it failed to load wxstd catalog if( !m_locale->Init( m_language_id, wxLOCALE_DONT_LOAD_DEFAULT ) ) { - wxLogTrace( traceLocale, "This language is not supported by the system." ); + wxLogTrace( traceLocale, wxT( "This language is not supported by the system." ) ); setLanguageId( wxLANGUAGE_DEFAULT ); delete m_locale; @@ -430,7 +430,7 @@ bool PGM_BASE::SetLanguage( wxString& aErrMsg, bool first_time ) } else if( !first_time ) { - wxLogTrace( traceLocale, "Search for dictionary %s.mo in %s", + wxLogTrace( traceLocale, wxT( "Search for dictionary %s.mo in %s" ), dictionaryName, m_locale->GetName() ); } @@ -467,7 +467,7 @@ bool PGM_BASE::SetLanguage( wxString& aErrMsg, bool first_time ) // the verification is skipped. if( !m_locale->IsLoaded( dictionaryName ) && m_language_id != wxLANGUAGE_ENGLISH ) { - wxLogTrace( traceLocale, "Unable to load dictionary %s.mo in %s", + wxLogTrace( traceLocale, wxT( "Unable to load dictionary %s.mo in %s" ), dictionaryName, m_locale->GetName() ); setLanguageId( wxLANGUAGE_DEFAULT ); @@ -489,7 +489,7 @@ bool PGM_BASE::SetDefaultLanguage( wxString& aErrMsg ) setLanguageId( wxLANGUAGE_DEFAULT ); // dictionary file name without extend (full name is kicad.mo) - wxString dictionaryName( "kicad" ); + wxString dictionaryName( wxT( "kicad" ) ); delete m_locale; m_locale = new wxLocale; @@ -505,7 +505,7 @@ bool PGM_BASE::SetDefaultLanguage( wxString& aErrMsg ) // the verification is skipped. if( !m_locale->IsLoaded( dictionaryName ) && m_language_id != wxLANGUAGE_ENGLISH ) { - wxLogTrace( traceLocale, "Unable to load dictionary %s.mo in %s", + wxLogTrace( traceLocale, wxT( "Unable to load dictionary %s.mo in %s" ), dictionaryName, m_locale->GetName() ); setLanguageId( wxLANGUAGE_DEFAULT ); @@ -524,7 +524,7 @@ bool PGM_BASE::SetDefaultLanguage( wxString& aErrMsg ) void PGM_BASE::SetLanguageIdentifier( int menu_id ) { - wxLogTrace( traceLocale, "Select language ID %d from %d possible languages.", + wxLogTrace( traceLocale, wxT( "Select language ID %d from %d possible languages." ), menu_id, (int)arrayDim( LanguagesList )-1 ); for( unsigned ii = 0; LanguagesList[ii].m_KI_Lang_Identifier != 0; ii++ ) @@ -550,23 +550,23 @@ void PGM_BASE::SetLanguagePath() wxFileName fn( guesses[i], wxEmptyString ); // Append path for Windows and unix KiCad package install - fn.AppendDir( "share" ); - fn.AppendDir( "internat" ); + fn.AppendDir( wxT( "share" ) ); + fn.AppendDir( wxT( "internat" ) ); if( fn.IsDirReadable() ) { - wxLogTrace( traceLocale, "Adding locale lookup path: " + fn.GetPath() ); + wxLogTrace( traceLocale, wxT( "Adding locale lookup path: " ) + fn.GetPath() ); wxLocale::AddCatalogLookupPathPrefix( fn.GetPath() ); } // Append path for unix standard install fn.RemoveLastDir(); - fn.AppendDir( "kicad" ); - fn.AppendDir( "internat" ); + fn.AppendDir( wxT( "kicad" ) ); + fn.AppendDir( wxT( "internat" ) ); if( fn.IsDirReadable() ) { - wxLogTrace( traceLocale, "Adding locale lookup path: " + fn.GetPath() ); + wxLogTrace( traceLocale, wxT( "Adding locale lookup path: " ) + fn.GetPath() ); wxLocale::AddCatalogLookupPathPrefix( fn.GetPath() ); } @@ -574,11 +574,11 @@ void PGM_BASE::SetLanguagePath() fn.RemoveLastDir(); fn.RemoveLastDir(); fn.RemoveLastDir(); - fn.AppendDir( "internat" ); + fn.AppendDir( wxT( "internat" ) ); if( fn.IsDirReadable() ) { - wxLogTrace( traceLocale, "Adding locale lookup path: " + fn.GetPath() ); + wxLogTrace( traceLocale, wxT( "Adding locale lookup path: " ) + fn.GetPath() ); wxLocale::AddCatalogLookupPathPrefix( fn.GetPath() ); } } @@ -587,7 +587,7 @@ void PGM_BASE::SetLanguagePath() { wxFileName fn( Pgm().GetExecutablePath() ); fn.RemoveLastDir(); - fn.AppendDir( "translation" ); + fn.AppendDir( wxT( "translation" ) ); wxLocale::AddCatalogLookupPathPrefix( fn.GetPath() ); } } @@ -600,7 +600,7 @@ bool PGM_BASE::SetLocalEnvVariable( const wxString& aName, const wxString& aValu if( aName.IsEmpty() ) { wxLogTrace( traceEnvVars, - "PGM_BASE::SetLocalEnvVariable: Attempt to set empty variable to value %s", + wxT( "PGM_BASE::SetLocalEnvVariable: Attempt to set empty variable to value %s" ), aValue ); return false; } @@ -609,13 +609,13 @@ bool PGM_BASE::SetLocalEnvVariable( const wxString& aName, const wxString& aValu if( wxGetEnv( aName, &env ) ) { wxLogTrace( traceEnvVars, - "PGM_BASE::SetLocalEnvVariable: Environment variable %s already set to %s", + wxT( "PGM_BASE::SetLocalEnvVariable: Environment variable %s already set to %s" ), aName, env ); return env == aValue; } wxLogTrace( traceEnvVars, - "PGM_BASE::SetLocalEnvVariable: Setting local environment variable %s to %s", + wxT( "PGM_BASE::SetLocalEnvVariable: Setting local environment variable %s to %s" ), aName, aValue ); return wxSetEnv( aName, aValue ); @@ -629,7 +629,7 @@ void PGM_BASE::SetLocalEnvVariables() for( const std::pair m_local_env_var : GetCommonSettings()->m_Env.vars ) { wxLogTrace( traceEnvVars, - "PGM_BASE::SetLocalEnvVariables: Setting local environment variable %s to %s", + wxT( "PGM_BASE::SetLocalEnvVariables: Setting local environment variable %s to %s" ), m_local_env_var.first, m_local_env_var.second.GetValue() ); wxSetEnv( m_local_env_var.first, m_local_env_var.second.GetValue() ); diff --git a/common/plotters/GERBER_plotter.cpp b/common/plotters/GERBER_plotter.cpp index 895c8cf4fd..bc8d41e3d3 100644 --- a/common/plotters/GERBER_plotter.cpp +++ b/common/plotters/GERBER_plotter.cpp @@ -250,7 +250,7 @@ bool GERBER_PLOTTER::StartPlot() // Create a temp file in system temp to avoid potential network share buffer issues for // the final read and save. - m_workFilename = wxFileName::CreateTempFileName( "" ); + m_workFilename = wxFileName::CreateTempFileName( wxT( "" ) ); workFile = wxFopen( m_workFilename, wxT( "wt" )); m_outputFile = workFile; wxASSERT( m_outputFile ); @@ -402,7 +402,7 @@ void GERBER_PLOTTER::SetCurrentLineWidth( int aWidth, void* aData ) else if( aWidth == USE_DEFAULT_LINE_WIDTH ) aWidth = m_renderSettings->GetDefaultPenWidth(); - wxASSERT_MSG( aWidth >= 0, "Plotter called to set negative pen width" ); + wxASSERT_MSG( aWidth >= 0, wxT( "Plotter called to set negative pen width" ) ); GBR_METADATA* gbr_metadata = static_cast( aData ); int aperture_attribute = gbr_metadata ? gbr_metadata->GetApertureAttrib() : 0; @@ -1601,7 +1601,7 @@ void GERBER_PLOTTER::plotRoundRectAsRegion( const wxPoint& aRectCenter, const wx #if 0 // For test only: if( last_pt != first_pt ) - wxLogMessage( "first pt %d %d last pt %d %d", + wxLogMessage( wxT( "first pt %d %d last pt %d %d" ), first_pt.x, first_pt.y, last_pt.x, last_pt.y ); #endif @@ -1811,7 +1811,7 @@ void GERBER_PLOTTER::FlashPadChamferRoundRect( const wxPoint& aShapePos, const w break; default: - wxLogMessage( "FlashPadChamferRoundRect(): Unexpected number of corners (%d)", + wxLogMessage( wxT( "FlashPadChamferRoundRect(): Unexpected number of corners (%d)" ), (int)cornerList.size() ); break; } diff --git a/common/plotters/HPGL_plotter.cpp b/common/plotters/HPGL_plotter.cpp index e728b7e8c0..eb8397cf3c 100644 --- a/common/plotters/HPGL_plotter.cpp +++ b/common/plotters/HPGL_plotter.cpp @@ -473,7 +473,7 @@ void HPGL_PLOTTER::PlotPoly( const std::vector& aCornerList, FILL_T aFi // Draw the filled area SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH ); - m_current_item->content << wxString( "PM 0;\n" ); // Start polygon + m_current_item->content << wxString( wxT( "PM 0;\n" ) ); // Start polygon for( unsigned ii = 1; ii < aCornerList.size(); ++ii ) LineTo( aCornerList[ii] ); diff --git a/common/plotters/PDF_plotter.cpp b/common/plotters/PDF_plotter.cpp index 7d88ff0957..040393982e 100644 --- a/common/plotters/PDF_plotter.cpp +++ b/common/plotters/PDF_plotter.cpp @@ -150,7 +150,7 @@ void PDF_PLOTTER::SetCurrentLineWidth( int aWidth, void* aData ) if( aWidth == 0 ) aWidth = 1; - wxASSERT_MSG( aWidth > 0, "Plotter called to set negative pen width" ); + wxASSERT_MSG( aWidth > 0, wxT( "Plotter called to set negative pen width" ) ); if( aWidth != m_currentPenWidth ) fprintf( workFile, "%g w\n", userToDeviceSize( aWidth ) ); diff --git a/common/plotters/common_plot_functions.cpp b/common/plotters/common_plot_functions.cpp index a730be2570..8f56d844e9 100644 --- a/common/plotters/common_plot_functions.cpp +++ b/common/plotters/common_plot_functions.cpp @@ -157,7 +157,7 @@ void PlotDrawingSheet( PLOTTER* plotter, const PROJECT* aProject, const TITLE_BL break; default: - wxFAIL_MSG( "PlotDrawingSheet(): Unknown drawing sheet item." ); + wxFAIL_MSG( wxT( "PlotDrawingSheet(): Unknown drawing sheet item." ) ); break; } } diff --git a/common/plugins/altium/altium_parser.cpp b/common/plugins/altium/altium_parser.cpp index 2b61bb999e..5749de773b 100644 --- a/common/plugins/altium/altium_parser.cpp +++ b/common/plugins/altium/altium_parser.cpp @@ -151,7 +151,7 @@ std::map ALTIUM_PARSER::ReadProperties() // If the key starts with '%UTF8%' we have to parse the value using UTF8 wxString value; - if( canonicalKey.StartsWith( "%UTF8%" ) ) + if( canonicalKey.StartsWith( wxT( "%UTF8%" ) ) ) value = wxString( valueS.c_str(), wxConvUTF8 ); else value = wxString( valueS.c_str(), wxConvISO8859_1 ); @@ -231,7 +231,7 @@ bool ALTIUM_PARSER::ReadBool( const std::map& aProps, const if( value == aProps.end() ) return aDefault; else - return value->second == "T" || value->second == "TRUE"; + return value->second == wxT( "T" ) || value->second == wxT( "TRUE" ); } @@ -242,7 +242,7 @@ int32_t ALTIUM_PARSER::ReadKicadUnit( const std::map& aProps wxString prefix; - if( !value.EndsWith( "mil", &prefix ) ) + if( !value.EndsWith( wxT( "mil" ), &prefix ) ) { wxLogError( _( "Unit '%s' does not end with 'mil'." ), value ); return 0; @@ -263,7 +263,7 @@ int32_t ALTIUM_PARSER::ReadKicadUnit( const std::map& aProps wxString ALTIUM_PARSER::ReadString( const std::map& aProps, const wxString& aKey, const wxString& aDefault ) { - const auto& utf8Value = aProps.find( wxString( "%UTF8%" ) + aKey ); + const auto& utf8Value = aProps.find( wxString( wxT( "%UTF8%" ) ) + aKey ); if( utf8Value != aProps.end() ) return utf8Value->second; diff --git a/common/plugins/altium/altium_parser.h b/common/plugins/altium/altium_parser.h index 6e2115a078..e682678cfb 100644 --- a/common/plugins/altium/altium_parser.h +++ b/common/plugins/altium/altium_parser.h @@ -80,7 +80,7 @@ public: else { m_error = true; - return wxString( "" ); + return wxString( wxT( "" ) ); } } diff --git a/common/plugins/altium/altium_parser_utils.cpp b/common/plugins/altium/altium_parser_utils.cpp index 0abbf5a2a6..24372667d0 100644 --- a/common/plugins/altium/altium_parser_utils.cpp +++ b/common/plugins/altium/altium_parser_utils.cpp @@ -32,7 +32,7 @@ LIB_ID AltiumToKiCadLibID( const wxString& aLibName, const wxString& aLibReferen { wxString libReference = EscapeString( aLibReference, CTX_LIBID ); - wxString key = !aLibName.empty() ? ( aLibName + ":" + libReference ) : libReference; + wxString key = !aLibName.empty() ? ( aLibName + wxT( ":" ) + libReference ) : libReference; LIB_ID libId; libId.Parse( key, true ); @@ -54,7 +54,7 @@ wxString AltiumPropertyToKiCadString( const wxString& aString ) { if( !inOverbar ) { - converted += "~{"; + converted += wxT( "~{" ); inOverbar = true; } @@ -65,7 +65,7 @@ wxString AltiumPropertyToKiCadString( const wxString& aString ) { if( inOverbar ) { - converted += "}"; + converted += wxT( "}" ); inOverbar = false; } @@ -93,13 +93,13 @@ wxString AltiumSpecialStringsToKiCadVariables( const wxString& size_t escaping_start = 0; do { - delimiter = aString.find( "+", start ); - escaping_start = aString.find( "'", start ); + delimiter = aString.find( wxT( "+" ), start ); + escaping_start = aString.find( wxT( "'" ), start ); if( escaping_start < delimiter ) { size_t text_start = escaping_start + 1; - size_t escaping_end = aString.find( "'", text_start ); + size_t escaping_end = aString.find( wxT( "'" ), text_start ); if( escaping_end == wxString::npos ) { @@ -114,7 +114,7 @@ wxString AltiumSpecialStringsToKiCadVariables( const wxString& { wxString specialString = aString.substr( start, delimiter - start ).Trim().Trim( false ); - if( specialString.StartsWith( "\"" ) && specialString.EndsWith( "\"" ) ) + if( specialString.StartsWith( wxT( "\"" ) ) && specialString.EndsWith( wxT( "\"" ) ) ) specialString = specialString.Mid( 1, specialString.Length() - 2 ); if( !specialString.IsEmpty() ) diff --git a/common/plugins/cadstar/cadstar_archive_parser.cpp b/common/plugins/cadstar/cadstar_archive_parser.cpp index 7eeba56011..1460c63089 100644 --- a/common/plugins/cadstar/cadstar_archive_parser.cpp +++ b/common/plugins/cadstar/cadstar_archive_parser.cpp @@ -836,7 +836,7 @@ wxString CADSTAR_ARCHIVE_PARSER::ParseTextFields( const wxString& aTextString, { // Assume the last two characters are "@>" wxASSERT_MSG( remainingStr.EndsWith( wxT( "@>" ) ), - "Expected '@>' at the end of a hyperlink" ); + wxT( "Expected '@>' at the end of a hyperlink" ) ); fieldValue = remainingStr.SubString( valueStart + splitPos + 1, remainingStr.Length() - 3 ); @@ -2429,7 +2429,7 @@ wxString CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDString( XNODE* aNode, unsigned bool aIsRequired ) { wxString attrName, retVal; - attrName = "attr"; + attrName = wxT( "attr" ); attrName << aID; if( !aNode->GetAttribute( attrName, &retVal ) ) @@ -2633,7 +2633,7 @@ void CADSTAR_ARCHIVE_PARSER::FixTextPositionNoAlignment( EDA_TEXT* aKiCadTextIte //Count num of additional lines wxString text = aKiCadTextItem->GetText(); - int numExtraLines = text.Replace( "\n", "\n" ); + int numExtraLines = text.Replace( wxT( "\n" ), wxT( "\n" ) ); numExtraLines -= text.at( text.size() - 1 ) == '\n'; // Ignore new line character at end positionOffset.x *= numExtraLines; positionOffset.y *= numExtraLines; diff --git a/common/plugins/eagle/eagle_parser.cpp b/common/plugins/eagle/eagle_parser.cpp index d215426aa9..ecfdfd6388 100644 --- a/common/plugins/eagle/eagle_parser.cpp +++ b/common/plugins/eagle/eagle_parser.cpp @@ -41,7 +41,7 @@ wxString escapeName( const wxString& aNetName ) { wxString ret( aNetName ); - ret.Replace( "!", "~" ); + ret.Replace( wxT( "!" ), wxT( "~" ) ); return ConvertToNewOverbarNotation( ret ); } @@ -172,12 +172,12 @@ int Convert( const wxString& aValue ) template <> bool Convert( const wxString& aValue ) { - if( aValue != "yes" && aValue != "no" ) + if( aValue != wxT( "yes" ) && aValue != wxT( "no" ) ) throw XML_PARSER_ERROR( "Conversion to bool failed. Original value, '" + aValue.ToStdString() + "', is neither 'yes' nor 'no'." ); - return aValue == "yes"; + return aValue == wxT( "yes" ); } @@ -298,23 +298,23 @@ static int parseAlignment( const wxString& aAlignment ) { // (bottom-left | bottom-center | bottom-right | center-left | // center | center-right | top-left | top-center | top-right) - if( aAlignment == "center" ) + if( aAlignment == wxT( "center" ) ) return ETEXT::CENTER; - else if( aAlignment == "center-right" ) + else if( aAlignment == wxT( "center-right" ) ) return ETEXT::CENTER_RIGHT; - else if( aAlignment == "top-left" ) + else if( aAlignment == wxT( "top-left" ) ) return ETEXT::TOP_LEFT; - else if( aAlignment == "top-center" ) + else if( aAlignment == wxT( "top-center" ) ) return ETEXT::TOP_CENTER; - else if( aAlignment == "top-right" ) + else if( aAlignment == wxT( "top-right" ) ) return ETEXT::TOP_RIGHT; - else if( aAlignment == "bottom-left" ) + else if( aAlignment == wxT( "bottom-left" ) ) return ETEXT::BOTTOM_LEFT; - else if( aAlignment == "bottom-center" ) + else if( aAlignment == wxT( "bottom-center" ) ) return ETEXT::BOTTOM_CENTER; - else if( aAlignment == "bottom-right" ) + else if( aAlignment == wxT( "bottom-right" ) ) return ETEXT::BOTTOM_RIGHT; - else if( aAlignment == "center-left" ) + else if( aAlignment == wxT( "center-left" ) ) return ETEXT::CENTER_LEFT; return DEFAULT_ALIGNMENT; @@ -339,30 +339,30 @@ EWIRE::EWIRE( wxXmlNode* aWire ) > */ - x1 = parseRequiredAttribute( aWire, "x1" ); - y1 = parseRequiredAttribute( aWire, "y1" ); - x2 = parseRequiredAttribute( aWire, "x2" ); - y2 = parseRequiredAttribute( aWire, "y2" ); - width = parseRequiredAttribute( aWire, "width" ); - layer = parseRequiredAttribute( aWire, "layer" ); - curve = parseOptionalAttribute( aWire, "curve" ); + x1 = parseRequiredAttribute( aWire, wxT( "x1" ) ); + y1 = parseRequiredAttribute( aWire, wxT( "y1" ) ); + x2 = parseRequiredAttribute( aWire, wxT( "x2" ) ); + y2 = parseRequiredAttribute( aWire, wxT( "y2" ) ); + width = parseRequiredAttribute( aWire, wxT( "width" ) ); + layer = parseRequiredAttribute( aWire, wxT( "layer" ) ); + curve = parseOptionalAttribute( aWire, wxT( "curve" ) ); - opt_wxString s = parseOptionalAttribute( aWire, "style" ); + opt_wxString s = parseOptionalAttribute( aWire, wxT( "style" ) ); - if( s == "continuous" ) + if( s == wxT( "continuous" ) ) style = EWIRE::CONTINUOUS; - else if( s == "longdash" ) + else if( s == wxT( "longdash" ) ) style = EWIRE::LONGDASH; - else if( s == "shortdash" ) + else if( s == wxT( "shortdash" ) ) style = EWIRE::SHORTDASH; - else if( s == "dashdot" ) + else if( s == wxT( "dashdot" ) ) style = EWIRE::DASHDOT; - s = parseOptionalAttribute( aWire, "cap" ); + s = parseOptionalAttribute( aWire, wxT( "cap" ) ); - if( s == "round" ) + if( s == wxT( "round" ) ) cap = EWIRE::ROUND; - else if( s == "flat" ) + else if( s == wxT( "flat" ) ) cap = EWIRE::FLAT; } @@ -377,8 +377,8 @@ EJUNCTION::EJUNCTION( wxXmlNode* aJunction ) > */ - x = parseRequiredAttribute( aJunction, "x" ); - y = parseRequiredAttribute( aJunction, "y" ); + x = parseRequiredAttribute( aJunction, wxT( "x" ) ); + y = parseRequiredAttribute( aJunction, wxT( "y" ) ); } @@ -398,12 +398,12 @@ ELABEL::ELABEL( wxXmlNode* aLabel, const wxString& aNetName ) > */ - x = parseRequiredAttribute( aLabel, "x" ); - y = parseRequiredAttribute( aLabel, "y" ); - size = parseRequiredAttribute( aLabel, "size" ); - layer = parseRequiredAttribute( aLabel, "layer" ); - rot = parseOptionalAttribute( aLabel, "rot" ); - xref = parseOptionalAttribute( aLabel, "xref" ); + x = parseRequiredAttribute( aLabel, wxT( "x" ) ); + y = parseRequiredAttribute( aLabel, wxT( "y" ) ); + size = parseRequiredAttribute( aLabel, wxT( "size" ) ); + layer = parseRequiredAttribute( aLabel, wxT( "layer" ) ); + rot = parseOptionalAttribute( aLabel, wxT( "rot" ) ); + xref = parseOptionalAttribute( aLabel, wxT( "xref" ) ); netname = aNetName; } @@ -423,15 +423,15 @@ EVIA::EVIA( wxXmlNode* aVia ) > */ - x = parseRequiredAttribute( aVia, "x" ); - y = parseRequiredAttribute( aVia, "y" ); + x = parseRequiredAttribute( aVia, wxT( "x" ) ); + y = parseRequiredAttribute( aVia, wxT( "y" ) ); - wxString ext = parseRequiredAttribute( aVia, "extent" ); + wxString ext = parseRequiredAttribute( aVia, wxT( "extent" ) ); sscanf( ext.c_str(), "%d-%d", &layer_front_most, &layer_back_most ); - drill = parseRequiredAttribute( aVia, "drill" ); - diam = parseOptionalAttribute( aVia, "diameter" ); - shape = parseOptionalAttribute( aVia, "shape" ); + drill = parseRequiredAttribute( aVia, wxT( "drill" ) ); + diam = parseOptionalAttribute( aVia, wxT( "diameter" ) ); + shape = parseOptionalAttribute( aVia, wxT( "shape" ) ); } @@ -448,11 +448,11 @@ ECIRCLE::ECIRCLE( wxXmlNode* aCircle ) > */ - x = parseRequiredAttribute( aCircle, "x" ); - y = parseRequiredAttribute( aCircle, "y" ); - radius = parseRequiredAttribute( aCircle, "radius" ); - width = parseRequiredAttribute( aCircle, "width" ); - layer = parseRequiredAttribute( aCircle, "layer" ); + x = parseRequiredAttribute( aCircle, wxT( "x" ) ); + y = parseRequiredAttribute( aCircle, wxT( "y" ) ); + radius = parseRequiredAttribute( aCircle, wxT( "radius" ) ); + width = parseRequiredAttribute( aCircle, wxT( "width" ) ); + layer = parseRequiredAttribute( aCircle, wxT( "layer" ) ); } @@ -470,12 +470,12 @@ ERECT::ERECT( wxXmlNode* aRect ) > */ - x1 = parseRequiredAttribute( aRect, "x1" ); - y1 = parseRequiredAttribute( aRect, "y1" ); - x2 = parseRequiredAttribute( aRect, "x2" ); - y2 = parseRequiredAttribute( aRect, "y2" ); - layer = parseRequiredAttribute( aRect, "layer" ); - rot = parseOptionalAttribute( aRect, "rot" ); + x1 = parseRequiredAttribute( aRect, wxT( "x1" ) ); + y1 = parseRequiredAttribute( aRect, wxT( "y1" ) ); + x2 = parseRequiredAttribute( aRect, wxT( "x2" ) ); + y2 = parseRequiredAttribute( aRect, wxT( "y2" ) ); + layer = parseRequiredAttribute( aRect, wxT( "layer" ) ); + rot = parseOptionalAttribute( aRect, wxT( "rot" ) ); } @@ -498,30 +498,30 @@ EATTR::EATTR( wxXmlNode* aTree ) > */ - name = parseRequiredAttribute( aTree, "name" ); - value = parseOptionalAttribute( aTree, "value" ); + name = parseRequiredAttribute( aTree, wxT( "name" ) ); + value = parseOptionalAttribute( aTree, wxT( "value" ) ); - x = parseOptionalAttribute( aTree, "x" ); - y = parseOptionalAttribute( aTree, "y" ); - size = parseOptionalAttribute( aTree, "size" ); + x = parseOptionalAttribute( aTree, wxT( "x" ) ); + y = parseOptionalAttribute( aTree, wxT( "y" ) ); + size = parseOptionalAttribute( aTree, wxT( "size" ) ); - layer = parseOptionalAttribute( aTree, "layer" ); - ratio = parseOptionalAttribute( aTree, "ratio" ); - rot = parseOptionalAttribute( aTree, "rot" ); + layer = parseOptionalAttribute( aTree, wxT( "layer" ) ); + ratio = parseOptionalAttribute( aTree, wxT( "ratio" ) ); + rot = parseOptionalAttribute( aTree, wxT( "rot" ) ); - opt_wxString stemp = parseOptionalAttribute( aTree, "display" ); + opt_wxString stemp = parseOptionalAttribute( aTree, wxT( "display" ) ); // (off | value | name | both) - if( stemp == "off" ) + if( stemp == wxT( "off" ) ) display = EATTR::Off; - else if( stemp == "name" ) + else if( stemp == wxT( "name" ) ) display = EATTR::NAME; - else if( stemp == "both" ) + else if( stemp == wxT( "both" ) ) display = EATTR::BOTH; else // "value" is the default display = EATTR::VALUE; - stemp = parseOptionalAttribute( aTree, "align" ); + stemp = parseOptionalAttribute( aTree, wxT( "align" ) ); align = stemp ? parseAlignment( *stemp ) : DEFAULT_ALIGNMENT; } @@ -543,14 +543,14 @@ EDIMENSION::EDIMENSION( wxXmlNode* aDimension ) > */ - x1 = parseRequiredAttribute( aDimension, "x1" ); - y1 = parseRequiredAttribute( aDimension, "y1" ); - x2 = parseRequiredAttribute( aDimension, "x2" ); - y2 = parseRequiredAttribute( aDimension, "y2" ); - x3 = parseRequiredAttribute( aDimension, "x3" ); - y3 = parseRequiredAttribute( aDimension, "y3" ); - layer = parseRequiredAttribute( aDimension, "layer" ); - dimensionType = parseOptionalAttribute( aDimension, "dtype" ); + x1 = parseRequiredAttribute( aDimension, wxT( "x1" ) ); + y1 = parseRequiredAttribute( aDimension, wxT( "y1" ) ); + x2 = parseRequiredAttribute( aDimension, wxT( "x2" ) ); + y2 = parseRequiredAttribute( aDimension, wxT( "y2" ) ); + x3 = parseRequiredAttribute( aDimension, wxT( "x3" ) ); + y3 = parseRequiredAttribute( aDimension, wxT( "y3" ) ); + layer = parseRequiredAttribute( aDimension, wxT( "layer" ) ); + dimensionType = parseOptionalAttribute( aDimension, wxT( "dtype" ) ); } @@ -571,16 +571,16 @@ ETEXT::ETEXT( wxXmlNode* aText ) */ text = aText->GetNodeContent(); - x = parseRequiredAttribute( aText, "x" ); - y = parseRequiredAttribute( aText, "y" ); - size = parseRequiredAttribute( aText, "size" ); - layer = parseRequiredAttribute( aText, "layer" ); + x = parseRequiredAttribute( aText, wxT( "x" ) ); + y = parseRequiredAttribute( aText, wxT( "y" ) ); + size = parseRequiredAttribute( aText, wxT( "size" ) ); + layer = parseRequiredAttribute( aText, wxT( "layer" ) ); - font = parseOptionalAttribute( aText, "font" ); - ratio = parseOptionalAttribute( aText, "ratio" ); - rot = parseOptionalAttribute( aText, "rot" ); + font = parseOptionalAttribute( aText, wxT( "font" ) ); + ratio = parseOptionalAttribute( aText, wxT( "ratio" ) ); + rot = parseOptionalAttribute( aText, wxT( "rot" ) ); - opt_wxString stemp = parseOptionalAttribute( aText, "align" ); + opt_wxString stemp = parseOptionalAttribute( aText, wxT( "align" ) ); align = stemp ? parseAlignment( *stemp ) : DEFAULT_ALIGNMENT; } @@ -594,11 +594,11 @@ wxSize ETEXT::ConvertSize() const { const wxString& fontName = font.CGet(); - if( fontName == "vector" ) + if( fontName == wxT( "vector" ) ) { textsize = wxSize( size.ToSchUnits(), size.ToSchUnits() ); } - else if( fontName == "fixed" ) + else if( fontName == wxT( "fixed" ) ) { textsize = wxSize( size.ToSchUnits(), size.ToSchUnits() * 0.80 ); } @@ -639,29 +639,29 @@ EFRAME::EFRAME( wxXmlNode* aFrameNode ) border_right = true; border_bottom = true; - x1 = parseRequiredAttribute( aFrameNode, "x1" ); - y1 = parseRequiredAttribute( aFrameNode, "y1" ); - x2 = parseRequiredAttribute( aFrameNode, "x2" ); - y2 = parseRequiredAttribute( aFrameNode, "y2" ); - columns = parseRequiredAttribute( aFrameNode, "columns" ); - rows = parseRequiredAttribute( aFrameNode, "rows" ); - layer = parseRequiredAttribute( aFrameNode, "layer" ); - border_left = parseOptionalAttribute( aFrameNode, "border-left" ); - border_top = parseOptionalAttribute( aFrameNode, "border-top" ); - border_right = parseOptionalAttribute( aFrameNode, "border-right" ); - border_bottom = parseOptionalAttribute( aFrameNode, "border-bottom" ); + x1 = parseRequiredAttribute( aFrameNode, wxT( "x1" ) ); + y1 = parseRequiredAttribute( aFrameNode, wxT( "y1" ) ); + x2 = parseRequiredAttribute( aFrameNode, wxT( "x2" ) ); + y2 = parseRequiredAttribute( aFrameNode, wxT( "y2" ) ); + columns = parseRequiredAttribute( aFrameNode, wxT( "columns" ) ); + rows = parseRequiredAttribute( aFrameNode, wxT( "rows" ) ); + layer = parseRequiredAttribute( aFrameNode, wxT( "layer" ) ); + border_left = parseOptionalAttribute( aFrameNode, wxT( "border-left" ) ); + border_top = parseOptionalAttribute( aFrameNode, wxT( "border-top" ) ); + border_right = parseOptionalAttribute( aFrameNode, wxT( "border-right" ) ); + border_bottom = parseOptionalAttribute( aFrameNode, wxT( "border-bottom" ) ); } EPAD_COMMON::EPAD_COMMON( wxXmlNode* aPad ) { // #REQUIRED says DTD, throw exception if not found - name = parseRequiredAttribute( aPad, "name" ); - x = parseRequiredAttribute( aPad, "x" ); - y = parseRequiredAttribute( aPad, "y" ); - rot = parseOptionalAttribute( aPad, "rot" ); - stop = parseOptionalAttribute( aPad, "stop" ); - thermals = parseOptionalAttribute( aPad, "thermals" ); + name = parseRequiredAttribute( aPad, wxT( "name" ) ); + x = parseRequiredAttribute( aPad, wxT( "x" ) ); + y = parseRequiredAttribute( aPad, wxT( "y" ) ); + rot = parseOptionalAttribute( aPad, wxT( "rot" ) ); + stop = parseOptionalAttribute( aPad, wxT( "stop" ) ); + thermals = parseOptionalAttribute( aPad, wxT( "thermals" ) ); } @@ -685,26 +685,26 @@ EPAD::EPAD( wxXmlNode* aPad ) */ // #REQUIRED says DTD, throw exception if not found - drill = parseRequiredAttribute( aPad, "drill" ); + drill = parseRequiredAttribute( aPad, wxT( "drill" ) ); // Optional attributes - diameter = parseOptionalAttribute( aPad, "diameter" ); + diameter = parseOptionalAttribute( aPad, wxT( "diameter" ) ); - opt_wxString s = parseOptionalAttribute( aPad, "shape" ); + opt_wxString s = parseOptionalAttribute( aPad, wxT( "shape" ) ); // (square | round | octagon | long | offset) - if( s == "square" ) + if( s == wxT( "square" ) ) shape = EPAD::SQUARE; - else if( s == "round" ) + else if( s == wxT( "round" ) ) shape = EPAD::ROUND; - else if( s == "octagon" ) + else if( s == wxT( "octagon" ) ) shape = EPAD::OCTAGON; - else if( s == "long" ) + else if( s == wxT( "long" ) ) shape = EPAD::LONG; - else if( s == "offset" ) + else if( s == wxT( "offset" ) ) shape = EPAD::OFFSET; - first = parseOptionalAttribute( aPad, "first" ); + first = parseOptionalAttribute( aPad, wxT( "first" ) ); } @@ -728,12 +728,12 @@ ESMD::ESMD( wxXmlNode* aSMD ) */ // DTD #REQUIRED, throw exception if not found - dx = parseRequiredAttribute( aSMD, "dx" ); - dy = parseRequiredAttribute( aSMD, "dy" ); - layer = parseRequiredAttribute( aSMD, "layer" ); + dx = parseRequiredAttribute( aSMD, wxT( "dx" ) ); + dy = parseRequiredAttribute( aSMD, wxT( "dy" ) ); + layer = parseRequiredAttribute( aSMD, wxT( "layer" ) ); - roundness = parseOptionalAttribute( aSMD, "roundness" ); - cream = parseOptionalAttribute( aSMD, "cream" ); + roundness = parseOptionalAttribute( aSMD, wxT( "roundness" ) ); + cream = parseOptionalAttribute( aSMD, wxT( "cream" ) ); } @@ -755,16 +755,16 @@ EPIN::EPIN( wxXmlNode* aPin ) */ // DTD #REQUIRED, throw exception if not found - name = parseRequiredAttribute( aPin, "name" ); - x = parseRequiredAttribute( aPin, "x" ); - y = parseRequiredAttribute( aPin, "y" ); + name = parseRequiredAttribute( aPin, wxT( "name" ) ); + x = parseRequiredAttribute( aPin, wxT( "x" ) ); + y = parseRequiredAttribute( aPin, wxT( "y" ) ); - visible = parseOptionalAttribute( aPin, "visible" ); - length = parseOptionalAttribute( aPin, "length" ); - direction = parseOptionalAttribute( aPin, "direction" ); - function = parseOptionalAttribute( aPin, "function" ); - swaplevel = parseOptionalAttribute( aPin, "swaplevel" ); - rot = parseOptionalAttribute( aPin, "rot" ); + visible = parseOptionalAttribute( aPin, wxT( "visible" ) ); + length = parseOptionalAttribute( aPin, wxT( "length" ) ); + direction = parseOptionalAttribute( aPin, wxT( "direction" ) ); + function = parseOptionalAttribute( aPin, wxT( "function" ) ); + swaplevel = parseOptionalAttribute( aPin, wxT( "swaplevel" ) ); + rot = parseOptionalAttribute( aPin, wxT( "rot" ) ); } @@ -779,9 +779,9 @@ EVERTEX::EVERTEX( wxXmlNode* aVertex ) > */ - x = parseRequiredAttribute( aVertex, "x" ); - y = parseRequiredAttribute( aVertex, "y" ); - curve = parseOptionalAttribute( aVertex, "curve" ); + x = parseRequiredAttribute( aVertex, wxT( "x" ) ); + y = parseRequiredAttribute( aVertex, wxT( "y" ) ); + curve = parseOptionalAttribute( aVertex, wxT( "curve" ) ); } @@ -801,25 +801,25 @@ EPOLYGON::EPOLYGON( wxXmlNode* aPolygon ) > */ - width = parseRequiredAttribute( aPolygon, "width" ); - layer = parseRequiredAttribute( aPolygon, "layer" ); + width = parseRequiredAttribute( aPolygon, wxT( "width" ) ); + layer = parseRequiredAttribute( aPolygon, wxT( "layer" ) ); - spacing = parseOptionalAttribute( aPolygon, "spacing" ); - isolate = parseOptionalAttribute( aPolygon, "isolate" ); - opt_wxString s = parseOptionalAttribute( aPolygon, "pour" ); + spacing = parseOptionalAttribute( aPolygon, wxT( "spacing" ) ); + isolate = parseOptionalAttribute( aPolygon, wxT( "isolate" ) ); + opt_wxString s = parseOptionalAttribute( aPolygon, wxT( "pour" ) ); // default pour to solid fill pour = EPOLYGON::SOLID; // (solid | hatch | cutout) - if( s == "hatch" ) + if( s == wxT( "hatch" ) ) pour = EPOLYGON::HATCH; - else if( s == "cutout" ) + else if( s == wxT( "cutout" ) ) pour = EPOLYGON::CUTOUT; - orphans = parseOptionalAttribute( aPolygon, "orphans" ); - thermals = parseOptionalAttribute( aPolygon, "thermals" ); - rank = parseOptionalAttribute( aPolygon, "rank" ); + orphans = parseOptionalAttribute( aPolygon, wxT( "orphans" ) ); + thermals = parseOptionalAttribute( aPolygon, wxT( "thermals" ) ); + rank = parseOptionalAttribute( aPolygon, wxT( "rank" ) ); } @@ -835,9 +835,9 @@ EHOLE::EHOLE( wxXmlNode* aHole ) */ // #REQUIRED: - x = parseRequiredAttribute( aHole, "x" ); - y = parseRequiredAttribute( aHole, "y" ); - drill = parseRequiredAttribute( aHole, "drill" ); + x = parseRequiredAttribute( aHole, wxT( "x" ) ); + y = parseRequiredAttribute( aHole, wxT( "y" ) ); + drill = parseRequiredAttribute( aHole, wxT( "drill" ) ); } @@ -859,20 +859,20 @@ EELEMENT::EELEMENT( wxXmlNode* aElement ) */ // #REQUIRED - name = parseRequiredAttribute( aElement, "name" ); - library = parseRequiredAttribute( aElement, "library" ); - value = parseRequiredAttribute( aElement, "value" ); - std::string p = parseRequiredAttribute( aElement, "package" ); + name = parseRequiredAttribute( aElement, wxT( "name" ) ); + library = parseRequiredAttribute( aElement, wxT( "library" ) ); + value = parseRequiredAttribute( aElement, wxT( "value" ) ); + std::string p = parseRequiredAttribute( aElement, wxT( "package" ) ); ReplaceIllegalFileNameChars( &p, '_' ); package = wxString::FromUTF8( p.c_str() ); - x = parseRequiredAttribute( aElement, "x" ); - y = parseRequiredAttribute( aElement, "y" ); + x = parseRequiredAttribute( aElement, wxT( "x" ) ); + y = parseRequiredAttribute( aElement, wxT( "y" ) ); // optional - locked = parseOptionalAttribute( aElement, "locked" ); - smashed = parseOptionalAttribute( aElement, "smashed" ); - rot = parseOptionalAttribute( aElement, "rot" ); + locked = parseOptionalAttribute( aElement, wxT( "locked" ) ); + smashed = parseOptionalAttribute( aElement, wxT( "smashed" ) ); + rot = parseOptionalAttribute( aElement, wxT( "rot" ) ); } @@ -890,12 +890,12 @@ ELAYER::ELAYER( wxXmlNode* aLayer ) > */ - number = parseRequiredAttribute( aLayer, "number" ); - name = parseRequiredAttribute( aLayer, "name" ); - color = parseRequiredAttribute( aLayer, "color" ); + number = parseRequiredAttribute( aLayer, wxT( "number" ) ); + name = parseRequiredAttribute( aLayer, wxT( "name" ) ); + color = parseRequiredAttribute( aLayer, wxT( "color" ) ); fill = 1; // Temporary value. - visible = parseOptionalAttribute( aLayer, "visible" ); - active = parseOptionalAttribute( aLayer, "active" ); + visible = parseOptionalAttribute( aLayer, wxT( "visible" ) ); + active = parseOptionalAttribute( aLayer, wxT( "active" ) ); } @@ -913,39 +913,39 @@ EPART::EPART( wxXmlNode* aPart ) * > */ // #REQUIRED - name = parseRequiredAttribute( aPart, "name" ); - library = parseRequiredAttribute( aPart, "library" ); - deviceset = parseRequiredAttribute( aPart, "deviceset" ); - device = parseRequiredAttribute( aPart, "device" ); - technology = parseOptionalAttribute( aPart, "technology" ); - value = parseOptionalAttribute( aPart, "value" ); + name = parseRequiredAttribute( aPart, wxT( "name" ) ); + library = parseRequiredAttribute( aPart, wxT( "library" ) ); + deviceset = parseRequiredAttribute( aPart, wxT( "deviceset" ) ); + device = parseRequiredAttribute( aPart, wxT( "device" ) ); + technology = parseOptionalAttribute( aPart, wxT( "technology" ) ); + value = parseOptionalAttribute( aPart, wxT( "value" ) ); for( wxXmlNode* child = aPart->GetChildren(); child; child = child->GetNext() ) { - if( child->GetName() == "attribute" ) + if( child->GetName() == wxT( "attribute" ) ) { std::string aname, avalue; for( wxXmlAttribute* x = child->GetAttributes(); x; x = x->GetNext() ) { - if( x->GetName() == "name" ) + if( x->GetName() == wxT( "name" ) ) aname = x->GetValue(); - else if( x->GetName() == "value" ) + else if( x->GetName() == wxT( "value" ) ) avalue = x->GetValue(); } if( aname.size() && avalue.size() ) attribute[aname] = avalue; } - else if( child->GetName() == "variant" ) + else if( child->GetName() == wxT( "variant" ) ) { std::string aname, avalue; for( wxXmlAttribute* x = child->GetAttributes(); x; x = x->GetNext() ) { - if( x->GetName() == "name" ) + if( x->GetName() == wxT( "name" ) ) aname = x->GetValue(); - else if( x->GetName() == "value" ) + else if( x->GetName() == wxT( "value" ) ) avalue = x->GetValue(); } @@ -969,15 +969,15 @@ EINSTANCE::EINSTANCE( wxXmlNode* aInstance ) * rot %Rotation; "R0" * > */ - part = parseRequiredAttribute( aInstance, "part" ); - gate = parseRequiredAttribute( aInstance, "gate" ); + part = parseRequiredAttribute( aInstance, wxT( "part" ) ); + gate = parseRequiredAttribute( aInstance, wxT( "gate" ) ); - x = parseRequiredAttribute( aInstance, "x" ); - y = parseRequiredAttribute( aInstance, "y" ); + x = parseRequiredAttribute( aInstance, wxT( "x" ) ); + y = parseRequiredAttribute( aInstance, wxT( "y" ) ); // optional - smashed = parseOptionalAttribute( aInstance, "smashed" ); - rot = parseOptionalAttribute( aInstance, "rot" ); + smashed = parseOptionalAttribute( aInstance, wxT( "smashed" ) ); + rot = parseOptionalAttribute( aInstance, wxT( "rot" ) ); } @@ -995,24 +995,24 @@ EGATE::EGATE( wxXmlNode* aGate ) * > */ - name = parseRequiredAttribute( aGate, "name" ); - symbol = parseRequiredAttribute( aGate, "symbol" ); + name = parseRequiredAttribute( aGate, wxT( "name" ) ); + symbol = parseRequiredAttribute( aGate, wxT( "symbol" ) ); - x = parseRequiredAttribute( aGate, "x" ); - y = parseRequiredAttribute( aGate, "y" ); + x = parseRequiredAttribute( aGate, wxT( "x" ) ); + y = parseRequiredAttribute( aGate, wxT( "y" ) ); - opt_wxString stemp = parseOptionalAttribute( aGate, "addlevel" ); + opt_wxString stemp = parseOptionalAttribute( aGate, wxT( "addlevel" ) ); // (off | value | name | both) - if( stemp == "must" ) + if( stemp == wxT( "must" ) ) addlevel = EGATE::MUST; - else if( stemp == "can" ) + else if( stemp == wxT( "can" ) ) addlevel = EGATE::CAN; - else if( stemp == "next" ) + else if( stemp == wxT( "next" ) ) addlevel = EGATE::NEXT; - else if( stemp == "request" ) + else if( stemp == wxT( "request" ) ) addlevel = EGATE::REQUEST; - else if( stemp == "always" ) + else if( stemp == wxT( "always" ) ) addlevel = EGATE::ALWAYS; else addlevel = EGATE::NEXT; @@ -1030,9 +1030,9 @@ ECONNECT::ECONNECT( wxXmlNode* aConnect ) * route %ContactRoute; "all" * > */ - gate = parseRequiredAttribute( aConnect, "gate" ); - pin = parseRequiredAttribute( aConnect, "pin" ); - pad = parseRequiredAttribute( aConnect, "pad" ); + gate = parseRequiredAttribute( aConnect, wxT( "gate" ) ); + pin = parseRequiredAttribute( aConnect, wxT( "pin" ) ); + pad = parseRequiredAttribute( aConnect, wxT( "pad" ) ); } @@ -1045,8 +1045,8 @@ EDEVICE::EDEVICE( wxXmlNode* aDevice ) package %String; #IMPLIED > */ - name = parseRequiredAttribute( aDevice, "name" ); - opt_wxString pack = parseOptionalAttribute( aDevice, "package" ); + name = parseRequiredAttribute( aDevice, wxT( "name" ) ); + opt_wxString pack = parseOptionalAttribute( aDevice, wxT( "package" ) ); if( pack ) { @@ -1056,7 +1056,7 @@ EDEVICE::EDEVICE( wxXmlNode* aDevice ) } NODE_MAP aDeviceChildren = MapChildren( aDevice ); - wxXmlNode* connectNode = getChildrenNodes( aDeviceChildren, "connects" ); + wxXmlNode* connectNode = getChildrenNodes( aDeviceChildren, wxT( "connects" ) ); while( connectNode ) { @@ -1077,23 +1077,23 @@ EDEVICE_SET::EDEVICE_SET( wxXmlNode* aDeviceSet ) > */ - name = parseRequiredAttribute( aDeviceSet, "name" ); - prefix = parseOptionalAttribute( aDeviceSet, "prefix" ); - uservalue = parseOptionalAttribute( aDeviceSet, "uservalue" ); + name = parseRequiredAttribute( aDeviceSet, wxT( "name" ) ); + prefix = parseOptionalAttribute( aDeviceSet, wxT( "prefix" ) ); + uservalue = parseOptionalAttribute( aDeviceSet, wxT( "uservalue" ) ); /* Russell: Parsing of devices and gates moved to sch_eagle_plugin.cpp * //TODO: description NODE_MAP aDeviceSetChildren = MapChildren(aDeviceSet); - wxXmlNode* deviceNode = getChildrenNodes(aDeviceSetChildren, "device"); + wxXmlNode* deviceNode = getChildrenNodes(aDeviceSetChildren, wxT( "device" )); while(deviceNode){ devices.push_back(EDEVICE(deviceNode)); deviceNode->GetNext(); } - wxXmlNode* gateNode = getChildrenNodes(aDeviceSetChildren, "gate"); + wxXmlNode* gateNode = getChildrenNodes(aDeviceSetChildren, wxT( "gate" )); while(gateNode){ gates.push_back(EGATE(gateNode)); @@ -1106,15 +1106,15 @@ EDEVICE_SET::EDEVICE_SET( wxXmlNode* aDeviceSet ) ECLASS::ECLASS( wxXmlNode* aClass ) { - number = parseRequiredAttribute( aClass, "number" ); - name = parseRequiredAttribute( aClass, "name" ); + number = parseRequiredAttribute( aClass, wxT( "number" ) ); + name = parseRequiredAttribute( aClass, wxT( "name" ) ); for( wxXmlNode* child = aClass->GetChildren(); child; child = child->GetNext() ) { - if( child->GetName() == "clearance" ) + if( child->GetName() == wxT( "clearance" ) ) { - wxString to = parseRequiredAttribute( child, "class" ); - ECOORD value = parseRequiredAttribute( child, "value" ); + wxString to = parseRequiredAttribute( child, wxT( "class" ) ); + ECOORD value = parseRequiredAttribute( child, wxT( "value" ) ); clearanceMap[to] = value; } diff --git a/common/preview_items/arc_assistant.cpp b/common/preview_items/arc_assistant.cpp index bed900dad8..497535472a 100644 --- a/common/preview_items/arc_assistant.cpp +++ b/common/preview_items/arc_assistant.cpp @@ -111,7 +111,7 @@ void ARC_ASSISTANT::ViewDraw( int aLayer, KIGFX::VIEW* aView ) const double degs = getNormDeciDegFromRad( initAngle ); - cursorStrings.push_back( DimensionLabel( "r", m_constructMan.GetRadius(), m_units ) ); + cursorStrings.push_back( DimensionLabel( wxT( "r" ), m_constructMan.GetRadius(), m_units ) ); cursorStrings.push_back( DimensionLabel( wxString::FromUTF8( "θ" ), degs, EDA_UNITS::DEGREES ) ); } diff --git a/common/preview_items/preview_utils.cpp b/common/preview_items/preview_utils.cpp index 1889f155fb..ec6be389a4 100644 --- a/common/preview_items/preview_utils.cpp +++ b/common/preview_items/preview_utils.cpp @@ -36,7 +36,7 @@ wxString KIGFX::PREVIEW::DimensionLabel( const wxString& prefix, double aVal, ED wxString str; if( prefix.size() ) - str << prefix << ": "; + str << prefix << wxT( ": " ); wxString fmtStr; @@ -55,7 +55,7 @@ wxString KIGFX::PREVIEW::DimensionLabel( const wxString& prefix, double aVal, ED str << wxString::Format( fmtStr, To_User_Unit( aUnits, aVal ) ); if( aIncludeUnits ) - str << " " << GetAbbreviatedUnitsLabel( aUnits ); + str << wxT( " " ) << GetAbbreviatedUnitsLabel( aUnits ); return str; } diff --git a/common/preview_items/ruler_item.cpp b/common/preview_items/ruler_item.cpp index 81daac0dce..13bb91f0b6 100644 --- a/common/preview_items/ruler_item.cpp +++ b/common/preview_items/ruler_item.cpp @@ -67,10 +67,10 @@ static void drawCursorStrings( KIGFX::VIEW* aView, const VECTOR2D& aCursor, if( aFlipY ) temp.y = -temp.y; - cursorStrings.push_back( DimensionLabel( "x", temp.x, aUnits ) ); - cursorStrings.push_back( DimensionLabel( "y", temp.y, aUnits ) ); + cursorStrings.push_back( DimensionLabel( wxT( "x" ), temp.x, aUnits ) ); + cursorStrings.push_back( DimensionLabel( wxT( "y" ), temp.y, aUnits ) ); - cursorStrings.push_back( DimensionLabel( "r", aRulerVec.EuclideanNorm(), aUnits ) ); + cursorStrings.push_back( DimensionLabel( wxT( "r" ), aRulerVec.EuclideanNorm(), aUnits ) ); double degs = RAD2DECIDEG( -aRulerVec.Angle() ); cursorStrings.push_back( DimensionLabel( wxString::FromUTF8( "θ" ), degs, @@ -221,7 +221,7 @@ void drawTicksAlongLine( KIGFX::VIEW* aView, const VECTOR2D& aOrigin, const VECT if( drawLabel ) { - wxString label = DimensionLabel( "", tickSpace * i, aUnits, false ); + wxString label = DimensionLabel( wxT( "" ), tickSpace * i, aUnits, false ); gal->SetLineWidth( textThickness ); gal->StrokeText( label, tickPos + labelOffset, labelAngle ); } diff --git a/common/preview_items/two_point_assistant.cpp b/common/preview_items/two_point_assistant.cpp index 7664236959..8d12fd5bf6 100644 --- a/common/preview_items/two_point_assistant.cpp +++ b/common/preview_items/two_point_assistant.cpp @@ -77,19 +77,19 @@ void TWO_POINT_ASSISTANT::ViewDraw( int aLayer, KIGFX::VIEW* aView ) const if( m_shape == GEOM_SHAPE::SEGMENT ) { - cursorStrings.push_back( DimensionLabel( "l", radVec.EuclideanNorm(), m_units ) ); + cursorStrings.push_back( DimensionLabel( wxT( "l" ), radVec.EuclideanNorm(), m_units ) ); } else if( m_shape == GEOM_SHAPE::RECT ) { - cursorStrings.push_back( DimensionLabel( "x", std::abs( radVec.x ), m_units ) ); - cursorStrings.push_back( DimensionLabel( "y", std::abs( radVec.y ), m_units ) ); + cursorStrings.push_back( DimensionLabel( wxT( "x" ), std::abs( radVec.x ), m_units ) ); + cursorStrings.push_back( DimensionLabel( wxT( "y" ), std::abs( radVec.y ), m_units ) ); } else if( m_shape == GEOM_SHAPE::CIRCLE ) { KIGFX::PREVIEW::DRAW_CONTEXT preview_ctx( *aView ); preview_ctx.DrawLine( origin, end, false ); - cursorStrings.push_back( DimensionLabel( "r", radVec.EuclideanNorm(), m_units ) ); + cursorStrings.push_back( DimensionLabel( wxT( "r" ), radVec.EuclideanNorm(), m_units ) ); } // place the text next to cursor, on opposite side from drawing diff --git a/common/project.cpp b/common/project.cpp index c546f6cba5..4be0dedce4 100644 --- a/common/project.cpp +++ b/common/project.cpp @@ -93,7 +93,7 @@ void PROJECT::setProjectFullName( const wxString& aFullPathAndName ) { Clear(); // clear the data when the project changes. - wxLogTrace( tracePathsAndFiles, "%s: old:'%s' new:'%s'", __func__, + wxLogTrace( tracePathsAndFiles, wxT( "%s: old:'%s' new:'%s'" ), __func__, TO_UTF8( GetProjectFullName() ), TO_UTF8( aFullPathAndName ) ); m_project_name = aFullPathAndName; @@ -139,13 +139,13 @@ bool PROJECT::IsNullProject() const const wxString PROJECT::SymbolLibTableName() const { - return libTableName( "sym-lib-table" ); + return libTableName( wxT( "sym-lib-table" ) ); } const wxString PROJECT::FootprintLibTblName() const { - return libTableName( "fp-lib-table" ); + return libTableName( wxT( "fp-lib-table" ) ); } @@ -181,7 +181,7 @@ const wxString PROJECT::libTableName( const wxString& aLibTableName ) const * until the project file being edited is saved. It is then moved to the correct * file in the folder where the project file is saved. */ - fn.SetName( "prj-" + aLibTableName ); + fn.SetName( wxT( "prj-" ) + aLibTableName ); } else // normal path. { diff --git a/common/property_mgr.cpp b/common/property_mgr.cpp index 47fd15b034..e1bad1feb2 100644 --- a/common/property_mgr.cpp +++ b/common/property_mgr.cpp @@ -123,14 +123,14 @@ void PROPERTY_MANAGER::AddTypeCast( TYPE_CAST_BASE* aCast ) TYPE_ID derivedHash = aCast->DerivedHash(); CLASS_DESC& classDesc = getClass( aCast->BaseHash() ); auto& typeCasts = classDesc.m_typeCasts; - wxASSERT_MSG( typeCasts.count( derivedHash ) == 0, "Such converter already exists" ); + wxASSERT_MSG( typeCasts.count( derivedHash ) == 0, wxT( "Such converter already exists" ) ); typeCasts.emplace( derivedHash, aCast ); } void PROPERTY_MANAGER::InheritsAfter( TYPE_ID aDerived, TYPE_ID aBase ) { - wxASSERT_MSG( aDerived != aBase, "Class cannot inherit from itself" ); + wxASSERT_MSG( aDerived != aBase, wxT( "Class cannot inherit from itself" ) ); CLASS_DESC& derived = getClass( aDerived ); CLASS_DESC& base = getClass( aBase ); @@ -138,7 +138,7 @@ void PROPERTY_MANAGER::InheritsAfter( TYPE_ID aDerived, TYPE_ID aBase ) m_dirty = true; wxASSERT_MSG( derived.m_bases.size() == 1 || derived.m_typeCasts.count( aBase ) == 1, - "You need to add a TYPE_CAST for classes inheriting from multiple bases" ); + wxT( "You need to add a TYPE_CAST for classes inheriting from multiple bases" ) ); } diff --git a/common/refdes_utils.cpp b/common/refdes_utils.cpp index 100099f0cb..c1a519586b 100644 --- a/common/refdes_utils.cpp +++ b/common/refdes_utils.cpp @@ -54,7 +54,7 @@ wxString GetRefDesUnannotated( const wxString& aSource ) int GetRefDesNumber( const wxString& aRefDes ) { int retval = -1; // negative to indicate not found - size_t firstnum = aRefDes.find_first_of( "0123456789" ); + size_t firstnum = aRefDes.find_first_of( wxT( "0123456789" ) ); if( firstnum != wxString::npos ) { diff --git a/common/reporter.cpp b/common/reporter.cpp index 11db29e7b5..77dbab7dea 100644 --- a/common/reporter.cpp +++ b/common/reporter.cpp @@ -245,7 +245,7 @@ void INFOBAR_REPORTER::Finalize() case RPT_SEVERITY_IGNORE: icon = wxICON_INFORMATION; break; } - if( m_message->EndsWith( "\n" ) ) + if( m_message->EndsWith( wxT( "\n" ) ) ) *m_message = m_message->Left( m_message->Length() - 1 ); if( HasMessage() ) diff --git a/common/scintilla_tricks.cpp b/common/scintilla_tricks.cpp index 9f8f54f78f..893c9d3b7c 100644 --- a/common/scintilla_tricks.cpp +++ b/common/scintilla_tricks.cpp @@ -268,7 +268,7 @@ void SCINTILLA_TRICKS::onCharHook( wxKeyEvent& aEvent ) for( int ii = startLine; ii <= endLine; ++ii ) { if( comment ) - m_te->InsertText( m_te->PositionFromLine( ii ), "#" ); + m_te->InsertText( m_te->PositionFromLine( ii ), wxT( "#" ) ); else if( firstNonWhitespace( ii, &whitespaceCount ) == '#' ) m_te->DeleteRange( m_te->PositionFromLine( ii ) + whitespaceCount, 1 ); } diff --git a/common/search_stack.cpp b/common/search_stack.cpp index 32a8a37f4f..7351ff664c 100644 --- a/common/search_stack.cpp +++ b/common/search_stack.cpp @@ -202,11 +202,11 @@ const wxString SEARCH_STACK::LastVisitedPath( const wxString& aSubPathToSearch ) #if defined(DEBUG) void SEARCH_STACK::Show( const wxString& aPrefix ) const { - wxLogTrace( tracePathsAndFiles, "%s SEARCH_STACK:", aPrefix ); + wxLogTrace( tracePathsAndFiles, wxT( "%s SEARCH_STACK:" ), aPrefix ); for( unsigned i=0; iGetName().BeforeLast( '_' ) ); // plain English (in case a localised version of the help file cannot be found) - localeNameDirs.Add( "en" ); + localeNameDirs.Add( wxT( "en" ) ); for( wxString& locale : localeNameDirs ) { @@ -72,37 +72,37 @@ wxString SearchHelpFileFullPath( const wxString& aBaseName ) wxFileName path( base, wxEmptyString ); // add /help// - path.AppendDir( "help" ); + path.AppendDir( wxT( "help" ) ); path.AppendDir( locale ); docPaths.AddPaths( path.GetPath() ); // add /doc/help// - path.InsertDir( path.GetDirCount() - 2, "doc" ); + path.InsertDir( path.GetDirCount() - 2, wxT( "doc" ) ); docPaths.AddPaths( path.GetPath() ); // add /doc/kicad/help// - path.InsertDir( path.GetDirCount() - 2, "kicad" ); + path.InsertDir( path.GetDirCount() - 2, wxT( "kicad" ) ); docPaths.AddPaths( path.GetPath() ); } #if defined( DEBUG ) - docPaths.Show( wxString( __func__ ) + ": docPaths (" + locale + ")" ); + docPaths.Show( wxString( __func__ ) + wxT( ": docPaths (" ) + locale + wxT( ")" ) ); #endif // search HTML first, as it is the preferred format for help files - wxLogTrace( tracePathsAndFiles, "Checking SEARCH_STACK for file %s.html", aBaseName ); - helpFile = docPaths.FindValidPath( aBaseName + ".html" ); + wxLogTrace( tracePathsAndFiles, wxT( "Checking SEARCH_STACK for file %s.html" ), aBaseName ); + helpFile = docPaths.FindValidPath( aBaseName + wxT( ".html" ) ); if( !helpFile.IsEmpty() ) { // prepend URI protocol to open the file in a browser - helpFile = "file://" + helpFile; + helpFile = wxT( "file://" ) + helpFile; break; } // search PDF only when no corresponding HTML file was found - wxLogTrace( tracePathsAndFiles, "Checking SEARCH_STACK for file %s.pdf", aBaseName ); - helpFile = docPaths.FindValidPath( aBaseName + ".pdf" ); + wxLogTrace( tracePathsAndFiles, wxT( "Checking SEARCH_STACK for file %s.pdf" ), aBaseName ); + helpFile = docPaths.FindValidPath( aBaseName + wxT( ".pdf" ) ); if( !helpFile.IsEmpty() ) break; diff --git a/common/single_top.cpp b/common/single_top.cpp index ceaf4140f5..84e88e5838 100644 --- a/common/single_top.cpp +++ b/common/single_top.cpp @@ -233,7 +233,7 @@ struct APP_SINGLE_TOP : public wxApp } catch( const std::exception& e ) { - wxLogError( "Unhandled exception class: %s what: %s", + wxLogError( wxT( "Unhandled exception class: %s what: %s" ), FROM_UTF8( typeid(e).name() ), FROM_UTF8( e.what() ) ); } @@ -243,7 +243,7 @@ struct APP_SINGLE_TOP : public wxApp } catch(...) { - wxLogError( "Unhandled exception of unknown type" ); + wxLogError( wxT( "Unhandled exception of unknown type" ) ); } return false; // continue on. Return false to abort program @@ -340,7 +340,7 @@ bool PGM_SINGLE_TOP::OnPgmInit() wxString frameName; - if( parser.Found( "frame", &frameName ) ) + if( parser.Found( wxT( "frame" ), &frameName ) ) { appType = FRAME_T_COUNT; diff --git a/common/string_utils.cpp b/common/string_utils.cpp index 17a7d45103..d661ea762d 100644 --- a/common/string_utils.cpp +++ b/common/string_utils.cpp @@ -47,7 +47,7 @@ wxString ConvertToNewOverbarNotation( const wxString& aOldStr ) bool inOverbar = false; // Don't get tripped up by the legacy empty-string token. - if( aOldStr == "~" ) + if( aOldStr == wxT( "~" ) ) return aOldStr; for( wxString::const_iterator chIt = aOldStr.begin(); chIt != aOldStr.end(); ++chIt ) @@ -62,12 +62,12 @@ wxString ConvertToNewOverbarNotation( const wxString& aOldStr ) { // This way the subsequent opening curly brace will not start an // overbar. - newStr << "~~{}"; + newStr << wxT( "~~{}" ); continue; } // Two subsequent tildes mean a tilde. - newStr << "~"; + newStr << wxT( "~" ); ++chIt; continue; } @@ -81,12 +81,12 @@ wxString ConvertToNewOverbarNotation( const wxString& aOldStr ) { if( inOverbar ) { - newStr << "}"; + newStr << wxT( "}" ); inOverbar = false; } else { - newStr << "~{"; + newStr << wxT( "~{" ); inOverbar = true; } @@ -96,7 +96,7 @@ wxString ConvertToNewOverbarNotation( const wxString& aOldStr ) else if( ( *chIt == ' ' || *chIt == '}' || *chIt == ')' ) && inOverbar ) { // Spaces were used to terminate overbar as well - newStr << "}"; + newStr << wxT( "}" ); inOverbar = false; } @@ -105,7 +105,7 @@ wxString ConvertToNewOverbarNotation( const wxString& aOldStr ) // Explicitly end the overbar even if there was no terminating '~' in the aOldStr. if( inOverbar ) - newStr << "}"; + newStr << wxT( "}" ); return newStr; } @@ -147,78 +147,78 @@ wxString EscapeString( const wxString& aSource, ESCAPE_CONTEXT aContext ) if( aContext == CTX_NETNAME ) { if( c == '/' ) - converted += "{slash}"; + converted += wxT( "{slash}" ); else if( c == '\n' || c == '\r' ) - converted += ""; // drop + converted += wxT( "" ); // drop else converted += c; } else if( aContext == CTX_LIBID ) { if( c == '{' ) - converted += "{brace}"; + converted += wxT( "{brace}" ); else if( c == '/' ) - converted += "{slash}"; + converted += wxT( "{slash}" ); else if( c == '\\' ) - converted += "{backslash}"; + converted += wxT( "{backslash}" ); else if( c == '<' ) - converted += "{lt}"; + converted += wxT( "{lt}" ); else if( c == '>' ) - converted += "{gt}"; + converted += wxT( "{gt}" ); else if( c == ':' ) - converted += "{colon}"; + converted += wxT( "{colon}" ); else if( c == '\"' ) - converted += "{dblquote}"; + converted += wxT( "{dblquote}" ); else if( c == '\n' || c == '\r' ) - converted += ""; // drop + converted += wxT( "" ); // drop else converted += c; } else if( aContext == CTX_QUOTED_STR ) { if( c == '\"' ) - converted += "{dblquote}"; + converted += wxT( "{dblquote}" ); else converted += c; } else if( aContext == CTX_LINE ) { if( c == '\n' || c == '\r' ) - converted += "{return}"; + converted += wxT( "{return}" ); else converted += c; } else if( aContext == CTX_FILENAME ) { if( c == '{' ) - converted += "{brace}"; + converted += wxT( "{brace}" ); else if( c == '/' ) - converted += "{slash}"; + converted += wxT( "{slash}" ); else if( c == '\\' ) - converted += "{backslash}"; + converted += wxT( "{backslash}" ); else if( c == '\"' ) - converted += "{dblquote}"; + converted += wxT( "{dblquote}" ); else if( c == '<' ) - converted += "{lt}"; + converted += wxT( "{lt}" ); else if( c == '>' ) - converted += "{gt}"; + converted += wxT( "{gt}" ); else if( c == '|' ) - converted += "{bar}"; + converted += wxT( "{bar}" ); else if( c == ':' ) - converted += "{colon}"; + converted += wxT( "{colon}" ); else if( c == '\t' ) - converted += "{tab}"; + converted += wxT( "{tab}" ); else if( c == '\n' || c == '\r' ) - converted += "{return}"; + converted += wxT( "{return}" ); else converted += c; } else if( aContext == CTX_NO_SPACE ) { if( c == ' ' ) - converted += "{space}"; + converted += wxT( "{space}" ); else if( c == '{' ) - converted += "{brace}"; + converted += wxT( "{brace}" ); else converted += c; } @@ -285,7 +285,7 @@ wxString UnescapeString( const wxString& aSource ) else if( token.IsEmpty() ) newbuf.append( wxS( "{" ) ); else { - newbuf.append( "{" + UnescapeString( token ) + "}" ); + newbuf.append( wxT( "{" ) + UnescapeString( token ) + wxT( "}" ) ); } } else @@ -416,8 +416,8 @@ std::string EscapedUTF8( const wxString& aString ) wxString str = aString; // No new-lines allowed in quoted strings - str.Replace( "\r\n", "\r" ); - str.Replace( "\n", "\r" ); + str.Replace( wxT( "\r\n" ), wxT( "\r" ) ); + str.Replace( wxT( "\n" ), wxT( "\r" ) ); std::string utf8 = TO_UTF8( aString ); @@ -457,15 +457,15 @@ wxString EscapeHTML( const wxString& aString ) for( wxUniChar c : aString ) { if( c == '\"' ) - converted += """; + converted += wxT( """ ); else if( c == '\'' ) - converted += "'"; + converted += wxT( "'" ); else if( c == '&' ) - converted += "&"; + converted += wxT( "&" ); else if( c == '<' ) - converted += "<"; + converted += wxT( "<" ); else if( c == '>' ) - converted += ">"; + converted += wxT( ">" ); else converted += c; } diff --git a/common/tool/action_manager.cpp b/common/tool/action_manager.cpp index dcc4237977..700875f2ed 100644 --- a/common/tool/action_manager.cpp +++ b/common/tool/action_manager.cpp @@ -78,7 +78,7 @@ void ACTION_MANAGER::SetConditions( const TOOL_ACTION& aAction, m_uiConditions[aAction.GetId()] = aConditions; wxLogTrace( kicadTraceToolStack, - "ACTION_MANAGER::SetConditions: Registering conditions for ID %d - %s", + wxT( "ACTION_MANAGER::SetConditions: Registering conditions for ID %d - %s" ), aAction.GetId(), aAction.GetName() ); // Register a new handler with the new conditions @@ -126,7 +126,7 @@ bool ACTION_MANAGER::RunHotKey( int aHotKey ) const if( key >= 'a' && key <= 'z' ) key = std::toupper( key ); - wxLogTrace( kicadTraceToolStack, "ACTION_MANAGER::RunHotKey Key: %s", + wxLogTrace( kicadTraceToolStack, wxT( "ACTION_MANAGER::RunHotKey Key: %s" ), KeyNameFromKeyCode( aHotKey ) ); HOTKEY_LIST::const_iterator it = m_actionHotKeys.find( key | mod ); @@ -138,7 +138,7 @@ bool ACTION_MANAGER::RunHotKey( int aHotKey ) const if( it == m_actionHotKeys.end() ) { wxLogTrace( kicadTraceToolStack, - "ACTION_MANAGER::RunHotKey No actions found, searching with key: %s", + wxT( "ACTION_MANAGER::RunHotKey No actions found, searching with key: %s" ), KeyNameFromKeyCode( key | ( mod & ~MD_SHIFT ) ) ); it = m_actionHotKeys.find( key | ( mod & ~MD_SHIFT ) ); @@ -192,8 +192,8 @@ bool ACTION_MANAGER::RunHotKey( int aHotKey ) const runAction = aCond->enableCondition( sel ); wxLogTrace( kicadTraceToolStack, - "ACTION_MANAGER::RunHotKey %s context action: %s for hotkey %s", - runAction ? "Running" : "Not running", + wxT( "ACTION_MANAGER::RunHotKey %s context action: %s for hotkey %s" ), + runAction ? wxT( "Running" ) : wxT( "Not running" ), context->GetName(), KeyNameFromKeyCode( aHotKey ) ); @@ -210,8 +210,8 @@ bool ACTION_MANAGER::RunHotKey( int aHotKey ) const runAction = aCond->enableCondition( sel ); wxLogTrace( kicadTraceToolStack, - "ACTION_MANAGER::RunHotKey %s global action: %s for hotkey %s", - runAction ? "Running" : "Not running", + wxT( "ACTION_MANAGER::RunHotKey %s global action: %s for hotkey %s" ), + runAction ? wxT( "Running" ) : wxT( "Not running" ), act->GetName(), KeyNameFromKeyCode( aHotKey ) ); @@ -221,7 +221,7 @@ bool ACTION_MANAGER::RunHotKey( int aHotKey ) const } wxLogTrace( kicadTraceToolStack, - "ACTION_MANAGER::RunHotKey No action found for key %s", + wxT( "ACTION_MANAGER::RunHotKey No action found for key %s" ), KeyNameFromKeyCode( aHotKey ) ); return false; diff --git a/common/tool/action_menu.cpp b/common/tool/action_menu.cpp index 0337d456a5..897709581b 100644 --- a/common/tool/action_menu.cpp +++ b/common/tool/action_menu.cpp @@ -134,7 +134,7 @@ void ACTION_MENU::DisplayTitle( bool aDisplay ) wxMenuItem* ACTION_MENU::Add( const wxString& aLabel, int aId, BITMAPS aIcon ) { - wxASSERT_MSG( FindItem( aId ) == nullptr, "Duplicate menu IDs!" ); + wxASSERT_MSG( FindItem( aId ) == nullptr, wxT( "Duplicate menu IDs!" ) ); wxMenuItem* item = new wxMenuItem( this, aId, aLabel, wxEmptyString, wxITEM_NORMAL ); @@ -148,7 +148,7 @@ wxMenuItem* ACTION_MENU::Add( const wxString& aLabel, int aId, BITMAPS aIcon ) wxMenuItem* ACTION_MENU::Add( const wxString& aLabel, const wxString& aTooltip, int aId, BITMAPS aIcon, bool aIsCheckmarkEntry ) { - wxASSERT_MSG( FindItem( aId ) == nullptr, "Duplicate menu IDs!" ); + wxASSERT_MSG( FindItem( aId ) == nullptr, wxT( "Duplicate menu IDs!" ) ); wxMenuItem* item = new wxMenuItem( this, aId, aLabel, aTooltip, aIsCheckmarkEntry ? wxITEM_CHECK : wxITEM_NORMAL ); @@ -186,7 +186,7 @@ wxMenuItem* ACTION_MENU::Add( ACTION_MENU* aMenu ) ACTION_MENU* menuCopy = aMenu->Clone(); m_submenus.push_back( menuCopy ); - wxASSERT_MSG( !menuCopy->m_title.IsEmpty(), "Set a title for ACTION_MENU using SetTitle()" ); + wxASSERT_MSG( !menuCopy->m_title.IsEmpty(), wxT( "Set a title for ACTION_MENU using SetTitle()" ) ); if( !!aMenu->m_icon ) { @@ -527,7 +527,7 @@ void ACTION_MENU::OnMenuEvent( wxMenuEvent& aEvent ) // clients that don't supply a tool will have to check GetSelected() themselves if( evt && m_tool ) { - wxLogTrace( kicadTraceToolStack, "ACTION_MENU::OnMenuEvent %s", evt->Format() ); + wxLogTrace( kicadTraceToolStack, wxT( "ACTION_MENU::OnMenuEvent %s" ), evt->Format() ); // WARNING: if you're squeamish, look away. // What follows is a series of egregious hacks necessitated by a lack of information from @@ -653,7 +653,7 @@ wxMenuItem* ACTION_MENU::appendCopy( const wxMenuItem* aSource ) if( aSource->IsSubMenu() ) { ACTION_MENU* menu = dynamic_cast( aSource->GetSubMenu() ); - wxASSERT_MSG( menu, "Submenus are expected to be a ACTION_MENU" ); + wxASSERT_MSG( menu, wxT( "Submenus are expected to be a ACTION_MENU" ) ); if( menu ) { diff --git a/common/tool/action_toolbar.cpp b/common/tool/action_toolbar.cpp index 26c89eb162..a13880a80c 100644 --- a/common/tool/action_toolbar.cpp +++ b/common/tool/action_toolbar.cpp @@ -57,7 +57,7 @@ wxBitmap MakeDisabledBitmap( const wxBitmap& aSource ) ACTION_GROUP::ACTION_GROUP( const std::string& aName, const std::vector& aActions ) { - wxASSERT_MSG( aActions.size() > 0, "Action groups must have at least one action" ); + wxASSERT_MSG( aActions.size() > 0, wxT( "Action groups must have at least one action" ) ); // The default action is just the first action in the vector m_actions = aActions; @@ -83,7 +83,7 @@ void ACTION_GROUP::SetDefaultAction( const TOOL_ACTION& aDefault ) return aAction->GetId() == aDefault.GetId(); } ); - wxASSERT_MSG( valid, "Action must be present in a group to be the default" ); + wxASSERT_MSG( valid, wxT( "Action must be present in a group to be the default" ) ); m_defaultAction = &aDefault; } @@ -230,7 +230,7 @@ ACTION_TOOLBAR::~ACTION_TOOLBAR() void ACTION_TOOLBAR::Add( const TOOL_ACTION& aAction, bool aIsToggleEntry, bool aIsCancellable ) { wxASSERT( GetParent() ); - wxASSERT_MSG( !( aIsCancellable && !aIsToggleEntry ), "aIsCancellable requires aIsToggleEntry" ); + wxASSERT_MSG( !( aIsCancellable && !aIsToggleEntry ), wxT( "aIsCancellable requires aIsToggleEntry" ) ); int toolId = aAction.GetUIId(); wxBitmap bmp = KiScaledBitmap( aAction.GetIcon(), GetParent() ); diff --git a/common/tool/common_control.cpp b/common/tool/common_control.cpp index df02776c2b..c50f86cc55 100644 --- a/common/tool/common_control.cpp +++ b/common/tool/common_control.cpp @@ -43,36 +43,36 @@ #include #include -#define URL_GET_INVOLVED "https://kicad.org/contribute/" -#define URL_DONATE "https://go.kicad.org/app-donate" -#define URL_DOCUMENTATION "https://docs.kicad.org/" +#define URL_GET_INVOLVED wxT( "https://kicad.org/contribute/" ) +#define URL_DONATE wxT( "https://go.kicad.org/app-donate" ) +#define URL_DOCUMENTATION wxT( "https://docs.kicad.org/" ) /// URL to launch a new issue with pre-populated description wxString COMMON_CONTROL::m_bugReportUrl = - "https://gitlab.com/kicad/code/kicad/issues/new?issue[description]=%s"; + wxT( "https://gitlab.com/kicad/code/kicad/issues/new?issue[description]=%s" ); /// Issue template to use for reporting bugs (this should not be translated) wxString COMMON_CONTROL::m_bugReportTemplate = - "\n" - "\n" - "# Description\n" - "\n" - "\n" - "\n" - "# Steps to reproduce\n" - "\n" - "\n" - "1.\n" - "2.\n" - "# KiCad Version\n" - "\n" - "```\n" - "%s\n" - "```"; + wxT( "\n" ) + wxT( "\n" ) + wxT( "# Description\n" ) + wxT( "\n" ) + wxT( "\n" ) + wxT( "\n" ) + wxT( "# Steps to reproduce\n" ) + wxT( "\n" ) + wxT( "\n" ) + wxT( "1.\n" ) + wxT( "2.\n" ) + wxT( "# KiCad Version\n" ) + wxT( "\n" ) + wxT( "```\n" ) + wxT( "%s\n" ) + wxT( "```" ); void COMMON_CONTROL::Reset( RESET_REASON aReason ) @@ -164,7 +164,7 @@ int COMMON_CONTROL::ShowPlayer( const TOOL_EVENT& aEvent ) KIWAY_PLAYER* editor = m_frame->Kiway().Player( playerType, true ); // editor can be null if Player() fails: - wxCHECK_MSG( editor != nullptr, 0, "Cannot open/create the editor frame" ); + wxCHECK_MSG( editor != nullptr, 0, wxT( "Cannot open/create the editor frame" ) ); // Needed on Windows, other platforms do not use it, but it creates no issue if( editor->IsIconized() ) @@ -186,9 +186,9 @@ int COMMON_CONTROL::ShowHelp( const TOOL_EVENT& aEvent ) wxString helpFile; wxString msg; - // the URL of help files is "https://docs.kicad.org////" - const wxString baseUrl = URL_DOCUMENTATION + GetMajorMinorVersion() + "/" - + Pgm().GetLocale()->GetName().BeforeLast( '_' ) + "/"; + // the URL of help files is wxT( "https://docs.kicad.org////" ) + const wxString baseUrl = URL_DOCUMENTATION + GetMajorMinorVersion() + wxT( "/" ) + + Pgm().GetLocale()->GetName().BeforeLast( '_' ) + wxT( "/" ); /* We have to get document for beginners, * or the full specific doc @@ -225,7 +225,7 @@ int COMMON_CONTROL::ShowHelp( const TOOL_EVENT& aEvent ) if( dlg.ShowModal() != wxID_YES ) return -1; - helpFile = baseUrl + names[0] + "/"; + helpFile = baseUrl + names[0] + wxT( "/" ); } } else @@ -245,7 +245,7 @@ int COMMON_CONTROL::ShowHelp( const TOOL_EVENT& aEvent ) if( dlg.ShowModal() != wxID_YES ) return -1; - helpFile = baseUrl + base_name + "/"; + helpFile = baseUrl + base_name + wxT( "/" ); } } diff --git a/common/tool/common_tools.cpp b/common/tool/common_tools.cpp index 3802c2e305..edf0e3fa8b 100644 --- a/common/tool/common_tools.cpp +++ b/common/tool/common_tools.cpp @@ -78,7 +78,7 @@ void COMMON_TOOLS::SetLastUnits( EDA_UNITS aUnit ) else if( EDA_UNIT_UTILS::IsMetricUnit( aUnit ) ) m_metricUnit = aUnit; else - wxASSERT_MSG( false, "Invalid unit" ); + wxASSERT_MSG( false, wxT( "Invalid unit" ) ); } @@ -150,7 +150,7 @@ int COMMON_TOOLS::CursorControl( const TOOL_EVENT& aEvent ) return 0; } default: - wxFAIL_MSG( "CursorControl(): unexpected request" ); + wxFAIL_MSG( wxT( "CursorControl(): unexpected request" ) ); } getViewControls()->SetCursorPosition( cursor, true, true, type ); @@ -515,7 +515,7 @@ int COMMON_TOOLS::SwitchUnits( const TOOL_EVENT& aEvent ) else if( EDA_UNIT_UTILS::IsImperialUnit( newUnit ) ) m_imperialUnit = newUnit; else - wxASSERT_MSG( false, "Invalid unit for the frame" ); + wxASSERT_MSG( false, wxT( "Invalid unit for the frame" ) ); m_frame->ChangeUserUnits( newUnit ); return 0; diff --git a/common/tool/tool_action.cpp b/common/tool/tool_action.cpp index 3e56ae4aea..d2b519858f 100644 --- a/common/tool/tool_action.cpp +++ b/common/tool/tool_action.cpp @@ -89,7 +89,7 @@ wxString TOOL_ACTION::GetLabel() const wxString TOOL_ACTION::GetMenuItem() const { wxString label = wxGetTranslation( m_label ); - label.Replace( "&", "&&" ); + label.Replace( wxT( "&" ), wxT( "&&" ) ); return AddHotkeyName( label, m_hotKey, IS_HOTKEY ); } diff --git a/common/tool/tool_dispatcher.cpp b/common/tool/tool_dispatcher.cpp index da052004ca..cae33cc217 100644 --- a/common/tool/tool_dispatcher.cpp +++ b/common/tool/tool_dispatcher.cpp @@ -360,7 +360,7 @@ OPT TOOL_DISPATCHER::GetToolEvent( wxKeyEvent* aKeyEvent, bool* keyI return evt; } - wxLogTrace( kicadTraceKeyEvent, "TOOL_DISPATCHER::GetToolEvent %s", dump( *aKeyEvent ) ); + wxLogTrace( kicadTraceKeyEvent, wxT( "TOOL_DISPATCHER::GetToolEvent %s" ), dump( *aKeyEvent ) ); // if the key event must be skipped, skip it here if the event is a wxEVT_CHAR_HOOK // and do nothing. @@ -512,7 +512,7 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent ) { wxKeyEvent* ke = static_cast( &aEvent ); - wxLogTrace( kicadTraceKeyEvent, "TOOL_DISPATCHER::DispatchWxEvent %s", dump( *ke ) ); + wxLogTrace( kicadTraceKeyEvent, wxT( "TOOL_DISPATCHER::DispatchWxEvent %s" ), dump( *ke ) ); // Do not process wxEVT_CHAR_HOOK for a shift-modified key, as ACTION_MANAGER::RunHotKey // will run the un-shifted key and that's not what we want. Wait to get the translated @@ -593,12 +593,12 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent ) if( evt ) { - wxLogTrace( kicadTraceToolStack, "TOOL_DISPATCHER::DispatchWxEvent %s", evt->Format() ); + wxLogTrace( kicadTraceToolStack, wxT( "TOOL_DISPATCHER::DispatchWxEvent %s" ), evt->Format() ); handled = m_toolMgr->ProcessEvent( *evt ); - wxLogTrace( kicadTraceToolStack, "TOOL_DISPATCHER::DispatchWxEvent - Handled: %s %s", - ( handled ? "true" : "false" ), evt->Format() ); + wxLogTrace( kicadTraceToolStack, wxT( "TOOL_DISPATCHER::DispatchWxEvent - Handled: %s %s" ), + ( handled ? wxT( "true" ) : wxT( "false" ) ), evt->Format() ); } // pass the event to the GUI, it might still be interested in it @@ -629,6 +629,6 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent ) && !keyIsEscape ) aEvent.Skip(); - wxLogTrace( kicadTraceToolStack, "TOOL_DISPATCHER::DispatchWxEvent - Wx event skipped: %s", - ( aEvent.GetSkipped() ? "true" : "false" ) ); + wxLogTrace( kicadTraceToolStack, wxT( "TOOL_DISPATCHER::DispatchWxEvent - Wx event skipped: %s" ), + ( aEvent.GetSkipped() ? wxT( "true" ) : wxT( "false" ) ) ); } diff --git a/common/tool/tool_event.cpp b/common/tool/tool_event.cpp index 55059a08e0..07762f1bd2 100644 --- a/common/tool/tool_event.cpp +++ b/common/tool/tool_event.cpp @@ -76,7 +76,7 @@ void TOOL_EVENT::init() VECTOR2D TOOL_EVENT::returnCheckedPosition( const VECTOR2D& aPos ) const { #ifdef WX_COMPATIBILITY - wxCHECK_MSG( HasPosition(), VECTOR2D(), "Attempted to get position from non-position event" ); + wxCHECK_MSG( HasPosition(), VECTOR2D(), wxT( "Attempted to get position from non-position event" ) ); #else assert( HasPosition() ); #endif diff --git a/common/tool/tool_manager.cpp b/common/tool/tool_manager.cpp index c169f142a2..680d71de07 100644 --- a/common/tool/tool_manager.cpp +++ b/common/tool/tool_manager.cpp @@ -256,7 +256,7 @@ bool TOOL_MANAGER::InvokeTool( TOOL_ID aToolId ) if( tool && tool->GetType() == INTERACTIVE ) return invokeTool( tool ); - wxLogTrace( kicadTraceToolStack, "TOOL_MANAGER::InvokeTool - no tool with ID %d", + wxLogTrace( kicadTraceToolStack, wxT( "TOOL_MANAGER::InvokeTool - no tool with ID %d" ), aToolId ); return false; // there is no tool with the given id @@ -270,7 +270,7 @@ bool TOOL_MANAGER::InvokeTool( const std::string& aToolName ) if( tool && tool->GetType() == INTERACTIVE ) return invokeTool( tool ); - wxLogTrace( kicadTraceToolStack, "TOOL_MANAGER::InvokeTool - no tool with name %s", + wxLogTrace( kicadTraceToolStack, wxT( "TOOL_MANAGER::InvokeTool - no tool with name %s" ), aToolName ); return false; // there is no tool with the given name @@ -411,7 +411,7 @@ bool TOOL_MANAGER::runTool( TOOL_BASE* aTool ) TOOL_ID id = aTool->GetId(); - wxLogTrace( kicadTraceToolStack, "TOOL_MANAGER::runTool - running tool %s", + wxLogTrace( kicadTraceToolStack, wxT( "TOOL_MANAGER::runTool - running tool %s" ), aTool->GetName() ); if( aTool->GetType() == INTERACTIVE ) @@ -464,7 +464,7 @@ void TOOL_MANAGER::ShutdownTool( TOOL_ID aToolId ) if( tool && tool->GetType() == INTERACTIVE ) ShutdownTool( tool ); - wxLogTrace( kicadTraceToolStack, "TOOL_MANAGER::ShutdownTool - no tool with ID %d", + wxLogTrace( kicadTraceToolStack, wxT( "TOOL_MANAGER::ShutdownTool - no tool with ID %d" ), aToolId ); } @@ -476,7 +476,7 @@ void TOOL_MANAGER::ShutdownTool( const std::string& aToolName ) if( tool && tool->GetType() == INTERACTIVE ) ShutdownTool( tool ); - wxLogTrace( kicadTraceToolStack, "TOOL_MANAGER::ShutdownTool - no tool with name %s", + wxLogTrace( kicadTraceToolStack, wxT( "TOOL_MANAGER::ShutdownTool - no tool with name %s" ), aToolName ); } @@ -505,7 +505,7 @@ void TOOL_MANAGER::ShutdownTool( TOOL_BASE* aTool ) if( st->cofunc ) { wxLogTrace( kicadTraceToolStack, - "TOOL_MANAGER::ShutdownTool - Shutting down tool %s", + wxT( "TOOL_MANAGER::ShutdownTool - Shutting down tool %s" ), st->theTool->GetName() ); setActiveState( st ); @@ -577,7 +577,7 @@ void TOOL_MANAGER::InitTools() if( !tool->Init() ) { - wxLogTrace( kicadTraceToolStack, "TOOL_MANAGER initialization of tool '%s' failed", + wxLogTrace( kicadTraceToolStack, wxT( "TOOL_MANAGER initialization of tool '%s' failed" ), tool->GetName() ); // Unregister the tool @@ -663,7 +663,7 @@ bool TOOL_MANAGER::dispatchInternal( TOOL_EVENT& aEvent ) { bool handled = false; - wxLogTrace( kicadTraceToolStack, "TOOL_MANAGER::dispatchInternal - received event: %s", + wxLogTrace( kicadTraceToolStack, wxT( "TOOL_MANAGER::dispatchInternal - received event: %s" ), aEvent.Format() ); auto it = m_activeTools.begin(); @@ -699,7 +699,7 @@ bool TOOL_MANAGER::dispatchInternal( TOOL_EVENT& aEvent ) st->waitEvents.clear(); wxLogTrace( kicadTraceToolStack, - "TOOL_MANAGER::dispatchInternal - Waking tool %s for event: %s", + wxT( "TOOL_MANAGER::dispatchInternal - Waking tool %s for event: %s" ), st->theTool->GetName(), aEvent.Format() ); setActiveState( st ); @@ -715,7 +715,7 @@ bool TOOL_MANAGER::dispatchInternal( TOOL_EVENT& aEvent ) if( !st->wakeupEvent.PassEvent() ) { wxLogTrace( kicadTraceToolStack, - "TOOL_MANAGER::dispatchInternal - tool %s stopped passing event: %s", + wxT( "TOOL_MANAGER::dispatchInternal - tool %s stopped passing event: %s" ), st->theTool->GetName(), aEvent.Format() ); return true; @@ -759,7 +759,7 @@ bool TOOL_MANAGER::dispatchInternal( TOOL_EVENT& aEvent ) st->transitions.clear(); wxLogTrace( kicadTraceToolStack, - "TOOL_MANAGER::dispatchInternal - Running tool %s for event: %s", + wxT( "TOOL_MANAGER::dispatchInternal - Running tool %s for event: %s" ), st->theTool->GetName(), aEvent.Format() ); // got match? Run the handler. @@ -784,8 +784,8 @@ bool TOOL_MANAGER::dispatchInternal( TOOL_EVENT& aEvent ) break; // only the first tool gets the event } - wxLogTrace( kicadTraceToolStack, "TOOL_MANAGER::dispatchInternal - %s handle event: %s", - ( handled ? "Did" : "Did not" ), aEvent.Format() ); + wxLogTrace( kicadTraceToolStack, wxT( "TOOL_MANAGER::dispatchInternal - %s handle event: %s" ), + ( handled ? wxT( "Did" ) : wxT( "Did not" ) ), aEvent.Format() ); return handled; } @@ -802,7 +802,7 @@ bool TOOL_MANAGER::DispatchHotKey( const TOOL_EVENT& aEvent ) bool TOOL_MANAGER::dispatchActivation( const TOOL_EVENT& aEvent ) { - wxLogTrace( kicadTraceToolStack, "TOOL_MANAGER::dispatchActivation - Received event: %s", + wxLogTrace( kicadTraceToolStack, wxT( "TOOL_MANAGER::dispatchActivation - Received event: %s" ), aEvent.Format() ); if( aEvent.IsActivate() ) @@ -814,7 +814,7 @@ bool TOOL_MANAGER::dispatchActivation( const TOOL_EVENT& aEvent ) if( tool != m_toolNameIndex.end() ) { wxLogTrace( kicadTraceToolStack, - "TOOL_MANAGER::dispatchActivation - Running tool %s for event: %s", + wxT( "TOOL_MANAGER::dispatchActivation - Running tool %s for event: %s" ), tool->second->theTool->GetName(), aEvent.Format() ); runTool( tool->second->theTool ); @@ -1115,7 +1115,7 @@ void TOOL_MANAGER::applyViewControls( const TOOL_STATE* aState ) bool TOOL_MANAGER::processEvent( const TOOL_EVENT& aEvent ) { - wxLogTrace( kicadTraceToolStack, "TOOL_MANAGER::processEvent - %s", aEvent.Format() ); + wxLogTrace( kicadTraceToolStack, wxT( "TOOL_MANAGER::processEvent - %s" ), aEvent.Format() ); // First try to dispatch the action associated with the event if it is a key press event bool handled = DispatchHotKey( aEvent ); @@ -1153,8 +1153,8 @@ bool TOOL_MANAGER::processEvent( const TOOL_EVENT& aEvent ) } } - wxLogTrace( kicadTraceToolStack, "TOOL_MANAGER::processEvent - %s handle event: %s", - ( handled ? "Did" : "Did not" ), aEvent.Format() ); + wxLogTrace( kicadTraceToolStack, wxT( "TOOL_MANAGER::processEvent - %s handle event: %s" ), + ( handled ? wxT( "Did" ) : wxT( "Did not" ) ), aEvent.Format() ); return handled; } diff --git a/common/trace_helpers.cpp b/common/trace_helpers.cpp index bc57acad56..c83e87afba 100644 --- a/common/trace_helpers.cpp +++ b/common/trace_helpers.cpp @@ -224,37 +224,37 @@ wxString GetKeyName( const wxKeyEvent &aEvent ) return wxString::Format( "'%c'", uc ); #endif - return "unknown"; + return wxT( "unknown" ); } wxString dump( const wxKeyEvent& aEvent ) { wxString msg; - wxString eventType = "unknown"; + wxString eventType = wxT( "unknown" ); if( aEvent.GetEventType() == wxEVT_KEY_DOWN ) - eventType = "KeyDown"; + eventType = wxT( "KeyDown" ); else if( aEvent.GetEventType() == wxEVT_KEY_UP ) - eventType = "KeyUp"; + eventType = wxT( "KeyUp" ); else if( aEvent.GetEventType() == wxEVT_CHAR ) - eventType = "Char"; + eventType = wxT( "Char" ); else if( aEvent.GetEventType() == wxEVT_CHAR_HOOK ) - eventType = "Hook"; + eventType = wxT( "Hook" ); // event key_name KeyCode modifiers Unicode raw_code raw_flags pos - msg.Printf( "%7s %15s %5d %c%c%c%c" + msg.Printf( wxT( "%7s %15s %5d %c%c%c%c" ) #if wxUSE_UNICODE - "%5d (U+%04x)" + wxT( "%5d (U+%04x)" ) #else - " none " + wxT( " none " ) #endif #ifdef wxHAS_RAW_KEY_CODES - " %7lu 0x%08lx" + wxT( " %7lu 0x%08lx" ) #else - " not-set not-set" + wxT( " not-set not-set" ) #endif - " (%5d,%5d)", + wxT( " (%5d,%5d)" ), eventType, GetKeyName( aEvent ), aEvent.GetKeyCode(), diff --git a/common/utf8.cpp b/common/utf8.cpp index a0abe222ec..38a1ec29dc 100644 --- a/common/utf8.cpp +++ b/common/utf8.cpp @@ -108,7 +108,7 @@ int UTF8::uni_forward( const unsigned char* aSequence, unsigned* aResult ) default: case 0: if( aResult ) - wxFAIL_MSG( "uni_forward: invalid start byte" ); + wxFAIL_MSG( wxT( "uni_forward: invalid start byte" ) ); return 0; break; @@ -117,7 +117,7 @@ int UTF8::uni_forward( const unsigned char* aSequence, unsigned* aResult ) if( ( s[1] & 0xc0 ) != 0x80 ) { if( aResult ) - wxFAIL_MSG( "uni_forward: invalid continuation byte" ); + wxFAIL_MSG( wxT( "uni_forward: invalid continuation byte" ) ); return 0; } @@ -136,7 +136,7 @@ int UTF8::uni_forward( const unsigned char* aSequence, unsigned* aResult ) ) { if( aResult ) - wxFAIL_MSG( "uni_forward: invalid continuation byte" ); + wxFAIL_MSG( wxT( "uni_forward: invalid continuation byte" ) ); return 0; } @@ -156,7 +156,7 @@ int UTF8::uni_forward( const unsigned char* aSequence, unsigned* aResult ) (s[0] == 0xF4 && s[1] > 0x8F) ) { if( aResult ) - wxFAIL_MSG( "uni_forward: invalid continuation byte" ); + wxFAIL_MSG( wxT( "uni_forward: invalid continuation byte" ) ); return 0; } diff --git a/common/validators.cpp b/common/validators.cpp index 5f6d229bb7..ca50c367f0 100644 --- a/common/validators.cpp +++ b/common/validators.cpp @@ -377,7 +377,7 @@ void KIUI::ValidatorTransferToWindowWithoutEvents( wxValidator& aValidator ) { wxWindow* ctrl = aValidator.GetWindow(); - wxCHECK_RET( ctrl != nullptr, "Transferring validator data without a control" ); + wxCHECK_RET( ctrl != nullptr, wxT( "Transferring validator data without a control" ) ); wxEventBlocker orient_update_blocker( ctrl, wxEVT_ANY ); aValidator.TransferToWindow(); diff --git a/common/view/view.cpp b/common/view/view.cpp index aaca558208..df8201f553 100644 --- a/common/view/view.cpp +++ b/common/view/view.cpp @@ -1159,7 +1159,7 @@ void VIEW::Redraw() #ifdef KICAD_GAL_PROFILE totalRealTime.Stop(); - wxLogTrace( traceGalProfile, "VIEW::Redraw(): %.1f ms", totalRealTime.msecs() ); + wxLogTrace( traceGalProfile, wxT( "VIEW::Redraw(): %.1f ms" ), totalRealTime.msecs() ); #endif /* KICAD_GAL_PROFILE */ } @@ -1474,7 +1474,7 @@ void VIEW::UpdateItems() } } - KI_TRACE( traceGalProfile, "View update: total items %u, geom %u updates %u\n", cntTotal, + KI_TRACE( traceGalProfile, wxT( "View update: total items %u, geom %u updates %u\n" ), cntTotal, cntGeomUpdate, cntAnyUpdate ); } diff --git a/common/widgets/color_swatch.cpp b/common/widgets/color_swatch.cpp index 11e230b594..0382958f80 100644 --- a/common/widgets/color_swatch.cpp +++ b/common/widgets/color_swatch.cpp @@ -120,7 +120,7 @@ COLOR_SWATCH::COLOR_SWATCH( wxWindow* aParent, const COLOR4D& aColor, int aID, m_readOnly( false ), m_supportsOpacity( true ) { - wxASSERT_MSG( aSwatchSize != SWATCH_EXPAND, "SWATCH_EXPAND not supported in COLOR_SWATCH" ); + wxASSERT_MSG( aSwatchSize != SWATCH_EXPAND, wxT( "SWATCH_EXPAND not supported in COLOR_SWATCH" ) ); switch( aSwatchSize ) { diff --git a/common/widgets/footprint_choice.cpp b/common/widgets/footprint_choice.cpp index e803d09b21..001dd9d6a1 100644 --- a/common/widgets/footprint_choice.cpp +++ b/common/widgets/footprint_choice.cpp @@ -81,7 +81,7 @@ void FOOTPRINT_CHOICE::OnDrawItem( wxDC& aDC, wxRect const& aRect, int aItem, in y = aRect.y; } - // If this item has a footprint and that footprint has a ":" delimiter, find the + // If this item has a footprint and that footprint has a wxT( ":" ) delimiter, find the // library component, then find that in the display string and grey it out. size_t start_grey = 0; @@ -123,7 +123,7 @@ void FOOTPRINT_CHOICE::OnDrawItem( wxDC& aDC, wxRect const& aRect, int aItem, in wxCoord FOOTPRINT_CHOICE::OnMeasureItem( size_t aItem ) const { - if( SafeGetString( aItem ) == "" ) + if( SafeGetString( aItem ) == wxT( "" ) ) return 11; else return wxOwnerDrawnComboBox::OnMeasureItem( aItem ); @@ -132,7 +132,7 @@ wxCoord FOOTPRINT_CHOICE::OnMeasureItem( size_t aItem ) const wxCoord FOOTPRINT_CHOICE::OnMeasureItemWidth( size_t aItem ) const { - if( SafeGetString( aItem ) == "" ) + if( SafeGetString( aItem ) == wxT( "" ) ) return GetTextRect().GetWidth() - 2; else return wxOwnerDrawnComboBox::OnMeasureItemWidth( aItem ); @@ -150,7 +150,7 @@ void FOOTPRINT_CHOICE::TryVetoMouse( wxMouseEvent& aEvent ) { int item = GetVListBoxComboPopup()->VirtualHitTest( aEvent.GetPosition().y ); - if( SafeGetString( item ) != "" ) + if( SafeGetString( item ) != wxT( "" ) ) aEvent.Skip(); } @@ -163,7 +163,7 @@ void FOOTPRINT_CHOICE::TryVetoSelect( wxCommandEvent& aEvent, bool aInner ) { wxString text = SafeGetString( sel ); - if( text == "" ) + if( text == wxT( "" ) ) { SetSelectionEither( aInner, m_last_selection ); } diff --git a/common/widgets/footprint_select_widget.cpp b/common/widgets/footprint_select_widget.cpp index a6052312e9..182b684930 100644 --- a/common/widgets/footprint_select_widget.cpp +++ b/common/widgets/footprint_select_widget.cpp @@ -139,14 +139,14 @@ bool FOOTPRINT_SELECT_WIDGET::UpdateList() m_fp_sel_ctrl->Append( m_default_footprint.IsEmpty() ? _( "No default footprint" ) : - "[" + _( "Default" ) + "] " + m_default_footprint, + wxT( "[" ) + _( "Default" ) + "] " + m_default_footprint, new wxStringClientData( m_default_footprint ) ); if( !m_zero_filter ) { for( FOOTPRINT_INFO& fpinfo : m_fp_filter ) { - wxString display_name( fpinfo.GetLibNickname() + ":" + fpinfo.GetFootprintName() ); + wxString display_name( fpinfo.GetLibNickname() + wxT( ":" ) + fpinfo.GetFootprintName() ); m_fp_sel_ctrl->Append( display_name, new wxStringClientData( display_name ) ); ++n_items; diff --git a/common/widgets/grid_bitmap_toggle.cpp b/common/widgets/grid_bitmap_toggle.cpp index 143b4ad271..e3640793d7 100644 --- a/common/widgets/grid_bitmap_toggle.cpp +++ b/common/widgets/grid_bitmap_toggle.cpp @@ -47,7 +47,7 @@ void GRID_BITMAP_TOGGLE_RENDERER::Draw( wxGrid& aGrid, wxGridCellAttr& aAttr, wx // erase background wxGridCellRenderer::Draw( aGrid, aAttr, aDc, aRect, aRow, aCol, aIsSelected ); - bool checked = aGrid.GetCellValue( aRow, aCol ) == "1"; + bool checked = aGrid.GetCellValue( aRow, aCol ) == wxT( "1" ); const wxBitmap& bitmap = checked ? m_bitmapChecked : m_bitmapUnchecked; int x = std::max( 0, ( aRect.GetWidth() - m_bitmapChecked.GetWidth() ) / 2 ); diff --git a/common/widgets/number_badge.cpp b/common/widgets/number_badge.cpp index d168e532cb..a977d3bf7c 100644 --- a/common/widgets/number_badge.cpp +++ b/common/widgets/number_badge.cpp @@ -138,9 +138,9 @@ void NUMBER_BADGE::computeSize() // Determine the size using the string "-999+" where the - on the front is for spacing from // the start of the rectangle so the number isn't close to the curved edge. - test = "-"; + test = wxT( "-" ); test.Pad( len, '9' ); - test += "+"; + test += wxT( "+" ); dc.SetFont( wxFont( m_textSize, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, BADGE_FONTWEIGHT ) ); wxSize size = dc.GetTextExtent( test ); diff --git a/common/widgets/split_button.cpp b/common/widgets/split_button.cpp index d00019d9b5..4c88516289 100644 --- a/common/widgets/split_button.cpp +++ b/common/widgets/split_button.cpp @@ -33,7 +33,7 @@ SPLIT_BUTTON::SPLIT_BUTTON( wxWindow* aParent, wxWindowID aId, const wxString& aLabel, const wxPoint& aPos, const wxSize& aSize ) : - wxPanel( aParent, aId, aPos, aSize, wxBORDER_NONE | wxTAB_TRAVERSAL, "DropDownButton" ), + wxPanel( aParent, aId, aPos, aSize, wxBORDER_NONE | wxTAB_TRAVERSAL, wxT( "DropDownButton" ) ), m_label( aLabel ) { m_colorNormal = GetForegroundColour(); diff --git a/common/widgets/ui_common.cpp b/common/widgets/ui_common.cpp index 851206fe10..5405db7902 100644 --- a/common/widgets/ui_common.cpp +++ b/common/widgets/ui_common.cpp @@ -91,7 +91,7 @@ wxFont KIUI::GetMonospacedUIFont() #ifdef __WXMAC__ // https://trac.wxwidgets.org/ticket/19210 if( font.GetFaceName().IsEmpty() ) - font.SetFaceName( "Menlo" ); + font.SetFaceName( wxT( "Menlo" ) ); #endif return font; @@ -119,7 +119,7 @@ wxFont getGUIFont( wxWindow* aWindow, int aRelativeSize ) #ifdef __WXMAC__ // https://trac.wxwidgets.org/ticket/19210 if( font.GetFaceName().IsEmpty() ) - font.SetFaceName( "San Francisco" ); + font.SetFaceName( wxT( "San Francisco" ) ); // OSX 10.1 .. 10.9: Lucida Grande // OSX 10.10: Helvetica Neue // OSX 10.11 .. : San Francisco diff --git a/common/widgets/widget_hotkey_list.cpp b/common/widgets/widget_hotkey_list.cpp index 030f72e862..a8caec5887 100644 --- a/common/widgets/widget_hotkey_list.cpp +++ b/common/widgets/widget_hotkey_list.cpp @@ -274,7 +274,7 @@ WIDGET_HOTKEY_CLIENT_DATA* WIDGET_HOTKEY_LIST::getExpectedHkClientData( wxTreeLi // This probably means a hotkey-only action is being attempted on // a row that is not a hotkey (like a section heading) - wxASSERT_MSG( hkdata != nullptr, "No hotkey data found for list item" ); + wxASSERT_MSG( hkdata != nullptr, wxT( "No hotkey data found for list item" ) ); return hkdata; } @@ -298,7 +298,7 @@ void WIDGET_HOTKEY_LIST::updateFromClientData() // mark unsaved changes if( changed_hk.m_EditKeycode != changed_hk.m_Actions[ 0 ]->GetHotKey() ) - label += " *"; + label += wxT( " *" ); SetItemText( i, 0, label ); SetItemText( i, 1, key_text); @@ -461,7 +461,7 @@ WIDGET_HOTKEY_LIST::WIDGET_HOTKEY_LIST( wxWindow* aParent, HOTKEY_STORE& aHotkey wxString command_header = _( "Command" ); if( !m_readOnly ) - command_header << " " << _( "(double-click to edit)" ); + command_header << wxT( " " ) << _( "(double-click to edit)" ); AppendColumn( command_header, 450, wxALIGN_LEFT, wxCOL_RESIZABLE | wxCOL_SORTABLE ); AppendColumn( _( "Hotkey" ), 120, wxALIGN_LEFT, wxCOL_RESIZABLE | wxCOL_SORTABLE ); @@ -488,8 +488,8 @@ WIDGET_HOTKEY_LIST::WIDGET_HOTKEY_LIST( wxWindow* aParent, HOTKEY_STORE& aHotkey std::vector reserved_keys = { - "Ctrl+Tab", - "Ctrl+Shift+Tab" + wxT( "Ctrl+Tab" ), + wxT( "Ctrl+Shift+Tab" ) }; for( auto& key : reserved_keys ) @@ -500,7 +500,7 @@ WIDGET_HOTKEY_LIST::WIDGET_HOTKEY_LIST( wxWindow* aParent, HOTKEY_STORE& aHotkey m_reservedHotkeys[code] = key; else { - wxLogWarning( "Unknown reserved keycode %s\n", key ); + wxLogWarning( wxT( "Unknown reserved keycode %s\n" ), key ); } } diff --git a/common/widgets/wx_ellipsized_static_text.cpp b/common/widgets/wx_ellipsized_static_text.cpp index 27026a1b19..bff8b59f4f 100644 --- a/common/widgets/wx_ellipsized_static_text.cpp +++ b/common/widgets/wx_ellipsized_static_text.cpp @@ -28,7 +28,7 @@ WX_ELLIPSIZED_STATIC_TEXT::WX_ELLIPSIZED_STATIC_TEXT( wxWindow* aParent, wxWindo const wxString& aLabel, const wxPoint& aPos, const wxSize& aSize, long aStyle ) : wxStaticText( aParent, aID, aLabel, aPos, aSize, aStyle ), - m_minimumString( "M...M" ) + m_minimumString( wxT( "M...M" ) ) { } diff --git a/common/widgets/wx_grid.cpp b/common/widgets/wx_grid.cpp index bdcdc59302..a4ea084aec 100644 --- a/common/widgets/wx_grid.cpp +++ b/common/widgets/wx_grid.cpp @@ -271,7 +271,7 @@ int WX_GRID::GetVisibleWidth( int aCol, bool aHeader, bool aContents, bool aKeep // the normal font. // TODO: use a better way to evaluate the text size, for bold font for( int row = 0; aContents && row < GetNumberRows(); row++ ) - size = std::max( size, int( GetTextExtent( GetRowLabelValue( row ) + "M" ).x * 1.1 ) ); + size = std::max( size, int( GetTextExtent( GetRowLabelValue( row ) + wxT( "M" ) ).x * 1.1 ) ); } else { @@ -286,14 +286,14 @@ int WX_GRID::GetVisibleWidth( int aCol, bool aHeader, bool aContents, bool aKeep // The 1.1 scale factor is due to the fact headers use a bold font, bigger than // the normal font. - size = std::max( size, int( GetTextExtent( GetColLabelValue( aCol ) + "M" ).x * 1.1 ) ); + size = std::max( size, int( GetTextExtent( GetColLabelValue( aCol ) + wxT( "M" ) ).x * 1.1 ) ); } for( int row = 0; aContents && row < GetNumberRows(); row++ ) { // If we have text, get the size. Otherwise, use a placeholder for the checkbox if( GetTable()->CanGetValueAs( row, aCol, wxGRID_VALUE_STRING ) ) - size = std::max( size, GetTextExtent( GetCellValue( row, aCol ) + "M" ).x ); + size = std::max( size, GetTextExtent( GetCellValue( row, aCol ) + wxT( "M" ) ).x ); else size = std::max( size, GetTextExtent( "MM" ).x ); } diff --git a/common/wildcards_and_files_ext.cpp b/common/wildcards_and_files_ext.cpp index 66bb282ad9..c576a7d2bc 100644 --- a/common/wildcards_and_files_ext.cpp +++ b/common/wildcards_and_files_ext.cpp @@ -85,30 +85,30 @@ wxString AddFileExtListToFilter( const std::vector& aExts ) { // The "all files" wildcard is different on different systems wxString filter; - filter << " (" << wxFileSelectorDefaultWildcardStr << ")|" + filter << wxT( " (" ) << wxFileSelectorDefaultWildcardStr << wxT( ")|" ) << wxFileSelectorDefaultWildcardStr; return filter; } - wxString files_filter = " ("; + wxString files_filter = wxT( " (" ); // Add extensions to the info message: for( const std::string& ext : aExts ) { if( files_filter.length() > 2 ) - files_filter << "; "; + files_filter << wxT( "; " ); - files_filter << "*." << ext; + files_filter << wxT( "*." ) << ext; } - files_filter << ")|*."; + files_filter << wxT( ")|*." ); // Add extensions to the filter list, using a formatted string (GTK specific): bool first = true; for( const auto& ext : aExts ) { if( !first ) - files_filter << ";*."; + files_filter << wxT( ";*." ); first = false;