Support both short and long item descriptions.

This commit is contained in:
Jeff Young 2024-06-27 10:11:55 +01:00
parent c4f61c2eaf
commit 16340e6cf4
89 changed files with 180 additions and 173 deletions

View File

@ -237,9 +237,10 @@ bool DS_DRAW_ITEM_TEXT::HitTest( const BOX2I& aRect, bool aContains, int aAccura
}
wxString DS_DRAW_ITEM_TEXT::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
wxString DS_DRAW_ITEM_TEXT::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
return wxString::Format( _( "Text '%s'" ), KIUI::EllipsizeMenuText( GetText() ) );
return wxString::Format( _( "Text '%s'" ),
aFull ? GetShownText( false ) : KIUI::EllipsizeMenuText( GetText() ) );
}
@ -332,7 +333,7 @@ bool DS_DRAW_ITEM_POLYPOLYGONS::HitTest( const BOX2I& aRect, bool aContained, in
}
wxString DS_DRAW_ITEM_POLYPOLYGONS::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
wxString DS_DRAW_ITEM_POLYPOLYGONS::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
return _( "Imported Shape" );
}
@ -431,7 +432,7 @@ bool DS_DRAW_ITEM_RECT::HitTest( const BOX2I& aRect, bool aContained, int aAccur
}
wxString DS_DRAW_ITEM_RECT::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
wxString DS_DRAW_ITEM_RECT::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
return wxString::Format( _( "Rectangle, width %s height %s" ),
aUnitsProvider->MessageTextFromValue( std::abs( GetStart().x - GetEnd().x ) ),
@ -464,7 +465,7 @@ bool DS_DRAW_ITEM_LINE::HitTest( const VECTOR2I& aPosition, int aAccuracy ) cons
}
wxString DS_DRAW_ITEM_LINE::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
wxString DS_DRAW_ITEM_LINE::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
return wxString::Format( _( "Line, length %s" ),
aUnitsProvider->MessageTextFromValue( GetStart().Distance( GetEnd() ) ) );
@ -516,13 +517,13 @@ bool DS_DRAW_ITEM_BITMAP::HitTest( const BOX2I& aRect, bool aContains, int aAccu
}
wxString DS_DRAW_ITEM_BITMAP::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
wxString DS_DRAW_ITEM_BITMAP::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
return _( "Image" );
}
wxString DS_DRAW_ITEM_PAGE::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
wxString DS_DRAW_ITEM_PAGE::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
return _( "Page Limits" );
}

View File

@ -105,7 +105,7 @@ INSPECT_RESULT EDA_ITEM::Visit( INSPECTOR inspector, void* testData,
}
wxString EDA_ITEM::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
wxString EDA_ITEM::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
wxFAIL_MSG( wxT( "GetItemDescription() was not overridden for schematic item type " ) +
GetClass() );

View File

