diff --git a/pcbnew/class_dimension.cpp b/pcbnew/class_dimension.cpp index 4c08065223..aa61d9034d 100644 --- a/pcbnew/class_dimension.cpp +++ b/pcbnew/class_dimension.cpp @@ -307,7 +307,35 @@ void DIMENSION::SetEnd( const wxPoint& aEnd ) void DIMENSION::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector& aList ) { // for now, display only the text within the DIMENSION using class TEXTE_PCB. - m_text.GetMsgPanelInfo( aFrame, aList ); + wxString msg; + + wxCHECK_RET( m_Parent != NULL, wxT( "TEXTE_PCB::GetMsgPanelInfo() m_Parent is NULL." ) ); + + aList.emplace_back( _( "Dimension" ), m_text.GetShownText(), DARKGREEN ); + + aList.emplace_back( _( "Layer" ), GetLayerName(), BLUE ); + + aList.emplace_back( _( "Prefix" ), GetPrefix(), BLUE ); + + if( GetOverrideTextEnabled() ) + { + aList.emplace_back( _( "Override Text" ), GetOverrideText(), BLUE ); + } + else + { + aList.emplace_back( _( "Value" ), GetValueText(), BLUE ); + + msg = "%" + wxString::Format( "1.%df", GetPrecision() ); + aList.emplace_back( _( "Precision" ), wxString::Format( msg, 0.0 ), BLUE ); + } + + aList.emplace_back( _( "Suffix" ), GetSuffix(), BLUE ); + + EDA_UNITS units; + bool useMils; + + GetUnits( units, useMils ); + aList.emplace_back( _( "Units" ), GetAbbreviatedUnitsLabel( units, useMils ), BLUE ); } @@ -913,6 +941,16 @@ void LEADER::updateGeometry() } +void LEADER::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector& aList ) +{ + wxString msg; + + aList.emplace_back( _( "Leader" ), m_text.GetShownText(), DARKGREEN ); + + aList.emplace_back( _( "Layer" ), GetLayerName(), BLUE ); +} + + CENTER_DIMENSION::CENTER_DIMENSION( BOARD_ITEM* aParent ) : DIMENSION( aParent, PCB_DIM_CENTER_T ) { diff --git a/pcbnew/class_dimension.h b/pcbnew/class_dimension.h index 2a7b816c44..989867a109 100644 --- a/pcbnew/class_dimension.h +++ b/pcbnew/class_dimension.h @@ -512,6 +512,8 @@ public: void SetTextFrame( DIM_TEXT_FRAME aFrame ) { m_textFrame = aFrame; } DIM_TEXT_FRAME GetTextFrame() const { return m_textFrame; } + void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector& aList ) override; + protected: void updateGeometry() override; diff --git a/pcbnew/class_pcb_text.cpp b/pcbnew/class_pcb_text.cpp index be412ab7b5..c31c7fc773 100644 --- a/pcbnew/class_pcb_text.cpp +++ b/pcbnew/class_pcb_text.cpp @@ -109,10 +109,7 @@ void TEXTE_PCB::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vectorType() ) == PCB_DIMENSION_T ) - aList.emplace_back( _( "Dimension" ), GetShownText(), DARKGREEN ); - else - aList.emplace_back( _( "PCB Text" ), GetShownText(), DARKGREEN ); + aList.emplace_back( _( "PCB Text" ), GetShownText(), DARKGREEN ); aList.emplace_back( _( "Layer" ), GetLayerName(), BLUE );