Fill in some missing GetMsgPanelItems and make some others consistent.

Also expunges a std::vector<MSG_PANEL_ITEM> cover type.
This commit is contained in:
Jeff Young 2021-09-27 00:22:32 +01:00
parent 8636afdc73
commit 5f3c67bd2b
36 changed files with 159 additions and 89 deletions

View File

@ -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<MSG_PANEL_ITEM>& aList )
{
wxString msg;
DS_DATA_ITEM* dataItem = GetPeer();

View File

@ -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<MSG_PANEL_ITEM>& 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<MSG_PANEL_ITEM> items;
aItem->GetMsgPanelInfo( this, items );
SetMsgPanel( items );
}

View File

@ -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<MSG_PANEL_ITEM> items;
if( footprint )
footprint->GetMsgPanelInfo( this, items );

View File

@ -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<MSG_PANEL_ITEM>& aList )
{
wxString msg;
EDA_RECT bBox = GetBoundingBox();

View File

@ -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<MSG_PANEL_ITEM>& 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 ) );
}

View File

@ -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<MSG_PANEL_ITEM>& aList )
{
wxString msg;

View File

@ -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<MSG_PANEL_ITEM>& aList )
{
LIB_ITEM::GetMsgPanelInfo( aFrame, aList );

View File

@ -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<MSG_PANEL_ITEM>& aList )
{
wxString msg;
EDA_RECT bBox = GetBoundingBox();

View File

@ -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<MSG_PANEL_ITEM>& aList )
{
LIB_ITEM::GetMsgPanelInfo( aFrame, aList );

View File

@ -21,10 +21,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file lib_text.cpp
*/
#include <common.h>
#include <sch_draw_panel.h>
#include <plotters/plotter.h>
@ -39,7 +35,7 @@
#include <settings/color_settings.h>
#include <lib_text.h>
#include <default_values.h> // For some default values
#include <string_utils.h>
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<MSG_PANEL_ITEM>& 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 ) );
}

View File

@ -79,8 +79,6 @@ public:
int GetPenWidth() const override;
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& 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<MSG_PANEL_ITEM>& aList ) override;
BITMAPS GetMenuImage() const override;

View File