@ -133,9 +133,9 @@ wxString RC_ITEM::ShowReport( UNITS_PROVIDER* aUnitsProvider, SEVERITY aSeverity
GetViolatingRuleDesc(),
severity,
showCoord( aUnitsProvider, mainItem->GetPosition()),
mainItem->GetItemDescription( aUnitsProvider ),
mainItem->GetItemDescription( aUnitsProvider, true ),
showCoord( aUnitsProvider, auxItem->GetPosition()),
auxItem->GetItemDescription( aUnitsProvider ) );
auxItem->GetItemDescription( aUnitsProvider, true ) );
}
else if( mainItem )
{
@ -145,7 +145,7 @@ wxString RC_ITEM::ShowReport( UNITS_PROVIDER* aUnitsProvider, SEVERITY aSeverity
GetViolatingRuleDesc(),
severity,
showCoord( aUnitsProvider, mainItem->GetPosition()),
mainItem->GetItemDescription( aUnitsProvider ) );
mainItem->GetItemDescription( aUnitsProvider, true ) );
}
else
{
@ -190,7 +190,7 @@ void RC_ITEM::GetJsonViolation( RC_JSON::VIOLATION& aViolation, UNITS_PROVIDER*
if( mainItem )
{
RC_JSON::AFFECTED_ITEM item;
item.description = mainItem->GetItemDescription( aUnitsProvider );
item.description = mainItem->GetItemDescription( aUnitsProvider, true );
item.uuid = mainItem->m_Uuid.AsString();
item.pos.x = EDA_UNIT_UTILS::UI::ToUserUnit( aUnitsProvider->GetIuScale(),
aUnitsProvider->GetUserUnits(),
@ -204,7 +204,7 @@ void RC_ITEM::GetJsonViolation( RC_JSON::VIOLATION& aViolation, UNITS_PROVIDER*
if( auxItem )
{
RC_JSON::AFFECTED_ITEM item;
item.description = auxItem->GetItemDescription( aUnitsProvider );
item.description = auxItem->GetItemDescription( aUnitsProvider, true );
item.uuid = auxItem->m_Uuid.AsString();
item.pos.x = EDA_UNIT_UTILS::UI::ToUserUnit( aUnitsProvider->GetIuScale(),
aUnitsProvider->GetUserUnits(),
@ -467,7 +467,7 @@ void RC_TREE_MODEL::GetValue( wxVariant& aVariant,
}
if( item )
msg += item->GetItemDescription( m_editFrame );
msg += item->GetItemDescription( m_editFrame, true );
msg.Replace( wxS( "\n" ), wxS( " " ) );
aVariant = msg;

View File

@ -286,18 +286,18 @@ bool SELECTION_TOOL::doSelectionMenu( COLLECTOR* aCollector )
{
#ifdef __WXMAC__
menuText = wxString::Format( "%s\t%d",
item->GetItemDescription( unitsProvider ),
item->GetItemDescription( unitsProvider, false ),
i + 1 );
#else
menuText = wxString::Format( "&%d %s\t%d",
i + 1,
item->GetItemDescription( unitsProvider ),
item->GetItemDescription( unitsProvider, false ),
i + 1 );
#endif
}
else
{
menuText = item->GetItemDescription( unitsProvider );
menuText = item->GetItemDescription( unitsProvider, false );
}
menu.Add( menuText, i + 1, item->GetMenuImage() );

View File

@ -1579,7 +1579,7 @@ void CONNECTION_GRAPH::collectAllDriverValues()
UNITS_PROVIDER unitsProvider( schIUScale, EDA_UNITS::MILLIMETRES );
wxLogTrace( ConnTrace, wxS( "Unexpected strong driver %s" ),
driver->GetItemDescription( &unitsProvider ) );
driver->GetItemDescription( &unitsProvider, true ) );
break;
}
}
@ -1850,7 +1850,7 @@ void CONNECTION_GRAPH::processSubGraphs()
wxS( "%ld (%s) weakly driven by unique sheet pin %s, "
"promoting" ),
subgraph->m_code, name,
subgraph->m_driver->GetItemDescription( &unitsProvider ) );
subgraph->m_driver->GetItemDescription( &unitsProvider, true ) );
subgraph->m_strong_driver = true;
}

View File

@ -338,14 +338,14 @@ void ERC_TREE_MODEL::GetValue( wxVariant& aVariant, wxDataViewItem const& aItem,
schEditFrame->SetCurrentSheet( aSheet );
aSheet.UpdateAllScreenReferences();
{
desc = aCurrItem->GetItemDescription( m_editFrame );
desc = aCurrItem->GetItemDescription( m_editFrame, true );
}
schEditFrame->SetCurrentSheet( curSheet );
curSheet.UpdateAllScreenReferences();
}
else
{
desc = aCurrItem->GetItemDescription( m_editFrame );
desc = aCurrItem->GetItemDescription( m_editFrame, true );
}
return desc;

View File

@ -1510,7 +1510,7 @@ std::vector<LIB_SYMBOL_UNIT> LIB_SYMBOL::GetUnitDrawItems()
#define REPORT( msg ) { if( aReporter ) aReporter->Report( msg ); }
#define ITEM_DESC( item ) ( item )->GetItemDescription( &unitsProvider )
#define ITEM_DESC( item ) ( item )->GetItemDescription( &unitsProvider, true )
int LIB_SYMBOL::Compare( const LIB_SYMBOL& aRhs, int aCompareFlags, REPORTER* aReporter ) const
{

View File

@ -133,7 +133,7 @@ public:
void MirrorVertically( int aCenter ) override;
void Rotate( const VECTOR2I& aCenter, bool aRotateCCW ) override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override
{
return wxString( _( "Image" ) );
}

View File

@ -443,13 +443,13 @@ bool SCH_BUS_ENTRY_BASE::HasConnectivityChanges( const SCH_ITEM* aItem,
}
wxString SCH_BUS_WIRE_ENTRY::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
wxString SCH_BUS_WIRE_ENTRY::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
return wxString( _( "Bus to Wire Entry" ) );
}
wxString SCH_BUS_BUS_ENTRY::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
wxString SCH_BUS_BUS_ENTRY::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
return wxString( _( "Bus to Bus Entry" ) );
}

View File

@ -191,7 +191,7 @@ public:
( aItem->GetLayer() == LAYER_WIRE || aItem->GetLayer() == LAYER_BUS );
}
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
EDA_ITEM* Clone() const override;
@ -239,7 +239,7 @@ public:
return aItem->Type() == SCH_LINE_T && aItem->GetLayer() == LAYER_BUS;
}
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
EDA_ITEM* Clone() const override;

View File

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

View File

@ -1054,9 +1054,11 @@ void SCH_FIELD::CalcEdit( const VECTOR2I& aPosition )
}
wxString SCH_FIELD::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
wxString SCH_FIELD::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
return wxString::Format( "%s '%s'", UnescapeString( GetName() ), KIUI::EllipsizeMenuText( GetText() ) );
return wxString::Format( _( "Field %s '%s'" ),
UnescapeString( GetName() ),
aFull ? GetShownText( false ) : KIUI::EllipsizeMenuText( GetText() ) );
}

View File

@ -255,7 +255,7 @@ public:
bool Replace( const EDA_SEARCH_DATA& aSearchData, void* aAuxData = nullptr ) override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
BITMAPS GetMenuImage() const override;

View File

@ -97,7 +97,7 @@ public:
|| aItem->Type() == SCH_DIRECTIVE_LABEL_T );
}
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override
{
return wxString( _( "Junction" ) );
}

View File

@ -1529,10 +1529,10 @@ const BOX2I SCH_LABEL::GetBodyBoundingBox() const
}
wxString SCH_LABEL::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
wxString SCH_LABEL::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
return wxString::Format( _( "Label '%s'" ),
KIUI::EllipsizeMenuText( GetShownText( false ) ) );
aFull ? GetShownText( false ) : KIUI::EllipsizeMenuText( GetText() ) );
}
@ -1796,7 +1796,7 @@ void SCH_DIRECTIVE_LABEL::AutoplaceFields( SCH_SCREEN* aScreen, bool aManual )
}
wxString SCH_DIRECTIVE_LABEL::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
wxString SCH_DIRECTIVE_LABEL::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
if( m_fields.empty() )
{
@ -1806,7 +1806,8 @@ wxString SCH_DIRECTIVE_LABEL::GetItemDescription( UNITS_PROVIDER* aUnitsProvider
{
return wxString::Format( _( "Directive Label [%s %s]" ),
UnescapeString( m_fields[0].GetName() ),
KIUI::EllipsizeMenuText( m_fields[0].GetShownText( false ) ) );
aFull ? m_fields[0].GetShownText( false )
: KIUI::EllipsizeMenuText( m_fields[0].GetText() ) );
}
}
@ -2049,10 +2050,10 @@ void SCH_GLOBALLABEL::CreateGraphicShape( const RENDER_SETTINGS* aRenderSettings
}
wxString SCH_GLOBALLABEL::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
wxString SCH_GLOBALLABEL::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
return wxString::Format( _( "Global Label '%s'" ),
KIUI::EllipsizeMenuText( GetShownText( false ) ) );
aFull ? GetShownText( false ) : KIUI::EllipsizeMenuText( GetText() ) );
}
@ -2196,10 +2197,10 @@ VECTOR2I SCH_HIERLABEL::GetSchematicTextOffset( const RENDER_SETTINGS* aSettings
}
wxString SCH_HIERLABEL::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
wxString SCH_HIERLABEL::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
return wxString::Format( _( "Hierarchical Label '%s'" ),
KIUI::EllipsizeMenuText( GetShownText( false ) ) );
aFull ? GetShownText( false ) : KIUI::EllipsizeMenuText( GetText() ) );
}

