Add preference for flip axis.

Fixes: lp:1836267
* https://bugs.launchpad.net/kicad/+bug/1836267
This commit is contained in:
Jeff Young 2019-07-12 22:02:10 +01:00
parent a3855cb4f2
commit 37af3adffb
46 changed files with 997 additions and 458 deletions

View File

@ -44,7 +44,7 @@ PANEL_PREV_3D::PANEL_PREV_3D( wxWindow* aParent, PCB_BASE_FRAME* aFrame, MODULE*
initPanel(); initPanel();
// Initialize the color settings to draw the board and the footprint // Initialize the color settings to draw the board and the footprint
m_dummyBoard->SetColorsSettings( &aFrame->Settings().Colors() ); m_dummyBoard->SetGeneralSettings( &aFrame->Settings() );
m_parentModelList = aParentModelList; m_parentModelList = aParentModelList;

View File

@ -260,15 +260,16 @@ public:
* Function Flip * Function Flip
* Flip this object, i.e. change the board side for this object * Flip this object, i.e. change the board side for this object
* @param aCentre - the rotation point. * @param aCentre - the rotation point.
* @param aFlipLeftRight - mirror across Y axis instead of X (the default)
*/ */
virtual void Flip( const wxPoint& aCentre ) virtual void Flip( const wxPoint& aCentre, bool aFlipLeftRight )
{ {
wxMessageBox( wxT( "virtual BOARD_ITEM::Flip used, should not occur" ), GetClass() ); wxMessageBox( wxT( "virtual BOARD_ITEM::Flip used, should not occur" ), GetClass() );
} }
void Flip( const VECTOR2I& aCentre ) void Flip( const VECTOR2I& aCentre, bool aFlipLeftRight )
{ {
Flip( wxPoint( aCentre.x, aCentre.y ) ); Flip( wxPoint( aCentre.x, aCentre.y ), aFlipLeftRight );
} }
/** /**

View File

@ -30,34 +30,26 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include <limits.h>
#include <algorithm> #include <algorithm>
#include <iterator> #include <iterator>
#include <fctsys.h> #include <fctsys.h>
#include <common.h> #include <common.h>
#include <kicad_string.h> #include <kicad_string.h>
#include <pcb_base_frame.h> #include <pcb_base_frame.h>
#include <msgpanel.h> #include <msgpanel.h>
#include <pcb_netlist.h>
#include <reporter.h> #include <reporter.h>
#include <base_units.h>
#include <ratsnest_data.h> #include <ratsnest_data.h>
#include <ratsnest_viewitem.h> #include <ratsnest_viewitem.h>
#include <ws_proxy_view_item.h> #include <ws_proxy_view_item.h>
#include <pcbnew.h> #include <pcbnew.h>
#include <collectors.h> #include <collectors.h>
#include <class_board.h> #include <class_board.h>
#include <class_module.h> #include <class_module.h>
#include <class_track.h> #include <class_track.h>
#include <class_zone.h> #include <class_zone.h>
#include <class_marker_pcb.h> #include <class_marker_pcb.h>
#include <class_drawsegment.h> #include <class_drawsegment.h>
#include <class_pcb_text.h>
#include <class_pcb_target.h> #include <class_pcb_target.h>
#include <class_dimension.h>
#include <connectivity/connectivity_data.h> #include <connectivity/connectivity_data.h>
@ -100,12 +92,11 @@ DELETED_BOARD_ITEM g_DeletedItem;
*/ */
wxPoint BOARD_ITEM::ZeroOffset( 0, 0 ); wxPoint BOARD_ITEM::ZeroOffset( 0, 0 );
// this is a dummy colors settings (defined colors are the vdefulat values) // Dummy general settings (defined colors are the default values) used to initialize the board.
// used to initialize the board. // These settings will be overriden later, depending on the draw frame that displays the board.
// these settings will be overriden later, depending on the draw frame that displays the board.
// However, when a board is created by a python script, outside a frame, the colors must be set // However, when a board is created by a python script, outside a frame, the colors must be set
// so dummyColorsSettings provide this default initialization // so dummyColorsSettings provide this default initialization
static COLORS_DESIGN_SETTINGS dummyColorsSettings( FRAME_PCB ); static PCB_GENERAL_SETTINGS dummyGeneralSettings( FRAME_PCB );
BOARD::BOARD() : BOARD::BOARD() :
BOARD_ITEM_CONTAINER( (BOARD_ITEM*) NULL, PCB_T ), BOARD_ITEM_CONTAINER( (BOARD_ITEM*) NULL, PCB_T ),
@ -114,7 +105,8 @@ BOARD::BOARD() :
// we have not loaded a board yet, assume latest until then. // we have not loaded a board yet, assume latest until then.
m_fileFormatVersionAtLoad = LEGACY_BOARD_FILE_VERSION; m_fileFormatVersionAtLoad = LEGACY_BOARD_FILE_VERSION;
m_colorsSettings = &dummyColorsSettings; m_generalSettings = &dummyGeneralSettings;
m_CurrentZoneContour = NULL; // This ZONE_CONTAINER handle the m_CurrentZoneContour = NULL; // This ZONE_CONTAINER handle the
// zone contour currently in progress // zone contour currently in progress

View File

@ -22,23 +22,16 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
/**
* @file class_board.h
* @brief Class BOARD to handle a board.
*/
#ifndef CLASS_BOARD_H_ #ifndef CLASS_BOARD_H_
#define CLASS_BOARD_H_ #define CLASS_BOARD_H_
#include <tuple> #include <tuple>
#include <core/iterators.h> #include <core/iterators.h>
#include <board_design_settings.h> #include <board_design_settings.h>
#include <board_item_container.h> #include <board_item_container.h>
#include <class_module.h> #include <class_module.h>
#include <class_pad.h> #include <class_pad.h>
#include <colors_design_settings.h> #include <pcb_general_settings.h>
#include <common.h> // PAGE_INFO #include <common.h> // PAGE_INFO
#include <eda_rect.h> #include <eda_rect.h>
#include <layers_id_colors_and_visibility.h> #include <layers_id_colors_and_visibility.h>
@ -200,7 +193,7 @@ private:
BOARD_DESIGN_SETTINGS m_designSettings; BOARD_DESIGN_SETTINGS m_designSettings;
ZONE_SETTINGS m_zoneSettings; ZONE_SETTINGS m_zoneSettings;
COLORS_DESIGN_SETTINGS* m_colorsSettings; PCB_GENERAL_SETTINGS* m_generalSettings; ///< reference only; I have no ownership
PAGE_INFO m_paper; PAGE_INFO m_paper;
TITLE_BLOCK m_titles; ///< text in lower right of screen and plots TITLE_BLOCK m_titles; ///< text in lower right of screen and plots
PCB_PLOT_PARAMS m_plotOptions; PCB_PLOT_PARAMS m_plotOptions;
@ -577,16 +570,15 @@ public:
* Function GetColorSettings * Function GetColorSettings
* @return the current COLORS_DESIGN_SETTINGS in use * @return the current COLORS_DESIGN_SETTINGS in use
*/ */
const COLORS_DESIGN_SETTINGS& Colors() const { return *m_colorsSettings; } const COLORS_DESIGN_SETTINGS& Colors() const { return m_generalSettings->Colors(); }
/** const PCB_GENERAL_SETTINGS& GeneralSettings() const { return *m_generalSettings; }
* Function SetColorsSettings
* @param aColorsSettings = the new COLORS_DESIGN_SETTINGS to use void SetGeneralSettings( PCB_GENERAL_SETTINGS* aGeneralSettings )
*/
void SetColorsSettings( COLORS_DESIGN_SETTINGS* aColorsSettings )
{ {
m_colorsSettings = aColorsSettings; m_generalSettings = aGeneralSettings;
} }
/** /**
* Function GetBoardPolygonOutlines * Function GetBoardPolygonOutlines
* Extracts the board outlines and build a closed polygon * Extracts the board outlines and build a closed polygon

View File

@ -135,7 +135,7 @@ void DIMENSION::Rotate( const wxPoint& aRotCentre, double aAngle )
} }
void DIMENSION::Flip( const wxPoint& aCentre ) void DIMENSION::Flip( const wxPoint& aCentre, bool aFlipLeftRight )
{ {
Mirror( aCentre ); Mirror( aCentre );
@ -145,11 +145,16 @@ void DIMENSION::Flip( const wxPoint& aCentre )
} }
void DIMENSION::Mirror( const wxPoint& axis_pos ) void DIMENSION::Mirror( const wxPoint& axis_pos, bool aMirrorLeftRight )
{ {
int axis = aMirrorLeftRight ? axis_pos.x : axis_pos.y;
wxPoint newPos = m_Text.GetTextPos(); wxPoint newPos = m_Text.GetTextPos();
#define INVERT( pos ) (pos) = axis_pos.y - ( (pos) - axis_pos.y ) #define INVERT( pos ) (pos) = axis - ( (pos) - axis )
if( aMirrorLeftRight )
INVERT( newPos.x );
else
INVERT( newPos.y ); INVERT( newPos.y );
m_Text.SetTextPos( newPos ); m_Text.SetTextPos( newPos );
@ -157,6 +162,8 @@ void DIMENSION::Mirror( const wxPoint& axis_pos )
// invert angle // invert angle
m_Text.SetTextAngle( -m_Text.GetTextAngle() ); m_Text.SetTextAngle( -m_Text.GetTextAngle() );
if( aMirrorLeftRight )
{
INVERT( m_crossBarO.y ); INVERT( m_crossBarO.y );
INVERT( m_crossBarF.y ); INVERT( m_crossBarF.y );
INVERT( m_featureLineGO.y ); INVERT( m_featureLineGO.y );
@ -167,6 +174,20 @@ void DIMENSION::Mirror( const wxPoint& axis_pos )
INVERT( m_arrowG2F.y ); INVERT( m_arrowG2F.y );
INVERT( m_arrowD1F.y ); INVERT( m_arrowD1F.y );
INVERT( m_arrowD2F.y ); INVERT( m_arrowD2F.y );
}
else
{
INVERT( m_crossBarO.y );
INVERT( m_crossBarF.y );
INVERT( m_featureLineGO.y );
INVERT( m_featureLineGF.y );
INVERT( m_featureLineDO.y );
INVERT( m_featureLineDF.y );
INVERT( m_arrowG1F.y );
INVERT( m_arrowG2F.y );
INVERT( m_arrowD1F.y );
INVERT( m_arrowD2F.y );
}
} }

View File

@ -207,7 +207,7 @@ public:
*/ */
void Move( const wxPoint& offset ) override; void Move( const wxPoint& offset ) override;
void Rotate( const wxPoint& aRotCentre, double aAngle ) override; void Rotate( const wxPoint& aRotCentre, double aAngle ) override;
void Flip( const wxPoint& aCentre ) override; void Flip( const wxPoint& aCentre, bool aFlipLeftRight ) override;
/** /**
* Function Mirror * Function Mirror
@ -216,7 +216,7 @@ public:
* the layer is not changed * the layer is not changed
* @param axis_pos : vertical axis position * @param axis_pos : vertical axis position
*/ */
void Mirror( const wxPoint& axis_pos ); void Mirror( const wxPoint& axis_pos, bool aMirrorLeftRight = false );
void GetMsgPanelInfo( EDA_UNITS_T aUnits, std::vector< MSG_PANEL_ITEM >& aList ) override; void GetMsgPanelInfo( EDA_UNITS_T aUnits, std::vector< MSG_PANEL_ITEM >& aList ) override;

View File

@ -164,10 +164,18 @@ void DRAWSEGMENT::Rotate( const wxPoint& aRotCentre, double aAngle )
} }
void DRAWSEGMENT::Flip( const wxPoint& aCentre ) void DRAWSEGMENT::Flip( const wxPoint& aCentre, bool aFlipLeftRight )
{ {
m_Start.y = aCentre.y - (m_Start.y - aCentre.y); if( aFlipLeftRight )
m_End.y = aCentre.y - (m_End.y - aCentre.y); {
m_Start.x = aCentre.x - ( m_Start.x - aCentre.x );
m_End.x = aCentre.x - ( m_End.x - aCentre.x );
}
else
{
m_Start.y = aCentre.y - ( m_Start.y - aCentre.y );
m_End.y = aCentre.y - ( m_End.y - aCentre.y );
}
switch ( m_Shape ) switch ( m_Shape )
{ {
@ -178,14 +186,25 @@ void DRAWSEGMENT::Flip( const wxPoint& aCentre )
case S_POLYGON: case S_POLYGON:
for( auto iter = m_Poly.Iterate(); iter; iter++ ) for( auto iter = m_Poly.Iterate(); iter; iter++ )
{ {
iter->y = aCentre.y - (iter->y - aCentre.y); if( aFlipLeftRight )
iter->x = aCentre.x - ( iter->x - aCentre.x );
else
iter->y = aCentre.y - ( iter->y - aCentre.y );
} }
break; break;
case S_CURVE: case S_CURVE:
{ {
m_BezierC1.y = aCentre.y - (m_BezierC1.y - aCentre.y); if( aFlipLeftRight )
m_BezierC2.y = aCentre.y - (m_BezierC2.y - aCentre.y); {
m_BezierC1.x = aCentre.x - ( m_BezierC1.x - aCentre.x );
m_BezierC2.x = aCentre.x - ( m_BezierC2.x - aCentre.x );
}
else
{
m_BezierC1.y = aCentre.y - ( m_BezierC1.y - aCentre.y );
m_BezierC2.y = aCentre.y - ( m_BezierC2.y - aCentre.y );
}
// Rebuild the poly points shape // Rebuild the poly points shape
std::vector<wxPoint> ctrlPoints = { m_Start, m_BezierC1, m_BezierC2, m_End }; std::vector<wxPoint> ctrlPoints = { m_Start, m_BezierC1, m_BezierC2, m_End };

View File

@ -237,7 +237,7 @@ public:
virtual void Rotate( const wxPoint& aRotCentre, double aAngle ) override; virtual void Rotate( const wxPoint& aRotCentre, double aAngle ) override;
virtual void Flip( const wxPoint& aCentre ) override; virtual void Flip( const wxPoint& aCentre, bool aFlipLeftRight ) override;
/** /**
* Function TransformShapeWithClearanceToPolygon * Function TransformShapeWithClearanceToPolygon

View File

@ -281,7 +281,7 @@ EDA_ITEM* EDGE_MODULE::Clone() const
} }
void EDGE_MODULE::Flip( const wxPoint& aCentre ) void EDGE_MODULE::Flip( const wxPoint& aCentre, bool aFlipLeftRight )
{ {
wxPoint pt; wxPoint pt;
@ -293,21 +293,29 @@ void EDGE_MODULE::Flip( const wxPoint& aCentre )
default: default:
case S_SEGMENT: case S_SEGMENT:
case S_CURVE: case S_CURVE:
pt = GetStart(); if( aFlipLeftRight )
MIRROR( pt.y, aCentre.y ); {
SetStart( pt ); MIRROR( m_Start.x, aCentre.x );
MIRROR( m_End.x, aCentre.x );
pt = GetEnd(); MIRROR( m_BezierC1.x, aCentre.x );
MIRROR( pt.y, aCentre.y ); MIRROR( m_BezierC2.x, aCentre.x );
SetEnd( pt ); MIRROR( m_Start0.x, 0 );
MIRROR( m_End0.x, 0 );
MIRROR( m_Bezier0_C1.x, 0 );
MIRROR( m_Bezier0_C2.x, 0 );
}
else
{
MIRROR( m_Start.y, aCentre.y );
MIRROR( m_End.y, aCentre.y );
MIRROR( m_BezierC1.y, aCentre.y ); MIRROR( m_BezierC1.y, aCentre.y );
MIRROR( m_BezierC2.y, aCentre.y ); MIRROR( m_BezierC2.y, aCentre.y );
MIRROR( m_Start0.y, 0 ); MIRROR( m_Start0.y, 0 );
MIRROR( m_End0.y, 0 ); MIRROR( m_End0.y, 0 );
MIRROR( m_Bezier0_C1.y, 0 ); MIRROR( m_Bezier0_C1.y, 0 );
MIRROR( m_Bezier0_C2.y, 0 ); MIRROR( m_Bezier0_C2.y, 0 );
}
RebuildBezierToSegmentsPointsList( m_Width ); RebuildBezierToSegmentsPointsList( m_Width );
break; break;
@ -316,6 +324,9 @@ void EDGE_MODULE::Flip( const wxPoint& aCentre )
// footprint position, orientation 0 // footprint position, orientation 0
for( auto iter = m_Poly.Iterate(); iter; iter++ ) for( auto iter = m_Poly.Iterate(); iter; iter++ )
{ {
if( aFlipLeftRight )
MIRROR( iter->x, 0 );
else
MIRROR( iter->y, 0 ); MIRROR( iter->y, 0 );
} }
break; break;

View File

@ -86,7 +86,7 @@ public:
* not usual to flip an item alone, without flipping the parent footprint. * not usual to flip an item alone, without flipping the parent footprint.
* (consider Mirror for a mirror transform). * (consider Mirror for a mirror transform).
*/ */
void Flip( const wxPoint& aCentre ) override; void Flip( const wxPoint& aCentre, bool aFlipLeftRight ) override;
bool IsParentFlipped() const; bool IsParentFlipped() const;

View File

@ -112,9 +112,12 @@ void MARKER_PCB::Rotate(const wxPoint& aRotCentre, double aAngle)
} }
void MARKER_PCB::Flip(const wxPoint& aCentre ) void MARKER_PCB::Flip(const wxPoint& aCentre, bool aFlipLeftRight )
{ {
m_Pos.y = aCentre.y - (m_Pos.y - aCentre.y); if( aFlipLeftRight )
m_Pos.x = aCentre.x - ( m_Pos.x - aCentre.x );
else
m_Pos.y = aCentre.y - ( m_Pos.y - aCentre.y );
} }

View File

@ -86,7 +86,7 @@ public:
void Rotate( const wxPoint& aRotCentre, double aAngle ) override; void Rotate( const wxPoint& aRotCentre, double aAngle ) override;
void Flip( const wxPoint& aCentre ) override; void Flip( const wxPoint& aCentre, bool aFlipLeftRight ) override;
void Print( PCB_BASE_FRAME* aFrame, wxDC* aDC, const wxPoint& aOffset = ZeroOffset ) override void Print( PCB_BASE_FRAME* aFrame, wxDC* aDC, const wxPoint& aOffset = ZeroOffset ) override
{ {

View File

@ -312,53 +312,6 @@ void MODULE::Remove( BOARD_ITEM* aBoardItem )
} }
void MODULE::CopyNetlistSettings( MODULE* aModule, bool aCopyLocalSettings )
{
// Don't do anything foolish like trying to copy to yourself.
wxCHECK_RET( aModule != NULL && aModule != this, wxT( "Cannot copy to NULL or yourself." ) );
// Not sure what to do with the value field. Use netlist for now.
aModule->SetPosition( GetPosition() );
if( aModule->GetLayer() != GetLayer() )
aModule->Flip( aModule->GetPosition() );
if( aModule->GetOrientation() != GetOrientation() )
aModule->Rotate( aModule->GetPosition(), GetOrientation() );
aModule->SetLocked( IsLocked() );
if( aCopyLocalSettings )
{
aModule->SetLocalSolderMaskMargin( GetLocalSolderMaskMargin() );
aModule->SetLocalClearance( GetLocalClearance() );
aModule->SetLocalSolderPasteMargin( GetLocalSolderPasteMargin() );
aModule->SetLocalSolderPasteMarginRatio( GetLocalSolderPasteMarginRatio() );
aModule->SetZoneConnection( GetZoneConnection() );
aModule->SetThermalWidth( GetThermalWidth() );
aModule->SetThermalGap( GetThermalGap() );
}
for( auto pad : aModule->Pads() )
{
// Fix me: if aCopyLocalSettings == true, for "multiple" pads
// (set of pads having the same name/number) this is broken
// because we copy settings from the first pad found.
// When old and new footprints have very few differences, a better
// algo can be used.
D_PAD* oldPad = FindPadByName( pad->GetName() );
if( oldPad )
oldPad->CopyNetlistSettings( pad, aCopyLocalSettings );
}
// Not sure about copying description, keywords, 3D models or any other
// local user changes to footprint. Stick with the new footprint settings
// called out in the footprint loaded in the netlist.
aModule->CalculateBoundingBox();
}
void MODULE::Print( PCB_BASE_FRAME* aFrame, wxDC* aDC, const wxPoint& aOffset ) void MODULE::Print( PCB_BASE_FRAME* aFrame, wxDC* aDC, const wxPoint& aOffset )
{ {
for( auto pad : m_pads ) for( auto pad : m_pads )
@ -1009,11 +962,16 @@ void MODULE::Rotate( const wxPoint& aRotCentre, double aAngle )
} }
void MODULE::Flip( const wxPoint& aCentre ) void MODULE::Flip( const wxPoint& aCentre, bool aFlipLeftRight )
{ {
// Move module to its final position: // Move module to its final position:
wxPoint finalPos = m_Pos; wxPoint finalPos = m_Pos;
if( aFlipLeftRight )
MIRROR( finalPos.x, aCentre.x ); /// Mirror the X position
else
MIRROR( finalPos.y, aCentre.y ); /// Mirror the Y position MIRROR( finalPos.y, aCentre.y ); /// Mirror the Y position
SetPosition( finalPos ); SetPosition( finalPos );
// Flip layer // Flip layer
@ -1023,13 +981,13 @@ void MODULE::Flip( const wxPoint& aCentre )
m_Orient = -m_Orient; m_Orient = -m_Orient;
NORMALIZE_ANGLE_POS( m_Orient ); NORMALIZE_ANGLE_POS( m_Orient );
// Mirror pads to other side of board about the x axis, i.e. vertically. // Mirror pads to other side of board.
for( auto pad : m_pads ) for( auto pad : m_pads )
pad->Flip( m_Pos ); pad->Flip( m_Pos, aFlipLeftRight );
// Mirror reference and value. // Mirror reference and value.
m_Reference->Flip( m_Pos ); m_Reference->Flip( m_Pos, aFlipLeftRight );
m_Value->Flip( m_Pos ); m_Value->Flip( m_Pos, aFlipLeftRight );
// Reverse mirror module graphics and texts. // Reverse mirror module graphics and texts.
for( auto item : m_drawings ) for( auto item : m_drawings )
@ -1037,11 +995,11 @@ void MODULE::Flip( const wxPoint& aCentre )
switch( item->Type() ) switch( item->Type() )
{ {
case PCB_MODULE_EDGE_T: case PCB_MODULE_EDGE_T:
( (EDGE_MODULE*) item )->Flip( m_Pos ); static_cast<EDGE_MODULE*>( item )->Flip( m_Pos, aFlipLeftRight );
break; break;
case PCB_MODULE_TEXT_T: case PCB_MODULE_TEXT_T:
static_cast<TEXTE_MODULE*>( item )->Flip( m_Pos ); static_cast<TEXTE_MODULE*>( item )->Flip( m_Pos, aFlipLeftRight );
break; break;
default: default:

View File

@ -241,7 +241,7 @@ public:
void Rotate( const wxPoint& aRotCentre, double aAngle ) override; void Rotate( const wxPoint& aRotCentre, double aAngle ) override;
void Flip( const wxPoint& aCentre ) override; void Flip( const wxPoint& aCentre, bool aFlipLeftRight ) override;
/** /**
* Function MoveAnchorPosition * Function MoveAnchorPosition
@ -581,23 +581,6 @@ public:
virtual const BOX2I ViewBBox() const override; virtual const BOX2I ViewBBox() const override;
/**
* Function CopyNetlistSettings
* copies the netlist settings to \a aModule.
* Used to copy some footprint parameters when replacing a footprint by an other
* footprint when reading a netlist, or in exchange footprint dialog
*
* The netlist settings are all of the #MODULE settings not define by a #MODULE in
* a netlist. These setting include placement prms (position, orientation, side)
* and optionally local prms( clearances, zone connection type, etc).
* The reference designator, value, path, and physical geometry settings are not
* copied.
*
* @param aModule is the #MODULE to copy the settings to.
* @param aCopyLocalSettings = false to copy only module placement
*/
void CopyNetlistSettings( MODULE* aModule, bool aCopyLocalSettings );
/** /**
* static function IsLibNameValid * static function IsLibNameValid
* Test for validity of a name of a footprint to be used in a footprint library * Test for validity of a name of a footprint to be used in a footprint library

View File

@ -434,15 +434,22 @@ void D_PAD::SetOrientation( double aAngle )
} }
void D_PAD::Flip( const wxPoint& aCentre ) void D_PAD::Flip( const wxPoint& aCentre, bool aFlipLeftRight )
{ {
int y = GetPosition().y; if( aFlipLeftRight )
MIRROR( y, aCentre.y ); // invert about x axis. {
SetY( y ); MIRROR( m_Pos.x, aCentre.x );
MIRROR( m_Pos0.x, 0 );
MIRROR( m_Offset.x, 0 );
MIRROR( m_DeltaSize.x, 0 );
}
else
{
MIRROR( m_Pos.y, aCentre.y );
MIRROR( m_Pos0.y, 0 ); MIRROR( m_Pos0.y, 0 );
MIRROR( m_Offset.y, 0 ); MIRROR( m_Offset.y, 0 );
MIRROR( m_DeltaSize.y, 0 ); MIRROR( m_DeltaSize.y, 0 );
}
SetOrientation( -GetOrientation() ); SetOrientation( -GetOrientation() );
@ -586,26 +593,6 @@ bool D_PAD::IncrementPadName( bool aSkipUnconnectable, bool aFillSequenceGaps )
} }
void D_PAD::CopyNetlistSettings( D_PAD* aPad, bool aCopyLocalSettings )
{
// Don't do anything foolish like trying to copy to yourself.
wxCHECK_RET( aPad != NULL && aPad != this, wxT( "Cannot copy to NULL or yourself." ) );
aPad->SetNetCode( GetNetCode() );
if( aCopyLocalSettings )
{
aPad->SetLocalClearance( m_LocalClearance );
aPad->SetLocalSolderMaskMargin( m_LocalSolderMaskMargin );
aPad->SetLocalSolderPasteMargin( m_LocalSolderPasteMargin );
aPad->SetLocalSolderPasteMarginRatio( m_LocalSolderPasteMarginRatio );
aPad->SetZoneConnection( m_ZoneConnection );
aPad->SetThermalWidth( m_ThermalWidth );
aPad->SetThermalGap( m_ThermalGap );
}
}
int D_PAD::GetClearance( BOARD_CONNECTED_ITEM* aItem ) const int D_PAD::GetClearance( BOARD_CONNECTED_ITEM* aItem ) const
{ {
// A pad can have specific clearance parameters that // A pad can have specific clearance parameters that

View File

@ -347,7 +347,7 @@ public:
*/ */
const SHAPE_POLY_SET& GetCustomShapeAsPolygon() const { return m_customShapeAsPolygon; } const SHAPE_POLY_SET& GetCustomShapeAsPolygon() const { return m_customShapeAsPolygon; }
void Flip( const wxPoint& aCentre ) override; void Flip( const wxPoint& aCentre, bool aFlipLeftRight ) override;
/** /**
* Flip the basic shapes, in custom pads * Flip the basic shapes, in custom pads
@ -788,23 +788,6 @@ public:
virtual const BOX2I ViewBBox() const override; virtual const BOX2I ViewBBox() const override;
/**
* Function CopyNetlistSettings
* copies the netlist settings to \a aPad, and the net name.
* Used to copy some pad parameters when replacing a footprint by an other
* footprint when reading a netlist, or in exchange footprint dialog
*
* The netlist settings are all of the #D_PAD settings not define by a #D_PAD in
* a netlist.
* The copied settings are the net name and optionally include local clearance, etc.
* The pad physical geometry settings are not copied.
*
* @param aPad is the #D_PAD to copy the settings to.
* @param aCopyLocalSettings = false to copy only the net name
* true to also copy local prms
*/
void CopyNetlistSettings( D_PAD* aPad, bool aCopyLocalSettings );
virtual void SwapData( BOARD_ITEM* aImage ) override; virtual void SwapData( BOARD_ITEM* aImage ) override;
#if defined(DEBUG) #if defined(DEBUG)

View File

@ -158,9 +158,13 @@ void PCB_TARGET::Rotate(const wxPoint& aRotCentre, double aAngle)
} }
void PCB_TARGET::Flip(const wxPoint& aCentre ) void PCB_TARGET::Flip(const wxPoint& aCentre, bool aFlipLeftRight )
{ {
if( aFlipLeftRight )
m_Pos.x = aCentre.x - ( m_Pos.x - aCentre.x );
else
m_Pos.y = aCentre.y - ( m_Pos.y - aCentre.y ); m_Pos.y = aCentre.y - ( m_Pos.y - aCentre.y );
SetLayer( FlipLayer( GetLayer() ) ); SetLayer( FlipLayer( GetLayer() ) );
} }

View File

@ -81,7 +81,7 @@ public:
void Rotate( const wxPoint& aRotCentre, double aAngle ) override; void Rotate( const wxPoint& aRotCentre, double aAngle ) override;
void Flip( const wxPoint& aCentre ) override; void Flip( const wxPoint& aCentre, bool aFlipLeftRight ) override;
void Print( PCB_BASE_FRAME* aFrame, wxDC* DC, const wxPoint& offset = ZeroOffset ) override; void Print( PCB_BASE_FRAME* aFrame, wxDC* DC, const wxPoint& offset = ZeroOffset ) override;

View File

@ -135,8 +135,11 @@ void TEXTE_PCB::Rotate( const wxPoint& aRotCentre, double aAngle )
} }
void TEXTE_PCB::Flip( const wxPoint& aCentre ) void TEXTE_PCB::Flip( const wxPoint& aCentre, bool aFlipLeftRight )
{ {
if( aFlipLeftRight )
SetTextX( aCentre.x - ( GetTextPos().x - aCentre.x ) );
else
SetTextY( aCentre.y - ( GetTextPos().y - aCentre.y ) ); SetTextY( aCentre.y - ( GetTextPos().y - aCentre.y ) );
int copperLayerCount = GetBoard()->GetCopperLayerCount(); int copperLayerCount = GetBoard()->GetCopperLayerCount();

View File

@ -72,7 +72,7 @@ public:
void Rotate( const wxPoint& aRotCentre, double aAngle ) override; void Rotate( const wxPoint& aRotCentre, double aAngle ) override;
void Flip( const wxPoint& aCentre ) override; void Flip( const wxPoint& aCentre, bool aFlipLeftRight ) override;
void Print( PCB_BASE_FRAME* aFrame, wxDC* DC, const wxPoint& offset = ZeroOffset ) override; void Print( PCB_BASE_FRAME* aFrame, wxDC* DC, const wxPoint& offset = ZeroOffset ) override;

View File

@ -147,9 +147,12 @@ void TEXTE_MODULE::Rotate( const wxPoint& aRotCentre, double aAngle )
} }
void TEXTE_MODULE::Flip( const wxPoint& aCentre ) void TEXTE_MODULE::Flip( const wxPoint& aCentre, bool aFlipLeftRight )
{ {
// flipping the footprint is relative to the X axis // flipping the footprint is relative to the X axis
if( aFlipLeftRight )
SetTextX( ::Mirror( GetTextPos().x, aCentre.x ) );
else
SetTextY( ::Mirror( GetTextPos().y, aCentre.y ) ); SetTextY( ::Mirror( GetTextPos().y, aCentre.y ) );
SetTextAngle( -GetTextAngle() ); SetTextAngle( -GetTextAngle() );

View File

@ -111,7 +111,7 @@ public:
void Rotate( const wxPoint& aOffset, double aAngle ) override; void Rotate( const wxPoint& aOffset, double aAngle ) override;
/// Flip entity during module flip /// Flip entity during module flip
void Flip( const wxPoint& aCentre ) override; void Flip( const wxPoint& aCentre, bool aFlipLeftRight ) override;
bool IsParentFlipped() const; bool IsParentFlipped() const;

View File

@ -233,19 +233,36 @@ void TRACK::Rotate( const wxPoint& aRotCentre, double aAngle )
} }
void TRACK::Flip( const wxPoint& aCentre ) void TRACK::Flip( const wxPoint& aCentre, bool aFlipLeftRight )
{ {
m_Start.y = aCentre.y - (m_Start.y - aCentre.y); if( aFlipLeftRight )
m_End.y = aCentre.y - (m_End.y - aCentre.y); {
m_Start.x = aCentre.x - ( m_Start.x - aCentre.x );
m_End.x = aCentre.x - ( m_End.x - aCentre.x );
}
else
{
m_Start.y = aCentre.y - ( m_Start.y - aCentre.y );
m_End.y = aCentre.y - ( m_End.y - aCentre.y );
}
int copperLayerCount = GetBoard()->GetCopperLayerCount(); int copperLayerCount = GetBoard()->GetCopperLayerCount();
SetLayer( FlipLayer( GetLayer(), copperLayerCount ) ); SetLayer( FlipLayer( GetLayer(), copperLayerCount ) );
} }
void VIA::Flip( const wxPoint& aCentre ) void VIA::Flip( const wxPoint& aCentre, bool aFlipLeftRight )
{ {
m_Start.y = aCentre.y - (m_Start.y - aCentre.y); if( aFlipLeftRight )
m_End.y = aCentre.y - (m_End.y - aCentre.y); {
m_Start.x = aCentre.x - ( m_Start.x - aCentre.x );
m_End.x = aCentre.x - ( m_End.x - aCentre.x );
}
else
{
m_Start.y = aCentre.y - ( m_Start.y - aCentre.y );
m_End.y = aCentre.y - ( m_End.y - aCentre.y );
}
if( GetViaType() != VIA_THROUGH ) if( GetViaType() != VIA_THROUGH )
{ {

View File

@ -86,15 +86,15 @@ public:
// Do not create a copy constructor. The one generated by the compiler is adequate. // Do not create a copy constructor. The one generated by the compiler is adequate.
virtual void Move( const wxPoint& aMoveVector ) override void Move( const wxPoint& aMoveVector ) override
{ {
m_Start += aMoveVector; m_Start += aMoveVector;
m_End += aMoveVector; m_End += aMoveVector;
} }
virtual void Rotate( const wxPoint& aRotCentre, double aAngle ) override; void Rotate( const wxPoint& aRotCentre, double aAngle ) override;
virtual void Flip( const wxPoint& aCentre ) override; void Flip( const wxPoint& aCentre, bool aFlipLeftRight ) override;
void SetPosition( const wxPoint& aPos ) override { m_Start = aPos; } void SetPosition( const wxPoint& aPos ) override { m_Start = aPos; }
const wxPoint GetPosition() const override { return m_Start; } const wxPoint GetPosition() const override { return m_Start; }
@ -325,14 +325,14 @@ public:
EDA_ITEM* Clone() const override; EDA_ITEM* Clone() const override;
virtual void ViewGetLayers( int aLayers[], int& aCount ) const override; void ViewGetLayers( int aLayers[], int& aCount ) const override;
virtual unsigned int ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const override; unsigned int ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const override;
virtual void Flip( const wxPoint& aCentre ) override; void Flip( const wxPoint& aCentre, bool aFlipLeftRight ) override;
#if defined (DEBUG) #if defined (DEBUG)
virtual void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); } void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
#endif #endif
VIATYPE_T GetViaType() const { return m_ViaType; } VIATYPE_T GetViaType() const { return m_ViaType; }

View File

@ -584,36 +584,13 @@ bool ZONE_CONTAINER::HitTest( const EDA_RECT& aRect, bool aContained, int aAccur
else // Test for intersection between aBox and the polygon else // Test for intersection between aBox and the polygon
// For a polygon, using its bounding box has no sense here // For a polygon, using its bounding box has no sense here
{ {
// Fast test: if aBox is outside the polygon bounding box, // Fast test: if aBox is outside the polygon bounding box, rectangles cannot intersect
// rectangles cannot intersect
if( !arect.Intersects( bbox ) ) if( !arect.Intersects( bbox ) )
return false; return false;
// aBox is inside the polygon bounding box,
// and can intersect the polygon: use a fine test.
// aBox intersects the polygon if at least one aBox corner
// is inside the polygon
/*
wxPoint origin = arect.GetOrigin();
int w = arect.GetWidth();
int h = arect.GetHeight();
if ( HitTestInsideZone( origin ) ||
HitTestInsideZone( origin + wxPoint( w, 0 ) ) ||
HitTestInsideZone( origin + wxPoint( w, h ) ) ||
HitTestInsideZone( origin + wxPoint( 0, h ) ) )
{
return true;
}
*/
// No corner inside aBox, but outlines can intersect aBox
// if one of outline corners is inside aBox
int count = m_Poly->TotalVertices(); int count = m_Poly->TotalVertices();
for( int ii =0; ii < count; ii++ )
for( int ii = 0; ii < count; ii++ )
{ {
auto vertex = m_Poly->Vertex( ii ); auto vertex = m_Poly->Vertex( ii );
auto vertexNext = m_Poly->Vertex( ( ii + 1 ) % count ); auto vertexNext = m_Poly->Vertex( ( ii + 1 ) % count );
@ -681,7 +658,7 @@ void ZONE_CONTAINER::GetMsgPanelInfo( EDA_UNITS_T aUnits, std::vector< MSG_PANEL
if( m_CornerSelection != nullptr && m_CornerSelection->m_contour > 0 ) if( m_CornerSelection != nullptr && m_CornerSelection->m_contour > 0 )
msg << wxT( " " ) << _( "(Cutout)" ); msg << wxT( " " ) << _( "(Cutout)" );
aList.push_back( MSG_PANEL_ITEM( _( "Type" ), msg, DARKCYAN ) ); aList.emplace_back( MSG_PANEL_ITEM( _( "Type" ), msg, DARKCYAN ) );
if( GetIsKeepout() ) if( GetIsKeepout() )
{ {
@ -696,7 +673,7 @@ void ZONE_CONTAINER::GetMsgPanelInfo( EDA_UNITS_T aUnits, std::vector< MSG_PANEL
if( GetDoNotAllowCopperPour() ) if( GetDoNotAllowCopperPour() )
AccumulateDescription( msg, _("No copper pour") ); AccumulateDescription( msg, _("No copper pour") );
aList.push_back( MSG_PANEL_ITEM( _( "Keepout" ), msg, RED ) ); aList.emplace_back( MSG_PANEL_ITEM( _( "Keepout" ), msg, RED ) );
} }
else if( IsOnCopperLayer() ) else if( IsOnCopperLayer() )
{ {
@ -712,25 +689,25 @@ void ZONE_CONTAINER::GetMsgPanelInfo( EDA_UNITS_T aUnits, std::vector< MSG_PANEL
else // a netcode < 0 is an error else // a netcode < 0 is an error
msg = wxT( "<error>" ); msg = wxT( "<error>" );
aList.push_back( MSG_PANEL_ITEM( _( "NetName" ), msg, RED ) ); aList.emplace_back( MSG_PANEL_ITEM( _( "NetName" ), msg, RED ) );
// Display net code : (useful in test or debug) // Display net code : (useful in test or debug)
msg.Printf( wxT( "%d" ), GetNetCode() ); msg.Printf( wxT( "%d" ), GetNetCode() );
aList.push_back( MSG_PANEL_ITEM( _( "NetCode" ), msg, RED ) ); aList.emplace_back( MSG_PANEL_ITEM( _( "NetCode" ), msg, RED ) );
// Display priority level // Display priority level
msg.Printf( wxT( "%d" ), GetPriority() ); msg.Printf( wxT( "%d" ), GetPriority() );
aList.push_back( MSG_PANEL_ITEM( _( "Priority" ), msg, BLUE ) ); aList.emplace_back( MSG_PANEL_ITEM( _( "Priority" ), msg, BLUE ) );
} }
else else
{ {
aList.push_back( MSG_PANEL_ITEM( _( "Non Copper Zone" ), wxEmptyString, RED ) ); aList.emplace_back( MSG_PANEL_ITEM( _( "Non Copper Zone" ), wxEmptyString, RED ) );
} }
aList.push_back( MSG_PANEL_ITEM( _( "Layer" ), GetLayerName(), BROWN ) ); aList.emplace_back( MSG_PANEL_ITEM( _( "Layer" ), GetLayerName(), BROWN ) );
msg.Printf( wxT( "%d" ), (int) m_Poly->TotalVertices() ); msg.Printf( wxT( "%d" ), (int) m_Poly->TotalVertices() );
aList.push_back( MSG_PANEL_ITEM( _( "Vertices" ), msg, BLUE ) ); aList.emplace_back( MSG_PANEL_ITEM( _( "Vertices" ), msg, BLUE ) );
switch( m_FillMode ) switch( m_FillMode )
{ {
@ -742,16 +719,16 @@ void ZONE_CONTAINER::GetMsgPanelInfo( EDA_UNITS_T aUnits, std::vector< MSG_PANEL
msg = _( "Unknown" ); break; msg = _( "Unknown" ); break;
} }
aList.push_back( MSG_PANEL_ITEM( _( "Fill Mode" ), msg, BROWN ) ); aList.emplace_back( MSG_PANEL_ITEM( _( "Fill Mode" ), msg, BROWN ) );
// Useful for statistics : // Useful for statistics :
msg.Printf( wxT( "%d" ), (int) m_HatchLines.size() ); msg.Printf( wxT( "%d" ), (int) m_HatchLines.size() );
aList.push_back( MSG_PANEL_ITEM( _( "Hatch Lines" ), msg, BLUE ) ); aList.emplace_back( MSG_PANEL_ITEM( _( "Hatch Lines" ), msg, BLUE ) );
if( !m_FilledPolysList.IsEmpty() ) if( !m_FilledPolysList.IsEmpty() )
{ {
msg.Printf( wxT( "%d" ), m_FilledPolysList.TotalVertices() ); msg.Printf( wxT( "%d" ), m_FilledPolysList.TotalVertices() );
aList.push_back( MSG_PANEL_ITEM( _( "Corner Count" ), msg, BLUE ) ); aList.emplace_back( MSG_PANEL_ITEM( _( "Corner Count" ), msg, BLUE ) );
} }
} }
@ -761,16 +738,16 @@ void ZONE_CONTAINER::GetMsgPanelInfo( EDA_UNITS_T aUnits, std::vector< MSG_PANEL
void ZONE_CONTAINER::Move( const wxPoint& offset ) void ZONE_CONTAINER::Move( const wxPoint& offset )
{ {
/* move outlines */ /* move outlines */
m_Poly->Move( VECTOR2I( offset ) ); m_Poly->Move( offset );
Hatch(); Hatch();
m_FilledPolysList.Move( VECTOR2I( offset.x, offset.y ) ); m_FilledPolysList.Move( offset );
for( unsigned ic = 0; ic < m_FillSegmList.size(); ic++ ) for( SEG& seg : m_FillSegmList )
{ {
m_FillSegmList[ic].A += VECTOR2I(offset); seg.A += VECTOR2I( offset );
m_FillSegmList[ic].B += VECTOR2I(offset); seg.B += VECTOR2I( offset );
} }
} }
@ -820,9 +797,9 @@ void ZONE_CONTAINER::Rotate( const wxPoint& centre, double angle )
} }
void ZONE_CONTAINER::Flip( const wxPoint& aCentre ) void ZONE_CONTAINER::Flip( const wxPoint& aCentre, bool aFlipLeftRight )
{ {
Mirror( aCentre ); Mirror( aCentre, aFlipLeftRight );
int copperLayerCount = GetBoard()->GetCopperLayerCount(); int copperLayerCount = GetBoard()->GetCopperLayerCount();
if( GetIsKeepout() ) if( GetIsKeepout() )
@ -836,26 +813,38 @@ void ZONE_CONTAINER::Flip( const wxPoint& aCentre )
} }
void ZONE_CONTAINER::Mirror( const wxPoint& mirror_ref ) void ZONE_CONTAINER::Mirror( const wxPoint& aMirrorRef, bool aMirrorLeftRight )
{ {
for( auto iterator = m_Poly->IterateWithHoles(); iterator; iterator++ ) for( auto iterator = m_Poly->IterateWithHoles(); iterator; iterator++ )
{ {
int py = mirror_ref.y - iterator->y; if( aMirrorLeftRight )
iterator->y = py + mirror_ref.y; iterator->x = ( aMirrorRef.x - iterator->x ) + aMirrorRef.x;
else
iterator->y = ( aMirrorRef.y - iterator->y ) + aMirrorRef.y;
} }
Hatch(); Hatch();
for( auto ic = m_FilledPolysList.Iterate(); ic; ++ic ) for( auto ic = m_FilledPolysList.Iterate(); ic; ++ic )
{ {
int py = mirror_ref.y - ic->y; if( aMirrorLeftRight )
ic->y = py + mirror_ref.y; ic->x = ( aMirrorRef.x - ic->x ) + aMirrorRef.x;
else
ic->y = ( aMirrorRef.y - ic->y ) + aMirrorRef.y;
} }
for( unsigned ic = 0; ic < m_FillSegmList.size(); ic++ ) for( SEG& seg : m_FillSegmList )
{ {
MIRROR( m_FillSegmList[ic].A.y, mirror_ref.y ); if( aMirrorLeftRight )
MIRROR( m_FillSegmList[ic].B.y, mirror_ref.y ); {
MIRROR( seg.A.x, aMirrorRef.x );
MIRROR( seg.B.x, aMirrorRef.x );
}
else
{
MIRROR( seg.A.y, aMirrorRef.y );
MIRROR( seg.B.y, aMirrorRef.y );
}
} }
} }
@ -1117,7 +1106,7 @@ void ZONE_CONTAINER::Hatch()
// else push 2 small lines // else push 2 small lines
if( m_hatchStyle == DIAGONAL_FULL || std::abs( dx ) < 2 * hatch_line_len ) if( m_hatchStyle == DIAGONAL_FULL || std::abs( dx ) < 2 * hatch_line_len )
{ {
m_HatchLines.push_back( SEG( pointbuffer[ip], pointbuffer[ip + 1] ) ); m_HatchLines.emplace_back( SEG( pointbuffer[ip], pointbuffer[ip + 1] ) );
} }
else else
{ {
@ -1134,9 +1123,9 @@ void ZONE_CONTAINER::Hatch()
int y1 = KiROUND( pointbuffer[ip].y + dx * slope ); int y1 = KiROUND( pointbuffer[ip].y + dx * slope );
int y2 = KiROUND( pointbuffer[ip + 1].y - dx * slope ); int y2 = KiROUND( pointbuffer[ip + 1].y - dx * slope );
m_HatchLines.push_back(SEG(pointbuffer[ip].x, pointbuffer[ip].y, x1, y1)); m_HatchLines.emplace_back( SEG( pointbuffer[ip].x, pointbuffer[ip].y, x1, y1 ) );
m_HatchLines.push_back( SEG( pointbuffer[ip+1].x, pointbuffer[ip+1].y, x2, y2 ) ); m_HatchLines.emplace_back( SEG( pointbuffer[ip+1].x, pointbuffer[ip+1].y, x2, y2 ) );
} }
} }
} }

View File

@ -400,15 +400,16 @@ public:
* (like Mirror() but changes layer) * (like Mirror() but changes layer)
* @param aCentre - the rotation point. * @param aCentre - the rotation point.
*/ */
virtual void Flip( const wxPoint& aCentre ) override; virtual void Flip( const wxPoint& aCentre, bool aFlipLeftRight ) override;
/** /**
* Function Mirror * Function Mirror
* Mirror the outlines , relative to a given horizontal axis * Mirror the outlines , relative to a given horizontal axis
* the layer is not changed * the layer is not changed
* @param mirror_ref = vertical axis position * @param aMirrorRef = axis position
* @param aMirrorLeftRight mirror across Y axis (otherwise mirror across X)
*/ */
void Mirror( const wxPoint& mirror_ref ); void Mirror( const wxPoint& aMirrorRef, bool aMirrorLeftRight );
/** /**
* Function GetClass * Function GetClass

View File

@ -716,7 +716,7 @@ bool DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataFromWindow()
change_layer = true; change_layer = true;
if( change_layer ) if( change_layer )
m_footprint->Flip( m_footprint->GetPosition() ); m_footprint->Flip( m_footprint->GetPosition(), m_frame->Settings().m_FlipLeftRight );
std::list<MODULE_3D_SETTINGS>* draw3D = &m_footprint->Models(); std::list<MODULE_3D_SETTINGS>* draw3D = &m_footprint->Models();
draw3D->clear(); draw3D->clear();

View File

@ -403,13 +403,28 @@ void PCB_EDIT_FRAME::Exchange_Module( MODULE* aSrc, MODULE* aDest, BOARD_COMMIT&
{ {
aDest->SetParent( GetBoard() ); aDest->SetParent( GetBoard() );
/* place module without ratsnest refresh: this will be made later
* when all modules are on board */
PlaceModule( aDest, false ); PlaceModule( aDest, false );
// Copy full placement and pad net names (when possible) // Copy full placement, locked flag and pad net names (when possible) but not local
// but not local settings like clearances (use library values) // settings like clearances (use library values)
aSrc->CopyNetlistSettings( aDest, false ); //
aDest->SetPosition( aSrc->GetPosition() );
if( aDest->GetLayer() != aSrc->GetLayer() )
aDest->Flip( aDest->GetPosition(), m_configSettings.m_FlipLeftRight );
if( aDest->GetOrientation() != aSrc->GetOrientation() )
aDest->Rotate( aDest->GetPosition(), aSrc->GetOrientation() );
aDest->SetLocked( aSrc->IsLocked() );
for( auto pad : aDest->Pads() )
{
D_PAD* oldPad = aSrc->FindPadByName( pad->GetName() );
if( oldPad )
pad->SetNetCode( oldPad->GetNetCode() );
}
// Copy reference // Copy reference
processTextItem( aSrc->Reference(), aDest->Reference(), processTextItem( aSrc->Reference(), aDest->Reference(),
@ -443,6 +458,7 @@ void PCB_EDIT_FRAME::Exchange_Module( MODULE* aSrc, MODULE* aDest, BOARD_COMMIT&
// Updating other parameters // Updating other parameters
aDest->SetTimeStamp( aSrc->GetTimeStamp() ); aDest->SetTimeStamp( aSrc->GetTimeStamp() );
aDest->SetPath( aSrc->GetPath() ); aDest->SetPath( aSrc->GetPath() );
aDest->CalculateBoundingBox();
aCommit.Remove( aSrc ); aCommit.Remove( aSrc );
aCommit.Add( aDest ); aCommit.Add( aDest );

View File

@ -62,6 +62,7 @@ bool PANEL_PCBNEW_SETTINGS::TransferDataToWindow()
m_magneticGraphicsChoice->SetSelection( !general_opts.m_MagneticGraphics ); m_magneticGraphicsChoice->SetSelection( !general_opts.m_MagneticGraphics );
m_UseEditKeyForWidth->SetValue( general_opts.m_EditHotkeyChangesTrackWidth ); m_UseEditKeyForWidth->SetValue( general_opts.m_EditHotkeyChangesTrackWidth );
m_dragSelects->SetValue( general_opts.m_DragSelects ); m_dragSelects->SetValue( general_opts.m_DragSelects );
m_FlipLeftRight->SetValue( general_opts.m_FlipLeftRight );
m_Show_Page_Limits->SetValue( m_Frame->ShowPageLimits() ); m_Show_Page_Limits->SetValue( m_Frame->ShowPageLimits() );
@ -84,6 +85,7 @@ bool PANEL_PCBNEW_SETTINGS::TransferDataFromWindow()
m_Frame->Settings().m_MagneticGraphics = !m_magneticGraphicsChoice->GetSelection(); m_Frame->Settings().m_MagneticGraphics = !m_magneticGraphicsChoice->GetSelection();
m_Frame->Settings().m_EditHotkeyChangesTrackWidth = m_UseEditKeyForWidth->GetValue(); m_Frame->Settings().m_EditHotkeyChangesTrackWidth = m_UseEditKeyForWidth->GetValue();
m_Frame->Settings().m_DragSelects = m_dragSelects->GetValue(); m_Frame->Settings().m_DragSelects = m_dragSelects->GetValue();
m_Frame->Settings().m_FlipLeftRight = m_FlipLeftRight->GetValue();
m_Frame->SetShowPageLimits( m_Show_Page_Limits->GetValue() ); m_Frame->SetShowPageLimits( m_Show_Page_Limits->GetValue() );

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 23 2019) // C++ code generated with wxFormBuilder (version Dec 30 2017)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO *NOT* EDIT THIS FILE! // PLEASE DO *NOT* EDIT THIS FILE!
@ -9,7 +9,7 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
PANEL_PCBNEW_SETTINGS_BASE::PANEL_PCBNEW_SETTINGS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name ) PANEL_PCBNEW_SETTINGS_BASE::PANEL_PCBNEW_SETTINGS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style )
{ {
wxBoxSizer* bPanelSizer; wxBoxSizer* bPanelSizer;
bPanelSizer = new wxBoxSizer( wxHORIZONTAL ); bPanelSizer = new wxBoxSizer( wxHORIZONTAL );
@ -39,10 +39,6 @@ PANEL_PCBNEW_SETTINGS_BASE::PANEL_PCBNEW_SETTINGS_BASE( wxWindow* parent, wxWind
wxStaticBoxSizer* bOptionsSizer; wxStaticBoxSizer* bOptionsSizer;
bOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Editing Options") ), wxVERTICAL ); bOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Editing Options") ), wxVERTICAL );
m_Show_Page_Limits = new wxCheckBox( bOptionsSizer->GetStaticBox(), wxID_ANY, _("Show page limits"), wxDefaultPosition, wxDefaultSize, 0 );
m_Show_Page_Limits->SetValue(true);
bOptionsSizer->Add( m_Show_Page_Limits, 0, wxALL, 5 );
m_Segments_45_Only_Ctrl = new wxCheckBox( bOptionsSizer->GetStaticBox(), wxID_SEGMENTS45, _("L&imit graphic lines to H, V and 45 degrees"), wxDefaultPosition, wxDefaultSize, 0 ); m_Segments_45_Only_Ctrl = new wxCheckBox( bOptionsSizer->GetStaticBox(), wxID_SEGMENTS45, _("L&imit graphic lines to H, V and 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.") ); m_Segments_45_Only_Ctrl->SetToolTip( _("Force line segment directions to H, V or 45 degrees when drawing on technical layers.") );
@ -58,6 +54,9 @@ PANEL_PCBNEW_SETTINGS_BASE::PANEL_PCBNEW_SETTINGS_BASE( wxWindow* parent, wxWind
bOptionsSizer->Add( m_dragSelects, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 ); bOptionsSizer->Add( m_dragSelects, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 );
m_FlipLeftRight = new wxCheckBox( bOptionsSizer->GetStaticBox(), wxID_ANY, _("Flip board items L/R (default is T/B)"), wxDefaultPosition, wxDefaultSize, 0 );
bOptionsSizer->Add( m_FlipLeftRight, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
wxFlexGridSizer* fgSizer12; wxFlexGridSizer* fgSizer12;
fgSizer12 = new wxFlexGridSizer( 0, 2, 0, 0 ); fgSizer12 = new wxFlexGridSizer( 0, 2, 0, 0 );
fgSizer12->AddGrowableCol( 1 ); fgSizer12->AddGrowableCol( 1 );
@ -136,7 +135,7 @@ PANEL_PCBNEW_SETTINGS_BASE::PANEL_PCBNEW_SETTINGS_BASE( wxWindow* parent, wxWind
fgSizer2->Add( m_magneticGraphicsChoice, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT, 5 ); fgSizer2->Add( m_magneticGraphicsChoice, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT, 5 );
sbMagnets->Add( fgSizer2, 1, wxEXPAND, 5 ); sbMagnets->Add( fgSizer2, 1, wxEXPAND|wxBOTTOM, 5 );
bRightSizer->Add( sbMagnets, 1, wxEXPAND, 5 ); bRightSizer->Add( sbMagnets, 1, wxEXPAND, 5 );
@ -145,17 +144,27 @@ PANEL_PCBNEW_SETTINGS_BASE::PANEL_PCBNEW_SETTINGS_BASE( wxWindow* parent, wxWind
sbSizer3 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Ratsnest") ), wxVERTICAL ); sbSizer3 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Ratsnest") ), wxVERTICAL );
m_showGlobalRatsnest = new wxCheckBox( sbSizer3->GetStaticBox(), wxID_ANY, _("Show ratsnest"), wxDefaultPosition, wxDefaultSize, 0 ); m_showGlobalRatsnest = new wxCheckBox( sbSizer3->GetStaticBox(), wxID_ANY, _("Show ratsnest"), wxDefaultPosition, wxDefaultSize, 0 );
sbSizer3->Add( m_showGlobalRatsnest, 0, wxALL, 5 ); sbSizer3->Add( m_showGlobalRatsnest, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_showSelectedRatsnest = new wxCheckBox( sbSizer3->GetStaticBox(), wxID_ANY, _("Always show selected ratsnest"), wxDefaultPosition, wxDefaultSize, 0 ); m_showSelectedRatsnest = new wxCheckBox( sbSizer3->GetStaticBox(), wxID_ANY, _("Always show selected ratsnest"), wxDefaultPosition, wxDefaultSize, 0 );
sbSizer3->Add( m_showSelectedRatsnest, 0, wxALL, 5 ); sbSizer3->Add( m_showSelectedRatsnest, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_OptDisplayCurvedRatsnestLines = new wxCheckBox( sbSizer3->GetStaticBox(), wxID_ANY, _("Show ratsnest with curved lines"), wxDefaultPosition, wxDefaultSize, 0 ); m_OptDisplayCurvedRatsnestLines = new wxCheckBox( sbSizer3->GetStaticBox(), wxID_ANY, _("Show ratsnest with curved lines"), wxDefaultPosition, wxDefaultSize, 0 );
sbSizer3->Add( m_OptDisplayCurvedRatsnestLines, 0, wxALL, 5 ); sbSizer3->Add( m_OptDisplayCurvedRatsnestLines, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
bRightSizer->Add( sbSizer3, 1, wxEXPAND, 5 ); bRightSizer->Add( sbSizer3, 1, wxEXPAND, 5 );
wxStaticBoxSizer* sbSizer4;
sbSizer4 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Annotations") ), wxVERTICAL );
m_Show_Page_Limits = new wxCheckBox( sbSizer4->GetStaticBox(), wxID_ANY, _("Show page limits"), wxDefaultPosition, wxDefaultSize, 0 );
m_Show_Page_Limits->SetValue(true);
sbSizer4->Add( m_Show_Page_Limits, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
bRightSizer->Add( sbSizer4, 1, wxEXPAND, 5 );
bMargins->Add( bRightSizer, 1, wxEXPAND|wxTOP|wxRIGHT, 5 ); bMargins->Add( bRightSizer, 1, wxEXPAND|wxTOP|wxRIGHT, 5 );

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project> <wxFormBuilder_Project>
<FileVersion major="1" minor="15" /> <FileVersion major="1" minor="13" />
<object class="Project" expanded="1"> <object class="Project" expanded="1">
<property name="class_decoration"></property> <property name="class_decoration"></property>
<property name="code_generation">C++</property> <property name="code_generation">C++</property>
@ -14,8 +14,6 @@
<property name="file">panel_pcbnew_settings_base</property> <property name="file">panel_pcbnew_settings_base</property>
<property name="first_id">1000</property> <property name="first_id">1000</property>
<property name="help_provider">none</property> <property name="help_provider">none</property>
<property name="image_path_wrapper_function_name"></property>
<property name="indent_with_spaces"></property>
<property name="internationalize">1</property> <property name="internationalize">1</property>
<property name="name">PanelPcbnewSettings</property> <property name="name">PanelPcbnewSettings</property>
<property name="namespace"></property> <property name="namespace"></property>
@ -26,7 +24,6 @@
<property name="skip_php_events">1</property> <property name="skip_php_events">1</property>
<property name="skip_python_events">1</property> <property name="skip_python_events">1</property>
<property name="ui_table">UI</property> <property name="ui_table">UI</property>
<property name="use_array_enum">0</property>
<property name="use_enum">1</property> <property name="use_enum">1</property>
<property name="use_microsoft_bom">0</property> <property name="use_microsoft_bom">0</property>
<object class="Panel" expanded="1"> <object class="Panel" expanded="1">
@ -51,6 +48,36 @@
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property> <property name="window_style">wxTAB_TRAVERSAL</property>
<event name="OnAuiFindManager"></event>
<event name="OnAuiPaneButton"></event>
<event name="OnAuiPaneClose"></event>
<event name="OnAuiPaneMaximize"></event>
<event name="OnAuiPaneRestore"></event>
<event name="OnAuiRender"></event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnInitDialog"></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 class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">bPanelSizer</property> <property name="name">bPanelSizer</property>
@ -138,6 +165,30 @@
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></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="OnRadioBox"></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="0"> <object class="sizeritem" expanded="0">
@ -204,6 +255,30 @@
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></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="OnRadioBox"></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"> <object class="sizeritem" expanded="1">
@ -218,70 +293,7 @@
<property name="orient">wxVERTICAL</property> <property name="orient">wxVERTICAL</property>
<property name="parent">1</property> <property name="parent">1</property>
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="0"> <event name="OnUpdateUI"></event>
<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">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_ANY</property>
<property name="label">Show page limits</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_Show_Page_Limits</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>
</object>
</object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxBOTTOM|wxLEFT|wxRIGHT</property> <property name="flag">wxBOTTOM|wxLEFT|wxRIGHT</property>
@ -344,6 +356,30 @@
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></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"> <object class="sizeritem" expanded="1">
@ -408,6 +444,30 @@
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></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"> <object class="sizeritem" expanded="1">
@ -472,6 +532,118 @@
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></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">wxBOTTOM|wxRIGHT|wxLEFT</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">Flip board items L/R (default is T/B)</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_FlipLeftRight</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">; forward_declare</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 class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
@ -523,7 +695,6 @@
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">&amp;Rotation angle:</property> <property name="label">&amp;Rotation angle:</property>
<property name="markup">0</property>
<property name="max_size"></property> <property name="max_size"></property>
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
@ -549,6 +720,29 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<property name="wrap">-1</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> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
@ -613,6 +807,33 @@
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></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="OnText"></event>
<event name="OnTextEnter"></event>
<event name="OnTextMaxLen"></event>
<event name="OnTextURL"></event>
<event name="OnUpdateUI"></event>
</object> </object>
</object> </object>
</object> </object>
@ -642,11 +863,12 @@
<property name="orient">wxVERTICAL</property> <property name="orient">wxVERTICAL</property>
<property name="parent">1</property> <property name="parent">1</property>
<property name="permission">none</property> <property name="permission">none</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND</property> <property name="flag">wxEXPAND|wxBOTTOM</property>
<property name="proportion">1</property> <property name="proportion">1</property>
<object class="wxFlexGridSizer" expanded="0"> <object class="wxFlexGridSizer" expanded="1">
<property name="cols">2</property> <property name="cols">2</property>
<property name="flexible_direction">wxBOTH</property> <property name="flexible_direction">wxBOTH</property>
<property name="growablecols"></property> <property name="growablecols"></property>
@ -691,7 +913,6 @@
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Snap to pads:</property> <property name="label">Snap to pads:</property>
<property name="markup">0</property>
<property name="max_size"></property> <property name="max_size"></property>
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
@ -717,6 +938,29 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<property name="wrap">-1</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> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
@ -781,6 +1025,30 @@
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnChoice"></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="0"> <object class="sizeritem" expanded="0">
@ -816,7 +1084,6 @@
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Snap to tracks:</property> <property name="label">Snap to tracks:</property>
<property name="markup">0</property>
<property name="max_size"></property> <property name="max_size"></property>
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
@ -842,6 +1109,29 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<property name="wrap">-1</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> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
@ -906,6 +1196,30 @@
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnChoice"></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="0"> <object class="sizeritem" expanded="0">
@ -941,7 +1255,6 @@
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="label">Snap to graphics:</property> <property name="label">Snap to graphics:</property>
<property name="markup">0</property>
<property name="max_size"></property> <property name="max_size"></property>
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
@ -967,6 +1280,29 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<property name="wrap">-1</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> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
@ -1031,6 +1367,30 @@
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnChoice"></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>
@ -1049,9 +1409,10 @@
<property name="orient">wxVERTICAL</property> <property name="orient">wxVERTICAL</property>
<property name="parent">1</property> <property name="parent">1</property>
<property name="permission">none</property> <property name="permission">none</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL</property> <property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxCheckBox" expanded="1"> <object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -1111,11 +1472,35 @@
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></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"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL</property> <property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxCheckBox" expanded="1"> <object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -1175,11 +1560,35 @@
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></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"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL</property> <property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxCheckBox" expanded="1"> <object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -1239,6 +1648,133 @@
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></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</property>
<property name="proportion">1</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label">Annotations</property>
<property name="minimum_size"></property>
<property name="name">sbSizer4</property>
<property name="orient">wxVERTICAL</property>
<property name="parent">1</property>
<property name="permission">none</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</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">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_ANY</property>
<property name="label">Show page limits</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_Show_Page_Limits</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>

View File

@ -1,11 +1,12 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 23 2019) // C++ code generated with wxFormBuilder (version Dec 30 2017)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO *NOT* EDIT THIS FILE! // PLEASE DO *NOT* EDIT THIS FILE!
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#pragma once #ifndef __PANEL_PCBNEW_SETTINGS_BASE_H__
#define __PANEL_PCBNEW_SETTINGS_BASE_H__
#include <wx/artprov.h> #include <wx/artprov.h>
#include <wx/xrc/xmlres.h> #include <wx/xrc/xmlres.h>
@ -43,10 +44,10 @@ class PANEL_PCBNEW_SETTINGS_BASE : public wxPanel
wxRadioBox* m_PolarDisplay; wxRadioBox* m_PolarDisplay;
wxRadioBox* m_UnitsSelection; wxRadioBox* m_UnitsSelection;
wxCheckBox* m_Show_Page_Limits;
wxCheckBox* m_Segments_45_Only_Ctrl; wxCheckBox* m_Segments_45_Only_Ctrl;
wxCheckBox* m_UseEditKeyForWidth; wxCheckBox* m_UseEditKeyForWidth;
wxCheckBox* m_dragSelects; wxCheckBox* m_dragSelects;
wxCheckBox* m_FlipLeftRight;
wxStaticText* m_staticTextRotationAngle; wxStaticText* m_staticTextRotationAngle;
wxTextCtrl* m_RotationAngle; wxTextCtrl* m_RotationAngle;
wxStaticText* m_staticText2; wxStaticText* m_staticText2;
@ -58,11 +59,13 @@ class PANEL_PCBNEW_SETTINGS_BASE : public wxPanel
wxCheckBox* m_showGlobalRatsnest; wxCheckBox* m_showGlobalRatsnest;
wxCheckBox* m_showSelectedRatsnest; wxCheckBox* m_showSelectedRatsnest;
wxCheckBox* m_OptDisplayCurvedRatsnestLines; wxCheckBox* m_OptDisplayCurvedRatsnestLines;
wxCheckBox* m_Show_Page_Limits;
public: public:
PANEL_PCBNEW_SETTINGS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); PANEL_PCBNEW_SETTINGS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL );
~PANEL_PCBNEW_SETTINGS_BASE(); ~PANEL_PCBNEW_SETTINGS_BASE();
}; };
#endif //__PANEL_PCBNEW_SETTINGS_BASE_H__

View File

@ -1237,8 +1237,8 @@ ZONE_CONTAINER* EAGLE_PLUGIN::loadPolygon( wxXmlNode* aPolyNode )
} }
void EAGLE_PLUGIN::orientModuleAndText( MODULE* m, const EELEMENT& e, void EAGLE_PLUGIN::orientModuleAndText( MODULE* m, const EELEMENT& e, const EATTR* nameAttr,
const EATTR* nameAttr, const EATTR* valueAttr ) const EATTR* valueAttr )
{ {
if( e.rot ) if( e.rot )
{ {
@ -1246,7 +1246,7 @@ void EAGLE_PLUGIN::orientModuleAndText( MODULE* m, const EELEMENT& e,
{ {
double orientation = e.rot->degrees + 180.0; double orientation = e.rot->degrees + 180.0;
m->SetOrientation( orientation * 10 ); m->SetOrientation( orientation * 10 );
m->Flip( m->GetPosition() ); m->Flip( m->GetPosition(), false );
} }
else else
m->SetOrientation( e.rot->degrees * 10 ); m->SetOrientation( e.rot->degrees * 10 );

View File

@ -318,7 +318,7 @@ void PCB_EDIT_FRAME::ExportToGenCAD( wxCommandEvent& aEvent )
if( module->GetLayer() == B_Cu ) if( module->GetLayer() == B_Cu )
{ {
module->Flip( module->GetPosition() ); module->Flip( module->GetPosition(), Settings().m_FlipLeftRight );
module->SetFlag( 1 ); module->SetFlag( 1 );
} }
} }
@ -352,7 +352,7 @@ void PCB_EDIT_FRAME::ExportToGenCAD( wxCommandEvent& aEvent )
{ {
if( module->GetFlag() ) if( module->GetFlag() )
{ {
module->Flip( module->GetPosition() ); module->Flip( module->GetPosition(), Settings().m_FlipLeftRight );
module->SetFlag( 0 ); module->SetFlag( 0 );
} }
} }

View File

@ -30,7 +30,6 @@
#include <wildcards_and_files_ext.h> #include <wildcards_and_files_ext.h>
#include <base_units.h> #include <base_units.h>
#include <trace_helpers.h> #include <trace_helpers.h>
#include <class_board.h> #include <class_board.h>
#include <class_module.h> #include <class_module.h>
#include <class_pcb_text.h> #include <class_pcb_text.h>
@ -44,7 +43,6 @@
#include <zones.h> #include <zones.h>
#include <kicad_plugin.h> #include <kicad_plugin.h>
#include <pcb_parser.h> #include <pcb_parser.h>
#include <wx/dir.h> #include <wx/dir.h>
#include <wx/filename.h> #include <wx/filename.h>
#include <wx/wfstream.h> #include <wx/wfstream.h>
@ -52,6 +50,7 @@
#include <memory.h> #include <memory.h>
#include <connectivity/connectivity_data.h> #include <connectivity/connectivity_data.h>
#include <convert_basic_shapes_to_polygon.h> // for enum RECT_CHAMFER_POSITIONS definition #include <convert_basic_shapes_to_polygon.h> // for enum RECT_CHAMFER_POSITIONS definition
#include <kiface_i.h>
using namespace PCB_KEYS_T; using namespace PCB_KEYS_T;
@ -2087,9 +2086,7 @@ const MODULE* PCB_IO::getFootprint( const wxString& aLibraryPath,
MODULE_CITER it = mods.find( aFootprintName ); MODULE_CITER it = mods.find( aFootprintName );
if( it == mods.end() ) if( it == mods.end() )
{ return nullptr;
return NULL;
}
return it->second->GetModule(); return it->second->GetModule();
} }
@ -2214,11 +2211,11 @@ void PCB_IO::FootprintSave( const wxString& aLibraryPath, const MODULE* aFootpri
// and it's time stamp must be 0, it should have no parent, orientation should // and it's time stamp must be 0, it should have no parent, orientation should
// be zero, and it should be on the front layer. // be zero, and it should be on the front layer.
module->SetTimeStamp( 0 ); module->SetTimeStamp( 0 );
module->SetParent( 0 ); module->SetParent( nullptr );
module->SetOrientation( 0 ); module->SetOrientation( 0 );
if( module->GetLayer() != F_Cu ) if( module->GetLayer() != F_Cu )
module->Flip( module->GetPosition() ); module->Flip( module->GetPosition(), m_board->GeneralSettings().m_FlipLeftRight );
wxLogTrace( traceKicadPcbPlugin, wxT( "Creating s-expr footprint file '%s'." ), fullPath ); wxLogTrace( traceKicadPcbPlugin, wxT( "Creating s-expr footprint file '%s'." ), fullPath );
mods.insert( footprintName, new FP_CACHE_ITEM( module, WX_FILENAME( fn.GetPath(), fullName ) ) ); mods.insert( footprintName, new FP_CACHE_ITEM( module, WX_FILENAME( fn.GetPath(), fullName ) ) );

View File

@ -134,7 +134,7 @@ bool FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD( MODULE* aModule )
// Put it on FRONT layer, // Put it on FRONT layer,
// because this is the default in ModEdit, and in libs // because this is the default in ModEdit, and in libs
if( newModule->GetLayer() != F_Cu ) if( newModule->GetLayer() != F_Cu )
newModule->Flip( newModule->GetPosition() ); newModule->Flip( newModule->GetPosition(), frame->Settings().m_FlipLeftRight );
// Put it in orientation 0, // Put it in orientation 0,
// because this is the default orientation in ModEdit, and in libs // because this is the default orientation in ModEdit, and in libs

View File

@ -171,7 +171,7 @@ void PCB_BASE_FRAME::SetBoard( BOARD* aBoard )
{ {
delete m_Pcb; delete m_Pcb;
m_Pcb = aBoard; m_Pcb = aBoard;
m_Pcb->SetColorsSettings( &Settings().Colors() ); m_Pcb->SetGeneralSettings( &Settings() );
} }
} }
@ -191,7 +191,7 @@ void PCB_BASE_FRAME::AddModuleToBoard( MODULE* module )
// Put it on FRONT layer, // Put it on FRONT layer,
// (Can be stored flipped if the lib is an archive built from a board) // (Can be stored flipped if the lib is an archive built from a board)
if( module->IsFlipped() ) if( module->IsFlipped() )
module->Flip( module->GetPosition() ); module->Flip( module->GetPosition(), m_configSettings.m_FlipLeftRight );
// Place it in orientation 0, // Place it in orientation 0,
// even if it is not saved with orientation 0 in lib // even if it is not saved with orientation 0 in lib

View File

@ -29,6 +29,7 @@ PCB_GENERAL_SETTINGS::PCB_GENERAL_SETTINGS( FRAME_T aFrameType ) :
m_Use45DegreeGraphicSegments( false ), m_Use45DegreeGraphicSegments( false ),
m_EditHotkeyChangesTrackWidth( false ), m_EditHotkeyChangesTrackWidth( false ),
m_DragSelects( true ), m_DragSelects( true ),
m_FlipLeftRight( false ),
m_MagneticPads( CAPTURE_CURSOR_IN_TRACK_TOOL ), m_MagneticPads( CAPTURE_CURSOR_IN_TRACK_TOOL ),
m_MagneticTracks( CAPTURE_CURSOR_IN_TRACK_TOOL ), m_MagneticTracks( CAPTURE_CURSOR_IN_TRACK_TOOL ),
m_MagneticGraphics( true ), m_MagneticGraphics( true ),
@ -44,6 +45,7 @@ PCB_GENERAL_SETTINGS::PCB_GENERAL_SETTINGS( FRAME_T aFrameType ) :
Add( "MagneticGraphics", &m_MagneticGraphics, true ); Add( "MagneticGraphics", &m_MagneticGraphics, true );
Add( "EditActionChangesTrackWidth", &m_EditHotkeyChangesTrackWidth, false ); Add( "EditActionChangesTrackWidth", &m_EditHotkeyChangesTrackWidth, false );
Add( "DragSelects", &m_DragSelects, true ); Add( "DragSelects", &m_DragSelects, true );
Add( "FlipLeftRight", &m_FlipLeftRight, false );
break; break;
case FRAME_PCB_MODULE_EDITOR: case FRAME_PCB_MODULE_EDITOR:

View File

@ -52,6 +52,8 @@ public:
bool m_EditHotkeyChangesTrackWidth; bool m_EditHotkeyChangesTrackWidth;
bool m_DragSelects; // True: Drag gesture always draws a selection box, bool m_DragSelects; // True: Drag gesture always draws a selection box,
// False: Drag will select an item and move it // False: Drag will select an item and move it
bool m_FlipLeftRight; // True: Flip footprints across Y axis
// False: Flip footprints across X axis
MAGNETIC_OPTIONS m_MagneticPads; MAGNETIC_OPTIONS m_MagneticPads;
MAGNETIC_OPTIONS m_MagneticTracks; MAGNETIC_OPTIONS m_MagneticTracks;

View File

@ -1737,7 +1737,7 @@ void SPECCTRA_DB::FlipMODULEs( BOARD* aBoard )
module->SetFlag( 0 ); module->SetFlag( 0 );
if( module->GetLayer() == B_Cu ) if( module->GetLayer() == B_Cu )
{ {
module->Flip( module->GetPosition() ); module->Flip( module->GetPosition(), aBoard->GeneralSettings().m_FlipLeftRight );
module->SetFlag( 1 ); module->SetFlag( 1 );
} }
} }
@ -1757,7 +1757,7 @@ void SPECCTRA_DB::RevertMODULEs( BOARD* aBoard )
{ {
if( module->GetFlag() ) if( module->GetFlag() )
{ {
module->Flip( module->GetPosition() ); module->Flip( module->GetPosition(), aBoard->GeneralSettings().m_FlipLeftRight );
module->SetFlag( 0 ); module->SetFlag( 0 );
} }
} }

View File

@ -379,7 +379,8 @@ void SPECCTRA_DB::FromSESSION( BOARD* aBoard )
if( module->GetLayer() != F_Cu ) if( module->GetLayer() != F_Cu )
{ {
// module is on copper layer (back) // module is on copper layer (back)
module->Flip( module->GetPosition() ); module->Flip( module->GetPosition(),
aBoard->GeneralSettings().m_FlipLeftRight );
} }
module->SetOrientation( orientation ); module->SetOrientation( orientation );
@ -391,7 +392,8 @@ void SPECCTRA_DB::FromSESSION( BOARD* aBoard )
if( module->GetLayer() != B_Cu ) if( module->GetLayer() != B_Cu )
{ {
// module is on component layer (front) // module is on component layer (front)
module->Flip( module->GetPosition() ); module->Flip( module->GetPosition(),
aBoard->GeneralSettings().m_FlipLeftRight );
} }
module->SetOrientation( orientation ); module->SetOrientation( orientation );

View File

@ -789,8 +789,10 @@ int DRAWING_TOOL::PlaceImportedGraphics( const TOOL_EVENT& aEvent )
} }
else if( evt->IsAction( &PCB_ACTIONS::flip ) ) else if( evt->IsAction( &PCB_ACTIONS::flip ) )
{ {
bool leftRight = m_frame->Settings().m_FlipLeftRight;
for( auto item : preview ) for( auto item : preview )
static_cast<BOARD_ITEM*>( item )->Flip( (wxPoint) cursorPos ); static_cast<BOARD_ITEM*>( item )->Flip( (wxPoint) cursorPos, leftRight);
m_view->Update( &preview ); m_view->Update( &preview );
} }

View File

@ -765,7 +765,8 @@ int EDIT_TOOL::Flip( const TOOL_EVENT& aEvent )
return 0; return 0;
updateModificationPoint( selection ); updateModificationPoint( selection );
auto modPoint = selection.GetReferencePoint(); VECTOR2I modPoint = selection.GetReferencePoint();
bool leftRight = frame()->Settings().m_FlipLeftRight;
// When editing modules, all items have the same parent // When editing modules, all items have the same parent
if( EditingModules() ) if( EditingModules() )
@ -776,7 +777,7 @@ int EDIT_TOOL::Flip( const TOOL_EVENT& aEvent )
if( !item->IsNew() && !EditingModules() ) if( !item->IsNew() && !EditingModules() )
m_commit->Modify( item ); m_commit->Modify( item );
static_cast<BOARD_ITEM*>( item )->Flip( modPoint ); static_cast<BOARD_ITEM*>( item )->Flip( modPoint, leftRight );
} }
if( !m_dragging ) if( !m_dragging )

View File

@ -728,7 +728,7 @@ int PCB_EDITOR_CONTROL::PlaceModule( const TOOL_EVENT& aEvent )
// Put it on FRONT layer, // Put it on FRONT layer,
// (Can be stored flipped if the lib is an archive built from a board) // (Can be stored flipped if the lib is an archive built from a board)
if( module->IsFlipped() ) if( module->IsFlipped() )
module->Flip( module->GetPosition() ); module->Flip( module->GetPosition(), m_frame->Settings().m_FlipLeftRight );
module->SetOrientation( 0 ); module->SetOrientation( 0 );
module->SetPosition( wxPoint( cursorPos.x, cursorPos.y ) ); module->SetPosition( wxPoint( cursorPos.x, cursorPos.y ) );

View File

@ -190,7 +190,7 @@ void PCB_TOOL_BASE::doInteractiveItemPlacement( INTERACTIVE_PLACER_BASE* aPlacer
} }
else if( evt->IsAction( &PCB_ACTIONS::flip ) && ( aOptions & IPO_FLIP ) ) else if( evt->IsAction( &PCB_ACTIONS::flip ) && ( aOptions & IPO_FLIP ) )
{ {
newItem->Flip( newItem->GetPosition() ); newItem->Flip( newItem->GetPosition(), frame()->Settings().m_FlipLeftRight );
view()->Update( &preview ); view()->Update( &preview );
} }
} }

View File

@ -521,7 +521,7 @@ void PCB_BASE_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool
case UR_FLIPPED: case UR_FLIPPED:
{ {
BOARD_ITEM* item = (BOARD_ITEM*) eda_item; BOARD_ITEM* item = (BOARD_ITEM*) eda_item;
item->Flip( aList->m_TransformPoint ); item->Flip( aList->m_TransformPoint, m_configSettings.m_FlipLeftRight );
view->Update( item, KIGFX::LAYERS ); view->Update( item, KIGFX::LAYERS );
connectivity->Update( item ); connectivity->Update( item );
} }