From fffb0d340f804008ee18e10358350b137ed8a938 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 5 Jul 2019 10:25:23 +0200 Subject: [PATCH] Eeschema: fix not deletable bitmap issue (missing SCH_BITMAP in deletable list). Also display bitmap info in message panel. Fixes: lp:1835125 https://bugs.launchpad.net/kicad/+bug/1835125 --- eeschema/sch_bitmap.cpp | 10 ++++++++++ eeschema/sch_bitmap.h | 2 ++ eeschema/tools/sch_edit_tool.cpp | 1 + 3 files changed, 13 insertions(+) diff --git a/eeschema/sch_bitmap.cpp b/eeschema/sch_bitmap.cpp index 80b78af4c3..59066c7f9d 100644 --- a/eeschema/sch_bitmap.cpp +++ b/eeschema/sch_bitmap.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include @@ -192,6 +193,15 @@ BITMAP_DEF SCH_BITMAP::GetMenuImage() const } +void SCH_BITMAP::GetMsgPanelInfo( EDA_UNITS_T aUnits, MSG_PANEL_ITEMS& aList ) +{ + aList.push_back( MSG_PANEL_ITEM( _( "Bitmap" ), wxEmptyString, RED ) ); + + aList.push_back( MSG_PANEL_ITEM( _( "Width" ), MessageTextFromValue( aUnits, GetSize().x ), RED ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Height" ), MessageTextFromValue( aUnits, GetSize().y ), RED ) ); +} + + void SCH_BITMAP::ViewGetLayers( int aLayers[], int& aCount ) const { aCount = 1; diff --git a/eeschema/sch_bitmap.h b/eeschema/sch_bitmap.h index 54ef61cf2f..43eefb065a 100644 --- a/eeschema/sch_bitmap.h +++ b/eeschema/sch_bitmap.h @@ -130,6 +130,8 @@ public: BITMAP_DEF GetMenuImage() const override; + void GetMsgPanelInfo( EDA_UNITS_T aUnits, std::vector< MSG_PANEL_ITEM >& aList ) override; + wxPoint GetPosition() const override { return m_pos; } void SetPosition( const wxPoint& aPosition ) override { m_pos = aPosition; } diff --git a/eeschema/tools/sch_edit_tool.cpp b/eeschema/tools/sch_edit_tool.cpp index c89f9f7ec9..43c72cc44a 100644 --- a/eeschema/tools/sch_edit_tool.cpp +++ b/eeschema/tools/sch_edit_tool.cpp @@ -874,6 +874,7 @@ static KICAD_T deletableItems[] = SCH_SHEET_T, SCH_SHEET_PIN_T, SCH_COMPONENT_T, + SCH_BITMAP_T, EOT };