More wxSing

This commit is contained in:
Marek Roszko 2023-01-16 23:14:38 -05:00
parent 358a05a2c8
commit d2c0f5fc2a
63 changed files with 240 additions and 238 deletions

View File

@ -234,16 +234,16 @@ wxString GetKeyName( const wxKeyEvent &aEvent )
wxString dump( const wxKeyEvent& aEvent )
{
wxString msg;
wxString eventType = "unknown";
wxString eventType = wxS( "unknown" );
if( aEvent.GetEventType() == wxEVT_KEY_DOWN )
eventType = "KeyDown";
eventType = wxS( "KeyDown" );
else if( aEvent.GetEventType() == wxEVT_KEY_UP )
eventType = "KeyUp";
eventType = wxS( "KeyUp" );
else if( aEvent.GetEventType() == wxEVT_CHAR )
eventType = "Char";
eventType = wxS( "Char" );
else if( aEvent.GetEventType() == wxEVT_CHAR_HOOK )
eventType = "Hook";
eventType = wxS( "Hook" );
// event key_name KeyCode modifiers Unicode raw_code raw_flags pos
msg.Printf( "%7s %15s %5d %c%c%c%c"

View File

@ -108,7 +108,7 @@ int UTF8::uni_forward( const unsigned char* aSequence, unsigned* aResult )
default:
case 0:
if( aResult )
wxFAIL_MSG( "uni_forward: invalid start byte" );
wxFAIL_MSG( wxS( "uni_forward: invalid start byte" ) );
return 0;
break;
@ -117,7 +117,7 @@ int UTF8::uni_forward( const unsigned char* aSequence, unsigned* aResult )
if( ( s[1] & 0xc0 ) != 0x80 )
{
if( aResult )
wxFAIL_MSG( "uni_forward: invalid continuation byte" );
wxFAIL_MSG( wxS( "uni_forward: invalid continuation byte" ) );
return 0;
}
@ -136,7 +136,7 @@ int UTF8::uni_forward( const unsigned char* aSequence, unsigned* aResult )
)
{
if( aResult )
wxFAIL_MSG( "uni_forward: invalid continuation byte" );
wxFAIL_MSG( wxS( "uni_forward: invalid continuation byte" ) );
return 0;
}
@ -156,7 +156,7 @@ int UTF8::uni_forward( const unsigned char* aSequence, unsigned* aResult )
(s[0] == 0xF4 && s[1] > 0x8F) )
{
if( aResult )
wxFAIL_MSG( "uni_forward: invalid continuation byte" );
wxFAIL_MSG( wxS( "uni_forward: invalid continuation byte" ) );
return 0;
}

View File

@ -74,7 +74,7 @@ FOOTPRINT_NAME_VALIDATOR::FOOTPRINT_NAME_VALIDATOR( wxString* aValue ) :
// This list of characters follows the string from footprint.cpp which, in turn mimics the
// strings from lib_id.cpp
// TODO: Unify forbidden character lists
wxString illegalChars = "%$<>\t\n\r\"\\/:";
wxString illegalChars = wxS( "%$<>\t\n\r\"\\/:" );
SetCharExcludes( illegalChars );
}
@ -377,7 +377,7 @@ void KIUI::ValidatorTransferToWindowWithoutEvents( wxValidator& aValidator )
{
wxWindow* ctrl = aValidator.GetWindow();
wxCHECK_RET( ctrl != nullptr, "Transferring validator data without a control" );
wxCHECK_RET( ctrl != nullptr, wxS( "Transferring validator data without a control" ) );
wxEventBlocker orient_update_blocker( ctrl, wxEVT_ANY );
aValidator.TransferToWindow();

View File

@ -1155,7 +1155,7 @@ void VIEW::Redraw()
#ifdef KICAD_GAL_PROFILE
totalRealTime.Stop();
wxLogTrace( traceGalProfile, "VIEW::Redraw(): %.1f ms", totalRealTime.msecs() );
wxLogTrace( traceGalProfile, wxS( "VIEW::Redraw(): %.1f ms" ), totalRealTime.msecs() );
#endif /* KICAD_GAL_PROFILE */
}
@ -1471,7 +1471,7 @@ void VIEW::UpdateItems()
}
}
KI_TRACE( traceGalProfile, "View update: total items %u, geom %u anyUpdated %u\n", cntTotal,
KI_TRACE( traceGalProfile, wxS( "View update: total items %u, geom %u anyUpdated %u\n" ), cntTotal,
cntGeomUpdate, (unsigned) anyUpdated );
}

View File

