From 13f1de8e73bee2243c3e8f9af77046c96be2f407 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sat, 19 Sep 2020 19:53:58 +0100 Subject: [PATCH] Forgot a bunch of files from last commit. --- common/page_layout/ws_draw_item.cpp | 7 +++---- eeschema/lib_field.cpp | 4 +++- eeschema/lib_text.cpp | 2 +- eeschema/sch_field.cpp | 2 +- eeschema/sch_text.cpp | 8 ++++---- pcbnew/class_dimension.cpp | 2 +- pcbnew/class_pcb_text.cpp | 2 +- pcbnew/class_text_mod.cpp | 8 ++++---- pcbnew/class_track.cpp | 26 +++++++++----------------- 9 files changed, 27 insertions(+), 34 deletions(-) diff --git a/common/page_layout/ws_draw_item.cpp b/common/page_layout/ws_draw_item.cpp index f1fc8faedc..cf6a457906 100644 --- a/common/page_layout/ws_draw_item.cpp +++ b/common/page_layout/ws_draw_item.cpp @@ -182,7 +182,7 @@ bool WS_DRAW_ITEM_TEXT::HitTest( const EDA_RECT& aRect, bool aContains, int aAcc wxString WS_DRAW_ITEM_TEXT::GetSelectMenuText( EDA_UNITS aUnits ) const { - return wxString::Format( _( "Text \"%s\"" ), + return wxString::Format( _( "Text '%s'" ), GetShownText() ); } @@ -428,14 +428,13 @@ bool WS_DRAW_ITEM_BITMAP::HitTest( const EDA_RECT& aRect, bool aContains, int aA wxString WS_DRAW_ITEM_BITMAP::GetSelectMenuText( EDA_UNITS aUnits ) const { - return wxString::Format( _( "Image" ) ); + return _( "Image" ); } wxString WS_DRAW_ITEM_PAGE::GetSelectMenuText( EDA_UNITS aUnits ) const { - wxString txt( "Page Limits" ); - return txt; + return _( "Page Limits" ); } diff --git a/eeschema/lib_field.cpp b/eeschema/lib_field.cpp index c073625e10..590b2ff114 100644 --- a/eeschema/lib_field.cpp +++ b/eeschema/lib_field.cpp @@ -405,7 +405,9 @@ void LIB_FIELD::SetName( const wxString& aName ) wxString LIB_FIELD::GetSelectMenuText( EDA_UNITS aUnits ) const { - return GetName() + " " + ShortenedShownText(); + return wxString::Format( "%s '%s'", + GetName(), + ShortenedShownText() ); } diff --git a/eeschema/lib_text.cpp b/eeschema/lib_text.cpp index 11be053365..f7eb7adcb9 100644 --- a/eeschema/lib_text.cpp +++ b/eeschema/lib_text.cpp @@ -384,7 +384,7 @@ const EDA_RECT LIB_TEXT::GetBoundingBox() const wxString LIB_TEXT::GetSelectMenuText( EDA_UNITS aUnits ) const { - return wxString::Format( _( "Graphic Text \"%s\"" ), ShortenedShownText() ); + return wxString::Format( _( "Graphic Text '%s'" ), ShortenedShownText() ); } diff --git a/eeschema/sch_field.cpp b/eeschema/sch_field.cpp index e8ff1acdea..aa3039baaf 100644 --- a/eeschema/sch_field.cpp +++ b/eeschema/sch_field.cpp @@ -429,7 +429,7 @@ void SCH_FIELD::Rotate( wxPoint aPosition ) wxString SCH_FIELD::GetSelectMenuText( EDA_UNITS aUnits ) const { - return wxString::Format( "%s \"%s\"", + return wxString::Format( "%s '%s'", GetName(), ShortenedShownText() ); } diff --git a/eeschema/sch_text.cpp b/eeschema/sch_text.cpp index 50eeb74811..80aa56a3c5 100644 --- a/eeschema/sch_text.cpp +++ b/eeschema/sch_text.cpp @@ -545,7 +545,7 @@ wxString SCH_TEXT::GetShownText( int aDepth ) const wxString SCH_TEXT::GetSelectMenuText( EDA_UNITS aUnits ) const { - return wxString::Format( _( "Graphic Text \"%s\"" ), GetChars( ShortenedShownText() ) ); + return wxString::Format( _( "Graphic Text '%s'" ), GetChars( ShortenedShownText() ) ); } @@ -792,7 +792,7 @@ const EDA_RECT SCH_LABEL::GetBoundingBox() const wxString SCH_LABEL::GetSelectMenuText( EDA_UNITS aUnits ) const { - return wxString::Format( _( "Label \"%s\"" ), ShortenedShownText() ); + return wxString::Format( _( "Label '%s'" ), ShortenedShownText() ); } @@ -1034,7 +1034,7 @@ const EDA_RECT SCH_GLOBALLABEL::GetBoundingBox() const wxString SCH_GLOBALLABEL::GetSelectMenuText( EDA_UNITS aUnits ) const { - return wxString::Format( _( "Global Label \"%s\"" ), ShortenedShownText() ); + return wxString::Format( _( "Global Label '%s'" ), ShortenedShownText() ); } @@ -1223,7 +1223,7 @@ wxPoint SCH_HIERLABEL::GetSchematicTextOffset( RENDER_SETTINGS* aSettings ) cons wxString SCH_HIERLABEL::GetSelectMenuText( EDA_UNITS aUnits ) const { - return wxString::Format( _( "Hierarchical Label \"%s\"" ), ShortenedShownText() ); + return wxString::Format( _( "Hierarchical Label '%s'" ), ShortenedShownText() ); } diff --git a/pcbnew/class_dimension.cpp b/pcbnew/class_dimension.cpp index f210a10cdc..1fdf6bbebd 100644 --- a/pcbnew/class_dimension.cpp +++ b/pcbnew/class_dimension.cpp @@ -402,7 +402,7 @@ const EDA_RECT DIMENSION::GetBoundingBox() const wxString DIMENSION::GetSelectMenuText( EDA_UNITS aUnits ) const { - return wxString::Format( _( "Dimension \"%s\" on %s" ), + return wxString::Format( _( "Dimension '%s' on %s" ), GetText(), GetLayerName() ); } diff --git a/pcbnew/class_pcb_text.cpp b/pcbnew/class_pcb_text.cpp index fa9a9a90ee..be412ab7b5 100644 --- a/pcbnew/class_pcb_text.cpp +++ b/pcbnew/class_pcb_text.cpp @@ -216,7 +216,7 @@ void TEXTE_PCB::Flip( const wxPoint& aCentre, bool aFlipLeftRight ) wxString TEXTE_PCB::GetSelectMenuText( EDA_UNITS aUnits ) const { - return wxString::Format( _( "PCB Text \"%s\" on %s"), ShortenedShownText(), GetLayerName() ); + return wxString::Format( _( "PCB Text '%s' on %s"), ShortenedShownText(), GetLayerName() ); } diff --git a/pcbnew/class_text_mod.cpp b/pcbnew/class_text_mod.cpp index 6e6a7df331..962322d852 100644 --- a/pcbnew/class_text_mod.cpp +++ b/pcbnew/class_text_mod.cpp @@ -330,16 +330,16 @@ wxString TEXTE_MODULE::GetSelectMenuText( EDA_UNITS aUnits ) const switch( m_Type ) { case TEXT_is_REFERENCE: - return wxString::Format( _( "Reference %s" ), + return wxString::Format( _( "Reference '%s'" ), static_cast( GetParent() )->GetReference() ); case TEXT_is_VALUE: - return wxString::Format( _( "Value %s of %s" ), + return wxString::Format( _( "Value '%s' of %s" ), GetShownText(), static_cast( GetParent() )->GetReference() ); - default: // wrap this one in quotes: - return wxString::Format( _( "Footprint Text \"%s\" of %s" ), + default: + return wxString::Format( _( "Footprint Text '%s' of %s" ), ShortenedShownText(), static_cast( GetParent() )->GetReference() ); } diff --git a/pcbnew/class_track.cpp b/pcbnew/class_track.cpp index 7f21c38e8f..18b4bb7a93 100644 --- a/pcbnew/class_track.cpp +++ b/pcbnew/class_track.cpp @@ -78,26 +78,18 @@ EDA_ITEM* VIA::Clone() const wxString VIA::GetSelectMenuText( EDA_UNITS aUnits ) const { - wxString viaType; + wxString formatStr; switch( GetViaType() ) { - case VIATYPE::BLIND_BURIED: viaType = _( "Blind/Buried Via" ); break; - case VIATYPE::MICROVIA: viaType = _( "Micro Via" ); break; - default: viaType = _( "Via" ); break; + case VIATYPE::BLIND_BURIED: formatStr = _( "Blind/Buried Via %s on %s" ); break; + case VIATYPE::MICROVIA: formatStr = _( "Micro Via %s on %s" ); break; + default: formatStr = _( "Via %s on %s" ); break; } - // say which layers, only two for now - PCB_LAYER_ID topLayer; - PCB_LAYER_ID botLayer; - BOARD* board = GetBoard(); - - LayerPair( &topLayer, &botLayer ); - - return wxString::Format( _( "%s %s on %s" ), - viaType, + return wxString::Format( formatStr, GetNetnameMsg(), - LayerMaskDescribe( board, GetLayerSet() ) ); + LayerMaskDescribe() ); } @@ -629,7 +621,7 @@ void TRACK::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector GetMsgPanelInfoBase_Common( aFrame, aList ); // Display layer - aList.emplace_back( _( "Layer" ), LayerMaskDescribe( board, GetLayerSet() ), DARKGREEN ); + aList.emplace_back( _( "Layer" ), LayerMaskDescribe(), DARKGREEN ); // Display width msg = MessageTextFromValue( aFrame->GetUserUnits(), m_Width, true ); @@ -695,7 +687,7 @@ void VIA::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector& GetMsgPanelInfoBase_Common( aFrame, aList ); // Display layer pair - aList.emplace_back( _( "Layer" ), LayerMaskDescribe( board, GetLayerSet() ), DARKGREEN ); + aList.emplace_back( _( "Layer" ), LayerMaskDescribe(), DARKGREEN ); // Display width msg = MessageTextFromValue( aFrame->GetUserUnits(), m_Width, true ); @@ -784,7 +776,7 @@ void TRACK::GetMsgPanelInfoBase_Common( EDA_DRAW_FRAME* aFrame, std::vector