View File

@ -397,7 +397,7 @@ public:
bool IsConnectable() const override { return true; }
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
BITMAPS GetMenuImage() const override;
@ -460,12 +460,13 @@ public:
int GetPenWidth() const override;
void CreateGraphicShape( const RENDER_SETTINGS* aSettings, std::vector<VECTOR2I>& aPoints,
void CreateGraphicShape( const RENDER_SETTINGS* aSettings,
std::vector<VECTOR2I>& aPoints,
const VECTOR2I& aPos ) const override;
void AutoplaceFields( SCH_SCREEN* aScreen, bool aManual ) override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
bool IsConnectable() const override { return true; }
@ -531,7 +532,8 @@ public:
VECTOR2I GetSchematicTextOffset( const RENDER_SETTINGS* aSettings ) const override;
void CreateGraphicShape( const RENDER_SETTINGS* aRenderSettings, std::vector<VECTOR2I>& aPoints,
void CreateGraphicShape( const RENDER_SETTINGS* aRenderSettings,
std::vector<VECTOR2I>& aPoints,
const VECTOR2I& aPos ) const override;
bool ResolveTextVar( const SCH_SHEET_PATH* aPath, wxString* token, int aDepth ) const override;
@ -540,7 +542,7 @@ public:
void ViewGetLayers( int aLayers[], int& aCount ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
BITMAPS GetMenuImage() const override;
@ -595,7 +597,7 @@ public:
bool IsConnectable() const override { return true; }
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
BITMAPS GetMenuImage() const override;

View File

@ -735,7 +735,7 @@ void SCH_LINE::GetSelectedPoints( std::vector<VECTOR2I>& aPoints ) const
}
wxString SCH_LINE::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
wxString SCH_LINE::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
wxString txtfmt;

View File

@ -275,7 +275,7 @@ public:
bool CanConnect( const SCH_ITEM* aItem ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
BITMAPS GetMenuImage() const override;

View File

@ -308,10 +308,10 @@ void SCH_MARKER::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_
auxItem = aFrame->GetItem( m_rcItem->GetAuxItemID() );
if( mainItem )
mainText = mainItem->GetItemDescription( aFrame );
mainText = mainItem->GetItemDescription( aFrame, true );
if( auxItem )
auxText = auxItem->GetItemDescription( aFrame );
auxText = auxItem->GetItemDescription( aFrame, true );
aList.emplace_back( mainText, auxText );
}

View File

@ -96,7 +96,7 @@ public:
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override
{
return wxString( _( "ERC Marker" ) );
}

View File

@ -93,7 +93,7 @@ public:
std::vector<VECTOR2I> GetConnectionPoints() const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override
{
return wxString( _( "No Connect" ) );
}

View File

@ -1879,7 +1879,7 @@ wxString SCH_PIN::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, ALT* aAlt
}
wxString SCH_PIN::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
wxString SCH_PIN::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
if( m_libPin )
{

View File

@ -228,7 +228,7 @@ public:
BITMAPS GetMenuImage() const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, ALT* aAlt ) const;
EDA_ITEM* Clone() const override;

View File

@ -195,7 +195,7 @@ void SCH_RULE_AREA::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OP
}
wxString SCH_RULE_AREA::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
wxString SCH_RULE_AREA::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
return _( "Schematic rule area" );
}

View File

@ -67,7 +67,7 @@ public:
virtual void Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed ) override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
/// @brief Resets all item and directive caches, saving the current state first
void ResetCaches( KIGFX::SCH_VIEW* view );

View File

@ -507,7 +507,7 @@ void SCH_SHAPE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_I
}
wxString SCH_SHAPE::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
wxString SCH_SHAPE::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
switch( GetShape() )
{

View File

@ -110,7 +110,7 @@ public:
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
BITMAPS GetMenuImage() const override;

View File

@ -1180,10 +1180,11 @@ void SCH_SHEET::RunOnChildren( const std::function<void( SCH_ITEM* )>& aFunction
}
wxString SCH_SHEET::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
wxString SCH_SHEET::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
return wxString::Format( _( "Hierarchical Sheet %s" ),
KIUI::EllipsizeMenuText( m_fields[ SHEETNAME ].GetText() ) );
aFull ? m_fields[ SHEETNAME ].GetShownText( false )
: KIUI::EllipsizeMenuText( m_fields[ SHEETNAME ].GetText() ) );
}

View File

@ -387,7 +387,7 @@ public:
bool GetDNP() const { return m_DNP; }
void SetDNP( bool aDNP ) { m_DNP = aDNP; }
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
BITMAPS GetMenuImage() const override;

View File

