Add missing option to show footprint texts in fill or sketch (line) mode.

This option is settable in stable version, but not in master.
So, this option set from the stable version could be modified in master version.
This commit is contained in:
jean-pierre charras 2019-12-23 18:11:45 +01:00
parent 951c78c901
commit a12b803af5
5 changed files with 48 additions and 7 deletions

View File

@ -319,6 +319,10 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
{
return !disp_opt.m_DisplayModEdgeFill;
};
auto sketchModuleTextOutlinesCondition = [ &disp_opt ]( const SELECTION &aSel )
{
return !disp_opt.m_DisplayModTextFill;
};
viewMenu->AddCheckItem( PCB_ACTIONS::showLayersManager, layersPaletteShownCondition );
viewMenu->AddCheckItem( PCB_ACTIONS::showMicrowaveToolbar, microwaveToolbarShownCondition );
@ -369,6 +373,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
drawingModeSubMenu->AddSeparator();
drawingModeSubMenu->AddCheckItem( PCB_ACTIONS::graphicDisplayMode, sketchGraphicsCondition );
drawingModeSubMenu->AddCheckItem( PCB_ACTIONS::moduleEdgeOutlines, sketchModuleEdgeOutlinesCondition );
drawingModeSubMenu->AddCheckItem( PCB_ACTIONS::moduleTextOutlines, sketchModuleTextOutlinesCondition );
viewMenu->AddMenu( drawingModeSubMenu );

View File

@ -691,6 +691,11 @@ TOOL_ACTION PCB_ACTIONS::moduleEdgeOutlines( "pcbnew.Control.graphicOutlines",
_( "Sketch Footprint Graphic Items" ), _( "Show footprint graphic items in outline mode" ),
show_mod_edge_xpm );
TOOL_ACTION PCB_ACTIONS::moduleTextOutlines( "pcbnew.Control.fpTextOutlines",
AS_GLOBAL, 0, "",
_( "Line Mode Footprint Text Items" ), _( "Show footprint texts in line mode" ),
text_sketch_xpm );
TOOL_ACTION PCB_ACTIONS::zoneDisplayEnable( "pcbnew.Control.zoneDisplayEnable",
AS_GLOBAL, 0, "",
_( "Fill Zones" ), _( "Show filled areas of zones" ),

View File

@ -310,14 +310,14 @@ public:
static TOOL_ACTION importSpecctraSession;
static TOOL_ACTION exportSpecctraDSN;
static TOOL_ACTION generateGerbers;
static TOOL_ACTION generateDrillFiles;
static TOOL_ACTION generatePosFile;
static TOOL_ACTION generateReportFile;
static TOOL_ACTION generateD356File;
static TOOL_ACTION generateBOM;
static TOOL_ACTION listNets;
static TOOL_ACTION runDRC;
@ -329,11 +329,11 @@ public:
// Module editor tools
static TOOL_ACTION toggleFootprintTree;
// We don't use ACTION::new here because we need to distinguish between New Library
// and New Footprint.
static TOOL_ACTION newFootprint;
// Create a new footprint using the Footprint Wizard
static TOOL_ACTION createFootprint;
@ -349,7 +349,7 @@ public:
static TOOL_ACTION pasteFootprint;
static TOOL_ACTION importFootprint;
static TOOL_ACTION exportFootprint;
static TOOL_ACTION footprintProperties;
static TOOL_ACTION defaultPadProperties;
@ -368,6 +368,9 @@ public:
/// Display module edges as outlines
static TOOL_ACTION moduleEdgeOutlines;
/// Display module texts as lines
static TOOL_ACTION moduleTextOutlines;
// Pad tools
/// Copy the selected pad's settings to the board design settings

View File

@ -66,7 +66,7 @@ extern IO_MGR::PCB_FILE_T plugin_type( const wxString& aFileName, int aCtl );
PCBNEW_CONTROL::PCBNEW_CONTROL() :
PCB_TOOL_BASE( "pcbnew.Control" ),
PCB_TOOL_BASE( "pcbnew.Control" ),
m_frame( nullptr )
{
m_gridOrigin.reset( new KIGFX::ORIGIN_VIEWITEM() );
@ -248,6 +248,32 @@ int PCBNEW_CONTROL::ModuleEdgeOutlines( const TOOL_EVENT& aEvent )
}
int PCBNEW_CONTROL::ModuleTextOutlines( const TOOL_EVENT& aEvent )
{
auto opts = displayOptions();
Flip( opts.m_DisplayModTextFill );
m_frame->SetDisplayOptions( opts );
view()->UpdateDisplayOptions( opts );
for( auto module : board()->Modules() )
{
view()->Update( &module->Reference(), KIGFX::GEOMETRY );
view()->Update( &module->Value(), KIGFX::GEOMETRY );
for( auto item : module->GraphicalItems() )
{
if( item->Type() == PCB_MODULE_TEXT_T )
view()->Update( item, KIGFX::GEOMETRY );
}
}
canvas()->Refresh();
return 0;
}
int PCBNEW_CONTROL::ZoneDisplayMode( const TOOL_EVENT& aEvent )
{
auto opts = displayOptions();
@ -1066,7 +1092,7 @@ void PCBNEW_CONTROL::setTransitions()
Go( &PCBNEW_CONTROL::AddLibrary, ACTIONS::addLibrary.MakeEvent() );
Go( &PCBNEW_CONTROL::Print, ACTIONS::print.MakeEvent() );
Go( &PCBNEW_CONTROL::Quit, ACTIONS::quit.MakeEvent() );
// Display modes
Go( &PCBNEW_CONTROL::TrackDisplayMode, PCB_ACTIONS::trackDisplayMode.MakeEvent() );
Go( &PCBNEW_CONTROL::ToggleRatsnest, PCB_ACTIONS::showRatsnest.MakeEvent() );
@ -1075,6 +1101,7 @@ void PCBNEW_CONTROL::setTransitions()
Go( &PCBNEW_CONTROL::ViaDisplayMode, PCB_ACTIONS::viaDisplayMode.MakeEvent() );
Go( &PCBNEW_CONTROL::GraphicDisplayMode, PCB_ACTIONS::graphicDisplayMode.MakeEvent() );
Go( &PCBNEW_CONTROL::ModuleEdgeOutlines, PCB_ACTIONS::moduleEdgeOutlines.MakeEvent() );
Go( &PCBNEW_CONTROL::ModuleTextOutlines, PCB_ACTIONS::moduleTextOutlines.MakeEvent() );
Go( &PCBNEW_CONTROL::ZoneDisplayMode, PCB_ACTIONS::zoneDisplayEnable.MakeEvent() );
Go( &PCBNEW_CONTROL::ZoneDisplayMode, PCB_ACTIONS::zoneDisplayDisable.MakeEvent() );
Go( &PCBNEW_CONTROL::ZoneDisplayMode, PCB_ACTIONS::zoneDisplayOutlines.MakeEvent() );

View File

@ -62,6 +62,7 @@ public:
int ViaDisplayMode( const TOOL_EVENT& aEvent );
int GraphicDisplayMode( const TOOL_EVENT& aEvent );
int ModuleEdgeOutlines( const TOOL_EVENT& aEvent );
int ModuleTextOutlines( const TOOL_EVENT& aEvent );
int HighContrastMode( const TOOL_EVENT& aEvent );
// Layer control