Push UNITS_PROVIDER down into a low-level mixin.

This allows us to also construct cheap UNIT_PROVIDERs for specific
tasks when necessary.
This commit is contained in:
Jeff Young
2022-09-19 17:10:59 +01:00
parent 5990595619
commit 64a6fc0fd4
128 changed files with 533 additions and 510 deletions
+8 -8
View File
@@ -234,11 +234,11 @@ int SELECTION_TOOL::SelectionMenu( const TOOL_EVENT& aEvent )
bool SELECTION_TOOL::doSelectionMenu( COLLECTOR* aCollector )
{
EDA_UNITS userUnits = getEditFrame<EDA_DRAW_FRAME>()->GetUserUnits();
EDA_ITEM* current = nullptr;
SELECTION highlightGroup;
bool selectAll = false;
bool expandSelection = false;
UNITS_PROVIDER* unitsProvider = getEditFrame<EDA_DRAW_FRAME>();
EDA_ITEM* current = nullptr;
SELECTION highlightGroup;
bool selectAll = false;
bool expandSelection = false;
highlightGroup.SetLayer( LAYER_SELECT_OVERLAY );
getView()->Add( &highlightGroup );
@@ -263,18 +263,18 @@ bool SELECTION_TOOL::doSelectionMenu( COLLECTOR* aCollector )
{
#ifdef __WXMAC__
menuText = wxString::Format( "%s\t%d",
item->GetSelectMenuText( userUnits ),
item->GetSelectMenuText( unitsProvider ),
i + 1 );
#else
menuText = wxString::Format( "&%d %s\t%d",
i + 1,
item->GetSelectMenuText( userUnits ),
item->GetSelectMenuText( unitsProvider ),
i + 1 );
#endif
}
else
{
menuText = item->GetSelectMenuText( userUnits );
menuText = item->GetSelectMenuText( unitsProvider );
}
menu.Add( menuText, i + 1, item->GetMenuImage() );