Multiple improvements concerning colors, configuration handling and legacy features in pcbnew:
- support for background color setting - removed several global config settings (such as g_Drc_On) - wrapped most of global config settings in PCB_GENERAL_SETTINGS class - reorganized PCB general options dialog to clearly mark which options concern only the legacy canvas - new GAL feature for legacy users: double-click (or E) to change track width available as an option. Fixes: lp:1530543 * https://bugs.launchpad.net/kicad/+bug/1530543 Fixes: lp:1707145 * https://bugs.launchpad.net/kicad/+bug/1707145
This commit is contained in:
parent
33e05ae557
commit
32185ddcd3
|
@ -33,7 +33,6 @@
|
|||
#include <class_board.h>
|
||||
#include <3d_math.h>
|
||||
#include "3d_fastmath.h"
|
||||
#include <colors_selection.h>
|
||||
|
||||
/**
|
||||
* Trace mask used to enable or disable the trace output of this class.
|
||||
|
@ -530,7 +529,7 @@ SFVEC3F CINFO3D_VISU::GetLayerColor( PCB_LAYER_ID aLayerId ) const
|
|||
{
|
||||
wxASSERT( aLayerId < PCB_LAYER_ID_COUNT );
|
||||
|
||||
const COLOR4D color = g_ColorsSettings.GetLayerColor( aLayerId );
|
||||
const COLOR4D color = m_board->Colors().GetLayerColor( aLayerId );
|
||||
|
||||
return SFVEC3F( color.r, color.g, color.b );
|
||||
}
|
||||
|
@ -538,7 +537,7 @@ SFVEC3F CINFO3D_VISU::GetLayerColor( PCB_LAYER_ID aLayerId ) const
|
|||
|
||||
SFVEC3F CINFO3D_VISU::GetItemColor( int aItemId ) const
|
||||
{
|
||||
return GetColor( g_ColorsSettings.GetItemColor( aItemId ) );
|
||||
return GetColor( m_board->Colors().GetItemColor( aItemId ) );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include <gestfich.h>
|
||||
#include <wildcards_and_files_ext.h>
|
||||
#include <bitmap_io.h>
|
||||
#include <colors_selection.h>
|
||||
#include <build_version.h>
|
||||
#include <menus_helpers.h>
|
||||
#include <kiway.h>
|
||||
|
|
|
@ -280,6 +280,7 @@ set( COMMON_SRCS
|
|||
searchhelpfilefullpath.cpp
|
||||
search_stack.cpp
|
||||
selcolor.cpp
|
||||
settings.cpp
|
||||
systemdirsappend.cpp
|
||||
trigo.cpp
|
||||
utf8.cpp
|
||||
|
|
|
@ -100,6 +100,13 @@ COLORS_DESIGN_SETTINGS::COLORS_DESIGN_SETTINGS()
|
|||
{
|
||||
m_LayersColors[dst] = COLOR4D( default_items_color[src++] );
|
||||
}
|
||||
|
||||
m_LayersColors[ LAYER_PCB_BACKGROUND ] = BLACK;
|
||||
m_LayersColors[ LAYER_CURSOR ] = WHITE;
|
||||
m_LayersColors[ LAYER_AUX_ITEMS ] = WHITE;
|
||||
m_LayersColors[ LAYER_WORKSHEET ] = DARKRED;
|
||||
|
||||
setupConfigParams();
|
||||
}
|
||||
|
||||
|
||||
|
@ -147,3 +154,46 @@ void COLORS_DESIGN_SETTINGS::SetAllColorsAs( COLOR4D aColor )
|
|||
for( unsigned ii = 0; ii < DIM(m_LayersColors); ii++ )
|
||||
m_LayersColors[ii] = aColor;
|
||||
}
|
||||
|
||||
#define LOC_COLOR(layer) &m_LayersColors[layer]
|
||||
#define ITEM_COLOR(item_visible) &m_LayersColors[item_visible]
|
||||
|
||||
void COLORS_DESIGN_SETTINGS::setupConfigParams()
|
||||
{
|
||||
wxASSERT( DIM( m_LayersColors ) >= PCB_LAYER_ID_COUNT );
|
||||
for( int i = 0; i<PCB_LAYER_ID_COUNT; ++i )
|
||||
{
|
||||
wxString vn = wxString::Format(
|
||||
wxT( "ColorPCBLayer_%s" ),
|
||||
LSET::Name( PCB_LAYER_ID( i ) ) );
|
||||
|
||||
Add( vn, LOC_COLOR(i), m_LayersColors[i] );
|
||||
}
|
||||
|
||||
Add( wxT( "ColorTxtFrontEx" ), ITEM_COLOR( LAYER_MOD_TEXT_FR ), LIGHTGRAY );
|
||||
Add( wxT( "ColorTxtBackEx" ), ITEM_COLOR( LAYER_MOD_TEXT_BK ), BLUE );
|
||||
Add( wxT( "ColorTxtInvisEx" ), ITEM_COLOR( LAYER_MOD_TEXT_INVISIBLE ), DARKGRAY );
|
||||
Add( wxT( "ColorPadBackEx" ), ITEM_COLOR( LAYER_PAD_BK ), GREEN );
|
||||
Add( wxT( "ColorAnchorEx" ), ITEM_COLOR( LAYER_ANCHOR ), BLUE );
|
||||
Add( wxT( "ColorPadFrontEx" ), ITEM_COLOR( LAYER_PAD_FR ), RED );
|
||||
Add( wxT( "ColorViaThruEx" ), ITEM_COLOR( LAYER_VIA_THROUGH ), LIGHTGRAY );
|
||||
Add( wxT( "ColorViaBBlindEx" ), ITEM_COLOR( LAYER_VIA_BBLIND ), BROWN );
|
||||
Add( wxT( "ColorViaMicroEx" ), ITEM_COLOR( LAYER_VIA_MICROVIA ), CYAN );
|
||||
Add( wxT( "ColorNonPlatedEx" ), ITEM_COLOR( LAYER_NON_PLATED ), YELLOW );
|
||||
Add( wxT( "ColorRatsEx" ), ITEM_COLOR( LAYER_RATSNEST ), WHITE );
|
||||
Add( wxT( "ColorPCBBackground" ), ITEM_COLOR( LAYER_PCB_BACKGROUND ), BLACK );
|
||||
Add( wxT( "ColorPCBCursor" ), ITEM_COLOR( LAYER_CURSOR ), WHITE );
|
||||
Add( wxT( "ColorAuxItems" ), ITEM_COLOR( LAYER_AUX_ITEMS ), WHITE );
|
||||
Add( wxT( "ColorWorksheet" ), ITEM_COLOR( LAYER_WORKSHEET ), DARKRED );
|
||||
|
||||
}
|
||||
|
||||
void COLORS_DESIGN_SETTINGS::Load( wxConfigBase *aConfig )
|
||||
{
|
||||
SETTINGS::Load(aConfig);
|
||||
}
|
||||
|
||||
void COLORS_DESIGN_SETTINGS::Save( wxConfigBase *aConfig )
|
||||
{
|
||||
SETTINGS::Save(aConfig);
|
||||
}
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <colors_selection.h>
|
||||
#include <layers_id_colors_and_visibility.h>
|
||||
#include <bitmaps.h>
|
||||
|
||||
|
|
|
@ -179,7 +179,9 @@ void EDA_DRAW_PANEL_GAL::onPaint( wxPaintEvent& WXUNUSED( aEvent ) )
|
|||
try
|
||||
{
|
||||
m_gal->BeginDrawing();
|
||||
m_gal->ClearScreen( settings->GetBackgroundColor() );
|
||||
m_gal->SetClearColor( settings->GetBackgroundColor() );
|
||||
m_gal->SetCursorColor( settings->GetLayerColor( LAYER_CURSOR ) );
|
||||
m_gal->ClearScreen( );
|
||||
|
||||
KIGFX::COLOR4D gridColor = settings->GetLayerColor( LAYER_GRID );
|
||||
m_gal->SetGridColor( gridColor );
|
||||
|
|
|
@ -123,7 +123,7 @@ void CAIRO_COMPOSITOR::Begin()
|
|||
{
|
||||
}
|
||||
|
||||
void CAIRO_COMPOSITOR::ClearBuffer()
|
||||
void CAIRO_COMPOSITOR::ClearBuffer( const COLOR4D& aColor )
|
||||
{
|
||||
// Clear the pixel storage
|
||||
memset( m_buffers[m_current].bitmap.get(), 0x00, m_bufferSize * sizeof(int) );
|
||||
|
|
|
@ -381,10 +381,10 @@ void CAIRO_GAL::Flush()
|
|||
}
|
||||
|
||||
|
||||
void CAIRO_GAL::ClearScreen( const COLOR4D& aColor )
|
||||
void CAIRO_GAL::ClearScreen( )
|
||||
{
|
||||
backgroundColor = aColor;
|
||||
cairo_set_source_rgb( currentContext, aColor.r, aColor.g, aColor.b );
|
||||
backgroundColor = m_clearColor;
|
||||
cairo_set_source_rgb( currentContext, backgroundColor.r, backgroundColor.g, backgroundColor.b );
|
||||
cairo_rectangle( currentContext, 0.0, 0.0, screenSize.x, screenSize.y );
|
||||
cairo_fill( currentContext );
|
||||
}
|
||||
|
@ -850,7 +850,7 @@ void CAIRO_GAL::ClearTarget( RENDER_TARGET aTarget )
|
|||
break;
|
||||
}
|
||||
|
||||
compositor->ClearBuffer();
|
||||
compositor->ClearBuffer( COLOR4D::BLACK );
|
||||
|
||||
// Restore the previous state
|
||||
compositor->SetBuffer( currentBuffer );
|
||||
|
@ -1014,8 +1014,9 @@ void CAIRO_GAL::initSurface()
|
|||
|
||||
cairo_set_antialias( context, CAIRO_ANTIALIAS_NONE );
|
||||
|
||||
m_clearColor = backgroundColor;
|
||||
// Clear the screen
|
||||
ClearScreen( backgroundColor );
|
||||
ClearScreen( );
|
||||
|
||||
// Compute the world <-> screen transformations
|
||||
ComputeWorldScreenMatrix();
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include <gal/opengl/antialiasing.h>
|
||||
#include <gal/opengl/opengl_compositor.h>
|
||||
#include <gal/opengl/utils.h>
|
||||
#include <gal/color4d.h>
|
||||
|
||||
#include <tuple>
|
||||
|
||||
|
@ -181,7 +182,7 @@ VECTOR2U ANTIALIASING_SUPERSAMPLING::GetInternalBufferSize()
|
|||
void ANTIALIASING_SUPERSAMPLING::Begin()
|
||||
{
|
||||
compositor->SetBuffer( ssaaMainBuffer );
|
||||
compositor->ClearBuffer();
|
||||
compositor->ClearBuffer( COLOR4D::BLACK );
|
||||
}
|
||||
|
||||
|
||||
|
@ -445,7 +446,7 @@ void ANTIALIASING_SMAA::DrawBuffer( GLuint buffer )
|
|||
void ANTIALIASING_SMAA::Begin()
|
||||
{
|
||||
compositor->SetBuffer( smaaBaseBuffer );
|
||||
compositor->ClearBuffer();
|
||||
compositor->ClearBuffer( COLOR4D::BLACK );
|
||||
}
|
||||
|
||||
|
||||
|
@ -487,7 +488,7 @@ void ANTIALIASING_SMAA::Present()
|
|||
// pass 1: main-buffer -> smaaEdgesBuffer
|
||||
//
|
||||
compositor->SetBuffer( smaaEdgesBuffer );
|
||||
compositor->ClearBuffer();
|
||||
compositor->ClearBuffer( COLOR4D::BLACK );
|
||||
|
||||
glActiveTexture( GL_TEXTURE0 );
|
||||
glBindTexture( GL_TEXTURE_2D, sourceTexture ); checkGlError( "binding colorTex" );
|
||||
|
@ -499,7 +500,7 @@ void ANTIALIASING_SMAA::Present()
|
|||
// pass 2: smaaEdgesBuffer -> smaaBlendBuffer
|
||||
//
|
||||
compositor->SetBuffer( smaaBlendBuffer );
|
||||
compositor->ClearBuffer();
|
||||
compositor->ClearBuffer( COLOR4D::BLACK );
|
||||
|
||||
auto edgesTex = compositor->GetBufferTexture( smaaEdgesBuffer );
|
||||
|
||||
|
@ -518,7 +519,7 @@ void ANTIALIASING_SMAA::Present()
|
|||
// pass 3: colorTex + BlendBuffer -> output
|
||||
//
|
||||
compositor->SetBuffer( OPENGL_COMPOSITOR::DIRECT_RENDERING );
|
||||
compositor->ClearBuffer();
|
||||
compositor->ClearBuffer( COLOR4D::BLACK );
|
||||
auto blendTex = compositor->GetBufferTexture( smaaBlendBuffer );
|
||||
|
||||
glActiveTexture( GL_TEXTURE0 );
|
||||
|
|
|
@ -31,6 +31,8 @@
|
|||
#include <gal/opengl/opengl_compositor.h>
|
||||
#include <gal/opengl/utils.h>
|
||||
|
||||
#include <gal/color4d.h>
|
||||
|
||||
#include <stdexcept>
|
||||
#include <cassert>
|
||||
|
||||
|
@ -245,7 +247,7 @@ unsigned int OPENGL_COMPOSITOR::CreateBuffer( VECTOR2U aDimensions )
|
|||
return 0;
|
||||
}
|
||||
|
||||
ClearBuffer();
|
||||
ClearBuffer( COLOR4D::BLACK );
|
||||
|
||||
// Return to direct rendering (we were asked only to create a buffer, not switch to one)
|
||||
bindFb( DIRECT_RENDERING );
|
||||
|
@ -290,11 +292,11 @@ void OPENGL_COMPOSITOR::SetBuffer( unsigned int aBufferHandle )
|
|||
}
|
||||
|
||||
|
||||
void OPENGL_COMPOSITOR::ClearBuffer()
|
||||
void OPENGL_COMPOSITOR::ClearBuffer( const COLOR4D& aColor )
|
||||
{
|
||||
assert( m_initialized );
|
||||
|
||||
glClearColor( 0.0f, 0.0f, 0.0f, 0.0f );
|
||||
glClearColor( aColor.r, aColor.g, aColor.b, 0.0f );
|
||||
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT );
|
||||
}
|
||||
|
||||
|
|
|
@ -1145,11 +1145,11 @@ void OPENGL_GAL::Flush()
|
|||
}
|
||||
|
||||
|
||||
void OPENGL_GAL::ClearScreen( const COLOR4D& aColor )
|
||||
void OPENGL_GAL::ClearScreen( )
|
||||
{
|
||||
// Clear screen
|
||||
compositor->SetBuffer( OPENGL_COMPOSITOR::DIRECT_RENDERING );
|
||||
glClearColor( aColor.r, aColor.g, aColor.b, aColor.a );
|
||||
glClearColor( m_clearColor.r, m_clearColor.g, m_clearColor.b, m_clearColor.a );
|
||||
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT );
|
||||
}
|
||||
|
||||
|
@ -1312,7 +1312,11 @@ void OPENGL_GAL::ClearTarget( RENDER_TARGET aTarget )
|
|||
break;
|
||||
}
|
||||
|
||||
compositor->ClearBuffer();
|
||||
|
||||
if( aTarget != TARGET_OVERLAY )
|
||||
compositor->ClearBuffer( m_clearColor );
|
||||
else
|
||||
compositor->ClearBuffer( COLOR4D::BLACK );
|
||||
|
||||
// Restore the previous state
|
||||
compositor->SetBuffer( oldTarget );
|
||||
|
@ -1675,6 +1679,7 @@ void OPENGL_GAL::blitCursor()
|
|||
const COLOR4D color( cColor.r * cColor.a, cColor.g * cColor.a,
|
||||
cColor.b * cColor.a, 1.0 );
|
||||
|
||||
glActiveTexture( GL_TEXTURE0 );
|
||||
glDisable( GL_TEXTURE_2D );
|
||||
glLineWidth( 1.0 );
|
||||
glColor4d( color.r, color.g, color.b, color.a );
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include <preview_items/preview_utils.h>
|
||||
#include <gal/graphics_abstraction_layer.h>
|
||||
#include <view/view.h>
|
||||
#include <pcb_painter.h>
|
||||
|
||||
#include <common.h>
|
||||
#include <base_units.h>
|
||||
|
@ -88,40 +89,47 @@ double angleIsSpecial( double aRadians )
|
|||
}
|
||||
|
||||
|
||||
static void drawLineWithHilight( KIGFX::GAL& aGal,
|
||||
static void drawLineWithHilight( KIGFX::VIEW *aView,
|
||||
const VECTOR2I& aStart, const VECTOR2I& aEnd, bool aDim )
|
||||
{
|
||||
auto gal = aView->GetGAL();
|
||||
auto rs = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( aView->GetPainter()->GetSettings() );
|
||||
|
||||
const auto vec = aEnd - aStart;
|
||||
COLOR4D strokeColor = PreviewOverlayDefaultColor();
|
||||
COLOR4D strokeColor = rs->GetLayerColor( LAYER_AUX_ITEMS );
|
||||
|
||||
if( angleIsSpecial( vec.Angle() ) )
|
||||
strokeColor = PreviewOverlaySpecialAngleColor();
|
||||
strokeColor = rs->IsBackgroundDark() ? COLOR4D( 0.5, 1.0, 0.5, 1.0 ) : COLOR4D( 0.0, 0.7, 0.0, 1.0 ) ;
|
||||
|
||||
aGal.SetStrokeColor( strokeColor.WithAlpha( PreviewOverlayDeemphAlpha( aDim ) ) );
|
||||
aGal.DrawLine( aStart, aEnd );
|
||||
gal->SetStrokeColor( strokeColor.WithAlpha( PreviewOverlayDeemphAlpha( aDim ) ) );
|
||||
gal->DrawLine( aStart, aEnd );
|
||||
}
|
||||
|
||||
|
||||
static void drawArcWithHilight( KIGFX::GAL& aGal,
|
||||
static void drawArcWithHilight( KIGFX::VIEW *aView,
|
||||
const VECTOR2I& aOrigin, double aRad, double aStartAngle,
|
||||
double aEndAngle )
|
||||
{
|
||||
COLOR4D color = PreviewOverlayDefaultColor();
|
||||
auto gal = aView->GetGAL();
|
||||
auto rs = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( aView->GetPainter()->GetSettings() );
|
||||
|
||||
auto color = rs->GetLayerColor( LAYER_AUX_ITEMS );
|
||||
|
||||
if( angleIsSpecial( aStartAngle - aEndAngle ) )
|
||||
color = PreviewOverlaySpecialAngleColor();
|
||||
color = rs->IsBackgroundDark() ? COLOR4D( 0.5, 1.0, 0.5, 1.0 ) : COLOR4D( 0.0, 0.7, 0.0, 1.0 ) ;
|
||||
|
||||
aGal.SetStrokeColor( color );
|
||||
aGal.SetFillColor( color.WithAlpha( 0.2 ) );
|
||||
gal->SetStrokeColor( color );
|
||||
gal->SetFillColor( color.WithAlpha( 0.2 ) );
|
||||
|
||||
// draw the angle reference arc
|
||||
aGal.DrawArc( aOrigin, aRad, -aStartAngle, -aEndAngle );
|
||||
gal->DrawArc( aOrigin, aRad, -aStartAngle, -aEndAngle );
|
||||
}
|
||||
|
||||
|
||||
void ARC_ASSISTANT::ViewDraw( int aLayer, KIGFX::VIEW* aView ) const
|
||||
{
|
||||
auto& gal = *aView->GetGAL();
|
||||
auto rs = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( aView->GetPainter()->GetSettings() );
|
||||
|
||||
// not in a position to draw anything
|
||||
if( m_constructMan.IsReset() )
|
||||
|
@ -144,7 +152,7 @@ void ARC_ASSISTANT::ViewDraw( int aLayer, KIGFX::VIEW* aView ) const
|
|||
// draw first radius line
|
||||
bool dimFirstLine = m_constructMan.GetStep() > ARC_GEOM_MANAGER::SET_START;
|
||||
|
||||
drawLineWithHilight( gal, origin, m_constructMan.GetStartRadiusEnd(), dimFirstLine );
|
||||
drawLineWithHilight( aView, origin, m_constructMan.GetStartRadiusEnd(), dimFirstLine );
|
||||
|
||||
std::vector<wxString> cursorStrings;
|
||||
|
||||
|
@ -156,11 +164,11 @@ void ARC_ASSISTANT::ViewDraw( int aLayer, KIGFX::VIEW* aView ) const
|
|||
|
||||
const auto angleRefLineEnd = m_constructMan.GetOrigin() + VECTOR2D( innerRad * 1.5, 0.0 );
|
||||
|
||||
gal.SetStrokeColor( PreviewOverlayDefaultColor() );
|
||||
gal.SetStrokeColor( rs->GetLayerColor( LAYER_AUX_ITEMS ) );
|
||||
gal.DrawLine( origin, angleRefLineEnd );
|
||||
|
||||
// draw the angle reference arc
|
||||
drawArcWithHilight( gal, origin, innerRad, initAngle, 0.0 );
|
||||
drawArcWithHilight( aView, origin, innerRad, initAngle, 0.0 );
|
||||
|
||||
double degs = getNormDeciDegFromRad( initAngle );
|
||||
|
||||
|
@ -169,18 +177,18 @@ void ARC_ASSISTANT::ViewDraw( int aLayer, KIGFX::VIEW* aView ) const
|
|||
}
|
||||
else
|
||||
{
|
||||
drawLineWithHilight( gal, origin, m_constructMan.GetEndRadiusEnd(), false );
|
||||
drawLineWithHilight( aView, origin, m_constructMan.GetEndRadiusEnd(), false );
|
||||
|
||||
auto start = m_constructMan.GetStartAngle();
|
||||
auto subtended = m_constructMan.GetSubtended();
|
||||
|
||||
drawArcWithHilight( gal, origin, innerRad, start, start + subtended );
|
||||
drawArcWithHilight( aView, origin, innerRad, start, start + subtended );
|
||||
|
||||
double subtendedDeg = getNormDeciDegFromRad( subtended );
|
||||
double endAngleDeg = getNormDeciDegFromRad( start + subtended );
|
||||
|
||||
// draw dimmed extender line to cursor
|
||||
drawLineWithHilight( gal, origin, m_constructMan.GetLastPoint(), true );
|
||||
drawLineWithHilight( aView, origin, m_constructMan.GetLastPoint(), true );
|
||||
|
||||
cursorStrings.push_back( DimensionLabel( "Δθ", subtendedDeg, DEGREES ) );
|
||||
cursorStrings.push_back( DimensionLabel( "θ", endAngleDeg, DEGREES ) );
|
||||
|
@ -194,7 +202,7 @@ void ARC_ASSISTANT::ViewDraw( int aLayer, KIGFX::VIEW* aView ) const
|
|||
}
|
||||
|
||||
// place the text next to cursor, on opposite side from radius
|
||||
DrawTextNextToCursor( gal, m_constructMan.GetLastPoint(),
|
||||
DrawTextNextToCursor( aView, m_constructMan.GetLastPoint(),
|
||||
origin - m_constructMan.GetLastPoint(),
|
||||
cursorStrings );
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include <preview_items/two_point_geom_manager.h>
|
||||
|
||||
#include <gal/graphics_abstraction_layer.h>
|
||||
|
||||
#include <view/view.h>
|
||||
|
||||
using namespace KIGFX::PREVIEW;
|
||||
|
||||
|
@ -93,8 +93,10 @@ const BOX2I CENTRELINE_RECT_ITEM::ViewBBox() const
|
|||
}
|
||||
|
||||
|
||||
void CENTRELINE_RECT_ITEM::drawPreviewShape( KIGFX::GAL& aGal ) const
|
||||
void CENTRELINE_RECT_ITEM::drawPreviewShape( KIGFX::VIEW* aView ) const
|
||||
{
|
||||
aGal.DrawLine( m_geomMgr.GetOrigin(), m_geomMgr.GetEnd() );
|
||||
aGal.DrawPolygon( getOutline() );
|
||||
auto& gal = *aView->GetGAL();
|
||||
|
||||
gal.DrawLine( m_geomMgr.GetOrigin(), m_geomMgr.GetEnd() );
|
||||
gal.DrawPolygon( getOutline() );
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
|
||||
#include <gal/graphics_abstraction_layer.h>
|
||||
#include <view/view.h>
|
||||
#include <pcb_painter.h>
|
||||
|
||||
using namespace KIGFX::PREVIEW;
|
||||
|
||||
|
@ -59,14 +60,17 @@ void POLYGON_ITEM::SetPoints( const std::vector<VECTOR2I>& aLockedPts,
|
|||
}
|
||||
|
||||
|
||||
void POLYGON_ITEM::drawPreviewShape( KIGFX::GAL& aGal ) const
|
||||
void POLYGON_ITEM::drawPreviewShape( KIGFX::VIEW* aView ) const
|
||||
{
|
||||
aGal.DrawPolyline( m_lockedChain );
|
||||
aGal.DrawPolygon( m_polyfill );
|
||||
auto& gal = *aView->GetGAL();
|
||||
auto rs = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( aView->GetPainter()->GetSettings() );
|
||||
|
||||
gal.DrawPolyline( m_lockedChain );
|
||||
gal.DrawPolygon( m_polyfill );
|
||||
|
||||
// draw the leader line in a different color
|
||||
aGal.SetStrokeColor( PreviewOverlayDefaultColor() );
|
||||
aGal.DrawPolyline( m_leaderChain );
|
||||
gal.SetStrokeColor( rs->GetLayerColor( LAYER_AUX_ITEMS ) );
|
||||
gal.DrawPolyline( m_leaderChain );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -24,19 +24,8 @@
|
|||
#include <preview_items/preview_utils.h>
|
||||
#include <gal/graphics_abstraction_layer.h>
|
||||
#include <base_units.h>
|
||||
|
||||
|
||||
COLOR4D KIGFX::PREVIEW::PreviewOverlayDefaultColor()
|
||||
{
|
||||
return COLOR4D( 1.0, 1.0, 1.0, 1.0 );
|
||||
}
|
||||
|
||||
|
||||
double KIGFX::PREVIEW::PreviewOverlayFillAlpha()
|
||||
{
|
||||
return 0.2;
|
||||
}
|
||||
|
||||
#include <pcb_painter.h>
|
||||
#include <view/view.h>
|
||||
|
||||
double KIGFX::PREVIEW::PreviewOverlayDeemphAlpha( bool aDeemph )
|
||||
{
|
||||
|
@ -44,12 +33,6 @@ double KIGFX::PREVIEW::PreviewOverlayDeemphAlpha( bool aDeemph )
|
|||
}
|
||||
|
||||
|
||||
COLOR4D KIGFX::PREVIEW::PreviewOverlaySpecialAngleColor()
|
||||
{
|
||||
return COLOR4D( 0.5, 1.0, 0.5, 1.0 );
|
||||
}
|
||||
|
||||
|
||||
static wxString getDimensionUnit( EDA_UNITS_T aUnits )
|
||||
{
|
||||
switch( aUnits )
|
||||
|
@ -129,11 +112,13 @@ void KIGFX::PREVIEW::SetConstantGlyphHeight( KIGFX::GAL& aGal, double aHeight )
|
|||
}
|
||||
|
||||
|
||||
void KIGFX::PREVIEW::DrawTextNextToCursor( KIGFX::GAL& aGal,
|
||||
void KIGFX::PREVIEW::DrawTextNextToCursor( KIGFX::VIEW* aView,
|
||||
const VECTOR2D& aCursorPos, const VECTOR2D& aTextQuadrant,
|
||||
const std::vector<wxString>& aStrings )
|
||||
{
|
||||
auto glyphSize = aGal.GetGlyphSize();
|
||||
auto gal = aView->GetGAL();
|
||||
auto glyphSize = gal->GetGlyphSize();
|
||||
auto rs = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( aView->GetPainter()->GetSettings() );
|
||||
|
||||
const auto lineSpace = glyphSize.y * 0.2;
|
||||
auto linePitch = glyphSize.y + lineSpace;
|
||||
|
@ -151,23 +136,23 @@ void KIGFX::PREVIEW::DrawTextNextToCursor( KIGFX::GAL& aGal,
|
|||
|
||||
if( aTextQuadrant.x < 0 )
|
||||
{
|
||||
aGal.SetHorizontalJustify( GR_TEXT_HJUSTIFY_LEFT );
|
||||
textPos.x += 15.0 / aGal.GetWorldScale();
|
||||
gal->SetHorizontalJustify( GR_TEXT_HJUSTIFY_LEFT );
|
||||
textPos.x += 15.0 / gal->GetWorldScale();
|
||||
}
|
||||
else
|
||||
{
|
||||
aGal.SetHorizontalJustify( GR_TEXT_HJUSTIFY_RIGHT );
|
||||
textPos.x -= 15.0 / aGal.GetWorldScale();
|
||||
gal->SetHorizontalJustify( GR_TEXT_HJUSTIFY_RIGHT );
|
||||
textPos.x -= 15.0 / gal->GetWorldScale();
|
||||
}
|
||||
|
||||
aGal.SetStrokeColor( PreviewOverlayDefaultColor().WithAlpha(
|
||||
gal->SetStrokeColor( rs->GetLayerColor( LAYER_AUX_ITEMS ).WithAlpha(
|
||||
PreviewOverlayDeemphAlpha( true ) ) );
|
||||
aGal.SetIsFill( false );
|
||||
gal->SetIsFill( false );
|
||||
|
||||
// write strings top-to-bottom
|
||||
for( const auto& str : aStrings )
|
||||
{
|
||||
textPos.y += linePitch;
|
||||
aGal.BitmapText( str, textPos, 0.0 );
|
||||
gal->BitmapText( str, textPos, 0.0 );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include <gal/graphics_abstraction_layer.h>
|
||||
#include <layers_id_colors_and_visibility.h>
|
||||
#include <view/view.h>
|
||||
#include <pcb_painter.h>
|
||||
|
||||
#include <base_units.h>
|
||||
#include <common.h>
|
||||
|
@ -38,7 +39,7 @@ static const double midTickLengthFactor = 1.5;
|
|||
static const double majorTickLengthFactor = 2.5;
|
||||
|
||||
|
||||
static void drawCursorStrings( KIGFX::GAL& aGal, const VECTOR2D& aCursor,
|
||||
static void drawCursorStrings( KIGFX::VIEW* aView, const VECTOR2D& aCursor,
|
||||
const VECTOR2D& aRulerVec )
|
||||
{
|
||||
// draw the cursor labels
|
||||
|
@ -56,7 +57,7 @@ static void drawCursorStrings( KIGFX::GAL& aGal, const VECTOR2D& aCursor,
|
|||
}
|
||||
|
||||
auto temp = aRulerVec;
|
||||
DrawTextNextToCursor( aGal, aCursor, -temp, cursorStrings );
|
||||
DrawTextNextToCursor( aView, aCursor, -temp, cursorStrings );
|
||||
}
|
||||
|
||||
|
||||
|
@ -117,13 +118,14 @@ static TICK_FORMAT getTickFormatForScale( double aScale, double& aTickSpace )
|
|||
* @param aLine line vector
|
||||
* @param aMinorTickLen length of minor ticks in IU
|
||||
*/
|
||||
void drawTicksAlongLine( KIGFX::GAL& aGal, const VECTOR2D& aOrigin,
|
||||
void drawTicksAlongLine( KIGFX::VIEW *aView, const VECTOR2D& aOrigin,
|
||||
const VECTOR2D& aLine, double aMinorTickLen )
|
||||
{
|
||||
VECTOR2D tickLine = aLine.Rotate( -M_PI_2 );
|
||||
|
||||
auto gal = aView->GetGAL();
|
||||
double tickSpace;
|
||||
TICK_FORMAT tickF = getTickFormatForScale( aGal.GetWorldScale(), tickSpace );
|
||||
TICK_FORMAT tickF = getTickFormatForScale( gal->GetWorldScale(), tickSpace );
|
||||
auto rs = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( aView->GetPainter()->GetSettings() );
|
||||
|
||||
// number of ticks in whole ruler
|
||||
int numTicks = (int) std::ceil( aLine.EuclideanNorm() / tickSpace );
|
||||
|
@ -133,16 +135,16 @@ void drawTicksAlongLine( KIGFX::GAL& aGal, const VECTOR2D& aOrigin,
|
|||
|
||||
if( aLine.Angle() > 0 )
|
||||
{
|
||||
aGal.SetHorizontalJustify( GR_TEXT_HJUSTIFY_LEFT );
|
||||
gal->SetHorizontalJustify( GR_TEXT_HJUSTIFY_LEFT );
|
||||
}
|
||||
else
|
||||
{
|
||||
aGal.SetHorizontalJustify( GR_TEXT_HJUSTIFY_RIGHT );
|
||||
gal->SetHorizontalJustify( GR_TEXT_HJUSTIFY_RIGHT );
|
||||
labelAngle += M_PI;
|
||||
}
|
||||
|
||||
// text and ticks are dimmed
|
||||
aGal.SetStrokeColor( PreviewOverlayDefaultColor().WithAlpha( PreviewOverlayDeemphAlpha( true ) ) );
|
||||
gal->SetStrokeColor( rs->GetLayerColor( LAYER_AUX_ITEMS ).WithAlpha( PreviewOverlayDeemphAlpha( true ) ) );
|
||||
|
||||
const auto labelOffset = tickLine.Resize( aMinorTickLen * ( majorTickLengthFactor + 1 ) );
|
||||
|
||||
|
@ -164,7 +166,7 @@ void drawTicksAlongLine( KIGFX::GAL& aGal, const VECTOR2D& aOrigin,
|
|||
length *= midTickLengthFactor;
|
||||
}
|
||||
|
||||
aGal.DrawLine( tickPos, tickPos + tickLine.Resize( length ) );
|
||||
gal->DrawLine( tickPos, tickPos + tickLine.Resize( length ) );
|
||||
|
||||
if( drawLabel )
|
||||
{
|
||||
|
@ -173,7 +175,7 @@ void drawTicksAlongLine( KIGFX::GAL& aGal, const VECTOR2D& aOrigin,
|
|||
// FIXME: spaces choke OpenGL lp:1668455
|
||||
label.erase( std::remove( label.begin(), label.end(), ' ' ), label.end() );
|
||||
|
||||
aGal.BitmapText( label, tickPos + labelOffset, labelAngle );
|
||||
gal->BitmapText( label, tickPos + labelOffset, labelAngle );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -230,6 +232,7 @@ void RULER_ITEM::ViewGetLayers( int aLayers[], int& aCount ) const
|
|||
void RULER_ITEM::ViewDraw( int aLayer, KIGFX::VIEW* aView ) const
|
||||
{
|
||||
auto& gal = *aView->GetGAL();
|
||||
auto rs = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( aView->GetPainter()->GetSettings() );
|
||||
|
||||
const auto origin = m_geomMgr.GetOrigin();
|
||||
const auto end = m_geomMgr.GetEnd();
|
||||
|
@ -237,7 +240,7 @@ void RULER_ITEM::ViewDraw( int aLayer, KIGFX::VIEW* aView ) const
|
|||
gal.SetLineWidth( 1.0 );
|
||||
gal.SetIsStroke( true );
|
||||
gal.SetIsFill( false );
|
||||
gal.SetStrokeColor( PreviewOverlayDefaultColor() );
|
||||
gal.SetStrokeColor( rs->GetLayerColor( LAYER_AUX_ITEMS ) );
|
||||
|
||||
gal.ResetTextAttributes();
|
||||
|
||||
|
@ -249,7 +252,7 @@ void RULER_ITEM::ViewDraw( int aLayer, KIGFX::VIEW* aView ) const
|
|||
// constant text size on screen
|
||||
SetConstantGlyphHeight( gal, 12.0 );
|
||||
|
||||
drawCursorStrings( gal, end, rulerVec );
|
||||
drawCursorStrings( aView, end, rulerVec );
|
||||
|
||||
// tick label size
|
||||
SetConstantGlyphHeight( gal, 10.0 );
|
||||
|
@ -257,9 +260,9 @@ void RULER_ITEM::ViewDraw( int aLayer, KIGFX::VIEW* aView ) const
|
|||
// basic tick size
|
||||
const double minorTickLen = 5.0 / gal.GetWorldScale();
|
||||
|
||||
drawTicksAlongLine( gal, origin, rulerVec, minorTickLen );
|
||||
drawTicksAlongLine( aView, origin, rulerVec, minorTickLen );
|
||||
|
||||
gal.SetStrokeColor( PreviewOverlayDefaultColor().WithAlpha( PreviewOverlayDeemphAlpha( true ) ) );
|
||||
gal.SetStrokeColor( rs->GetLayerColor( LAYER_AUX_ITEMS ).WithAlpha( PreviewOverlayDeemphAlpha( true ) ) );
|
||||
drawBacksideTicks( gal, origin, rulerVec, minorTickLen * majorTickLengthFactor, 2 );
|
||||
|
||||
// draw the back of the origin "crosshair"
|
||||
|
|
|
@ -26,23 +26,44 @@
|
|||
|
||||
#include <gal/graphics_abstraction_layer.h>
|
||||
#include <view/view.h>
|
||||
#include <pcb_painter.h>
|
||||
|
||||
using namespace KIGFX::PREVIEW;
|
||||
|
||||
// Selection area colours
|
||||
const COLOR4D SELECT_MODE_NORMAL( 0.3, 0.3, 0.7, 0.3 ); // Slight blue
|
||||
const COLOR4D SELECT_MODE_ADDITIVE( 0.3, 0.7, 0.3, 0.3 ); // Slight green
|
||||
const COLOR4D SELECT_MODE_SUBTRACT( 0.7, 0.3, 0.3, 0.3 ); // Slight red
|
||||
struct SELECTION_COLORS
|
||||
{
|
||||
COLOR4D normal;
|
||||
COLOR4D additive;
|
||||
COLOR4D subtract;
|
||||
COLOR4D outline_l2r;
|
||||
COLOR4D outline_r2l;
|
||||
};
|
||||
|
||||
static const SELECTION_COLORS selectionColorScheme[2] = {
|
||||
{ // dark background
|
||||
COLOR4D( 0.3, 0.3, 0.7, 0.3 ), // Slight blue
|
||||
COLOR4D( 0.3, 0.7, 0.3, 0.3 ), // Slight green
|
||||
COLOR4D( 0.7, 0.3, 0.3, 0.3 ), // Slight red
|
||||
|
||||
COLOR4D( 1.0, 1.0, 0.4, 1.0 ), // yellow
|
||||
COLOR4D( 0.4, 0.4, 1.0, 1.0 ) // blue
|
||||
},
|
||||
{ // bright background
|
||||
COLOR4D( 0.5, 0.3, 1.0, 0.5 ), // Slight blue
|
||||
COLOR4D( 0.5, 1.0, 0.5, 0.5 ), // Slight green
|
||||
COLOR4D( 1.0, 0.5, 0.5, 0.5 ), // Slight red
|
||||
|
||||
COLOR4D( 0.7, 0.7, 0.0, 1.0 ), // yellow
|
||||
COLOR4D( 0.1, 0.1, 1.0, 1.0 ) // blue
|
||||
}
|
||||
};
|
||||
|
||||
const COLOR4D SELECT_OUTLINE_L2R( 1.0, 1.0, 0.4, 1.0 );
|
||||
const COLOR4D SELECT_OUTLINE_R2L( 0.4, 0.4, 1.0, 1.0 );
|
||||
|
||||
SELECTION_AREA::SELECTION_AREA() :
|
||||
m_additive( false ),
|
||||
m_subtractive( false )
|
||||
{
|
||||
SetStrokeColor( SELECT_OUTLINE_L2R );
|
||||
SetFillColor( SELECT_MODE_NORMAL );
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -74,26 +95,33 @@ const BOX2I SELECTION_AREA::ViewBBox() const
|
|||
return tmp;
|
||||
}
|
||||
|
||||
|
||||
void SELECTION_AREA::drawPreviewShape( KIGFX::GAL& aGal ) const
|
||||
void SELECTION_AREA::ViewDraw( int aLayer, KIGFX::VIEW* aView ) const
|
||||
{
|
||||
auto& gal = *aView->GetGAL();
|
||||
|
||||
auto rs = static_cast<PCB_RENDER_SETTINGS*>( aView->GetPainter()->GetSettings() );
|
||||
|
||||
const auto& scheme = rs->IsBackgroundDark() ? selectionColorScheme[0] : selectionColorScheme[1];
|
||||
|
||||
// Set the fill of the selection rectangle
|
||||
// based on the selection mode
|
||||
if( m_additive )
|
||||
{
|
||||
aGal.SetFillColor( SELECT_MODE_ADDITIVE );
|
||||
gal.SetFillColor( scheme.additive );
|
||||
}
|
||||
else if( m_subtractive )
|
||||
{
|
||||
aGal.SetFillColor( SELECT_MODE_SUBTRACT );
|
||||
gal.SetFillColor( scheme.subtract );
|
||||
}
|
||||
else
|
||||
{
|
||||
aGal.SetFillColor( SELECT_MODE_NORMAL );
|
||||
gal.SetFillColor( scheme.normal );
|
||||
}
|
||||
|
||||
// Set the stroke color to indicate window or crossing selection
|
||||
aGal.SetStrokeColor( ( m_origin.x <= m_end.x ) ? SELECT_OUTLINE_L2R : SELECT_OUTLINE_R2L );
|
||||
gal.SetIsStroke( true );
|
||||
gal.SetIsFill( true );
|
||||
|
||||
aGal.DrawRectangle( m_origin, m_end );
|
||||
// Set the stroke color to indicate window or crossing selection
|
||||
gal.SetStrokeColor( ( m_origin.x <= m_end.x ) ? scheme.outline_l2r : scheme.outline_r2l );
|
||||
gal.DrawRectangle( m_origin, m_end );
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ void SIMPLE_OVERLAY_ITEM::ViewDraw( int aLayer, KIGFX::VIEW* aView ) const
|
|||
auto& gal = *aView->GetGAL();
|
||||
|
||||
setupGal( gal );
|
||||
drawPreviewShape( gal );
|
||||
drawPreviewShape( aView );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
* This program source code file is part of KICAD, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2010-2014 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 1992-2014 KiCad Developers, see CHANGELOG.TXT for contributors.
|
||||
* Copyright (C) 2012-2017 Kicad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
|
@ -22,13 +21,30 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/* colors_selection.h */
|
||||
#include <core/settings.h>
|
||||
|
||||
#ifndef _COLORS_SELECTION_H_
|
||||
#define _COLORS_SELECTION_H_
|
||||
void SETTINGS::Load( wxConfigBase *aConfig )
|
||||
{
|
||||
for( const PARAM_CFG_BASE& param : m_params )
|
||||
{
|
||||
if( !!param.m_Group )
|
||||
aConfig->SetPath( param.m_Group );
|
||||
else
|
||||
aConfig->SetPath( wxT("") );
|
||||
|
||||
#include <class_colors_design_settings.h>
|
||||
// Colors for layers and items
|
||||
extern COLORS_DESIGN_SETTINGS g_ColorsSettings;
|
||||
param.ReadParam( aConfig );
|
||||
}
|
||||
}
|
||||
|
||||
#endif // _COLORS_SELECTION_H_
|
||||
void SETTINGS::Save( wxConfigBase *aConfig )
|
||||
{
|
||||
for( PARAM_CFG_BASE& param : m_params )
|
||||
{
|
||||
if( !!param.m_Group )
|
||||
aConfig->SetPath( param.m_Group );
|
||||
else
|
||||
aConfig->SetPath( wxT("") );
|
||||
|
||||
param.SaveParam( aConfig );
|
||||
}
|
||||
}
|
|
@ -36,6 +36,7 @@ set( CVPCB_DIALOGS
|
|||
set( CVPCB_SRCS
|
||||
../common/base_units.cpp
|
||||
../pcbnew/board_items_to_polygon_shape_transform.cpp
|
||||
../pcbnew/pcb_general_settings.cpp
|
||||
../pcbnew/class_drc_item.cpp
|
||||
autosel.cpp
|
||||
cfg.cpp
|
||||
|
|
|
@ -432,7 +432,7 @@ void DISPLAY_FOOTPRINTS_FRAME::SetGridVisibility(bool aVisible)
|
|||
}
|
||||
|
||||
|
||||
COLOR4D DISPLAY_FOOTPRINTS_FRAME::GetGridColor() const
|
||||
COLOR4D DISPLAY_FOOTPRINTS_FRAME::GetGridColor()
|
||||
{
|
||||
return COLOR4D( DARKGRAY );
|
||||
}
|
||||
|
|
|
@ -87,7 +87,7 @@ public:
|
|||
* Function GetGridColor() , virtual
|
||||
* @return the color of the grid
|
||||
*/
|
||||
virtual COLOR4D GetGridColor() const override;
|
||||
virtual COLOR4D GetGridColor() override;
|
||||
|
||||
void OnLeftClick( wxDC* DC, const wxPoint& MousePos ) override;
|
||||
void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) override;
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
#include <cvpcb.h>
|
||||
#include <zones.h>
|
||||
#include <cvpcb_mainframe.h>
|
||||
#include <colors_selection.h>
|
||||
#include <cvpcb_id.h>
|
||||
|
||||
#include <build_version.h>
|
||||
|
|
|
@ -71,6 +71,8 @@ set( GERBVIEW_EXTRA_SRCS
|
|||
../common/eda_text.cpp
|
||||
../common/class_layer_box_selector.cpp
|
||||
../common/class_page_info.cpp
|
||||
../common/lset.cpp
|
||||
../common/settings.cpp
|
||||
../pcbnew/layer_widget.cpp
|
||||
)
|
||||
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
*/
|
||||
|
||||
#include <common.h>
|
||||
#include <colors_selection.h>
|
||||
#include <gerbview_frame.h>
|
||||
#include <class_gerber_file_image_list.h>
|
||||
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
#include <common.h>
|
||||
#include <class_drawpanel.h>
|
||||
#include <config_params.h>
|
||||
#include <colors_selection.h>
|
||||
|
||||
#include <gerbview.h>
|
||||
#include <gerbview_frame.h>
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
#include <build_version.h>
|
||||
#include <trigo.h>
|
||||
#include <base_units.h>
|
||||
#include <colors_selection.h>
|
||||
#include <class_gbr_layer_box_selector.h>
|
||||
#include <msgpanel.h>
|
||||
#include <bitmaps.h>
|
||||
|
@ -607,7 +606,7 @@ bool GERBVIEW_FRAME::IsLayerVisible( int aLayer ) const
|
|||
}
|
||||
|
||||
|
||||
COLOR4D GERBVIEW_FRAME::GetVisibleElementColor( GERBVIEW_LAYER_ID aItemIdVisible ) const
|
||||
COLOR4D GERBVIEW_FRAME::GetVisibleElementColor( GERBVIEW_LAYER_ID aItemIdVisible )
|
||||
{
|
||||
COLOR4D color = COLOR4D::UNSPECIFIED;
|
||||
|
||||
|
@ -659,7 +658,7 @@ void GERBVIEW_FRAME::SetVisibleElementColor( GERBVIEW_LAYER_ID aItemIdVisible,
|
|||
}
|
||||
}
|
||||
|
||||
COLOR4D GERBVIEW_FRAME::GetNegativeItemsColor() const
|
||||
COLOR4D GERBVIEW_FRAME::GetNegativeItemsColor()
|
||||
{
|
||||
if( IsElementVisible( LAYER_NEGATIVE_OBJECTS ) )
|
||||
return GetVisibleElementColor( LAYER_NEGATIVE_OBJECTS );
|
||||
|
|
|
@ -40,6 +40,9 @@
|
|||
#include <class_gbr_screen.h>
|
||||
#include <class_page_info.h>
|
||||
#include <class_gbr_display_options.h>
|
||||
#include <class_colors_design_settings.h>
|
||||
|
||||
extern COLORS_DESIGN_SETTINGS g_ColorsSettings;
|
||||
|
||||
#define NO_AVAILABLE_LAYERS UNDEFINED_LAYER
|
||||
|
||||
|
@ -335,7 +338,7 @@ public:
|
|||
* Function GetVisibleElementColor
|
||||
* returns the color of a gerber visible element.
|
||||
*/
|
||||
COLOR4D GetVisibleElementColor( GERBVIEW_LAYER_ID aItemIdVisible ) const;
|
||||
COLOR4D GetVisibleElementColor( GERBVIEW_LAYER_ID aItemIdVisible );
|
||||
|
||||
void SetVisibleElementColor( GERBVIEW_LAYER_ID aItemIdVisible, COLOR4D aColor );
|
||||
|
||||
|
@ -357,7 +360,7 @@ public:
|
|||
* This is usually the background color, but can be an other color
|
||||
* in order to see negative objects
|
||||
*/
|
||||
COLOR4D GetNegativeItemsColor() const;
|
||||
COLOR4D GetNegativeItemsColor();
|
||||
|
||||
/**
|
||||
* Function DisplayLinesSolidMode
|
||||
|
|
|
@ -31,14 +31,20 @@
|
|||
#define COLORS_DESIGN_SETTING_H
|
||||
#include <gal/color4d.h>
|
||||
#include <layers_id_colors_and_visibility.h>
|
||||
#include <core/settings.h>
|
||||
|
||||
using KIGFX::COLOR4D;
|
||||
|
||||
class wxConfigBase;
|
||||
class wxString;
|
||||
|
||||
class PARAM_CFG_ARRAY;
|
||||
|
||||
/**
|
||||
* Class COLORS_DESIGN_SETTINGS
|
||||
* is a list of color settings for designs in Eeschema, Pcbnew and GerbView
|
||||
*/
|
||||
class COLORS_DESIGN_SETTINGS
|
||||
class COLORS_DESIGN_SETTINGS : public SETTINGS
|
||||
{
|
||||
public:
|
||||
// Color options for screen display of the Printed Board and schematic:
|
||||
|
@ -49,6 +55,8 @@ public:
|
|||
public:
|
||||
COLORS_DESIGN_SETTINGS();
|
||||
|
||||
virtual void Load( wxConfigBase *aConfig );
|
||||
virtual void Save( wxConfigBase *aConfig );
|
||||
/**
|
||||
* Function GetLayerColor
|
||||
* @return the color for aLayer which is one of the layer indices given
|
||||
|
@ -83,6 +91,11 @@ public:
|
|||
* Usefull to create a monochrome color selection for printing purpose
|
||||
*/
|
||||
void SetAllColorsAs( COLOR4D aColor );
|
||||
|
||||
private:
|
||||
|
||||
void setupConfigParams();
|
||||
|
||||
};
|
||||
|
||||
#endif // COLORS_DESIGN_SETTING_H
|
||||
|
|
|
@ -0,0 +1,118 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015 CERN
|
||||
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you may find one here:
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __SETTINGS_H
|
||||
#define __SETTINGS_H
|
||||
|
||||
#include <wx/confbase.h>
|
||||
#include <config_params.h>
|
||||
|
||||
|
||||
/**
|
||||
* Class TOOL_SETTINGS
|
||||
*
|
||||
* Manages persistent settings for a tool (just a simple wrapper to wxConfigBase)
|
||||
*/
|
||||
class SETTINGS
|
||||
{
|
||||
public:
|
||||
SETTINGS()
|
||||
{}
|
||||
|
||||
~SETTINGS()
|
||||
{}
|
||||
|
||||
void SetConfigPrefix ( const wxString& aPrefix )
|
||||
{
|
||||
m_prefix = aPrefix;
|
||||
}
|
||||
|
||||
virtual void Load( wxConfigBase *aConfig );
|
||||
virtual void Save( wxConfigBase *aConfig );
|
||||
|
||||
#if 0
|
||||
template<class T>
|
||||
T Get( const wxString& aName, T aDefaultValue ) const
|
||||
{
|
||||
wxConfigBase* config = getConfigBase();
|
||||
|
||||
if( !config )
|
||||
return aDefaultValue;
|
||||
|
||||
T tmp = aDefaultValue;
|
||||
|
||||
config->Read( getKeyName( aName ), &tmp );
|
||||
return tmp;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
void Set( const wxString& aName, const T &aValue )
|
||||
{
|
||||
wxConfigBase* config = getConfigBase();
|
||||
|
||||
if( !config )
|
||||
return;
|
||||
|
||||
config->Write( getKeyName( aName ), aValue );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void Add ( const wxString& name, int* aPtr, int aDefaultValue )
|
||||
{
|
||||
m_params.push_back ( new PARAM_CFG_INT ( name, aPtr, aDefaultValue ) );
|
||||
}
|
||||
|
||||
void Add ( const wxString& name, bool* aPtr, bool aDefaultValue )
|
||||
{
|
||||
m_params.push_back ( new PARAM_CFG_BOOL ( name, aPtr, aDefaultValue ) );
|
||||
}
|
||||
|
||||
void Add ( const wxString& name, KIGFX::COLOR4D* aPtr, KIGFX::COLOR4D aDefaultValue )
|
||||
{
|
||||
m_params.push_back ( new PARAM_CFG_SETCOLOR ( name, aPtr, aDefaultValue ) );
|
||||
}
|
||||
|
||||
void Add ( const wxString& name, KIGFX::COLOR4D* aPtr, EDA_COLOR_T aDefaultValue )
|
||||
{
|
||||
m_params.push_back ( new PARAM_CFG_SETCOLOR ( name, aPtr, aDefaultValue ) );
|
||||
}
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
virtual wxString getKeyName( const wxString& aEntryName ) const
|
||||
{
|
||||
return aEntryName;
|
||||
}
|
||||
|
||||
private:
|
||||
wxString m_prefix;
|
||||
PARAM_CFG_ARRAY m_params;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
|
@ -445,7 +445,7 @@ public:
|
|||
* Function GetGridColor() , virtual
|
||||
* @return the color of the grid
|
||||
*/
|
||||
virtual COLOR4D GetGridColor() const
|
||||
virtual COLOR4D GetGridColor()
|
||||
{
|
||||
return m_gridColor;
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ public:
|
|||
virtual void Begin() override;
|
||||
|
||||
/// @copydoc COMPOSITOR::ClearBuffer()
|
||||
virtual void ClearBuffer() override;
|
||||
virtual void ClearBuffer( const COLOR4D& aColor ) override;
|
||||
|
||||
/// @copydoc COMPOSITOR::DrawBuffer()
|
||||
virtual void DrawBuffer( unsigned int aBufferHandle ) override;
|
||||
|
|
|
@ -150,7 +150,7 @@ public:
|
|||
virtual void Flush() override;
|
||||
|
||||
/// @copydoc GAL::ClearScreen()
|
||||
virtual void ClearScreen( const COLOR4D& aColor ) override;
|
||||
virtual void ClearScreen( ) override;
|
||||
|
||||
// -----------------
|
||||
// Attribute setting
|
||||
|
|
|
@ -34,6 +34,8 @@
|
|||
namespace KIGFX
|
||||
{
|
||||
|
||||
class COLOR4D;
|
||||
|
||||
class COMPOSITOR
|
||||
{
|
||||
public:
|
||||
|
@ -91,7 +93,7 @@ public:
|
|||
* Function ClearBuffer()
|
||||
* clears the selected buffer (set by the SetBuffer() function).
|
||||
*/
|
||||
virtual void ClearBuffer() = 0;
|
||||
virtual void ClearBuffer( const COLOR4D& aColor ) = 0;
|
||||
|
||||
/**
|
||||
* Function Begin()
|
||||
|
|
|
@ -198,11 +198,21 @@ public:
|
|||
/// @brief Force all remaining objects to be drawn.
|
||||
virtual void Flush() {};
|
||||
|
||||
void SetClearColor( const COLOR4D& aColor )
|
||||
{
|
||||
m_clearColor = aColor;
|
||||
}
|
||||
|
||||
const COLOR4D& GetClearColor( ) const
|
||||
{
|
||||
return m_clearColor;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Clear the screen.
|
||||
* @param aColor is the color used for clearing.
|
||||
*/
|
||||
virtual void ClearScreen( const COLOR4D& aColor ) {};
|
||||
virtual void ClearScreen() {};
|
||||
|
||||
// -----------------
|
||||
// Attribute setting
|
||||
|
@ -988,6 +998,7 @@ protected:
|
|||
|
||||
COLOR4D fillColor; ///< The fill color
|
||||
COLOR4D strokeColor; ///< The color of the outlines
|
||||
COLOR4D m_clearColor;
|
||||
|
||||
double layerDepth; ///< The actual layer depth
|
||||
VECTOR2D depthRange; ///< Range of the depth
|
||||
|
|
|
@ -68,7 +68,7 @@ public:
|
|||
}
|
||||
|
||||
/// @copydoc COMPOSITOR::ClearBuffer()
|
||||
virtual void ClearBuffer() override;
|
||||
virtual void ClearBuffer( const COLOR4D& aColor ) override;
|
||||
|
||||
/// @copydoc COMPOSITOR::DrawBuffer()
|
||||
virtual void DrawBuffer( unsigned int aBufferHandle ) override;
|
||||
|
|
|
@ -171,7 +171,7 @@ public:
|
|||
virtual void Flush() override;
|
||||
|
||||
/// @copydoc GAL::ClearScreen()
|
||||
virtual void ClearScreen( const COLOR4D& aColor ) override;
|
||||
virtual void ClearScreen( ) override;
|
||||
|
||||
// --------------
|
||||
// Transformation
|
||||
|
|
|
@ -193,6 +193,9 @@ enum GAL_LAYER_ID: int
|
|||
LAYER_DRC, ///< drc markers
|
||||
LAYER_WORKSHEET, ///< worksheet frame
|
||||
LAYER_GP_OVERLAY, ///< general purpose overlay
|
||||
LAYER_PCB_BACKGROUND, ///< PCB background color
|
||||
LAYER_CURSOR, ///< PCB cursor
|
||||
LAYER_AUX_ITEMS, ///< Auxillary items (guides, rulre, etc)
|
||||
|
||||
/// This is the end of the layers used for visibility bitmasks in Pcbnew
|
||||
/// There can be at most 32 layers above here.
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
namespace KIGFX
|
||||
{
|
||||
class GAL;
|
||||
class VIEW;
|
||||
|
||||
namespace PREVIEW
|
||||
{
|
||||
|
@ -64,7 +65,7 @@ private:
|
|||
SHAPE_POLY_SET getOutline() const;
|
||||
|
||||
///> Draw rectangle and centre line onto GAL
|
||||
void drawPreviewShape( KIGFX::GAL& aGal ) const override;
|
||||
void drawPreviewShape( KIGFX::VIEW* aView ) const override;
|
||||
|
||||
const TWO_POINT_GEOMETRY_MANAGER& m_geomMgr;
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@ namespace KIGFX
|
|||
{
|
||||
|
||||
class GAL;
|
||||
class VIEW;
|
||||
|
||||
namespace PREVIEW
|
||||
{
|
||||
|
@ -67,7 +68,7 @@ public:
|
|||
private:
|
||||
|
||||
///> Draw rectangle and centre line onto GAL
|
||||
void drawPreviewShape( KIGFX::GAL& aGal ) const override;
|
||||
void drawPreviewShape( KIGFX::VIEW* aView ) const override;
|
||||
|
||||
///> complete polyline of locked in and leader points
|
||||
SHAPE_LINE_CHAIN m_lockedChain, m_leaderChain;
|
||||
|
|
|
@ -31,30 +31,17 @@
|
|||
namespace KIGFX
|
||||
{
|
||||
class GAL;
|
||||
class VIEW;
|
||||
|
||||
namespace PREVIEW
|
||||
{
|
||||
|
||||
/**
|
||||
* The default fill/stroke color of preview overlay items
|
||||
*/
|
||||
COLOR4D PreviewOverlayDefaultColor();
|
||||
|
||||
/**
|
||||
* The default alpha of overlay fills
|
||||
*/
|
||||
double PreviewOverlayFillAlpha();
|
||||
|
||||
/**
|
||||
* Default alpha of "de-emphasised" features (like previously locked-in
|
||||
* lines
|
||||
*/
|
||||
double PreviewOverlayDeemphAlpha( bool aDeemph = true );
|
||||
|
||||
/**
|
||||
* The colour of "special" angle overlay features
|
||||
*/
|
||||
COLOR4D PreviewOverlaySpecialAngleColor();
|
||||
|
||||
/**
|
||||
* Get a formatted string showing a dimension to a sane precision
|
||||
|
@ -81,7 +68,7 @@ void SetConstantGlyphHeight( KIGFX::GAL& aGal, double aHeight );
|
|||
* text in
|
||||
* @param aStrings list of strings to draw, top to bottom
|
||||
*/
|
||||
void DrawTextNextToCursor( KIGFX::GAL& aGal,
|
||||
void DrawTextNextToCursor( KIGFX::VIEW* aView,
|
||||
const VECTOR2D& aCursorPos, const VECTOR2D& aTextQuadrant,
|
||||
const std::vector<wxString>& aStrings );
|
||||
|
||||
|
|
|
@ -86,17 +86,13 @@ public:
|
|||
void SetAdditive( bool aAdditive );
|
||||
void SetSubtractive( bool aSubtractive );
|
||||
|
||||
void ViewDraw( int aLayer, KIGFX::VIEW* aView ) const override final;
|
||||
|
||||
private:
|
||||
|
||||
bool m_additive;
|
||||
bool m_subtractive;
|
||||
|
||||
/**
|
||||
* Draw the selection rectangle onto the GAL
|
||||
*/
|
||||
void drawPreviewShape( KIGFX::GAL& aGal ) const override;
|
||||
|
||||
VECTOR2I m_origin, m_end;
|
||||
};
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ public:
|
|||
* or direct access to the VIEW, you probably should make a new
|
||||
* class.
|
||||
*/
|
||||
void ViewDraw( int aLayer, KIGFX::VIEW* aView ) const override final;
|
||||
void ViewDraw( int aLayer, KIGFX::VIEW* aView ) const override;
|
||||
|
||||
|
||||
#if defined(DEBUG)
|
||||
|
@ -123,7 +123,7 @@ private:
|
|||
* Subclasses should implement this in terms of their own graphical
|
||||
* data.
|
||||
*/
|
||||
virtual void drawPreviewShape( KIGFX::GAL& aGal ) const = 0;
|
||||
virtual void drawPreviewShape( KIGFX::VIEW* aView ) const { };
|
||||
|
||||
|
||||
COLOR4D m_fillColor;
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#ifndef __TOOL_SETTINGS_H
|
||||
#define __TOOL_SETTINGS_H
|
||||
|
||||
#include <wx/confbase.h>
|
||||
#include <core/settings.h>
|
||||
|
||||
/**
|
||||
* Class TOOL_SETTINGS
|
||||
|
@ -35,7 +35,7 @@
|
|||
*/
|
||||
class TOOL_BASE;
|
||||
|
||||
class TOOL_SETTINGS
|
||||
class TOOL_SETTINGS : public SETTINGS
|
||||
{
|
||||
public:
|
||||
TOOL_SETTINGS( TOOL_BASE* aTool = NULL );
|
||||
|
|
|
@ -43,6 +43,8 @@
|
|||
#include <pcbstruct.h>
|
||||
#include <class_draw_panel_gal.h>
|
||||
|
||||
#include <pcb_general_settings.h>
|
||||
|
||||
/* Forward declarations of classes. */
|
||||
class BOARD;
|
||||
class BOARD_CONNECTED_ITEM;
|
||||
|
@ -58,6 +60,7 @@ class ZONE_SETTINGS;
|
|||
class PCB_PLOT_PARAMS;
|
||||
class FP_LIB_TABLE;
|
||||
class LIB_ID;
|
||||
class PCB_GENERAL_SETTINGS ;
|
||||
|
||||
/**
|
||||
* class PCB_BASE_FRAME
|
||||
|
@ -76,6 +79,7 @@ public:
|
|||
protected:
|
||||
BOARD* m_Pcb;
|
||||
GENERAL_COLLECTOR* m_Collector;
|
||||
PCB_GENERAL_SETTINGS m_configSettings;
|
||||
|
||||
/// Auxiliary tool bar typically shown below the main tool bar at the top of the
|
||||
/// main window.
|
||||
|
@ -702,6 +706,17 @@ public:
|
|||
*/
|
||||
bool SaveCanvasTypeSetting( EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType );
|
||||
|
||||
PCB_GENERAL_SETTINGS& Settings()
|
||||
{
|
||||
return m_configSettings;
|
||||
}
|
||||
|
||||
const PCB_GENERAL_SETTINGS& CSettings() const
|
||||
{
|
||||
return m_configSettings;
|
||||
}
|
||||
|
||||
|
||||
///> Key in KifaceSettings to store the canvas type.
|
||||
static const wxChar CANVAS_TYPE_KEY[];
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ protected:
|
|||
|
||||
DRC* m_drc; ///< the DRC controller, see drc.cpp
|
||||
|
||||
PARAM_CFG_ARRAY m_configSettings; ///< List of Pcbnew configuration settings.
|
||||
PARAM_CFG_ARRAY m_configParams; ///< List of Pcbnew configuration settings.
|
||||
|
||||
wxString m_lastNetListRead; ///< Last net list read with relative path.
|
||||
|
||||
|
@ -362,7 +362,7 @@ public:
|
|||
* Function GetGridColor() , virtual
|
||||
* @return the color of the grid
|
||||
*/
|
||||
virtual COLOR4D GetGridColor() const override;
|
||||
virtual COLOR4D GetGridColor() override;
|
||||
|
||||
/**
|
||||
* Function SetGridColor() , virtual
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
#include <pcb_calculator.h>
|
||||
|
||||
#include <bitmaps.h>
|
||||
#include <colors_selection.h>
|
||||
#include <build_version.h>
|
||||
|
||||
// Pcb_calculator data file extension:
|
||||
|
|
|
@ -260,6 +260,7 @@ set( PCBNEW_CLASS_SRCS
|
|||
pcbnew_config.cpp
|
||||
pcbplot.cpp
|
||||
pcb_draw_panel_gal.cpp
|
||||
pcb_general_settings.cpp
|
||||
plot_board_layers.cpp
|
||||
plot_brditems_plotter.cpp
|
||||
print_board_functions.cpp
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
|
||||
#include <autorout.h>
|
||||
#include <cell.h>
|
||||
#include <colors_selection.h>
|
||||
|
||||
#include <class_board.h>
|
||||
#include <class_module.h>
|
||||
|
|
|
@ -176,6 +176,7 @@ void PCB_BASE_FRAME::SetBoard( BOARD* aBoard )
|
|||
{
|
||||
delete m_Pcb;
|
||||
m_Pcb = aBoard;
|
||||
m_Pcb->SetColorsSettings( &Settings().Colors() );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,6 @@
|
|||
#include <worksheet_viewitem.h>
|
||||
|
||||
#include <pcbnew.h>
|
||||
#include <colors_selection.h>
|
||||
#include <collectors.h>
|
||||
|
||||
#include <class_board.h>
|
||||
|
@ -76,8 +75,6 @@ BOARD::BOARD() :
|
|||
m_fileFormatVersionAtLoad = LEGACY_BOARD_FILE_VERSION;
|
||||
|
||||
m_Status_Pcb = 0; // Status word: bit 1 = calculate.
|
||||
SetColorsSettings( &g_ColorsSettings );
|
||||
|
||||
m_CurrentZoneContour = NULL; // This ZONE_CONTAINER handle the
|
||||
// zone contour currently in progress
|
||||
|
||||
|
@ -789,72 +786,6 @@ void BOARD::SetElementVisibility( GAL_LAYER_ID LAYER_aPCB, bool isEnabled )
|
|||
}
|
||||
|
||||
|
||||
COLOR4D BOARD::GetVisibleElementColor( GAL_LAYER_ID aLayerId )
|
||||
{
|
||||
COLOR4D color = COLOR4D::UNSPECIFIED;
|
||||
|
||||
switch( aLayerId )
|
||||
{
|
||||
case LAYER_NON_PLATED:
|
||||
case LAYER_VIA_THROUGH:
|
||||
case LAYER_VIA_MICROVIA:
|
||||
case LAYER_VIA_BBLIND:
|
||||
case LAYER_MOD_TEXT_FR:
|
||||
case LAYER_MOD_TEXT_BK:
|
||||
case LAYER_MOD_TEXT_INVISIBLE:
|
||||
case LAYER_ANCHOR:
|
||||
case LAYER_PAD_FR:
|
||||
case LAYER_PAD_BK:
|
||||
case LAYER_RATSNEST:
|
||||
case LAYER_GRID:
|
||||
color = GetColorsSettings()->GetItemColor( aLayerId );
|
||||
break;
|
||||
|
||||
default:
|
||||
wxLogDebug( wxT( "BOARD::GetVisibleElementColor(): bad arg %d" ), aLayerId );
|
||||
}
|
||||
|
||||
return color;
|
||||
}
|
||||
|
||||
|
||||
void BOARD::SetVisibleElementColor( GAL_LAYER_ID aLayerId, COLOR4D aColor )
|
||||
{
|
||||
switch( aLayerId )
|
||||
{
|
||||
case LAYER_NON_PLATED:
|
||||
case LAYER_VIA_THROUGH:
|
||||
case LAYER_VIA_MICROVIA:
|
||||
case LAYER_VIA_BBLIND:
|
||||
case LAYER_MOD_TEXT_FR:
|
||||
case LAYER_MOD_TEXT_BK:
|
||||
case LAYER_MOD_TEXT_INVISIBLE:
|
||||
case LAYER_ANCHOR:
|
||||
case LAYER_PAD_FR:
|
||||
case LAYER_PAD_BK:
|
||||
case LAYER_GRID:
|
||||
case LAYER_RATSNEST:
|
||||
GetColorsSettings()->SetItemColor( aLayerId, aColor );
|
||||
break;
|
||||
|
||||
default:
|
||||
wxLogDebug( wxT( "BOARD::SetVisibleElementColor(): bad arg %d" ), aLayerId );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void BOARD::SetLayerColor( PCB_LAYER_ID aLayer, COLOR4D aColor )
|
||||
{
|
||||
GetColorsSettings()->SetLayerColor( aLayer, aColor );
|
||||
}
|
||||
|
||||
|
||||
COLOR4D BOARD::GetLayerColor( PCB_LAYER_ID aLayer ) const
|
||||
{
|
||||
return GetColorsSettings()->GetLayerColor( aLayer );
|
||||
}
|
||||
|
||||
|
||||
bool BOARD::IsModuleLayerVisible( PCB_LAYER_ID layer )
|
||||
{
|
||||
switch( layer )
|
||||
|
|
|
@ -517,15 +517,6 @@ public:
|
|||
*/
|
||||
bool IsModuleLayerVisible( PCB_LAYER_ID layer );
|
||||
|
||||
/**
|
||||
* Function GetVisibleElementColor
|
||||
* returns the color of a pcb visible element.
|
||||
* @see enum GAL_LAYER_ID
|
||||
*/
|
||||
COLOR4D GetVisibleElementColor( GAL_LAYER_ID LAYER_aPCB );
|
||||
|
||||
void SetVisibleElementColor( GAL_LAYER_ID LAYER_aPCB, COLOR4D aColor );
|
||||
|
||||
/**
|
||||
* Function GetDesignSettings
|
||||
* @return the BOARD_DESIGN_SETTINGS for this BOARD
|
||||
|
@ -561,7 +552,7 @@ public:
|
|||
* Function GetColorSettings
|
||||
* @return the current COLORS_DESIGN_SETTINGS in use
|
||||
*/
|
||||
COLORS_DESIGN_SETTINGS* GetColorsSettings() const { return m_colorsSettings; }
|
||||
const COLORS_DESIGN_SETTINGS& Colors() const { return *m_colorsSettings; }
|
||||
|
||||
/**
|
||||
* Function SetColorsSettings
|
||||
|
@ -571,7 +562,6 @@ public:
|
|||
{
|
||||
m_colorsSettings = aColorsSettings;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function GetBoardPolygonOutlines
|
||||
* Extracts the board outlines and build a closed polygon
|
||||
|
@ -682,18 +672,6 @@ public:
|
|||
*/
|
||||
bool SetLayerType( PCB_LAYER_ID aLayer, LAYER_T aLayerType );
|
||||
|
||||
/**
|
||||
* Function SetLayerColor
|
||||
* changes a layer color for any valid layer, including non-copper ones.
|
||||
*/
|
||||
void SetLayerColor( PCB_LAYER_ID aLayer, COLOR4D aColor );
|
||||
|
||||
/**
|
||||
* Function GetLayerColor
|
||||
* gets a layer color for any valid layer, including non-copper ones.
|
||||
*/
|
||||
COLOR4D GetLayerColor( PCB_LAYER_ID aLayer ) const;
|
||||
|
||||
/** Functions to get some items count */
|
||||
int GetNumSegmTrack() const;
|
||||
|
||||
|
|
|
@ -34,10 +34,10 @@
|
|||
#include <trigo.h>
|
||||
#include <wxstruct.h>
|
||||
#include <class_drawpanel.h>
|
||||
#include <colors_selection.h>
|
||||
#include <kicad_string.h>
|
||||
#include <richio.h>
|
||||
#include <bitmaps.h>
|
||||
#include <wxPcbStruct.h>
|
||||
|
||||
#include <class_board.h>
|
||||
#include <class_pcb_text.h>
|
||||
|
@ -316,7 +316,6 @@ void DIMENSION::AdjustDimensionDetails( bool aDoNotChangeText )
|
|||
void DIMENSION::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, GR_DRAWMODE mode_color,
|
||||
const wxPoint& offset )
|
||||
{
|
||||
COLOR4D gcolor;
|
||||
BOARD* brd = GetBoard();
|
||||
|
||||
if( brd->IsLayerVisible( m_Layer ) == false )
|
||||
|
@ -324,7 +323,8 @@ void DIMENSION::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, GR_DRAWMODE mode_color,
|
|||
|
||||
m_Text.Draw( panel, DC, mode_color, offset );
|
||||
|
||||
gcolor = brd->GetLayerColor( m_Layer );
|
||||
auto frame = static_cast<PCB_EDIT_FRAME*> ( panel->GetParent() );
|
||||
auto gcolor = frame->Settings().Colors().GetLayerColor( m_Layer );
|
||||
|
||||
GRSetDrawMode( DC, mode_color );
|
||||
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)panel->GetDisplayOptions();
|
||||
|
|
|
@ -36,11 +36,12 @@
|
|||
#include <bezier_curves.h>
|
||||
#include <class_drawpanel.h>
|
||||
#include <class_pcb_screen.h>
|
||||
#include <colors_selection.h>
|
||||
#include <trigo.h>
|
||||
#include <msgpanel.h>
|
||||
#include <bitmaps.h>
|
||||
|
||||
#include <wxPcbStruct.h>
|
||||
|
||||
#include <pcbnew.h>
|
||||
|
||||
#include <class_board.h>
|
||||
|
@ -206,14 +207,14 @@ void DRAWSEGMENT::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, GR_DRAWMODE draw_mode,
|
|||
int radius;
|
||||
|
||||
PCB_LAYER_ID curr_layer = ( (PCB_SCREEN*) panel->GetScreen() )->m_Active_Layer;
|
||||
COLOR4D color;
|
||||
|
||||
BOARD * brd = GetBoard( );
|
||||
|
||||
if( brd->IsLayerVisible( GetLayer() ) == false )
|
||||
return;
|
||||
|
||||
color = brd->GetLayerColor( GetLayer() );
|
||||
auto frame = static_cast<PCB_EDIT_FRAME*> ( panel->GetParent() );
|
||||
auto color = frame->Settings().Colors().GetLayerColor( GetLayer() );
|
||||
|
||||
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)panel->GetDisplayOptions();
|
||||
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
#include <class_pcb_screen.h>
|
||||
#include <confirm.h>
|
||||
#include <kicad_string.h>
|
||||
#include <colors_selection.h>
|
||||
#include <richio.h>
|
||||
#include <macros.h>
|
||||
#include <math_for_graphics.h>
|
||||
|
@ -46,6 +45,7 @@
|
|||
#include <base_units.h>
|
||||
#include <bitmaps.h>
|
||||
|
||||
#include <wxPcbStruct.h>
|
||||
#include <class_board.h>
|
||||
#include <class_module.h>
|
||||
#include <class_edge_mod.h>
|
||||
|
@ -119,7 +119,10 @@ void EDGE_MODULE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, GR_DRAWMODE draw_mode,
|
|||
if( brd->IsLayerVisible( m_Layer ) == false )
|
||||
return;
|
||||
|
||||
COLOR4D color = brd->GetLayerColor( m_Layer );
|
||||
|
||||
auto frame = static_cast<PCB_BASE_FRAME*> ( panel->GetParent() );
|
||||
auto color = frame->Settings().Colors().GetLayerColor( m_Layer );
|
||||
|
||||
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)panel->GetDisplayOptions();
|
||||
|
||||
if(( draw_mode & GR_ALLOW_HIGHCONTRAST ) && displ_opts && displ_opts->m_ContrastModeDisplay )
|
||||
|
|
|
@ -34,11 +34,11 @@
|
|||
#include <common.h>
|
||||
#include <class_drawpanel.h>
|
||||
#include <kicad_string.h>
|
||||
#include <colors_selection.h>
|
||||
#include <trigo.h>
|
||||
#include <macros.h>
|
||||
#include <richio.h>
|
||||
#include <bitmaps.h>
|
||||
#include <wxPcbStruct.h>
|
||||
|
||||
#include <class_board.h>
|
||||
#include <class_mire.h>
|
||||
|
@ -89,7 +89,8 @@ void PCB_TARGET::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, GR_DRAWMODE mode_color,
|
|||
if( brd->IsLayerVisible( m_Layer ) == false )
|
||||
return;
|
||||
|
||||
COLOR4D gcolor = brd->GetLayerColor( m_Layer );
|
||||
auto frame = static_cast<PCB_EDIT_FRAME*> ( panel->GetParent() );
|
||||
auto gcolor = frame->Settings().Colors().GetLayerColor( m_Layer );
|
||||
|
||||
GRSetDrawMode( DC, mode_color );
|
||||
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)panel->GetDisplayOptions();
|
||||
|
|
|
@ -38,13 +38,13 @@
|
|||
#include <confirm.h>
|
||||
#include <kicad_string.h>
|
||||
#include <pcbnew.h>
|
||||
#include <colors_selection.h>
|
||||
#include <richio.h>
|
||||
#include <filter_reader.h>
|
||||
#include <macros.h>
|
||||
#include <msgpanel.h>
|
||||
#include <bitmaps.h>
|
||||
|
||||
#include <wxPcbStruct.h>
|
||||
#include <class_board.h>
|
||||
#include <class_edge_mod.h>
|
||||
#include <class_module.h>
|
||||
|
@ -237,13 +237,15 @@ void MODULE::ClearAllNets()
|
|||
void MODULE::DrawAncre( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& offset,
|
||||
int dim_ancre, GR_DRAWMODE draw_mode )
|
||||
{
|
||||
auto frame = (PCB_EDIT_FRAME*) panel->GetParent();
|
||||
|
||||
GRSetDrawMode( DC, draw_mode );
|
||||
|
||||
if( GetBoard()->IsElementVisible( LAYER_ANCHOR ) )
|
||||
{
|
||||
GRDrawAnchor( panel->GetClipBox(), DC, m_Pos.x, m_Pos.y,
|
||||
dim_ancre,
|
||||
g_ColorsSettings.GetItemColor( LAYER_ANCHOR ) );
|
||||
frame->Settings().Colors().GetItemColor( LAYER_ANCHOR ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
#include <common.h>
|
||||
#include <kicad_string.h>
|
||||
#include <pcbnew.h>
|
||||
#include <colors_selection.h>
|
||||
#include <richio.h>
|
||||
#include <macros.h>
|
||||
#include <msgpanel.h>
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include <drawtxt.h>
|
||||
#include <layers_id_colors_and_visibility.h>
|
||||
#include <wxBasePcbFrame.h>
|
||||
#include <wxPcbStruct.h>
|
||||
#include <pcbnew_id.h> // ID_TRACK_BUTT
|
||||
#include <pcbnew.h>
|
||||
#include <class_board.h>
|
||||
|
@ -102,6 +103,10 @@ void D_PAD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, GR_DRAWMODE aDraw_mode,
|
|||
*/
|
||||
|
||||
BOARD* brd = GetBoard();
|
||||
|
||||
auto frame = static_cast<PCB_EDIT_FRAME*> ( aPanel->GetParent() );
|
||||
const auto& cds = frame->Settings().Colors();
|
||||
|
||||
bool frontVisible = brd->IsElementVisible( LAYER_PAD_FR );
|
||||
bool backVisible = brd->IsElementVisible( LAYER_PAD_BK );
|
||||
|
||||
|
@ -118,7 +123,6 @@ void D_PAD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, GR_DRAWMODE aDraw_mode,
|
|||
if( !backVisible && !( m_layerMask & LSET::FrontMask() ).any() )
|
||||
return;
|
||||
|
||||
PCB_BASE_FRAME* frame = (PCB_BASE_FRAME*) aPanel->GetParent();
|
||||
|
||||
wxCHECK_RET( frame != NULL, wxT( "Panel has no parent frame window." ) );
|
||||
|
||||
|
@ -134,12 +138,12 @@ void D_PAD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, GR_DRAWMODE aDraw_mode,
|
|||
|
||||
if( m_layerMask[F_Cu] )
|
||||
{
|
||||
color = brd->GetVisibleElementColor( LAYER_PAD_FR );
|
||||
color = cds.GetItemColor( LAYER_PAD_FR );
|
||||
}
|
||||
|
||||
if( m_layerMask[B_Cu] )
|
||||
{
|
||||
color = color.LegacyMix( brd->GetVisibleElementColor( LAYER_PAD_BK ) );
|
||||
color = color.LegacyMix( cds.GetItemColor( LAYER_PAD_BK ) );
|
||||
}
|
||||
|
||||
if( color == BLACK ) // Not on a visible copper layer (i.e. still nothing to show)
|
||||
|
@ -162,7 +166,7 @@ void D_PAD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, GR_DRAWMODE aDraw_mode,
|
|||
break;
|
||||
|
||||
default:
|
||||
color = brd->GetLayerColor( pad_layer );
|
||||
color = cds.GetLayerColor( pad_layer );
|
||||
#ifdef SHOW_PADMASK_REAL_SIZE_AND_COLOR
|
||||
showActualMaskSize = pad_layer;
|
||||
#endif
|
||||
|
@ -240,7 +244,7 @@ void D_PAD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, GR_DRAWMODE aDraw_mode,
|
|||
{
|
||||
if( IsOnLayer( screen->m_Active_Layer ) )
|
||||
{
|
||||
color = brd->GetLayerColor( screen->m_Active_Layer );
|
||||
color = cds.GetLayerColor( screen->m_Active_Layer );
|
||||
|
||||
// In high contrast mode, and if the active layer is the mask
|
||||
// layer shows the pad size with the mask clearance
|
||||
|
@ -276,7 +280,7 @@ void D_PAD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, GR_DRAWMODE aDraw_mode,
|
|||
brd->IsElementVisible( LAYER_NON_PLATED ) )
|
||||
{
|
||||
drawInfo.m_ShowNotPlatedHole = true;
|
||||
drawInfo.m_NPHoleColor = brd->GetVisibleElementColor( LAYER_NON_PLATED );
|
||||
drawInfo.m_NPHoleColor = cds.GetItemColor( LAYER_NON_PLATED );
|
||||
}
|
||||
|
||||
drawInfo.m_DrawMode = aDraw_mode;
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
#include <pcbnew.h>
|
||||
#include <wxPcbStruct.h>
|
||||
#include <class_board_design_settings.h>
|
||||
#include <colors_selection.h>
|
||||
#include <layers_id_colors_and_visibility.h>
|
||||
|
||||
#include <class_board.h>
|
||||
|
@ -149,10 +148,8 @@ LSET PCB_LAYER_BOX_SELECTOR::getEnabledLayers() const
|
|||
COLOR4D PCB_LAYER_BOX_SELECTOR::GetLayerColor( LAYER_NUM aLayer ) const
|
||||
{
|
||||
wxASSERT( m_boardFrame );
|
||||
BOARD* board = m_boardFrame->GetBoard();
|
||||
wxASSERT( board );
|
||||
|
||||
return board->GetLayerColor( ToLAYER_ID( aLayer ) );
|
||||
return m_boardFrame->Settings().Colors().GetLayerColor( ToLAYER_ID( aLayer ) );
|
||||
}
|
||||
|
||||
|
||||
|
@ -165,4 +162,3 @@ wxString PCB_LAYER_BOX_SELECTOR::GetLayerName( LAYER_NUM aLayer ) const
|
|||
|
||||
return board->GetLayerName( ToLAYER_ID( aLayer ) );
|
||||
}
|
||||
|
||||
|
|
|
@ -78,6 +78,10 @@ const LAYER_WIDGET::ROW PCB_LAYER_WIDGET::s_render_rows[] = {
|
|||
RR( _( "Footprints Back" ), LAYER_MOD_BK, COLOR4D::UNSPECIFIED, _( "Show footprints that are on board's back") ),
|
||||
RR( _( "Values" ), LAYER_MOD_VALUES, COLOR4D::UNSPECIFIED, _( "Show footprint's values") ),
|
||||
RR( _( "References" ), LAYER_MOD_REFERENCES, COLOR4D::UNSPECIFIED, _( "Show footprint's references") ),
|
||||
RR( _( "Worksheet" ), LAYER_WORKSHEET, DARKRED, _( "Show worksheet") ),
|
||||
RR( _( "Cursor" ), LAYER_CURSOR, WHITE, _( "PCB Cursor" ), true, false ),
|
||||
RR( _( "Aux items" ), LAYER_AUX_ITEMS, WHITE, _( "Auxillary items (rulers, assistants, axes, etc.)" ), true, false ),
|
||||
RR( _( "Background" ), LAYER_PCB_BACKGROUND, BLACK, _( "PCB Background" ), true, false )
|
||||
};
|
||||
|
||||
static int s_allowed_in_FpEditor[] =
|
||||
|
@ -398,7 +402,7 @@ void PCB_LAYER_WIDGET::ReFillRender()
|
|||
if( renderRow.color != COLOR4D::UNSPECIFIED ) // does this row show a color?
|
||||
{
|
||||
// this window frame must have an established BOARD, i.e. after SetBoard()
|
||||
renderRow.color = board->GetVisibleElementColor( static_cast<GAL_LAYER_ID>( renderRow.id ) );
|
||||
renderRow.color = myframe->Settings().Colors().GetItemColor( static_cast<GAL_LAYER_ID>( renderRow.id ) );
|
||||
}
|
||||
|
||||
renderRow.state = board->IsElementVisible( static_cast<GAL_LAYER_ID>( renderRow.id ) );
|
||||
|
@ -475,7 +479,7 @@ void PCB_LAYER_WIDGET::ReFill()
|
|||
}
|
||||
|
||||
AppendLayerRow( LAYER_WIDGET::ROW(
|
||||
brd->GetLayerName( layer ), layer, brd->GetLayerColor( layer ),
|
||||
brd->GetLayerName( layer ), layer, myframe->Settings().Colors().GetLayerColor( layer ),
|
||||
dsc, true ) );
|
||||
|
||||
if( m_fp_editor_mode && !isLayerAllowedInFpMode( layer ) )
|
||||
|
@ -522,7 +526,7 @@ void PCB_LAYER_WIDGET::ReFill()
|
|||
continue;
|
||||
|
||||
AppendLayerRow( LAYER_WIDGET::ROW(
|
||||
brd->GetLayerName( layer ), layer, brd->GetLayerColor( layer ),
|
||||
brd->GetLayerName( layer ), layer, myframe->Settings().Colors().GetLayerColor( layer ),
|
||||
wxGetTranslation( non_cu_seq[i].tooltip ), true ) );
|
||||
|
||||
if( m_fp_editor_mode && !isLayerAllowedInFpMode( layer ) )
|
||||
|
@ -546,16 +550,16 @@ void PCB_LAYER_WIDGET::OnLayerColorChange( int aLayer, COLOR4D aColor )
|
|||
// destroys the GAL color setup
|
||||
if( !myframe->IsGalCanvasActive() )
|
||||
{
|
||||
COLOR4D oldColor = myframe->GetBoard()->GetLayerColor( ToLAYER_ID( aLayer ) );
|
||||
COLOR4D oldColor = myframe->Settings().Colors().GetLayerColor( ToLAYER_ID( aLayer ) );
|
||||
aColor.a = oldColor.a;
|
||||
}
|
||||
|
||||
myframe->GetBoard()->SetLayerColor( ToLAYER_ID( aLayer ), aColor );
|
||||
myframe->Settings().Colors().SetLayerColor( ToLAYER_ID( aLayer ), aColor );
|
||||
|
||||
if( myframe->IsGalCanvasActive() )
|
||||
{
|
||||
KIGFX::VIEW* view = myframe->GetGalCanvas()->GetView();
|
||||
view->GetPainter()->GetSettings()->ImportLegacyColors( myframe->GetBoard()->GetColorsSettings() );
|
||||
view->GetPainter()->GetSettings()->ImportLegacyColors( &myframe->Settings().Colors() );
|
||||
view->UpdateLayerColor( aLayer );
|
||||
view->UpdateLayerColor( GetNetnameLayer( aLayer ) );
|
||||
}
|
||||
|
@ -624,15 +628,14 @@ void PCB_LAYER_WIDGET::OnRenderColorChange( int aId, COLOR4D aColor )
|
|||
{
|
||||
wxASSERT( aId > GAL_LAYER_ID_START && aId < GAL_LAYER_ID_END );
|
||||
|
||||
BOARD* brd = myframe->GetBoard();
|
||||
brd->SetVisibleElementColor( static_cast<GAL_LAYER_ID>( aId ), aColor );
|
||||
myframe->Settings().Colors().SetItemColor( static_cast<GAL_LAYER_ID>( aId ), aColor );
|
||||
|
||||
EDA_DRAW_PANEL_GAL* galCanvas = myframe->GetGalCanvas();
|
||||
|
||||
if( galCanvas && myframe->IsGalCanvasActive() )
|
||||
{
|
||||
KIGFX::VIEW* view = galCanvas->GetView();
|
||||
view->GetPainter()->GetSettings()->ImportLegacyColors( brd->GetColorsSettings() );
|
||||
view->GetPainter()->GetSettings()->ImportLegacyColors( &myframe->Settings().Colors() );
|
||||
view->MarkTargetDirty( KIGFX::TARGET_NONCACHED ); // useful to update rastnest
|
||||
view->UpdateLayerColor( aId );
|
||||
galCanvas->Refresh();
|
||||
|
|
|
@ -35,11 +35,10 @@
|
|||
#include <drawtxt.h>
|
||||
#include <kicad_string.h>
|
||||
#include <trigo.h>
|
||||
#include <colors_selection.h>
|
||||
#include <richio.h>
|
||||
#include <class_drawpanel.h>
|
||||
#include <macros.h>
|
||||
#include <wxBasePcbFrame.h>
|
||||
#include <wxPcbStruct.h>
|
||||
#include <msgpanel.h>
|
||||
#include <base_units.h>
|
||||
#include <bitmaps.h>
|
||||
|
@ -75,7 +74,8 @@ void TEXTE_PCB::Draw( EDA_DRAW_PANEL* panel, wxDC* DC,
|
|||
if( brd->IsLayerVisible( m_Layer ) == false )
|
||||
return;
|
||||
|
||||
COLOR4D color = brd->GetLayerColor( m_Layer );
|
||||
auto frame = static_cast<PCB_EDIT_FRAME*> ( panel->GetParent() );
|
||||
auto color = frame->Settings().Colors().GetLayerColor( m_Layer );
|
||||
|
||||
EDA_DRAW_MODE_T fillmode = FILLED;
|
||||
DISPLAY_OPTIONS* displ_opts =
|
||||
|
@ -96,7 +96,7 @@ void TEXTE_PCB::Draw( EDA_DRAW_PANEL* panel, wxDC* DC,
|
|||
COLOR4D anchor_color = COLOR4D::UNSPECIFIED;
|
||||
|
||||
if( brd->IsElementVisible( LAYER_ANCHOR ) )
|
||||
anchor_color = brd->GetVisibleElementColor( LAYER_ANCHOR );
|
||||
anchor_color = frame->Settings().Colors().GetItemColor( LAYER_ANCHOR );
|
||||
|
||||
EDA_RECT* clipbox = panel? panel->GetClipBox() : NULL;
|
||||
EDA_TEXT::Draw( clipbox, DC, offset, color,
|
||||
|
|
|
@ -35,10 +35,9 @@
|
|||
#include <class_drawpanel.h>
|
||||
#include <drawtxt.h>
|
||||
#include <kicad_string.h>
|
||||
#include <colors_selection.h>
|
||||
#include <richio.h>
|
||||
#include <macros.h>
|
||||
#include <wxBasePcbFrame.h>
|
||||
#include <wxPcbStruct.h>
|
||||
#include <msgpanel.h>
|
||||
#include <base_units.h>
|
||||
#include <bitmaps.h>
|
||||
|
@ -234,7 +233,10 @@ void TEXTE_MODULE::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, GR_DRAWMODE aDrawMod
|
|||
wxASSERT( m_Parent );
|
||||
|
||||
BOARD* brd = GetBoard( );
|
||||
COLOR4D color = brd->GetLayerColor( GetLayer() );
|
||||
|
||||
auto frame = static_cast<PCB_BASE_FRAME*> ( aPanel->GetParent() );
|
||||
auto color = frame->Settings().Colors().GetLayerColor( GetLayer() );
|
||||
|
||||
PCB_LAYER_ID text_layer = GetLayer();
|
||||
|
||||
if( !brd->IsLayerVisible( m_Layer )
|
||||
|
@ -249,7 +251,7 @@ void TEXTE_MODULE::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, GR_DRAWMODE aDrawMod
|
|||
if( !brd->IsElementVisible( LAYER_MOD_TEXT_INVISIBLE ) )
|
||||
return;
|
||||
|
||||
color = brd->GetVisibleElementColor( LAYER_MOD_TEXT_INVISIBLE );
|
||||
color = frame->Settings().Colors().GetItemColor( LAYER_MOD_TEXT_INVISIBLE );
|
||||
}
|
||||
|
||||
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)aPanel->GetDisplayOptions();
|
||||
|
@ -275,7 +277,7 @@ void TEXTE_MODULE::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, GR_DRAWMODE aDrawMod
|
|||
// Draw the text anchor point
|
||||
if( brd->IsElementVisible( LAYER_ANCHOR ) )
|
||||
{
|
||||
COLOR4D anchor_color = brd->GetVisibleElementColor( LAYER_ANCHOR );
|
||||
COLOR4D anchor_color = frame->Settings().Colors().GetItemColor( LAYER_ANCHOR );
|
||||
GRDrawAnchor( aPanel->GetClipBox(), aDC, pos.x, pos.y, DIM_ANCRE_TEXTE, anchor_color );
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
#include <class_drawpanel.h>
|
||||
#include <class_pcb_screen.h>
|
||||
#include <drawtxt.h>
|
||||
#include <colors_selection.h>
|
||||
#include <wxstruct.h>
|
||||
#include <wxBasePcbFrame.h>
|
||||
#include <class_board.h>
|
||||
|
@ -637,7 +636,9 @@ void TRACK::Draw( EDA_DRAW_PANEL* panel, wxDC* aDC, GR_DRAWMODE aDrawMode,
|
|||
const wxPoint& aOffset )
|
||||
{
|
||||
BOARD* brd = GetBoard();
|
||||
COLOR4D color = brd->GetLayerColor( m_Layer );
|
||||
|
||||
auto frame = static_cast<PCB_BASE_FRAME*> ( panel->GetParent() );
|
||||
auto color = frame->Settings().Colors().GetLayerColor( m_Layer );
|
||||
|
||||
if( brd->IsLayerVisible( m_Layer ) == false && !( aDrawMode & GR_HIGHLIGHT ) )
|
||||
return;
|
||||
|
@ -706,7 +707,9 @@ void SEGZONE::Draw( EDA_DRAW_PANEL* panel, wxDC* aDC, GR_DRAWMODE aDrawMode,
|
|||
return;
|
||||
|
||||
BOARD* brd = GetBoard();
|
||||
COLOR4D color = brd->GetLayerColor( m_Layer );
|
||||
|
||||
auto frame = static_cast<PCB_BASE_FRAME*> ( panel->GetParent() );
|
||||
auto color = frame->Settings().Colors().GetLayerColor( m_Layer );
|
||||
|
||||
if( brd->IsLayerVisible( m_Layer ) == false && !( aDrawMode & GR_HIGHLIGHT ) )
|
||||
return;
|
||||
|
@ -794,7 +797,7 @@ void VIA::Draw( EDA_DRAW_PANEL* panel, wxDC* aDC, GR_DRAWMODE aDrawMode, const w
|
|||
GRSetDrawMode( aDC, aDrawMode );
|
||||
|
||||
BOARD * brd = GetBoard();
|
||||
COLOR4D color = brd->GetVisibleElementColor( LAYER_VIAS + GetViaType() );
|
||||
COLOR4D color = frame->Settings().Colors().GetItemColor( LAYER_VIAS + GetViaType() );
|
||||
|
||||
if( brd->IsElementVisible( LAYER_VIAS + GetViaType() ) == false
|
||||
&& !( aDrawMode & GR_HIGHLIGHT ) )
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
#include <class_pcb_screen.h>
|
||||
#include <class_drawpanel.h>
|
||||
#include <kicad_string.h>
|
||||
#include <colors_selection.h>
|
||||
#include <richio.h>
|
||||
#include <macros.h>
|
||||
#include <wxBasePcbFrame.h>
|
||||
|
@ -187,7 +186,9 @@ void ZONE_CONTAINER::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, GR_DRAWMODE aDrawMod
|
|||
PCB_LAYER_ID curr_layer = ( (PCB_SCREEN*) panel->GetScreen() )->m_Active_Layer;
|
||||
BOARD* brd = GetBoard();
|
||||
|
||||
COLOR4D color = brd->GetLayerColor( m_Layer );
|
||||
auto frame = static_cast<PCB_BASE_FRAME*> ( panel->GetParent() );
|
||||
|
||||
auto color = frame->Settings().Colors().GetLayerColor( m_Layer );
|
||||
|
||||
if( brd->IsLayerVisible( m_Layer ) == false && !( aDrawMode & GR_HIGHLIGHT ) )
|
||||
return;
|
||||
|
@ -259,7 +260,9 @@ void ZONE_CONTAINER::DrawFilledArea( EDA_DRAW_PANEL* panel,
|
|||
|
||||
BOARD* brd = GetBoard();
|
||||
PCB_LAYER_ID curr_layer = ( (PCB_SCREEN*) panel->GetScreen() )->m_Active_Layer;
|
||||
COLOR4D color = brd->GetLayerColor( m_Layer );
|
||||
|
||||
auto frame = static_cast<PCB_BASE_FRAME*> ( panel->GetParent() );
|
||||
auto color = frame->Settings().Colors().GetLayerColor( m_Layer );
|
||||
|
||||
if( brd->IsLayerVisible( m_Layer ) == false && !( aDrawMode & GR_HIGHLIGHT ) )
|
||||
return;
|
||||
|
@ -385,7 +388,10 @@ void ZONE_CONTAINER::DrawWhileCreateOutline( EDA_DRAW_PANEL* panel, wxDC* DC,
|
|||
|
||||
PCB_LAYER_ID curr_layer = ( (PCB_SCREEN*) panel->GetScreen() )->m_Active_Layer;
|
||||
BOARD* brd = GetBoard();
|
||||
COLOR4D color = brd->GetLayerColor( m_Layer );
|
||||
|
||||
auto frame = static_cast<PCB_BASE_FRAME*> ( panel->GetParent() );
|
||||
auto color = frame->Settings().Colors().GetLayerColor( m_Layer );
|
||||
|
||||
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)panel->GetDisplayOptions();
|
||||
|
||||
if( displ_opts->m_ContrastModeDisplay )
|
||||
|
|
|
@ -325,7 +325,7 @@ bool PCB_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, EDA_KE
|
|||
{
|
||||
// If there's no intrusion and DRC is active, we pass the cursor
|
||||
// "as is", and let ShowNewTrackWhenMovingCursor figure out what to do.
|
||||
if( !g_Drc_On || !g_CurrentTrackSegment ||
|
||||
if( !Settings().m_legacyDrcOn || !g_CurrentTrackSegment ||
|
||||
(BOARD_ITEM*)g_CurrentTrackSegment != this->GetCurItem() ||
|
||||
!LocateIntrusion( m_Pcb->m_Track, g_CurrentTrackSegment,
|
||||
GetScreen()->m_Active_Layer, RefPos( true ) ) )
|
||||
|
|
|
@ -61,7 +61,7 @@ TRACK* PCB_EDIT_FRAME::Delete_Segment( wxDC* DC, TRACK* aTrack )
|
|||
// delete the most recently entered
|
||||
delete g_CurrentTrackList.PopBack();
|
||||
|
||||
if( g_TwoSegmentTrackBuild )
|
||||
if( Settings().m_legacyUseTwoSegmentTracks )
|
||||
{
|
||||
// if in 2 track mode, and the next most recent is a segment
|
||||
// not a via, and the one previous to that is a via, then
|
||||
|
@ -88,7 +88,7 @@ TRACK* PCB_EDIT_FRAME::Delete_Segment( wxDC* DC, TRACK* aTrack )
|
|||
|
||||
UpdateStatusBar();
|
||||
|
||||
if( g_TwoSegmentTrackBuild ) // We must have 2 segments or more, or 0
|
||||
if( Settings().m_legacyUseTwoSegmentTracks ) // We must have 2 segments or more, or 0
|
||||
{
|
||||
if( g_CurrentTrackList.GetCount() == 1
|
||||
&& g_CurrentTrackSegment->Type() != PCB_VIA_T )
|
||||
|
|
|
@ -253,7 +253,7 @@ void DIALOG_COPPER_ZONE::initDialog()
|
|||
|
||||
msg.Trim();
|
||||
|
||||
COLOR4D layerColor = board->GetLayerColor( layer );
|
||||
COLOR4D layerColor = m_Parent->Settings().Colors().GetLayerColor( layer );
|
||||
|
||||
imageList->Add( makeLayerBitmap( layerColor ) );
|
||||
|
||||
|
|
|
@ -72,19 +72,19 @@ void DIALOG_GENERALOPTIONS::init()
|
|||
wxString timevalue;
|
||||
timevalue << GetParent()->GetAutoSaveInterval() / 60;
|
||||
m_SaveTime->SetValue( timevalue );
|
||||
m_MaxShowLinks->SetValue( displ_opts->m_MaxLinksShowed );
|
||||
|
||||
m_DrcOn->SetValue( g_Drc_On );
|
||||
m_DrcOn->SetValue( GetParent()->Settings().m_legacyDrcOn );
|
||||
m_ShowGlobalRatsnest->SetValue( m_Board->IsElementVisible( LAYER_RATSNEST ) );
|
||||
m_TrackAutodel->SetValue( g_AutoDeleteOldTrack );
|
||||
m_Track_45_Only_Ctrl->SetValue( g_Track_45_Only_Allowed );
|
||||
m_Segments_45_Only_Ctrl->SetValue( g_Segments_45_Only );
|
||||
m_TrackAutodel->SetValue( GetParent()->Settings().m_legacyAutoDeleteOldTrack );
|
||||
m_Track_45_Only_Ctrl->SetValue( GetParent()->Settings().m_legacyUse45DegreeTracks );
|
||||
m_Segments_45_Only_Ctrl->SetValue( GetParent()->Settings().m_use45DegreeGraphicSegments );
|
||||
m_ZoomCenterOpt->SetValue( ! GetParent()->GetCanvas()->GetEnableZoomNoCenter() );
|
||||
m_MousewheelPANOpt->SetValue( GetParent()->GetCanvas()->GetEnableMousewheelPan() );
|
||||
m_AutoPANOpt->SetValue( GetParent()->GetCanvas()->GetEnableAutoPan() );
|
||||
m_Track_DoubleSegm_Ctrl->SetValue( g_TwoSegmentTrackBuild );
|
||||
m_MagneticPadOptCtrl->SetSelection( g_MagneticPadOption );
|
||||
m_MagneticTrackOptCtrl->SetSelection( g_MagneticTrackOption );
|
||||
m_Track_DoubleSegm_Ctrl->SetValue( GetParent()->Settings().m_legacyUseTwoSegmentTracks );
|
||||
m_MagneticPadOptCtrl->SetSelection( GetParent()->Settings().m_magneticPads );
|
||||
m_MagneticTrackOptCtrl->SetSelection( GetParent()->Settings().m_magneticTracks );
|
||||
m_UseEditKeyForWidth->SetValue( GetParent()->Settings().m_editActionChangesTrackWidth );
|
||||
}
|
||||
|
||||
|
||||
|
@ -110,8 +110,7 @@ void DIALOG_GENERALOPTIONS::OnOkClick( wxCommandEvent& event )
|
|||
GetParent()->SetRotationAngle( wxRound( 10.0 * wxAtof( m_RotationAngle->GetValue() ) ) );
|
||||
|
||||
/* Updating the combobox to display the active layer. */
|
||||
displ_opts->m_MaxLinksShowed = m_MaxShowLinks->GetValue();
|
||||
g_Drc_On = m_DrcOn->GetValue();
|
||||
GetParent()->Settings().m_legacyDrcOn = m_DrcOn->GetValue();
|
||||
|
||||
if( m_Board->IsElementVisible( LAYER_RATSNEST ) != m_ShowGlobalRatsnest->GetValue() )
|
||||
{
|
||||
|
@ -120,17 +119,18 @@ void DIALOG_GENERALOPTIONS::OnOkClick( wxCommandEvent& event )
|
|||
GetParent()->OnModify();
|
||||
}
|
||||
|
||||
g_AutoDeleteOldTrack = m_TrackAutodel->GetValue();
|
||||
g_Segments_45_Only = m_Segments_45_Only_Ctrl->GetValue();
|
||||
g_Track_45_Only_Allowed = m_Track_45_Only_Ctrl->GetValue();
|
||||
GetParent()->Settings().m_legacyAutoDeleteOldTrack = m_TrackAutodel->GetValue();
|
||||
GetParent()->Settings().m_use45DegreeGraphicSegments = m_Segments_45_Only_Ctrl->GetValue();
|
||||
GetParent()->Settings().m_legacyUse45DegreeTracks = m_Track_45_Only_Ctrl->GetValue();
|
||||
|
||||
GetParent()->GetCanvas()->SetEnableZoomNoCenter( ! m_ZoomCenterOpt->GetValue() );
|
||||
GetParent()->GetCanvas()->SetEnableMousewheelPan( m_MousewheelPANOpt->GetValue() );
|
||||
GetParent()->GetCanvas()->SetEnableAutoPan( m_AutoPANOpt->GetValue() );
|
||||
|
||||
g_TwoSegmentTrackBuild = m_Track_DoubleSegm_Ctrl->GetValue();
|
||||
g_MagneticPadOption = m_MagneticPadOptCtrl->GetSelection();
|
||||
g_MagneticTrackOption = m_MagneticTrackOptCtrl->GetSelection();
|
||||
GetParent()->Settings().m_legacyUseTwoSegmentTracks = m_Track_DoubleSegm_Ctrl->GetValue();
|
||||
GetParent()->Settings().m_magneticPads = (MAGNETIC_PAD_OPTION_VALUES) m_MagneticPadOptCtrl->GetSelection();
|
||||
GetParent()->Settings().m_magneticTracks = (MAGNETIC_PAD_OPTION_VALUES) m_MagneticTrackOptCtrl->GetSelection();
|
||||
GetParent()->Settings().m_editActionChangesTrackWidth = m_UseEditKeyForWidth->GetValue();
|
||||
|
||||
EndModal( wxID_OK );
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Feb 6 2017)
|
||||
// C++ code generated with wxFormBuilder (version Jun 17 2015)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
|
@ -49,15 +49,6 @@ DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE::DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE(
|
|||
fgSizer1->SetFlexibleDirection( wxBOTH );
|
||||
fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
||||
|
||||
m_staticTextmaxlinks = new wxStaticText( this, wxID_ANY, _("&Maximum links:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextmaxlinks->Wrap( -1 );
|
||||
fgSizer1->Add( m_staticTextmaxlinks, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
||||
|
||||
m_MaxShowLinks = new wxSpinCtrl( this, wxID_ANY, wxT("1"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 1, 5, 1 );
|
||||
m_MaxShowLinks->SetToolTip( _("Adjust the number of ratsnets shown from cursor to closest pads.") );
|
||||
|
||||
fgSizer1->Add( m_MaxShowLinks, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxTOP, 5 );
|
||||
|
||||
m_staticTextautosave = new wxStaticText( this, wxID_ANY, _("&Auto save (minutes):"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticTextautosave->Wrap( -1 );
|
||||
fgSizer1->Add( m_staticTextautosave, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
||||
|
@ -79,43 +70,57 @@ DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE::DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE(
|
|||
|
||||
bMiddleLeftSizer->Add( fgSizer1, 0, wxEXPAND, 5 );
|
||||
|
||||
wxStaticBoxSizer* bMiddleRightBoxSizer;
|
||||
bMiddleRightBoxSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options") ), wxVERTICAL );
|
||||
wxStaticBoxSizer* bOptionsSizer;
|
||||
bOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options") ), wxVERTICAL );
|
||||
|
||||
m_DrcOn = new wxCheckBox( bMiddleRightBoxSizer->GetStaticBox(), wxID_DRC_ONOFF, _("&Enforce design rules when routing"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_DrcOn->SetValue(true);
|
||||
m_DrcOn->SetToolTip( _("Enable DRC control. When DRC control is disabled, all connections are allowed.") );
|
||||
|
||||
bMiddleRightBoxSizer->Add( m_DrcOn, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
m_ShowGlobalRatsnest = new wxCheckBox( bMiddleRightBoxSizer->GetStaticBox(), wxID_GENERAL_RATSNEST, _("&Show ratsnest"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_ShowGlobalRatsnest = new wxCheckBox( bOptionsSizer->GetStaticBox(), wxID_GENERAL_RATSNEST, _("&Show ratsnest"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_ShowGlobalRatsnest->SetValue(true);
|
||||
m_ShowGlobalRatsnest->SetToolTip( _("Show the full ratsnest.") );
|
||||
|
||||
bMiddleRightBoxSizer->Add( m_ShowGlobalRatsnest, 0, wxALL, 5 );
|
||||
bOptionsSizer->Add( m_ShowGlobalRatsnest, 0, wxALL, 5 );
|
||||
|
||||
m_TrackAutodel = new wxCheckBox( bMiddleRightBoxSizer->GetStaticBox(), wxID_TRACK_AUTODEL, _("&Delete unconnected tracks"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_TrackAutodel->SetToolTip( _("Enable automatic track deletion when redrawing a track.") );
|
||||
|
||||
bMiddleRightBoxSizer->Add( m_TrackAutodel, 0, wxALL, 5 );
|
||||
|
||||
m_Track_45_Only_Ctrl = new wxCheckBox( bMiddleRightBoxSizer->GetStaticBox(), wxID_TRACKS45, _("&Limit tracks to 45 degrees"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_Track_45_Only_Ctrl->SetToolTip( _("Force track directions to H, V or 45 degrees when drawing a track.") );
|
||||
|
||||
bMiddleRightBoxSizer->Add( m_Track_45_Only_Ctrl, 0, wxALL, 5 );
|
||||
|
||||
m_Segments_45_Only_Ctrl = new wxCheckBox( bMiddleRightBoxSizer->GetStaticBox(), wxID_SEGMENTS45, _("L&imit graphic lines to 45 degrees"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_Segments_45_Only_Ctrl = new wxCheckBox( bOptionsSizer->GetStaticBox(), wxID_SEGMENTS45, _("L&imit graphic lines to 45 degrees"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_Segments_45_Only_Ctrl->SetToolTip( _("Force line segment directions to H, V or 45 degrees when drawing on technical layers.") );
|
||||
|
||||
bMiddleRightBoxSizer->Add( m_Segments_45_Only_Ctrl, 0, wxALL, 5 );
|
||||
bOptionsSizer->Add( m_Segments_45_Only_Ctrl, 0, wxALL, 5 );
|
||||
|
||||
m_Track_DoubleSegm_Ctrl = new wxCheckBox( bMiddleRightBoxSizer->GetStaticBox(), wxID_ANY, _("&Use double segmented tracks"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_UseEditKeyForWidth = new wxCheckBox( bOptionsSizer->GetStaticBox(), wxID_ANY, _("Edit action changes track width"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_UseEditKeyForWidth->SetToolTip( _("When active, hitting Edit hotkey or double-clicking on a track or via changes its width/diameter to the one selected in the main toolbar. ") );
|
||||
|
||||
bOptionsSizer->Add( m_UseEditKeyForWidth, 0, wxALL, 5 );
|
||||
|
||||
|
||||
bMiddleLeftSizer->Add( bOptionsSizer, 1, wxEXPAND|wxALL, 5 );
|
||||
|
||||
wxStaticBoxSizer* bLegacyOptionsSizer;
|
||||
bLegacyOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Legacy Routing Options") ), wxVERTICAL );
|
||||
|
||||
m_DrcOn = new wxCheckBox( bLegacyOptionsSizer->GetStaticBox(), wxID_DRC_ONOFF, _("&Enforce design rules when routing"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_DrcOn->SetValue(true);
|
||||
m_DrcOn->SetToolTip( _("Enable DRC control. When DRC control is disabled, all connections are allowed.") );
|
||||
|
||||
bLegacyOptionsSizer->Add( m_DrcOn, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
m_TrackAutodel = new wxCheckBox( bLegacyOptionsSizer->GetStaticBox(), wxID_TRACK_AUTODEL, _("&Delete unconnected tracks"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_TrackAutodel->SetValue(true);
|
||||
m_TrackAutodel->SetToolTip( _("Enable automatic track deletion when redrawing a track.") );
|
||||
|
||||
bLegacyOptionsSizer->Add( m_TrackAutodel, 0, wxALL, 5 );
|
||||
|
||||
m_Track_45_Only_Ctrl = new wxCheckBox( bLegacyOptionsSizer->GetStaticBox(), wxID_TRACKS45, _("&Limit tracks to 45 degrees"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_Track_45_Only_Ctrl->SetValue(true);
|
||||
m_Track_45_Only_Ctrl->SetToolTip( _("Force track directions to H, V or 45 degrees when drawing a track.") );
|
||||
|
||||
bLegacyOptionsSizer->Add( m_Track_45_Only_Ctrl, 0, wxALL, 5 );
|
||||
|
||||
m_Track_DoubleSegm_Ctrl = new wxCheckBox( bLegacyOptionsSizer->GetStaticBox(), wxID_ANY, _("&Use double segmented tracks"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_Track_DoubleSegm_Ctrl->SetValue(true);
|
||||
m_Track_DoubleSegm_Ctrl->SetToolTip( _("Use two track segments, with 45 degrees angle between them, when drawing a new track ") );
|
||||
|
||||
bMiddleRightBoxSizer->Add( m_Track_DoubleSegm_Ctrl, 0, wxALL, 5 );
|
||||
bLegacyOptionsSizer->Add( m_Track_DoubleSegm_Ctrl, 0, wxALL, 5 );
|
||||
|
||||
|
||||
bMiddleLeftSizer->Add( bMiddleRightBoxSizer, 4, wxALL|wxEXPAND, 5 );
|
||||
bMiddleLeftSizer->Add( bLegacyOptionsSizer, 0, wxEXPAND|wxALL, 5 );
|
||||
|
||||
|
||||
bSizerUpper->Add( bMiddleLeftSizer, 0, wxALL|wxEXPAND, 5 );
|
||||
|
@ -126,7 +131,7 @@ DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE::DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE(
|
|||
wxString m_MagneticPadOptCtrlChoices[] = { _("Never"), _("When creating tracks"), _("Always") };
|
||||
int m_MagneticPadOptCtrlNChoices = sizeof( m_MagneticPadOptCtrlChoices ) / sizeof( wxString );
|
||||
m_MagneticPadOptCtrl = new wxRadioBox( this, wxID_ANY, _("Magnetic Pads"), wxDefaultPosition, wxDefaultSize, m_MagneticPadOptCtrlNChoices, m_MagneticPadOptCtrlChoices, 1, wxRA_SPECIFY_COLS );
|
||||
m_MagneticPadOptCtrl->SetSelection( 0 );
|
||||
m_MagneticPadOptCtrl->SetSelection( 2 );
|
||||
m_MagneticPadOptCtrl->SetToolTip( _("Control capture of the cursor when the mouse enters a pad area.") );
|
||||
|
||||
bRightSizer->Add( m_MagneticPadOptCtrl, 0, wxALL|wxEXPAND, 5 );
|
||||
|
@ -158,7 +163,7 @@ DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE::DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE(
|
|||
sbSizer2PAN->Add( m_AutoPANOpt, 0, wxALL, 5 );
|
||||
|
||||
|
||||
bRightSizer->Add( sbSizer2PAN, 1, wxEXPAND, 5 );
|
||||
bRightSizer->Add( sbSizer2PAN, 1, wxEXPAND|wxALL, 5 );
|
||||
|
||||
|
||||
bSizerUpper->Add( bRightSizer, 0, wxALL|wxEXPAND, 5 );
|
||||
|
|
|
@ -318,177 +318,6 @@
|
|||
<property name="permission">none</property>
|
||||
<property name="rows">0</property>
|
||||
<property name="vgap">0</property>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">&Maximum links:</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_staticTextmaxlinks</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL|wxTOP</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxSpinCtrl" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="initial">1</property>
|
||||
<property name="max">5</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min">1</property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_MaxShowLinks</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style">wxSP_ARROW_KEYS</property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip">Adjust the number of ratsnets shown from cursor to closest pads.</property>
|
||||
<property name="value">1</property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnSpinCtrl"></event>
|
||||
<event name="OnSpinCtrlText"></event>
|
||||
<event name="OnTextEnter"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
|
||||
|
@ -838,13 +667,291 @@
|
|||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL|wxEXPAND</property>
|
||||
<property name="proportion">4</property>
|
||||
<property name="flag">wxEXPAND|wxALL</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxStaticBoxSizer" expanded="1">
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Options</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bMiddleRightBoxSizer</property>
|
||||
<property name="name">bOptionsSizer</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<event name="OnUpdateUI"></event>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="checked">1</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_GENERAL_RATSNEST</property>
|
||||
<property name="label">&Show ratsnest</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_ShowGlobalRatsnest</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip">Show the full ratsnest.</property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCheckBox"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="checked">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_SEGMENTS45</property>
|
||||
<property name="label">L&imit graphic lines to 45 degrees</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_Segments_45_Only_Ctrl</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip">Force line segment directions to H, V or 45 degrees when drawing on technical layers.</property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCheckBox"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="checked">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Edit action changes track width</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_UseEditKeyForWidth</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip">When active, hitting Edit hotkey or double-clicking on a track or via changes its width/diameter to the one selected in the main toolbar. </property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCheckBox"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticBoxSizer" expanded="1">
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Legacy Routing Options</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bLegacyOptionsSizer</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<event name="OnUpdateUI"></event>
|
||||
|
@ -968,94 +1075,6 @@
|
|||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_GENERAL_RATSNEST</property>
|
||||
<property name="label">&Show ratsnest</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_ShowGlobalRatsnest</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip">Show the full ratsnest.</property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCheckBox"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="checked">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_TRACK_AUTODEL</property>
|
||||
<property name="label">&Delete unconnected tracks</property>
|
||||
<property name="max_size"></property>
|
||||
|
@ -1130,7 +1149,7 @@
|
|||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="checked">0</property>
|
||||
<property name="checked">1</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
|
@ -1218,95 +1237,7 @@
|
|||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="checked">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_SEGMENTS45</property>
|
||||
<property name="label">L&imit graphic lines to 45 degrees</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_Segments_45_Only_Ctrl</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip">Force line segment directions to H, V or 45 degrees when drawing on technical layers.</property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCheckBox"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="0">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="checked">0</property>
|
||||
<property name="checked">1</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
|
@ -1439,7 +1370,7 @@
|
|||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="selection">0</property>
|
||||
<property name="selection">2</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style">wxRA_SPECIFY_COLS</property>
|
||||
|
@ -1571,7 +1502,7 @@
|
|||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="flag">wxEXPAND|wxALL</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxStaticBoxSizer" expanded="1">
|
||||
<property name="id">wxID_ANY</property>
|
||||
|
@ -1847,108 +1778,6 @@
|
|||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxStaticBoxSizer" expanded="1">
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Advanced/Developer</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">sbSizer4</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<event name="OnUpdateUI"></event>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxCheckBox" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="checked">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Use legacy connectivity algorithm</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_cbUseLegacyConnectivityAlgo</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnCheckBox"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Feb 6 2017)
|
||||
// C++ code generated with wxFormBuilder (version Jun 17 2015)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
|
@ -44,28 +44,27 @@ class DIALOG_GENERALOPTIONS_BOARDEDITOR_BASE : public DIALOG_SHIM
|
|||
{
|
||||
wxID_POLAR_CTRL = 1000,
|
||||
wxID_UNITS,
|
||||
wxID_DRC_ONOFF,
|
||||
wxID_GENERAL_RATSNEST,
|
||||
wxID_SEGMENTS45,
|
||||
wxID_DRC_ONOFF,
|
||||
wxID_TRACK_AUTODEL,
|
||||
wxID_TRACKS45,
|
||||
wxID_SEGMENTS45,
|
||||
wxID_MAGNETIC_TRACKS,
|
||||
wxID_AUTOPAN
|
||||
};
|
||||
|
||||
wxRadioBox* m_PolarDisplay;
|
||||
wxRadioBox* m_UnitsSelection;
|
||||
wxStaticText* m_staticTextmaxlinks;
|
||||
wxSpinCtrl* m_MaxShowLinks;
|
||||
wxStaticText* m_staticTextautosave;
|
||||
wxSpinCtrl* m_SaveTime;
|
||||
wxStaticText* m_staticTextRotationAngle;
|
||||
wxTextCtrl* m_RotationAngle;
|
||||
wxCheckBox* m_DrcOn;
|
||||
wxCheckBox* m_ShowGlobalRatsnest;
|
||||
wxCheckBox* m_Segments_45_Only_Ctrl;
|
||||
wxCheckBox* m_UseEditKeyForWidth;
|
||||
wxCheckBox* m_DrcOn;
|
||||
wxCheckBox* m_TrackAutodel;
|
||||
wxCheckBox* m_Track_45_Only_Ctrl;
|
||||
wxCheckBox* m_Segments_45_Only_Ctrl;
|
||||
wxCheckBox* m_Track_DoubleSegm_Ctrl;
|
||||
wxRadioBox* m_MagneticPadOptCtrl;
|
||||
wxRadioBox* m_MagneticTrackOptCtrl;
|
||||
|
|
|
@ -165,7 +165,7 @@ void DIALOG_KEEPOUT_AREA_PROPERTIES::initDialog()
|
|||
|
||||
msg = board->GetLayerName( layer );
|
||||
|
||||
COLOR4D layerColor = board->GetLayerColor( layer );
|
||||
COLOR4D layerColor = m_parent->Settings().Colors().GetLayerColor( layer );
|
||||
|
||||
imageList->Add( makeLayerBitmap( layerColor ) );
|
||||
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
#include <netlist_reader.h>
|
||||
#include <reporter.h>
|
||||
|
||||
#include <pcbnew_config.h>
|
||||
#include <class_board_design_settings.h>
|
||||
#include <class_board.h>
|
||||
#include <class_module.h>
|
||||
|
|
|
@ -155,7 +155,8 @@ void DIALOG_NON_COPPER_ZONES_EDITOR::Init()
|
|||
{
|
||||
PCB_LAYER_ID layer = *seq;
|
||||
|
||||
COLOR4D layerColor = board->GetLayerColor( layer );
|
||||
COLOR4D layerColor = m_parent->Settings().Colors().GetLayerColor( layer );
|
||||
|
||||
imageList->Add( makeLayerBitmap( layerColor ) );
|
||||
|
||||
msg = board->GetLayerName( layer );
|
||||
|
|
|
@ -131,7 +131,8 @@ DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES( PCB_BASE_FRAME* aParent, D_PAD* aP
|
|||
|
||||
if( m_parent->IsGalCanvasActive() )
|
||||
{
|
||||
m_panelShowPadGal->UseColorScheme( m_board->GetColorsSettings() );
|
||||
|
||||
m_panelShowPadGal->UseColorScheme( &m_parent->Settings().Colors() );
|
||||
m_panelShowPadGal->SwitchBackend( m_parent->GetGalCanvas()->GetBackend() );
|
||||
m_panelShowPadGal->Show();
|
||||
m_panelShowPad->Hide();
|
||||
|
@ -171,12 +172,12 @@ void DIALOG_PAD_PROPERTIES::OnPaintShowPanel( wxPaintEvent& event )
|
|||
|
||||
if( m_dummyPad->GetLayerSet()[F_Cu] )
|
||||
{
|
||||
color = m_board->GetVisibleElementColor( LAYER_PAD_FR );
|
||||
color = m_parent->Settings().Colors().GetItemColor( LAYER_PAD_FR );
|
||||
}
|
||||
|
||||
if( m_dummyPad->GetLayerSet()[B_Cu] )
|
||||
{
|
||||
color = color.LegacyMix( m_board->GetVisibleElementColor( LAYER_PAD_BK ) );
|
||||
color = color.LegacyMix( m_parent->Settings().Colors().GetItemColor( LAYER_PAD_BK ) );
|
||||
}
|
||||
|
||||
// What could happen: the pad color is *actually* black, or no
|
||||
|
|
|
@ -1447,7 +1447,7 @@ void PCB_EDIT_FRAME::OnSelectTool( wxCommandEvent& aEvent )
|
|||
break;
|
||||
|
||||
case ID_TRACK_BUTT:
|
||||
if( g_Drc_On )
|
||||
if( Settings().m_legacyDrcOn )
|
||||
SetToolID( id, wxCURSOR_PENCIL, _( "Add tracks" ) );
|
||||
else
|
||||
SetToolID( id, wxCURSOR_QUESTION_ARROW, _( "Add tracks" ) );
|
||||
|
|
|
@ -119,7 +119,7 @@ bool PCB_EDIT_FRAME::SetTrackSegmentWidth( TRACK* aTrackItem,
|
|||
{
|
||||
int diagdrc = OK_DRC;
|
||||
|
||||
if( g_Drc_On )
|
||||
if( Settings().m_legacyDrcOn )
|
||||
diagdrc = m_drc->Drc( aTrackItem, GetBoard()->m_Track );
|
||||
|
||||
if( diagdrc == OK_DRC )
|
||||
|
|
|
@ -343,7 +343,7 @@ void PCB_EDIT_FRAME::End_Edge( DRAWSEGMENT* Segment, wxDC* DC )
|
|||
static void DrawSegment( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosition, bool aErase )
|
||||
{
|
||||
DRAWSEGMENT* Segment = (DRAWSEGMENT*) aPanel->GetScreen()->GetCurItem();
|
||||
|
||||
auto frame = (PCB_EDIT_FRAME*) ( aPanel->GetParent() );
|
||||
if( Segment == NULL )
|
||||
return;
|
||||
|
||||
|
@ -355,7 +355,7 @@ static void DrawSegment( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosi
|
|||
if( aErase )
|
||||
Segment->Draw( aPanel, aDC, GR_XOR );
|
||||
|
||||
if( g_Segments_45_Only && Segment->GetShape() == S_SEGMENT )
|
||||
if( frame->Settings().m_use45DegreeGraphicSegments && Segment->GetShape() == S_SEGMENT )
|
||||
{
|
||||
wxPoint pt;
|
||||
|
||||
|
|
|
@ -71,14 +71,14 @@ bool PCB_EDIT_FRAME::Other_Layer_Route( TRACK* aTrack, wxDC* DC )
|
|||
}
|
||||
|
||||
// Is the current segment Ok (no DRC error) ?
|
||||
if( g_Drc_On )
|
||||
if( Settings().m_legacyDrcOn )
|
||||
{
|
||||
if( BAD_DRC==m_drc->Drc( g_CurrentTrackSegment, GetBoard()->m_Track ) )
|
||||
// DRC error, the change layer is not made
|
||||
return false;
|
||||
|
||||
// Handle 2 segments.
|
||||
if( g_TwoSegmentTrackBuild && g_CurrentTrackSegment->Back() )
|
||||
if( Settings().m_legacyUseTwoSegmentTracks && g_CurrentTrackSegment->Back() )
|
||||
{
|
||||
if( BAD_DRC == m_drc->Drc( g_CurrentTrackSegment->Back(), GetBoard()->m_Track ) )
|
||||
return false;
|
||||
|
@ -151,7 +151,7 @@ bool PCB_EDIT_FRAME::Other_Layer_Route( TRACK* aTrack, wxDC* DC )
|
|||
break;
|
||||
}
|
||||
|
||||
if( g_Drc_On && BAD_DRC == m_drc->Drc( via, GetBoard()->m_Track ) )
|
||||
if( Settings().m_legacyDrcOn && BAD_DRC == m_drc->Drc( via, GetBoard()->m_Track ) )
|
||||
{
|
||||
// DRC fault: the Via cannot be placed here ...
|
||||
delete via;
|
||||
|
@ -205,7 +205,7 @@ bool PCB_EDIT_FRAME::Other_Layer_Route( TRACK* aTrack, wxDC* DC )
|
|||
|
||||
g_CurrentTrackList.PushBack( track );
|
||||
|
||||
if( g_TwoSegmentTrackBuild )
|
||||
if( Settings().m_legacyUseTwoSegmentTracks )
|
||||
{
|
||||
// Create a second segment (we must have 2 track segments to adjust)
|
||||
g_CurrentTrackList.PushBack( (TRACK*)g_CurrentTrackSegment->Clone() );
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
#include <class_drawpanel.h>
|
||||
#include <trigo.h>
|
||||
#include <wxPcbStruct.h>
|
||||
#include <colors_selection.h>
|
||||
|
||||
#include <pcbnew.h>
|
||||
#include <drc_stuff.h>
|
||||
|
@ -194,7 +193,7 @@ TRACK* PCB_EDIT_FRAME::Begin_Route( TRACK* aTrack, wxDC* aDC )
|
|||
g_CurrentTrackSegment->start = pad;
|
||||
}
|
||||
|
||||
if( g_TwoSegmentTrackBuild )
|
||||
if( Settings().m_legacyUseTwoSegmentTracks )
|
||||
{
|
||||
// Create 2nd segment
|
||||
g_CurrentTrackList.PushBack( (TRACK*)g_CurrentTrackSegment->Clone() );
|
||||
|
@ -213,7 +212,7 @@ TRACK* PCB_EDIT_FRAME::Begin_Route( TRACK* aTrack, wxDC* aDC )
|
|||
SetCurItem( g_CurrentTrackSegment, false );
|
||||
m_canvas->CallMouseCapture( aDC, wxDefaultPosition, false );
|
||||
|
||||
if( g_Drc_On )
|
||||
if( Settings().m_legacyDrcOn )
|
||||
{
|
||||
if( BAD_DRC == m_drc->Drc( g_CurrentTrackSegment, GetBoard()->m_Track ) )
|
||||
{
|
||||
|
@ -224,13 +223,13 @@ TRACK* PCB_EDIT_FRAME::Begin_Route( TRACK* aTrack, wxDC* aDC )
|
|||
else // Track in progress : segment coordinates are updated by ShowNewTrackWhenMovingCursor.
|
||||
{
|
||||
// Test for a D.R.C. error:
|
||||
if( g_Drc_On )
|
||||
if( Settings().m_legacyDrcOn )
|
||||
{
|
||||
if( BAD_DRC == m_drc->Drc( g_CurrentTrackSegment, GetBoard()->m_Track ) )
|
||||
return NULL;
|
||||
|
||||
// We must handle 2 segments
|
||||
if( g_TwoSegmentTrackBuild && g_CurrentTrackSegment->Back() )
|
||||
if( Settings().m_legacyUseTwoSegmentTracks && g_CurrentTrackSegment->Back() )
|
||||
{
|
||||
if( BAD_DRC == m_drc->Drc( g_CurrentTrackSegment->Back(), GetBoard()->m_Track ) )
|
||||
return NULL;
|
||||
|
@ -243,10 +242,10 @@ TRACK* PCB_EDIT_FRAME::Begin_Route( TRACK* aTrack, wxDC* aDC )
|
|||
*/
|
||||
bool CanCreateNewSegment = true;
|
||||
|
||||
if( !g_TwoSegmentTrackBuild && g_CurrentTrackSegment->IsNull() )
|
||||
if( !Settings().m_legacyUseTwoSegmentTracks && g_CurrentTrackSegment->IsNull() )
|
||||
CanCreateNewSegment = false;
|
||||
|
||||
if( g_TwoSegmentTrackBuild && g_CurrentTrackSegment->IsNull()
|
||||
if( Settings().m_legacyUseTwoSegmentTracks && g_CurrentTrackSegment->IsNull()
|
||||
&& g_CurrentTrackSegment->Back()
|
||||
&& g_CurrentTrackSegment->Back()->IsNull() )
|
||||
CanCreateNewSegment = false;
|
||||
|
@ -356,7 +355,7 @@ bool PCB_EDIT_FRAME::Add45DegreeSegment( wxDC* aDC )
|
|||
else
|
||||
newTrack->SetEnd( wxPoint(newTrack->GetEnd().x - segm_step_45, newTrack->GetEnd().y) );
|
||||
|
||||
if( g_Drc_On && BAD_DRC == m_drc->Drc( curTrack, GetBoard()->m_Track ) )
|
||||
if( Settings().m_legacyDrcOn && BAD_DRC == m_drc->Drc( curTrack, GetBoard()->m_Track ) )
|
||||
{
|
||||
delete newTrack;
|
||||
return false;
|
||||
|
@ -391,7 +390,7 @@ bool PCB_EDIT_FRAME::Add45DegreeSegment( wxDC* aDC )
|
|||
else
|
||||
newTrack->SetEnd( wxPoint(newTrack->GetEnd().x, newTrack->GetEnd().y - segm_step_45) );
|
||||
|
||||
if( g_Drc_On && BAD_DRC==m_drc->Drc( newTrack, GetBoard()->m_Track ) )
|
||||
if( Settings().m_legacyDrcOn && BAD_DRC==m_drc->Drc( newTrack, GetBoard()->m_Track ) )
|
||||
{
|
||||
delete newTrack;
|
||||
return false;
|
||||
|
@ -415,7 +414,7 @@ bool PCB_EDIT_FRAME::End_Route( TRACK* aTrack, wxDC* aDC )
|
|||
if( aTrack == NULL )
|
||||
return false;
|
||||
|
||||
if( g_Drc_On && BAD_DRC == m_drc->Drc( g_CurrentTrackSegment, GetBoard()->m_Track ) )
|
||||
if( Settings().m_legacyDrcOn && BAD_DRC == m_drc->Drc( g_CurrentTrackSegment, GetBoard()->m_Track ) )
|
||||
return false;
|
||||
|
||||
// Saving the coordinate of end point of the trace
|
||||
|
@ -499,7 +498,7 @@ bool PCB_EDIT_FRAME::End_Route( TRACK* aTrack, wxDC* aDC )
|
|||
}
|
||||
|
||||
// delete the old track, if it exists and is redundant
|
||||
if( g_AutoDeleteOldTrack )
|
||||
if( Settings().m_legacyAutoDeleteOldTrack )
|
||||
{
|
||||
EraseRedundantTrack( aDC, firstTrack, newCount, &s_ItemsListPicker );
|
||||
}
|
||||
|
@ -705,7 +704,7 @@ void ShowNewTrackWhenMovingCursor( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPo
|
|||
|
||||
if( showTrackClearanceMode >= SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS )
|
||||
{
|
||||
COLOR4D color = g_ColorsSettings.GetLayerColor( g_CurrentTrackSegment->GetLayer() );
|
||||
COLOR4D color = frame->Settings().Colors().GetLayerColor( g_CurrentTrackSegment->GetLayer() );
|
||||
DrawViaCirclesWhenEditingNewTrack( panelClipBox, aDC, g_CurrentTrackSegment->GetEnd(),
|
||||
boardViaRadius, viaRadiusWithClearence, color);
|
||||
}
|
||||
|
@ -721,7 +720,7 @@ void ShowNewTrackWhenMovingCursor( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPo
|
|||
if( !frame->GetDesignSettings().m_UseConnectedTrackWidth )
|
||||
g_CurrentTrackSegment->SetWidth( frame->GetDesignSettings().GetCurrentTrackWidth() );
|
||||
|
||||
if( g_TwoSegmentTrackBuild )
|
||||
if( frame->Settings().m_legacyUseTwoSegmentTracks )
|
||||
{
|
||||
TRACK* previous_track = g_CurrentTrackSegment->Back();
|
||||
|
||||
|
@ -734,13 +733,13 @@ void ShowNewTrackWhenMovingCursor( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPo
|
|||
}
|
||||
}
|
||||
|
||||
if( g_Track_45_Only_Allowed )
|
||||
if( frame->Settings().m_legacyUse45DegreeTracks )
|
||||
{
|
||||
if( g_TwoSegmentTrackBuild )
|
||||
if( frame->Settings().m_legacyUseTwoSegmentTracks )
|
||||
{
|
||||
g_CurrentTrackSegment->SetEnd( frame->GetCrossHairPosition() );
|
||||
|
||||
if( g_Drc_On )
|
||||
if( frame->Settings().m_legacyDrcOn )
|
||||
PushTrack( aPanel );
|
||||
|
||||
ComputeBreakPoint( g_CurrentTrackSegment,
|
||||
|
@ -769,7 +768,7 @@ void ShowNewTrackWhenMovingCursor( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPo
|
|||
|
||||
if( showTrackClearanceMode >= SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS )
|
||||
{
|
||||
COLOR4D color = g_ColorsSettings.GetLayerColor(g_CurrentTrackSegment->GetLayer());
|
||||
COLOR4D color = frame->Settings().Colors().GetLayerColor(g_CurrentTrackSegment->GetLayer());
|
||||
|
||||
//Via diameter must have taken what we are using, rather than netclass value.
|
||||
DrawViaCirclesWhenEditingNewTrack( panelClipBox, aDC, g_CurrentTrackSegment->GetEnd(),
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
|
||||
#include <boost/bind.hpp>
|
||||
#include <make_unique.h>
|
||||
#include <class_colors_design_settings.h>
|
||||
|
||||
#include <wx/stattext.h>
|
||||
|
||||
|
@ -258,8 +259,9 @@ FOOTPRINT_PREVIEW_PANEL::FOOTPRINT_PREVIEW_PANEL(
|
|||
EnableScrolling( false, false ); // otherwise Zoom Auto disables GAL canvas
|
||||
|
||||
m_dummyBoard = std::make_unique<BOARD>();
|
||||
m_colorsSettings = std::make_unique<COLORS_DESIGN_SETTINGS>();
|
||||
|
||||
UseColorScheme( m_dummyBoard->GetColorsSettings() );
|
||||
UseColorScheme( m_colorsSettings.get() );
|
||||
SyncLayersVisibility( &*m_dummyBoard );
|
||||
|
||||
Raise();
|
||||
|
|
|
@ -42,6 +42,7 @@ class IO_MGR;
|
|||
class BOARD;
|
||||
class FP_LOADER_THREAD;
|
||||
class FP_THREAD_IFACE;
|
||||
class COLORS_DESIGN_SETTINGS;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -91,6 +92,7 @@ private:
|
|||
std::shared_ptr<FP_THREAD_IFACE> m_iface;
|
||||
FOOTPRINT_STATUS_HANDLER m_handler;
|
||||
std::unique_ptr<BOARD> m_dummyBoard;
|
||||
std::unique_ptr<COLORS_DESIGN_SETTINGS> m_colorsSettings;
|
||||
|
||||
LIB_ID m_currentFPID;
|
||||
bool m_footprintDisplayed;
|
||||
|
|
|
@ -324,6 +324,7 @@ void LAYER_WIDGET::insertRenderRow( int aRow, const ROW& aSpec )
|
|||
aSpec.rowName, wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT );
|
||||
shrinkFont( cb, m_PointSize );
|
||||
cb->SetValue( aSpec.state );
|
||||
cb->Enable( aSpec.changeable );
|
||||
cb->Bind( wxEVT_COMMAND_CHECKBOX_CLICKED, &LAYER_WIDGET::OnRenderCheckBox, this );
|
||||
cb->SetToolTip( aSpec.tooltip );
|
||||
m_RenderFlexGridSizer->wxSizer::Insert( index+col, cb, 0, flags );
|
||||
|
|
|
@ -88,15 +88,17 @@ public:
|
|||
COLOR4D color; ///< COLOR4D::UNSPECIFIED if none.
|
||||
bool state; ///< initial wxCheckBox state
|
||||
wxString tooltip; ///< if not empty, use this tooltip on row
|
||||
bool changeable; ///< if true, the state can be changed
|
||||
|
||||
ROW( const wxString& aRowName, int aId, COLOR4D aColor = COLOR4D::UNSPECIFIED,
|
||||
const wxString& aTooltip = wxEmptyString, bool aState = true )
|
||||
const wxString& aTooltip = wxEmptyString, bool aState = true, bool aChangeable = true )
|
||||
{
|
||||
rowName = aRowName;
|
||||
id = aId;
|
||||
color = aColor;
|
||||
state = aState;
|
||||
tooltip = aTooltip;
|
||||
changeable = aChangeable;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@ bool FindBestGridPointOnTrack( wxPoint* aNearPos, wxPoint on_grid, const TRACK*
|
|||
bool Magnetize( PCB_EDIT_FRAME* frame, int aCurrentTool, wxSize aGridSize,
|
||||
wxPoint on_grid, wxPoint* curpos )
|
||||
{
|
||||
bool doCheckNet = g_MagneticPadOption != CAPTURE_ALWAYS && g_Drc_On;
|
||||
bool doCheckNet = frame->Settings().m_magneticPads != CAPTURE_ALWAYS && frame->Settings().m_legacyDrcOn;
|
||||
bool doTrack = false;
|
||||
bool doPad = false;
|
||||
bool amMovingVia = false;
|
||||
|
@ -155,20 +155,20 @@ bool Magnetize( PCB_EDIT_FRAME* frame, int aCurrentTool, wxSize aGridSize,
|
|||
currTrack = NULL;
|
||||
}
|
||||
|
||||
if( g_MagneticPadOption == CAPTURE_ALWAYS )
|
||||
if( frame->Settings().m_magneticPads == CAPTURE_ALWAYS )
|
||||
doPad = true;
|
||||
|
||||
if( g_MagneticTrackOption == CAPTURE_ALWAYS )
|
||||
if( frame->Settings().m_magneticTracks == CAPTURE_ALWAYS )
|
||||
doTrack = true;
|
||||
|
||||
if( aCurrentTool == ID_TRACK_BUTT || amMovingVia )
|
||||
{
|
||||
int q = CAPTURE_CURSOR_IN_TRACK_TOOL;
|
||||
|
||||
if( g_MagneticPadOption == q )
|
||||
if( frame->Settings().m_magneticPads == q )
|
||||
doPad = true;
|
||||
|
||||
if( g_MagneticTrackOption == q )
|
||||
if( frame->Settings().m_magneticTracks == q )
|
||||
doTrack = true;
|
||||
}
|
||||
|
||||
|
@ -225,7 +225,7 @@ bool Magnetize( PCB_EDIT_FRAME* frame, int aCurrentTool, wxSize aGridSize,
|
|||
/*
|
||||
* In two segment mode, ignore the final segment if it's inside a grid square.
|
||||
*/
|
||||
if( !amMovingVia && currTrack && g_TwoSegmentTrackBuild && currTrack->Back()
|
||||
if( !amMovingVia && currTrack && frame->Settings().m_legacyUseTwoSegmentTracks && currTrack->Back()
|
||||
&& currTrack->GetStart().x - aGridSize.x < currTrack->GetEnd().x
|
||||
&& currTrack->GetStart().x + aGridSize.x > currTrack->GetEnd().x
|
||||
&& currTrack->GetStart().y - aGridSize.y < currTrack->GetEnd().y
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
#include <wildcards_and_files_ext.h>
|
||||
#include <menus_helpers.h>
|
||||
#include <footprint_wizard_frame.h>
|
||||
#include <pcbnew_config.h>
|
||||
#include <config_params.h>
|
||||
|
||||
#include <functional>
|
||||
using namespace std::placeholders;
|
||||
|
@ -989,9 +989,9 @@ void FOOTPRINT_EDIT_FRAME::OnVerticalToolbar( wxCommandEvent& aEvent )
|
|||
}
|
||||
|
||||
|
||||
COLOR4D FOOTPRINT_EDIT_FRAME::GetGridColor() const
|
||||
COLOR4D FOOTPRINT_EDIT_FRAME::GetGridColor()
|
||||
{
|
||||
return g_ColorsSettings.GetItemColor( LAYER_GRID );
|
||||
return Settings().Colors().GetItemColor( LAYER_GRID );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -459,7 +459,7 @@ public:
|
|||
* Function GetGridColor() , virtual
|
||||
* @return the color of the grid
|
||||
*/
|
||||
virtual COLOR4D GetGridColor() const override;
|
||||
virtual COLOR4D GetGridColor() override;
|
||||
|
||||
///> @copydoc PCB_BASE_FRAME::SetActiveLayer()
|
||||
void SetActiveLayer( PCB_LAYER_ID aLayer ) override;
|
||||
|
|
|
@ -821,7 +821,9 @@ void FOOTPRINT_EDIT_FRAME::updateTitle()
|
|||
|
||||
void FOOTPRINT_EDIT_FRAME::updateView()
|
||||
{
|
||||
static_cast<PCB_DRAW_PANEL_GAL*>( GetGalCanvas() )->DisplayBoard( GetBoard() );
|
||||
auto dp = static_cast<PCB_DRAW_PANEL_GAL*>( GetGalCanvas() );
|
||||
dp->UseColorScheme( &Settings().Colors() );
|
||||
dp->DisplayBoard( GetBoard() );
|
||||
m_toolManager->ResetTools( TOOL_BASE::MODEL_RELOAD );
|
||||
m_toolManager->RunAction( ACTIONS::zoomFitScreen, true );
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
|
||||
#include <hotkeys.h>
|
||||
#include <wildcards_and_files_ext.h>
|
||||
#include <pcbnew_config.h>
|
||||
#include <config_params.h>
|
||||
|
||||
#include <tool/tool_manager.h>
|
||||
#include <tool/tool_dispatcher.h>
|
||||
|
@ -699,9 +699,9 @@ void FOOTPRINT_VIEWER_FRAME::Update3D_Frame( bool aForceReloadFootprint )
|
|||
}
|
||||
|
||||
|
||||
COLOR4D FOOTPRINT_VIEWER_FRAME::GetGridColor() const
|
||||
COLOR4D FOOTPRINT_VIEWER_FRAME::GetGridColor()
|
||||
{
|
||||
return g_ColorsSettings.GetItemColor( LAYER_GRID );
|
||||
return Settings().Colors().GetItemColor( LAYER_GRID );
|
||||
}
|
||||
|
||||
|
||||
|
@ -890,7 +890,9 @@ void FOOTPRINT_VIEWER_FRAME::updateView()
|
|||
{
|
||||
if( IsGalCanvasActive() )
|
||||
{
|
||||
static_cast<PCB_DRAW_PANEL_GAL*>( GetGalCanvas() )->DisplayBoard( GetBoard() );
|
||||
auto dp = static_cast<PCB_DRAW_PANEL_GAL*>( GetGalCanvas() );
|
||||
dp->UseColorScheme( &Settings().Colors() );
|
||||
dp->DisplayBoard( GetBoard() );
|
||||
m_toolManager->ResetTools( TOOL_BASE::MODEL_RELOAD );
|
||||
m_toolManager->RunAction( ACTIONS::zoomFitScreen, true );
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ protected:
|
|||
public:
|
||||
~FOOTPRINT_VIEWER_FRAME();
|
||||
|
||||
virtual COLOR4D GetGridColor() const override;
|
||||
virtual COLOR4D GetGridColor() override;
|
||||
|
||||
/**
|
||||
* Function ReCreateLibraryList
|
||||
|
|
|
@ -801,7 +801,7 @@ bool PCB_EDIT_FRAME::PlaceDraggedOrMovedTrackSegment( TRACK* Track, wxDC* DC )
|
|||
int current_net_code = Track->GetNetCode();
|
||||
|
||||
// DRC control:
|
||||
if( g_Drc_On )
|
||||
if( Settings().m_legacyDrcOn )
|
||||
{
|
||||
errdrc = m_drc->Drc( Track, GetBoard()->m_Track );
|
||||
|
||||
|
|
|
@ -73,6 +73,7 @@ void PCB_BASE_EDIT_FRAME::SetBoard( BOARD* aBoard )
|
|||
PCB_DRAW_PANEL_GAL* drawPanel = static_cast<PCB_DRAW_PANEL_GAL*>( GetGalCanvas() );
|
||||
|
||||
drawPanel->DisplayBoard( aBoard );
|
||||
drawPanel->UseColorScheme( &Settings().Colors() );
|
||||
m_toolManager->SetEnvironment( aBoard, drawPanel->GetView(),
|
||||
drawPanel->GetViewControls(), this );
|
||||
|
||||
|
|
|
@ -37,6 +37,8 @@
|
|||
#include <class_track.h>
|
||||
#include <wxBasePcbFrame.h>
|
||||
|
||||
#include <gal/graphics_abstraction_layer.h>
|
||||
|
||||
#include <functional>
|
||||
using namespace std::placeholders;
|
||||
|
||||
|
@ -157,9 +159,6 @@ void PCB_DRAW_PANEL_GAL::DisplayBoard( const BOARD* aBoard )
|
|||
// Ratsnest
|
||||
m_ratsnest.reset( new KIGFX::RATSNEST_VIEWITEM( aBoard->GetConnectivity() ) );
|
||||
m_view->Add( m_ratsnest.get() );
|
||||
|
||||
// Display settings
|
||||
UseColorScheme( aBoard->GetColorsSettings() );
|
||||
}
|
||||
|
||||
|
||||
|
@ -175,6 +174,7 @@ void PCB_DRAW_PANEL_GAL::UseColorScheme( const COLORS_DESIGN_SETTINGS* aSettings
|
|||
KIGFX::PCB_RENDER_SETTINGS* rs;
|
||||
rs = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( m_view->GetPainter()->GetSettings() );
|
||||
rs->ImportLegacyColors( aSettings );
|
||||
m_gal->SetCursorColor( aSettings->GetItemColor( LAYER_CURSOR ) );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
* This program source code file is part of KICAD, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2012-2017 Kicad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you may find one here:
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <pcb_general_settings.h>
|
||||
|
||||
PCB_GENERAL_SETTINGS::PCB_GENERAL_SETTINGS()
|
||||
{
|
||||
Add( "LegacyDRCOn", &m_legacyDrcOn, true );
|
||||
Add( "LegacyAutoDeleteOldTrack", &m_legacyAutoDeleteOldTrack, true );
|
||||
Add( "LegacyUse45DegreeTracks",&m_legacyUse45DegreeTracks, true);
|
||||
Add( "LegacyUseTwoSegmentTracks", &m_legacyUseTwoSegmentTracks, true);
|
||||
Add( "Use45DegreeGraphicSegments", &m_use45DegreeGraphicSegments, false);
|
||||
Add( "MagneticPads", reinterpret_cast<int*>( &m_magneticPads ), CAPTURE_CURSOR_IN_TRACK_TOOL );
|
||||
Add( "MagneticTracks", reinterpret_cast<int*>( &m_magneticTracks ), CAPTURE_CURSOR_IN_TRACK_TOOL );
|
||||
Add( "EditActionChangesTrackWidth", &m_editActionChangesTrackWidth, false );
|
||||
}
|
||||
|
||||
void PCB_GENERAL_SETTINGS::Load( wxConfigBase* aCfg )
|
||||
{
|
||||
m_colorsSettings.Load( aCfg );
|
||||
SETTINGS::Load( aCfg );
|
||||
}
|
||||
|
||||
|
||||
void PCB_GENERAL_SETTINGS::Save( wxConfigBase* aCfg )
|
||||
{
|
||||
m_colorsSettings.Save( aCfg );
|
||||
SETTINGS::Save( aCfg );
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
/*
|
||||
* This program source code file is part of KICAD, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2012-2017 Kicad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you may find one here:
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#ifndef __PCBNEW_GENERAL_SETTINGS_H
|
||||
#define __PCBNEW_GENERAL_SETTINGS_H
|
||||
|
||||
#include <class_colors_design_settings.h>
|
||||
|
||||
class wxConfigBase;
|
||||
class wxString;
|
||||
|
||||
enum MAGNETIC_PAD_OPTION_VALUES
|
||||
{
|
||||
NO_EFFECT,
|
||||
CAPTURE_CURSOR_IN_TRACK_TOOL,
|
||||
CAPTURE_ALWAYS
|
||||
};
|
||||
|
||||
class PCB_GENERAL_SETTINGS : public SETTINGS
|
||||
{
|
||||
public:
|
||||
PCB_GENERAL_SETTINGS();
|
||||
|
||||
void Load ( wxConfigBase* aCfg );
|
||||
void Save( wxConfigBase* aCfg );
|
||||
|
||||
COLORS_DESIGN_SETTINGS m_colorsSettings;
|
||||
|
||||
COLORS_DESIGN_SETTINGS& Colors()
|
||||
{
|
||||
return m_colorsSettings;
|
||||
}
|
||||
|
||||
bool m_legacyDrcOn = true;
|
||||
bool m_legacyAutoDeleteOldTrack = true;
|
||||
bool m_legacyAlternateTrackPosture = false;
|
||||
bool m_legacyUse45DegreeTracks = true; // True to allow horiz, vert. and 45deg only tracks
|
||||
bool m_use45DegreeGraphicSegments = false; // True to allow horiz, vert. and 45deg only graphic segments
|
||||
bool m_legacyUseTwoSegmentTracks = true;
|
||||
|
||||
bool m_editActionChangesTrackWidth = false;
|
||||
bool m_showFilterDialogAfterEachSelection = false;
|
||||
|
||||
MAGNETIC_PAD_OPTION_VALUES m_magneticPads = CAPTURE_CURSOR_IN_TRACK_TOOL;
|
||||
MAGNETIC_PAD_OPTION_VALUES m_magneticTracks = CAPTURE_CURSOR_IN_TRACK_TOOL;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -36,6 +36,7 @@
|
|||
#include <class_mire.h>
|
||||
#include <class_marker_pcb.h>
|
||||
|
||||
#include <layers_id_colors_and_visibility.h>
|
||||
#include <pcb_painter.h>
|
||||
#include <gal/graphics_abstraction_layer.h>
|
||||
#include <convert_basic_shapes_to_polygon.h>
|
||||
|
@ -87,7 +88,6 @@ void PCB_RENDER_SETTINGS::ImportLegacyColors( const COLORS_DESIGN_SETTINGS* aSet
|
|||
m_layerColors[LAYER_PADS_NETNAMES] = COLOR4D( 1.0, 1.0, 1.0, 0.9 );
|
||||
m_layerColors[LAYER_PAD_FR_NETNAMES] = COLOR4D( 1.0, 1.0, 1.0, 0.9 );
|
||||
m_layerColors[LAYER_PAD_BK_NETNAMES] = COLOR4D( 1.0, 1.0, 1.0, 0.9 );
|
||||
m_layerColors[LAYER_WORKSHEET] = COLOR4D( 0.5, 0.0, 0.0, 0.8 );
|
||||
m_layerColors[LAYER_DRC] = COLOR4D( 1.0, 0.0, 0.0, 0.8 );
|
||||
|
||||
// LAYER_NON_PLATED, LAYER_ANCHOR],LAYER_RATSNEST,
|
||||
|
@ -98,9 +98,6 @@ void PCB_RENDER_SETTINGS::ImportLegacyColors( const COLORS_DESIGN_SETTINGS* aSet
|
|||
m_layerColors[LAYER_MOD_TEXT_FR] = m_layerColors[F_SilkS];
|
||||
m_layerColors[LAYER_MOD_TEXT_BK] = m_layerColors[B_SilkS];
|
||||
|
||||
// Make ratsnest lines slightly transparent
|
||||
m_layerColors[LAYER_RATSNEST].a = 0.8;
|
||||
|
||||
// Netnames for copper layers
|
||||
for( LSEQ cu = LSET::AllCuMask().CuStack(); cu; ++cu )
|
||||
{
|
||||
|
@ -114,6 +111,8 @@ void PCB_RENDER_SETTINGS::ImportLegacyColors( const COLORS_DESIGN_SETTINGS* aSet
|
|||
m_layerColors[GetNetnameLayer( layer )] = lightLabel;
|
||||
}
|
||||
|
||||
SetBackgroundColor ( aSettings->GetItemColor( LAYER_PCB_BACKGROUND ) );
|
||||
|
||||
update();
|
||||
}
|
||||
|
||||
|
|
|
@ -126,6 +126,13 @@ public:
|
|||
return m_sketchMode[aItemLayer];
|
||||
}
|
||||
|
||||
inline bool IsBackgroundDark() const
|
||||
{
|
||||
auto luma = m_layerColors[ LAYER_PCB_BACKGROUND ].GetBrightness();
|
||||
|
||||
return luma < 0.5;
|
||||
}
|
||||
|
||||
protected:
|
||||
///> Flag determining if items on a given layer should be drawn as an outline or a filled item
|
||||
bool m_sketchMode[GAL_LAYER_ID_END];
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
#include <dialog_design_rules.h>
|
||||
#include <class_pcb_layer_widget.h>
|
||||
#include <hotkeys.h>
|
||||
#include <pcbnew_config.h>
|
||||
#include <config_params.h>
|
||||
#include <module_editor_frame.h>
|
||||
#include <dialog_helpers.h>
|
||||
#include <dialog_plot.h>
|
||||
|
@ -731,15 +731,15 @@ void PCB_EDIT_FRAME::UseGalCanvas( bool aEnable )
|
|||
|
||||
void PCB_EDIT_FRAME::forceColorsToLegacy()
|
||||
{
|
||||
COLORS_DESIGN_SETTINGS* cds = GetBoard()->GetColorsSettings();
|
||||
COLORS_DESIGN_SETTINGS& cds = Settings().Colors();
|
||||
|
||||
for( unsigned i = 0; i < DIM( cds->m_LayersColors ); i++ )
|
||||
for( unsigned i = 0; i < DIM( cds.m_LayersColors ); i++ )
|
||||
{
|
||||
COLOR4D c = cds->GetLayerColor( i );
|
||||
COLOR4D c = cds.GetLayerColor( i );
|
||||
c.SetToNearestLegacyColor();
|
||||
// Note the alpha chanel is not modified. Therefore the value
|
||||
// is the previous value used in GAL canvas.
|
||||
cds->SetLayerColor( i, c );
|
||||
cds.SetLayerColor( i, c );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -794,6 +794,8 @@ void PCB_EDIT_FRAME::LoadSettings( wxConfigBase* aCfg )
|
|||
|
||||
wxConfigLoadSetups( aCfg, GetConfigurationSettings() );
|
||||
|
||||
m_configSettings.Load( aCfg );
|
||||
|
||||
double dtmp;
|
||||
aCfg->Read( PlotLineWidthEntry, &dtmp, 0.1 ); // stored in mm
|
||||
|
||||
|
@ -805,8 +807,6 @@ void PCB_EDIT_FRAME::LoadSettings( wxConfigBase* aCfg )
|
|||
|
||||
g_DrawDefaultLineThickness = Millimeter2iu( dtmp );
|
||||
|
||||
aCfg->Read( MagneticPadsEntry, &g_MagneticPadOption );
|
||||
aCfg->Read( MagneticTracksEntry, &g_MagneticTrackOption );
|
||||
aCfg->Read( ShowMicrowaveEntry, &m_show_microwave_tools );
|
||||
aCfg->Read( ShowLayerManagerEntry, &m_show_layer_manager_tools );
|
||||
aCfg->Read( ShowPageLimitsEntry, &m_showPageLimits );
|
||||
|
@ -815,14 +815,14 @@ void PCB_EDIT_FRAME::LoadSettings( wxConfigBase* aCfg )
|
|||
|
||||
void PCB_EDIT_FRAME::SaveSettings( wxConfigBase* aCfg )
|
||||
{
|
||||
m_configSettings.Save( aCfg );
|
||||
|
||||
PCB_BASE_FRAME::SaveSettings( aCfg );
|
||||
|
||||
wxConfigSaveSetups( aCfg, GetConfigurationSettings() );
|
||||
|
||||
// This value is stored in mm )
|
||||
aCfg->Write( PlotLineWidthEntry, MM_PER_IU * g_DrawDefaultLineThickness );
|
||||
aCfg->Write( MagneticPadsEntry, (long) g_MagneticPadOption );
|
||||
aCfg->Write( MagneticTracksEntry, (long) g_MagneticTrackOption );
|
||||
aCfg->Write( ShowMicrowaveEntry, (long) m_show_microwave_tools );
|
||||
aCfg->Write( ShowLayerManagerEntry, (long)m_show_layer_manager_tools );
|
||||
aCfg->Write( ShowPageLimitsEntry, m_showPageLimits );
|
||||
|
@ -841,16 +841,16 @@ void PCB_EDIT_FRAME::SetGridVisibility(bool aVisible)
|
|||
}
|
||||
|
||||
|
||||
COLOR4D PCB_EDIT_FRAME::GetGridColor() const
|
||||
COLOR4D PCB_EDIT_FRAME::GetGridColor()
|
||||
{
|
||||
return GetBoard()->GetVisibleElementColor( LAYER_GRID );
|
||||
return Settings().Colors().GetItemColor( LAYER_GRID );
|
||||
}
|
||||
|
||||
|
||||
void PCB_EDIT_FRAME::SetGridColor( COLOR4D aColor )
|
||||
{
|
||||
|
||||
GetBoard()->SetVisibleElementColor( LAYER_GRID, aColor );
|
||||
Settings().Colors().SetItemColor( LAYER_GRID, aColor );
|
||||
|
||||
if( IsGalCanvasActive() )
|
||||
{
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
#include <class_drawpanel.h>
|
||||
#include <wxPcbStruct.h>
|
||||
#include <eda_dde.h>
|
||||
#include <colors_selection.h>
|
||||
#include <wx/stdpaths.h>
|
||||
|
||||
#include <wx/file.h>
|
||||
|
@ -65,20 +64,11 @@
|
|||
extern bool IsWxPythonLoaded();
|
||||
|
||||
// Colors for layers and items
|
||||
COLORS_DESIGN_SETTINGS g_ColorsSettings;
|
||||
|
||||
bool g_Drc_On = true;
|
||||
bool g_AutoDeleteOldTrack = true;
|
||||
bool g_Raccord_45_Auto = true;
|
||||
bool g_Alternate_Track_Posture = false;
|
||||
bool g_Track_45_Only_Allowed = true; // True to allow horiz, vert. and 45deg only tracks
|
||||
bool g_Segments_45_Only; // True to allow horiz, vert. and 45deg only graphic segments
|
||||
bool g_TwoSegmentTrackBuild = true;
|
||||
|
||||
PCB_LAYER_ID g_Route_Layer_TOP;
|
||||
PCB_LAYER_ID g_Route_Layer_BOTTOM;
|
||||
int g_MagneticPadOption = CAPTURE_CURSOR_IN_TRACK_TOOL;
|
||||
int g_MagneticTrackOption = CAPTURE_CURSOR_IN_TRACK_TOOL;
|
||||
bool g_Alternate_Track_Posture = false;
|
||||
bool g_Raccord_45_Auto = true;
|
||||
|
||||
wxPoint g_Offset_Module; // module offset used when moving a footprint
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue