diff --git a/common/drawing_sheet/ds_draw_item.cpp b/common/drawing_sheet/ds_draw_item.cpp index d2b1bafb2d..12386e1460 100644 --- a/common/drawing_sheet/ds_draw_item.cpp +++ b/common/drawing_sheet/ds_draw_item.cpp @@ -98,7 +98,8 @@ bool DS_DRAW_ITEM_BASE::HitTest( const EDA_RECT& aRect, bool aContained, int aAc } -void DS_DRAW_ITEM_BASE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList ) +void DS_DRAW_ITEM_BASE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, + std::vector& aList ) { wxString msg; DS_DATA_ITEM* dataItem = GetPeer(); diff --git a/common/eda_draw_frame.cpp b/common/eda_draw_frame.cpp index 9046515678..104ccced3c 100644 --- a/common/eda_draw_frame.cpp +++ b/common/eda_draw_frame.cpp @@ -660,7 +660,7 @@ void EDA_DRAW_FRAME::ClearMsgPanel() } -void EDA_DRAW_FRAME::SetMsgPanel( const MSG_PANEL_ITEMS& aList ) +void EDA_DRAW_FRAME::SetMsgPanel( const std::vector& aList ) { if( m_messagePanel ) { @@ -688,7 +688,7 @@ void EDA_DRAW_FRAME::SetMsgPanel( EDA_ITEM* aItem ) { wxCHECK_RET( aItem, wxT( "Invalid EDA_ITEM pointer. Bad programmer." ) ); - MSG_PANEL_ITEMS items; + std::vector items; aItem->GetMsgPanelInfo( this, items ); SetMsgPanel( items ); } diff --git a/cvpcb/display_footprints_frame.cpp b/cvpcb/display_footprints_frame.cpp index 5033df6548..541f15d86b 100644 --- a/cvpcb/display_footprints_frame.cpp +++ b/cvpcb/display_footprints_frame.cpp @@ -517,8 +517,8 @@ void DISPLAY_FOOTPRINTS_FRAME::updateView() void DISPLAY_FOOTPRINTS_FRAME::UpdateMsgPanel() { - FOOTPRINT* footprint = GetBoard()->GetFirstFootprint(); - MSG_PANEL_ITEMS items; + FOOTPRINT* footprint = GetBoard()->GetFirstFootprint(); + std::vector items; if( footprint ) footprint->GetMsgPanelInfo( this, items ); diff --git a/eeschema/lib_circle.cpp b/eeschema/lib_circle.cpp index a18000e696..9eb6e31670 100644 --- a/eeschema/lib_circle.cpp +++ b/eeschema/lib_circle.cpp @@ -234,7 +234,7 @@ const EDA_RECT LIB_CIRCLE::GetBoundingBox() const } -void LIB_CIRCLE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList ) +void LIB_CIRCLE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector& aList ) { wxString msg; EDA_RECT bBox = GetBoundingBox(); diff --git a/eeschema/lib_field.cpp b/eeschema/lib_field.cpp index 8a3a3aa1ed..1409345635 100644 --- a/eeschema/lib_field.cpp +++ b/eeschema/lib_field.cpp @@ -417,27 +417,43 @@ void LIB_FIELD::CalcEdit( const wxPoint& aPosition ) } -void LIB_FIELD::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList ) +void LIB_FIELD::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector& aList ) { wxString msg; LIB_ITEM::GetMsgPanelInfo( aFrame, aList ); - // Display style: + aList.push_back( MSG_PANEL_ITEM( _( "Field" ), GetName() ) ); + + // Don't use GetShownText() here; we want to show the user the variable references + aList.push_back( MSG_PANEL_ITEM( _( "Text" ), UnescapeString( GetText() ) ) ); + + msg = IsVisible() ? _( "Yes" ) : _( "No" ); + aList.push_back( MSG_PANEL_ITEM( _( "Visible" ), msg ) ); + msg = GetTextStyleName(); aList.push_back( MSG_PANEL_ITEM( _( "Style" ), msg ) ); msg = MessageTextFromValue( aFrame->GetUserUnits(), GetTextWidth() ); - aList.push_back( MSG_PANEL_ITEM( _( "Width" ), msg ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Text Size" ), msg ) ); - msg = MessageTextFromValue( aFrame->GetUserUnits(), GetTextHeight() ); - aList.push_back( MSG_PANEL_ITEM( _( "Height" ), msg ) ); + switch ( GetHorizJustify() ) + { + case GR_TEXT_HJUSTIFY_LEFT: msg = _( "Left" ); break; + case GR_TEXT_HJUSTIFY_CENTER: msg = _( "Center" ); break; + case GR_TEXT_HJUSTIFY_RIGHT: msg = _( "Right" ); break; + } - // Display field name (ref, value ...) - aList.push_back( MSG_PANEL_ITEM( _( "Field" ), GetName() ) ); + aList.push_back( MSG_PANEL_ITEM( _( "H Justification" ), msg ) ); - // Display field text: - aList.push_back( MSG_PANEL_ITEM( _( "Value" ), GetShownText() ) ); + switch ( GetVertJustify() ) + { + case GR_TEXT_VJUSTIFY_TOP: msg = _( "Top" ); break; + case GR_TEXT_VJUSTIFY_CENTER: msg = _( "Center" ); break; + case GR_TEXT_VJUSTIFY_BOTTOM: msg = _( "Bottom" ); break; + } + + aList.push_back( MSG_PANEL_ITEM( _( "V Justification" ), msg ) ); } diff --git a/eeschema/lib_item.cpp b/eeschema/lib_item.cpp index a8d60348e8..55ff472cfa 100644 --- a/eeschema/lib_item.cpp +++ b/eeschema/lib_item.cpp @@ -47,7 +47,7 @@ LIB_ITEM::LIB_ITEM( KICAD_T aType, } -void LIB_ITEM::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList ) +void LIB_ITEM::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector& aList ) { wxString msg; diff --git a/eeschema/lib_pin.cpp b/eeschema/lib_pin.cpp index d166c5f949..5925fae78a 100644 --- a/eeschema/lib_pin.cpp +++ b/eeschema/lib_pin.cpp @@ -1032,7 +1032,7 @@ void LIB_PIN::Plot( PLOTTER* aPlotter, const wxPoint& aPffset, bool aFill, } -void LIB_PIN::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList ) +void LIB_PIN::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector& aList ) { LIB_ITEM::GetMsgPanelInfo( aFrame, aList ); diff --git a/eeschema/lib_polyline.cpp b/eeschema/lib_polyline.cpp index 223cbba7d8..b3d9409aca 100644 --- a/eeschema/lib_polyline.cpp +++ b/eeschema/lib_polyline.cpp @@ -328,7 +328,7 @@ void LIB_POLYLINE::DeleteSegment( const wxPoint aPosition ) } -void LIB_POLYLINE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList ) +void LIB_POLYLINE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector& aList ) { wxString msg; EDA_RECT bBox = GetBoundingBox(); diff --git a/eeschema/lib_rectangle.cpp b/eeschema/lib_rectangle.cpp index a719f4d72d..44b5148bd1 100644 --- a/eeschema/lib_rectangle.cpp +++ b/eeschema/lib_rectangle.cpp @@ -181,7 +181,7 @@ void LIB_RECTANGLE::print( const RENDER_SETTINGS* aSettings, const wxPoint& aOff } -void LIB_RECTANGLE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList ) +void LIB_RECTANGLE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector& aList ) { LIB_ITEM::GetMsgPanelInfo( aFrame, aList ); diff --git a/eeschema/lib_text.cpp b/eeschema/lib_text.cpp index 22ab447bae..904c997f77 100644 --- a/eeschema/lib_text.cpp +++ b/eeschema/lib_text.cpp @@ -21,10 +21,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file lib_text.cpp - */ - #include #include #include @@ -39,7 +35,7 @@ #include #include #include // For some default values - +#include LIB_TEXT::LIB_TEXT( LIB_SYMBOL* aParent ) : LIB_ITEM( LIB_TEXT_T, aParent ), @@ -343,12 +339,38 @@ void LIB_TEXT::print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset, } -void LIB_TEXT::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList ) +void LIB_TEXT::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector& aList ) { + wxString msg; + LIB_ITEM::GetMsgPanelInfo( aFrame, aList ); - wxString msg = MessageTextFromValue( aFrame->GetUserUnits(), GetTextThickness() ); - aList.push_back( MSG_PANEL_ITEM( _( "Line Width" ), msg ) ); + // Don't use GetShownText() here; we want to show the user the variable references + aList.push_back( MSG_PANEL_ITEM( _( "Text" ), UnescapeString( GetText() ) ) ); + + msg = GetTextStyleName(); + aList.push_back( MSG_PANEL_ITEM( _( "Style" ), msg ) ); + + msg = MessageTextFromValue( aFrame->GetUserUnits(), GetTextWidth() ); + aList.push_back( MSG_PANEL_ITEM( _( "Text Size" ), msg ) ); + + switch ( GetHorizJustify() ) + { + case GR_TEXT_HJUSTIFY_LEFT: msg = _( "Left" ); break; + case GR_TEXT_HJUSTIFY_CENTER: msg = _( "Center" ); break; + case GR_TEXT_HJUSTIFY_RIGHT: msg = _( "Right" ); break; + } + + aList.push_back( MSG_PANEL_ITEM( _( "H Justification" ), msg ) ); + + switch ( GetVertJustify() ) + { + case GR_TEXT_VJUSTIFY_TOP: msg = _( "Top" ); break; + case GR_TEXT_VJUSTIFY_CENTER: msg = _( "Center" ); break; + case GR_TEXT_VJUSTIFY_BOTTOM: msg = _( "Bottom" ); break; + } + + aList.push_back( MSG_PANEL_ITEM( _( "V Justification" ), msg ) ); } diff --git a/eeschema/lib_text.h b/eeschema/lib_text.h index c879d37a69..75ce03889a 100644 --- a/eeschema/lib_text.h +++ b/eeschema/lib_text.h @@ -79,8 +79,6 @@ public: int GetPenWidth() const override; - void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector& aList ) override; - const EDA_RECT GetBoundingBox() const override; void BeginEdit( const wxPoint& aStartPoint ) override; @@ -105,6 +103,7 @@ public: void SetWidth( int aWidth ) override { SetTextThickness( aWidth ); } wxString GetSelectMenuText( EDA_UNITS aUnits ) const override; + void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector& aList ) override; BITMAPS GetMenuImage() const override; diff --git a/eeschema/sch_bitmap.cpp b/eeschema/sch_bitmap.cpp index d800c0bcc0..4cbe346622 100644 --- a/eeschema/sch_bitmap.cpp +++ b/eeschema/sch_bitmap.cpp @@ -196,7 +196,7 @@ BITMAPS SCH_BITMAP::GetMenuImage() const } -void SCH_BITMAP::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList ) +void SCH_BITMAP::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector& aList ) { aList.push_back( MSG_PANEL_ITEM( _( "Bitmap" ), wxEmptyString ) ); diff --git a/eeschema/sch_bus_entry.cpp b/eeschema/sch_bus_entry.cpp index a1e8798257..f718f0dfe6 100644 --- a/eeschema/sch_bus_entry.cpp +++ b/eeschema/sch_bus_entry.cpp @@ -478,7 +478,8 @@ void SCH_BUS_ENTRY_BASE::Plot( PLOTTER* aPlotter ) const } -void SCH_BUS_ENTRY_BASE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList ) +void SCH_BUS_ENTRY_BASE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, + std::vector& aList ) { wxString msg; diff --git a/eeschema/sch_connection.cpp b/eeschema/sch_connection.cpp index e385e83520..35005a6fc7 100644 --- a/eeschema/sch_connection.cpp +++ b/eeschema/sch_connection.cpp @@ -396,7 +396,7 @@ void SCH_CONNECTION::SetSuffix( const wxString& aSuffix ) } -void SCH_CONNECTION::AppendInfoToMsgPanel( MSG_PANEL_ITEMS& aList ) const +void SCH_CONNECTION::AppendInfoToMsgPanel( std::vector& aList ) const { wxString msg, group_name; std::vector group_members; diff --git a/eeschema/sch_connection.h b/eeschema/sch_connection.h index a94c433eaa..e58259472c 100644 --- a/eeschema/sch_connection.h +++ b/eeschema/sch_connection.h @@ -27,15 +27,14 @@ #include #include - #include -#include #include class CONNECTION_GRAPH; class SCH_ITEM; class SCH_SHEET_PATH; +class MSG_PANEL_ITEM; enum class CONNECTION_TYPE @@ -215,7 +214,7 @@ public: /** * Adds information about the connection object to aList */ - void AppendInfoToMsgPanel( MSG_PANEL_ITEMS& aList ) const; + void AppendInfoToMsgPanel( std::vector& aList ) const; /** * Test if \a aLabel has a bus notation. diff --git a/eeschema/sch_field.cpp b/eeschema/sch_field.cpp index a1a5e00b08..f195215207 100644 --- a/eeschema/sch_field.cpp +++ b/eeschema/sch_field.cpp @@ -477,6 +477,44 @@ wxString SCH_FIELD::GetSelectMenuText( EDA_UNITS aUnits ) const } +void SCH_FIELD::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector& aList ) +{ + wxString msg; + + aList.push_back( MSG_PANEL_ITEM( _( "Symbol Field" ), GetName() ) ); + + // Don't use GetShownText() here; we want to show the user the variable references + aList.push_back( MSG_PANEL_ITEM( _( "Text" ), UnescapeString( GetText() ) ) ); + + msg = IsVisible() ? _( "Yes" ) : _( "No" ); + aList.push_back( MSG_PANEL_ITEM( _( "Visible" ), msg ) ); + + msg = GetTextStyleName(); + aList.push_back( MSG_PANEL_ITEM( _( "Style" ), msg ) ); + + msg = MessageTextFromValue( aFrame->GetUserUnits(), GetTextWidth() ); + aList.push_back( MSG_PANEL_ITEM( _( "Text Size" ), msg ) ); + + switch ( GetHorizJustify() ) + { + case GR_TEXT_HJUSTIFY_LEFT: msg = _( "Left" ); break; + case GR_TEXT_HJUSTIFY_CENTER: msg = _( "Center" ); break; + case GR_TEXT_HJUSTIFY_RIGHT: msg = _( "Right" ); break; + } + + aList.push_back( MSG_PANEL_ITEM( _( "H Justification" ), msg ) ); + + switch ( GetVertJustify() ) + { + case GR_TEXT_VJUSTIFY_TOP: msg = _( "Top" ); break; + case GR_TEXT_VJUSTIFY_CENTER: msg = _( "Center" ); break; + case GR_TEXT_VJUSTIFY_BOTTOM: msg = _( "Bottom" ); break; + } + + aList.push_back( MSG_PANEL_ITEM( _( "V Justification" ), msg ) ); +} + + void SCH_FIELD::DoHypertextMenu( EDA_DRAW_FRAME* aFrame ) { constexpr int START_ID = 1; diff --git a/eeschema/sch_field.h b/eeschema/sch_field.h index 63737874d9..ec004623fd 100644 --- a/eeschema/sch_field.h +++ b/eeschema/sch_field.h @@ -178,6 +178,7 @@ public: bool Replace( const wxFindReplaceData& aSearchData, void* aAuxData = nullptr ) override; wxString GetSelectMenuText( EDA_UNITS aUnits ) const override; + void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector& aList ) override; BITMAPS GetMenuImage() const override; diff --git a/eeschema/sch_line.cpp b/eeschema/sch_line.cpp index 23a6f4ad57..91b8c85f4a 100644 --- a/eeschema/sch_line.cpp +++ b/eeschema/sch_line.cpp @@ -870,7 +870,7 @@ void SCH_LINE::SetPosition( const wxPoint& aPosition ) } -void SCH_LINE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList ) +void SCH_LINE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector& aList ) { wxString msg; diff --git a/eeschema/sch_marker.cpp b/eeschema/sch_marker.cpp index 6dcbcc0289..ad3256ea14 100644 --- a/eeschema/sch_marker.cpp +++ b/eeschema/sch_marker.cpp @@ -160,7 +160,7 @@ const EDA_RECT SCH_MARKER::GetBoundingBox() const } -void SCH_MARKER::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList ) +void SCH_MARKER::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector& aList ) { aList.push_back( MSG_PANEL_ITEM( _( "Electrical Rule Check Error" ), m_rcItem->GetErrorMessage() ) ); diff --git a/eeschema/sch_pin.cpp b/eeschema/sch_pin.cpp index ae4269c1d4..3d15f2199f 100644 --- a/eeschema/sch_pin.cpp +++ b/eeschema/sch_pin.cpp @@ -177,7 +177,7 @@ wxString SCH_PIN::GetSelectMenuText( EDA_UNITS aUnits ) const } -void SCH_PIN::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList ) +void SCH_PIN::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector& aList ) { wxString msg; @@ -216,12 +216,6 @@ void SCH_PIN::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList ) msg = PinOrientationName( (unsigned) PinOrientationIndex( GetOrientation() ) ); aList.push_back( MSG_PANEL_ITEM( _( "Orientation" ), msg ) ); - msg = MessageTextFromValue( aFrame->GetUserUnits(), m_position.x ); - aList.emplace_back( _( "Pos X" ), msg ); - - msg = MessageTextFromValue( aFrame->GetUserUnits(), m_position.y ); - aList.emplace_back( _( "Pos Y" ), msg ); - SCH_EDIT_FRAME* schframe = dynamic_cast( aFrame ); SCH_SHEET_PATH* currentSheet = schframe ? &schframe->GetCurrentSheet() : nullptr; SCH_SYMBOL* symbol = GetParentSymbol(); diff --git a/eeschema/sch_pin.h b/eeschema/sch_pin.h index 6e888c8769..5216f9461d 100644 --- a/eeschema/sch_pin.h +++ b/eeschema/sch_pin.h @@ -25,12 +25,13 @@ #include #include #include -#include #include #include class SCH_SYMBOL; +class MSG_PANEL_ITEM; + class SCH_PIN : public SCH_ITEM { @@ -64,7 +65,7 @@ public: void SetAlt( const wxString& aAlt ) { m_alt = aAlt; } wxString GetSelectMenuText( EDA_UNITS aUnits ) const override; - void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList ) override; + void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector& aList ) override; void Print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset ) override {} diff --git a/eeschema/sch_sheet.cpp b/eeschema/sch_sheet.cpp index 799e0ecde9..fe5a4c6aa4 100644 --- a/eeschema/sch_sheet.cpp +++ b/eeschema/sch_sheet.cpp @@ -708,7 +708,7 @@ int SCH_SHEET::CountSheets() const } -void SCH_SHEET::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList ) +void SCH_SHEET::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector& aList ) { aList.emplace_back( _( "Sheet Name" ), m_fields[ SHEETNAME ].GetText() ); diff --git a/eeschema/sch_symbol.cpp b/eeschema/sch_symbol.cpp index 0552673634..7b51f72cf0 100644 --- a/eeschema/sch_symbol.cpp +++ b/eeschema/sch_symbol.cpp @@ -1361,7 +1361,7 @@ const EDA_RECT SCH_SYMBOL::GetBoundingBox() const } -void SCH_SYMBOL::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList ) +void SCH_SYMBOL::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector& aList ) { wxString msg; diff --git a/eeschema/sch_text.cpp b/eeschema/sch_text.cpp index e13110a94a..1a712b14ec 100644 --- a/eeschema/sch_text.cpp +++ b/eeschema/sch_text.cpp @@ -735,7 +735,7 @@ void SCH_TEXT::Plot( PLOTTER* aPlotter ) const } -void SCH_TEXT::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList ) +void SCH_TEXT::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector& aList ) { wxString msg; @@ -752,17 +752,13 @@ void SCH_TEXT::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList ) // Don't use GetShownText() here; we want to show the user the variable references aList.push_back( MSG_PANEL_ITEM( msg, UnescapeString( GetText() ) ) ); - switch( GetLabelSpinStyle() ) + // Display electrical type if it is relevant + if( Type() == SCH_GLOBAL_LABEL_T || Type() == SCH_HIER_LABEL_T || Type() == SCH_SHEET_PIN_T ) { - case LABEL_SPIN_STYLE::LEFT: msg = _( "Align right" ); break; - case LABEL_SPIN_STYLE::UP: msg = _( "Align bottom" ); break; - case LABEL_SPIN_STYLE::RIGHT: msg = _( "Align left" ); break; - case LABEL_SPIN_STYLE::BOTTOM: msg = _( "Align top" ); break; - default: msg = wxT( "???" ); break; + msg = getElectricalTypeLabel( GetShape() ); + aList.push_back( MSG_PANEL_ITEM( _( "Type" ), msg ) ); } - aList.push_back( MSG_PANEL_ITEM( _( "Justification" ), msg, BROWN ) ); - wxString textStyle[] = { _( "Normal" ), _( "Italic" ), _( "Bold" ), _( "Bold Italic" ) }; int style = 0; @@ -774,16 +770,20 @@ void SCH_TEXT::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList ) aList.push_back( MSG_PANEL_ITEM( _( "Style" ), textStyle[style] ) ); - // Display electrical type if it is relevant - if( Type() == SCH_GLOBAL_LABEL_T || Type() == SCH_HIER_LABEL_T || Type() == SCH_SHEET_PIN_T ) - { - msg = getElectricalTypeLabel( GetShape() ); - aList.push_back( MSG_PANEL_ITEM( _( "Type" ), msg ) ); - } - // Display text size (X or Y value, with are the same value in Eeschema) msg = MessageTextFromValue( aFrame->GetUserUnits(), GetTextWidth() ); - aList.push_back( MSG_PANEL_ITEM( _( "Size" ), msg ) ); + aList.push_back( MSG_PANEL_ITEM( _( "Text Size" ), msg ) ); + + switch( GetLabelSpinStyle() ) + { + case LABEL_SPIN_STYLE::LEFT: msg = _( "Align right" ); break; + case LABEL_SPIN_STYLE::UP: msg = _( "Align bottom" ); break; + case LABEL_SPIN_STYLE::RIGHT: msg = _( "Align left" ); break; + case LABEL_SPIN_STYLE::BOTTOM: msg = _( "Align top" ); break; + default: msg = wxT( "???" ); break; + } + + aList.push_back( MSG_PANEL_ITEM( _( "Justification" ), msg ) ); SCH_CONNECTION* conn = dynamic_cast( aFrame ) ? Connection() : nullptr; diff --git a/eeschema/tools/ee_inspection_tool.cpp b/eeschema/tools/ee_inspection_tool.cpp index f5bc232d30..8d51980fde 100644 --- a/eeschema/tools/ee_inspection_tool.cpp +++ b/eeschema/tools/ee_inspection_tool.cpp @@ -562,7 +562,7 @@ int EE_INSPECTION_TOOL::UpdateMessagePanel( const TOOL_EVENT& aEvent ) { EDA_ITEM* item = (EDA_ITEM*) selection.Front(); - MSG_PANEL_ITEMS msgItems; + std::vector msgItems; item->GetMsgPanelInfo( m_frame, msgItems ); m_frame->SetMsgPanel( msgItems ); } diff --git a/eeschema/tools/symbol_editor_edit_tool.cpp b/eeschema/tools/symbol_editor_edit_tool.cpp index 1566837393..1e793d881e 100644 --- a/eeschema/tools/symbol_editor_edit_tool.cpp +++ b/eeschema/tools/symbol_editor_edit_tool.cpp @@ -481,7 +481,7 @@ void SYMBOL_EDITOR_EDIT_TOOL::editGraphicProperties( LIB_ITEM* aItem ) drawingTools->SetDrawSpecificConvert( !dlg.GetApplyToAllConversions() ); drawingTools->SetDrawSpecificUnit( !dlg.GetApplyToAllUnits() ); - MSG_PANEL_ITEMS items; + std::vector items; aItem->GetMsgPanelInfo( m_frame, items ); m_frame->SetMsgPanel( items ); } diff --git a/eeschema/tools/symbol_editor_pin_tool.cpp b/eeschema/tools/symbol_editor_pin_tool.cpp index 9a8568129b..f6f142caa0 100644 --- a/eeschema/tools/symbol_editor_pin_tool.cpp +++ b/eeschema/tools/symbol_editor_pin_tool.cpp @@ -197,7 +197,7 @@ bool SYMBOL_EDITOR_PIN_TOOL::EditPinProperties( LIB_PIN* aPin ) m_frame->UpdateItem( aPin ); m_frame->OnModify( ); - MSG_PANEL_ITEMS items; + std::vector items; aPin->GetMsgPanelInfo( m_frame, items ); m_frame->SetMsgPanel( items ); diff --git a/gerbview/tools/gerbview_control.cpp b/gerbview/tools/gerbview_control.cpp index 6a8b9928f6..046de2cda5 100644 --- a/gerbview/tools/gerbview_control.cpp +++ b/gerbview/tools/gerbview_control.cpp @@ -373,7 +373,7 @@ int GERBVIEW_CONTROL::UpdateMessagePanel( const TOOL_EVENT& aEvent ) { EDA_ITEM* item = (EDA_ITEM*) selection.Front(); - MSG_PANEL_ITEMS msgItems; + std::vector msgItems; item->GetMsgPanelInfo( m_frame, msgItems ); m_frame->SetMsgPanel( msgItems ); } diff --git a/include/drawing_sheet/ds_draw_item.h b/include/drawing_sheet/ds_draw_item.h index 0ddd3fc490..7f4d209839 100644 --- a/include/drawing_sheet/ds_draw_item.h +++ b/include/drawing_sheet/ds_draw_item.h @@ -97,7 +97,7 @@ public: bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override; - void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aList ) override; + void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector& aList ) override; protected: DS_DRAW_ITEM_BASE( DS_DATA_ITEM* aPeer, int aIndex, KICAD_T aType ) : diff --git a/include/widgets/msgpanel.h b/include/widgets/msgpanel.h index 5d648a6022..961db5002b 100644 --- a/include/widgets/msgpanel.h +++ b/include/widgets/msgpanel.h @@ -94,9 +94,6 @@ private: }; -typedef std::vector MSG_PANEL_ITEMS; - - /** * A panel to display various information messages. */ @@ -166,9 +163,10 @@ protected: */ wxSize computeTextSize( const wxString& text ) const; - MSG_PANEL_ITEMS m_Items; - int m_last_x; ///< the last used x coordinate - wxSize m_fontSize; +protected: + std::vector m_Items; + int m_last_x; ///< the last used x coordinate + wxSize m_fontSize; }; diff --git a/pagelayout_editor/tools/pl_editor_control.cpp b/pagelayout_editor/tools/pl_editor_control.cpp index 7da9a4ec63..d30238331e 100644 --- a/pagelayout_editor/tools/pl_editor_control.cpp +++ b/pagelayout_editor/tools/pl_editor_control.cpp @@ -151,7 +151,7 @@ int PL_EDITOR_CONTROL::UpdateMessagePanel( const TOOL_EVENT& aEvent ) { EDA_ITEM* item = (EDA_ITEM*) selection.Front(); - MSG_PANEL_ITEMS msgItems; + std::vector msgItems; item->GetMsgPanelInfo( m_frame, msgItems ); m_frame->SetMsgPanel( msgItems ); @@ -160,7 +160,7 @@ int PL_EDITOR_CONTROL::UpdateMessagePanel( const TOOL_EVENT& aEvent ) } else { - MSG_PANEL_ITEMS msgItems; + std::vector msgItems; m_frame->GetPageLayout().GetMsgPanelInfo( m_frame, msgItems ); m_frame->SetMsgPanel( msgItems ); diff --git a/pcbnew/cross-probing.cpp b/pcbnew/cross-probing.cpp index f11cb1c028..277ed13f4a 100644 --- a/pcbnew/cross-probing.cpp +++ b/pcbnew/cross-probing.cpp @@ -103,7 +103,7 @@ void PCB_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline ) { netcode = netinfo->GetNetCode(); - MSG_PANEL_ITEMS items; + std::vector items; netinfo->GetMsgPanelInfo( this, items ); SetMsgPanel( items ); } @@ -126,7 +126,7 @@ void PCB_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline ) if( first ) { // TODO: Once buses are included in netlist, show bus name - MSG_PANEL_ITEMS items; + std::vector items; netinfo->GetMsgPanelInfo( this, items ); SetMsgPanel( items ); first = false; diff --git a/pcbnew/footprint_wizard_frame.cpp b/pcbnew/footprint_wizard_frame.cpp index ca74799eff..9eaabbc5d1 100644 --- a/pcbnew/footprint_wizard_frame.cpp +++ b/pcbnew/footprint_wizard_frame.cpp @@ -306,7 +306,7 @@ void FOOTPRINT_WIZARD_FRAME::UpdateMsgPanel() if( footprint ) { - MSG_PANEL_ITEMS items; + std::vector items; footprint->GetMsgPanelInfo( this, items ); SetMsgPanel( items ); diff --git a/pcbnew/router/router_tool.cpp b/pcbnew/router/router_tool.cpp index 475dbe0e00..6486bf69c9 100644 --- a/pcbnew/router/router_tool.cpp +++ b/pcbnew/router/router_tool.cpp @@ -1913,7 +1913,7 @@ void ROUTER_TOOL::updateMessagePanel() return; } - MSG_PANEL_ITEMS items; + std::vector items; PNS::SIZES_SETTINGS sizes( m_router->Sizes() ); PNS::RULE_RESOLVER* resolver = m_iface->GetRuleResolver(); bool isDiffPair = m_router->Mode() == PNS::ROUTER_MODE::PNS_MODE_ROUTE_DIFF_PAIR; diff --git a/pcbnew/tools/board_inspection_tool.cpp b/pcbnew/tools/board_inspection_tool.cpp index 89a27a0da4..7e3c127f60 100644 --- a/pcbnew/tools/board_inspection_tool.cpp +++ b/pcbnew/tools/board_inspection_tool.cpp @@ -1021,7 +1021,7 @@ int BOARD_INSPECTION_TOOL::HighlightItem( const TOOL_EVENT& aEvent ) if( netinfo ) { - MSG_PANEL_ITEMS items; + std::vector items; netinfo->GetMsgPanelInfo( m_frame, items ); m_frame->SetMsgPanel( items ); m_frame->SendCrossProbeNetName( netinfo->GetNetname() ); diff --git a/pcbnew/tools/pcb_control.cpp b/pcbnew/tools/pcb_control.cpp index dc37c7d357..741d5dcf05 100644 --- a/pcbnew/tools/pcb_control.cpp +++ b/pcbnew/tools/pcb_control.cpp @@ -1150,16 +1150,16 @@ int PCB_CONTROL::UpdateMessagePanel( const TOOL_EVENT& aEvent ) if( selection.GetSize() == 1 ) { - EDA_ITEM* item = selection.Front(); - MSG_PANEL_ITEMS msgItems; + EDA_ITEM* item = selection.Front(); + std::vector msgItems; item->GetMsgPanelInfo( m_frame, msgItems ); m_frame->SetMsgPanel( msgItems ); } else if( selection.GetSize() > 1 ) { - MSG_PANEL_ITEMS msgItems; - wxString msg = wxString::Format( wxT( "%d" ), selection.GetSize() ); + std::vector msgItems; + wxString msg = wxString::Format( wxT( "%d" ), selection.GetSize() ); msgItems.emplace_back( MSG_PANEL_ITEM( _( "Selected Items" ), msg ) ); m_frame->SetMsgPanel( msgItems ); @@ -1171,8 +1171,8 @@ int PCB_CONTROL::UpdateMessagePanel( const TOOL_EVENT& aEvent ) if( !footprint ) return 0; - MSG_PANEL_ITEMS msgItems; - wxString msg; + std::vector msgItems; + wxString msg; msg = footprint->GetFPID().GetLibNickname().wx_str(); msgItems.emplace_back( MSG_PANEL_ITEM( _( "Library" ), msg ) );