diff --git a/eeschema/lib_pin.cpp b/eeschema/lib_pin.cpp index cd3a137338..aaa0e3b429 100644 --- a/eeschema/lib_pin.cpp +++ b/eeschema/lib_pin.cpp @@ -1884,10 +1884,13 @@ const char** LIB_PIN::GetMenuImage() const wxString LIB_PIN::GetSelectMenuText() const { - wxString tmp = _( "Pin " ); - - return tmp << GetNumberString() << wxT( ", " ) << GetTypeString() << wxT( ", " ) - << wxGetTranslation( pin_style_names[ GetStyleCodeIndex( m_shape ) ] );; + wxString tmp; + tmp.Printf( _( "Pin %s, %s, %s" ), + GetChars( GetNumberString() ), + GetChars( GetTypeString() ), + GetChars( wxGetTranslation( pin_style_names[ GetStyleCodeIndex( m_shape ) ] ) ) + ); + return tmp; } diff --git a/eeschema/sch_component.cpp b/eeschema/sch_component.cpp index 4a15a9fed7..9d219be709 100644 --- a/eeschema/sch_component.cpp +++ b/eeschema/sch_component.cpp @@ -1633,9 +1633,11 @@ LIB_DRAW_ITEM* SCH_COMPONENT::GetDrawItem( const wxPoint& aPosition, KICAD_T aTy wxString SCH_COMPONENT::GetSelectMenuText() const { - wxString tmp = _( "Component " ); - - return tmp << m_ChipName << wxT( ", " ) << GetField( REFERENCE )->GetText(); + wxString tmp; + tmp.Printf( _( "Component %s, %s" ), + GetChars( m_ChipName ), + GetChars( GetField( REFERENCE )->GetText() ) ); + return tmp; } diff --git a/eeschema/sch_field.cpp b/eeschema/sch_field.cpp index b31f2b311c..5e4d1ff056 100644 --- a/eeschema/sch_field.cpp +++ b/eeschema/sch_field.cpp @@ -449,9 +449,10 @@ void SCH_FIELD::Rotate( wxPoint rotationPoint ) wxString SCH_FIELD::GetSelectMenuText() const { - wxString tmp = _( "Field " ); + wxString tmp; + tmp.Printf( _( "Field %s" ), GetChars( + GetName() ) ); - return tmp + GetName(); + return tmp; } diff --git a/eeschema/sch_line.cpp b/eeschema/sch_line.cpp index 060adbdf0b..54deae87da 100644 --- a/eeschema/sch_line.cpp +++ b/eeschema/sch_line.cpp @@ -419,31 +419,35 @@ void SCH_LINE::GetConnectionPoints( vector< wxPoint >& aPoints ) const wxString SCH_LINE::GetSelectMenuText() const { - wxString menuText; + wxString menuText, txtfmt, orient; + if( m_Start.x == m_End.x ) + orient = _("Vert."); + else if( m_Start.y == m_End.y ) + orient = _("Horiz."); switch( m_Layer ) { case LAYER_NOTES: - menuText = _( "Graphic Line " ); + txtfmt = _( "%s Graphic Line from (%s,%s) to (%s,%s) " ); break; case LAYER_WIRE: - menuText = _( "Wire " ); + txtfmt = _( "%s Wire from (%s,%s) to (%s,%s)" ); break; case LAYER_BUS: - menuText = _( "Bus " ); + txtfmt = _( "%s Bus from (%s,%s) to (%s,%s)" ); break; default: - menuText = _( "Line on Unkown Layer " ); + txtfmt += _( "%s Line on Unkown Layer from (%s,%s) to (%s,%s)" ); } - menuText << wxT( "from (" ) << CoordinateToString( m_Start.x, EESCHEMA_INTERNAL_UNIT ) - << wxT( "," ) << CoordinateToString( m_Start.y, EESCHEMA_INTERNAL_UNIT ) - << wxT( ")" ); - menuText << wxT( " to (" ) << CoordinateToString( m_End.x, EESCHEMA_INTERNAL_UNIT ) - << wxT( "," ) << CoordinateToString( m_End.y, EESCHEMA_INTERNAL_UNIT ) << wxT( ")" ); + menuText.Printf( txtfmt, GetChars( orient ), + GetChars(CoordinateToString( m_Start.x, EESCHEMA_INTERNAL_UNIT )), + GetChars(CoordinateToString( m_Start.y, EESCHEMA_INTERNAL_UNIT )), + GetChars(CoordinateToString( m_End.x, EESCHEMA_INTERNAL_UNIT )), + GetChars(CoordinateToString( m_End.y, EESCHEMA_INTERNAL_UNIT )) ); return menuText; } diff --git a/eeschema/sch_polyline.cpp b/eeschema/sch_polyline.cpp index 75821a12fe..77a2a29e51 100644 --- a/eeschema/sch_polyline.cpp +++ b/eeschema/sch_polyline.cpp @@ -207,27 +207,27 @@ void SCH_POLYLINE::Rotate( wxPoint rotationPoint ) wxString SCH_POLYLINE::GetSelectMenuText() const { - wxString menuText; + wxString menuText, fmt; switch( m_Layer ) { case LAYER_NOTES: - menuText = _( "Graphic Polyline " ); + fmt = _( "Graphic Polyline with %d Points" ); break; case LAYER_WIRE: - menuText = _( "Polyline Wire " ); + fmt = _( "Polyline Wire with %d Points" ); break; case LAYER_BUS: - menuText = _( "Polyline Bus " ); + fmt = _( "Polyline Bus with %d Points" ); break; default: - menuText = _( "Polyline on Unkown Layer " ); + fmt = _( "Polyline on Unkown Layer with %d Points" ); } - menuText += wxString::Format( _( "with %d Points" ), m_PolyPoints.size() ); + menuText.Printf( fmt, m_PolyPoints.size() ); return menuText; } diff --git a/eeschema/sch_sheet.cpp b/eeschema/sch_sheet.cpp index a5df99fffe..f38c4cea8d 100644 --- a/eeschema/sch_sheet.cpp +++ b/eeschema/sch_sheet.cpp @@ -983,7 +983,9 @@ SEARCH_RESULT SCH_SHEET::Visit( INSPECTOR* aInspector, const void* aTestData, wxString SCH_SHEET::GetSelectMenuText() const { - return wxString( _( "Hierarchical Sheet " ) ) + m_SheetName; + wxString tmp; + tmp.Printf( _( "Hierarchical Sheet " ), GetChars( m_SheetName ) ); + return tmp; } diff --git a/eeschema/sch_sheet_pin.cpp b/eeschema/sch_sheet_pin.cpp index 005b3b9851..a95e66cf87 100644 --- a/eeschema/sch_sheet_pin.cpp +++ b/eeschema/sch_sheet_pin.cpp @@ -461,7 +461,9 @@ void SCH_SHEET_PIN::GetEndPoints( std::vector & aItemList ) wxString SCH_SHEET_PIN::GetSelectMenuText() const { - return wxString( _( "Hierarchical Sheet Label " ) ) + GetText(); + wxString tmp; + tmp.Printf( _( "Hierarchical Sheet Label %s" ), GetChars( GetText() ) ); + return tmp; } diff --git a/eeschema/sch_text.cpp b/eeschema/sch_text.cpp index c19852f6e8..2bb3c28046 100644 --- a/eeschema/sch_text.cpp +++ b/eeschema/sch_text.cpp @@ -628,7 +628,9 @@ wxString SCH_TEXT::GetSelectMenuText() const tmp.Replace( wxT( "\t" ), wxT( " " ) ); tmp =( tmp.Length() > 15 ) ? tmp.Left( 12 ) + wxT( "..." ) : tmp; - return wxString( _( "Graphic Text " ) ) + tmp; + wxString msg; + msg.Printf(_( "Graphic Text %s" ), GetChars(tmp)); + return msg; } @@ -859,7 +861,9 @@ wxString SCH_LABEL::GetSelectMenuText() const { wxString tmp = ( GetText().Length() > 15 ) ? GetText().Left( 12 ) + wxT( "..." ) : GetText(); - return wxString( _( "Label " ) ) + tmp; + wxString msg; + msg.Printf( _( "Label %s" ), GetChars(tmp) ); + return msg; } @@ -1290,7 +1294,9 @@ wxString SCH_GLOBALLABEL::GetSelectMenuText() const { wxString tmp = ( GetText().Length() > 15 ) ? GetText().Left( 12 ) + wxT( "..." ) : GetText(); - return wxString( _( "Global Label " ) ) + tmp; + wxString msg; + msg.Printf( _( "Global Label %s" ), GetChars(tmp) ); + return msg; } @@ -1645,7 +1651,9 @@ wxString SCH_HIERLABEL::GetSelectMenuText() const { wxString tmp = ( GetText().Length() > 15 ) ? GetText().Left( 12 ) + wxT( "..." ) : GetText(); - return wxString( _( "Hierarchical Label " ) ) + tmp; + wxString msg; + msg.Printf( _( "Hierarchical Label %s" ), GetChars( tmp ) ); + return msg; }