@ -343,7 +343,7 @@ void BITMAP_BUTTON::SetIsSeparator()
void BITMAP_BUTTON::Check( bool aCheck )
{
wxASSERT_MSG( hasFlag( wxCONTROL_CHECKABLE ), "Button is not a checkButton." );
wxASSERT_MSG( hasFlag( wxCONTROL_CHECKABLE ), wxS( "Button is not a checkButton." ) );
if( aCheck && !hasFlag( wxCONTROL_CHECKED ) )
{
@ -361,7 +361,7 @@ void BITMAP_BUTTON::Check( bool aCheck )
bool BITMAP_BUTTON::IsChecked() const
{
wxASSERT_MSG( hasFlag( wxCONTROL_CHECKABLE ), "Button is not a checkButton." );
wxASSERT_MSG( hasFlag( wxCONTROL_CHECKABLE ), wxS( "Button is not a checkButton." ) );
return hasFlag( wxCONTROL_CHECKED );
}

View File

@ -120,7 +120,7 @@ COLOR_SWATCH::COLOR_SWATCH( wxWindow* aParent, const COLOR4D& aColor, int aID,
m_readOnly( false ),
m_supportsOpacity( true )
{
wxASSERT_MSG( aSwatchSize != SWATCH_EXPAND, "SWATCH_EXPAND not supported in COLOR_SWATCH" );
wxASSERT_MSG( aSwatchSize != SWATCH_EXPAND, wxS( "SWATCH_EXPAND not supported in COLOR_SWATCH" ) );
switch( aSwatchSize )
{

View File

@ -123,7 +123,7 @@ void FOOTPRINT_CHOICE::OnDrawItem( wxDC& aDC, wxRect const& aRect, int aItem, in
wxCoord FOOTPRINT_CHOICE::OnMeasureItem( size_t aItem ) const
{
if( SafeGetString( aItem ) == "" )
if( SafeGetString( aItem ) == wxS( "" ) )
return 11;
else
return wxOwnerDrawnComboBox::OnMeasureItem( aItem );
@ -132,7 +132,7 @@ wxCoord FOOTPRINT_CHOICE::OnMeasureItem( size_t aItem ) const
wxCoord FOOTPRINT_CHOICE::OnMeasureItemWidth( size_t aItem ) const
{
if( SafeGetString( aItem ) == "" )
if( SafeGetString( aItem ) == wxS( "" ) )
return GetTextRect().GetWidth() - 2;
else
return wxOwnerDrawnComboBox::OnMeasureItemWidth( aItem );
@ -150,7 +150,7 @@ void FOOTPRINT_CHOICE::TryVetoMouse( wxMouseEvent& aEvent )
{
int item = GetVListBoxComboPopup()->VirtualHitTest( aEvent.GetPosition().y );
if( SafeGetString( item ) != "" )
if( SafeGetString( item ) != wxS( "" ) )
aEvent.Skip();
}

View File

@ -139,14 +139,14 @@ bool FOOTPRINT_SELECT_WIDGET::UpdateList()
m_fp_sel_ctrl->Append( m_default_footprint.IsEmpty() ?
_( "No default footprint" ) :
"[" + _( "Default" ) + "] " + m_default_footprint,
wxS( "[" ) + _( "Default" ) + wxS( "] " ) + m_default_footprint,
new wxStringClientData( m_default_footprint ) );
if( !m_zero_filter )
{
for( FOOTPRINT_INFO& fpinfo : m_fp_filter )
{
wxString display_name( fpinfo.GetLibNickname() + ":" + fpinfo.GetFootprintName() );
wxString display_name( fpinfo.GetLibNickname() + wxS( ":" ) + fpinfo.GetFootprintName() );
m_fp_sel_ctrl->Append( display_name, new wxStringClientData( display_name ) );
++n_items;

View File

@ -139,11 +139,11 @@ void NUMBER_BADGE::computeSize()
// Determine the size using the string "m999{+}" where the 'm' on the front serves as a margin
// so the number isn't too close to the curved edge.
test = "m";
test = wxS( "m" );
test.Pad( len, '9' );
if( m_currentNumber > m_maxNumber )
test += "+";
test += wxS( "+" );
dc.SetFont( wxFont( m_textSize, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, BADGE_FONTWEIGHT ) );
wxSize size = dc.GetTextExtent( test );

View File

@ -255,7 +255,7 @@ void PROPERTIES_PANEL::update( const SELECTION& aSelection )
if( !converted )
{
wxFAIL_MSG( "Could not convert wxAny to wxVariant" );
wxFAIL_MSG( wxS( "Could not convert wxAny to wxVariant" ) );
available = false;
break;
}
@ -345,7 +345,7 @@ void PROPERTIES_PANEL::onCharHook( wxKeyEvent& aEvent )
m_grid->CommitChangesFromEditor();
/* don't skip this one; if we're not the last property we'll also go to the next row */
}
aEvent.Skip();
}

View File

@ -30,19 +30,19 @@
#include <wx/menu.h>
#include <wx/renderer.h>
#include <wx/settings.h>
#include <wx/version.h>
#include <wx/version.h>
#include <kiplatform/ui.h>
SPLIT_BUTTON::SPLIT_BUTTON( wxWindow* aParent, wxWindowID aId, const wxString& aLabel,
const wxPoint& aPos, const wxSize& aSize ) :
wxPanel( aParent, aId, aPos, aSize, wxBORDER_NONE | wxTAB_TRAVERSAL, "DropDownButton" ),
wxPanel( aParent, aId, aPos, aSize, wxBORDER_NONE | wxTAB_TRAVERSAL, wxS( "DropDownButton" ) ),
m_label( aLabel )
{
if( aSize == wxDefaultSize )
{
#if wxCHECK_VERSION( 3, 1, 3 )
wxSize defaultSize = wxButton::GetDefaultSize( aParent );
#else
#else
wxSize defaultSize = wxButton::GetDefaultSize();
#endif

View File

@ -29,20 +29,20 @@
#include <wx/menu.h>
#include <wx/renderer.h>
#include <wx/settings.h>
#include <wx/version.h>
#include <wx/version.h>
#include <kiplatform/ui.h>
STD_BITMAP_BUTTON::STD_BITMAP_BUTTON( wxWindow* aParent, wxWindowID aId,
const wxBitmap& aDummyBitmap, const wxPoint& aPos,
const wxSize& aSize, int aStyle ) :
wxPanel( aParent, aId, aPos, aSize, aStyle, "StdBitmapButton" )
wxPanel( aParent, aId, aPos, aSize, aStyle, wxS( "StdBitmapButton" ) )
{
if( aSize == wxDefaultSize )
{
#if wxCHECK_VERSION( 3, 1, 3 )
wxSize defaultSize = wxButton::GetDefaultSize( aParent );
#else
#else
wxSize defaultSize = wxButton::GetDefaultSize();
#endif
@ -56,7 +56,7 @@ STD_BITMAP_BUTTON::STD_BITMAP_BUTTON( wxWindow* aParent, wxWindowID aId,
Bind( wxEVT_LEAVE_WINDOW, &STD_BITMAP_BUTTON::OnMouseLeave, this );
Bind( wxEVT_ENTER_WINDOW, &STD_BITMAP_BUTTON::OnMouseEnter, this );
Bind( wxEVT_SYS_COLOUR_CHANGED,
Bind( wxEVT_SYS_COLOUR_CHANGED,
wxSysColourChangedEventHandler( STD_BITMAP_BUTTON::onThemeChanged ),
this );
}

View File

@ -91,7 +91,7 @@ wxFont KIUI::GetMonospacedUIFont()
#ifdef __WXMAC__
// https://trac.wxwidgets.org/ticket/19210
if( font.GetFaceName().IsEmpty() )
font.SetFaceName( "Menlo" );
font.SetFaceName( wxS( "Menlo" ) );
#endif
return font;
@ -119,7 +119,7 @@ wxFont getGUIFont( wxWindow* aWindow, int aRelativeSize )
#ifdef __WXMAC__
// https://trac.wxwidgets.org/ticket/19210
if( font.GetFaceName().IsEmpty() )
font.SetFaceName( "San Francisco" );
font.SetFaceName( wxS( "San Francisco" ) );
// OSX 10.1 .. 10.9: Lucida Grande
// OSX 10.10: Helvetica Neue
// OSX 10.11 .. : San Francisco

View File

@ -301,7 +301,7 @@ void WIDGET_HOTKEY_LIST::updateFromClientData()
// mark unsaved changes
if( changed_hk.m_EditKeycode != changed_hk.m_Actions[ 0 ]->GetHotKey() )
label += " *";
label += wxS( " *" );
description.Replace( wxS( "\n" ), wxS( " " ) );
description.Replace( wxS( "\r" ), wxS( " " ) );
@ -467,7 +467,7 @@ WIDGET_HOTKEY_LIST::WIDGET_HOTKEY_LIST( wxWindow* aParent, HOTKEY_STORE& aHotkey
wxString command_header = _( "Command" );
if( !m_readOnly )
command_header << " " << _( "(double-click to edit)" );
command_header << wxS( " " ) << _( "(double-click to edit)" );
AppendColumn( command_header, 450, wxALIGN_LEFT, wxCOL_RESIZABLE | wxCOL_SORTABLE );
AppendColumn( _( "Hotkey" ), 120, wxALIGN_LEFT, wxCOL_RESIZABLE | wxCOL_SORTABLE );
@ -495,8 +495,8 @@ WIDGET_HOTKEY_LIST::WIDGET_HOTKEY_LIST( wxWindow* aParent, HOTKEY_STORE& aHotkey
std::vector<wxString> reserved_keys =
{
"Ctrl+Tab",
"Ctrl+Shift+Tab"
wxS( "Ctrl+Tab" ),
wxS( "Ctrl+Shift+Tab" )
};
for( const wxString& key : reserved_keys )
@ -506,7 +506,7 @@ WIDGET_HOTKEY_LIST::WIDGET_HOTKEY_LIST( wxWindow* aParent, HOTKEY_STORE& aHotkey
if( code )
m_reservedHotkeys[code] = key;
else
wxLogWarning( "Unknown reserved keycode %s\n", key );
wxLogWarning( wxS( "Unknown reserved keycode %s\n" ), key );
}
GetDataView()->SetIndent( 10 );

View File

@ -524,7 +524,7 @@ int WX_GRID::GetVisibleWidth( int aCol, bool aHeader, bool aContents, bool aKeep
size = GetRowLabelSize();
for( int row = 0; aContents && row < GetNumberRows(); row++ )
size = std::max( size, int( GetTextExtent( GetRowLabelValue( row ) + "M" ).x ) );
size = std::max( size, int( GetTextExtent( GetRowLabelValue( row ) + wxS( "M" ) ).x ) );
}
else
{
@ -537,14 +537,14 @@ int WX_GRID::GetVisibleWidth( int aCol, bool aHeader, bool aContents, bool aKeep
{
EnsureColLabelsVisible();
size = std::max( size, int( GetTextExtent( GetColLabelValue( aCol ) + "M" ).x ) );
size = std::max( size, int( GetTextExtent( GetColLabelValue( aCol ) + wxS( "M" ) ).x ) );
}
for( int row = 0; aContents && row < GetNumberRows(); row++ )
{
// If we have text, get the size. Otherwise, use a placeholder for the checkbox
if( GetTable()->CanGetValueAs( row, aCol, wxGRID_VALUE_STRING ) )
size = std::max( size, GetTextExtent( GetCellValue( row, aCol ) + "M" ).x );
size = std::max( size, GetTextExtent( GetCellValue( row, aCol ) + wxS( "M" ) ).x );
else
size = std::max( size, GetTextExtent( "MM" ).x );
}

View File

@ -189,20 +189,20 @@ wxString WX_HTML_REPORT_PANEL::generateHtml( const REPORT_LINE& aLine )
switch( aLine.severity )
{
case RPT_SEVERITY_ERROR:
retv = "<font color=#F04040 size=3>" + _( "Error:" ) + " </font>"
"<font size=3>" + aLine.message + "</font><br>";
retv = wxS( "<font color=#F04040 size=3>" ) + _( "Error:" ) + wxS( " </font>" )
wxS( "<font size=3>" ) + aLine.message + wxS( "</font><br>" );
break;
case RPT_SEVERITY_WARNING:
retv = "<font size=3>" + _( "Warning:" ) + wxS( " " ) + aLine.message + "</font><br>";
retv = wxS( "<font size=3>" ) + _( "Warning:" ) + wxS( " " ) + aLine.message + wxS( "</font><br>" );
break;
case RPT_SEVERITY_INFO:
retv = "<font color=#909090 size=3>" + aLine.message + "</font><br>";
retv = wxS( "<font color=#909090 size=3>" ) + aLine.message + wxS( "</font><br>" );
break;
case RPT_SEVERITY_ACTION:
retv = "<font color=#60D060 size=3>" + aLine.message + "</font><br>";
retv = wxS( "<font color=#60D060 size=3>" ) + aLine.message + wxS( "</font><br>" );
break;
default:
retv = "<font size=3>" + aLine.message + "</font><br>";
retv = wxS( "<font size=3>" ) + aLine.message + wxS( "</font><br>" );
}
}
else
@ -210,26 +210,26 @@ wxString WX_HTML_REPORT_PANEL::generateHtml( const REPORT_LINE& aLine )
switch( aLine.severity )
{
case RPT_SEVERITY_ERROR:
retv = "<font color=#D00000 size=3>" + _( "Error:" ) + " </font>"
"<font size=3>" + aLine.message + "</font><br>";
retv = wxS( "<font color=#D00000 size=3>" ) + _( "Error:" ) + wxS( " </font>" )
wxS( "<font size=3>" ) + aLine.message + wxS( "</font><br>" );
break;
case RPT_SEVERITY_WARNING:
retv = "<font size=3>" + _( "Warning:" ) + wxS( " " ) + aLine.message + "</font><br>";
retv = wxS( "<font size=3>" ) + _( "Warning:" ) + wxS( " " ) + aLine.message + wxS( "</font><br>" );
break;
case RPT_SEVERITY_INFO:
retv = "<font color=#808080 size=3>" + aLine.message + "</font><br>";
retv = wxS( "<font color=#808080 size=3>" ) + aLine.message + wxS( "</font><br>" );
break;
case RPT_SEVERITY_ACTION:
retv = "<font color=#008000 size=3>" + aLine.message + "</font><br>";
retv = wxS( "<font color=#008000 size=3>" ) + aLine.message + wxS( "</font><br>" );
break;
default:
retv = "<font size=3>" + aLine.message + "</font><br>";
retv = wxS( "<font size=3>" ) + aLine.message + wxS( "</font><br>" );
}
}
// wxHtmlWindow fails to do correct baseline alignment between Japanese/Chinese cells and
// Roman cells. This keeps the line in a single cell.
retv.Replace( " ", "&nbsp;" );
retv.Replace( wxS( " " ), wxS( "&nbsp;" ) );
return retv;
}

View File

@ -88,23 +88,23 @@ wxString AddFileExtListToFilter( const std::vector<std::string>& aExts )
{
// The "all files" wildcard is different on different systems
wxString filter;
filter << " (" << wxFileSelectorDefaultWildcardStr << ")|"
filter << wxS( " (" ) << wxFileSelectorDefaultWildcardStr << wxS( ")|" )
<< wxFileSelectorDefaultWildcardStr;
return filter;
}
wxString files_filter = " (";
wxString files_filter = wxS( " (" );
// Add extensions to the info message:
for( const std::string& ext : aExts )
{
if( files_filter.length() > 2 )
files_filter << "; ";
files_filter << wxS( "; " );
files_filter << "*." << ext;
}
files_filter << ")|*.";
files_filter << wxS( ")|*." );
// Add extensions to the filter list, using a formatted string (GTK specific):
bool first = true;
@ -112,7 +112,7 @@ wxString AddFileExtListToFilter( const std::vector<std::string>& aExts )
for( const std::string& ext : aExts )
{
if( !first )
files_filter << ";*.";
files_filter << wxS( ";*." );
first = false;

View File

@ -80,7 +80,7 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( KIWAY* aKiway, wxWindow* aParent ) :
m_tcFilterString = nullptr;
m_FootprintsList = FOOTPRINT_LIST::GetInstance( Kiway() );
m_initialized = false;
m_aboutTitle = "CvPcb";
m_aboutTitle = wxS( "CvPcb" );
// Give an icon
wxIcon icon;

View File

@ -127,13 +127,13 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( KIWAY* aKiway, wxWindow* aPa
m_auimgr.SetManagedWindow( this );
CreateInfoBar();
m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" )
m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( wxS( "MainToolbar" ) )
.Top().Layer( 6 ) );
m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( "OptToolbar" )
m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( wxS( "OptToolbar" ) )
.Left().Layer( 3 ) );
m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" )
m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( wxS( "DrawFrame" ) )
.Center() );
m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" )
m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( wxS( "MsgPanel" ) )
.Bottom().Layer( 6 ) );
FinishAUIInitialization();

View File

@ -158,7 +158,7 @@ void FOOTPRINTS_LISTBOX::SetFootprints( FOOTPRINT_LIST& aList, const wxString& a
for( const FOOTPRINT_INFO& i : filter )
{
msg.Printf( "%3d %s:%s",
msg.Printf( wxS( "%3d %s:%s" ),
int( newList.GetCount() + 1 ),
i.GetLibNickname(),
i.GetFootprintName() );
@ -211,7 +211,7 @@ void FOOTPRINTS_LISTBOX::OnLeftDClick( wxListEvent& event )
void FOOTPRINTS_LISTBOX::OnChar( wxKeyEvent& event )
{
wxLogTrace( kicadTraceKeyEvent, "FOOTPRINTS_LISTBOX::OnChar %s", dump( event ) );
wxLogTrace( kicadTraceKeyEvent, wxS( "FOOTPRINTS_LISTBOX::OnChar %s" ), dump( event ) );
int key = event.GetKeyCode();

View File

@ -142,7 +142,7 @@ END_EVENT_TABLE()
void LIBRARY_LISTBOX::OnChar( wxKeyEvent& event )
{
wxLogTrace( kicadTraceKeyEvent, "LIBRARY_LISTBOX::OnChar %s", dump( event ) );
wxLogTrace( kicadTraceKeyEvent, wxS( "LIBRARY_LISTBOX::OnChar %s" ), dump( event ) );
int key = event.GetKeyCode();

View File

@ -82,7 +82,7 @@ void ITEMS_LISTBOX_BASE::UpdateLineWidth( unsigned aLine, wxClientDC& dc )
str = OnGetItemText( aLine, 0 );
else
str = GetItemText( aLine, 0 );
str += " ";
str += wxS( " " );
dc.GetTextExtent( str, &w, nullptr );
newWidth += w;

View File

@ -71,7 +71,7 @@ void CVPCB_MAINFRAME::doReCreateMenuBar()
// 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..." ) + wxS( "\tCtrl+," ),
_( "Show preferences for all open tools" ),
wxID_PREFERENCES,
BITMAPS::preference );

View File

@ -35,7 +35,7 @@
SYMBOLS_LISTBOX::SYMBOLS_LISTBOX( CVPCB_MAINFRAME* parent, wxWindowID id ) :
ITEMS_LISTBOX_BASE( parent, id ),
ITEMS_LISTBOX_BASE( parent, id ),
m_warningAttr( std::make_unique<wxListItemAttr>() )
{
m_warningAttr->SetBackgroundColour( KIPLATFORM::UI::IsDarkTheme()
@ -101,7 +101,7 @@ void SYMBOLS_LISTBOX::AppendWarning( int index )
void SYMBOLS_LISTBOX::RemoveWarning( int index )
{
if( auto const found{ std::find( m_symbolWarning.begin(), m_symbolWarning.end(), index ) };
if( auto const found{ std::find( m_symbolWarning.begin(), m_symbolWarning.end(), index ) };
found != m_symbolWarning.end() )
{
m_symbolWarning.erase( found );
@ -121,7 +121,7 @@ wxListItemAttr* SYMBOLS_LISTBOX::OnGetItemAttr( long item ) const
{
return m_warningAttr.get();
}
return nullptr;
return nullptr;
}
@ -144,7 +144,7 @@ void SYMBOLS_LISTBOX::SetSelection( int index, bool State )
void SYMBOLS_LISTBOX::OnChar( wxKeyEvent& event )
{
wxLogTrace( kicadTraceKeyEvent, "SYMBOLS_LISTBOX::OnChar %s", dump( event ) );
wxLogTrace( kicadTraceKeyEvent, wxS( "SYMBOLS_LISTBOX::OnChar %s" ), dump( event ) );
int key = event.GetKeyCode();

View File

@ -150,7 +150,7 @@ public:
for( unsigned field_idx = 0; field_idx < m_fields.size(); ++field_idx )
{
SCH_FIELD* field = m_fields[field_idx];
if( !field->IsVisible() || !field->CanAutoplace() )
continue;
@ -248,7 +248,7 @@ protected:
case PIN_UP: return SIDE_BOTTOM;
case PIN_DOWN: return SIDE_TOP;
default:
wxFAIL_MSG( "Invalid pin orientation" );
wxFAIL_MSG( wxS( "Invalid pin orientation" ) );
return SIDE_LEFT;
}
}
@ -278,7 +278,7 @@ protected:
*/
void getPossibleCollisions( std::vector<SCH_ITEM*>& aItems )
{
wxCHECK_RET( m_screen, "getPossibleCollisions() with null m_screen" );
wxCHECK_RET( m_screen, wxS( "getPossibleCollisions() with null m_screen" ) );
BOX2I symbolBox = m_symbol->GetBodyAndPinsBoundingBox();
std::vector<SIDE_AND_NPINS> sides = getPreferredSides();
@ -670,7 +670,7 @@ protected:
field_xcoord = aFieldBox.GetRight();
break;
default:
wxFAIL_MSG( "Unexpected value for SCH_FIELD::GetHorizJustify()" );
wxFAIL_MSG( wxS( "Unexpected value for SCH_FIELD::GetHorizJustify()" ) );
field_xcoord = aFieldBox.Centre().x; // Most are centered
}
@ -739,7 +739,7 @@ const AUTOPLACER::SIDE AUTOPLACER::SIDE_RIGHT( 1, 0 );
void SCH_SYMBOL::AutoplaceFields( SCH_SCREEN* aScreen, bool aManual )
{
if( aManual )
wxASSERT_MSG( aScreen, "A SCH_SCREEN pointer must be given for manual autoplacement" );
wxASSERT_MSG( aScreen, wxS( "A SCH_SCREEN pointer must be given for manual autoplacement" ) );
AUTOPLACER autoplacer( this, aScreen );
autoplacer.DoAutoplace( aManual );

View File

@ -60,7 +60,7 @@ BOM_GENERATOR_HANDLER::BOM_GENERATOR_HANDLER( const wxString& aFile )
if( extension == wxS( "xsl" ) )
{
m_info = readHeader( wxS( "-->" ) );
m_cmd = wxString::Format( "xsltproc -o \"%%O%s\" \"%s\" \"%%I\"",
m_cmd = wxString::Format( wxS( "xsltproc -o \"%%O%s\" \"%s\" \"%%I\"" ),
getOutputExtension( m_info ),
m_file.GetFullPath() );
}
@ -110,7 +110,7 @@ BOM_GENERATOR_HANDLER::BOM_GENERATOR_HANDLER( const wxString& aFile )
else if( extension == wxS( "pyw" ) )
{
m_info = readHeader( wxS( "\"\"\"" ) );
m_cmd = wxString::Format( "pythonw \"%s/%s\" \"%%I\" \"%%O%s\"",
m_cmd = wxString::Format( wxS( "pythonw \"%s/%s\" \"%%I\" \"%%O%s\"" ),
m_file.GetPath(),
m_file.GetFullName(),
getOutputExtension( m_info ) );
@ -121,7 +121,7 @@ BOM_GENERATOR_HANDLER::BOM_GENERATOR_HANDLER( const wxString& aFile )
m_cmd = m_file.GetFullPath();
}
wxLogTrace( BOM_TRACE, "%s: extracted command line %s", m_name, m_cmd );
wxLogTrace( BOM_TRACE, wxS( "%s: extracted command line %s" ), m_name, m_cmd );
}
@ -145,7 +145,7 @@ wxString BOM_GENERATOR_HANDLER::readHeader( const wxString& aEndSection )
if( aEndSection.IsEmpty() )
return wxEmptyString;
wxFFile fdata( m_file.GetFullPath(), "rb" ); // dtor will close the file
wxFFile fdata( m_file.GetFullPath(), wxS( "rb" ) ); // dtor will close the file
wxString data;
if( !fdata.ReadAll( &data ) )
@ -177,7 +177,7 @@ wxString BOM_GENERATOR_HANDLER::getOutputExtension( const wxString& aHeader )
{
// search header for extension after %O (extension includes '.')
// looks for output argument of the form `"%O.extension"`
const wxString outputarg( "\"%O" );
const wxString outputarg( wxS( "\"%O" ) );
int strstart = aHeader.Find( outputarg );
@ -185,7 +185,7 @@ wxString BOM_GENERATOR_HANDLER::getOutputExtension( const wxString& aHeader )
return wxEmptyString;
strstart += outputarg.Length();
int strend = aHeader.find( "\"", strstart );
int strend = aHeader.find( wxS( "\"" ), strstart );
if( strend == wxNOT_FOUND )
return wxEmptyString;

View File

@ -236,7 +236,7 @@ wxString CONNECTION_SUBGRAPH::GetNetName() const
if( !m_driver->Connection( &m_sheet ) )
{
#ifdef CONNECTIVITY_DEBUG
wxASSERT_MSG( false, "Tried to get the net name of an item with no connection" );
wxASSERT_MSG( false, wxS( "Tried to get the net name of an item with no connection" ) );
#endif
return "";
@ -297,7 +297,7 @@ wxString CONNECTION_SUBGRAPH::driverName( SCH_ITEM* aItem ) const
}
default:
wxFAIL_MSG( "Unhandled item type in GetNameForDriver" );
wxFAIL_MSG( wxS( "Unhandled item type in GetNameForDriver" ) );
break;
}
@ -779,7 +779,7 @@ void CONNECTION_GRAPH::updateItemConnectivity( const SCH_SHEET_PATH& aSheet,
void CONNECTION_GRAPH::buildItemSubGraphs()
{
// Recache all bus aliases for later use
wxCHECK_RET( m_schematic, "Connection graph cannot be built without schematic pointer" );
wxCHECK_RET( m_schematic, wxS( "Connection graph cannot be built without schematic pointer" ) );
SCH_SHEET_LIST all_sheets = m_schematic->GetSheets();
@ -991,7 +991,7 @@ void CONNECTION_GRAPH::collectAllDriverValues()
{
UNITS_PROVIDER unitsProvider( schIUScale, EDA_UNITS::MILLIMETRES );
wxLogTrace( ConnTrace, "Unexpected strong driver %s",
wxLogTrace( ConnTrace, wxS( "Unexpected strong driver %s" ),
driver->GetItemDescription( &unitsProvider ) );
break;
}
@ -1136,7 +1136,7 @@ void CONNECTION_GRAPH::processSubGraphs()
while( m_net_name_to_subgraphs_map.count( new_name ) )
new_name = create_new_name( connection );
wxLogTrace( ConnTrace, "%ld (%s) is weakly driven and not unique. Changing to %s.",
wxLogTrace( ConnTrace, wxS( "%ld (%s) is weakly driven and not unique. Changing to %s." ),
subgraph->m_code, name, new_name );
alg::delete_matching( *vec, subgraph );
@ -1177,7 +1177,7 @@ void CONNECTION_GRAPH::processSubGraphs()
if( conflict )
{
wxLogTrace( ConnTrace,
"%ld (%s) skipped for promotion due to potential conflict",
wxS( "%ld (%s) skipped for promotion due to potential conflict" ),
subgraph->m_code, name );
}
else
@ -1185,7 +1185,7 @@ void CONNECTION_GRAPH::processSubGraphs()
UNITS_PROVIDER unitsProvider( schIUScale, EDA_UNITS::MILLIMETRES );
wxLogTrace( ConnTrace,
"%ld (%s) weakly driven by unique sheet pin %s, promoting",
wxS( "%ld (%s) weakly driven by unique sheet pin %s, promoting" ),
subgraph->m_code, name,
subgraph->m_driver->GetItemDescription( &unitsProvider ) );
@ -1277,7 +1277,7 @@ void CONNECTION_GRAPH::processSubGraphs()
connections_to_check.push_back( c );
wxLogTrace( ConnTrace,
"%lu (%s): Adding secondary driver %s", aSubgraph->m_code,
wxS( "%lu (%s): Adding secondary driver %s" ), aSubgraph->m_code,
aSubgraph->m_driver_connection->Name( true ),
c->Name( true ) );
}
@ -1356,7 +1356,7 @@ void CONNECTION_GRAPH::processSubGraphs()
{
if( connection->IsBus() && candidate->m_driver_connection->IsNet() )
{
wxLogTrace( ConnTrace, "%lu (%s) has bus child %lu (%s)", subgraph->m_code,
wxLogTrace( ConnTrace, wxS( "%lu (%s) has bus child %lu (%s)" ), subgraph->m_code,
connection->Name(), candidate->m_code, member->Name() );
subgraph->m_bus_neighbors[member].insert( candidate );
@ -1364,7 +1364,7 @@ void CONNECTION_GRAPH::processSubGraphs()
}
else
{
wxLogTrace( ConnTrace, "%lu (%s) absorbs neighbor %lu (%s)",
wxLogTrace( ConnTrace, wxS( "%lu (%s) absorbs neighbor %lu (%s)" ),
subgraph->m_code, connection->Name(),
candidate->m_code, candidate->m_driver_connection->Name() );
@ -1392,7 +1392,7 @@ void CONNECTION_GRAPH::processSubGraphs()
else
assignNewNetCode( *subgraph->m_driver_connection );
wxLogTrace( ConnTrace, "Re-resolving drivers for %lu (%s)", subgraph->m_code,
wxLogTrace( ConnTrace, wxS( "Re-resolving drivers for %lu (%s)" ), subgraph->m_code,
subgraph->m_driver_connection->Name() );
}
@ -1488,7 +1488,7 @@ void CONNECTION_GRAPH::buildConnectionGraph( std::function<void( SCH_ITEM* )>* a
if( !subgraph->m_dirty )
continue;
wxLogTrace( ConnTrace, "Processing %lu (%s) for propagation", subgraph->m_code,
wxLogTrace( ConnTrace, wxS( "Processing %lu (%s) for propagation" ), subgraph->m_code,
subgraph->m_driver_connection->Name() );
// For subgraphs that are driven by a global (power port or label) and have more
@ -1522,7 +1522,7 @@ void CONNECTION_GRAPH::buildConnectionGraph( std::function<void( SCH_ITEM* )>* a
if( conn->Name() == secondary_name )
{
wxLogTrace( ConnTrace, "Global %lu (%s) promoted to %s", candidate->m_code,
wxLogTrace( ConnTrace, wxS( "Global %lu (%s) promoted to %s" ), candidate->m_code,
conn->Name(), subgraph->m_driver_connection->Name() );
conn->Clone( *subgraph->m_driver_connection );
@ -1560,14 +1560,14 @@ void CONNECTION_GRAPH::buildConnectionGraph( std::function<void( SCH_ITEM* )>* a
for( CONNECTION_SUBGRAPH* subgraph : m_driver_subgraphs )
{
// All SGs should have been processed by propagateToNeighbors above
wxASSERT_MSG( !subgraph->m_dirty, "Subgraph not processed by propagateToNeighbors!" );
wxASSERT_MSG( !subgraph->m_dirty, wxS( "Subgraph not processed by propagateToNeighbors!" ) );
if( subgraph->m_bus_parents.size() < 2 )
continue;
SCH_CONNECTION* conn = subgraph->m_driver_connection;
wxLogTrace( ConnTrace, "%lu (%s) has multiple bus parents",
wxLogTrace( ConnTrace, wxS( "%lu (%s) has multiple bus parents" ),
subgraph->m_code, conn->Name() );
wxASSERT( conn->IsNet() );
@ -1585,7 +1585,7 @@ void CONNECTION_GRAPH::buildConnectionGraph( std::function<void( SCH_ITEM* )>* a
if( !match )
{
wxLogTrace( ConnTrace, "Warning: could not match %s inside %lu (%s)",
wxLogTrace( ConnTrace, wxS( "Warning: could not match %s inside %lu (%s)" ),
conn->Name(), parent->m_code, parent->m_driver_connection->Name() );
continue;
}
@ -1594,7 +1594,7 @@ void CONNECTION_GRAPH::buildConnectionGraph( std::function<void( SCH_ITEM* )>* a
{
wxString old_name = match->Name();
wxLogTrace( ConnTrace, "Updating %lu (%s) member %s to %s", parent->m_code,
wxLogTrace( ConnTrace, wxS( "Updating %lu (%s) member %s to %s" ), parent->m_code,
parent->m_driver_connection->Name(), old_name, conn->Name() );
match->Clone( *conn );
@ -1841,7 +1841,7 @@ void CONNECTION_GRAPH::propagateToNeighbors( CONNECTION_SUBGRAPH* aSubgraph, boo
{
if( candidate->GetNameForDriver( label ) == aParent->GetNameForDriver( pin ) )
{
wxLogTrace( ConnTrace, "%lu: found child %lu (%s)", aParent->m_code,
wxLogTrace( ConnTrace, wxS( "%lu: found child %lu (%s)" ), aParent->m_code,
candidate->m_code, candidate->m_driver_connection->Name() );
candidate->m_hier_parent = aParent;
@ -1888,7 +1888,7 @@ void CONNECTION_GRAPH::propagateToNeighbors( CONNECTION_SUBGRAPH* aSubgraph, boo
if( aParent->GetNameForDriver( label ) == candidate->GetNameForDriver( pin ) )
{
wxLogTrace( ConnTrace, "%lu: found additional parent %lu (%s)",
wxLogTrace( ConnTrace, wxS( "%lu: found additional parent %lu (%s)" ),
aParent->m_code, candidate->m_code,
candidate->m_driver_connection->Name() );
@ -1943,7 +1943,7 @@ void CONNECTION_GRAPH::propagateToNeighbors( CONNECTION_SUBGRAPH* aSubgraph, boo
// This is bad, probably an ERC error
if( !member )
{
wxLogTrace( ConnTrace, "Could not match bus member %s in %s",
wxLogTrace( ConnTrace, wxS( "Could not match bus member %s in %s" ),
kv.first->Name(), parent->Name() );
continue;
}
@ -1962,7 +1962,7 @@ void CONNECTION_GRAPH::propagateToNeighbors( CONNECTION_SUBGRAPH* aSubgraph, boo
// Safety check against infinite recursion
wxASSERT( neighbor_conn->IsNet() );
wxLogTrace( ConnTrace, "%lu (%s) connected to bus member %s (local %s)",
wxLogTrace( ConnTrace, wxS( "%lu (%s) connected to bus member %s (local %s)" ),
neighbor->m_code, neighbor_name, member->Name(), member->LocalName() );
// Take whichever name is higher priority
@ -1995,13 +1995,13 @@ void CONNECTION_GRAPH::propagateToNeighbors( CONNECTION_SUBGRAPH* aSubgraph, boo
// on which subgraph comes up first)
if( !aSubgraph->m_hier_ports.empty() && !aSubgraph->m_hier_pins.empty() )
{
wxLogTrace( ConnTrace, "%lu (%s) has both hier ports and pins; deferring processing",
wxLogTrace( ConnTrace, wxS( "%lu (%s) has both hier ports and pins; deferring processing" ),
aSubgraph->m_code, conn->Name() );
return;
}
else if( aSubgraph->m_hier_ports.empty() && aSubgraph->m_hier_pins.empty() )
{
wxLogTrace( ConnTrace, "%lu (%s) has no hier pins or ports; marking clean",
wxLogTrace( ConnTrace, wxS( "%lu (%s) has no hier pins or ports; marking clean" ),
aSubgraph->m_code, conn->Name() );
aSubgraph->m_dirty = false;
return;
@ -2009,7 +2009,7 @@ void CONNECTION_GRAPH::propagateToNeighbors( CONNECTION_SUBGRAPH* aSubgraph, boo
visited.insert( aSubgraph );
wxLogTrace( ConnTrace, "Propagating %lu (%s) to subsheets",
wxLogTrace( ConnTrace, wxS( "Propagating %lu (%s) to subsheets" ),
aSubgraph->m_code, aSubgraph->m_driver_connection->Name() );
visit( aSubgraph );
@ -2072,7 +2072,7 @@ void CONNECTION_GRAPH::propagateToNeighbors( CONNECTION_SUBGRAPH* aSubgraph, boo
if( bestDriver != aSubgraph )
{
wxLogTrace( ConnTrace, "%lu (%s) overridden by new driver %lu (%s)",
wxLogTrace( ConnTrace, wxS( "%lu (%s) overridden by new driver %lu (%s)" ),
aSubgraph->m_code, aSubgraph->m_driver_connection->Name(), bestDriver->m_code,
bestDriver->m_driver_connection->Name() );
}
@ -2106,12 +2106,12 @@ void CONNECTION_GRAPH::propagateToNeighbors( CONNECTION_SUBGRAPH* aSubgraph, boo
if( !member )
{
wxLogTrace( ConnTrace, "WARNING: failed to match stale member %s in %s.",
wxLogTrace( ConnTrace, wxS( "WARNING: failed to match stale member %s in %s." ),
stale_member->Name(), subgraph->m_driver_connection->Name() );
continue;
}
wxLogTrace( ConnTrace, "Updating %lu (%s) member %s to %s", subgraph->m_code,
wxLogTrace( ConnTrace, wxS( "Updating %lu (%s) member %s to %s" ), subgraph->m_code,
subgraph->m_driver_connection->Name(), member->LocalName(),
stale_member->Name() );
@ -2228,7 +2228,7 @@ void CONNECTION_GRAPH::recacheSubgraphName( CONNECTION_SUBGRAPH* aSubgraph,
alg::delete_matching( vec, aSubgraph );
}
wxLogTrace( ConnTrace, "recacheSubgraphName: %s => %s", aOldName,
wxLogTrace( ConnTrace, wxS( "recacheSubgraphName: %s => %s" ), aOldName,
aSubgraph->m_driver_connection->Name() );
m_net_name_to_subgraphs_map[aSubgraph->m_driver_connection->Name()].push_back( aSubgraph );
@ -2279,7 +2279,7 @@ std::vector<const CONNECTION_SUBGRAPH*> CONNECTION_GRAPH::GetBusesNeedingMigrati
if( !different )
continue;
wxLogTrace( ConnTrace, "SG %ld (%s) has multiple bus labels", subgraph->m_code,
wxLogTrace( ConnTrace, wxS( "SG %ld (%s) has multiple bus labels" ), subgraph->m_code,
connection->Name() );
ret.push_back( subgraph );
@ -2365,7 +2365,7 @@ int CONNECTION_GRAPH::RunERC()
{
int error_count = 0;
wxCHECK_MSG( m_schematic, true, "Null m_schematic in CONNECTION_GRAPH::RunERC" );
wxCHECK_MSG( m_schematic, true, wxS( "Null m_schematic in CONNECTION_GRAPH::RunERC" ) );
ERC_SETTINGS& settings = m_schematic->ErcSettings();
@ -3152,7 +3152,7 @@ bool CONNECTION_GRAPH::ercCheckLabels( const CONNECTION_SUBGRAPH* aSubgraph )
wxString netName = GetResolvedSubgraphName( aSubgraph );
wxCHECK_MSG( m_schematic, true, "Null m_schematic in CONNECTION_GRAPH::ercCheckLabels" );
wxCHECK_MSG( m_schematic, true, wxS( "Null m_schematic in CONNECTION_GRAPH::ercCheckLabels" ) );
// Labels that have multiple pins connected are not dangling (may be used for naming segments)
// so leave them without errors here

View File

@ -478,11 +478,11 @@ bool findSymbolsAndPins(
wxString fullRef = schRef.GetRef() + refNum;
// Skip power symbols
if( fullRef.StartsWith( "#" ) )
if( fullRef.StartsWith( wxS( "#" ) ) )
continue;
// Unannotated symbols are not supported
if( refNum.compare( "?" ) == 0 )
if( refNum.compare( wxS( "?" ) ) == 0 )
continue;
// Look for whole footprint
@ -570,11 +570,11 @@ bool sheetContainsOnlyWantedItems(
wxString fullRef = schRef.GetRef() + refNum;
// Skip power symbols
if( fullRef.StartsWith( "#" ) )
if( fullRef.StartsWith( wxS( "#" ) ) )
continue;
// Unannotated symbols are not supported
if( refNum.compare( "?" ) == 0 )
if( refNum.compare( wxS( "?" ) ) == 0 )
continue;
if( aSyncSymMap.find( fullRef ) == aSyncSymMap.end() )
@ -599,7 +599,7 @@ std::optional<std::tuple<SCH_SHEET_PATH, SCH_ITEM*, std::vector<SCH_ITEM*>>>
findItemsFromSyncSelection( const SCHEMATIC& aSchematic, const std::string aSyncStr,
bool aFocusOnFirst )
{
wxArrayString syncArray = wxStringTokenize( aSyncStr, "," );
wxArrayString syncArray = wxStringTokenize( aSyncStr, wxS( "," ) );
std::unordered_map<wxString, std::vector<SCH_REFERENCE>> syncSymMap;
std::unordered_map<wxString, std::unordered_map<wxString, SCH_PIN*>> syncPinMap;

View File

@ -212,7 +212,7 @@ void DIALOG_BOM::installGeneratorsList()
if( !m_generators[ii]->FindFilePath().Exists( wxFILE_EXISTS_REGULAR ) )
{
wxLogTrace( BOM_TRACE, "BOM plugin %s not found",
wxLogTrace( BOM_TRACE, wxS( "BOM plugin %s not found" ),
m_generators[ii]->FindFilePath().GetFullName() );
name.Append( wxT( " " ) + _( "(file missing)" ) );

View File

@ -564,7 +564,7 @@ bool DIALOG_CHANGE_SYMBOLS::processSymbol( SCH_SYMBOL* aSymbol, const SCH_SHEET_
if( !libSymbol )
{
msg << ": " << _( "*** symbol not found ***" );
msg << wxS( ": " ) << _( "*** symbol not found ***" );
m_messagePanel->Report( msg, RPT_SEVERITY_ERROR );
return false;
}
@ -573,7 +573,7 @@ bool DIALOG_CHANGE_SYMBOLS::processSymbol( SCH_SYMBOL* aSymbol, const SCH_SHEET_
if( flattenedSymbol->GetUnitCount() < aSymbol->GetUnit() )
{
msg << ": " << _( "*** new symbol has too few units ***" );
msg << wxS( ": " ) << _( "*** new symbol has too few units ***" );
m_messagePanel->Report( msg, RPT_SEVERITY_ERROR );
return false;
}

View File

@ -925,7 +925,7 @@ void DIALOG_ERC::deleteAllMarkers( bool aIncludeExclusions )
void DIALOG_ERC::OnSaveReport( wxCommandEvent& aEvent )
{
wxFileName fn( "ERC." + ReportFileExtension );
wxFileName fn( wxS( "ERC." ) + ReportFileExtension );
wxFileDialog dlg( this, _( "Save Report to File" ), Prj().GetProjectPath(), fn.GetFullName(),
ReportFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT );

View File

@ -312,7 +312,7 @@ void DIALOG_EXPORT_NETLIST::OnRunExternSpiceCommand( wxCommandEvent& event )
// Build the command line
wxString commandLine = simulatorCommand;
commandLine.Replace( "%I", fn.GetFullPath(), true );
commandLine.Replace( wxS( "%I" ), fn.GetFullPath(), true );
if( m_Parent->ReadyToNetlist( _( "Simulator requires a fully annotated schematic." ) ) )
{

View File

@ -503,7 +503,7 @@ DIALOG_SCH_FIELD_PROPERTIES::DIALOG_SCH_FIELD_PROPERTIES( SCH_BASE_FRAME* aParen
m_isPower = false;
m_textLabel->SetLabel( aField->GetName() + ":" );
m_textLabel->SetLabel( aField->GetName() + wxS( ":" ) );
m_position = m_field->GetPosition();
@ -560,7 +560,7 @@ void DIALOG_SCH_FIELD_PROPERTIES::onScintillaCharAdded( wxStyledTextEvent &aEven
{
wxString text = m_StyledTextCtrl->GetText();
int currpos = m_StyledTextCtrl->GetCurrentPos();
text.Replace( "\n", "" );
text.Replace( wxS( "\n" ), wxS( "" ) );
m_StyledTextCtrl->SetText( text );
m_StyledTextCtrl->GotoPos( currpos-1 );
return;

View File

@ -438,7 +438,7 @@ bool DIALOG_LABEL_PROPERTIES::TransferDataFromWindow()
#ifdef __WXMAC__
// On macOS CTRL+Enter produces '\r' instead of '\n' regardless of EOL setting
text.Replace( "\r", "\n" );
text.Replace( wxS( "\r" ), wxS( "\n" ) );
#endif
if( text.IsEmpty() && !m_currentLabel->IsNew() )

View File

@ -665,11 +665,11 @@ private:
static bool BoolFromString( wxString aValue )
{
if( aValue == "1" )
if( aValue == wxS( "1" ) )
{
return true;
}
else if( aValue == "0" )
else if( aValue == wxS( "0" ) )
{
return false;
}

View File

@ -250,11 +250,11 @@ bool DIALOG_LIB_TEXTBOX_PROPERTIES::TransferDataFromWindow()
#ifdef __WXMAC__
// On macOS CTRL+Enter produces '\r' instead of '\n' regardless of EOL setting
text.Replace( "\r", "\n" );
text.Replace( wxS( "\r" ), wxS( "\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.
text.Replace( "\r", "" );
text.Replace( wxS( "\r" ), wxS( "" ) );
#endif
m_currentText->SetText( text );

View File

@ -1056,7 +1056,7 @@ void DIALOG_SIM_MODEL<T_symbol, T_field>::onBrowseButtonClick( wxCommandEvent& a
wxString path = dlg.GetPath();
wxFileName fn( path );
if( fn.MakeRelativeTo( Prj().GetProjectPath() ) && !fn.GetFullPath().StartsWith( ".." ) )
if( fn.MakeRelativeTo( Prj().GetProjectPath() ) && !fn.GetFullPath().StartsWith( wxS( ".." ) ) )
path = fn.GetFullPath();
loadLibrary( path, true );

View File

@ -1112,8 +1112,8 @@ void DIALOG_SYMBOL_FIELDS_TABLE::OnRemoveField( wxCommandEvent& event )
// Should never occur: "Remove Field..." button should be disabled if invalid selection
// via OnFieldsCtrlSelectionChanged()
wxCHECK_RET( row != -1, "Some user defined field must be selected first" );
wxCHECK_RET( row >= MANDATORY_FIELDS, "Mandatory fields cannot be removed" );
wxCHECK_RET( row != -1, wxS( "Some user defined field must be selected first" ) );
wxCHECK_RET( row >= MANDATORY_FIELDS, wxS( "Mandatory fields cannot be removed" ) );
wxString fieldName = m_fieldsCtrl->GetTextValue( row, 0 );
@ -1415,9 +1415,9 @@ void DIALOG_SYMBOL_FIELDS_TABLE::OnExport( wxCommandEvent& aEvent )
continue;
wxString escapedValue = m_grid->GetColLabelValue( col );
escapedValue.Replace( "\"", "\"\"" );
escapedValue.Replace( wxS( "\"" ), wxS( "\"\"" ) );
wxString format = col == last_col ? "\"%s\"\r\n" : "\"%s\",";
wxString format = col == last_col ? wxS( "\"%s\"\r\n" ) : wxS( "\"%s\"," );
out.Write( wxString::Format( format, escapedValue ) );
}
@ -1436,9 +1436,9 @@ void DIALOG_SYMBOL_FIELDS_TABLE::OnExport( wxCommandEvent& aEvent )
// Get the unanottated version of the field, e.g. no "> " or "v " by
wxString escapedValue = m_dataModel->GetRawValue( row, col );
escapedValue.Replace( "\"", "\"\"" );
escapedValue.Replace( wxS( "\"" ), wxS( "\"\"" ) );
wxString format = col == last_col ? "\"%s\"\r\n" : "\"%s\",";
wxString format = col == last_col ? wxS( "\"%s\"\r\n" ) : wxS( "\"%s\"," );
out.Write( wxString::Format( format, escapedValue ) );
}

View File

@ -515,7 +515,7 @@ bool DIALOG_SYMBOL_PROPERTIES::TransferDataToWindow()
}
#ifdef KICAD_SPICE
m_cbExcludeFromSim->SetValue( m_symbol->GetFieldText( SIM_ENABLE_FIELD ) == "0" );
m_cbExcludeFromSim->SetValue( m_symbol->GetFieldText( SIM_ENABLE_FIELD ) == wxS( "0" ) );
#endif
m_cbExcludeFromBom->SetValue( !m_symbol->GetIncludeInBom() );
m_cbExcludeFromBoard->SetValue( !m_symbol->GetIncludeOnBoard() );
@ -1184,7 +1184,7 @@ void DIALOG_SYMBOL_PROPERTIES::OnUpdateUI( wxUpdateUIEvent& event )
}
}
m_cbExcludeFromSim->SetValue( simEnable == "0" );
m_cbExcludeFromSim->SetValue( simEnable == wxS( "0" ) );
#endif
}

View File

@ -182,7 +182,7 @@ void DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable( REPORTER& aReporter )
// Spaces in the file name will break the symbol name because they are not
// quoted in the symbol library file format.
libName.Replace( " ", "-" );
libName.Replace( wxS( " " ), wxS( "-" ) );
// Don't create duplicate table entries.
while( alg::contains( libNames, libName ) )
@ -445,7 +445,7 @@ bool DIALOG_SYMBOL_REMAP::backupProject( REPORTER& aReporter )
// Back up the cache library.
srcFileName.SetPath( Prj().GetProjectPath() );
srcFileName.SetName( Prj().GetProjectName() + "-cache" );
srcFileName.SetName( Prj().GetProjectName() + wxS( "-cache" ) );
srcFileName.SetExt( LegacySymbolLibFileExtension );
destFileName = srcFileName;
@ -465,7 +465,7 @@ bool DIALOG_SYMBOL_REMAP::backupProject( REPORTER& aReporter )
}
// Back up the rescue symbol library if it exists.
srcFileName.SetName( Prj().GetProjectName() + "-rescue" );
srcFileName.SetName( Prj().GetProjectName() + wxS( "-rescue" ) );
destFileName.SetName( srcFileName.GetName() + timeStamp );
tmp.Printf( _( "Backing up file '%s' to '%s'." ),

View File

@ -120,7 +120,7 @@ void PANEL_SETUP_PINMAP::reBuildMatrixPanel()
const int twiddle = 1;
#endif
wxSize charSize = KIUI::GetTextSize( "X", m_matrixPanel );
wxSize charSize = KIUI::GetTextSize( wxS( "X" ), m_matrixPanel );
wxPoint pos( 0, charSize.y * 2 );
wxStaticText* text;

View File

@ -158,7 +158,7 @@ protected:
// paste the SYMBOL_LIB_TABLE_ROWs of s-expression (sym_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 ), wxS( "Clipboard" ) );
LIB_TABLE_LEXER lexer( &slr );
SYMBOL_LIB_TABLE tmp_tbl;
bool parsed = true;

View File

@ -155,8 +155,8 @@ bool PANEL_TEMPLATE_FIELDNAMES::TransferDataToGrid()
{
m_grid->SetCellValue( row, 0, m_fields[row].m_Name );
// columns 1 and 2 show a boolean value (in a check box):
m_grid->SetCellValue( row, 1, m_fields[row].m_Visible ? "1" : "0" );
m_grid->SetCellValue( row, 2, m_fields[row].m_URL ? "1" : "0" );
m_grid->SetCellValue( row, 1, m_fields[row].m_Visible ? wxS( "1" ) : wxS( "0" ) );
m_grid->SetCellValue( row, 2, m_fields[row].m_URL ? wxS( "1" ) : wxS( "0" ) );
// Set cell properties
m_grid->SetCellAlignment( row, 0, wxALIGN_LEFT, wxALIGN_CENTRE );
@ -185,8 +185,8 @@ bool PANEL_TEMPLATE_FIELDNAMES::TransferDataFromGrid()
for( int row = 0; row < m_grid->GetNumberRows(); ++row )
{
m_fields[row].m_Name = m_grid->GetCellValue( row, 0 );
m_fields[row].m_Visible = m_grid->GetCellValue( row, 1 ) == "1";
m_fields[row].m_URL = m_grid->GetCellValue( row, 2 ) == "1";
m_fields[row].m_Visible = m_grid->GetCellValue( row, 1 ) == wxS( "1" );
m_fields[row].m_URL = m_grid->GetCellValue( row, 2 ) == wxS( "1" );
}
return true;

View File

@ -419,7 +419,7 @@ void IFACE::SaveFileAs( const wxString& aProjectBasePath, const wxString& aProje
wxString msg;
if( !aErrors.empty() )
aErrors += "\n";
aErrors += wxS( "\n" );
msg.Printf( _( "Cannot copy file '%s' as it will be overwritten by the new root "
"sheet file." ), destFile.GetFullPath() );
@ -446,11 +446,11 @@ void IFACE::SaveFileAs( const wxString& aProjectBasePath, const wxString& aProje
else if( ext == LegacySymbolLibFileExtension || ext == LegacySymbolDocumentFileExtension ||
ext == KiCadSymbolLibFileExtension )
{
if( destFile.GetName() == aProjectName + "-cache" )
destFile.SetName( aNewProjectName + "-cache" );
if( destFile.GetName() == aProjectName + wxS( "-cache" ) )
destFile.SetName( aNewProjectName + wxS( "-cache" ) );
if( destFile.GetName() == aProjectName + "-rescue" )
destFile.SetName( aNewProjectName + "-rescue" );
if( destFile.GetName() == aProjectName + wxS( "-rescue" ) )
destFile.SetName( aNewProjectName + wxS( "-rescue" ) );
KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
}
@ -481,10 +481,10 @@ void IFACE::SaveFileAs( const wxString& aProjectBasePath, const wxString& aProje
else if( symNode )
path = symNode->m_value;
if( path == aProjectName + ".sch" )
path = aNewProjectName + ".sch";
else if( path == aProjectBasePath + "/" + aProjectName + ".sch" )
path = aNewProjectBasePath + "/" + aNewProjectName + ".sch";
if( path == aProjectName + wxS( ".sch" ) )
path = aNewProjectName + wxS( ".sch" );
else if( path == aProjectBasePath + "/" + aProjectName + wxS( ".sch" ) )
path = aNewProjectBasePath + "/" + aNewProjectName + wxS( ".sch" );
else if( path.StartsWith( aProjectBasePath ) )
path.Replace( aProjectBasePath, aNewProjectBasePath, false );
@ -512,13 +512,13 @@ void IFACE::SaveFileAs( const wxString& aProjectBasePath, const wxString& aProje
wxString msg;
if( !aErrors.empty() )
aErrors += "\n";
aErrors += wxS( "\n" );
msg.Printf( _( "Cannot copy file '%s'." ), destFile.GetFullPath() );
aErrors += msg;
}
}
else if( destFile.GetName() == "sym-lib-table" )
else if( destFile.GetName() == wxS( "sym-lib-table" ) )
{
SYMBOL_LIB_TABLE symbolLibTable;
symbolLibTable.Load( aSrcFilePath );
@ -528,10 +528,12 @@ void IFACE::SaveFileAs( const wxString& aProjectBasePath, const wxString& aProje
LIB_TABLE_ROW& row = symbolLibTable.At( i );
wxString uri = row.GetFullURI();
uri.Replace( "/" + aProjectName + "-cache.lib", "/" + aNewProjectName + "-cache.lib" );
uri.Replace( "/" + aProjectName + "-rescue.lib", "/" + aNewProjectName +
"-rescue.lib" );
uri.Replace( "/" + aProjectName + ".lib", "/" + aNewProjectName + ".lib" );
uri.Replace( wxS( "/" ) + aProjectName + wxS( "-cache.lib" ),
wxS( "/" ) + aNewProjectName + wxS( "-cache.lib" ) );
uri.Replace( wxS( "/" ) + aProjectName + wxS( "-rescue.lib" ),
wxS( "/" ) + aNewProjectName + wxS( "-rescue.lib" ) );
uri.Replace( wxS( "/" ) + aProjectName + wxS( ".lib" ),
wxS( "/" ) + aNewProjectName + wxS( ".lib" ) );
row.SetFullURI( uri );
}
@ -553,7 +555,7 @@ void IFACE::SaveFileAs( const wxString& aProjectBasePath, const wxString& aProje
}
else
{
wxFAIL_MSG( "Unexpected filetype for Eeschema::SaveFileAs()" );
wxFAIL_MSG( wxS( "Unexpected filetype for Eeschema::SaveFileAs()" ) );
}
}

View File

@ -989,7 +989,7 @@ void BOM_CFG_PARSER::parseGenerator()
wxString option = FromUTF8();
if( option.StartsWith( "nickname=", &str ) )
if( option.StartsWith( wxS( "nickname=" ), &str ) )
settings.name = str;
NeedRIGHT();

View File

@ -181,11 +181,11 @@ void ERC_TESTER::TestTextVars( DS_PROXY_VIEW_ITEM* aDrawingSheet )
if( aDrawingSheet )
{
wsItems.SetMilsToIUfactor( schIUScale.IU_PER_MILS );
wsItems.SetPageNumber( "1" );
wsItems.SetPageNumber( wxS( "1" ) );
wsItems.SetSheetCount( 1 );
wsItems.SetFileName( "dummyFilename" );
wsItems.SetSheetName( "dummySheet" );
wsItems.SetSheetLayer( "dummyLayer" );
wsItems.SetFileName( wxS( "dummyFilename" ) );
wsItems.SetSheetName( wxS( "dummySheet" ) );
wsItems.SetSheetLayer( wxS( "dummyLayer" ) );
wsItems.SetProject( &m_schematic->Prj() );
wsItems.BuildDrawItemsList( aDrawingSheet->GetPageInfo(), aDrawingSheet->GetTitleBlock());
}

View File

@ -269,7 +269,7 @@ std::shared_ptr<ERC_ITEM> ERC_ITEM::Create( int aErrorCode )
case ERCE_MISSING_BIDI_PIN: return std::make_shared<ERC_ITEM>( missingBidiPin );
case ERCE_UNSPECIFIED:
default:
wxFAIL_MSG( "Unknown ERC error code" );
wxFAIL_MSG( wxS( "Unknown ERC error code" ) );
return nullptr;
}

View File

@ -253,7 +253,7 @@ SEVERITY ERC_SETTINGS::GetSeverity( int aErrorCode ) const
}
wxCHECK_MSG( m_ERCSeverities.count( aErrorCode ), RPT_SEVERITY_IGNORE,
"Missing severity from map in ERC_SETTINGS!" );
wxS( "Missing severity from map in ERC_SETTINGS!" ) );
return m_ERCSeverities.at( aErrorCode );
}

View File

@ -565,7 +565,7 @@ wxString FIELDS_GRID_TABLE<T>::GetValue( int aRow, int aCol )
}
else
{
wxFAIL_MSG( "Unhandled field owner type." );
wxFAIL_MSG( wxS( "Unhandled field owner type." ) );
return field.GetName( false );
}
@ -913,11 +913,11 @@ wxString FIELDS_GRID_TABLE<T>::StringFromBool( bool aValue ) const
template <class T>
bool FIELDS_GRID_TABLE<T>::BoolFromString( wxString aValue ) const
{
if( aValue == "1" )
if( aValue == wxS( "1" ) )
{
return true;
}
else if( aValue == "0" )
else if( aValue == wxS( "0" ) )
{
return false;
}

View File

@ -613,10 +613,10 @@ void SCH_EDIT_FRAME::OnImportProject( wxCommandEvent& aEvent )
SCH_PLUGIN::SCH_PLUGIN_RELEASER plugin( SCH_IO_MGR::FindPlugin( loader.second ) );
wxCHECK( plugin, /*void*/ );
allWildcards += "*." + formatWildcardExt( plugin->GetFileExtension() ) + ";";
allWildcards += wxS( "*." ) + formatWildcardExt( plugin->GetFileExtension() ) + wxS( ";" );
}
fileFilters = _( "All supported formats|" ) + allWildcards + "|" + fileFilters;
fileFilters = _( "All supported formats|" ) + allWildcards + wxS( "|" ) + fileFilters;
wxFileDialog dlg( this, _( "Import Schematic" ), path, wxEmptyString, fileFilters,
wxFD_OPEN | wxFD_FILE_MUST_EXIST ); // TODO

View File

@ -25,24 +25,24 @@
#include <symbol_lib_table.h>
#include <wx/log.h>
static const wxString DescriptionFormat =
static const wxString DescriptionFormat = wxS(
"<b>__NAME__</b>"
"__ALIASOF__"
"__DESC__"
"__KEY__"
"<hr><table border=0>"
"__FIELDS__"
"</table>";
"</table>" );
static const wxString AliasOfFormat = "<br><i>" + _( "Derived from" ) + " %s (%s)</i>";
static const wxString DescFormat = "<br>%s";
static const wxString KeywordsFormat = "<br>" + _( "Keywords" ) + ": %s";
static const wxString FieldFormat =
static const wxString AliasOfFormat = wxS( "<br><i>" ) + _( "Derived from" ) + wxS( " %s (%s)</i>" );
static const wxString DescFormat = wxS( "<br>%s" );
static const wxString KeywordsFormat = wxS( "<br>" ) + _( "Keywords" ) + wxS( ": %s" );
static const wxString FieldFormat = wxS(
"<tr>"
" <td><b>__NAME__</b></td>"
" <td>__VALUE__</td>"
"</tr>";
static const wxString DatasheetLinkFormat = "<a href=\"__HREF__\">__TEXT__</a>";
"</tr>" );
static const wxString DatasheetLinkFormat = wxS( "<a href=\"__HREF__\">__TEXT__</a>" );
class FOOTPRINT_INFO_GENERATOR
@ -106,7 +106,7 @@ public:
protected:
void SetHtmlName()
{
m_html.Replace( "__NAME__", EscapeHTML( UnescapeString( m_symbol->GetName() ) ) );
m_html.Replace( wxS( "__NAME__" ), EscapeHTML( UnescapeString( m_symbol->GetName() ) ) );
}
@ -119,7 +119,7 @@ protected:
else
{
wxString root_name = _( "Unknown" );
wxString root_desc = "";
wxString root_desc = wxS( "" );
std::shared_ptr< LIB_SYMBOL > parent = m_symbol->GetParent().lock();
@ -129,7 +129,7 @@ protected:
root_desc = parent->GetDescription();
}
m_html.Replace( "__ALIASOF__", wxString::Format( AliasOfFormat,
m_html.Replace( wxS( "__ALIASOF__" ), wxString::Format( AliasOfFormat,
EscapeHTML( UnescapeString( root_name ) ),
EscapeHTML( root_desc ) ) );
}
@ -140,7 +140,7 @@ protected:
{
wxString raw_desc = m_symbol->GetDescription();
m_html.Replace( "__DESC__", wxString::Format( DescFormat, EscapeHTML( raw_desc ) ) );
m_html.Replace( wxS( "__DESC__" ), wxString::Format( DescFormat, EscapeHTML( raw_desc ) ) );
}
@ -149,9 +149,9 @@ protected:
wxString keywords = m_symbol->GetKeyWords();
if( keywords.empty() )
m_html.Replace( "__KEY__", wxEmptyString );
m_html.Replace( wxS( "__KEY__" ), wxEmptyString );
else
m_html.Replace( "__KEY__", wxString::Format( KeywordsFormat, EscapeHTML( keywords ) ) );
m_html.Replace( wxS( "__KEY__" ), wxString::Format( KeywordsFormat, EscapeHTML( keywords ) ) );
}
@ -161,7 +161,7 @@ protected:
wxString text = aField.GetFullText( m_unit > 0 ? m_unit : 1 );
wxString fieldhtml = FieldFormat;
fieldhtml.Replace( "__NAME__", EscapeHTML( name ) );
fieldhtml.Replace( wxS( "__NAME__" ), EscapeHTML( name ) );
switch( aField.GetId() )
{
@ -170,19 +170,19 @@ protected:
if( text.IsEmpty() || text == wxT( "~" ) )
{
fieldhtml.Replace( "__VALUE__", text );
fieldhtml.Replace( wxS( "__VALUE__" ), text );
}
else
{
wxString datasheetlink = DatasheetLinkFormat;
datasheetlink.Replace( "__HREF__", EscapeHTML( text ) );
datasheetlink.Replace( wxS( "__HREF__" ), EscapeHTML( text ) );
if( text.Length() > 75 )
text = text.Left( 72 ) + wxT( "..." );
datasheetlink.Replace( "__TEXT__", EscapeHTML( text ) );
datasheetlink.Replace( wxS( "__TEXT__" ), EscapeHTML( text ) );
fieldhtml.Replace( "__VALUE__", datasheetlink );
fieldhtml.Replace( wxS( "__VALUE__" ), datasheetlink );
}
break;
@ -192,7 +192,7 @@ protected:
return wxEmptyString;
default:
fieldhtml.Replace( "__VALUE__", EscapeHTML( text ) );
fieldhtml.Replace( wxS( "__VALUE__" ), EscapeHTML( text ) );
}
return fieldhtml;
@ -230,7 +230,7 @@ protected:
}
}
m_html.Replace( "__FIELDS__", fieldtable );
m_html.Replace( wxS( "__FIELDS__" ), fieldtable );
}
};

View File

@ -496,7 +496,7 @@ void LIB_FIELD::SetName( const wxString& aName )
// Mandatory field names are fixed.
if( IsMandatory() )
{
wxFAIL_MSG( "trying to set a MANDATORY_FIELD's name\n" );
wxFAIL_MSG( wxS( "trying to set a MANDATORY_FIELD's name\n" ) );
return;
}

View File

@ -1204,7 +1204,7 @@ wxString LIB_SYMBOL::GetPrefix()
{
wxString refDesignator = GetFieldById( REFERENCE_FIELD )->GetText();
refDesignator.Replace( "~", " " );
refDesignator.Replace( wxS( "~" ), wxS( " " ) );
wxString prefix = refDesignator;

View File

@ -48,7 +48,7 @@ bool SCH_EDIT_FRAME::CreateArchiveLibraryCacheFile( bool aUseCurrentSheetFilenam
else
fn = Schematic().RootScreen()->GetFileName();
fn.SetName( fn.GetName() + "-cache" );
fn.SetName( fn.GetName() + wxS( "-cache" ) );
fn.SetExt( LegacySymbolLibFileExtension );
bool success = CreateArchiveLibrary( fn.GetFullPath() );
@ -131,7 +131,7 @@ bool SCH_EDIT_FRAME::CreateArchiveLibrary( const wxString& aFileName )
if( errorMsg.empty() )
errorMsg += tmp;
else
errorMsg += "\n" + tmp;
errorMsg += wxS( "\n" ) + tmp;
}
}
}

View File

@ -148,20 +148,20 @@ int PIN_NUMBERS::Compare( const wxString& lhs, const wxString& rhs )
if( symbol2.empty() )
return 2;
bool sym1_isnumeric = symbol1.find_first_of( "0123456789" ) != wxString::npos;
bool sym2_isnumeric = symbol2.find_first_of( "0123456789" ) != wxString::npos;
bool sym1_isnumeric = symbol1.find_first_of( wxS( "0123456789" ) ) != wxString::npos;
bool sym2_isnumeric = symbol2.find_first_of( wxS( "0123456789" ) ) != wxString::npos;
if( sym1_isnumeric )
{
if( sym2_isnumeric )
{
// numeric comparison
wxString::size_type v1 = symbol1.find_first_of( "vV" );
wxString::size_type v1 = symbol1.find_first_of( wxS( "vV" ) );
if( v1 != wxString::npos )
symbol1[v1] = '.';
wxString::size_type v2 = symbol2.find_first_of( "vV" );
wxString::size_type v2 = symbol2.find_first_of( wxS( "vV" ) );
if( v2 != wxString::npos )
symbol2[v2] = '.';

View File

@ -325,7 +325,7 @@ bool RESCUE_CACHE_CANDIDATE::PerformAction( RESCUER* aRescuer )
{
LIB_SYMBOL* tmp = ( m_cache_candidate ) ? m_cache_candidate : m_lib_candidate;
wxCHECK_MSG( tmp, false, "Both cache and library symbols undefined." );
wxCHECK_MSG( tmp, false, wxS( "Both cache and library symbols undefined." ) );
std::unique_ptr<LIB_SYMBOL> new_symbol = tmp->Flatten();
new_symbol->SetName( m_new_name );
@ -455,7 +455,7 @@ void RESCUE_SYMBOL_LIB_TABLE_CANDIDATE::FindRescues(
// library.
wxString libNickname = GetRescueLibraryFileName( aRescuer.Schematic() ).GetName();
LIB_ID new_id( libNickname, new_name + "-" + symbol_id.GetLibNickname().wx_str() );
LIB_ID new_id( libNickname, new_name + wxS( "-" ) + symbol_id.GetLibNickname().wx_str() );
RESCUE_SYMBOL_LIB_TABLE_CANDIDATE candidate( symbol_id, new_id, cache_match, lib_match,
eachSymbol->GetUnit(),
@ -504,7 +504,7 @@ bool RESCUE_SYMBOL_LIB_TABLE_CANDIDATE::PerformAction( RESCUER* aRescuer )
{
LIB_SYMBOL* tmp = ( m_cache_candidate ) ? m_cache_candidate : m_lib_candidate;
wxCHECK_MSG( tmp, false, "Both cache and library symbols undefined." );
wxCHECK_MSG( tmp, false, wxS( "Both cache and library symbols undefined." ) );
std::unique_ptr<LIB_SYMBOL> new_symbol = tmp->Flatten();
new_symbol->SetLibId( m_new_id );
@ -781,7 +781,7 @@ bool LEGACY_RESCUER::WriteRescueLibrary( wxWindow *aParent )
void LEGACY_RESCUER::AddSymbol( LIB_SYMBOL* aNewSymbol )
{
wxCHECK_RET( aNewSymbol, "Invalid LIB_SYMBOL pointer." );
wxCHECK_RET( aNewSymbol, wxS( "Invalid LIB_SYMBOL pointer." ) );
aNewSymbol->SetLib( m_rescue_lib.get() );
m_rescue_lib->AddSymbol( aNewSymbol );
@ -870,7 +870,7 @@ bool SYMBOL_LIB_TABLE_RESCUER::WriteRescueLibrary( wxWindow *aParent )
// it to the table.
if( !row || ( SCH_IO_MGR::EnumFromStr( row->GetType() ) == SCH_IO_MGR::SCH_LEGACY ) )
{
wxString uri = "${KIPRJMOD}/" + fn.GetFullName();
wxString uri = wxS( "${KIPRJMOD}/" ) + fn.GetFullName();
wxString libNickname = fn.GetName();
row = new SYMBOL_LIB_TABLE_ROW( libNickname, uri, wxT( "KiCad" ) );
@ -905,7 +905,7 @@ bool SYMBOL_LIB_TABLE_RESCUER::WriteRescueLibrary( wxWindow *aParent )
void SYMBOL_LIB_TABLE_RESCUER::AddSymbol( LIB_SYMBOL* aNewSymbol )
{
wxCHECK_RET( aNewSymbol, "Invalid LIB_SYMBOL pointer." );
wxCHECK_RET( aNewSymbol, wxS( "Invalid LIB_SYMBOL pointer." ) );
m_rescueLibSymbols.emplace_back( std::make_unique<LIB_SYMBOL>( *aNewSymbol ) );
}

View File

@ -53,7 +53,7 @@
LIB_SYMBOL* SchGetLibSymbol( const LIB_ID& aLibId, SYMBOL_LIB_TABLE* aLibTable,
SYMBOL_LIB* aCacheLib, wxWindow* aParent, bool aShowErrorMsg )
{
wxCHECK_MSG( aLibTable, nullptr, "Invalid symbol library table." );
wxCHECK_MSG( aLibTable, nullptr, wxS( "Invalid symbol library table." ) );
LIB_SYMBOL* symbol = nullptr;
@ -63,7 +63,7 @@ LIB_SYMBOL* SchGetLibSymbol( const LIB_ID& aLibId, SYMBOL_LIB_TABLE* aLibTable,
if( !symbol && aCacheLib )
{
wxCHECK_MSG( aCacheLib->IsCache(), nullptr, "Invalid cache library." );
wxCHECK_MSG( aCacheLib->IsCache(), nullptr, wxS( "Invalid cache library." ) );
wxString cacheName = aLibId.GetLibNickname().wx_str();
cacheName += "_" + aLibId.GetLibItemName();
@ -187,12 +187,12 @@ void SCH_BASE_FRAME::UpdateStatusBar()
VECTOR2D cursorPos = GetCanvas()->GetViewControls()->GetCursorPosition();
VECTOR2D d = cursorPos - screen->m_LocalOrigin;
line.Printf( "X %s Y %s",
line.Printf( wxS( "X %s Y %s" ),
MessageTextFromValue( cursorPos.x, false ),
MessageTextFromValue( cursorPos.y, false ) );
SetStatusText( line, 2 );
line.Printf( "dx %s dy %s dist %s",
line.Printf( wxS( "dx %s dy %s dist %s" ),
MessageTextFromValue( d.x, false ),
MessageTextFromValue( d.y, false ),
MessageTextFromValue( hypot( d.x, d.y ), false ) );

View File

@ -87,7 +87,7 @@ SCH_BUS_WIRE_ENTRY::SCH_BUS_WIRE_ENTRY( const VECTOR2I& pos, int aQuadrant ) :
case 2: m_size.x *= 1; m_size.y *= 1; break;
case 3: m_size.x *= -1; m_size.y *= 1; break;
case 4: m_size.x *= -1; m_size.y *= -1; break;
default: wxFAIL_MSG( "SCH_BUS_WIRE_ENTRY ctor: unexpected quadrant" );
default: wxFAIL_MSG( wxS( "SCH_BUS_WIRE_ENTRY ctor: unexpected quadrant" ) );
}
m_layer = LAYER_WIRE;

View File

@ -441,7 +441,7 @@ void SCH_CONNECTION::AppendInfoToMsgPanel( std::vector<MSG_PANEL_ITEM>& aList )
{
UNITS_PROVIDER unitsProvider( schIUScale, EDA_UNITS::MILLIMETRES );
msg.Printf( "%s at %p", driver->GetItemDescription( &unitsProvider ), driver );
msg.Printf( wxS( "%s at %p" ), driver->GetItemDescription( &unitsProvider ), driver );
aList.emplace_back( wxT( "Connection Source" ), msg );
}
#endif

View File

@ -169,10 +169,10 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
CreateInfoBar();
// Rows; layers 4 - 6
m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" )
m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( wxS( "MainToolbar" ) )
.Top().Layer( 6 ) );
m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" )
m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( wxS( "MsgPanel" ) )
.Bottom().Layer( 6 ) );
// Columns; layers 1 - 3
@ -186,14 +186,14 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
.BestSize( 200, 200 )
.FloatingSize( 200, 200 )
.Show( false ) );
m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( "OptToolbar" )
m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( wxS( "OptToolbar" ) )
.Left().Layer( 2 ) );
m_auimgr.AddPane( m_drawToolBar, EDA_PANE().VToolbar().Name( "ToolsToolbar" )
m_auimgr.AddPane( m_drawToolBar, EDA_PANE().VToolbar().Name( wxS( "ToolsToolbar" ) )
.Right().Layer( 2 ) );
// Center
m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" )
m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( wxS( "DrawFrame" ) )
.Center() );
FinishAUIInitialization();
@ -943,7 +943,7 @@ void SCH_EDIT_FRAME::OnModify()
GetCanvas()->Refresh();
UpdateHierarchyNavigator();
if( !GetTitle().StartsWith( "*" ) )
if( !GetTitle().StartsWith( wxS( "*" ) ) )
updateTitle();
}
@ -1120,7 +1120,7 @@ void SCH_EDIT_FRAME::NewProject()
}
// OpenProjectFiles() requires absolute
wxASSERT_MSG( create_me.IsAbsolute(), "wxFileDialog returned non-absolute path" );
wxASSERT_MSG( create_me.IsAbsolute(), wxS( "wxFileDialog returned non-absolute path" ) );
OpenProjectFiles( std::vector<wxString>( 1, create_me.GetFullPath() ), KICTL_CREATE );
m_mruPath = create_me.GetPath();
@ -1132,8 +1132,8 @@ void SCH_EDIT_FRAME::LoadProject()
{
wxString pro_dir = m_mruPath;
wxString wildcards = AllSchematicFilesWildcard()
+ "|" + KiCadSchematicFileWildcard()
+ "|" + LegacySchematicFileWildcard();
+ wxS( "|" ) + KiCadSchematicFileWildcard()
+ wxS( "|" ) + LegacySchematicFileWildcard();
wxFileDialog dlg( this, _( "Open Schematic" ), pro_dir, wxEmptyString,
wildcards, wxFD_OPEN | wxFD_FILE_MUST_EXIST );

View File

@ -160,8 +160,8 @@ void SCH_JUNCTION::Show( int nestLevel, std::ostream& os ) const
// XML output:
wxString s = GetClass();
NestedSpace( nestLevel, os ) << '<' << s.Lower().mb_str() << m_pos << ", " << m_diameter
<< "/>\n";
NestedSpace( nestLevel, os ) << '<' << s.Lower().mb_str() << m_pos << wxS( ", " ) << m_diameter
<< wxS( "/>\n" );
}
#endif

View File

@ -86,7 +86,7 @@ bool IncrementLabelMember( wxString& name, int aIncrement )
{
name.Remove( ii + 1 );
//write out a format string with correct number of leading zeroes
outputFormat.Printf( "%%0%dld", dCount );
outputFormat.Printf( wxS( "%%0%dld" ), dCount );
//write out the number using the format string
outputNumber.Printf( outputFormat, number );
name << outputNumber << suffix;

View File

@ -105,7 +105,7 @@ void SCHEMATIC::SetProject( PROJECT* aPrj )
void SCHEMATIC::SetRoot( SCH_SHEET* aRootSheet )
{
wxCHECK_RET( aRootSheet, "Call to SetRoot with null SCH_SHEET!" );
wxCHECK_RET( aRootSheet, wxS( "Call to SetRoot with null SCH_SHEET!" ) );
m_rootSheet = aRootSheet;
@ -273,7 +273,7 @@ bool SCHEMATIC::ResolveCrossReference( wxString* token, int aDepth ) const
if( refSymbol->ResolveTextVar( &remainder, aDepth + 1 ) )
*token = remainder;
else
*token = refSymbol->GetRef( &sheetPath, true ) + ":" + remainder;
*token = refSymbol->GetRef( &sheetPath, true ) + wxS( ":" ) + remainder;
return true; // Cross-reference is resolved whether or not the actual textvar was
}
@ -368,13 +368,13 @@ wxString SCHEMATIC::ConvertRefsToKIIDs( const wxString& aSource ) const
if( ref == refSymbol->GetRef( &references[ jj ].GetSheetPath(), true ) )
{
token = refSymbol->m_Uuid.AsString() + ":" + remainder;
token = refSymbol->m_Uuid.AsString() + wxS( ":" ) + remainder;
break;
}
}
}
newbuf.append( "${" + token + "}" );
newbuf.append( wxS( "${" ) + token + wxS( "}" ) );
}
else
{
@ -421,11 +421,11 @@ wxString SCHEMATIC::ConvertKIIDsToRefs( const wxString& aSource ) const
if( refItem && refItem->Type() == SCH_SYMBOL_T )
{
SCH_SYMBOL* refSymbol = static_cast<SCH_SYMBOL*>( refItem );
token = refSymbol->GetRef( &refSheetPath, true ) + ":" + remainder;
token = refSymbol->GetRef( &refSheetPath, true ) + wxS( ":" ) + remainder;
}
}
newbuf.append( "${" + token + "}" );
newbuf.append( wxS( "${" ) + token + wxS( "}" ) );
}
else
{