@ -52,7 +52,7 @@ public:
SCH_ITEM( nullptr, NOT_USED )
{}
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override
{
return _( "(Deleted Item)" );
}

View File

@ -334,10 +334,10 @@ void SCH_SHEET_PIN::GetEndPoints( std::vector<DANGLING_END_ITEM>& aItemList )
}
wxString SCH_SHEET_PIN::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
wxString SCH_SHEET_PIN::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
return wxString::Format( _( "Hierarchical Sheet Pin %s" ),
KIUI::EllipsizeMenuText( GetText() ) );
aFull ? GetShownText( false ) : KIUI::EllipsizeMenuText( GetText() ) );
}

View File

@ -187,7 +187,7 @@ public:
bool HasConnectivityChanges( const SCH_ITEM* aItem,
const SCH_SHEET_PATH* aInstance = nullptr ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
BITMAPS GetMenuImage() const override;

View File

@ -2231,7 +2231,7 @@ SCH_ITEM* SCH_SYMBOL::GetDrawItem( const VECTOR2I& aPosition, KICAD_T aType )
}
wxString SCH_SYMBOL::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
wxString SCH_SYMBOL::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
return wxString::Format( _( "Symbol %s [%s]" ),
KIUI::EllipsizeMenuText( GetField( REFERENCE_FIELD )->GetText() ),

View File

@ -786,7 +786,7 @@ public:
*/
SCH_ITEM* GetDrawItem( const VECTOR2I& aPosition, KICAD_T aType = TYPE_NOT_INIT );
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
BITMAPS GetMenuImage() const override;

View File

@ -395,7 +395,7 @@ INSPECT_RESULT SCH_TABLE::Visit( INSPECTOR aInspector, void* aTestData,
}
wxString SCH_TABLE::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
wxString SCH_TABLE::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
return wxString::Format( _( "%d Column Table" ), m_colCount );
}

View File

@ -191,7 +191,7 @@ public:
return false;
}
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
BITMAPS GetMenuImage() const override;

View File

@ -47,7 +47,7 @@ void SCH_TABLECELL::SwapData( SCH_ITEM* aItem )
}
wxString SCH_TABLECELL::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
wxString SCH_TABLECELL::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
return wxString::Format( _( "Table Cell %s" ), GetAddr() );
}

View File

@ -43,7 +43,7 @@ public:
return wxT( "SCH_TABLECELL" );
}
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
EDA_ITEM* Clone() const override
{

View File

@ -450,9 +450,10 @@ void SCH_TEXT::DoHypertextAction( EDA_DRAW_FRAME* aFrame ) const
}
wxString SCH_TEXT::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
wxString SCH_TEXT::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
return wxString::Format( _( "Graphic Text '%s'" ), KIUI::EllipsizeMenuText( GetText() ) );
return wxString::Format( _( "Graphic Text '%s'" ),
aFull ? GetShownText( false ) : KIUI::EllipsizeMenuText( GetText() ) );
}

View File

@ -134,7 +134,7 @@ public:
void ViewGetLayers( int aLayers[], int& aCount ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
BITMAPS GetMenuImage() const override;

View File

@ -416,7 +416,7 @@ void SCH_TEXTBOX::DoHypertextAction( EDA_DRAW_FRAME* aFrame ) const
}
wxString SCH_TEXTBOX::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
wxString SCH_TEXTBOX::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
return wxString::Format( _( "Text Box" ) );
}

View File

@ -125,7 +125,7 @@ public:
virtual bool IsReplaceable() const override { return true; }
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
BITMAPS GetMenuImage() const override;

View File

@ -1029,7 +1029,7 @@ INSPECT_RESULT GERBER_DRAW_ITEM::Visit( INSPECTOR inspector, void* testData,
}
wxString GERBER_DRAW_ITEM::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
wxString GERBER_DRAW_ITEM::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
wxString layerName = GERBER_FILE_IMAGE_LIST::GetImagesList().GetDisplayName( GetLayer(), true );

View File

@ -221,7 +221,7 @@ public:
const std::vector<KICAD_T>& aScanTypes ) override;
///< @copydoc EDA_ITEM::GetItemDescription()
virtual wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
virtual wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
///< @copydoc EDA_ITEM::GetMenuImage()
BITMAPS GetMenuImage() const override;

View File

@ -427,7 +427,7 @@ public:
BOARD_ITEM( nullptr, NOT_USED )
{}
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override
{
return _( "(Deleted Item)" );
}

View File

