diff --git a/3d-viewer/3d_cache/3d_cache.cpp b/3d-viewer/3d_cache/3d_cache.cpp index 6cecebdd75..cc77ac2c02 100644 --- a/3d-viewer/3d_cache/3d_cache.cpp +++ b/3d-viewer/3d_cache/3d_cache.cpp @@ -536,7 +536,7 @@ bool S3D_CACHE::Set3DConfigDir( const wxString& aConfigDir ) { wxLogTrace( MASK_3D_CACHE, wxT( "%s:%s:%d\n * could not set 3D Config Directory on filename resolver\n" - " * config directory: '%s'" ), + " * config directory: '%s'" ), __FILE__, __FUNCTION__, __LINE__, m_ConfigDir ); } diff --git a/3d-viewer/3d_cache/3d_plugin_manager.cpp b/3d-viewer/3d_cache/3d_plugin_manager.cpp index b335d18830..f2d2bbaa03 100644 --- a/3d-viewer/3d_cache/3d_plugin_manager.cpp +++ b/3d-viewer/3d_cache/3d_plugin_manager.cpp @@ -324,7 +324,7 @@ void S3D_PLUGIN_MANAGER::checkPluginPath( const wxString& aPath, if( aPath.StartsWith( wxT( "${" ) ) || aPath.StartsWith( wxT( "$(" ) ) ) path.Assign( ExpandEnvVarSubstitutions( aPath, nullptr ), wxEmptyString ); else - path.Assign( aPath, "" ); + path.Assign( aPath, wxT( "" ) ); path.Normalize(); diff --git a/3d-viewer/3d_cache/sg/ifsg_api.cpp b/3d-viewer/3d_cache/sg/ifsg_api.cpp index 4c52920086..5f20782ab5 100644 --- a/3d-viewer/3d_cache/sg/ifsg_api.cpp +++ b/3d-viewer/3d_cache/sg/ifsg_api.cpp @@ -323,8 +323,10 @@ SGNODE* S3D::ReadCache( const char* aFileName, void* aPluginMgr, if( !rval ) { - wxLogTrace( MASK_3D_SG, "%s:%s:%d * [INFO] problems encountered reading cache file '%s'", - __FILE__, __FUNCTION__, __LINE__, aFileName ); + wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] problems encountered reading cache file " + "'%s'" ), + __FILE__, __FUNCTION__, __LINE__, + aFileName ); return nullptr; } diff --git a/3d-viewer/3d_canvas/eda_3d_canvas.cpp b/3d-viewer/3d_canvas/eda_3d_canvas.cpp index 52a9e3ce11..b65aee71a9 100644 --- a/3d-viewer/3d_canvas/eda_3d_canvas.cpp +++ b/3d-viewer/3d_canvas/eda_3d_canvas.cpp @@ -783,7 +783,7 @@ void EDA_3D_CANVAS::OnMouseMove( wxMouseEvent& event ) m_3d_render_opengl->SetCurrentRollOverItem( nullptr ); Request_refresh(); - reporter.Report( "" ); + reporter.Report( wxEmptyString ); } m_currentRollOverItem = nullptr; diff --git a/3d-viewer/dialogs/panel_preview_3d_model.cpp b/3d-viewer/dialogs/panel_preview_3d_model.cpp index 95397009f2..29a9fa120e 100644 --- a/3d-viewer/dialogs/panel_preview_3d_model.cpp +++ b/3d-viewer/dialogs/panel_preview_3d_model.cpp @@ -239,13 +239,16 @@ static double rotationFromString( const wxString& aValue ) wxString PANEL_PREVIEW_3D_MODEL::formatScaleValue( double aValue ) { - return wxString::Format( "%.4f", aValue ); + return wxString::Format( wxT( "%.4f" ), + aValue ); } wxString PANEL_PREVIEW_3D_MODEL::formatRotationValue( double aValue ) { - return wxString::Format( "%.2f%s", aValue, GetAbbreviatedUnitsLabel( EDA_UNITS::DEGREES ) ); + return wxString::Format( wxT( "%.2f%s" ), + aValue, + GetAbbreviatedUnitsLabel( EDA_UNITS::DEGREES ) ); } @@ -257,7 +260,9 @@ wxString PANEL_PREVIEW_3D_MODEL::formatOffsetValue( double aValue ) else if( m_userUnits == EDA_UNITS::MILS ) aValue /= 25.4 / 1e3; - return wxString::Format( "%.6f%s", aValue, GetAbbreviatedUnitsLabel( m_userUnits ) ); + return wxString::Format( wxT( "%.6f%s" ), + aValue, + GetAbbreviatedUnitsLabel( m_userUnits ) ); } diff --git a/eeschema/dialogs/panel_sym_lib_table.cpp b/eeschema/dialogs/panel_sym_lib_table.cpp index b7191f6d52..c61190ad4f 100644 --- a/eeschema/dialogs/panel_sym_lib_table.cpp +++ b/eeschema/dialogs/panel_sym_lib_table.cpp @@ -357,8 +357,8 @@ bool PANEL_SYM_LIB_TABLE::verifyTables() wxYES_NO | wxCENTER | wxICON_QUESTION | wxYES_DEFAULT ); badCellDlg.SetExtendedMessage( _( "Empty cells will result in all rows that are " "invalid to be removed from the table." ) ); - badCellDlg.SetYesNoLabels( wxMessageDialog::ButtonLabel( "Remove Invalid Cells" ), - wxMessageDialog::ButtonLabel( "Cancel Table Update" ) ); + badCellDlg.SetYesNoLabels( wxMessageDialog::ButtonLabel( _( "Remove Invalid Cells" ) ), + wxMessageDialog::ButtonLabel( _( "Cancel Table Update" ) ) ); if( badCellDlg.ShowModal() == wxID_NO ) return false; diff --git a/pcbnew/action_plugin.cpp b/pcbnew/action_plugin.cpp index 2a1d90bd22..a2a75618a8 100644 --- a/pcbnew/action_plugin.cpp +++ b/pcbnew/action_plugin.cpp @@ -177,7 +177,7 @@ void ACTION_PLUGINS::register_action( ACTION_PLUGIN* aAction ) if ( !aAction->iconBitmap.IsOk() ) { - wxLogVerbose( "Failed to load icon " + icon_file_name + " for action plugin " ); + wxLogVerbose( wxT( "Failed to load icon " ) + icon_file_name + wxT( " for action plugin " ) ); } } } diff --git a/pcbnew/board.cpp b/pcbnew/board.cpp index daf9cc8ff7..da5224929d 100644 --- a/pcbnew/board.cpp +++ b/pcbnew/board.cpp @@ -1011,14 +1011,14 @@ wxString BOARD::ConvertCrossReferencesToKIIDs( const wxString& aSource ) const wxString test( remainder ); if( footprint->ResolveTextVar( &test ) ) - token = footprint->m_Uuid.AsString() + ":" + remainder; + token = footprint->m_Uuid.AsString() + wxT( ":" ) + remainder; break; } } } - newbuf.append( "${" + token + "}" ); + newbuf.append( wxT( "${" ) + token + wxT( "}" ) ); } else { @@ -1060,10 +1060,13 @@ wxString BOARD::ConvertKIIDsToCrossReferences( const wxString& aSource ) const BOARD_ITEM* refItem = GetItem( KIID( ref ) ); if( refItem && refItem->Type() == PCB_FOOTPRINT_T ) - token = static_cast( refItem )->GetReference() + ":" + remainder; + { + token = static_cast( refItem )->GetReference() + wxT( ":" ) + + remainder; + } } - newbuf.append( "${" + token + "}" ); + newbuf.append( wxT( "${" ) + token + wxT( "}" ) ); } else { @@ -1189,11 +1192,11 @@ void BOARD::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector } } - aList.emplace_back( _( "Pads" ), wxString::Format( "%d", padCount ) ); - aList.emplace_back( _( "Vias" ), wxString::Format( "%d", viaCount ) ); - aList.emplace_back( _( "Track Segments" ), wxString::Format( "%d", trackSegmentCount ) ); - aList.emplace_back( _( "Nets" ), wxString::Format( "%d", (int) netCodes.size() ) ); - aList.emplace_back( _( "Unrouted" ), wxString::Format( "%d", unconnected ) ); + aList.emplace_back( _( "Pads" ), wxString::Format( wxT( "%d" ), padCount ) ); + aList.emplace_back( _( "Vias" ), wxString::Format( wxT( "%d" ), viaCount ) ); + aList.emplace_back( _( "Track Segments" ), wxString::Format( wxT( "%d" ), trackSegmentCount ) ); + aList.emplace_back( _( "Nets" ), wxString::Format( wxT( "%d" ), (int) netCodes.size() ) ); + aList.emplace_back( _( "Unrouted" ), wxString::Format( wxT( "%d" ), unconnected ) ); } diff --git a/pcbnew/board_connected_item.cpp b/pcbnew/board_connected_item.cpp index 2530c61bcc..835ff6551c 100644 --- a/pcbnew/board_connected_item.cpp +++ b/pcbnew/board_connected_item.cpp @@ -139,9 +139,9 @@ wxString BOARD_CONNECTED_ITEM::GetNetnameMsg() const if( !netname.length() ) return wxT( "[]" ); else if( GetNetCode() < 0 ) - return wxT( "[" + UnescapeString( netname ) + "](" + _( "Not Found" ) + ")" ); + return wxT( "[" ) + UnescapeString( netname ) + wxT( "](" ) + _( "Not Found" ) + wxT( ")" ); else - return wxT( "[" + UnescapeString( netname ) + "]" ); + return wxT( "[" ) + UnescapeString( netname ) + wxT( "]" ); } diff --git a/pcbnew/board_item.cpp b/pcbnew/board_item.cpp index 5fd3961a7f..b89fe46db3 100644 --- a/pcbnew/board_item.cpp +++ b/pcbnew/board_item.cpp @@ -171,8 +171,8 @@ void BOARD_ITEM::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBu int aError, ERROR_LOC aErrorLoc, bool ignoreLineWidth ) const { - wxASSERT_MSG( false, - "Called TransformShapeWithClearanceToPolygon() on unsupported BOARD_ITEM." ); + wxASSERT_MSG( false, wxT( "Called TransformShapeWithClearanceToPolygon() on unsupported " + "BOARD_ITEM." ) ); }; diff --git a/pcbnew/board_stackup_manager/board_stackup.cpp b/pcbnew/board_stackup_manager/board_stackup.cpp index c177c9700b..a10730dbde 100644 --- a/pcbnew/board_stackup_manager/board_stackup.cpp +++ b/pcbnew/board_stackup_manager/board_stackup.cpp @@ -48,18 +48,18 @@ BOARD_STACKUP_ITEM::BOARD_STACKUP_ITEM( BOARD_STACKUP_ITEM_TYPE aType ) break; case BS_ITEM_TYPE_DIELECTRIC: - m_TypeName = KEY_CORE; // or prepreg - SetMaterial( "FR4" ); // or other dielectric name - SetLossTangent( 0.02 ); // for FR4 - SetEpsilonR( 4.5 ); // for FR4 + m_TypeName = KEY_CORE; // or prepreg + SetMaterial( wxT( "FR4" ) ); // or other dielectric name + SetLossTangent( 0.02 ); // for FR4 + SetEpsilonR( 4.5 ); // for FR4 break; case BS_ITEM_TYPE_SOLDERPASTE: - m_TypeName = "solderpaste"; + m_TypeName = wxT( "solderpaste" ); break; case BS_ITEM_TYPE_SOLDERMASK: - m_TypeName = "soldermask"; + m_TypeName = wxT( "soldermask" ); m_Color = NotSpecifiedPrm(); SetMaterial( NotSpecifiedPrm() ); // or other solder mask material name SetThickness( GetMaskDefaultThickness() ); @@ -67,7 +67,7 @@ BOARD_STACKUP_ITEM::BOARD_STACKUP_ITEM( BOARD_STACKUP_ITEM_TYPE aType ) break; case BS_ITEM_TYPE_SILKSCREEN: - m_TypeName = "silkscreen"; + m_TypeName = wxT( "silkscreen" ); m_Color = NotSpecifiedPrm(); SetMaterial( NotSpecifiedPrm() ); // or other silkscreen material name SetEpsilonR( DEFAULT_EPSILON_R_SILKSCREEN ); @@ -299,7 +299,7 @@ BOARD_STACKUP::BOARD_STACKUP() m_EdgeConnectorConstraints = BS_EDGE_CONNECTOR_NONE; m_CastellatedPads = false; // True if some castellated pads exist m_EdgePlating = false; // True if edge board is plated - m_FinishType = "None"; // undefined finish type + m_FinishType = wxT( "None" ); // undefined finish type } @@ -550,12 +550,12 @@ void BOARD_STACKUP::BuildDefaultStackupList( const BOARD_DESIGN_SETTINGS* aSetti if( (dielectric_idx & 1) == 0 ) { item->SetTypeName( KEY_CORE ); - item->SetMaterial( "FR4" ); + item->SetMaterial( wxT( "FR4" ) ); } else { item->SetTypeName( KEY_PREPREG ); - item->SetMaterial( "FR4" ); + item->SetMaterial( wxT( "FR4" ) ); } Add( item ); @@ -617,7 +617,7 @@ void BOARD_STACKUP::FormatBoardStackup( OUTPUTFORMATTER* aFormatter, wxString layer_name; if( item->GetBrdLayerId() == UNDEFINED_LAYER ) - layer_name.Printf( "dielectric %d", item->GetDielectricLayerId() ); + layer_name.Printf( wxT( "dielectric %d" ), item->GetDielectricLayerId() ); else layer_name = LSET::Name( item->GetBrdLayerId() ); diff --git a/pcbnew/board_stackup_manager/board_stackup_reporter.cpp b/pcbnew/board_stackup_manager/board_stackup_reporter.cpp index ce859b95b4..1489776c97 100644 --- a/pcbnew/board_stackup_manager/board_stackup_reporter.cpp +++ b/pcbnew/board_stackup_manager/board_stackup_reporter.cpp @@ -56,21 +56,27 @@ wxString BuildStackupReport( BOARD_STACKUP& aStackup, EDA_UNITS aUnits ) wxString sublayer_text; if( item->GetSublayersCount() ) - sublayer_text.Printf( "\n sublayer \"1/%d\"", item->GetSublayersCount() ); + { + sublayer_text.Printf( wxT( "\n sublayer \"1/%d\"" ), + item->GetSublayersCount() ); + } - txt.Printf( "layer \"%s\" type \"%s\"%s", - item->FormatDielectricLayerName(), - item->GetTypeName(), sublayer_text ); + txt.Printf( wxT( "layer \"%s\" type \"%s\"%s" ), + item->FormatDielectricLayerName(), + item->GetTypeName(), sublayer_text ); } else - txt.Printf( "layer \"%s\" type \"%s\"", item->GetLayerName(), + { + txt.Printf( wxT( "layer \"%s\" type \"%s\"" ), + item->GetLayerName(), item->GetTypeName() ); + } report << txt; if( item->IsColorEditable() ) { - txt.Printf( " Color \"%s\"", item->GetColor() ); + txt.Printf( wxT( " Color \"%s\"" ), item->GetColor() ); report << txt; } @@ -78,38 +84,38 @@ wxString BuildStackupReport( BOARD_STACKUP& aStackup, EDA_UNITS aUnits ) { if( idx ) // not printed for the main (first) layer. { - txt.Printf( "\n sublayer \"%d/%d\"", idx+1, item->GetSublayersCount() ); + txt.Printf( wxT( "\n sublayer \"%d/%d\"" ), idx+1, item->GetSublayersCount() ); report << txt; } if( item->IsThicknessEditable() ) { - txt.Printf( " Thickness %s", + txt.Printf( wxT( " Thickness %s" ), StringFromValue( aUnits, item->GetThickness( idx ), true ) ); report << txt; if( item->GetType() == BS_ITEM_TYPE_DIELECTRIC && item->IsThicknessLocked( idx ) ) { - txt.Printf( " Locked" ); + txt.Printf( wxT( " Locked" ) ); report << txt; } } if( item->IsMaterialEditable() ) { - txt.Printf( " Material \"%s\"", item->GetMaterial( idx ) ); + txt.Printf( wxT( " Material \"%s\"" ), item->GetMaterial( idx ) ); report << txt; } if( item->HasEpsilonRValue() ) { - txt.Printf( " EpsilonR %s", item->FormatEpsilonR( idx ) ); + txt.Printf( wxT( " EpsilonR %s" ), item->FormatEpsilonR( idx ) ); report << txt; } if( item->HasLossTangentValue() ) { - txt.Printf( " LossTg %s", item->FormatLossTangent( idx ) ); + txt.Printf( wxT( " LossTg %s" ), item->FormatLossTangent( idx ) ); report << txt; } } @@ -118,26 +124,26 @@ wxString BuildStackupReport( BOARD_STACKUP& aStackup, EDA_UNITS aUnits ) } // Finish and other options: - txt.Printf( "Finish \"%s\"", aStackup.m_FinishType ); + txt.Printf( wxT( "Finish \"%s\"" ), aStackup.m_FinishType ); report << txt; if( aStackup.m_HasDielectricConstrains ) - report << " Option \"Impedance Controlled\""; + report << wxT( " Option \"Impedance Controlled\"" ); if( aStackup.m_EdgePlating ) - report << " Option \"Plated edges\""; + report << wxT( " Option \"Plated edges\"" ); if( aStackup.m_CastellatedPads ) - report << " Option \"Castellated Pads\""; + report << wxT( " Option \"Castellated Pads\"" ); if( aStackup.m_EdgeConnectorConstraints != BS_EDGE_CONNECTOR_NONE ) { - wxString conn_txt = "yes"; + wxString conn_txt = wxT( "yes" ); if( aStackup.m_EdgeConnectorConstraints == BS_EDGE_CONNECTOR_BEVELLED ) - conn_txt << ",bevelled"; + conn_txt << wxT( ",bevelled" ); - txt.Printf( " EdgeConnector \"%s\"", conn_txt ); + txt.Printf( wxT( " EdgeConnector \"%s\"" ), conn_txt ); report << txt; } diff --git a/pcbnew/board_stackup_manager/dielectric_material.cpp b/pcbnew/board_stackup_manager/dielectric_material.cpp index 1eabc1a3fe..7ad7ef3c19 100644 --- a/pcbnew/board_stackup_manager/dielectric_material.cpp +++ b/pcbnew/board_stackup_manager/dielectric_material.cpp @@ -37,32 +37,32 @@ // DO NOT translate them, as they are proper noun static DIELECTRIC_SUBSTRATE substrateMaterial[] = { - { NotSpecifiedPrm(), 0.0, 0.0 }, // Not specified, not in .gbrjob - { "FR4", 4.5, 0.02 }, // used in .gbrjob file - { "FR408-HR", 3.69, 0.0091 }, // used in .gbrjob file - { "Polyimide", 3.2, 0.004 }, // used in .gbrjob file - { "Kapton", 3.2, 0.004 }, // used in .gbrjob file - { "Polyolefin", 1.0, 0.0 }, // used in .gbrjob file - { "Al", 8.7, 0.001 }, // used in .gbrjob file - { "PTFE", 2.1, 0.0002 }, // used in .gbrjob file - { "Teflon", 2.1, 0.0002 }, // used in .gbrjob file - { "Ceramic", 1.0, 0.0 } // used in .gbrjob file + { NotSpecifiedPrm(), 0.0, 0.0 }, // Not specified, not in .gbrjob + { wxT( "FR4" ), 4.5, 0.02 }, // used in .gbrjob file + { wxT( "FR408-HR" ), 3.69, 0.0091 }, // used in .gbrjob file + { wxT( "Polyimide" ), 3.2, 0.004 }, // used in .gbrjob file + { wxT( "Kapton" ), 3.2, 0.004 }, // used in .gbrjob file + { wxT( "Polyolefin" ), 1.0, 0.0 }, // used in .gbrjob file + { wxT( "Al" ), 8.7, 0.001 }, // used in .gbrjob file + { wxT( "PTFE" ), 2.1, 0.0002 }, // used in .gbrjob file + { wxT( "Teflon" ), 2.1, 0.0002 }, // used in .gbrjob file + { wxT( "Ceramic" ), 1.0, 0.0 } // used in .gbrjob file // Other names are free }; static DIELECTRIC_SUBSTRATE solderMaskMaterial[] = { - { NotSpecifiedPrm(), DEFAULT_EPSILON_R_SOLDERMASK, 0.0 }, // Not specified, not in .gbrjob - { "Epoxy", DEFAULT_EPSILON_R_SOLDERMASK, 0.0 }, // Epoxy Liquid material (usual) - { "Liquid Ink", DEFAULT_EPSILON_R_SOLDERMASK, 0.0 }, // Liquid Ink Photoimageable - { "Dry Film", DEFAULT_EPSILON_R_SOLDERMASK, 0.0 } // Dry Film Photoimageable + { NotSpecifiedPrm(), DEFAULT_EPSILON_R_SOLDERMASK, 0.0 }, // Not specified, not in .gbrjob + { wxT( "Epoxy" ), DEFAULT_EPSILON_R_SOLDERMASK, 0.0 }, // Epoxy Liquid material (usual) + { wxT( "Liquid Ink" ), DEFAULT_EPSILON_R_SOLDERMASK, 0.0 }, // Liquid Ink Photoimageable + { wxT( "Dry Film" ), DEFAULT_EPSILON_R_SOLDERMASK, 0.0 } // Dry Film Photoimageable }; static DIELECTRIC_SUBSTRATE silkscreenMaterial[] = { - { NotSpecifiedPrm(), DEFAULT_EPSILON_R_SILKSCREEN, 0.0 }, // Not specified, not in .gbrjob - { "Liquid Photo", DEFAULT_EPSILON_R_SILKSCREEN, 0.0 }, // Liquid Ink Photoimageable - { "Direct Printing", DEFAULT_EPSILON_R_SILKSCREEN, 0.0 } // Direct Legend Printing + { NotSpecifiedPrm(), DEFAULT_EPSILON_R_SILKSCREEN, 0.0 }, // Not specified, not in .gbrjob + { wxT( "Liquid Photo" ), DEFAULT_EPSILON_R_SILKSCREEN, 0.0 }, // Liquid Ink Photoimageable + { wxT( "Direct Printing" ), DEFAULT_EPSILON_R_SILKSCREEN, 0.0 } // Direct Legend Printing }; diff --git a/pcbnew/board_stackup_manager/panel_board_stackup.cpp b/pcbnew/board_stackup_manager/panel_board_stackup.cpp index 80ab9ded0b..b276bee5a0 100644 --- a/pcbnew/board_stackup_manager/panel_board_stackup.cpp +++ b/pcbnew/board_stackup_manager/panel_board_stackup.cpp @@ -93,17 +93,17 @@ PANEL_SETUP_BOARD_STACKUP::PANEL_SETUP_BOARD_STACKUP( PAGED_DIALOG* aParent, PCB // Calculates a good size for color swatches (icons) in this dialog wxClientDC dc( this ); - m_colorSwatchesSize = dc.GetTextExtent( "XX" ); - m_colorIconsSize = dc.GetTextExtent( "XXXX" ); + m_colorSwatchesSize = dc.GetTextExtent( wxT( "XX" ) ); + m_colorIconsSize = dc.GetTextExtent( wxT( "XXXX" ) ); // Calculates a good size for wxTextCtrl to enter Epsilon R and Loss tan // ("0.0000000" + margins) - m_numericFieldsSize = dc.GetTextExtent( "X.XXXXXXX" ); + m_numericFieldsSize = dc.GetTextExtent( wxT( "X.XXXXXXX" ) ); m_numericFieldsSize.y = -1; // Use default for the vertical size // Calculates a minimal size for wxTextCtrl to enter a dim with units // ("000.0000000 mils" + margins) - m_numericTextCtrlSize = dc.GetTextExtent( "XXX.XXXXXXX mils" ); + m_numericTextCtrlSize = dc.GetTextExtent( wxT( "XXX.XXXXXXX mils" ) ); m_numericTextCtrlSize.y = -1; // Use default for the vertical size // The grid column containing the lock checkbox is kept to a minimal @@ -532,7 +532,7 @@ void PANEL_SETUP_BOARD_STACKUP::synchronizeWithBoard( bool aFullSync ) auto bm_combo = dynamic_cast( ui_row_item.m_ColorCtrl ); int selected = 0; // The "not specified" item - if( item->GetColor().StartsWith( "#" ) ) // User defined color + if( item->GetColor().StartsWith( wxT( "#" ) ) ) // User defined color { COLOR4D custom_color( item->GetColor() ); @@ -703,7 +703,8 @@ BOARD_STACKUP_ROW_UI_ITEM PANEL_SETUP_BOARD_STACKUP::createRowData( int aRow, if( item->GetSublayersCount() > 1 ) { - lname << " (" << aSublayerIdx+1 << "/" << item->GetSublayersCount() << ")"; + lname << wxT( " (" ) << aSublayerIdx+1 << wxT( "/" ) + << item->GetSublayersCount() << wxT( ")" ); } wxStaticText* st_text = new wxStaticText( m_scGridWin, wxID_ANY, lname ); @@ -789,7 +790,7 @@ BOARD_STACKUP_ROW_UI_ITEM PANEL_SETUP_BOARD_STACKUP::createRowData( int aRow, if( item->IsColorEditable() ) { - if( item->GetColor().StartsWith( "#" ) ) // User defined color + if( item->GetColor().StartsWith( wxT( "#" ) ) ) // User defined color { ui_row_item.m_UserColor = COLOR4D( item->GetColor() ).ToColour(); } @@ -801,7 +802,7 @@ BOARD_STACKUP_ROW_UI_ITEM PANEL_SETUP_BOARD_STACKUP::createRowData( int aRow, m_fgGridSizer->Add( bm_combo, 1, wxLEFT|wxRIGHT|wxALIGN_CENTER_VERTICAL|wxEXPAND, 2 ); - if( item->GetColor().StartsWith( "#" ) ) + if( item->GetColor().StartsWith( wxT( "#" ) ) ) { selected = GetColorUserDefinedListIdx( item->GetType() ); bm_combo->SetString( selected, item->GetColor() ); @@ -1046,7 +1047,7 @@ bool PANEL_SETUP_BOARD_STACKUP::transferDataFromUIToStackup() success = false; if( !error_msg.IsEmpty() ) - error_msg << "\n"; + error_msg << wxT( "\n" ); error_msg << _( "Incorrect value for Loss tg (Loss tg must be positive or null " "if not used)" ); @@ -1093,7 +1094,7 @@ bool PANEL_SETUP_BOARD_STACKUP::transferDataFromUIToStackup() success = false; if( !error_msg.IsEmpty() ) - error_msg << "\n"; + error_msg << wxT( "\n" ); error_msg << _( "A layer thickness is < 0. Fix it" ); } @@ -1444,11 +1445,11 @@ wxColor PANEL_SETUP_BOARD_STACKUP::getColorIconItem( int aRow ) default: case BS_ITEM_TYPE_UNDEFINED: - wxFAIL_MSG( "PANEL_SETUP_BOARD_STACKUP::getColorIconItem: unrecognized item type" ); + wxFAIL_MSG( wxT( "PANEL_SETUP_BOARD_STACKUP::getColorIconItem: unrecognized item type" ) ); break; } - wxASSERT_MSG( color.IsOk(), "Invalid color in PCB stackup" ); + wxASSERT_MSG( color.IsOk(), wxT( "Invalid color in PCB stackup" ) ); return color; } @@ -1496,7 +1497,7 @@ wxBitmapComboBox* PANEL_SETUP_BOARD_STACKUP::createColorBox( BOARD_STACKUP_ITEM* // Defined colors have a name, the user color uses HTML notation ( i.e. #FF000080) if( IsCustomColorIdx( itemType, ii ) - && aStackupItem && aStackupItem->GetColor().StartsWith( "#" ) ) + && aStackupItem && aStackupItem->GetColor().StartsWith( wxT( "#" ) ) ) { label = aStackupItem->GetColor(); curr_color = COLOR4D( label ); diff --git a/pcbnew/board_stackup_manager/stackup_predefined_prms.h b/pcbnew/board_stackup_manager/stackup_predefined_prms.h index 16895d45b7..b06a3d2259 100644 --- a/pcbnew/board_stackup_manager/stackup_predefined_prms.h +++ b/pcbnew/board_stackup_manager/stackup_predefined_prms.h @@ -41,10 +41,10 @@ #include // Keyword used in file to identify the dielectric layer type -#define KEY_CORE "core" -#define KEY_PREPREG "prepreg" +#define KEY_CORE wxT( "core" ) +#define KEY_PREPREG wxT( "prepreg" ) -#define KEY_COPPER "copper" +#define KEY_COPPER wxT( "copper" ) // key string used for not specified parameters // Can be translated in dialogs, and is also a keyword outside dialogs diff --git a/pcbnew/cleanup_item.cpp b/pcbnew/cleanup_item.cpp index ee14a611f3..c609fa1805 100644 --- a/pcbnew/cleanup_item.cpp +++ b/pcbnew/cleanup_item.cpp @@ -60,7 +60,7 @@ wxString CLEANUP_ITEM::GetErrorText( int aCode, bool aTranslate ) const case CLEANUP_LINES_TO_RECT: msg = _HKI( "Convert lines to rectangle" ); break; default: - wxFAIL_MSG( "Missing cleanup item description" ); + wxFAIL_MSG( wxT( "Missing cleanup item description" ) ); msg = _HKI( "Unknown cleanup action" ); break; } diff --git a/pcbnew/connectivity/connectivity_algo.cpp b/pcbnew/connectivity/connectivity_algo.cpp index 2ac8c57659..fe9553ec8b 100644 --- a/pcbnew/connectivity/connectivity_algo.cpp +++ b/pcbnew/connectivity/connectivity_algo.cpp @@ -498,25 +498,30 @@ void CN_CONNECTIVITY_ALGO::propagateConnections( BOARD_COMMIT* aCommit, PROPAGAT { bool skipConflicts = ( aMode == PROPAGATE_MODE::SKIP_CONFLICTS ); - wxLogTrace( "CN", "propagateConnections: propagate skip conflicts? %d", skipConflicts ); + wxLogTrace( wxT( "CN" ), wxT( "propagateConnections: propagate skip conflicts? %d" ), + skipConflicts ); for( const auto& cluster : m_connClusters ) { if( skipConflicts && cluster->IsConflicting() ) { - wxLogTrace( "CN", "Conflicting nets in cluster %p; skipping update", cluster.get() ); + wxLogTrace( wxT( "CN" ), wxT( "Conflicting nets in cluster %p; skipping update" ), + cluster.get() ); } else if( cluster->IsOrphaned() ) { - wxLogTrace( "CN", "Skipping orphaned cluster %p [net: %s]", cluster.get(), - (const char*) cluster->OriginNetName().c_str() ); + wxLogTrace( wxT( "CN" ), wxT( "Skipping orphaned cluster %p [net: %s]" ), + cluster.get(), + (const char*) cluster->OriginNetName().c_str() ); } else if( cluster->HasValidNet() ) { if( cluster->IsConflicting() ) { - wxLogTrace( "CN", "Conflicting nets in cluster %p; chose %d (%s)", cluster.get(), - cluster->OriginNet(), cluster->OriginNetName() ); + wxLogTrace( wxT( "CN" ), wxT( "Conflicting nets in cluster %p; chose %d (%s)" ), + cluster.get(), + cluster->OriginNet(), + cluster->OriginNetName() ); } // normal cluster: just propagate from the pads @@ -542,15 +547,19 @@ void CN_CONNECTIVITY_ALGO::propagateConnections( BOARD_COMMIT* aCommit, PROPAGAT if( n_changed ) { - wxLogTrace( "CN", "Cluster %p : net : %d %s", cluster.get(), - cluster->OriginNet(), (const char*) cluster->OriginNetName().c_str() ); + wxLogTrace( wxT( "CN" ), wxT( "Cluster %p : net : %d %s" ), + cluster.get(), + cluster->OriginNet(), + (const char*) cluster->OriginNetName().c_str() ); } else - wxLogTrace( "CN", "Cluster %p : nothing to propagate", cluster.get() ); + wxLogTrace( wxT( "CN" ), wxT( "Cluster %p : nothing to propagate" ), + cluster.get() ); } else { - wxLogTrace( "CN", "Cluster %p : connected to unused net", cluster.get() ); + wxLogTrace( wxT( "CN" ), wxT( "Cluster %p : connected to unused net" ), + cluster.get() ); } } } @@ -590,7 +599,7 @@ void CN_CONNECTIVITY_ALGO::FindIsolatedCopperIslands( ZONE* aZone, PCB_LAYER_ID } } - wxLogTrace( "CN", "Found %u isolated islands\n", (unsigned)aIslands.size() ); + wxLogTrace( wxT( "CN" ), wxT( "Found %u isolated islands\n" ), (unsigned) aIslands.size() ); } void CN_CONNECTIVITY_ALGO::FindIsolatedCopperIslands( std::vector& aZones ) diff --git a/pcbnew/connectivity/connectivity_data.cpp b/pcbnew/connectivity/connectivity_data.cpp index fbedf68517..8100699b01 100644 --- a/pcbnew/connectivity/connectivity_data.cpp +++ b/pcbnew/connectivity/connectivity_data.cpp @@ -644,7 +644,7 @@ bool CONNECTIVITY_DATA::TestTrackEndpointDangling( PCB_TRACK* aTrack, VECTOR2I* // Not in the connectivity system. This is a bug! if( items.empty() ) { - wxFAIL_MSG( "track not in connectivity system" ); + wxFAIL_MSG( wxT( "track not in connectivity system" ) ); return false; } @@ -737,7 +737,7 @@ bool CONNECTIVITY_DATA::TestTrackEndpointDangling( PCB_TRACK* aTrack, VECTOR2I* } else { - wxFAIL_MSG( "CONNECTIVITY_DATA::TestTrackEndpointDangling: unknown track type" ); + wxFAIL_MSG( wxT( "CONNECTIVITY_DATA::TestTrackEndpointDangling: unknown track type" ) ); } return false; diff --git a/pcbnew/connectivity/connectivity_items.cpp b/pcbnew/connectivity/connectivity_items.cpp index 7293995c3b..fff732e756 100644 --- a/pcbnew/connectivity/connectivity_items.cpp +++ b/pcbnew/connectivity/connectivity_items.cpp @@ -160,7 +160,7 @@ void CN_ITEM::Dump() for( CN_ITEM* i : m_connected ) { PCB_TRACK* t = static_cast( i->Parent() ); - wxLogDebug( " - %p %d\n", t, t->Type() ); + wxLogDebug( wxT( " - %p %d\n" ), t, t->Type() ); } } @@ -458,12 +458,12 @@ void CN_CLUSTER::Dump() { for( auto item : m_items ) { - wxLogTrace( "CN", " - item : %p bitem : %p type : %d inet %s\n", + wxLogTrace( wxT( "CN" ), wxT( " - item : %p bitem : %p type : %d inet %s\n" ), item, item->Parent(), item->Parent()->Type(), (const char*) item->Parent()->GetNetname().c_str() ); - wxLogTrace( "CN", "- item : %p bitem : %p type : %d inet %s\n", + wxLogTrace( wxT( "CN" ), wxT( "- item : %p bitem : %p type : %d inet %s\n" ), item, item->Parent(), item->Parent()->Type(), diff --git a/pcbnew/connectivity/from_to_cache.cpp b/pcbnew/connectivity/from_to_cache.cpp index 6f5e3f814f..1bb0f0415a 100644 --- a/pcbnew/connectivity/from_to_cache.cpp +++ b/pcbnew/connectivity/from_to_cache.cpp @@ -39,7 +39,7 @@ void FROM_TO_CACHE::buildEndpointList( ) for( PAD* pad : footprint->Pads() ) { FT_ENDPOINT ent; - ent.name = footprint->GetReference() + "-" + pad->GetNumber(); + ent.name = footprint->GetReference() + wxT( "-" ) + pad->GetNumber(); ent.parent = pad; m_ftEndpoints.push_back( ent ); ent.name = footprint->GetReference(); @@ -140,7 +140,8 @@ int FROM_TO_CACHE::cacheFromToPaths( const wxString& aFrom, const wxString& aTo int count = 0; auto netName = path.from->GetNetname(); - wxString fromName = path.from->GetParent()->GetReference() + "-" + path.from->GetNumber(); + wxString fromName = path.from->GetParent()->GetReference() + wxT( "-" ) + + path.from->GetNumber(); const KICAD_T onlyRouting[] = { PCB_PAD_T, PCB_ARC_T, PCB_VIA_T, PCB_TRACE_T, EOT }; @@ -157,7 +158,7 @@ int FROM_TO_CACHE::cacheFromToPaths( const wxString& aFrom, const wxString& aTo const PAD *pad = static_cast( pitem ); - wxString toName = pad->GetParent()->GetReference() + "-" + pad->GetNumber(); + wxString toName = pad->GetParent()->GetReference() + wxT( "-" ) + pad->GetNumber(); for ( const auto& endpoint : m_ftEndpoints ) diff --git a/pcbnew/convert_shape_list_to_polygon.cpp b/pcbnew/convert_shape_list_to_polygon.cpp index cbb3e15aef..0cbce66cb6 100644 --- a/pcbnew/convert_shape_list_to_polygon.cpp +++ b/pcbnew/convert_shape_list_to_polygon.cpp @@ -953,13 +953,15 @@ bool isCopperOutside( const FOOTPRINT* aMod, SHAPE_POLY_SET& aShape ) if( poly.OutlineCount() == 0 ) { VECTOR2I padPos = pad->GetPosition(); - wxLogTrace( traceBoardOutline, "Tested pad (%d, %d): outside", padPos.x, padPos.y ); + wxLogTrace( traceBoardOutline, wxT( "Tested pad (%d, %d): outside" ), + padPos.x, padPos.y ); padOutside = true; break; } VECTOR2I padPos = pad->GetPosition(); - wxLogTrace( traceBoardOutline, "Tested pad (%d, %d): not outside", padPos.x, padPos.y ); + wxLogTrace( traceBoardOutline, wxT( "Tested pad (%d, %d): not outside" ), + padPos.x, padPos.y ); } return padOutside; @@ -1021,7 +1023,7 @@ int findEndSegments( SHAPE_LINE_CHAIN& aChain, SEG& aStartSeg, SEG& aEndSeg ) if( foundSegs == 0 ) { // The first segment we encounter is the "start" segment - wxLogTrace( traceBoardOutline, "Found start segment: (%d, %d)-(%d, %d)", + wxLogTrace( traceBoardOutline, wxT( "Found start segment: (%d, %d)-(%d, %d)" ), seg.A.x, seg.A.y, seg.B.x, seg.B.y ); aStartSeg = seg; foundSegs++; @@ -1029,7 +1031,7 @@ int findEndSegments( SHAPE_LINE_CHAIN& aChain, SEG& aStartSeg, SEG& aEndSeg ) else { // Once we find both start and end, we can stop - wxLogTrace( traceBoardOutline, "Found end segment: (%d, %d)-(%d, %d)", + wxLogTrace( traceBoardOutline, wxT( "Found end segment: (%d, %d)-(%d, %d)" ), seg.A.x, seg.A.y, seg.B.x, seg.B.y ); aEndSeg = seg; foundSegs++; @@ -1061,7 +1063,7 @@ bool BuildFootprintPolygonOutlines( BOARD* aBoard, SHAPE_POLY_SET& aOutlines, in // No footprint loaded if( !footprint ) { - wxLogTrace( traceBoardOutline, "No footprint found on board" ); + wxLogTrace( traceBoardOutline, wxT( "No footprint found on board" ) ); return false; } @@ -1091,12 +1093,12 @@ bool BuildFootprintPolygonOutlines( BOARD* aBoard, SHAPE_POLY_SET& aOutlines, in // A closed outline was found on Edge_Cuts if( success ) { - wxLogTrace( traceBoardOutline, "Closed outline found" ); + wxLogTrace( traceBoardOutline, wxT( "Closed outline found" ) ); // If copper is outside a closed polygon, treat it as a hole if( isCopperOutside( footprint, outlines ) ) { - wxLogTrace( traceBoardOutline, "Treating outline as a hole" ); + wxLogTrace( traceBoardOutline, wxT( "Treating outline as a hole" ) ); buildBoardBoundingBoxPoly( aBoard, aOutlines ); @@ -1120,7 +1122,7 @@ bool BuildFootprintPolygonOutlines( BOARD* aBoard, SHAPE_POLY_SET& aOutlines, in // If all copper is inside, then the computed outline is the board outline else { - wxLogTrace( traceBoardOutline, "Treating outline as board edge" ); + wxLogTrace( traceBoardOutline, wxT( "Treating outline as board edge" ) ); aOutlines = outlines; } @@ -1129,7 +1131,7 @@ bool BuildFootprintPolygonOutlines( BOARD* aBoard, SHAPE_POLY_SET& aOutlines, in // No board outlines were found, so use the bounding box else if( outlines.OutlineCount() == 0 ) { - wxLogTrace( traceBoardOutline, "Using footprint bounding box" ); + wxLogTrace( traceBoardOutline, wxT( "Using footprint bounding box" ) ); buildBoardBoundingBoxPoly( aBoard, aOutlines ); return true; @@ -1137,7 +1139,7 @@ bool BuildFootprintPolygonOutlines( BOARD* aBoard, SHAPE_POLY_SET& aOutlines, in // There is an outline present, but it is not closed else { - wxLogTrace( traceBoardOutline, "Trying to build outline" ); + wxLogTrace( traceBoardOutline, wxT( "Trying to build outline" ) ); std::vector closedChains; std::vector openChains; @@ -1152,12 +1154,12 @@ bool BuildFootprintPolygonOutlines( BOARD* aBoard, SHAPE_POLY_SET& aOutlines, in if( hole.IsClosed() ) { - wxLogTrace( traceBoardOutline, "Found closed hole" ); + wxLogTrace( traceBoardOutline, wxT( "Found closed hole" ) ); closedChains.push_back( hole ); } else { - wxLogTrace( traceBoardOutline, "Found open hole" ); + wxLogTrace( traceBoardOutline, wxT( "Found open hole" ) ); openChains.push_back( hole ); } } @@ -1184,7 +1186,7 @@ bool BuildFootprintPolygonOutlines( BOARD* aBoard, SHAPE_POLY_SET& aOutlines, in if( chain.SegmentCount() == 0 ) { // Something is wrong, bail out with the overall footprint bounding box - wxLogTrace( traceBoardOutline, "No line segments in provided outline" ); + wxLogTrace( traceBoardOutline, wxT( "No line segments in provided outline" ) ); aOutlines = bbox; return true; } @@ -1192,7 +1194,7 @@ bool BuildFootprintPolygonOutlines( BOARD* aBoard, SHAPE_POLY_SET& aOutlines, in { // This case means there is only 1 line segment making up the edge cuts of the // footprint, so we just need to use it to cut the bounding box in half. - wxLogTrace( traceBoardOutline, "Only 1 line segment in provided outline" ); + wxLogTrace( traceBoardOutline, wxT( "Only 1 line segment in provided outline" ) ); startSeg = chain.Segment( 0 ); @@ -1205,7 +1207,8 @@ bool BuildFootprintPolygonOutlines( BOARD* aBoard, SHAPE_POLY_SET& aOutlines, in if( inter0 && inter2 && !inter1 && !inter3 ) { // Intersects the vertical rectangle sides only - wxLogTrace( traceBoardOutline, "Segment intersects only vertical bbox sides" ); + wxLogTrace( traceBoardOutline, wxT( "Segment intersects only vertical bbox " + "sides" ) ); // The upper half upper.Append( *inter0 ); @@ -1224,7 +1227,8 @@ bool BuildFootprintPolygonOutlines( BOARD* aBoard, SHAPE_POLY_SET& aOutlines, in else if( inter1 && inter3 && !inter0 && !inter2 ) { // Intersects the horizontal rectangle sides only - wxLogTrace( traceBoardOutline, "Segment intersects only horizontal bbox sides" ); + wxLogTrace( traceBoardOutline, wxT( "Segment intersects only horizontal bbox " + "sides" ) ); // The left half upper.Append( *inter1 ); @@ -1243,7 +1247,8 @@ bool BuildFootprintPolygonOutlines( BOARD* aBoard, SHAPE_POLY_SET& aOutlines, in else { // Angled line segment that cuts across a corner - wxLogTrace( traceBoardOutline, "Segment intersects two perpendicular bbox sides" ); + wxLogTrace( traceBoardOutline, wxT( "Segment intersects two perpendicular bbox " + "sides" ) ); // Figure out which actual lines are intersected, since IntersectLines assumes // an infinite line @@ -1255,7 +1260,7 @@ bool BuildFootprintPolygonOutlines( BOARD* aBoard, SHAPE_POLY_SET& aOutlines, in if( hit0 && hit1 ) { // Cut across the upper left corner - wxLogTrace( traceBoardOutline, "Segment cuts upper left corner" ); + wxLogTrace( traceBoardOutline, wxT( "Segment cuts upper left corner" ) ); // The upper half upper.Append( *inter0 ); @@ -1274,7 +1279,7 @@ bool BuildFootprintPolygonOutlines( BOARD* aBoard, SHAPE_POLY_SET& aOutlines, in else if( hit1 && hit2 ) { // Cut across the upper right corner - wxLogTrace( traceBoardOutline, "Segment cuts upper right corner" ); + wxLogTrace( traceBoardOutline, wxT( "Segment cuts upper right corner" ) ); // The upper half upper.Append( *inter1 ); @@ -1293,7 +1298,7 @@ bool BuildFootprintPolygonOutlines( BOARD* aBoard, SHAPE_POLY_SET& aOutlines, in else if( hit2 && hit3 ) { // Cut across the lower right corner - wxLogTrace( traceBoardOutline, "Segment cuts lower right corner" ); + wxLogTrace( traceBoardOutline, wxT( "Segment cuts lower right corner" ) ); // The upper half upper.Append( *inter2 ); @@ -1312,7 +1317,7 @@ bool BuildFootprintPolygonOutlines( BOARD* aBoard, SHAPE_POLY_SET& aOutlines, in else { // Cut across the lower left corner - wxLogTrace( traceBoardOutline, "Segment cuts upper left corner" ); + wxLogTrace( traceBoardOutline, wxT( "Segment cuts upper left corner" ) ); // The upper half upper.Append( *inter0 ); @@ -1333,7 +1338,7 @@ bool BuildFootprintPolygonOutlines( BOARD* aBoard, SHAPE_POLY_SET& aOutlines, in else { // More than 1 segment - wxLogTrace( traceBoardOutline, "Multiple segments in outline" ); + wxLogTrace( traceBoardOutline, wxT( "Multiple segments in outline" ) ); // Just a temporary thing aOutlines = bbox; @@ -1352,19 +1357,19 @@ bool BuildFootprintPolygonOutlines( BOARD* aBoard, SHAPE_POLY_SET& aOutlines, in if( isCopperOutside( footprint, poly1 ) ) { - wxLogTrace( traceBoardOutline, "Using lower shape" ); + wxLogTrace( traceBoardOutline, wxT( "Using lower shape" ) ); aOutlines = poly2; } else { - wxLogTrace( traceBoardOutline, "Using upper shape" ); + wxLogTrace( traceBoardOutline, wxT( "Using upper shape" ) ); aOutlines = poly1; } // Add all closed polys as holes to the main outline for( SHAPE_LINE_CHAIN& closedChain : closedChains ) { - wxLogTrace( traceBoardOutline, "Adding hole to main outline" ); + wxLogTrace( traceBoardOutline, wxT( "Adding hole to main outline" ) ); aOutlines.AddHole( closedChain, -1 ); } diff --git a/pcbnew/cross-probing.cpp b/pcbnew/cross-probing.cpp index 4bf2139dc7..d9c0c57ae9 100644 --- a/pcbnew/cross-probing.cpp +++ b/pcbnew/cross-probing.cpp @@ -115,7 +115,7 @@ void PCB_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline ) if( !crossProbingSettings.auto_highlight ) return; - wxStringTokenizer netsTok = wxStringTokenizer( FROM_UTF8( text ), "," ); + wxStringTokenizer netsTok = wxStringTokenizer( FROM_UTF8( text ), wxT( "," ) ); bool first = true; while( netsTok.HasMoreTokens() ) diff --git a/pcbnew/dialogs/dialog_board_reannotate.cpp b/pcbnew/dialogs/dialog_board_reannotate.cpp index 68ec910aec..0a8a79bbf7 100644 --- a/pcbnew/dialogs/dialog_board_reannotate.cpp +++ b/pcbnew/dialogs/dialog_board_reannotate.cpp @@ -492,7 +492,7 @@ static bool ModuleCompare( const RefDesInfo& aA, const RefDesInfo& aB ) wxString DIALOG_BOARD_REANNOTATE::CoordTowxString( int aX, int aY ) { - return wxString::Format( "%s, %s", + return wxString::Format( wxT( "%s, %s" ), MessageTextFromValue( m_units, aX ), MessageTextFromValue( m_units, aY ) ); } @@ -522,14 +522,14 @@ void DIALOG_BOARD_REANNOTATE::LogChangePlan() (int) m_refDesTypes.size() ); for( RefDesTypeStr Type : m_refDesTypes ) // Show all the types of refdes - message += Type.RefDesType + ( 0 == ( i++ % 16 ) ? "\n" : " " ); + message += Type.RefDesType + ( 0 == ( i++ % 16 ) ? wxT( "\n" ) : wxS( " " ) ); if( !m_excludeArray.empty() ) { wxString excludes; for( wxString& exclude : m_excludeArray ) // Show the refdes we are excluding - excludes += exclude + " "; + excludes += exclude + wxS( " " ); message += wxString::Format( _( "\nExcluding: %s from reannotation\n\n" ), excludes ); } @@ -538,10 +538,12 @@ void DIALOG_BOARD_REANNOTATE::LogChangePlan() for( const RefDesChange& change : m_changeArray ) { - message += wxString::Format( - "%s -> %s %s %s\n", change.OldRefDesString, change.NewRefDes, - ActionMessage[change.Action], - UpdateRefDes != change.Action ? _( " will be ignored" ) : wxT( "" ) ); + message += wxString::Format( wxT( "%s -> %s %s %s\n" ), + change.OldRefDesString, + change.NewRefDes, + ActionMessage[change.Action], + UpdateRefDes != change.Action ? _( " will be ignored" ) + : wxT( "" ) ); } ShowReport( message, RPT_SEVERITY_INFO ); @@ -591,17 +593,17 @@ bool DIALOG_BOARD_REANNOTATE::ReannotateBoard() if( !BuildFootprintList( BadRefDes ) ) { - ShowReport( "Selected options resulted in errors! Change them and try again.", + ShowReport( _( "Selected options resulted in errors! Change them and try again." ), RPT_SEVERITY_ERROR ); return false; } if( !BadRefDes.empty() ) { - message.Printf( - _( "\nPCB has %d empty or invalid reference designations." - "\nRecommend running DRC with 'Test for parity between PCB and schematic' checked.\n" ), - (int) BadRefDes.size() ); + message.Printf( _( "\nPCB has %d empty or invalid reference designations." + "\nRecommend running DRC with 'Test for parity between PCB and " + "schematic' checked.\n" ), + (int) BadRefDes.size() ); for( const RefDesInfo& mod : BadRefDes ) { @@ -612,7 +614,7 @@ bool DIALOG_BOARD_REANNOTATE::ReannotateBoard() CoordTowxString( mod.x, mod.y ) ); } - ShowReport( message + badrefdes + "\n", RPT_SEVERITY_WARNING ); + ShowReport( message + badrefdes + wxT( "\n" ), RPT_SEVERITY_WARNING ); message += _( "Reannotate anyway?" ); if( !IsOK( m_frame, message ) ) @@ -633,7 +635,7 @@ bool DIALOG_BOARD_REANNOTATE::ReannotateBoard() m_frame->GetCanvas()->GetView()->Update( footprint ); // Touch the footprint } - commit.Push( "Geographic reannotation" ); + commit.Push( wxT( "Geographic reannotation" ) ); return true; } @@ -707,7 +709,7 @@ bool DIALOG_BOARD_REANNOTATE::BuildFootprintList( std::vector& aBadR } else { - firstnum = fpData.RefDesString.find_first_of( "0123456789" ); + firstnum = fpData.RefDesString.find_first_of( wxT( "0123456789" ) ); if( std::string::npos == firstnum ) fpData.Action = InvalidRefDes; // do not change ref des such as 12 or +1, or L @@ -797,7 +799,7 @@ bool DIALOG_BOARD_REANNOTATE::BuildFootprintList( std::vector& aBadR { if( m_changeArray[i].NewRefDes == m_changeArray[j].NewRefDes ) { - ShowReport( "Duplicate instances of " + m_changeArray[j].NewRefDes, + ShowReport( _( "Duplicate instances of " ) + m_changeArray[j].NewRefDes, RPT_SEVERITY_ERROR ); if( errorcount++ > MAXERROR ) diff --git a/pcbnew/dialogs/dialog_board_statistics.cpp b/pcbnew/dialogs/dialog_board_statistics.cpp index 58cf568af0..cd271284f9 100644 --- a/pcbnew/dialogs/dialog_board_statistics.cpp +++ b/pcbnew/dialogs/dialog_board_statistics.cpp @@ -122,8 +122,8 @@ DIALOG_BOARD_STATISTICS::DIALOG_BOARD_STATISTICS( PCB_EDIT_FRAME* aParentFrame ) if( !s_savedDialogState.saveReportInitialized || s_savedDialogState.m_project != Prj().GetProjectFullName() ) { - fn.SetName( fn.GetName() + "_report" ); - fn.SetExt( "txt" ); + fn.SetName( fn.GetName() + wxT( "_report" ) ); + fn.SetExt( wxT( "txt" ) ); s_savedDialogState.saveReportName = fn.GetFullName(); s_savedDialogState.saveReportFolder = wxPathOnly( Prj().GetProjectFullName() ); s_savedDialogState.m_project = Prj().GetProjectFullName(); @@ -372,7 +372,7 @@ void DIALOG_BOARD_STATISTICS::updateWidets() } m_gridPads->SetCellValue( currentRow, COL_LABEL, _( "Total:" ) ); - m_gridPads->SetCellValue( currentRow, COL_AMOUNT, wxString::Format( "%i ", totalPads ) ); + m_gridPads->SetCellValue( currentRow, COL_AMOUNT, wxString::Format( wxT( "%i " ), totalPads ) ); int totalVias = 0; currentRow = 0; @@ -380,13 +380,13 @@ void DIALOG_BOARD_STATISTICS::updateWidets() for( const auto& type : m_viasTypes ) { m_gridVias->SetCellValue( currentRow, COL_LABEL, type.title ); - m_gridVias->SetCellValue( currentRow, COL_AMOUNT, wxString::Format( "%i ", type.qty ) ); + m_gridVias->SetCellValue( currentRow, COL_AMOUNT, wxString::Format( wxT( "%i " ), type.qty ) ); totalVias += type.qty; currentRow++; } m_gridVias->SetCellValue( currentRow, COL_LABEL, _( "Total:" ) ); - m_gridVias->SetCellValue( currentRow, COL_AMOUNT, wxString::Format( "%i ", totalVias ) ); + m_gridVias->SetCellValue( currentRow, COL_AMOUNT, wxString::Format( wxT( "%i " ), totalVias ) ); int totalFront = 0; @@ -398,12 +398,13 @@ void DIALOG_BOARD_STATISTICS::updateWidets() for( const auto& type : m_componentsTypes ) { m_gridComponents->SetCellValue( currentRow, COL_LABEL, type.title ); - m_gridComponents->SetCellValue( - currentRow, COL_FRONT_SIDE, wxString::Format( "%i ", type.frontSideQty ) ); - m_gridComponents->SetCellValue( - currentRow, COL_BOTTOM_SIDE, wxString::Format( "%i ", type.backSideQty ) ); + m_gridComponents->SetCellValue( currentRow, COL_FRONT_SIDE, + wxString::Format( wxT( "%i " ), type.frontSideQty ) ); + m_gridComponents->SetCellValue( currentRow, COL_BOTTOM_SIDE, + wxString::Format( wxT( "%i " ), type.backSideQty ) ); m_gridComponents->SetCellValue( currentRow, 3, - wxString::Format( wxT( "%i " ), type.frontSideQty + type.backSideQty ) ); + wxString::Format( wxT( "%i " ), + type.frontSideQty + type.backSideQty ) ); totalFront += type.frontSideQty; totalBack += type.backSideQty; currentRow++; @@ -411,18 +412,20 @@ void DIALOG_BOARD_STATISTICS::updateWidets() m_gridComponents->SetCellValue( currentRow, COL_LABEL, _( "Total:" ) ); m_gridComponents->SetCellValue( currentRow, COL_FRONT_SIDE, - wxString::Format( "%i ", totalFront ) ); + wxString::Format( wxT( "%i " ), totalFront ) ); m_gridComponents->SetCellValue( currentRow, COL_BOTTOM_SIDE, - wxString::Format( "%i ", totalBack ) ); + wxString::Format( wxT( "%i " ), totalBack ) ); m_gridComponents->SetCellValue( currentRow, COL_TOTAL, - wxString::Format( "%i ", totalFront + totalBack ) ); + wxString::Format( wxT( "%i " ), totalFront + totalBack ) ); if( m_hasOutline ) { m_gridBoard->SetCellValue( ROW_BOARD_WIDTH, COL_AMOUNT, - MessageTextFromValue( GetUserUnits(), m_boardWidth ) + " " ); + MessageTextFromValue( GetUserUnits(), + m_boardWidth ) + wxS( " " ) ); m_gridBoard->SetCellValue( ROW_BOARD_HEIGHT, COL_AMOUNT, - MessageTextFromValue( GetUserUnits(), m_boardHeight ) + " " ); + MessageTextFromValue( GetUserUnits(), + m_boardHeight ) + wxS( " " ) ); m_gridBoard->SetCellValue( ROW_BOARD_AREA, COL_AMOUNT, MessageTextFromValue( GetUserUnits(), m_boardArea, true, EDA_DATA_TYPE::AREA ) ); @@ -482,7 +485,7 @@ void DIALOG_BOARD_STATISTICS::updateDrillGrid() stopLayerStr = board->GetLayerName( type.stopLayer ); m_gridDrills->SetCellValue( - currentRow, drillType_t::COL_COUNT, wxString::Format( "%i", type.qty ) ); + currentRow, drillType_t::COL_COUNT, wxString::Format( wxT( "%i" ), type.qty ) ); m_gridDrills->SetCellValue( currentRow, drillType_t::COL_SHAPE, shapeStr ); m_gridDrills->SetCellValue( currentRow, drillType_t::COL_X_SIZE, MessageTextFromValue( GetUserUnits(), type.xSize ) ); @@ -529,44 +532,44 @@ void DIALOG_BOARD_STATISTICS::printGridToStringAsTable( wxGrid* aGrid, wxString& // Print column labels. - aStr << "|"; + aStr << wxT( "|" ); if( aUseRowLabels ) { aStr.Append( ' ', rowLabelsWidth ); - aStr << " |"; + aStr << wxT( " |" ); } for( int col = 0; col < aGrid->GetNumberCols(); col++ ) { if( aUseColLabels ) - tmp.Printf( " %*s |", widths[col], aGrid->GetColLabelValue( col ) ); + tmp.Printf( wxT( " %*s |" ), widths[col], aGrid->GetColLabelValue( col ) ); else - tmp.Printf( " %*s |", widths[col], aGrid->GetCellValue( 0, col ) ); + tmp.Printf( wxT( " %*s |" ), widths[col], aGrid->GetCellValue( 0, col ) ); aStr << tmp; } - aStr << "\n"; + aStr << wxT( "\n" ); // Print column label horizontal separators. - aStr << "|"; + aStr << wxT( "|" ); if( aUseRowLabels ) { aStr.Append( '-', rowLabelsWidth ); - aStr << "-|"; + aStr << wxT( "-|" ); } for( int col = 0; col < aGrid->GetNumberCols(); col++ ) { - aStr << "-"; + aStr << wxT( "-" ); aStr.Append( '-', widths[col] ); - aStr << "-|"; + aStr << wxT( "-|" ); } - aStr << "\n"; + aStr << wxT( "\n" ); // Print regular cells. @@ -581,21 +584,21 @@ void DIALOG_BOARD_STATISTICS::printGridToStringAsTable( wxGrid* aGrid, wxString& for( int row = firstRow; row < aGrid->GetNumberRows(); row++ ) { if( aUseRowLabels ) - tmp.Printf( "|%-*s |", rowLabelsWidth, aGrid->GetRowLabelValue( row ) ); + tmp.Printf( wxT( "|%-*s |" ), rowLabelsWidth, aGrid->GetRowLabelValue( row ) ); else if( aUseFirstColAsLabel ) - tmp.Printf( "|%-*s |", widths[0], aGrid->GetCellValue( row, 0 ) ); + tmp.Printf( wxT( "|%-*s |" ), widths[0], aGrid->GetCellValue( row, 0 ) ); else - tmp.Printf( "|" ); + tmp.Printf( wxT( "|" ) ); aStr << tmp; for( int col = firstCol; col < aGrid->GetNumberCols(); col++ ) { - tmp.Printf( " %*s |", widths[col], aGrid->GetCellValue( row, col ) ); + tmp.Printf( wxT( " %*s |" ), widths[col], aGrid->GetCellValue( row, col ) ); aStr << tmp; } - aStr << "\n"; + aStr << wxT( "\n" ); } } @@ -655,7 +658,7 @@ void DIALOG_BOARD_STATISTICS::saveReportClicked( wxCommandEvent& aEvent ) s_savedDialogState.saveReportFolder = wxPathOnly( saveFileDialog.GetPath() ); s_savedDialogState.saveReportName = saveFileDialog.GetFilename(); - outFile = wxFopen( saveFileDialog.GetPath(), "wt" ); + outFile = wxFopen( saveFileDialog.GetPath(), wxT( "wt" ) ); if( outFile == nullptr ) { @@ -664,47 +667,47 @@ void DIALOG_BOARD_STATISTICS::saveReportClicked( wxCommandEvent& aEvent ) return; } - msg << _( "PCB statistics report\n=====================" ) << "\n"; - msg << wxS( "- " ) << _( "Date" ) << wxS( ": " ) << wxDateTime::Now().Format() << "\n"; - msg << wxS( "- " ) << _( "Project" ) << wxS( ": " )<< Prj().GetProjectName() << "\n"; - msg << wxS( "- " ) << _( "Board name" ) << wxS( ": " )<< boardName << "\n"; + msg << _( "PCB statistics report\n=====================" ) << wxT( "\n" ); + msg << wxS( "- " ) << _( "Date" ) << wxS( ": " ) << wxDateTime::Now().Format() << wxT( "\n" ); + msg << wxS( "- " ) << _( "Project" ) << wxS( ": " )<< Prj().GetProjectName() << wxT( "\n" ); + msg << wxS( "- " ) << _( "Board name" ) << wxS( ": " )<< boardName << wxT( "\n" ); - msg << "\n"; - msg << _( "Board" ) << "\n-----\n"; + msg << wxT( "\n" ); + msg << _( "Board" ) << wxT( "\n-----\n" ); if( m_hasOutline ) { msg << wxS( "- " ) << _( "Width" ) << wxS( ": " ) << - MessageTextFromValue( GetUserUnits(), m_boardWidth ) << "\n"; + MessageTextFromValue( GetUserUnits(), m_boardWidth ) << wxT( "\n" ); msg << wxS( "- " ) << _( "Height" ) << wxS( ": " ) << - MessageTextFromValue( GetUserUnits(), m_boardHeight ) << "\n"; + MessageTextFromValue( GetUserUnits(), m_boardHeight ) << wxT( "\n" ); msg << wxS( "- " ) << _( "Area" ) + wxS( ": " ) << MessageTextFromValue( GetUserUnits(), m_boardArea, true, EDA_DATA_TYPE::AREA ); - msg << "\n"; + msg << wxT( "\n" ); } else { - msg << wxS( "- " ) << _( "Width" ) << wxS( ": " ) << _( "unknown" ) << "\n"; - msg << wxS( "- " ) << _( "Height" ) << wxS( ": " ) << _( "unknown" ) << "\n"; - msg << wxS( "- " ) << _( "Area" ) << wxS( ": " ) << _( "unknown" ) << "\n"; + msg << wxS( "- " ) << _( "Width" ) << wxS( ": " ) << _( "unknown" ) << wxT( "\n" ); + msg << wxS( "- " ) << _( "Height" ) << wxS( ": " ) << _( "unknown" ) << wxT( "\n" ); + msg << wxS( "- " ) << _( "Area" ) << wxS( ": " ) << _( "unknown" ) << wxT( "\n" ); } - msg << "\n"; - msg << _( "Pads" ) << "\n----\n"; + msg << wxT( "\n" ); + msg << _( "Pads" ) << wxT( "\n----\n" ); for( auto& type : m_padsTypes ) - msg << "- " << type.title << " " << type.qty << "\n"; + msg << wxT( "- " ) << type.title << wxS( " " ) << type.qty << wxT( "\n" ); - msg << "\n"; - msg << _( "Vias" ) << "\n----\n"; + msg << wxT( "\n" ); + msg << _( "Vias" ) << wxT( "\n----\n" ); for( auto& type : m_viasTypes ) - msg << "- " << type.title << " " << type.qty << "\n"; + msg << wxT( "- " ) << type.title << wxS( " " ) << type.qty << wxT( "\n" ); // We will save data about components in the table. // We have to calculate column widths std::vector widths; - std::vector labels{ "", _( "Front Side" ), _( "Back Side" ), _( "Total" ) }; + std::vector labels{ wxT( "" ), _( "Front Side" ), _( "Back Side" ), _( "Total" ) }; wxString tmp; widths.reserve( labels.size() ); @@ -724,23 +727,23 @@ void DIALOG_BOARD_STATISTICS::saveReportClicked( wxCommandEvent& aEvent ) } // Get maximum width for other columns - tmp.Printf( "%i", frontTotal ); + tmp.Printf( wxT( "%i" ), frontTotal ); widths[1] = std::max( tmp.size(), widths[1] ); - tmp.Printf( "%i", backTotal ); + tmp.Printf( wxT( "%i" ), backTotal ); widths[2] = std::max( tmp.size(), widths[2] ); - tmp.Printf( "%i", frontTotal + backTotal ); + tmp.Printf( wxT( "%i" ), frontTotal + backTotal ); widths[3] = std::max( tmp.size(), widths[3] ); //Write components amount to file - msg << "\n"; - msg << _( "Components" ) << "\n----------\n"; - msg << "\n"; + msg << wxT( "\n" ); + msg << _( "Components" ) << wxT( "\n----------\n" ); + msg << wxT( "\n" ); printGridToStringAsTable( m_gridComponents, msg, false, false, true ); - msg << "\n"; - msg << _( "Drill holes" ) << "\n-----------\n"; - msg << "\n"; + msg << wxT( "\n" ); + msg << _( "Drill holes" ) << wxT( "\n-----------\n" ); + msg << wxT( "\n" ); printGridToStringAsTable( m_gridDrills, msg, false, true, false ); diff --git a/pcbnew/dialogs/dialog_constraints_reporter.cpp b/pcbnew/dialogs/dialog_constraints_reporter.cpp index 35241c7123..d95570df8e 100644 --- a/pcbnew/dialogs/dialog_constraints_reporter.cpp +++ b/pcbnew/dialogs/dialog_constraints_reporter.cpp @@ -50,9 +50,9 @@ void DIALOG_CONSTRAINTS_REPORTER::DeleteAllPages() void DIALOG_CONSTRAINTS_REPORTER::OnErrorLinkClicked( wxHtmlLinkEvent& event ) { - if( event.GetLinkInfo().GetHref() == "boardsetup" ) + if( event.GetLinkInfo().GetHref() == wxT( "boardsetup" ) ) m_frame->ShowBoardSetupDialog( _( "Custom Rules" ) ); - else if( event.GetLinkInfo().GetHref() == "drc" ) + else if( event.GetLinkInfo().GetHref() == wxT( "drc" ) ) m_frame->GetToolManager()->RunAction( PCB_ACTIONS::runDRC, true ); } diff --git a/pcbnew/dialogs/dialog_copper_zones.cpp b/pcbnew/dialogs/dialog_copper_zones.cpp index f244fb2a67..914504e50c 100644 --- a/pcbnew/dialogs/dialog_copper_zones.cpp +++ b/pcbnew/dialogs/dialog_copper_zones.cpp @@ -688,7 +688,7 @@ void DIALOG_COPPER_ZONE::updateShowNetsFilter() netNameShowFilter = wxT( "*" ); } - wxStringTokenizer showFilters( netNameShowFilter.Lower(), "," ); + wxStringTokenizer showFilters( netNameShowFilter.Lower(), wxT( "," ) ); m_showNetsFilter.clear(); @@ -816,7 +816,7 @@ wxArrayString DIALOG_COPPER_ZONE::applyHideFilterIfRequired( const wxArrayString bool DIALOG_COPPER_ZONE::isAutoGenerated( const wxString& netName ) { - return netName.StartsWith( "Net-(" ) || netName.StartsWith( "unconnected-(" ); + return netName.StartsWith( wxT( "Net-(" ) ) || netName.StartsWith( wxT( "unconnected-(" ) ); } diff --git a/pcbnew/dialogs/dialog_create_array.cpp b/pcbnew/dialogs/dialog_create_array.cpp index 6663c4f4ea..ba8611ffca 100644 --- a/pcbnew/dialogs/dialog_create_array.cpp +++ b/pcbnew/dialogs/dialog_create_array.cpp @@ -50,28 +50,28 @@ struct CREATE_ARRAY_DIALOG_ENTRIES m_GridOffsetX( 0 ), m_GridOffsetY( 0 ), m_GridStagger( 1 ), - m_GridStaggerType( 0 ), // rows - m_GridNumberingAxis( 0 ), // h then v + m_GridStaggerType( 0 ), // rows + m_GridNumberingAxis( 0 ), // h then v m_GridNumReverseAlt( false ), - m_GridNumStartSet( 1 ), // use specified start - m_Grid2dArrayNumbering( 0 ), // linear numbering - m_GridPrimaryAxisScheme( 0 ), // numeric - m_GridSecondaryAxisScheme( 0 ), // numeric - m_GridPrimaryNumOffset( "1" ), // numeric - m_GridSecondaryNumOffset( "1" ), // numeric + m_GridNumStartSet( 1 ), // use specified start + m_Grid2dArrayNumbering( 0 ), // linear numbering + m_GridPrimaryAxisScheme( 0 ), // numeric + m_GridSecondaryAxisScheme( 0 ), // numeric + m_GridPrimaryNumOffset( wxT( "1" ) ), // numeric + m_GridSecondaryNumOffset( wxT( "1" ) ), // numeric m_GridPrimaryAxisStep( 1 ), m_GridSecondaryAxisStep( 1 ), m_CircCentreX( 0 ), m_CircCentreY( 0 ), m_CircCount( 4 ), - m_CircNumStartSet( 1 ), // use specified start + m_CircNumStartSet( 1 ), // use specified start m_GridCircNumScheme( 0 ), - m_CircNumberingOffset( "1" ), + m_CircNumberingOffset( wxT( "1" ) ), m_CircNumberingStep( 1 ), m_CircRotatationStep( false ), - m_ArrayTypeTab( 0 ), // start on grid view + m_ArrayTypeTab( 0 ), // start on grid view m_FootprintKeepAnnotations( false ), - m_FootprintReannotate( true ) // Assign unique by default + m_FootprintReannotate( true ) // Assign unique by default { } @@ -292,7 +292,7 @@ static bool validateAxisOptions( const wxTextCtrl& offsetEntry, const wxChoice& void* clientData = typeEntry.GetClientData( typeEntry.GetSelection() ); const NUMBERING_LIST_DATA* numberingData = static_cast( clientData ); - wxCHECK_MSG( numberingData, false, "Failed to get client data from list control." ); + wxCHECK_MSG( numberingData, false, wxT( "Failed to get client data from list control." ) ); aAxis.SetAxisType( numberingData->m_numbering_type ); @@ -444,7 +444,7 @@ bool DIALOG_CREATE_ARRAY::TransferDataFromWindow() if( errors.IsEmpty() ) errorStr = _("Bad parameters"); else - errorStr = boost::algorithm::join( errors, "\n" ); + errorStr = boost::algorithm::join( errors, wxT( "\n" ) ); wxMessageBox( errorStr ); return false; diff --git a/pcbnew/dialogs/dialog_drc.h b/pcbnew/dialogs/dialog_drc.h index d22a86d4dc..59dcda0816 100644 --- a/pcbnew/dialogs/dialog_drc.h +++ b/pcbnew/dialogs/dialog_drc.h @@ -38,7 +38,7 @@ class BOARD_DESIGN_SETTINGS; -#define DIALOG_DRC_WINDOW_NAME "DialogDrcWindowName" +#define DIALOG_DRC_WINDOW_NAME wxT( "DialogDrcWindowName" ) class DIALOG_DRC: public DIALOG_DRC_BASE, PROGRESS_REPORTER_BASE diff --git a/pcbnew/dialogs/dialog_export_idf.cpp b/pcbnew/dialogs/dialog_export_idf.cpp index 5faf0b6b56..50e8e76548 100644 --- a/pcbnew/dialogs/dialog_export_idf.cpp +++ b/pcbnew/dialogs/dialog_export_idf.cpp @@ -178,7 +178,7 @@ void PCB_EDIT_FRAME::OnExportIDF3( wxCommandEvent& event ) if( path.IsEmpty() ) { wxFileName brdFile = GetBoard()->GetFileName(); - brdFile.SetExt( "emn" ); + brdFile.SetExt( wxT( "emn" ) ); path = brdFile.GetFullPath(); } diff --git a/pcbnew/dialogs/dialog_export_step.cpp b/pcbnew/dialogs/dialog_export_step.cpp index 17ffa87edf..40f7e85bad 100644 --- a/pcbnew/dialogs/dialog_export_step.cpp +++ b/pcbnew/dialogs/dialog_export_step.cpp @@ -128,7 +128,7 @@ DIALOG_EXPORT_STEP::DIALOG_EXPORT_STEP( PCB_EDIT_FRAME* aParent, const wxString& if( path.IsEmpty() ) { wxFileName brdFile = m_parent->GetBoard()->GetFileName(); - brdFile.SetExt( "step" ); + brdFile.SetExt( wxT( "step" ) ); path = brdFile.GetFullPath(); } @@ -178,7 +178,7 @@ DIALOG_EXPORT_STEP::DIALOG_EXPORT_STEP( PCB_EDIT_FRAME* aParent, const wxString& wxString tmpStr; tmpStr << m_XOrg; m_STEP_Xorg->SetValue( tmpStr ); - tmpStr = ""; + tmpStr = wxEmptyString; tmpStr << m_YOrg; m_STEP_Yorg->SetValue( tmpStr ); @@ -207,7 +207,7 @@ DIALOG_EXPORT_STEP::DIALOG_EXPORT_STEP( PCB_EDIT_FRAME* aParent, const wxString& if( !bad_scales.empty() && !Pgm().GetCommonSettings()->m_DoNotShowAgain.scaled_3d_models_warning ) { - wxString extendedMsg = _( "Non-unity scaled models:" ) + "\n" + bad_scales; + wxString extendedMsg = _( "Non-unity scaled models:" ) + wxT( "\n" ) + bad_scales; KIDIALOG msgDlg( m_parent, _( "Scaled models detected. " "Model scaling is not reliable for mechanical export." ), @@ -356,7 +356,8 @@ void DIALOG_EXPORT_STEP::onExportButton( wxCommandEvent& aEvent ) FILENAME_RESOLVER* fnResolver = m_parent->Prj().Get3DFilenameResolver(); - fnResolver->WritePathList( wxStandardPaths::Get().GetTempDir(), "ExportPaths.cfg", true ); + fnResolver->WritePathList( wxStandardPaths::Get().GetTempDir(), wxT( "ExportPaths.cfg" ), + true ); DIALOG_EXPORT_STEP::STEP_ORG_OPT orgOpt = GetOriginOption(); double xOrg = 0.0; @@ -369,25 +370,25 @@ void DIALOG_EXPORT_STEP::onExportButton( wxCommandEvent& aEvent ) // On macOS, we have standalone applications inside the main bundle, so we handle that here: if( appK2S.GetPath().Find( "/Contents/Applications/pcbnew.app/Contents/MacOS" ) != wxNOT_FOUND ) { - appK2S.AppendDir( ".." ); - appK2S.AppendDir( ".." ); - appK2S.AppendDir( ".." ); - appK2S.AppendDir( ".." ); - appK2S.AppendDir( "MacOS" ); + appK2S.AppendDir( wxT( ".." ) ); + appK2S.AppendDir( wxT( ".." ) ); + appK2S.AppendDir( wxT( ".." ) ); + appK2S.AppendDir( wxT( ".." ) ); + appK2S.AppendDir( wxT( "MacOS" ) ); } #endif - appK2S.SetName( "kicad2step" ); + appK2S.SetName( wxT( "kicad2step" ) ); - wxString cmdK2S = "\""; + wxString cmdK2S = wxT( "\"" ); cmdK2S.Append( appK2S.GetFullPath() ); - cmdK2S.Append( "\"" ); + cmdK2S.Append( wxT( "\"" ) ); if( GetNoVirtOption() ) - cmdK2S.Append( " --no-virtual" ); + cmdK2S.Append( wxT( " --no-virtual" ) ); if( GetSubstOption() ) - cmdK2S.Append( " --subst-models" ); + cmdK2S.Append( wxT( " --subst-models" ) ); // Note: for some reason, using \" to insert a quote in a format string, under MacOS // wxString::Format does not work. So use a %c format in string @@ -399,11 +400,11 @@ void DIALOG_EXPORT_STEP::onExportButton( wxCommandEvent& aEvent ) break; case DIALOG_EXPORT_STEP::STEP_ORG_PLOT_AXIS: - cmdK2S.Append( " --drill-origin" ); + cmdK2S.Append( wxT( " --drill-origin" ) ); break; case DIALOG_EXPORT_STEP::STEP_ORG_GRID_AXIS: - cmdK2S.Append( " --grid-origin" ); + cmdK2S.Append( wxT( " --grid-origin" ) ); break; case DIALOG_EXPORT_STEP::STEP_ORG_USER: @@ -419,7 +420,8 @@ void DIALOG_EXPORT_STEP::onExportButton( wxCommandEvent& aEvent ) } LOCALE_IO dummy; - cmdK2S.Append( wxString::Format( " --user-origin=%c%.6f x %.6f%c", quote, xOrg, yOrg, quote ) ); + cmdK2S.Append( wxString::Format( wxT( " --user-origin=%c%.6f x %.6f%c" ), + quote, xOrg, yOrg, quote ) ); } break; @@ -429,20 +431,23 @@ void DIALOG_EXPORT_STEP::onExportButton( wxCommandEvent& aEvent ) xOrg = Iu2Millimeter( bbox.GetCenter().x ); yOrg = Iu2Millimeter( bbox.GetCenter().y ); LOCALE_IO dummy; - cmdK2S.Append( wxString::Format( " --user-origin=%c%.6f x %.6f%c", quote, xOrg, yOrg, quote ) ); + cmdK2S.Append( wxString::Format( wxT( " --user-origin=%c%.6f x %.6f%c" ), + quote, xOrg, yOrg, quote ) ); } break; } { LOCALE_IO dummy; - cmdK2S.Append( wxString::Format( " --min-distance=%c%.3f mm%c", quote, tolerance, quote ) ); + cmdK2S.Append( wxString::Format( wxT( " --min-distance=%c%.3f mm%c" ), + quote, tolerance, quote ) ); } - cmdK2S.Append( wxString::Format( " -f -o %c%s%c", quote, - m_filePickerSTEP->GetPath(), quote ) ); // input file path + cmdK2S.Append( wxString::Format( wxT( " -f -o %c%s%c" ), + quote, m_filePickerSTEP->GetPath(), quote ) ); // input file path - cmdK2S.Append( wxString::Format( " %c%s%c",quote, m_boardPath, quote ) ); // output file path + cmdK2S.Append( wxString::Format( wxT( " %c%s%c" ), + quote, m_boardPath, quote ) ); // output file path wxExecute( cmdK2S, wxEXEC_ASYNC | wxEXEC_SHOW_CONSOLE ); diff --git a/pcbnew/dialogs/dialog_export_vrml.cpp b/pcbnew/dialogs/dialog_export_vrml.cpp index abd582b0e3..e9c14913d4 100644 --- a/pcbnew/dialogs/dialog_export_vrml.cpp +++ b/pcbnew/dialogs/dialog_export_vrml.cpp @@ -197,7 +197,7 @@ void PCB_EDIT_FRAME::OnExportVRML( wxCommandEvent& event ) if( path.IsEmpty() ) { wxFileName brdFile = GetBoard()->GetFileName(); - brdFile.SetExt( "wrl" ); + brdFile.SetExt( wxT( "wrl" ) ); path = brdFile.GetFullPath(); } diff --git a/pcbnew/dialogs/dialog_footprint_wizard_list.cpp b/pcbnew/dialogs/dialog_footprint_wizard_list.cpp index 50b2bc18f0..f6efb74950 100644 --- a/pcbnew/dialogs/dialog_footprint_wizard_list.cpp +++ b/pcbnew/dialogs/dialog_footprint_wizard_list.cpp @@ -103,7 +103,7 @@ void DIALOG_FOOTPRINT_WIZARD_LIST::initLists() // Put all wizards in the list for( int ii = 0; ii < n_wizards; ii++ ) { - wxString num = wxString::Format( "%d", ii+1 ); + wxString num = wxString::Format( wxT( "%d" ), ii+1 ); FOOTPRINT_WIZARD *wizard = FOOTPRINT_WIZARD_LIST::GetWizard( ii ); wxString name = wizard->GetName(); wxString description = wizard->GetDescription(); diff --git a/pcbnew/dialogs/dialog_gencad_export_options.cpp b/pcbnew/dialogs/dialog_gencad_export_options.cpp index c5d88a1e3e..ba5ecb99f5 100644 --- a/pcbnew/dialogs/dialog_gencad_export_options.cpp +++ b/pcbnew/dialogs/dialog_gencad_export_options.cpp @@ -83,7 +83,7 @@ bool DIALOG_GENCAD_EXPORT_OPTIONS::GetOption( GENCAD_EXPORT_OPT aOption ) const if( it == m_options.end() ) { - wxASSERT_MSG( false, "Missing checkbox for an option" ); + wxASSERT_MSG( false, wxT( "Missing checkbox for an option" ) ); return false; } diff --git a/pcbnew/dialogs/dialog_gendrill.cpp b/pcbnew/dialogs/dialog_gendrill.cpp index bedfa6883f..e608c8fe65 100644 --- a/pcbnew/dialogs/dialog_gendrill.cpp +++ b/pcbnew/dialogs/dialog_gendrill.cpp @@ -220,7 +220,8 @@ void DIALOG_GENDRILL::onFileFormatSelection( wxCommandEvent& event ) else { m_staticTextPrecision->Enable( true ); - m_staticTextPrecision->SetLabel( m_plotOpts.GetGerberPrecision() == 6 ? "4.6" : "4.5" ); + m_staticTextPrecision->SetLabel( m_plotOpts.GetGerberPrecision() == 6 ? wxT( "4.6" ) + : wxT( "4.5" ) ); } } diff --git a/pcbnew/dialogs/dialog_global_deletion.cpp b/pcbnew/dialogs/dialog_global_deletion.cpp index 3b0f7be7e2..b0f6f745a4 100644 --- a/pcbnew/dialogs/dialog_global_deletion.cpp +++ b/pcbnew/dialogs/dialog_global_deletion.cpp @@ -254,7 +254,7 @@ void DIALOG_GLOBAL_DELETION::DoGlobalDeletions() } } - commit.Push( "Global delete" ); + commit.Push( wxT( "Global delete" ) ); if( m_delMarkers->GetValue() ) board->DeleteMARKERs(); diff --git a/pcbnew/dialogs/dialog_global_edit_text_and_graphics.cpp b/pcbnew/dialogs/dialog_global_edit_text_and_graphics.cpp index d6289ffe0d..fd2b292422 100644 --- a/pcbnew/dialogs/dialog_global_edit_text_and_graphics.cpp +++ b/pcbnew/dialogs/dialog_global_edit_text_and_graphics.cpp @@ -247,7 +247,7 @@ bool DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::TransferDataToWindow() attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER ); \ attr->SetReadOnly(); \ m_grid->SetAttr( aRow, aCol, attr ); \ - m_grid->SetCellValue( aRow, aCol, ( aValue ) ? "1" : "" ) + m_grid->SetCellValue( aRow, aCol, ( aValue ) ? wxT( "1" ) : wxT( "" ) ) const BOARD_DESIGN_SETTINGS& bds = m_parent->GetBoard()->GetDesignSettings(); wxGridCellAttr* attr; @@ -537,7 +537,7 @@ bool DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::TransferDataFromWindow() } } - commit.Push( "Edit text and graphics properties" ); + commit.Push( wxT( "Edit text and graphics properties" ) ); m_parent->GetCanvas()->Refresh(); return true; diff --git a/pcbnew/dialogs/dialog_imported_layers.cpp b/pcbnew/dialogs/dialog_imported_layers.cpp index bb880cebc2..8146f25b61 100644 --- a/pcbnew/dialogs/dialog_imported_layers.cpp +++ b/pcbnew/dialogs/dialog_imported_layers.cpp @@ -27,13 +27,13 @@ wxString DIALOG_IMPORTED_LAYERS::WrapRequired( const wxString& aLayerName ) { - return aLayerName + " *"; + return aLayerName + wxT( " *" ); } wxString DIALOG_IMPORTED_LAYERS::UnwrapRequired( const wxString& aLayerName ) { - if( !aLayerName.EndsWith( " *" ) ) + if( !aLayerName.EndsWith( wxT( " *" ) ) ) return aLayerName; return aLayerName.Left( aLayerName.Length() - 2 ); @@ -74,7 +74,7 @@ PCB_LAYER_ID DIALOG_IMPORTED_LAYERS::GetSelectedLayerID() // There should only be one selected (or none) as the list is set with wxLC_SINGLE_SEL style wxASSERT_MSG( ( m_kicad_layers_list->GetNextItem( itemIndex, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED ) ) == wxNOT_FOUND, - "There are more than one KiCad layer selected (unexpected)" ); + wxT( "There are more than one KiCad layer selected (unexpected)" ) ); for( int layer = 0; layer < PCB_LAYER_ID_COUNT; ++layer ) { @@ -313,7 +313,7 @@ std::vector DIALOG_IMPORTED_LAYERS::GetUnmappedRequiredLayers() const for( const wxString& layerName : m_unmatched_layer_names ) { const INPUT_LAYER_DESC* layerDesc = GetLayerDescription( layerName ); - wxASSERT_MSG( layerDesc != nullptr, "Expected to find layer description" ); + wxASSERT_MSG( layerDesc != nullptr, wxT( "Expected to find layer description" ) ); if( layerDesc->Required ) unmappedLayers.push_back( layerDesc->Name ); diff --git a/pcbnew/dialogs/dialog_net_inspector.cpp b/pcbnew/dialogs/dialog_net_inspector.cpp index fd8aafaec9..5ecd5c56a0 100644 --- a/pcbnew/dialogs/dialog_net_inspector.cpp +++ b/pcbnew/dialogs/dialog_net_inspector.cpp @@ -1007,7 +1007,7 @@ bool DIALOG_NET_INSPECTOR::netFilterMatches( NETINFO_ITEM* aNet ) const // Show unconnected nets only if specifically asked for by filter if( m_netFilter.empty() ) - return !aNet->GetNetname().StartsWith( "unconnected-(" ); + return !aNet->GetNetname().StartsWith( wxT( "unconnected-(" ) ); wxString net_str = UnescapeString( aNet->GetNetname() ).Upper(); @@ -1087,7 +1087,7 @@ void DIALOG_NET_INSPECTOR::updateDisplayedRowValues( const OPT& wxString DIALOG_NET_INSPECTOR::formatNetCode( const NETINFO_ITEM* aNet ) const { - return wxString::Format( "%.3d", aNet->GetNetCode() ); + return wxString::Format( wxT( "%.3d" ), aNet->GetNetCode() ); } @@ -1099,7 +1099,7 @@ wxString DIALOG_NET_INSPECTOR::formatNetName( const NETINFO_ITEM* aNet ) const wxString DIALOG_NET_INSPECTOR::formatCount( unsigned int aValue ) const { - return wxString::Format( "%u", aValue ); + return wxString::Format( wxT( "%u" ), aValue ); } @@ -1584,7 +1584,7 @@ void DIALOG_NET_INSPECTOR::buildNetsList() void DIALOG_NET_INSPECTOR::onFilterChange( wxCommandEvent& aEvent ) { - wxStringTokenizer filters( m_textCtrlFilter->GetValue().Upper(), "," ); + wxStringTokenizer filters( m_textCtrlFilter->GetValue().Upper(), wxT( "," ) ); m_netFilter.clear(); while( filters.HasMoreTokens() ) @@ -1600,7 +1600,7 @@ void DIALOG_NET_INSPECTOR::onFilterChange( wxCommandEvent& aEvent ) } } - wxStringTokenizer group_filters( m_groupByText->GetValue(), "," ); + wxStringTokenizer group_filters( m_groupByText->GetValue(), wxT( "," ) ); m_groupFilter.clear(); while( group_filters.HasMoreTokens() ) @@ -1718,15 +1718,15 @@ void DIALOG_NET_INSPECTOR::adjustListColumns() int w0, w1, w2, w3, w4, w5, w6, w7; dc.GetTextExtent( COLUMN_NET.display_name, &w0, &h ); - dc.GetTextExtent( "MMMMMMMMMMMMM", &minw_col1, &h ); + dc.GetTextExtent( wxT( "MMMMMMMMMMMMM" ), &minw_col1, &h ); dc.GetTextExtent( COLUMN_PAD_COUNT.display_name, &w2, &h ); dc.GetTextExtent( COLUMN_VIA_COUNT.display_name, &w3, &h ); dc.GetTextExtent( COLUMN_VIA_LENGTH.display_name, &w4, &h ); dc.GetTextExtent( COLUMN_BOARD_LENGTH.display_name, &w5, &h ); dc.GetTextExtent( COLUMN_CHIP_LENGTH.display_name, &w6, &h ); dc.GetTextExtent( COLUMN_TOTAL_LENGTH.display_name, &w7, &h ); - dc.GetTextExtent( "00000,000 mm", &minw, &h ); - dc.GetTextExtent( "00000", &minw_col0, &h ); + dc.GetTextExtent( wxT( "00000,000 mm" ), &minw, &h ); + dc.GetTextExtent( wxT( "00000" ), &minw_col0, &h ); // Considering left and right margins. // For wxRenderGeneric it is 5px. @@ -1842,7 +1842,7 @@ void DIALOG_NET_INSPECTOR::onRenameNet( wxCommandEvent& aEvent ) wxString netPath; wxString shortNetName; - if( fullNetName.Contains( "/" ) ) + if( fullNetName.Contains( wxT( "/" ) ) ) { netPath = fullNetName.BeforeLast( '/' ) + '/'; shortNetName = fullNetName.AfterLast( '/' ); @@ -2001,7 +2001,7 @@ void DIALOG_NET_INSPECTOR::onReport( wxCommandEvent& aEvent ) // Print Header: for( auto&& col : m_data_model->columnDesc() ) - txt += '"' + col.csv_name + "\";"; + txt += '"' + col.csv_name + wxT( "\";" ); f.AddLine( txt ); @@ -2020,7 +2020,7 @@ void DIALOG_NET_INSPECTOR::onReport( wxCommandEvent& aEvent ) for( auto&& col : m_data_model->columnDesc() ) { if( col.csv_flags & COLUMN_DESC::CSV_QUOTE ) - txt += '"' + m_data_model->valueAt( col.num, row ).GetString() + "\";"; + txt += '"' + m_data_model->valueAt( col.num, row ).GetString() + wxT( "\";" ); else txt += m_data_model->valueAt( col.num, row ).GetString() + ';'; } diff --git a/pcbnew/dialogs/dialog_pad_basicshapes_properties.cpp b/pcbnew/dialogs/dialog_pad_basicshapes_properties.cpp index f49cd165af..6cdc0bd549 100644 --- a/pcbnew/dialogs/dialog_pad_basicshapes_properties.cpp +++ b/pcbnew/dialogs/dialog_pad_basicshapes_properties.cpp @@ -294,7 +294,7 @@ bool DIALOG_PAD_PRIMITIVE_POLY_PROPS::TransferDataToWindow() for( unsigned row = 0; row < m_currPoints.size(); ++row ) { // Row label is "Corner x" - msg.Printf( "Corner %d", row+1 ); + msg.Printf( _( "Corner %d" ), row+1 ); m_gridCornersList->SetRowLabelValue( row, msg ); msg = StringFromValue( GetUserUnits(), m_currPoints[row].x, true ); diff --git a/pcbnew/dialogs/dialog_pad_properties.cpp b/pcbnew/dialogs/dialog_pad_properties.cpp index 7bd52bf451..6f3e6299dd 100644 --- a/pcbnew/dialogs/dialog_pad_properties.cpp +++ b/pcbnew/dialogs/dialog_pad_properties.cpp @@ -671,7 +671,7 @@ void DIALOG_PAD_PROPERTIES::initValues() // A small helper function, to display coordinates: static wxString formatCoord( EDA_UNITS aUnits, VECTOR2I aCoord ) { - return wxString::Format( "(X:%s Y:%s)", + return wxString::Format( wxT( "(X:%s Y:%s)" ), MessageTextFromValue( aUnits, aCoord.x ), MessageTextFromValue( aUnits, aCoord.y ) ); } @@ -731,13 +731,13 @@ void DIALOG_PAD_PROPERTIES::displayPrimitivesList() break; case SHAPE_T::POLY: - bs_info[0] = "Polygon"; + bs_info[0] = _( "Polygon" ); bs_info[1] = wxString::Format( _( "corners count %d" ), primitive->GetPolyShape().Outline( 0 ).PointCount() ); break; default: - bs_info[0] = "Unknown primitive"; + bs_info[0] = _( "Unknown primitive" ); break; } @@ -1877,7 +1877,7 @@ bool DIALOG_PAD_PROPERTIES::transferDataToPad( PAD* aPad ) break; default: - wxFAIL_MSG( "DIALOG_PAD_PROPERTIES::transferDataToPad: unknown pad type" ); + wxFAIL_MSG( wxT( "DIALOG_PAD_PROPERTIES::transferDataToPad: unknown pad type" ) ); break; } diff --git a/pcbnew/dialogs/dialog_pad_properties.h b/pcbnew/dialogs/dialog_pad_properties.h index 39e4e3a1cd..bee102dbd1 100644 --- a/pcbnew/dialogs/dialog_pad_properties.h +++ b/pcbnew/dialogs/dialog_pad_properties.h @@ -45,7 +45,7 @@ * created by wxFormBuilder */ // The wxWidgets window name. Used to retrieve the dialog by window name -#define PAD_PROPERTIES_DLG_NAME "pad_properties_dlg_name" +#define PAD_PROPERTIES_DLG_NAME wxT( "pad_properties_dlg_name" ) class DIALOG_PAD_PROPERTIES : public DIALOG_PAD_PROPERTIES_BASE { diff --git a/pcbnew/dialogs/dialog_plot.cpp b/pcbnew/dialogs/dialog_plot.cpp index d5c9d417ce..88f240eb49 100644 --- a/pcbnew/dialogs/dialog_plot.cpp +++ b/pcbnew/dialogs/dialog_plot.cpp @@ -925,7 +925,7 @@ void DIALOG_PLOT::Plot( wxCommandEvent& event ) // Pick the basename from the board file wxFileName fn( boardFilename ); // Build gerber job file from basename - BuildPlotFileName( &fn, outputDir.GetPath(), "job", GerberJobFileExtension ); + BuildPlotFileName( &fn, outputDir.GetPath(), wxT( "job" ), GerberJobFileExtension ); jobfile_writer.CreateJobFile( fn.GetFullPath() ); } diff --git a/pcbnew/dialogs/dialog_plot.h b/pcbnew/dialogs/dialog_plot.h index e23aa4c07d..6803b442b4 100644 --- a/pcbnew/dialogs/dialog_plot.h +++ b/pcbnew/dialogs/dialog_plot.h @@ -31,7 +31,7 @@ #include // the plot dialog window name, used by wxWidgets -#define DLG_WINDOW_NAME "plot_dialog-window" +#define DLG_WINDOW_NAME wxT( "plot_dialog-window" ) /** * A dialog to set the plot options and create plot files in various formats. diff --git a/pcbnew/dialogs/dialog_position_relative.cpp b/pcbnew/dialogs/dialog_position_relative.cpp index 87e97ea86e..a01b52f687 100644 --- a/pcbnew/dialogs/dialog_position_relative.cpp +++ b/pcbnew/dialogs/dialog_position_relative.cpp @@ -252,7 +252,7 @@ void DIALOG_POSITION_RELATIVE::UpdateAnchor( EDA_ITEM* aItem ) reference = item->GetSelectMenuText( GetUserUnits() ); } - m_referenceInfo->SetLabel( wxString::Format( "Reference item: %s", reference ) ); + m_referenceInfo->SetLabel( wxString::Format( _( "Reference item: %s" ), reference ) ); Show( true ); } diff --git a/pcbnew/dialogs/dialog_text_properties.cpp b/pcbnew/dialogs/dialog_text_properties.cpp index 8bcc0d4579..44a6164c03 100644 --- a/pcbnew/dialogs/dialog_text_properties.cpp +++ b/pcbnew/dialogs/dialog_text_properties.cpp @@ -160,7 +160,7 @@ DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES( PCB_BASE_EDIT_FRAME* aParent, BO double rot_list[] = { 0.0, 90.0, -90.0, 180.0 }; for( size_t ii = 0; ii < m_OrientCtrl->GetCount() && ii < 4; ++ii ) - m_OrientCtrl->SetString( ii, wxString::Format( "%.1f", rot_list[ii] ) ); + m_OrientCtrl->SetString( ii, wxString::Format( wxT( "%.1f" ), rot_list[ii] ) ); // Set font sizes m_statusLine->SetFont( KIUI::GetInfoFont( this ) ); @@ -382,11 +382,11 @@ bool DIALOG_TEXT_PROPERTIES::TransferDataFromWindow() #ifdef __WXMAC__ // On macOS CTRL+Enter produces '\r' instead of '\n' regardless of EOL setting. // Replace it now. - txt.Replace( "\r", "\n" ); + txt.Replace( wxT( "\r" ), wxT( "\n" ) ); #elif defined( __WINDOWS__ ) // On Windows, a new line is coded as \r\n. We use only \n in kicad files and in // drawing routines so strip the \r char. - txt.Replace( "\r", "" ); + txt.Replace( wxT( "\r" ), wxT( "" ) ); #endif m_edaText->SetText( EscapeString( txt, CTX_QUOTED_STR ) ); } diff --git a/pcbnew/dialogs/dialog_track_via_properties.cpp b/pcbnew/dialogs/dialog_track_via_properties.cpp index 594649e742..1a0521aa37 100644 --- a/pcbnew/dialogs/dialog_track_via_properties.cpp +++ b/pcbnew/dialogs/dialog_track_via_properties.cpp @@ -307,7 +307,8 @@ DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES( PCB_BASE_FRAME* aParen { VIA_DIMENSION* viaDimension = &aParent->GetDesignSettings().m_ViasDimensionsList[ii]; wxString msg = StringFromValue( m_frame->GetUserUnits(), viaDimension->m_Diameter ) - + " / " + StringFromValue( m_frame->GetUserUnits(), viaDimension->m_Drill ); + + wxT( " / " ) + + StringFromValue( m_frame->GetUserUnits(), viaDimension->m_Drill ); m_DesignRuleViasCtrl->Append( msg, viaDimension ); if( viaSelection == wxNOT_FOUND @@ -405,7 +406,8 @@ void DIALOG_TRACK_VIA_PROPERTIES::onUnitsChanged( wxCommandEvent& aEvent ) { VIA_DIMENSION* viaDimension = &m_frame->GetDesignSettings().m_ViasDimensionsList[ii]; wxString msg = StringFromValue( m_frame->GetUserUnits(), viaDimension->m_Diameter ) - + " / " + StringFromValue( m_frame->GetUserUnits(), viaDimension->m_Drill ); + + wxT( " / " ) + + StringFromValue( m_frame->GetUserUnits(), viaDimension->m_Drill ); m_DesignRuleViasCtrl->Append( msg, viaDimension ); } @@ -618,7 +620,7 @@ bool DIALOG_TRACK_VIA_PROPERTIES::TransferDataFromWindow() switch( v->GetViaType() ) { default: - wxFAIL_MSG( "Unhandled via type" ); + wxFAIL_MSG( wxT( "Unhandled via type" ) ); KI_FALLTHROUGH; case VIATYPE::THROUGH: diff --git a/pcbnew/dialogs/panel_fp_editor_defaults.cpp b/pcbnew/dialogs/panel_fp_editor_defaults.cpp index 31f5ec4de5..302cd62c9d 100644 --- a/pcbnew/dialogs/panel_fp_editor_defaults.cpp +++ b/pcbnew/dialogs/panel_fp_editor_defaults.cpp @@ -242,7 +242,7 @@ void PANEL_FP_EDITOR_DEFAULTS::loadFPSettings( FOOTPRINT_EDITOR_SETTINGS* aCfg ) SET_MILS_CELL( i, COL_TEXT_WIDTH, aCfg->m_DesignSettings.m_TextSize[ i ].x ); SET_MILS_CELL( i, COL_TEXT_HEIGHT, aCfg->m_DesignSettings.m_TextSize[ i ].y ); SET_MILS_CELL( i, COL_TEXT_THICKNESS, aCfg->m_DesignSettings.m_TextThickness[ i ] ); - m_graphicsGrid->SetCellValue( i, COL_TEXT_ITALIC, aCfg->m_DesignSettings.m_TextItalic[ i ] ? "1" : "" ); + m_graphicsGrid->SetCellValue( i, COL_TEXT_ITALIC, aCfg->m_DesignSettings.m_TextItalic[ i ] ? wxT( "1" ) : wxT( "" ) ); auto attr = new wxGridCellAttr; attr->SetRenderer( new wxGridCellBoolRenderer() ); diff --git a/pcbnew/dialogs/panel_fp_lib_table.cpp b/pcbnew/dialogs/panel_fp_lib_table.cpp index 64df20bbd5..49fc1fc802 100644 --- a/pcbnew/dialogs/panel_fp_lib_table.cpp +++ b/pcbnew/dialogs/panel_fp_lib_table.cpp @@ -108,8 +108,8 @@ static const std::map& fileTypes() { { ID_PANEL_FPLIB_ADD_KICADMOD, { - "KiCad (folder with .kicad_mod files)", "", KiCadFootprintFileExtension, - false, IO_MGR::KICAD_SEXP + wxT( "KiCad (folder with .kicad_mod files)" ), wxT( "" ), + KiCadFootprintFileExtension, false, IO_MGR::KICAD_SEXP } }, { ID_PANEL_FPLIB_ADD_ALTIUM, @@ -119,18 +119,20 @@ static const std::map& fileTypes() }, { ID_PANEL_FPLIB_ADD_EAGLE6, { - "Eagle 6.x (*.lbr)", EagleFootprintLibPathWildcard(), "", true, IO_MGR::EAGLE + wxT( "Eagle 6.x (*.lbr)" ), EagleFootprintLibPathWildcard(), wxT( "" ), + true, IO_MGR::EAGLE } }, { ID_PANEL_FPLIB_ADD_KICADLEGACY, { - "KiCad legacy (*.mod)", LegacyFootprintLibPathWildcard(), "", true, IO_MGR::LEGACY + wxT( "KiCad legacy (*.mod)" ), LegacyFootprintLibPathWildcard(), wxT( "" ), + true, IO_MGR::LEGACY } }, { ID_PANEL_FPLIB_ADD_GEDA, { - "Geda (folder with *.fp files)", "", GedaPcbFootprintLibFileExtension, false, - IO_MGR::GEDA_PCB + wxT( "Geda (folder with *.fp files)" ), wxT( "" ), + GedaPcbFootprintLibFileExtension, false, IO_MGR::GEDA_PCB } }, }; @@ -318,7 +320,7 @@ protected: // paste the FP_LIB_TABLE_ROWs of s-expression (fp_lib_table), starting // at column 0 regardless of current cursor column. - STRING_LINE_READER slr( TO_UTF8( cb_text ), "Clipboard" ); + STRING_LINE_READER slr( TO_UTF8( cb_text ), wxT( "Clipboard" ) ); LIB_TABLE_LEXER lexer( &slr ); FP_LIB_TABLE tmp_tbl; bool parsed = true; @@ -545,8 +547,8 @@ bool PANEL_FP_LIB_TABLE::verifyTables() wxYES_NO | wxCENTER | wxICON_QUESTION | wxYES_DEFAULT ); badCellDlg.SetExtendedMessage( _( "Empty cells will result in all rows that are " "invalid to be removed from the table." ) ); - badCellDlg.SetYesNoLabels( wxMessageDialog::ButtonLabel( "Remove Invalid Cells" ), - wxMessageDialog::ButtonLabel( "Cancel Table Update" ) ); + badCellDlg.SetYesNoLabels( wxMessageDialog::ButtonLabel( _( "Remove Invalid Cells" ) ), + wxMessageDialog::ButtonLabel( _( "Cancel Table Update" ) ) ); if( badCellDlg.ShowModal() == wxID_NO ) return false; @@ -790,7 +792,8 @@ void PANEL_FP_LIB_TABLE::browseLibrariesHandler( wxCommandEvent& event ) if( fileTypeIt == fileTypes().end() ) { - wxLogWarning( "File type selection event received but could not find the file type in the table" ); + wxLogWarning( wxT( "File type selection event received but could not find the file type " + "in the table" ) ); return; } @@ -863,7 +866,7 @@ void PANEL_FP_LIB_TABLE::browseLibrariesHandler( wxCommandEvent& event ) wxString detailedMsg = _( "The following directories could not be opened: \n" ); for( const wxString& path : failedDirs ) - detailedMsg << path << "\n"; + detailedMsg << path << wxT( "\n" ); DisplayErrorMessage( this, _( "Failed to open directories to look for libraries" ), detailedMsg ); @@ -930,7 +933,7 @@ void PANEL_FP_LIB_TABLE::browseLibrariesHandler( wxCommandEvent& event ) // Do not use the project path in the global library table. This will almost // assuredly be wrong for a different project. - if( m_pageNdx == 0 && path.Contains( "${KIPRJMOD}" ) ) + if( m_pageNdx == 0 && path.Contains( wxT( "${KIPRJMOD}" ) ) ) path = fn.GetFullPath(); m_cur_grid->SetCellValue( last_row, COL_URI, path ); diff --git a/pcbnew/dialogs/panel_fp_properties_3d_model.cpp b/pcbnew/dialogs/panel_fp_properties_3d_model.cpp index 84d0012244..ac8ff6180f 100644 --- a/pcbnew/dialogs/panel_fp_properties_3d_model.cpp +++ b/pcbnew/dialogs/panel_fp_properties_3d_model.cpp @@ -84,7 +84,7 @@ PANEL_FP_PROPERTIES_3D_MODEL::PANEL_FP_PROPERTIES_3D_MODEL( // Filename attr = new wxGridCellAttr; attr->SetEditor( new GRID_CELL_PATH_EDITOR( m_parentDialog, m_modelsGrid, &cfg->m_lastFootprint3dDir, - "*.*", true, m_frame->Prj().GetProjectPath() ) ); + wxT( "*.*" ), true, m_frame->Prj().GetProjectPath() ) ); m_modelsGrid->SetColAttr( COL_FILENAME, attr ); // Show checkbox @@ -217,9 +217,9 @@ void PANEL_FP_PROPERTIES_3D_MODEL::On3DModelCellChanged( wxGridEvent& aEvent ) // Perform cleanup and validation on the filename if it isn't empty if( !filename.empty() ) { - filename.Replace( "\n", "" ); - filename.Replace( "\r", "" ); - filename.Replace( "\t", "" ); + filename.Replace( wxT( "\n" ), wxT( "" ) ); + filename.Replace( wxT( "\r" ), wxT( "" ) ); + filename.Replace( wxT( "\t" ), wxT( "" ) ); res->ValidateFileName( filename, hasAlias ); @@ -289,7 +289,7 @@ void PANEL_FP_PROPERTIES_3D_MODEL::OnAdd3DModel( wxCommandEvent& ) // variable and fall back to the project path if necessary. if( initialpath.IsEmpty() ) { - if( !wxGetEnv( "KICAD6_3DMODEL_DIR", &initialpath ) || initialpath.IsEmpty() ) + if( !wxGetEnv( wxT( "KICAD6_3DMODEL_DIR" ), &initialpath ) || initialpath.IsEmpty() ) initialpath = prj.GetProjectPath(); } @@ -323,7 +323,7 @@ void PANEL_FP_PROPERTIES_3D_MODEL::OnAdd3DModel( wxCommandEvent& ) #ifdef __WINDOWS__ // In KiCad files, filenames and paths are stored using Unix notation - model.m_Filename.Replace( "\\", "/" ); + model.m_Filename.Replace( wxT( "\\" ), wxT( "/" ) ); #endif model.m_Show = true; diff --git a/pcbnew/dialogs/panel_pcbnew_color_settings.cpp b/pcbnew/dialogs/panel_pcbnew_color_settings.cpp index d68a8620b5..7ba0d456ab 100644 --- a/pcbnew/dialogs/panel_pcbnew_color_settings.cpp +++ b/pcbnew/dialogs/panel_pcbnew_color_settings.cpp @@ -482,7 +482,7 @@ void PANEL_PCBNEW_COLOR_SETTINGS::createPreviewItems() m_page->SetHeightMils( 5000 ); m_page->SetWidthMils( 6000 ); - STRING_LINE_READER reader( g_previewBoard, "preview" ); + STRING_LINE_READER reader( g_previewBoard, wxT( "preview" ) ); PCB_PLUGIN pi; try diff --git a/pcbnew/dialogs/panel_setup_layers.cpp b/pcbnew/dialogs/panel_setup_layers.cpp index 2adf5f1b29..6da40c5750 100644 --- a/pcbnew/dialogs/panel_setup_layers.cpp +++ b/pcbnew/dialogs/panel_setup_layers.cpp @@ -459,7 +459,7 @@ bool PANEL_SETUP_LAYERS::TransferDataFromWindow() if( !notremovableLayers.empty() ) { for( unsigned int ii = 0; ii < notremovableLayers.size(); ii++ ) - msg << m_pcb->GetLayerName( notremovableLayers[ii] ) << "\n"; + msg << m_pcb->GetLayerName( notremovableLayers[ii] ) << wxT( "\n" ); if( !IsOK( this, wxString::Format( _( "Footprints have some items on removed layers:\n" "%s\n" diff --git a/pcbnew/dialogs/panel_setup_rules.cpp b/pcbnew/dialogs/panel_setup_rules.cpp index 25ad75537c..dbcd2d5552 100644 --- a/pcbnew/dialogs/panel_setup_rules.cpp +++ b/pcbnew/dialogs/panel_setup_rules.cpp @@ -181,7 +181,7 @@ void PANEL_SETUP_RULES::onScintillaCharAdded( wxStyledTextEvent &aEvent ) int lineStart = m_textEditor->PositionFromLine( line ); wxString beginning = m_textEditor->GetTextRange( lineStart, lineStart + 10 ); - if( beginning.StartsWith( "(rule " ) ) + if( beginning.StartsWith( wxT( "(rule " ) ) ) { startPos = lineStart; break; @@ -201,15 +201,15 @@ void PANEL_SETUP_RULES::onScintillaCharAdded( wxStyledTextEvent &aEvent ) auto isDisallowToken = []( const wxString& token ) -> bool { - return token == "buried_via" - || token == "graphic" - || token == "hole" - || token == "micro_via" - || token == "pad" - || token == "text" - || token == "track" - || token == "via" - || token == "zone"; + return token == wxT( "buried_via" ) + || token == wxT( "graphic" ) + || token == wxT( "hole" ) + || token == wxT( "micro_via" ) + || token == wxT( "pad" ) + || token == wxT( "text" ) + || token == wxT( "track" ) + || token == wxT( "via" ) + || token == wxT( "zone" ); }; std::stack sexprs; @@ -277,11 +277,11 @@ void PANEL_SETUP_RULES::onScintillaCharAdded( wxStyledTextEvent &aEvent ) } else if( c == ')' ) { - while( !sexprs.empty() && ( sexprs.top() == "assertion" - || sexprs.top() == "disallow" + while( !sexprs.empty() && ( sexprs.top() == wxT( "assertion" ) + || sexprs.top() == wxT( "disallow" ) || isDisallowToken( sexprs.top() ) - || sexprs.top() == "min_resolved_spokes" - || sexprs.top() == "zone_connection" ) ) + || sexprs.top() == wxT( "min_resolved_spokes" ) + || sexprs.top() == wxT( "zone_connection" ) ) ) { sexprs.pop(); } @@ -293,10 +293,10 @@ void PANEL_SETUP_RULES::onScintillaCharAdded( wxStyledTextEvent &aEvent ) } else if( c == ' ' ) { - if( context == SEXPR_OPEN && ( partial == "constraint" - || partial == "disallow" - || partial == "layer" - || partial == "severity" ) ) + if( context == SEXPR_OPEN && ( partial == wxT( "constraint" ) + || partial == wxT( "disallow" ) + || partial == wxT( "layer" ) + || partial == wxT( "severity" ) ) ) { m_textEditor->AutoCompCancel(); sexprs.push( partial ); @@ -305,10 +305,10 @@ void PANEL_SETUP_RULES::onScintillaCharAdded( wxStyledTextEvent &aEvent ) context = SEXPR_TOKEN; continue; } - else if( partial == "disallow" + else if( partial == wxT( "disallow" ) || isDisallowToken( partial ) - || partial == "min_resolved_spokes" - || partial == "zone_connection" ) + || partial == wxT( "min_resolved_spokes" ) + || partial == wxT( "zone_connection" ) ) { m_textEditor->AutoCompCancel(); sexprs.push( partial ); @@ -317,9 +317,9 @@ void PANEL_SETUP_RULES::onScintillaCharAdded( wxStyledTextEvent &aEvent ) context = SEXPR_TOKEN; continue; } - else if( partial == "rule" - || partial == "assertion" - || partial == "condition" ) + else if( partial == wxT( "rule" ) + || partial == wxT( "assertion" ) + || partial == wxT( "condition" ) ) { m_textEditor->AutoCompCancel(); sexprs.push( partial ); @@ -343,19 +343,19 @@ void PANEL_SETUP_RULES::onScintillaCharAdded( wxStyledTextEvent &aEvent ) { if( sexprs.empty() ) { - tokens = "rule|" - "version"; + tokens = wxT( "rule|" + "version" ); } - else if( sexprs.top() == "rule" ) + else if( sexprs.top() == wxT( "rule" ) ) { - tokens = "condition|" - "constraint|" - "layer|" - "severity"; + tokens = wxT( "condition|" + "constraint|" + "layer|" + "severity" ); } - else if( sexprs.top() == "constraint" ) + else if( sexprs.top() == wxT( "constraint" ) ) { - tokens = "max|min|opt"; + tokens = wxT( "max|min|opt" ); } } else if( context == SEXPR_TOKEN ) @@ -364,70 +364,70 @@ void PANEL_SETUP_RULES::onScintillaCharAdded( wxStyledTextEvent &aEvent ) { /* badly formed grammar */ } - else if( sexprs.top() == "constraint" ) + else if( sexprs.top() == wxT( "constraint" ) ) { - tokens = "annular_width|" - "assertion|" - "clearance|" - "courtyard_clearance|" - "diff_pair_gap|" - "diff_pair_uncoupled|" - "disallow|" - "edge_clearance|" - "length|" - "hole_clearance|" - "hole_size|" - "hole_to_hole|" - "mechanical_clearance|" - "mechanical_hole_clearance|" - "min_resolved_spokes|" - "silk_clearance|" - "skew|" - "text_height|" - "text_thickness|" - "thermal_relief_gap|" - "thermal_spoke_width|" - "track_width|" - "via_count|" - "via_diameter|" - "zone_connection"; + tokens = wxT( "annular_width|" + "assertion|" + "clearance|" + "courtyard_clearance|" + "diff_pair_gap|" + "diff_pair_uncoupled|" + "disallow|" + "edge_clearance|" + "length|" + "hole_clearance|" + "hole_size|" + "hole_to_hole|" + "mechanical_clearance|" + "mechanical_hole_clearance|" + "min_resolved_spokes|" + "silk_clearance|" + "skew|" + "text_height|" + "text_thickness|" + "thermal_relief_gap|" + "thermal_spoke_width|" + "track_width|" + "via_count|" + "via_diameter|" + "zone_connection" ); } - else if( sexprs.top() == "disallow" || isDisallowToken( sexprs.top() ) ) + else if( sexprs.top() == wxT( "disallow" ) || isDisallowToken( sexprs.top() ) ) { - tokens = "buried_via|" - "graphic|" - "hole|" - "micro_via|" - "pad|" - "text|" - "track|" - "via|" - "zone"; + tokens = wxT( "buried_via|" + "graphic|" + "hole|" + "micro_via|" + "pad|" + "text|" + "track|" + "via|" + "zone" ); } - else if( sexprs.top() == "zone_connection" ) + else if( sexprs.top() == wxT( "zone_connection" ) ) { - tokens = "none|solid|thermal_relief"; + tokens = wxT( "none|solid|thermal_relief" ); } - else if( sexprs.top() == "min_resolved_spokes" ) + else if( sexprs.top() == wxT( "min_resolved_spokes" ) ) { - tokens = "0|1|2|3|4"; + tokens = wxT( "0|1|2|3|4" ); } - else if( sexprs.top() == "layer" ) + else if( sexprs.top() == wxT( "layer" ) ) { - tokens = "inner|outer|\"x\""; + tokens = wxT( "inner|outer|\"x\"" ); } - else if( sexprs.top() == "severity" ) + else if( sexprs.top() == wxT( "severity" ) ) { - tokens = "warning|error|ignore|exclusion"; + tokens = wxT( "warning|error|ignore|exclusion" ); } } else if( context == SEXPR_STRING && !sexprs.empty() - && ( sexprs.top() == "condition" || sexprs.top() == "assertion" ) ) + && ( sexprs.top() == wxT( "condition" ) || sexprs.top() == wxT( "assertion" ) ) ) { - m_textEditor->AddText( "\"" ); + m_textEditor->AddText( wxT( "\"" ) ); } else if( context == STRING && !sexprs.empty() - && ( sexprs.top() == "condition" || sexprs.top() == "assertion" ) ) + && ( sexprs.top() == wxT( "condition" ) || sexprs.top() == wxT( "assertion" ) ) ) { if( expr_context == STRUCT_REF ) { @@ -441,18 +441,18 @@ void PANEL_SETUP_RULES::onScintillaCharAdded( wxStyledTextEvent &aEvent ) for( PROPERTY_BASE* prop : props ) { wxString ref( prop->Name() ); - ref.Replace( " ", "_" ); + ref.Replace( wxT( " " ), wxT( "_" ) ); propNames.insert( ref ); } } for( const wxString& propName : propNames ) - tokens += "|" + propName; + tokens += wxT( "|" ) + propName; PCB_EXPR_BUILTIN_FUNCTIONS& functions = PCB_EXPR_BUILTIN_FUNCTIONS::Instance(); for( const wxString& funcSig : functions.GetSignatures() ) - tokens += "|" + funcSig; + tokens += wxT( "|" ) + funcSig; } else if( expr_context == STRING ) { @@ -462,60 +462,60 @@ void PANEL_SETUP_RULES::onScintillaCharAdded( wxStyledTextEvent &aEvent ) BOARD_DESIGN_SETTINGS& bds = board->GetDesignSettings(); for( const std::pair& entry : bds.GetNetClasses() ) - tokens += "|" + entry.first; + tokens += wxT( "|" ) + entry.first; } else if( m_netNameRegex.Matches( last ) ) { BOARD* board = m_frame->GetBoard(); for( const wxString& netnameCandidate : board->GetNetClassAssignmentCandidates() ) - tokens += "|" + netnameCandidate; + tokens += wxT( "|" ) + netnameCandidate; } else if( m_typeRegex.Matches( last ) ) { - tokens = "Dimension|" - "Footprint|" - "Graphic|" - "Group|" - "Leader|" - "Pad|" - "Target|" - "Text|" - "Track|" - "Via|" - "Zone"; + tokens = wxT( "Dimension|" + "Footprint|" + "Graphic|" + "Group|" + "Leader|" + "Pad|" + "Target|" + "Text|" + "Track|" + "Via|" + "Zone" ); } else if( m_padTypeRegex.Matches( last ) ) { - tokens = "Through-hole|" - "SMD|" - "Edge connector|" - "NPTH, mechanical"; + tokens = wxT( "Through-hole|" + "SMD|" + "Edge connector|" + "NPTH, mechanical" ); } else if( m_pinTypeRegex.Matches( last ) ) { - tokens = "Input|" - "Output|" - "Bidirectional|" - "Tri-state|" - "Passive|" - "Free|" - "Unspecified|" - "Power input|" - "Power output|" - "Open collector|" - "Open emitter|" - "Unconnected"; + tokens = wxT( "Input|" + "Output|" + "Bidirectional|" + "Tri-state|" + "Passive|" + "Free|" + "Unspecified|" + "Power input|" + "Power output|" + "Open collector|" + "Open emitter|" + "Unconnected" ); } else if( m_fabPropRegex.Matches( last ) ) { - tokens = "None|" - "BGA pad|" - "Fiducial, global to board|" - "Fiducial, local to footprint|" - "Test point pad|" - "Heatsink pad|" - "Castellated pad"; + tokens = wxT( "None|" + "BGA pad|" + "Fiducial, global to board|" + "Fiducial, local to footprint|" + "Test point pad|" + "Heatsink pad|" + "Castellated pad" ); } } } @@ -539,7 +539,7 @@ void PANEL_SETUP_RULES::OnCompile( wxCommandEvent& event ) } catch( PARSE_ERROR& pe ) { - wxString msg = wxString::Format( "%s %s%s", + wxString msg = wxString::Format( wxT( "%s %s%s" ), _( "ERROR:" ), pe.lineNumber, pe.byteIndex, @@ -651,7 +651,7 @@ void PANEL_SETUP_RULES::OnSyntaxHelp( wxHyperlinkEvent& aEvent ) ; #ifdef __WXMAC__ - msg.Replace( "Ctrl+", "Cmd+" ); + msg.Replace( wxT( "Ctrl+" ), wxT( "Cmd+" ) ); #endif m_helpWindow = new HTML_MESSAGE_BOX( nullptr, _( "Syntax Help" ) ); diff --git a/pcbnew/dialogs/panel_setup_text_and_graphics.cpp b/pcbnew/dialogs/panel_setup_text_and_graphics.cpp index 9f6a04ddb2..d239c46293 100644 --- a/pcbnew/dialogs/panel_setup_text_and_graphics.cpp +++ b/pcbnew/dialogs/panel_setup_text_and_graphics.cpp @@ -76,7 +76,7 @@ PANEL_SETUP_TEXT_AND_GRAPHICS::PANEL_SETUP_TEXT_AND_GRAPHICS( PAGED_DIALOG* aPar // Gives a suitable size to m_grid columns // The default wxWidget col size is not very good // Calculate a min best size to handle longest usual numeric values: - int min_best_width = m_grid->GetTextExtent( "555,555555 mils" ).x; + int min_best_width = m_grid->GetTextExtent( wxT( "555,555555 mils" ) ).x; for( int i = 0; i < m_grid->GetNumberCols(); ++i ) { @@ -148,8 +148,8 @@ bool PANEL_SETUP_TEXT_AND_GRAPHICS::TransferDataToWindow() SET_MILS_CELL( i, COL_TEXT_WIDTH, m_BrdSettings->m_TextSize[ i ].x ); SET_MILS_CELL( i, COL_TEXT_HEIGHT, m_BrdSettings->m_TextSize[ i ].y ); SET_MILS_CELL( i, COL_TEXT_THICKNESS, m_BrdSettings->m_TextThickness[ i ] ); - m_grid->SetCellValue( i, COL_TEXT_ITALIC, m_BrdSettings->m_TextItalic[ i ] ? "1" : "" ); - m_grid->SetCellValue( i, COL_TEXT_UPRIGHT, m_BrdSettings->m_TextUpright[ i ] ? "1" : "" ); + m_grid->SetCellValue( i, COL_TEXT_ITALIC, m_BrdSettings->m_TextItalic[ i ] ? wxT( "1" ) : wxT( "" ) ); + m_grid->SetCellValue( i, COL_TEXT_UPRIGHT, m_BrdSettings->m_TextUpright[ i ] ? wxT( "1" ) : wxT( "" ) ); auto attr = new wxGridCellAttr; attr->SetRenderer( new wxGridCellBoolRenderer() ); @@ -173,7 +173,8 @@ bool PANEL_SETUP_TEXT_AND_GRAPHICS::TransferDataToWindow() Layout(); - wxASSERT_MSG( m_BrdSettings->m_DimensionPrecision <= 4, "Unhandled dimension precision!" ); + wxASSERT_MSG( m_BrdSettings->m_DimensionPrecision <= 4, + wxT( "Unhandled dimension precision!" ) ); int mode = static_cast( m_BrdSettings->m_DimensionUnitsMode ); m_dimensionUnits->SetSelection( mode ); diff --git a/pcbnew/dialogs/panel_setup_tracks_and_vias.cpp b/pcbnew/dialogs/panel_setup_tracks_and_vias.cpp index e19de1f454..4b69f14507 100644 --- a/pcbnew/dialogs/panel_setup_tracks_and_vias.cpp +++ b/pcbnew/dialogs/panel_setup_tracks_and_vias.cpp @@ -86,7 +86,7 @@ PANEL_SETUP_TRACKS_AND_VIAS::PANEL_SETUP_TRACKS_AND_VIAS( PAGED_DIALOG* aParent, // Ensure width of columns is enough to enter any reasonable value WX_GRID* grid_list[] = { m_trackWidthsGrid, m_viaSizesGrid, m_diffPairsGrid, nullptr }; - int min_linesize = m_trackWidthsGrid->GetTextExtent( "000.000000 mm " ).x; + int min_linesize = m_trackWidthsGrid->GetTextExtent( wxT( "000.000000 mm " ) ).x; for( int ii = 0; grid_list[ii]; ii++ ) { diff --git a/pcbnew/edit_zone_helpers.cpp b/pcbnew/edit_zone_helpers.cpp index 2b9241cbf8..2a5222cbcb 100644 --- a/pcbnew/edit_zone_helpers.cpp +++ b/pcbnew/edit_zone_helpers.cpp @@ -115,7 +115,7 @@ void PCB_EDIT_FRAME::Edit_Zone_Params( ZONE* aZone ) if( zone == nullptr ) { - wxASSERT_MSG( false, "Expected a zone after zone properties edit" ); + wxASSERT_MSG( false, wxT( "Expected a zone after zone properties edit" ) ); continue; } diff --git a/pcbnew/files.cpp b/pcbnew/files.cpp index 6048b8815d..6fa160f132 100644 --- a/pcbnew/files.cpp +++ b/pcbnew/files.cpp @@ -142,7 +142,7 @@ bool AskLoadBoardFileName( PCB_EDIT_FRAME* aParent, int* aCtl, wxString* aFileNa } fileFilters = _( "All KiCad Board Files" ) + AddFileExtListToFilter( fileExtensions ) - + "|" + fileFilters; + + wxT( "|" ) + fileFilters; } else { @@ -157,11 +157,10 @@ bool AskLoadBoardFileName( PCB_EDIT_FRAME* aParent, int* aCtl, wxString* aFileNa PLUGIN::RELEASER plugin( IO_MGR::PluginFind( loaders[ii].pluginType ) ); wxCHECK( plugin, false ); - allWildcards += "*." + formatWildcardExt( plugin->GetFileExtension() ) + ";"; + allWildcards += wxT( "*." ) + formatWildcardExt( plugin->GetFileExtension() ) + wxT( ";" ); } - fileFilters = _( "All supported formats|" ) + allWildcards - + "|" + fileFilters; + fileFilters = _( "All supported formats|" ) + allWildcards + wxT( "|" ) + fileFilters; } @@ -751,7 +750,7 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector& aFileSet, in SetBoard( loadedBoard, false, &progressReporter ); if( GFootprintList.GetCount() == 0 ) - GFootprintList.ReadCacheFromFile( Prj().GetProjectPath() + "fp-info-cache" ); + GFootprintList.ReadCacheFromFile( Prj().GetProjectPath() + wxT( "fp-info-cache" ) ); if( loadedBoard->m_LegacyDesignSettingsLoaded ) { @@ -798,7 +797,7 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector& aFileSet, in if( ( pluginType == IO_MGR::LEGACY ) || ( pluginType == IO_MGR::KICAD_SEXP && loadedBoard->GetFileFormatVersionAtLoad() < SEXPR_BOARD_FILE_VERSION - && loadedBoard->GetGenerator().Lower() != "gerbview" ) ) + && loadedBoard->GetGenerator().Lower() != wxT( "gerbview" ) ) ) { m_infoBar->RemoveAllButtons(); m_infoBar->AddCloseButton(); @@ -853,11 +852,13 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector& aFileSet, in const wxString& project_env = PROJECT_VAR_NAME; wxString rel_path, env_path; - wxASSERT_MSG( wxGetEnv( project_env, &env_path ), "There is no project variable?" ); + wxASSERT_MSG( wxGetEnv( project_env, &env_path ), + wxT( "There is no project variable?" ) ); wxString result( newLibPath ); - rel_path = result.Replace( env_path, wxString( "$(" + project_env + ")" ) ) ? result - : ""; + rel_path = result.Replace( env_path, wxT( "$(" ) + project_env + wxT( ")" ) ) + ? result + : wxEmptyString; FP_LIB_TABLE_ROW* row = new FP_LIB_TABLE_ROW( libNickName, rel_path, wxT( "KiCad" ), wxEmptyString ); @@ -1198,7 +1199,8 @@ bool PCB_EDIT_FRAME::doAutoSave() return false; } - wxLogTrace( traceAutoSave, "Creating auto save file <" + autoSaveFileName.GetFullPath() + ">" ); + wxLogTrace( traceAutoSave, + wxT( "Creating auto save file <" ) + autoSaveFileName.GetFullPath() + wxT( ">" ) ); if( SavePcbFile( autoSaveFileName.GetFullPath(), false, false ) ) { diff --git a/pcbnew/footprint.cpp b/pcbnew/footprint.cpp index db12d07662..ff782677b6 100644 --- a/pcbnew/footprint.cpp +++ b/pcbnew/footprint.cpp @@ -562,7 +562,7 @@ void FOOTPRINT::Remove( BOARD_ITEM* aBoardItem, REMOVE_MODE aMode ) case PCB_FP_TEXT_T: // Only user text can be removed this way. wxCHECK_RET( static_cast( aBoardItem )->GetType() == FP_TEXT::TEXT_is_DIVERS, - "Please report this bug: Invalid remove operation on required text" ); + wxT( "Please report this bug: Invalid remove operation on required text" ) ); KI_FALLTHROUGH; case PCB_FP_DIM_ALIGNED_T: @@ -990,7 +990,8 @@ void FOOTPRINT::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector" ) @@ -1345,7 +1346,7 @@ void FOOTPRINT::RunOnChildren( const std::function& aFuncti } catch( std::bad_function_call& ) { - wxFAIL_MSG( "Error running FOOTPRINT::RunOnChildren" ); + wxFAIL_MSG( wxT( "Error running FOOTPRINT::RunOnChildren" ) ); } } @@ -1385,8 +1386,8 @@ void FOOTPRINT::ViewGetLayers( int aLayers[], int& aCount ) const switch( m_layer ) { default: - wxASSERT_MSG( false, "Illegal layer" ); // do you really have footprints placed on - // other layers? + wxASSERT_MSG( false, wxT( "Illegal layer" ) ); // do you really have footprints placed + // on other layers? KI_FALLTHROUGH; case F_Cu: @@ -1883,7 +1884,7 @@ BOARD_ITEM* FOOTPRINT::DuplicateItem( const BOARD_ITEM* aItem, bool aAddToFootpr default: // Un-handled item for duplication - wxFAIL_MSG( "Duplication not supported for items of class " + aItem->GetClass() ); + wxFAIL_MSG( wxT( "Duplication not supported for items of class " ) + aItem->GetClass() ); break; } @@ -1904,10 +1905,10 @@ wxString FOOTPRINT::GetNextPadNumber( const wxString& aLastPadNumber ) const wxString prefix = UTIL::GetRefDesPrefix( aLastPadNumber ); int num = GetTrailingInt( aLastPadNumber ); - while( usedNumbers.count( wxString::Format( "%s%d", prefix, num ) ) ) + while( usedNumbers.count( wxString::Format( wxT( "%s%d" ), prefix, num ) ) ) num++; - return wxString::Format( "%s%d", prefix, num ); + return wxString::Format( wxT( "%s%d" ), prefix, num ); } @@ -2197,7 +2198,7 @@ void FOOTPRINT::CheckFootprintAttributes( const std::functionIsProjectOpen() && wxFileName::IsDirWritable( Prj().GetProjectPath() ) ) { - GFootprintList.WriteCacheToFile( Prj().GetProjectPath() + "fp-info-cache" ); + GFootprintList.WriteCacheToFile( Prj().GetProjectPath() + wxT( "fp-info-cache" ) ); } mgr->FlushAndRelease( GetSettings() ); @@ -818,7 +818,7 @@ void FOOTPRINT_EDIT_FRAME::OnModify() Update3DView( true, true ); m_treePane->GetLibTree()->RefreshLibTree(); - if( !GetTitle().StartsWith( "*" ) ) + if( !GetTitle().StartsWith( wxT( "*" ) ) ) UpdateTitle(); } @@ -836,8 +836,9 @@ void FOOTPRINT_EDIT_FRAME::UpdateTitle() title = wxT( "*" ); title += footprint->GetReference(); - title += wxS( " " ) + wxString::Format( _( "[from %s]" ), - Prj().GetProjectName() + "." + PcbFileExtension ); + title += wxS( " " ) + wxString::Format( _( "[from %s]" ), Prj().GetProjectName() + + wxT( "." ) + + PcbFileExtension ); } else if( fpid.IsValid() ) { @@ -901,7 +902,7 @@ void FOOTPRINT_EDIT_FRAME::initLibraryTree() WX_PROGRESS_REPORTER progressReporter( this, _( "Loading Footprint Libraries" ), 2 ); if( GFootprintList.GetCount() == 0 ) - GFootprintList.ReadCacheFromFile( Prj().GetProjectPath() + "fp-info-cache" ); + GFootprintList.ReadCacheFromFile( Prj().GetProjectPath() + wxT( "fp-info-cache" ) ); GFootprintList.ReadFootprintFiles( fpTable, nullptr, &progressReporter ); progressReporter.Show( false ); @@ -1225,7 +1226,7 @@ void FOOTPRINT_EDIT_FRAME::OnSaveFootprintAsPng( wxCommandEvent& event ) } wxFileName fn( id.GetLibItemName() ); - fn.SetExt( "png" ); + fn.SetExt( wxT( "png" ) ); wxString projectPath = wxPathOnly( Prj().GetProjectFullName() ); diff --git a/pcbnew/footprint_editor_utils.cpp b/pcbnew/footprint_editor_utils.cpp index b92dac4ee7..5b5380f235 100644 --- a/pcbnew/footprint_editor_utils.cpp +++ b/pcbnew/footprint_editor_utils.cpp @@ -246,7 +246,7 @@ void FOOTPRINT_EDIT_FRAME::OnEditItemRequest( BOARD_ITEM* aItem ) break; default: - wxFAIL_MSG( "FOOTPRINT_EDIT_FRAME::OnEditItemRequest: unsupported item type " + wxFAIL_MSG( wxT( "FOOTPRINT_EDIT_FRAME::OnEditItemRequest: unsupported item type " ) + aItem->GetClass() ); break; } diff --git a/pcbnew/footprint_info_impl.cpp b/pcbnew/footprint_info_impl.cpp index 718d481925..bfae62a4aa 100644 --- a/pcbnew/footprint_info_impl.cpp +++ b/pcbnew/footprint_info_impl.cpp @@ -375,7 +375,7 @@ void FOOTPRINT_LIST_IMPL::WriteCacheToFile( const wxString& aFilePath ) return; } - txtStream << wxString::Format( "%lld", m_list_timestamp ) << endl; + txtStream << wxString::Format( wxT( "%lld" ), m_list_timestamp ) << endl; for( std::unique_ptr& fpinfo : m_list ) { @@ -383,9 +383,9 @@ void FOOTPRINT_LIST_IMPL::WriteCacheToFile( const wxString& aFilePath ) txtStream << fpinfo->GetName() << endl; txtStream << EscapeString( fpinfo->GetDescription(), CTX_LINE ) << endl; txtStream << EscapeString( fpinfo->GetKeywords(), CTX_LINE ) << endl; - txtStream << wxString::Format( "%d", fpinfo->GetOrderNum() ) << endl; - txtStream << wxString::Format( "%u", fpinfo->GetPadCount() ) << endl; - txtStream << wxString::Format( "%u", fpinfo->GetUniquePadCount() ) << endl; + txtStream << wxString::Format( wxT( "%d" ), fpinfo->GetOrderNum() ) << endl; + txtStream << wxString::Format( wxT( "%u" ), fpinfo->GetPadCount() ) << endl; + txtStream << wxString::Format( wxT( "%u" ), fpinfo->GetUniquePadCount() ) << endl; } txtStream.Flush(); diff --git a/pcbnew/footprint_viewer_frame.cpp b/pcbnew/footprint_viewer_frame.cpp index ce2a9df811..1fb25565b3 100644 --- a/pcbnew/footprint_viewer_frame.cpp +++ b/pcbnew/footprint_viewer_frame.cpp @@ -477,7 +477,7 @@ void FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList() for( const std::unique_ptr& footprint : fp_info_list->GetList() ) { - wxString search = footprint->GetFootprintName() + " " + footprint->GetSearchText(); + wxString search = footprint->GetFootprintName() + wxS( " " ) + footprint->GetSearchText(); bool matched = matcher.Find( search.Lower(), matches, position ); if( !matched && term.IsNumber() ) @@ -805,7 +805,7 @@ void FOOTPRINT_VIEWER_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg ) WINDOW_SETTINGS* FOOTPRINT_VIEWER_FRAME::GetWindowSettings( APP_SETTINGS_BASE* aCfg ) { PCBNEW_SETTINGS* cfg = dynamic_cast( aCfg ); - wxCHECK_MSG( cfg, nullptr, "config not existing" ); + wxCHECK_MSG( cfg, nullptr, wxT( "config not existing" ) ); return &cfg->m_FootprintViewer; } @@ -972,8 +972,8 @@ void FOOTPRINT_VIEWER_FRAME::OnIterateFootprintList( wxCommandEvent& event ) break; default: - wxString id = wxString::Format( "%i", event.GetId() ); - wxFAIL_MSG( "FOOTPRINT_VIEWER_FRAME::OnIterateFootprintList error: id = " + id ); + wxString id = wxString::Format( wxT( "%i" ), event.GetId() ); + wxFAIL_MSG( wxT( "FOOTPRINT_VIEWER_FRAME::OnIterateFootprintList error: id = " ) + id ); } } diff --git a/pcbnew/footprint_wizard.h b/pcbnew/footprint_wizard.h index d9d10b26d1..5b06350483 100644 --- a/pcbnew/footprint_wizard.h +++ b/pcbnew/footprint_wizard.h @@ -35,15 +35,15 @@ #include // Allowable parameter types for PCB wizards -const wxString WIZARD_PARAM_UNITS_MM = "mm"; // Millimetres -const wxString WIZARD_PARAM_UNITS_MILS = "mils"; // Mils / thou -const wxString WIZARD_PARAM_UNITS_FLOAT = "float"; // Floating point (dimensionless) -const wxString WIZARD_PARAM_UNITS_INTEGER = "integer"; // Integer (dimensionless) -const wxString WIZARD_PARAM_UNITS_BOOL = "bool"; // Boolean option -const wxString WIZARD_PARAM_UNITS_RADIANS = "radians"; // Angle (radians) -const wxString WIZARD_PARAM_UNITS_DEGREES = "degrees"; // Angle (degrees) -const wxString WIZARD_PARAM_UNITS_PERCENT = "%"; // Percent (0% -> 100%) -const wxString WIZARD_PARAM_UNITS_STRING = "string"; // String +const wxString WIZARD_PARAM_UNITS_MM = wxT( "mm" ); // Millimetres +const wxString WIZARD_PARAM_UNITS_MILS = wxT( "mils" ); // Mils / thou +const wxString WIZARD_PARAM_UNITS_FLOAT = wxT( "float" ); // Floating point (dimensionless) +const wxString WIZARD_PARAM_UNITS_INTEGER = wxT( "integer" ); // Integer (dimensionless) +const wxString WIZARD_PARAM_UNITS_BOOL = wxT( "bool" ); // Boolean option +const wxString WIZARD_PARAM_UNITS_RADIANS = wxT( "radians" ); // Angle (radians) +const wxString WIZARD_PARAM_UNITS_DEGREES = wxT( "degrees" ); // Angle (degrees) +const wxString WIZARD_PARAM_UNITS_PERCENT = wxT( "%" ); // Percent (0% -> 100%) +const wxString WIZARD_PARAM_UNITS_STRING = wxT( "string" ); // String /** * The parent class from where any footprint wizard class must derive. diff --git a/pcbnew/footprint_wizard_frame.cpp b/pcbnew/footprint_wizard_frame.cpp index 07f78ac4dc..3696da59b7 100644 --- a/pcbnew/footprint_wizard_frame.cpp +++ b/pcbnew/footprint_wizard_frame.cpp @@ -421,9 +421,9 @@ void FOOTPRINT_WIZARD_FRAME::ReCreateParameterList() m_parameterGrid->SetCellRenderer( i, WIZ_COL_VALUE, new wxGridCellBoolRenderer ); } // Parameters that can be selected from a list of multiple options - else if( units.Contains( "," ) ) // Indicates list of available options + else if( units.Contains( wxT( "," ) ) ) // Indicates list of available options { - wxStringTokenizer tokenizer( units, "," ); + wxStringTokenizer tokenizer( units, wxT( "," ) ); wxArrayString options; while( tokenizer.HasMoreTokens() ) diff --git a/pcbnew/footprint_wizard_frame_functions.cpp b/pcbnew/footprint_wizard_frame_functions.cpp index 3d3d62edcf..2e3f071472 100644 --- a/pcbnew/footprint_wizard_frame_functions.cpp +++ b/pcbnew/footprint_wizard_frame_functions.cpp @@ -66,9 +66,9 @@ void FOOTPRINT_WIZARD_FRAME::Process_Special_Functions( wxCommandEvent& event ) break; default: - wxFAIL_MSG( wxString::Format( - "FOOTPRINT_WIZARD_FRAME::Process_Special_Functions error: id = %d", - event.GetId() ) ); + wxFAIL_MSG( wxString::Format( wxT( "FOOTPRINT_WIZARD_FRAME::Process_Special_Functions " + "error: id = %d" ), + event.GetId() ) ); break; } } diff --git a/pcbnew/fp_tree_model_adapter.cpp b/pcbnew/fp_tree_model_adapter.cpp index 984210ce44..b09cc65bb8 100644 --- a/pcbnew/fp_tree_model_adapter.cpp +++ b/pcbnew/fp_tree_model_adapter.cpp @@ -37,7 +37,7 @@ FP_TREE_MODEL_ADAPTER::Create( EDA_BASE_FRAME* aParent, LIB_TABLE* aLibs ) FP_TREE_MODEL_ADAPTER::FP_TREE_MODEL_ADAPTER( EDA_BASE_FRAME* aParent, LIB_TABLE* aLibs ) : - LIB_TREE_MODEL_ADAPTER( aParent, "pinned_footprint_libs" ), + LIB_TREE_MODEL_ADAPTER( aParent, wxT( "pinned_footprint_libs" ) ), m_libs( (FP_LIB_TABLE*) aLibs ) {} diff --git a/pcbnew/fp_tree_synchronizing_adapter.cpp b/pcbnew/fp_tree_synchronizing_adapter.cpp index 11e2e793fa..8d0c5ec38b 100644 --- a/pcbnew/fp_tree_synchronizing_adapter.cpp +++ b/pcbnew/fp_tree_synchronizing_adapter.cpp @@ -181,7 +181,7 @@ void FP_TREE_SYNCHRONIZING_ADAPTER::GetValue( wxVariant& aVariant, wxDataViewIte // mark modified part with an asterisk if( m_frame->GetScreen()->IsContentModified() ) - aVariant = node->m_Name + " *"; + aVariant = node->m_Name + wxT( " *" ); else aVariant = node->m_Name; } diff --git a/pcbnew/generate_footprint_info.cpp b/pcbnew/generate_footprint_info.cpp index 83f1539341..b9fa034815 100644 --- a/pcbnew/generate_footprint_info.cpp +++ b/pcbnew/generate_footprint_info.cpp @@ -25,24 +25,24 @@ #include -static const wxString DescriptionFormat = +static const wxString DescriptionFormat = wxT( "__NAME__" "
__DESC__" "
" "__FIELDS__" - "
"; + "" ); -static const wxString KeywordsFormat = +static const wxString KeywordsFormat = wxT( "" " " + _( "Keywords" ) + "" " __KEYWORDS__" - ""; + "" ); -static const wxString DocFormat = +static const wxString DocFormat = wxT( "" " " + _( "Documentation" ) + "" " __TEXT__" - ""; + "" ); class FOOTPRINT_INFO_GENERATOR @@ -66,7 +66,7 @@ public: */ void GenerateHtml() { - wxCHECK_RET( m_fp_lib_table, "Footprint library table pointer is not valid" ); + wxCHECK_RET( m_fp_lib_table, wxT( "Footprint library table pointer is not valid" ) ); if( !m_lib_id.IsValid() ) return; diff --git a/pcbnew/graphics_cleaner.cpp b/pcbnew/graphics_cleaner.cpp index 7c0e66f3f9..f20cb6cd04 100644 --- a/pcbnew/graphics_cleaner.cpp +++ b/pcbnew/graphics_cleaner.cpp @@ -124,7 +124,7 @@ bool GRAPHICS_CLEANER::areEquivalent( PCB_SHAPE* aShape1, PCB_SHAPE* aShape2 ) && aShape1->GetBezierPoints() == aShape2->GetBezierPoints(); default: - wxFAIL_MSG( "GRAPHICS_CLEANER::areEquivalent unimplemented for " + wxFAIL_MSG( wxT( "GRAPHICS_CLEANER::areEquivalent unimplemented for " ) + aShape1->SHAPE_T_asString() ); return false; } diff --git a/pcbnew/kicad_clipboard.cpp b/pcbnew/kicad_clipboard.cpp index c13a25ecbb..6302c074a8 100644 --- a/pcbnew/kicad_clipboard.cpp +++ b/pcbnew/kicad_clipboard.cpp @@ -205,9 +205,9 @@ void CLIPBOARD_IO::SaveSelection( const PCB_SELECTION& aSelected, bool isFootpri FP_TEXT* fp_text = static_cast( item ); PCB_TEXT* pcb_text = new PCB_TEXT( m_board ); - if( fp_text->GetText() == "${VALUE}" ) + if( fp_text->GetText() == wxT( "${VALUE}" ) ) pcb_text->SetText( footprint->GetValue() ); - else if( fp_text->GetText() == "${REFERENCE}" ) + else if( fp_text->GetText() == wxT( "${REFERENCE}" ) ) pcb_text->SetText( footprint->GetReference() ); else pcb_text->CopyText( *fp_text ); diff --git a/pcbnew/load_select_footprint.cpp b/pcbnew/load_select_footprint.cpp index 46774a944b..e4b4f58925 100644 --- a/pcbnew/load_select_footprint.cpp +++ b/pcbnew/load_select_footprint.cpp @@ -252,7 +252,8 @@ FOOTPRINT* PCB_BASE_FRAME::SelectFootprintFromLibTree( LIB_ID aPreselect ) historyInfos.push_back( fp_info ); } - adapter->DoAddLibrary( "-- " + _( "Recently Used" ) + " --", wxEmptyString, historyInfos, true ); + adapter->DoAddLibrary( wxT( "-- " ) + _( "Recently Used" ) + wxT( " --" ), wxEmptyString, + historyInfos, true ); if( aPreselect.IsValid() ) adapter->SetPreselectNode( aPreselect, 0 ); @@ -461,8 +462,8 @@ FOOTPRINT* PCB_BASE_FRAME::GetFootprintFromBoardByReference() wxArrayString fplist; // Build list of available fp references, to display them in dialog - for( auto fp : GetBoard()->Footprints() ) - fplist.Add( fp->GetReference() + wxT(" ( ") + fp->GetValue() + wxT(" )") ); + for( FOOTPRINT* fp : GetBoard()->Footprints() ) + fplist.Add( fp->GetReference() + wxT( " ( " ) + fp->GetValue() + wxT( " )" ) ); fplist.Sort(); @@ -477,10 +478,10 @@ FOOTPRINT* PCB_BASE_FRAME::GetFootprintFromBoardByReference() if( !footprintName.IsEmpty() ) { - for( auto mod : GetBoard()->Footprints() ) + for( FOOTPRINT* fp : GetBoard()->Footprints() ) { - if( mod->GetReference().CmpNoCase( footprintName ) == 0 ) - return mod; + if( fp->GetReference().CmpNoCase( footprintName ) == 0 ) + return fp; } } diff --git a/pcbnew/menubar_footprint_editor.cpp b/pcbnew/menubar_footprint_editor.cpp index fbba74543f..37a088f83f 100644 --- a/pcbnew/menubar_footprint_editor.cpp +++ b/pcbnew/menubar_footprint_editor.cpp @@ -238,7 +238,7 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar() // We can't use ACTIONS::showPreferences yet because wxWidgets moves this on // Mac, and it needs the wxID_PREFERENCES id to find it. - prefsMenu->Add( _( "Preferences..." ) + "\tCtrl+,", + prefsMenu->Add( _( "Preferences..." ) + wxT( "\tCtrl+," ), _( "Show preferences for all open tools" ), wxID_PREFERENCES, BITMAPS::preference ); diff --git a/pcbnew/menubar_pcb_editor.cpp b/pcbnew/menubar_pcb_editor.cpp index cb8794c840..5901e37e34 100644 --- a/pcbnew/menubar_pcb_editor.cpp +++ b/pcbnew/menubar_pcb_editor.cpp @@ -140,7 +140,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() submenuExport->Add( _( "Footprint Association (.cmp) File..." ), _( "Export footprint association file (*.cmp) for schematic back annotation" ), ID_PCB_GEN_CMP_FILE, BITMAPS::export_cmp ); - submenuExport->Add( _( "Hyperlynx..." ), "", + submenuExport->Add( _( "Hyperlynx..." ), wxEmptyString, ID_GEN_EXPORT_FILE_HYPERLYNX, BITMAPS::export_step ); if( ADVANCED_CFG::GetCfg().m_ShowPcbnewExportNetlist && m_exportNetlistAction ) @@ -455,7 +455,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() // We can't use ACTIONS::showPreferences yet because wxWidgets moves this on // Mac, and it needs the wxID_PREFERENCES id to find it. - prefsMenu->Add( _( "Preferences..." ) + "\tCtrl+,", + prefsMenu->Add( _( "Preferences..." ) + wxT( "\tCtrl+," ), _( "Show preferences for all open tools" ), wxID_PREFERENCES, BITMAPS::preference ); diff --git a/pcbnew/netinfo.h b/pcbnew/netinfo.h index f3ce72b7fb..27f565c9cf 100644 --- a/pcbnew/netinfo.h +++ b/pcbnew/netinfo.h @@ -137,7 +137,7 @@ public: { m_netname = aNewName; - if( aNewName.Contains( "/" ) ) + if( aNewName.Contains( wxT( "/" ) ) ) m_shortNetname = aNewName.AfterLast( '/' ); else m_shortNetname = aNewName; diff --git a/pcbnew/netinfo_item.cpp b/pcbnew/netinfo_item.cpp index 5563ac44db..f63caf1222 100644 --- a/pcbnew/netinfo_item.cpp +++ b/pcbnew/netinfo_item.cpp @@ -50,7 +50,7 @@ NETINFO_ITEM::NETINFO_ITEM( BOARD* aParent, const wxString& aNetName, int aNetCo if( aParent ) m_netClass = aParent->GetDesignSettings().GetNetClasses().GetDefault(); else - m_netClass = std::make_shared( "" ); + m_netClass = std::make_shared( wxT( "" ) ); } @@ -73,7 +73,7 @@ void NETINFO_ITEM::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vectorGetBoard() : nullptr; @@ -92,7 +92,7 @@ void NETINFO_ITEM::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vectorsecond == aNet ) { - wxASSERT_MSG( removed, "NETINFO_LIST::RemoveNet: target net found in m_netNames " - "but not m_netCodes!" ); + wxASSERT_MSG( removed, wxT( "NETINFO_LIST::RemoveNet: target net found in m_netNames " + "but not m_netCodes!" ) ); m_netNames.erase(i); break; } @@ -177,7 +177,7 @@ void NETINFO_LIST::Show() const for( it = m_netNames.begin(), itEnd = m_netNames.end(); it != itEnd; ++it ) { - wxLogDebug( "[%d]: netcode:%d netname:<%s>\n", + wxLogDebug( wxT( "[%d]: netcode:%d netname:<%s>\n" ), i++, it->second->GetNetCode(), TO_UTF8( it->second->GetNetname() ) ); diff --git a/pcbnew/pad.cpp b/pcbnew/pad.cpp index 5677442ec2..34dcbfb8be 100644 --- a/pcbnew/pad.cpp +++ b/pcbnew/pad.cpp @@ -471,7 +471,7 @@ void PAD::BuildEffectiveShapes( PCB_LAYER_ID aLayer ) const break; default: - wxFAIL_MSG( "PAD::buildEffectiveShapes: Unsupported pad shape: " + wxFAIL_MSG( wxT( "PAD::buildEffectiveShapes: Unsupported pad shape: " ) + PAD_SHAPE_T_asString( effectiveShape ) ); break; } @@ -928,13 +928,13 @@ void PAD::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector& if( GetDrillShape() == PAD_DRILL_SHAPE_CIRCLE ) { aList.emplace_back( _( "Hole" ), - wxString::Format( "%s", + wxString::Format( wxT( "%s" ), MessageTextFromValue( units, m_drill.x ) ) ); } else { aList.emplace_back( _( "Hole X / Y" ), - wxString::Format( "%s / %s", + wxString::Format( wxT( "%s / %s" ), MessageTextFromValue( units, m_drill.x ), MessageTextFromValue( units, m_drill.y ) ) ); } @@ -1261,8 +1261,8 @@ void PAD::ViewGetLayers( int aLayers[], int& aCount ) const { wxString msg; msg.Printf( wxT( "footprint %s, pad %s: could not find valid layer for pad" ), - GetParent() ? GetParent()->GetReference() : "", - GetNumber().IsEmpty() ? "(unnumbered)" : GetNumber() ); + GetParent() ? GetParent()->GetReference() : wxT( "" ), + GetNumber().IsEmpty() ? wxT( "(unnumbered)" ) : GetNumber() ); wxLogDebug( msg ); } #endif @@ -1495,7 +1495,7 @@ void PAD::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer, int aError, ERROR_LOC aErrorLoc, bool ignoreLineWidth ) const { - wxASSERT_MSG( !ignoreLineWidth, "IgnoreLineWidth has no meaning for pads." ); + wxASSERT_MSG( !ignoreLineWidth, wxT( "IgnoreLineWidth has no meaning for pads." ) ); // minimal segment count to approximate a circle to create the polygonal pad shape // This minimal value is mainly for very small pads, like SM0402. @@ -1588,7 +1588,7 @@ void PAD::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer, } default: - wxFAIL_MSG( "PAD::TransformShapeWithClearanceToPolygon no implementation for " + wxFAIL_MSG( wxT( "PAD::TransformShapeWithClearanceToPolygon no implementation for " ) + PAD_SHAPE_T_asString( GetShape() ) ); break; } diff --git a/pcbnew/pcb_base_edit_frame.cpp b/pcbnew/pcb_base_edit_frame.cpp index 13eea54013..ab245744fd 100644 --- a/pcbnew/pcb_base_edit_frame.cpp +++ b/pcbnew/pcb_base_edit_frame.cpp @@ -82,7 +82,7 @@ void PCB_BASE_EDIT_FRAME::doCloseWindow() if( mgr->IsProjectOpen() && wxFileName::IsDirWritable( projectName.GetPath() ) && projectName.Exists() ) { - GFootprintList.WriteCacheToFile( Prj().GetProjectPath() + "fp-info-cache" ); + GFootprintList.WriteCacheToFile( Prj().GetProjectPath() + wxT( "fp-info-cache" ) ); } // Close the project if we are standalone, so it gets cleaned up properly diff --git a/pcbnew/pcb_base_frame.cpp b/pcbnew/pcb_base_frame.cpp index 3451d2bfb8..e70d4203ff 100644 --- a/pcbnew/pcb_base_frame.cpp +++ b/pcbnew/pcb_base_frame.cpp @@ -249,7 +249,8 @@ void PCB_BASE_FRAME::FocusOnItem( BOARD_ITEM* aItem, PCB_LAYER_ID aLayer ) } catch( const boost::uuids::entropy_error& ) { - wxLogError( "A Boost UUID entropy exception was thrown in %s:%s.", __FILE__, __FUNCTION__ ); + wxLogError( wxT( "A Boost UUID entropy exception was thrown in %s:%s." ), + __FILE__, __FUNCTION__ ); } #else lastItem = GetBoard()->GetItem( lastBrightenedItemID ); @@ -731,7 +732,7 @@ void PCB_BASE_FRAME::DisplayGridMsg() VECTOR2D gridSize = GetCanvas()->GetGAL()->GetGridSize(); wxString line; - line.Printf( "grid X %s Y %s", + line.Printf( wxT( "grid X %s Y %s" ), MessageTextFromValue( m_userUnits, gridSize.x, false ), MessageTextFromValue( m_userUnits, gridSize.y, false ) ); diff --git a/pcbnew/pcb_dimension.cpp b/pcbnew/pcb_dimension.cpp index 2d31ebdbc4..3b17d8777a 100644 --- a/pcbnew/pcb_dimension.cpp +++ b/pcbnew/pcb_dimension.cpp @@ -78,14 +78,14 @@ void PCB_DIMENSION_BASE::updateText() break; case DIM_UNITS_FORMAT::BARE_SUFFIX: // normal - text += " "; + text += wxS( " " ); text += GetAbbreviatedUnitsLabel( m_units ); break; case DIM_UNITS_FORMAT::PAREN_SUFFIX: // parenthetical - text += " ("; + text += wxT( " (" ); text += GetAbbreviatedUnitsLabel( m_units ); - text += ")"; + text += wxT( ")" ); break; } @@ -110,7 +110,7 @@ wxString PCB_DIMENSION_BASE::GetValueText() const int val = GetMeasuredValue(); wxString text; - wxString format = wxT( "%." ) + wxString::Format( "%i", m_precision ) + wxT( "f" ); + wxString format = wxT( "%." ) + wxString::Format( wxT( "%i" ), m_precision ) + wxT( "f" ); text.Printf( format, To_User_Unit( m_units, val ) ); @@ -294,7 +294,7 @@ void PCB_DIMENSION_BASE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, { aList.emplace_back( _( "Value" ), GetValueText() ); - msg = "%" + wxString::Format( "1.%df", GetPrecision() ); + msg = wxT( "%" ) + wxString::Format( wxT( "1.%df" ), GetPrecision() ); aList.emplace_back( _( "Precision" ), wxString::Format( msg, 0.0 ) ); } @@ -311,7 +311,7 @@ void PCB_DIMENSION_BASE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, if( Type() == PCB_DIM_CENTER_T || Type() == PCB_FP_DIM_CENTER_T ) { VECTOR2I startCoord = originTransforms.ToDisplayAbs( GetStart() ); - wxString start = wxString::Format( "@(%s, %s)", + wxString start = wxString::Format( wxT( "@(%s, %s)" ), MessageTextFromValue( units, startCoord.x ), MessageTextFromValue( units, startCoord.y ) ); @@ -320,11 +320,11 @@ void PCB_DIMENSION_BASE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, else { VECTOR2I startCoord = originTransforms.ToDisplayAbs( GetStart() ); - wxString start = wxString::Format( "@(%s, %s)", + wxString start = wxString::Format( wxT( "@(%s, %s)" ), MessageTextFromValue( units, startCoord.x ), MessageTextFromValue( units, startCoord.y ) ); VECTOR2I endCoord = originTransforms.ToDisplayAbs( GetEnd() ); - wxString end = wxString::Format( "@(%s, %s)", + wxString end = wxString::Format( wxT( "@(%s, %s)" ), MessageTextFromValue( units, endCoord.x ), MessageTextFromValue( units, endCoord.y ) ); @@ -492,7 +492,7 @@ void PCB_DIMENSION_BASE::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& a int aError, ERROR_LOC aErrorLoc, bool aIgnoreLineWidth ) const { - wxASSERT_MSG( !aIgnoreLineWidth, "IgnoreLineWidth has no meaning for dimensions." ); + wxASSERT_MSG( !aIgnoreLineWidth, wxT( "IgnoreLineWidth has no meaning for dimensions." ) ); for( const std::shared_ptr& shape : m_shapes ) { @@ -513,8 +513,8 @@ void PCB_DIMENSION_BASE::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& a } else { - wxFAIL_MSG( "PCB_DIMENSION_BASE::TransformShapeWithClearanceToPolygon unexpected " - "shape type." ); + wxFAIL_MSG( wxT( "PCB_DIMENSION_BASE::TransformShapeWithClearanceToPolygon unexpected " + "shape type." ) ); } } } @@ -1050,7 +1050,7 @@ void PCB_DIM_LEADER::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vectorGetUserUnits(); VECTOR2I startCoord = originTransforms.ToDisplayAbs( GetStart() ); - wxString start = wxString::Format( "@(%s, %s)", + wxString start = wxString::Format( wxT( "@(%s, %s)" ), MessageTextFromValue( units, startCoord.x ), MessageTextFromValue( units, startCoord.y ) ); diff --git a/pcbnew/pcb_draw_panel_gal.cpp b/pcbnew/pcb_draw_panel_gal.cpp index da18db9331..0ad34e81e3 100644 --- a/pcbnew/pcb_draw_panel_gal.cpp +++ b/pcbnew/pcb_draw_panel_gal.cpp @@ -265,7 +265,7 @@ void PCB_DRAW_PANEL_GAL::UpdateColors() cs = Pgm().GetSettingsManager().GetColorSettings(); } - wxCHECK_RET( cs, "null COLOR_SETTINGS" ); + wxCHECK_RET( cs, wxT( "null COLOR_SETTINGS" ) ); auto rs = static_cast( m_view->GetPainter()->GetSettings() ); rs->LoadColors( cs ); @@ -472,11 +472,11 @@ void PCB_DRAW_PANEL_GAL::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, } } - aList.emplace_back( _( "Pads" ), wxString::Format( "%d", padCount ) ); - aList.emplace_back( _( "Vias" ), wxString::Format( "%d", viaCount ) ); - aList.emplace_back( _( "Track Segments" ), wxString::Format( "%d", trackSegmentCount ) ); - aList.emplace_back( _( "Nets" ), wxString::Format( "%d", (int) netCodes.size() ) ); - aList.emplace_back( _( "Unrouted" ), wxString::Format( "%d", unconnected ) ); + aList.emplace_back( _( "Pads" ), wxString::Format( wxT( "%d" ), padCount ) ); + aList.emplace_back( _( "Vias" ), wxString::Format( wxT( "%d" ), viaCount ) ); + aList.emplace_back( _( "Track Segments" ), wxString::Format( wxT( "%d" ), trackSegmentCount ) ); + aList.emplace_back( _( "Nets" ), wxString::Format( wxT( "%d" ), (int) netCodes.size() ) ); + aList.emplace_back( _( "Unrouted" ), wxString::Format( wxT( "%d" ), unconnected ) ); } diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index 7db353b4c2..fe11ce8fea 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -347,19 +347,19 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) : wxString strK2S = Pgm().GetExecutablePath(); #ifdef __WXMAC__ - if( strK2S.Find( "pcbnew.app" ) != wxNOT_FOUND ) + if( strK2S.Find( wxT( "pcbnew.app" ) ) != wxNOT_FOUND ) { // On macOS, we have standalone applications inside the main bundle, so we handle that here: - strK2S += "../../"; + strK2S += wxT( "../../" ); } - strK2S += "Contents/MacOS/"; + strK2S += wxT( "Contents/MacOS/" ); #endif - wxFileName appK2S( strK2S, "kicad2step" ); + wxFileName appK2S( strK2S, wxT( "kicad2step" ) ); #ifdef _WIN32 - appK2S.SetExt( "exe" ); + appK2S.SetExt( wxT( "exe" ) ); #endif // Ensure the window is on top @@ -967,7 +967,7 @@ void PCB_EDIT_FRAME::doCloseWindow() if( !fn.IsOk() || !fn.IsDirWritable() ) fn.SetPath( wxFileName::GetTempDir() ); - wxLogTrace( traceAutoSave, "Deleting auto save file <" + fn.GetFullPath() + ">" ); + wxLogTrace( traceAutoSave, wxT( "Deleting auto save file <" ) + fn.GetFullPath() + wxT( ">" ) ); // Remove the auto save file on a normal close of Pcbnew. if( fn.FileExists() && !wxRemoveFile( fn.GetFullPath() ) ) @@ -1341,7 +1341,7 @@ void PCB_EDIT_FRAME::OnModify( ) Update3DView( true, Settings().m_Display.m_Live3DRefresh ); - if( !GetTitle().StartsWith( "*" ) ) + if( !GetTitle().StartsWith( wxT( "*" ) ) ) UpdateTitle(); m_ZoneFillsDirty = true; @@ -1489,9 +1489,11 @@ void PCB_EDIT_FRAME::ToPlotter( int aID ) case ID_GEN_PLOT_PS: plotSettings.SetFormat( PLOT_FORMAT::POST ); break; - case ID_GEN_PLOT: /* keep the previous setup */ break; + case ID_GEN_PLOT: + /* keep the previous setup */ + break; default: - wxFAIL_MSG( "ToPlotter(): unexpected plot type" ); break; + wxFAIL_MSG( wxT( "ToPlotter(): unexpected plot type" ) ); break; break; } @@ -1579,7 +1581,7 @@ bool PCB_EDIT_FRAME::FetchNetlistFromSchematic( NETLIST& aNetlist, Raise(); // Do not translate extra_info strings. These are for developers - wxString extra_info = e.Problem() + " : " + e.What() + " at " + e.Where(); + wxString extra_info = e.Problem() + wxT( " : " ) + e.What() + wxT( " at " ) + e.Where(); DisplayErrorMessage( this, _( "Received an error while reading netlist. Please " "report this issue to the KiCad team using the menu " diff --git a/pcbnew/pcb_expr_evaluator.cpp b/pcbnew/pcb_expr_evaluator.cpp index fc9e09d358..c87c149bc6 100644 --- a/pcbnew/pcb_expr_evaluator.cpp +++ b/pcbnew/pcb_expr_evaluator.cpp @@ -1,7 +1,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2019-2020 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2019-2022 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -59,7 +59,8 @@ bool exprFromTo( LIBEVAL::CONTEXT* aCtx, void* self ) if( !ftCache ) { - wxLogWarning( "Attempting to call fromTo() with non-existent from-to cache, aborting..."); + wxLogWarning( wxT( "Attempting to call fromTo() with non-existent from-to cache, " + "aborting..." )); return true; } @@ -286,14 +287,14 @@ static void insideCourtyard( LIBEVAL::CONTEXT* aCtx, void* self ) else itemBBox = item->GetBoundingBox(); - if( arg->AsString() == "A" ) + if( arg->AsString() == wxT( "A" ) ) { FOOTPRINT* fp = dynamic_cast( context->GetItem( 0 ) ); if( isInsideCourtyard( item, itemBBox, itemShape, context, fp, In1_Cu ) ) return 1.0; } - else if( arg->AsString() == "B" ) + else if( arg->AsString() == wxT( "B" ) ) { FOOTPRINT* fp = dynamic_cast( context->GetItem( 1 ) ); @@ -353,14 +354,14 @@ static void insideFrontCourtyard( LIBEVAL::CONTEXT* aCtx, void* self ) else itemBBox = item->GetBoundingBox(); - if( arg->AsString() == "A" ) + if( arg->AsString() == wxT( "A" ) ) { FOOTPRINT* fp = dynamic_cast( context->GetItem( 0 ) ); if( isInsideCourtyard( item, itemBBox, itemShape, context, fp, F_Cu ) ) return 1.0; } - else if( arg->AsString() == "B" ) + else if( arg->AsString() == wxT( "B" ) ) { FOOTPRINT* fp = dynamic_cast( context->GetItem( 1 ) ); @@ -419,14 +420,14 @@ static void insideBackCourtyard( LIBEVAL::CONTEXT* aCtx, void* self ) else itemBBox = item->GetBoundingBox(); - if( arg->AsString() == "A" ) + if( arg->AsString() == wxT( "A" ) ) { FOOTPRINT* fp = dynamic_cast( context->GetItem( 0 ) ); if( isInsideCourtyard( item, itemBBox, itemShape, context, fp, B_Cu ) ) return 1.0; } - else if( arg->AsString() == "B" ) + else if( arg->AsString() == wxT( "B" ) ) { FOOTPRINT* fp = dynamic_cast( context->GetItem( 1 ) ); @@ -638,12 +639,12 @@ static void insideArea( LIBEVAL::CONTEXT* aCtx, void* self ) else itemBBox = item->GetBoundingBox(); - if( arg->AsString() == "A" ) + if( arg->AsString() == wxT( "A" ) ) { ZONE* zone = dynamic_cast( context->GetItem( 0 ) ); return isInsideArea( item, itemBBox, context, zone ) ? 1.0 : 0.0; } - else if( arg->AsString() == "B" ) + else if( arg->AsString() == wxT( "B" ) ) { ZONE* zone = dynamic_cast( context->GetItem( 1 ) ); return isInsideArea( item, itemBBox, context, zone ) ? 1.0 : 0.0; @@ -909,19 +910,19 @@ PCB_EXPR_BUILTIN_FUNCTIONS::PCB_EXPR_BUILTIN_FUNCTIONS() void PCB_EXPR_BUILTIN_FUNCTIONS::RegisterAllFunctions() { m_funcs.clear(); - RegisterFunc( "existsOnLayer('x')", existsOnLayer ); - RegisterFunc( "isPlated()", isPlated ); - RegisterFunc( "insideCourtyard('x')", insideCourtyard ); - RegisterFunc( "insideFrontCourtyard('x')", insideFrontCourtyard ); - RegisterFunc( "insideBackCourtyard('x')", insideBackCourtyard ); - RegisterFunc( "insideArea('x')", insideArea ); - RegisterFunc( "isMicroVia()", isMicroVia ); - RegisterFunc( "isBlindBuriedVia()", isBlindBuriedVia ); - RegisterFunc( "memberOf('x')", memberOf ); - RegisterFunc( "fromTo('x','y')", exprFromTo ); - RegisterFunc( "isCoupledDiffPair()", isCoupledDiffPair ); - RegisterFunc( "inDiffPair('x')", inDiffPair ); - RegisterFunc( "getField('x')", getField ); + RegisterFunc( wxT( "existsOnLayer('x')" ), existsOnLayer ); + RegisterFunc( wxT( "isPlated()" ), isPlated ); + RegisterFunc( wxT( "insideCourtyard('x')" ), insideCourtyard ); + RegisterFunc( wxT( "insideFrontCourtyard('x')" ), insideFrontCourtyard ); + RegisterFunc( wxT( "insideBackCourtyard('x')" ), insideBackCourtyard ); + RegisterFunc( wxT( "insideArea('x')" ), insideArea ); + RegisterFunc( wxT( "isMicroVia()" ), isMicroVia ); + RegisterFunc( wxT( "isBlindBuriedVia()" ), isBlindBuriedVia ); + RegisterFunc( wxT( "memberOf('x')" ), memberOf ); + RegisterFunc( wxT( "fromTo('x','y')" ), exprFromTo ); + RegisterFunc( wxT( "isCoupledDiffPair()" ), isCoupledDiffPair ); + RegisterFunc( wxT( "inDiffPair('x')" ), inDiffPair ); + RegisterFunc( wxT( "getField('x')" ), getField ); } @@ -1085,39 +1086,39 @@ std::unique_ptr PCB_EXPR_UCODE::CreateVarRef( const wxString& // Check for a couple of very common cases and compile them straight to "object code". - if( aField.CmpNoCase( "NetClass" ) == 0 ) + if( aField.CmpNoCase( wxT( "NetClass" ) ) == 0 ) { - if( aVar == "A" ) + if( aVar == wxT( "A" ) ) return std::make_unique( 0 ); - else if( aVar == "B" ) + else if( aVar == wxT( "B" ) ) return std::make_unique( 1 ); else return nullptr; } - else if( aField.CmpNoCase( "NetName" ) == 0 ) + else if( aField.CmpNoCase( wxT( "NetName" ) ) == 0 ) { - if( aVar == "A" ) + if( aVar == wxT( "A" ) ) return std::make_unique( 0 ); - else if( aVar == "B" ) + else if( aVar == wxT( "B" ) ) return std::make_unique( 1 ); else return nullptr; } - else if( aField.CmpNoCase( "Type" ) == 0 ) + else if( aField.CmpNoCase( wxT( "Type" ) ) == 0 ) { - if( aVar == "A" ) + if( aVar == wxT( "A" ) ) return std::make_unique( 0 ); - else if( aVar == "B" ) + else if( aVar == wxT( "B" ) ) return std::make_unique( 1 ); else return nullptr; } - if( aVar == "A" || aVar == "AB" ) + if( aVar == wxT( "A" ) || aVar == wxT( "AB" ) ) vref = std::make_unique( 0 ); - else if( aVar == "B" ) + else if( aVar == wxT( "B" ) ) vref = std::make_unique( 1 ); - else if( aVar == "L" ) + else if( aVar == wxT( "L" ) ) vref = std::make_unique( 2 ); else return nullptr; @@ -1128,7 +1129,7 @@ std::unique_ptr PCB_EXPR_UCODE::CreateVarRef( const wxString& } wxString field( aField ); - field.Replace( "_", " " ); + field.Replace( wxT( "_" ), wxT( " " ) ); for( const PROPERTY_MANAGER::CLASS_INFO& cls : propMgr.GetAllClasses() ) { @@ -1155,7 +1156,7 @@ std::unique_ptr PCB_EXPR_UCODE::CreateVarRef( const wxString& } else { - wxFAIL_MSG( "PCB_EXPR_UCODE::createVarRef: Unknown property type." ); + wxFAIL_MSG( wxT( "PCB_EXPR_UCODE::createVarRef: Unknown property type." ) ); } } } @@ -1186,7 +1187,7 @@ public: virtual const std::vector& GetSupportedUnits() const override { - static const std::vector pcbUnits = { "mil", "mm", "in" }; + static const std::vector pcbUnits = { wxT( "mil" ), wxT( "mm" ), wxT( "in" ) }; return pcbUnits; } diff --git a/pcbnew/pcb_group.cpp b/pcbnew/pcb_group.cpp index 85d0091f12..f178cc7b5c 100644 --- a/pcbnew/pcb_group.cpp +++ b/pcbnew/pcb_group.cpp @@ -333,7 +333,7 @@ BITMAPS PCB_GROUP::GetMenuImage() const void PCB_GROUP::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector& aList ) { aList.emplace_back( _( "Group" ), m_name.empty() ? _( "" ) : m_name ); - aList.emplace_back( _( "Members" ), wxString::Format( "%zu", m_items.size() ) ); + aList.emplace_back( _( "Members" ), wxString::Format( wxT( "%zu" ), m_items.size() ) ); if( aFrame->GetName() == PCB_EDIT_FRAME_NAME && IsLocked() ) aList.emplace_back( _( "Status" ), _( "Locked" ) ); diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index 10288eaa79..0c8287147f 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -959,12 +959,12 @@ void PCB_PAINTER::draw( const PAD* aPad, int aLayer ) // shorten the displayed netname (actual name not useful) // Can happen if the pad netname is edited inside the board editor, therefore // having a netname not coming from schematic - if( netname.StartsWith( "unconnected-(" ) ) + if( netname.StartsWith( wxT( "unconnected-(" ) ) ) { if( pinType == wxT( "no_connect" ) || pinType.EndsWith( wxT( "+no_connect" ) ) ) - netname = "x"; + netname = wxT( "x" ); else if( pinType == wxT( "free" ) ) - netname = "*"; + netname = wxT( "*" ); } // approximate the size of net name text: diff --git a/pcbnew/pcb_target.cpp b/pcbnew/pcb_target.cpp index def9a8b015..1a38bf942d 100644 --- a/pcbnew/pcb_target.cpp +++ b/pcbnew/pcb_target.cpp @@ -156,7 +156,7 @@ void PCB_TARGET::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vectorGetDesignSettings().GetAuxOrigin(); if( aBoard->GetPlotOptions().GetUseAuxOrigin() && auxOrigin.x && auxOrigin.y ) - registration_id.Printf( "PX%xPY%x", auxOrigin.x, auxOrigin.y ); + registration_id.Printf( wxT( "PX%xPY%x" ), auxOrigin.x, auxOrigin.y ); - text.Printf( "%%TF.SameCoordinates,%s*%%", registration_id.GetData() ); + text.Printf( wxT( "%%TF.SameCoordinates,%s*%%" ), registration_id.GetData() ); aPlotter->AddLineToHeader( makeStringCompatX1( text, aUseX1CompatibilityMode ) ); } diff --git a/pcbnew/plot_board_layers.cpp b/pcbnew/plot_board_layers.cpp index b3f0bc4a80..f3a3eaf625 100644 --- a/pcbnew/plot_board_layers.cpp +++ b/pcbnew/plot_board_layers.cpp @@ -1214,7 +1214,7 @@ PLOTTER* StartPlotBoard( BOARD *aBoard, const PCB_PLOT_PARAMS *aPlotOpts, int aL if( aPlotOpts->GetPlotFrameRef() ) { PlotDrawingSheet( plotter, aBoard->GetProject(), aBoard->GetTitleBlock(), - aBoard->GetPageSettings(), "1", 1, aSheetDesc, + aBoard->GetPageSettings(), wxT( "1" ), 1, aSheetDesc, aBoard->GetFileName() ); if( aPlotOpts->GetMirror() ) diff --git a/pcbnew/plot_brditems_plotter.cpp b/pcbnew/plot_brditems_plotter.cpp index 5e326e01dd..f16ef5e019 100644 --- a/pcbnew/plot_brditems_plotter.cpp +++ b/pcbnew/plot_brditems_plotter.cpp @@ -750,7 +750,7 @@ void BRDITEMS_PLOTTER::PlotFootprintShape( const FP_SHAPE* aShape ) break; default: - wxASSERT_MSG( false, "Unhandled FP_SHAPE shape" ); + wxASSERT_MSG( false, wxT( "Unhandled FP_SHAPE shape" ) ); break; } } diff --git a/pcbnew/plugin.cpp b/pcbnew/plugin.cpp index 2a20574718..decdf0d542 100644 --- a/pcbnew/plugin.cpp +++ b/pcbnew/plugin.cpp @@ -27,7 +27,7 @@ #include -#define FMT_UNIMPLEMENTED "Plugin \"%s\" does not implement the \"%s\" function." +#define FMT_UNIMPLEMENTED wxT( "Plugin \"%s\" does not implement the \"%s\" function." ) /** * Throw an #IO_ERROR and complains of an API function not being implemented. @@ -148,34 +148,30 @@ void PLUGIN::FootprintLibOptions( PROPERTIES* aListToAppendTo ) const { // disable all these in another couple of months, after everyone has seen them: #if 1 - (*aListToAppendTo)["debug_level"] = UTF8( _( - "Enable debug logging for Footprint*() functions in this PLUGIN." - )); + (*aListToAppendTo)["debug_level"] = UTF8( _( "Enable debug logging for Footprint*() " + "functions in this PLUGIN." ) ); - (*aListToAppendTo)["read_filter_regex"] = UTF8( _( - "Regular expression footprint name filter." - )); + (*aListToAppendTo)["read_filter_regex"] = UTF8( _( "Regular expression footprint name " + "filter." ) ); - (*aListToAppendTo)["enable_transaction_logging"] = UTF8( _( - "Enable transaction logging. The mere presence of this option turns on the " - "logging, no need to set a Value." - )); + (*aListToAppendTo)["enable_transaction_logging"] = UTF8( _( "Enable transaction logging. The " + "mere presence of this option " + "turns on the logging, no need to " + "set a Value." ) ); - (*aListToAppendTo)["username"] = UTF8( _( - "User name for login to some special library server." - )); + (*aListToAppendTo)["username"] = UTF8( _( "User name for login to some special library " + "server." ) ); - (*aListToAppendTo)["password"] = UTF8( _( - "Password for login to some special library server." - )); + (*aListToAppendTo)["password"] = UTF8( _( "Password for login to some special library " + "server." ) ); #endif #if 1 // Suitable for a C++ to python PLUGIN::Footprint*() adapter, move it to the adapter // if and when implemented. - (*aListToAppendTo)["python_footprint_plugin"] = UTF8( _( - "Enter the python module which implements the PLUGIN::Footprint*() functions." - )); + (*aListToAppendTo)["python_footprint_plugin"] = UTF8( _( "Enter the python module which " + "implements the PLUGIN::Footprint*() " + "functions." ) ); #endif } diff --git a/pcbnew/plugins/altium/altium_pcb.cpp b/pcbnew/plugins/altium/altium_pcb.cpp index 16393702d4..6037d24aa2 100644 --- a/pcbnew/plugins/altium/altium_pcb.cpp +++ b/pcbnew/plugins/altium/altium_pcb.cpp @@ -3061,17 +3061,18 @@ void ALTIUM_PCB::ConvertTexts6ToFootprintItemOnLayer( FOOTPRINT* aFootprint, con // TODO: improve parsing of variables wxString trimmedText = aElem.text; trimmedText.Trim(); - if( !aElem.isDesignator && trimmedText.CmpNoCase( ".Designator" ) == 0 ) + + if( !aElem.isDesignator && trimmedText.CmpNoCase( wxT( ".Designator" ) ) == 0 ) { - fpText->SetText( "${REFERENCE}" ); + fpText->SetText( wxT( "${REFERENCE}" ) ); } - else if( !aElem.isComment && trimmedText.CmpNoCase( ".Comment" ) == 0 ) + else if( !aElem.isComment && trimmedText.CmpNoCase( wxT( ".Comment" ) ) == 0 ) { - fpText->SetText( "${VALUE}" ); + fpText->SetText( wxT( "${VALUE}" ) ); } - else if( trimmedText.CmpNoCase( ".Layer_Name" ) == 0 ) + else if( trimmedText.CmpNoCase( wxT( ".Layer_Name" ) ) == 0 ) { - fpText->SetText( "${LAYER}" ); + fpText->SetText( wxT( "${LAYER}" ) ); } else { diff --git a/pcbnew/plugins/eagle/eagle_plugin.cpp b/pcbnew/plugins/eagle/eagle_plugin.cpp index 55b56cfc19..bf161e4aeb 100644 --- a/pcbnew/plugins/eagle/eagle_plugin.cpp +++ b/pcbnew/plugins/eagle/eagle_plugin.cpp @@ -2470,7 +2470,7 @@ void EAGLE_PLUGIN::loadClasses( wxXmlNode* aClasses ) ECLASS eClass( classNode ); NETCLASSPTR netclass; - if( eClass.name.CmpNoCase( "default" ) == 0 ) + if( eClass.name.CmpNoCase( wxT( "default" ) ) == 0 ) { netclass = bds.GetNetClasses().GetDefault(); } diff --git a/pcbnew/plugins/kicad/pcb_parser.cpp b/pcbnew/plugins/kicad/pcb_parser.cpp index dd5e400c3e..f7ca172760 100644 --- a/pcbnew/plugins/kicad/pcb_parser.cpp +++ b/pcbnew/plugins/kicad/pcb_parser.cpp @@ -1561,7 +1561,7 @@ void PCB_PARSER::parseBoardStackup() name = FromUTF8(); // Older versions didn't store opacity with custom colors - if( name.StartsWith( "#" ) && m_requiredVersion < 20210824 ) + if( name.StartsWith( wxT( "#" ) ) && m_requiredVersion < 20210824 ) { KIGFX::COLOR4D color( name ); @@ -3845,8 +3845,8 @@ FP_TEXT* PCB_PARSER::parseFP_TEXT() Expecting( "text value" ); wxString value = FromUTF8(); - value.Replace( "%V", "${VALUE}" ); - value.Replace( "%R", "${REFERENCE}" ); + value.Replace( wxT( "%V" ), wxT( "${VALUE}" ) ); + value.Replace( wxT( "%R" ), wxT( "${REFERENCE}" ) ); text->SetText( value ); NeedLEFT(); token = NextTok(); diff --git a/pcbnew/plugins/kicad/pcb_plugin.cpp b/pcbnew/plugins/kicad/pcb_plugin.cpp index e9dd4d493f..4a64e4a970 100644 --- a/pcbnew/plugins/kicad/pcb_plugin.cpp +++ b/pcbnew/plugins/kicad/pcb_plugin.cpp @@ -276,7 +276,7 @@ void FP_CACHE::Load() catch( const IO_ERROR& ioe ) { if( !cacheError.IsEmpty() ) - cacheError += "\n\n"; + cacheError += wxT( "\n\n" ); cacheError += ioe.What(); } @@ -1058,7 +1058,7 @@ void PCB_PLUGIN::format( const FP_SHAPE* aFPShape, int aNestLevel ) const break; default: - wxFAIL_MSG( "PCB_PLUGIN::format not implemented for " + aFPShape->SHAPE_T_asString() ); + wxFAIL_MSG( wxT( "PCB_PLUGIN::format not implemented for " ) + aFPShape->SHAPE_T_asString() ); return; }; @@ -1422,7 +1422,8 @@ void PCB_PLUGIN::format( const PAD* aPad, int aNestLevel ) const case PAD_ATTRIB::NPTH: type = "np_thru_hole"; break; default: - THROW_IO_ERROR( wxString::Format( "unknown pad attribute: %d", aPad->GetAttribute() ) ); + THROW_IO_ERROR( wxString::Format( wxT( "unknown pad attribute: %d" ), + aPad->GetAttribute() ) ); } const char* property = nullptr; @@ -1438,7 +1439,8 @@ void PCB_PLUGIN::format( const PAD* aPad, int aNestLevel ) const case PAD_PROP::CASTELLATED: property = "pad_prop_castellated"; break; default: - THROW_IO_ERROR( wxString::Format( "unknown pad property: %d", aPad->GetProperty() ) ); + THROW_IO_ERROR( wxString::Format( wxT( "unknown pad property: %d" ), + aPad->GetProperty() ) ); } m_out->Print( aNestLevel, "(pad %s %s %s", diff --git a/pcbnew/sel_layer.cpp b/pcbnew/sel_layer.cpp index 360aaf14ce..05012d1c5d 100644 --- a/pcbnew/sel_layer.cpp +++ b/pcbnew/sel_layer.cpp @@ -215,7 +215,7 @@ void PCB_ONE_LAYER_SELECTOR::buildList() m_leftGridLayers->SetCellValue( left_row, LAYERNAME_COLNUM, layername ); if( m_layerSelected == layerid ) - m_leftGridLayers->SetCellValue( left_row, SELECT_COLNUM, "1" ); + m_leftGridLayers->SetCellValue( left_row, SELECT_COLNUM, wxT( "1" ) ); m_layersIdLeftColumn.push_back( layerid ); left_row++; @@ -229,7 +229,7 @@ void PCB_ONE_LAYER_SELECTOR::buildList() m_rightGridLayers->SetCellValue( right_row, LAYERNAME_COLNUM, layername ); if( m_layerSelected == layerid ) - m_rightGridLayers->SetCellValue( right_row, SELECT_COLNUM, "1" ); + m_rightGridLayers->SetCellValue( right_row, SELECT_COLNUM, wxT( "1" ) ); m_layersIdRightColumn.push_back( layerid ); right_row++; @@ -397,7 +397,7 @@ void SELECT_COPPER_LAYERS_PAIR_DIALOG::buildList() if( m_frontLayer == layerid ) { - m_leftGridLayers->SetCellValue( row, SELECT_COLNUM, "1" ); + m_leftGridLayers->SetCellValue( row, SELECT_COLNUM, wxT( "1" ) ); m_leftGridLayers->SetGridCursor( row, COLOR_COLNUM ); m_leftRowSelected = row; } @@ -410,7 +410,7 @@ void SELECT_COPPER_LAYERS_PAIR_DIALOG::buildList() if( m_backLayer == layerid ) { - m_rightGridLayers->SetCellValue( row, SELECT_COLNUM, "1" ); + m_rightGridLayers->SetCellValue( row, SELECT_COLNUM, wxT( "1" ) ); m_rightRowSelected = row; } @@ -434,7 +434,7 @@ void SELECT_COPPER_LAYERS_PAIR_DIALOG::OnLeftGridCellClick( wxGridEvent& event ) m_leftGridLayers->SetCellValue( m_leftRowSelected, SELECT_COLNUM, wxEmptyString ); m_frontLayer = layer; m_leftRowSelected = row; - m_leftGridLayers->SetCellValue( m_leftRowSelected, SELECT_COLNUM, "1" ); + m_leftGridLayers->SetCellValue( m_leftRowSelected, SELECT_COLNUM, wxT( "1" ) ); } @@ -449,5 +449,5 @@ void SELECT_COPPER_LAYERS_PAIR_DIALOG::OnRightGridCellClick( wxGridEvent& event m_rightGridLayers->SetCellValue( m_rightRowSelected, SELECT_COLNUM, wxEmptyString ); m_backLayer = layer; m_rightRowSelected = row; - m_rightGridLayers->SetCellValue( m_rightRowSelected, SELECT_COLNUM, "1" ); + m_rightGridLayers->SetCellValue( m_rightRowSelected, SELECT_COLNUM, wxT( "1" ) ); } diff --git a/pcbnew/toolbars_pcb_editor.cpp b/pcbnew/toolbars_pcb_editor.cpp index 64c4fa87ce..fbec8af6c7 100644 --- a/pcbnew/toolbars_pcb_editor.cpp +++ b/pcbnew/toolbars_pcb_editor.cpp @@ -616,11 +616,13 @@ static wxString ComboBoxUnits( EDA_UNITS aUnits, double aValue, bool aIncludeLab switch( aUnits ) { - default: wxASSERT_MSG( false, "Invalid unit" ); KI_FALLTHROUGH; - case EDA_UNITS::UNSCALED: format = wxT( "%.0f" ); break; - case EDA_UNITS::MILLIMETRES: format = wxT( "%.3f" ); break; - case EDA_UNITS::MILS: format = wxT( "%.2f" ); break; - case EDA_UNITS::INCHES: format = wxT( "%.5f" ); break; + default: + wxASSERT_MSG( false, wxT( "Invalid unit" ) ); + KI_FALLTHROUGH; + case EDA_UNITS::UNSCALED: format = wxT( "%.0f" ); break; + case EDA_UNITS::MILLIMETRES: format = wxT( "%.3f" ); break; + case EDA_UNITS::MILS: format = wxT( "%.2f" ); break; + case EDA_UNITS::INCHES: format = wxT( "%.5f" ); break; } text.Printf( format, To_User_Unit( aUnits, aValue ) ); @@ -710,9 +712,9 @@ void PCB_EDIT_FRAME::UpdateViaSizeSelectBox( wxChoice* aViaSizeSelectBox, bool a if( hole > 0 ) { - priStr = ComboBoxUnits( primaryUnit, diam, false ) + " / " + priStr = ComboBoxUnits( primaryUnit, diam, false ) + wxT( " / " ) + ComboBoxUnits( primaryUnit, hole, true ); - secStr = ComboBoxUnits( secondaryUnit, diam, false ) + " / " + secStr = ComboBoxUnits( secondaryUnit, diam, false ) + wxT( " / " ) + ComboBoxUnits( secondaryUnit, hole, true ); } else diff --git a/pcbnew/undo_redo.cpp b/pcbnew/undo_redo.cpp index de337da948..db097900e5 100644 --- a/pcbnew/undo_redo.cpp +++ b/pcbnew/undo_redo.cpp @@ -289,7 +289,7 @@ void PCB_BASE_EDIT_FRAME::SaveCopyInUndoList( const PICKED_ITEMS_LIST& aItemsLis break; default: - wxFAIL_MSG( wxString::Format( "SaveCopyInUndoList() error (unknown code %X)", + wxFAIL_MSG( wxString::Format( wxT( "SaveCopyInUndoList() error (unknown code %X)" ), command ) ); break; } @@ -408,7 +408,7 @@ void PCB_BASE_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList ) if( !TestForExistingItem( GetBoard(), (BOARD_ITEM*) eda_item ) ) { // Checking if it ever happens - wxASSERT_MSG( false, "Item in the undo buffer does not exist" ); + wxASSERT_MSG( false, wxT( "Item in the undo buffer does not exist" ) ); // Remove this non existent item aList->RemovePicker( ii ); @@ -527,7 +527,7 @@ void PCB_BASE_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList ) } default: - wxFAIL_MSG( wxString::Format( "PutDataInPreviousState() error (unknown code %X)", + wxFAIL_MSG( wxString::Format( wxT( "PutDataInPreviousState() error (unknown code %X)" ), aList->GetPickedItemStatus( ii ) ) ); break; } diff --git a/pcbnew/zone.cpp b/pcbnew/zone.cpp index dabf7bbc3e..1a6458e3cf 100644 --- a/pcbnew/zone.cpp +++ b/pcbnew/zone.cpp @@ -570,7 +570,7 @@ void ZONE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector& } // Display priority level - aList.emplace_back( _( "Priority" ), wxString::Format( "%d", GetPriority() ) ); + aList.emplace_back( _( "Priority" ), wxString::Format( wxT( "%d" ), GetPriority() ) ); } if( aFrame->GetName() == PCB_EDIT_FRAME_NAME ) @@ -1366,7 +1366,7 @@ void ZONE::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer, PCB_LAYER_ID aLayer, int aClearance, int aError, ERROR_LOC aErrorLoc, bool aIgnoreLineWidth ) const { - wxASSERT_MSG( !aIgnoreLineWidth, "IgnoreLineWidth has no meaning for zones." ); + wxASSERT_MSG( !aIgnoreLineWidth, wxT( "IgnoreLineWidth has no meaning for zones." ) ); if( !m_FilledPolysList.count( aLayer ) ) return; diff --git a/pcbnew/zone_filler.cpp b/pcbnew/zone_filler.cpp index ea7e049a07..25e3aa9b40 100644 --- a/pcbnew/zone_filler.cpp +++ b/pcbnew/zone_filler.cpp @@ -69,7 +69,8 @@ ZONE_FILLER::~ZONE_FILLER() void ZONE_FILLER::SetProgressReporter( PROGRESS_REPORTER* aReporter ) { m_progressReporter = aReporter; - wxASSERT_MSG( m_commit, "ZONE_FILLER must have a valid commit to call SetProgressReporter" ); + wxASSERT_MSG( m_commit, wxT( "ZONE_FILLER must have a valid commit to call " + "SetProgressReporter" ) ); } @@ -1089,19 +1090,19 @@ bool ZONE_FILLER::computeRawFilledArea( const ZONE* aZone, SHAPE_POLY_SET clearanceHoles; aRawPolys = aSmoothedOutline; - DUMP_POLYS_TO_COPPER_LAYER( aRawPolys, In1_Cu, "smoothed-outline" ); + DUMP_POLYS_TO_COPPER_LAYER( aRawPolys, In1_Cu, wxT( "smoothed-outline" ) ); if( m_progressReporter && m_progressReporter->IsCancelled() ) return false; knockoutThermalReliefs( aZone, aLayer, aRawPolys, thermalConnectionPads, noConnectionPads ); - DUMP_POLYS_TO_COPPER_LAYER( aRawPolys, In2_Cu, "minus-thermal-reliefs" ); + DUMP_POLYS_TO_COPPER_LAYER( aRawPolys, In2_Cu, wxT( "minus-thermal-reliefs" ) ); if( m_progressReporter && m_progressReporter->IsCancelled() ) return false; buildCopperItemClearances( aZone, aLayer, noConnectionPads, clearanceHoles ); - DUMP_POLYS_TO_COPPER_LAYER( clearanceHoles, In3_Cu, "clearance-holes" ); + DUMP_POLYS_TO_COPPER_LAYER( clearanceHoles, In3_Cu, wxT( "clearance-holes" ) ); if( m_progressReporter && m_progressReporter->IsCancelled() ) return false; @@ -1116,16 +1117,16 @@ bool ZONE_FILLER::computeRawFilledArea( const ZONE* aZone, static const bool USE_BBOX_CACHES = true; SHAPE_POLY_SET testAreas = aRawPolys; testAreas.BooleanSubtract( clearanceHoles, SHAPE_POLY_SET::PM_FAST ); - DUMP_POLYS_TO_COPPER_LAYER( testAreas, In4_Cu, "minus-clearance-holes" ); + DUMP_POLYS_TO_COPPER_LAYER( testAreas, In4_Cu, wxT( "minus-clearance-holes" ) ); // Prune features that don't meet minimum-width criteria if( half_min_width - epsilon > epsilon ) { testAreas.Deflate( half_min_width - epsilon, numSegs, fastCornerStrategy ); - DUMP_POLYS_TO_COPPER_LAYER( testAreas, In5_Cu, "spoke-test-deflated" ); + DUMP_POLYS_TO_COPPER_LAYER( testAreas, In5_Cu, wxT( "spoke-test-deflated" ) ); testAreas.Inflate( half_min_width - epsilon, numSegs, fastCornerStrategy ); - DUMP_POLYS_TO_COPPER_LAYER( testAreas, In6_Cu, "spoke-test-reinflated" ); + DUMP_POLYS_TO_COPPER_LAYER( testAreas, In6_Cu, wxT( "spoke-test-reinflated" ) ); } if( m_progressReporter && m_progressReporter->IsCancelled() ) @@ -1174,19 +1175,19 @@ bool ZONE_FILLER::computeRawFilledArea( const ZONE* aZone, } } - DUMP_POLYS_TO_COPPER_LAYER( debugSpokes, In7_Cu, "spokes" ); + DUMP_POLYS_TO_COPPER_LAYER( debugSpokes, In7_Cu, wxT( "spokes" ) ); if( m_progressReporter && m_progressReporter->IsCancelled() ) return false; aRawPolys.BooleanSubtract( clearanceHoles, SHAPE_POLY_SET::PM_FAST ); - DUMP_POLYS_TO_COPPER_LAYER( aRawPolys, In8_Cu, "after-spoke-trimming" ); + DUMP_POLYS_TO_COPPER_LAYER( aRawPolys, In8_Cu, wxT( "after-spoke-trimming" ) ); // Prune features that don't meet minimum-width criteria if( half_min_width - epsilon > epsilon ) aRawPolys.Deflate( half_min_width - epsilon, numSegs, cornerStrategy ); - DUMP_POLYS_TO_COPPER_LAYER( aRawPolys, In9_Cu, "deflated" ); + DUMP_POLYS_TO_COPPER_LAYER( aRawPolys, In9_Cu, wxT( "deflated" ) ); if( m_progressReporter && m_progressReporter->IsCancelled() ) return false; @@ -1212,18 +1213,18 @@ bool ZONE_FILLER::computeRawFilledArea( const ZONE* aZone, aRawPolys.Inflate( half_min_width - epsilon, numSegs, cornerStrategy ); } - DUMP_POLYS_TO_COPPER_LAYER( aRawPolys, In15_Cu, "after-reinflating" ); + DUMP_POLYS_TO_COPPER_LAYER( aRawPolys, In15_Cu, wxT( "after-reinflating" ) ); // Ensure additive changes (thermal stubs and particularly inflating acute corners) do not // add copper outside the zone boundary or inside the clearance holes aRawPolys.BooleanIntersection( aMaxExtents, SHAPE_POLY_SET::PM_FAST ); - DUMP_POLYS_TO_COPPER_LAYER( aRawPolys, In16_Cu, "after-trim-to-outline" ); + DUMP_POLYS_TO_COPPER_LAYER( aRawPolys, In16_Cu, wxT( "after-trim-to-outline" ) ); aRawPolys.BooleanSubtract( clearanceHoles, SHAPE_POLY_SET::PM_FAST ); - DUMP_POLYS_TO_COPPER_LAYER( aRawPolys, In17_Cu, "after-trim-to-clearance-holes" ); + DUMP_POLYS_TO_COPPER_LAYER( aRawPolys, In17_Cu, wxT( "after-trim-to-clearance-holes" ) ); // Lastly give any same-net but higher-priority zones control over their own area. subtractHigherPriorityZones( aZone, aLayer, aRawPolys ); - DUMP_POLYS_TO_COPPER_LAYER( aRawPolys, In18_Cu, "minus-higher-priority-zones" ); + DUMP_POLYS_TO_COPPER_LAYER( aRawPolys, In18_Cu, wxT( "minus-higher-priority-zones" ) ); aRawPolys.Fracture( SHAPE_POLY_SET::PM_FAST ); return true; @@ -1548,7 +1549,7 @@ bool ZONE_FILLER::addHatchFillTypeOnZone( const ZONE* aZone, PCB_LAYER_ID aLayer if( !aZone->GetHatchOrientation().IsZero() ) holes.Rotate( aZone->GetHatchOrientation() ); - DUMP_POLYS_TO_COPPER_LAYER( holes, In10_Cu, "hatch-holes" ); + DUMP_POLYS_TO_COPPER_LAYER( holes, In10_Cu, wxT( "hatch-holes" ) ); int outline_margin = aZone->GetMinThickness() * 1.1; @@ -1561,12 +1562,12 @@ bool ZONE_FILLER::addHatchFillTypeOnZone( const ZONE* aZone, PCB_LAYER_ID aLayer SHAPE_POLY_SET deflatedFilledPolys = aRawPolys; deflatedFilledPolys.Deflate( outline_margin - aZone->GetMinThickness(), 16 ); holes.BooleanIntersection( deflatedFilledPolys, SHAPE_POLY_SET::PM_FAST ); - DUMP_POLYS_TO_COPPER_LAYER( holes, In11_Cu, "fill-clipped-hatch-holes" ); + DUMP_POLYS_TO_COPPER_LAYER( holes, In11_Cu, wxT( "fill-clipped-hatch-holes" ) ); SHAPE_POLY_SET deflatedOutline = *aZone->Outline(); deflatedOutline.Deflate( outline_margin, 16 ); holes.BooleanIntersection( deflatedOutline, SHAPE_POLY_SET::PM_FAST ); - DUMP_POLYS_TO_COPPER_LAYER( holes, In12_Cu, "outline-clipped-hatch-holes" ); + DUMP_POLYS_TO_COPPER_LAYER( holes, In12_Cu, wxT( "outline-clipped-hatch-holes" ) ); if( aZone->GetNetCode() != 0 ) { @@ -1625,7 +1626,7 @@ bool ZONE_FILLER::addHatchFillTypeOnZone( const ZONE* aZone, PCB_LAYER_ID aLayer holes.BooleanSubtract( aprons, SHAPE_POLY_SET::PM_FAST ); } - DUMP_POLYS_TO_COPPER_LAYER( holes, In13_Cu, "pad-via-clipped-hatch-holes" ); + DUMP_POLYS_TO_COPPER_LAYER( holes, In13_Cu, wxT( "pad-via-clipped-hatch-holes" ) ); // Now filter truncated holes to avoid small holes in pattern // It happens for holes near the zone outline @@ -1642,7 +1643,7 @@ bool ZONE_FILLER::addHatchFillTypeOnZone( const ZONE* aZone, PCB_LAYER_ID aLayer // create grid. Use SHAPE_POLY_SET::PM_STRICTLY_SIMPLE to // generate strictly simple polygons needed by Gerber files and Fracture() aRawPolys.BooleanSubtract( aRawPolys, holes, SHAPE_POLY_SET::PM_STRICTLY_SIMPLE ); - DUMP_POLYS_TO_COPPER_LAYER( aRawPolys, In14_Cu, "after-hatching" ); + DUMP_POLYS_TO_COPPER_LAYER( aRawPolys, In14_Cu, wxT( "after-hatching" ) ); return true; } diff --git a/pcbnew/zone_settings.cpp b/pcbnew/zone_settings.cpp index 12b9f182bb..1202b4de81 100644 --- a/pcbnew/zone_settings.cpp +++ b/pcbnew/zone_settings.cpp @@ -230,7 +230,7 @@ void ZONE_SETTINGS::SetupLayersList( wxDataViewListCtrl* aList, PCB_BASE_FRAME* wxVector row; row.push_back( wxVariant( m_Layers.test( layerID ) ) ); row.push_back( wxVariant( wxDataViewIconText( layerName, icon ) ) ); - row.push_back( wxVariant( wxString::Format( "%i", layerID ) ) ); + row.push_back( wxVariant( wxString::Format( wxT( "%i" ), layerID ) ) ); aList->AppendItem( row ); if( m_Layers.test( layerID ) )