@ -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<MSG_PANEL_ITEM>& aList )
{
aList.push_back( MSG_PANEL_ITEM( _( "Bitmap" ), wxEmptyString ) );

View File

@ -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<MSG_PANEL_ITEM>& aList )
{
wxString msg;

View File

@ -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<MSG_PANEL_ITEM>& aList ) const
{
wxString msg, group_name;
std::vector<wxString> group_members;

View File

@ -27,15 +27,14 @@
#include <boost/optional.hpp>
#include <wx/regex.h>
#include <bus_alias.h>
#include <widgets/msgpanel.h>
#include <sch_sheet_path.h>
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<MSG_PANEL_ITEM>& aList ) const;
/**
* Test if \a aLabel has a bus notation.

View File

@ -477,6 +477,44 @@ wxString SCH_FIELD::GetSelectMenuText( EDA_UNITS aUnits ) const
}
void SCH_FIELD::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& 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;

View File

@ -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<MSG_PANEL_ITEM>& aList ) override;
BITMAPS GetMenuImage() const override;

View File

@ -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<MSG_PANEL_ITEM>& aList )
{
wxString msg;

View File

@ -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<MSG_PANEL_ITEM>& aList )
{
aList.push_back( MSG_PANEL_ITEM( _( "Electrical Rule Check Error" ),
m_rcItem->GetErrorMessage() ) );

View File

@ -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<MSG_PANEL_ITEM>& 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<SCH_EDIT_FRAME*>( aFrame );
SCH_SHEET_PATH* currentSheet = schframe ? &schframe->GetCurrentSheet() : nullptr;
SCH_SYMBOL* symbol = GetParentSymbol();

View File

@ -25,12 +25,13 @@
#include <lib_pin.h>
#include <sch_item.h>
#include <sch_sheet_path.h>
#include <widgets/msgpanel.h>
#include <mutex>
#include <map>
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<MSG_PANEL_ITEM>& aList ) override;
void Print( const RENDER_SETTINGS* aSettings, const wxPoint& aOffset ) override {}

View File

@ -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<MSG_PANEL_ITEM>& aList )
{
aList.emplace_back( _( "Sheet Name" ), m_fields[ SHEETNAME ].GetText() );

View File

@ -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<MSG_PANEL_ITEM>& aList )
{
wxString msg;

View File

@ -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<MSG_PANEL_ITEM>& 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<SCH_EDIT_FRAME*>( aFrame ) ? Connection() : nullptr;

View File

@ -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<MSG_PANEL_ITEM> msgItems;
item->GetMsgPanelInfo( m_frame, msgItems );
m_frame->SetMsgPanel( msgItems );
}

View File

@ -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<MSG_PANEL_ITEM> items;
aItem->GetMsgPanelInfo( m_frame, items );
m_frame->SetMsgPanel( items );
}

View File

@ -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<MSG_PANEL_ITEM> items;
aPin->GetMsgPanelInfo( m_frame, items );
m_frame->SetMsgPanel( items );

View File

@ -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<MSG_PANEL_ITEM> msgItems;
item->GetMsgPanelInfo( m_frame, msgItems );
m_frame->SetMsgPanel( msgItems );
}

View File

@ -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<MSG_PANEL_ITEM>& aList ) override;
protected:
DS_DRAW_ITEM_BASE( DS_DATA_ITEM* aPeer, int aIndex, KICAD_T aType ) :

View File

@ -94,9 +94,6 @@ private:
};
typedef std::vector<MSG_PANEL_ITEM> 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<MSG_PANEL_ITEM> m_Items;
int m_last_x; ///< the last used x coordinate
wxSize m_fontSize;
};

View File

@ -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<MSG_PANEL_ITEM> 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<MSG_PANEL_ITEM> msgItems;
m_frame->GetPageLayout().GetMsgPanelInfo( m_frame, msgItems );
m_frame->SetMsgPanel( msgItems );

View File

@ -103,7 +103,7 @@ void PCB_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline )
{
netcode = netinfo->GetNetCode();
MSG_PANEL_ITEMS items;
std::vector<MSG_PANEL_ITEM> 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<MSG_PANEL_ITEM> items;
netinfo->GetMsgPanelInfo( this, items );
SetMsgPanel( items );
first = false;

View File

@ -306,7 +306,7 @@ void FOOTPRINT_WIZARD_FRAME::UpdateMsgPanel()
if( footprint )
{
MSG_PANEL_ITEMS items;
std::vector<MSG_PANEL_ITEM> items;
footprint->GetMsgPanelInfo( this, items );
SetMsgPanel( items );

View File

@ -1913,7 +1913,7 @@ void ROUTER_TOOL::updateMessagePanel()
return;
}
MSG_PANEL_ITEMS items;
std::vector<MSG_PANEL_ITEM> 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;

View File

@ -1021,7 +1021,7 @@ int BOARD_INSPECTION_TOOL::HighlightItem( const TOOL_EVENT& aEvent )
if( netinfo )
{
MSG_PANEL_ITEMS items;
std::vector<MSG_PANEL_ITEM> items;
netinfo->GetMsgPanelInfo( m_frame, items );
m_frame->SetMsgPanel( items );
m_frame->SendCrossProbeNetName( netinfo->GetNetname() );

View File

@ -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<MSG_PANEL_ITEM> 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<MSG_PANEL_ITEM> 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<MSG_PANEL_ITEM> msgItems;
wxString msg;
msg = footprint->GetFPID().GetLibNickname().wx_str();
msgItems.emplace_back( MSG_PANEL_ITEM( _( "Library" ), msg ) );