@ -155,7 +155,7 @@ public:
void PrintWsItem( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
#if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
@ -190,7 +190,7 @@ public:
void PrintWsItem( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
#if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
@ -243,7 +243,7 @@ public:
bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
#if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
@ -290,7 +290,7 @@ public:
const BOX2I GetBoundingBox() const override;
bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override { return false; }
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
#if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
@ -343,7 +343,7 @@ public:
bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
bool HitTest( const BOX2I& aRect, bool aContained, int aAccuracy = 0 ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
#if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
@ -380,7 +380,7 @@ public:
const BOX2I GetBoundingBox() const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
#if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }

View File

@ -347,9 +347,10 @@ public:
* returns a string to indicate that it was not overridden to provide the object
* specific text.
*
* @param aLong indicates a long string is acceptable
* @return The menu text string.
*/
virtual wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const;
virtual wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const;
/**
* Return a pointer to an image to be used in menus.

View File

@ -1207,7 +1207,7 @@ void BOARD::RemoveAll( std::initializer_list<KICAD_T> aTypes )
}
wxString BOARD::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
wxString BOARD::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
return wxString::Format( _( "PCB" ) );
}

View File

@ -673,7 +673,7 @@ public:
const TITLE_BLOCK& GetTitleBlock() const { return m_titles; }
void SetTitleBlock( const TITLE_BLOCK& aTitleBlock ) { m_titles = aTitleBlock; }
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
EDA_UNITS GetUserUnits() { return m_userUnits; }
void SetUserUnits( EDA_UNITS aUnits ) { m_userUnits = aUnits; }

View File

@ -49,7 +49,7 @@ DIALOG_GROUP_PROPERTIES::DIALOG_GROUP_PROPERTIES( PCB_BASE_EDIT_FRAME* aParent,
m_locked->Show( dynamic_cast<PCB_EDIT_FRAME*>( aParent ) != nullptr );
for( BOARD_ITEM* item : m_group->GetItems() )
m_membersList->Append( item->GetItemDescription( m_brdEditor ), item );
m_membersList->Append( item->GetItemDescription( m_brdEditor, true ), item );
SetupStandardButtons();
@ -151,7 +151,7 @@ void DIALOG_GROUP_PROPERTIES::DoAddMember( EDA_ITEM* aItem )
if( aItem == m_group )
return;
m_membersList->Append( aItem->GetItemDescription( m_brdEditor ), aItem );
m_membersList->Append( aItem->GetItemDescription( m_brdEditor, true ), aItem );
}

View File

@ -239,7 +239,7 @@ void DIALOG_POSITION_RELATIVE::updateAnchorInfo( BOARD_ITEM* aItem )
wxString msg = _( "<none selected>" );
if( aItem )
msg = aItem->GetItemDescription( &unitsProvider );
msg = aItem->GetItemDescription( &unitsProvider, true );
m_referenceInfo->SetLabel( wxString::Format( _( "Reference item: %s" ), msg ) );
break;

View File

@ -734,7 +734,7 @@ DRC_CONSTRAINT DRC_ENGINE::EvalRules( DRC_CONSTRAINT_T aConstraintType, const BO
{
REPORT( "" )
REPORT( wxString::Format( _( "Local override on %s; clearance: %s." ),
EscapeHTML( a->GetItemDescription( this ) ),
EscapeHTML( a->GetItemDescription( this, true ) ),
MessageTextFromValue( overrideA.value() ) ) )
override_val = ac->GetClearanceOverrides( &msg ).value();
@ -744,7 +744,7 @@ DRC_CONSTRAINT DRC_ENGINE::EvalRules( DRC_CONSTRAINT_T aConstraintType, const BO
{
REPORT( "" )
REPORT( wxString::Format( _( "Local override on %s; clearance: %s." ),
EscapeHTML( b->GetItemDescription( this ) ),
EscapeHTML( b->GetItemDescription( this, true ) ),
EscapeHTML( MessageTextFromValue( overrideB.value() ) ) ) )
if( overrideB > override_val )
@ -793,7 +793,7 @@ DRC_CONSTRAINT DRC_ENGINE::EvalRules( DRC_CONSTRAINT_T aConstraintType, const BO
REPORT( "" )
REPORT( wxString::Format( _( "Local override on %s; zone connection: %s." ),
EscapeHTML( pad->GetItemDescription( this ) ),
EscapeHTML( pad->GetItemDescription( this, true ) ),
EscapeHTML( PrintZoneConnection( override ) ) ) )
constraint.SetName( msg );
@ -810,7 +810,7 @@ DRC_CONSTRAINT DRC_ENGINE::EvalRules( DRC_CONSTRAINT_T aConstraintType, const BO
REPORT( "" )
REPORT( wxString::Format( _( "Local override on %s; thermal relief gap: %s." ),
EscapeHTML( pad->GetItemDescription( this ) ),
EscapeHTML( pad->GetItemDescription( this, true ) ),
EscapeHTML( MessageTextFromValue( gap_override ) ) ) )
constraint.SetName( msg );
@ -827,7 +827,7 @@ DRC_CONSTRAINT DRC_ENGINE::EvalRules( DRC_CONSTRAINT_T aConstraintType, const BO
REPORT( "" )
REPORT( wxString::Format( _( "Local override on %s; thermal spoke width: %s." ),
EscapeHTML( pad->GetItemDescription( this ) ),
EscapeHTML( pad->GetItemDescription( this, true ) ),
EscapeHTML( MessageTextFromValue( spoke_override ) ) ) )
if( zone && zone->GetMinThickness() > spoke_override )
@ -836,7 +836,7 @@ DRC_CONSTRAINT DRC_ENGINE::EvalRules( DRC_CONSTRAINT_T aConstraintType, const BO
REPORT( "" )
REPORT( wxString::Format( _( "%s min thickness: %s." ),
EscapeHTML( zone->GetItemDescription( this ) ),
EscapeHTML( zone->GetItemDescription( this, true ) ),
EscapeHTML( MessageTextFromValue( spoke_override ) ) ) )
}
@ -1070,12 +1070,12 @@ DRC_CONSTRAINT DRC_ENGINE::EvalRules( DRC_CONSTRAINT_T aConstraintType, const BO
else if( a_is_non_copper )
{
REPORT( wxString::Format( _( "%s contains no copper. Rule ignored." ),
EscapeHTML( a->GetItemDescription( this ) ) ) )
EscapeHTML( a->GetItemDescription( this, true ) ) ) )
}
else if( b_is_non_copper )
{
REPORT( wxString::Format( _( "%s contains no copper. Rule ignored." ),
EscapeHTML( b->GetItemDescription( this ) ) ) )
EscapeHTML( b->GetItemDescription( this, true ) ) ) )
}
return;
@ -1193,7 +1193,7 @@ DRC_CONSTRAINT DRC_ENGINE::EvalRules( DRC_CONSTRAINT_T aConstraintType, const BO
{
// Report non-drilled-holes as an implicit condition
REPORT( wxString::Format( _( "%s is not a drilled hole; rule ignored." ),
a->GetItemDescription( this ) ) )
a->GetItemDescription( this, true ) ) )
}
else if( !c->condition || c->condition->GetExpression().IsEmpty() )
{
@ -1313,7 +1313,7 @@ DRC_CONSTRAINT DRC_ENGINE::EvalRules( DRC_CONSTRAINT_T aConstraintType, const BO
}
REPORT( wxString::Format( _( "Local clearance on %s: %s." ),
EscapeHTML( a->GetItemDescription( this ) ),
EscapeHTML( a->GetItemDescription( this, true ) ),
MessageTextFromValue( localA ) ) )
if( localA > clearance )
@ -1337,7 +1337,7 @@ DRC_CONSTRAINT DRC_ENGINE::EvalRules( DRC_CONSTRAINT_T aConstraintType, const BO
}
REPORT( wxString::Format( _( "Local clearance on %s: %s." ),
EscapeHTML( b->GetItemDescription( this ) ),
EscapeHTML( b->GetItemDescription( this, true ) ),
MessageTextFromValue( localB ) ) )
if( localB > clearance )
@ -1396,7 +1396,7 @@ DRC_CONSTRAINT DRC_ENGINE::EvalRules( DRC_CONSTRAINT_T aConstraintType, const BO
{
REPORT( "" )
REPORT( wxString::Format( _( "%s zone connection: %s." ),
EscapeHTML( parentFootprint->GetItemDescription( this ) ),
EscapeHTML( parentFootprint->GetItemDescription( this, true ) ),
EscapeHTML( PrintZoneConnection( local ) ) ) )
constraint.SetParentRule( nullptr );
@ -1412,7 +1412,7 @@ DRC_CONSTRAINT DRC_ENGINE::EvalRules( DRC_CONSTRAINT_T aConstraintType, const BO
REPORT( "" )
REPORT( wxString::Format( _( "%s pad connection: %s." ),
EscapeHTML( zone->GetItemDescription( this ) ),
EscapeHTML( zone->GetItemDescription( this, true ) ),
EscapeHTML( PrintZoneConnection( local ) ) ) )
constraint.SetParentRule( nullptr );
@ -1429,7 +1429,7 @@ DRC_CONSTRAINT DRC_ENGINE::EvalRules( DRC_CONSTRAINT_T aConstraintType, const BO
REPORT( "" )
REPORT( wxString::Format( _( "%s thermal relief gap: %s." ),
EscapeHTML( zone->GetItemDescription( this ) ),
EscapeHTML( zone->GetItemDescription( this, true ) ),
EscapeHTML( MessageTextFromValue( local ) ) ) )
constraint.SetParentRule( nullptr );
@ -1446,7 +1446,7 @@ DRC_CONSTRAINT DRC_ENGINE::EvalRules( DRC_CONSTRAINT_T aConstraintType, const BO
REPORT( "" )
REPORT( wxString::Format( _( "%s thermal spoke width: %s." ),
EscapeHTML( zone->GetItemDescription( this ) ),
EscapeHTML( zone->GetItemDescription( this, true ) ),
EscapeHTML( MessageTextFromValue( local ) ) ) )
constraint.SetParentRule( nullptr );

View File

@ -119,7 +119,7 @@ public:
return diff; \
} while (0)
#define ITEM_DESC( item ) ( item )->GetItemDescription( &g_unitsProvider )
#define ITEM_DESC( item ) ( item )->GetItemDescription( &g_unitsProvider, true )
#define PAD_DESC( pad ) wxString::Format( _( "Pad %s" ), ( pad )->GetNumber() )

View File

@ -2002,7 +2002,7 @@ INSPECT_RESULT FOOTPRINT::Visit( INSPECTOR inspector, void* testData,
}
wxString FOOTPRINT::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
wxString FOOTPRINT::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
wxString reference = GetReference();

View File

@ -863,7 +863,7 @@ public:
return wxT( "FOOTPRINT" );
}
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
BITMAPS GetMenuImage() const override;

View File

@ -251,7 +251,7 @@ public:
wxString GetGeneratorType() const override { return wxS( "tuning_pattern" ); }
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override
{
return wxString( _( "Tuning Pattern" ) );
}

View File

@ -1431,7 +1431,7 @@ wxString PAD::ShowPadAttr() const
}
wxString PAD::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
wxString PAD::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
FOOTPRINT* parentFP = nullptr;

View File

@ -769,7 +769,7 @@ public:
void Rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle ) override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
BITMAPS GetMenuImage() const override;

View File

@ -562,10 +562,10 @@ const BOX2I PCB_DIMENSION_BASE::GetBoundingBox() const
}
wxString PCB_DIMENSION_BASE::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
wxString PCB_DIMENSION_BASE::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
return wxString::Format( _( "Dimension '%s' on %s" ),
KIUI::EllipsizeMenuText( GetText() ),
aFull ? GetShownText( false ) : KIUI::EllipsizeMenuText( GetText() ),
GetLayerName() );
}

View File

@ -276,7 +276,7 @@ public:
std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer,
FLASHING aFlash = FLASHING::DEFAULT ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
const BOX2I ViewBBox() const override;

View File

@ -139,34 +139,31 @@ wxString PCB_FIELD::GetTextTypeDescription() const
}
wxString PCB_FIELD::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
wxString PCB_FIELD::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
wxString content = aFull ? GetShownText( false ) : KIUI::EllipsizeMenuText( GetText() );
wxString ref = GetParentFootprint()->GetReference();
switch( m_id )
{
case REFERENCE_FIELD:
return wxString::Format( _( "Reference '%s'" ),
GetParentFootprint()->GetReference() );
return wxString::Format( _( "Reference field of %s" ), ref );
case VALUE_FIELD:
return wxString::Format( _( "Value '%s' of %s" ),
KIUI::EllipsizeMenuText( GetText() ),
GetParentFootprint()->GetReference() );
return wxString::Format( _( "Value field of %s (%s)" ), ref, content );
case FOOTPRINT_FIELD:
return wxString::Format( _( "Footprint '%s' of %s" ),
KIUI::EllipsizeMenuText( GetText() ),
GetParentFootprint()->GetReference() );
return wxString::Format( _( "Footprint field of %s (%s)" ), ref, content );
case DATASHEET_FIELD:
return wxString::Format( _( "Datasheet '%s' of %s" ),
KIUI::EllipsizeMenuText( GetText() ),
GetParentFootprint()->GetReference() );
return wxString::Format( _( "Datasheet field of %s (%s)" ), ref, content );
default:
break; // avoid unreachable code / missing return statement warnings
if( GetName().IsEmpty() )
return wxString::Format( _( "Field of %s (%s)" ), ref, content );
else
return wxString::Format( _( "%s field of %s (%s)" ), GetName(), ref, content );
}
return wxString::Format( _( "Field '%s' of %s" ), KIUI::EllipsizeMenuText( GetText() ),
GetParentFootprint()->GetReference() );
}

View File

@ -76,7 +76,7 @@ public:
wxString GetTextTypeDescription() const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
double ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const override;

View File

@ -211,7 +211,7 @@ std::vector<std::pair<wxString, wxVariant>> PCB_GENERATOR::GetRowData()
}
wxString PCB_GENERATOR::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
wxString PCB_GENERATOR::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
return wxString( _( "Generator" ) );
}

View File

@ -103,7 +103,7 @@ public:
virtual void ShowPropertiesDialog( PCB_BASE_EDIT_FRAME* aEditFrame ) {};
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
virtual wxString GetPluralName() const = 0;

View File

@ -363,7 +363,7 @@ void PCB_GROUP::Flip( const VECTOR2I& aCentre, bool aFlipLeftRight )
}
wxString PCB_GROUP::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
wxString PCB_GROUP::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
if( m_name.empty() )
return wxString::Format( _( "Unnamed Group, %zu members" ), m_items.size() );

View File

@ -185,7 +185,7 @@ public:
void Flip( const VECTOR2I& aCentre, bool aFlipLeftRight ) override;
/// @copydoc EDA_ITEM::GetItemDescription
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
/// @copydoc EDA_ITEM::GetMenuImage
BITMAPS GetMenuImage() const override;

View File

@ -227,10 +227,10 @@ void PCB_MARKER::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_
auxItem = aFrame->GetItem( m_rcItem->GetAuxItemID() );
if( mainItem )
mainText = mainItem->GetItemDescription( aFrame );
mainText = mainItem->GetItemDescription( aFrame, true );
if( auxItem )
auxText = auxItem->GetItemDescription( aFrame );
auxText = auxItem->GetItemDescription( aFrame, true );
aList.emplace_back( mainText, auxText );
}
@ -260,11 +260,10 @@ std::shared_ptr<SHAPE> PCB_MARKER::GetEffectiveShape( PCB_LAYER_ID aLayer, FLASH
}
wxString PCB_MARKER::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
wxString PCB_MARKER::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
// m_rcItem->GetErrorMessage() could be used instead, but is probably too long
// for menu duty.
return wxString::Format( _( "Marker (%s)" ), m_rcItem->GetErrorText() );
return wxString::Format( _( "Marker (%s)" ),
aFull ? m_rcItem->GetErrorMessage() : m_rcItem->GetErrorText() );
}

View File

@ -98,7 +98,7 @@ public:
return BOARD_ITEM::Matches( m_rcItem->GetErrorMessage(), aSearchData );
}
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
BITMAPS GetMenuImage() const override;

View File

@ -120,7 +120,7 @@ public:
void Flip( const VECTOR2I& aCentre, bool aFlipLeftRight ) override;
void Rotate( const VECTOR2I& aCenter, const EDA_ANGLE& aAngle ) override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override
{
return wxString( _( "Reference Image" ) );
}

View File

@ -698,7 +698,7 @@ void PCB_SHAPE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_I
}
wxString PCB_SHAPE::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
wxString PCB_SHAPE::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
FOOTPRINT* parentFP = nullptr;

View File

@ -150,7 +150,7 @@ public:
int aError, ERROR_LOC aErrorLoc,
bool ignoreLineWidth = false ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
BITMAPS GetMenuImage() const override;

View File

@ -355,7 +355,7 @@ INSPECT_RESULT PCB_TABLE::Visit( INSPECTOR aInspector, void* aTestData,
}
wxString PCB_TABLE::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
wxString PCB_TABLE::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
return wxString::Format( _( "%d Column Table" ), m_colCount );
}

View File

@ -212,7 +212,7 @@ public:
return false;
}
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
BITMAPS GetMenuImage() const override;

View File

@ -47,7 +47,7 @@ void PCB_TABLECELL::swapData( BOARD_ITEM* aImage )
}
wxString PCB_TABLECELL::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
wxString PCB_TABLECELL::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
return wxString::Format( _( "Table Cell %s" ), GetAddr() );
}

View File

@ -65,7 +65,7 @@ public:
int GetRowSpan() const { return m_rowSpan; }
void SetRowSpan( int aSpan ) { m_rowSpan = aSpan; }
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;

View File

@ -119,7 +119,7 @@ std::shared_ptr<SHAPE> PCB_TARGET::GetEffectiveShape( PCB_LAYER_ID aLayer, FLASH
}
wxString PCB_TARGET::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
wxString PCB_TARGET::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
// Targets are on *every* layer by definition
return _( "Target" );

View File

@ -86,7 +86,7 @@ public:
std::shared_ptr<SHAPE>
GetEffectiveShape( PCB_LAYER_ID aLayer, FLASHING aFlash = FLASHING::DEFAULT ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
BITMAPS GetMenuImage() const override;

View File

@ -487,17 +487,17 @@ wxString PCB_TEXT::GetTextTypeDescription() const
}
wxString PCB_TEXT::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
wxString PCB_TEXT::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
wxString content = aFull ? GetShownText( false ) : KIUI::EllipsizeMenuText( GetText() );
if( FOOTPRINT* parentFP = GetParentFootprint() )
{
return wxString::Format( _( "Footprint Text '%s' of %s" ),
KIUI::EllipsizeMenuText( GetText() ), parentFP->GetReference() );
wxString ref = parentFP->GetReference();
return wxString::Format( _( "Footprint text of %s (%s)" ), ref, content );
}
return wxString::Format( _( "PCB Text '%s' on %s" ),
KIUI::EllipsizeMenuText( GetText() ),
GetLayerName() );
return wxString::Format( _( "PCB text '%s' on %s" ), content, GetLayerName() );
}

View File

@ -142,7 +142,7 @@ public:
virtual wxString GetTextTypeDescription() const;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
BITMAPS GetMenuImage() const override;

View File

@ -483,10 +483,10 @@ bool PCB_TEXTBOX::HitTest( const BOX2I& aRect, bool aContained, int aAccuracy )
}
wxString PCB_TEXTBOX::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
wxString PCB_TEXTBOX::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
return wxString::Format( _( "PCB Text Box '%s' on %s" ),
KIUI::EllipsizeMenuText( GetText() ),
aFull ? GetShownText( false ) : KIUI::EllipsizeMenuText( GetText() ),
GetLayerName() );
}

View File

@ -140,7 +140,7 @@ public:
std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER,
FLASHING aFlash = FLASHING::DEFAULT ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
BITMAPS GetMenuImage() const override;

View File

@ -136,7 +136,7 @@ EDA_ITEM* PCB_VIA::Clone() const
}
wxString PCB_VIA::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
wxString PCB_VIA::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
wxString formatStr;
@ -1529,7 +1529,7 @@ bool PCB_VIA::HitTest( const BOX2I& aRect, bool aContained, int aAccuracy ) cons
}
wxString PCB_TRACK::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
wxString PCB_TRACK::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
return wxString::Format( Type() == PCB_ARC_T ? _("Track (arc) %s on %s, length %s" )
: _("Track %s on %s, length %s" ),

View File

@ -199,7 +199,7 @@ public:
virtual MINOPTMAX<int> GetWidthConstraint( wxString* aSource = nullptr ) const;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
BITMAPS GetMenuImage() const override;
@ -457,7 +457,7 @@ public:
return wxT( "PCB_VIA" );
}
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
BITMAPS GetMenuImage() const override;

View File

@ -1263,7 +1263,7 @@ bool PNS_KICAD_IFACE_BASE::syncZone( PNS::NODE* aWorld, ZONE* aZone, SHAPE_POLY_
if( !poly->IsTriangulationUpToDate() )
{
UNITS_PROVIDER unitsProvider( pcbIUScale, GetUnits() );
msg.Printf( _( "%s is malformed." ), aZone->GetItemDescription( &unitsProvider ) );
msg.Printf( _( "%s is malformed." ), aZone->GetItemDescription( &unitsProvider, true ) );
KIDIALOG dlg( nullptr, msg, KIDIALOG::KD_WARNING );
dlg.ShowDetailedText( _( "This zone cannot be handled by the router.\n"

View File

@ -1349,7 +1349,7 @@ SHOVE::SHOVE_STATUS SHOVE::shoveIteration( int aIter )
UNITS_PROVIDER up( pcbIUScale, EDA_UNITS::MILLIMETRES );
PNS_DBG( Dbg(), Message, wxString::Format( wxT( "NI: %s (%s)" ),
ni->Format(),
ni->Parent() ? ni->Parent()->GetItemDescription( &up )
ni->Parent() ? ni->Parent()->GetItemDescription( &up, false )
: wxString( wxT( "null" ) ) ) );
unwindLineStack( ni );

View File

@ -191,7 +191,7 @@ wxString BOARD_INSPECTION_TOOL::getItemDescription( BOARD_ITEM* aItem )
if( !aItem )
return wxString();
wxString msg = aItem->GetItemDescription( m_frame );
wxString msg = aItem->GetItemDescription( m_frame, true );
if( aItem->IsConnected() && !isNPTHPad( aItem ) )
{

View File

@ -1566,8 +1566,8 @@ int PCB_CONTROL::UpdateMessagePanel( const TOOL_EVENT& aEvent )
BOARD_ITEM* a = static_cast<BOARD_ITEM*>( selection[0] );
BOARD_ITEM* b = static_cast<BOARD_ITEM*>( selection[1] );
msgItems.emplace_back( MSG_PANEL_ITEM( a->GetItemDescription( m_frame ),
b->GetItemDescription( m_frame ) ) );
msgItems.emplace_back( MSG_PANEL_ITEM( a->GetItemDescription( m_frame, false ),
b->GetItemDescription( m_frame, false ) ) );
BOARD_CONNECTED_ITEM* a_conn = dyn_cast<BOARD_CONNECTED_ITEM*>( a );
BOARD_CONNECTED_ITEM* b_conn = dyn_cast<BOARD_CONNECTED_ITEM*>( b );

View File

@ -820,7 +820,7 @@ bool ZONE::AppendCorner( VECTOR2I aPosition, int aHoleIdx, bool aAllowDuplicatio
}
wxString ZONE::GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const
wxString ZONE::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
LSEQ layers = m_layerSet.Seq();
wxString layerDesc;

View File

@ -682,7 +682,7 @@ public:
void AddPolygon( const SHAPE_LINE_CHAIN& aPolygon );
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider ) const override;
wxString GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const override;
BITMAPS GetMenuImage() const override;