Remove dialog-based primitive editing in favour of Pad Edit Mode.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/13561
This commit is contained in:
Jeff Young 2023-09-04 20:23:41 +01:00
parent 0e26f3ab30
commit 7c718db5d2
11 changed files with 87 additions and 7120 deletions

View File

@ -114,10 +114,8 @@ set( PCBNEW_DIALOGS
dialogs/dialog_import_netlist_base.cpp
dialogs/dialog_non_copper_zones_properties.cpp
dialogs/dialog_non_copper_zones_properties_base.cpp
dialogs/dialog_pad_basicshapes_properties.cpp
dialogs/dialog_pad_properties.cpp
dialogs/dialog_pad_properties_base.cpp
dialogs/dialog_pad_primitives_properties_base.cpp
dialogs/dialog_plot.cpp
dialogs/dialog_plot_base.cpp
dialogs/dialog_pns_diff_pair_dimensions.cpp

View File

@ -1,650 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <algorithm>
#include <confirm.h>
#include <trigo.h>
#include <pcb_base_frame.h>
#include <base_units.h>
#include <widgets/wx_grid.h>
#include <widgets/std_bitmap_button.h>
#include <footprint.h>
#include <math/util.h> // for KiROUND
#include <bitmaps.h>
#include <wx/dcclient.h>
#include <dialog_pad_properties.h>
#include <dialog_pad_primitives_properties.h>
DIALOG_PAD_PRIMITIVES_PROPERTIES::DIALOG_PAD_PRIMITIVES_PROPERTIES( wxWindow* aParent,
PCB_BASE_FRAME* aFrame,
PCB_SHAPE* aShape ) :
DIALOG_PAD_PRIMITIVES_PROPERTIES_BASE( aParent ),
m_shape( aShape ),
m_startX( aFrame, m_startXLabel, m_startXCtrl, m_startXUnits ),
m_startY( aFrame, m_startYLabel, m_startYCtrl, m_startYUnits ),
m_ctrl1X( aFrame, m_ctrl1XLabel, m_ctrl1XCtrl, m_ctrl1XUnits ),
m_ctrl1Y( aFrame, m_ctrl1YLabel, m_ctrl1YCtrl, m_ctrl1YUnits ),
m_ctrl2X( aFrame, m_ctrl2XLabel, m_ctrl2XCtrl, m_ctrl2XUnits ),
m_ctrl2Y( aFrame, m_ctrl2YLabel, m_ctrl2YCtrl, m_ctrl2YUnits ),
m_endX( aFrame, m_endXLabel, m_endXCtrl, m_endXUnits ),
m_endY( aFrame, m_endYLabel, m_endYCtrl, m_endYUnits ),
m_radius( aFrame, m_radiusLabel, m_radiusCtrl, m_radiusUnits ),
m_thickness( aFrame, m_thicknessLabel, m_thicknessCtrl, m_thicknessUnits )
{
SetInitialFocus( m_startXCtrl );
TransferDataToWindow();
SetupStandardButtons();
finishDialogSettings();
}
bool DIALOG_PAD_PRIMITIVES_PROPERTIES::TransferDataToWindow()
{
if( m_shape == nullptr )
return false;
m_thickness.SetValue( m_shape->GetWidth() );
m_filledCtrl->SetValue( m_shape->IsFilled() );
switch( m_shape->GetShape() )
{
case SHAPE_T::SEGMENT:
SetTitle( _( "Segment" ) );
m_startX.SetValue( m_shape->GetStart().x );
m_startY.SetValue( m_shape->GetStart().y );
m_endX.SetValue( m_shape->GetEnd().x );
m_endY.SetValue( m_shape->GetEnd().y );
m_ctrl1X.Show( false, true );
m_ctrl1Y.Show( false, true );
m_ctrl2X.Show( false, true );
m_ctrl2Y.Show( false, true );
m_staticTextPosCtrl1->Show( false );
m_staticTextPosCtrl1->SetSize( 0, 0 );
m_staticTextPosCtrl2->Show( false );
m_staticTextPosCtrl2->SetSize( 0, 0 );
m_radius.Show( false );
m_filledCtrl->Show( false );
break;
case SHAPE_T::BEZIER:
SetTitle( _( "Bezier" ) );
m_startX.SetValue( m_shape->GetStart().x );
m_startY.SetValue( m_shape->GetStart().y );
m_endX.SetValue( m_shape->GetEnd().x );
m_endY.SetValue( m_shape->GetEnd().y );
m_ctrl1X.SetValue( m_shape->GetBezierC1().x );
m_ctrl1Y.SetValue( m_shape->GetBezierC1().y );
m_ctrl2X.SetValue( m_shape->GetBezierC2().x );
m_ctrl2Y.SetValue( m_shape->GetBezierC2().y );
m_radius.Show( false );
m_filledCtrl->Show( false );
break;
case SHAPE_T::ARC:
SetTitle( _( "Arc" ) );
m_startX.SetValue( m_shape->GetStart().x );
m_startY.SetValue( m_shape->GetStart().y );
m_staticTextPosEnd->SetLabel( _( "Center Point:" ) );
m_endX.SetValue( m_shape->GetCenter().x );
m_endY.SetValue( m_shape->GetCenter().y );
m_radiusLabel->SetLabel( _( "Angle:" ) );
m_radius.SetUnits( EDA_UNITS::DEGREES );
m_radius.SetAngleValue( m_shape->GetArcAngle() );
m_ctrl1X.Show( false, true );
m_ctrl1Y.Show( false, true );
m_ctrl2X.Show( false, true );
m_ctrl2Y.Show( false, true );
m_staticTextPosCtrl1->Show( false );
m_staticTextPosCtrl1->SetSize( 0, 0 );
m_staticTextPosCtrl2->Show( false );
m_staticTextPosCtrl2->SetSize( 0, 0 );
m_filledCtrl->Show( false );
break;
case SHAPE_T::CIRCLE:
if( m_shape->GetWidth() )
SetTitle( _( "Ring" ) );
else
SetTitle( _( "Circle" ) );
// End point does not exist for a circle or ring:
m_staticTextPosEnd->Show( false );
m_endX.Show( false );
m_endY.Show( false );
// Circle center uses position controls:
m_staticTextPosStart->SetLabel( _( "Center Point:" ) );
m_startX.SetValue( m_shape->GetStart().x );
m_startY.SetValue( m_shape->GetStart().y );
m_radius.SetValue( m_shape->GetRadius() );
m_ctrl1X.Show( false, true );
m_ctrl1Y.Show( false, true );
m_ctrl2X.Show( false, true );
m_ctrl2Y.Show( false, true );
m_staticTextPosCtrl1->Show( false );
m_staticTextPosCtrl1->SetSize( 0, 0 );
m_staticTextPosCtrl2->Show( false );
m_staticTextPosCtrl2->SetSize( 0, 0 );
m_filledCtrl->Show( true );
break;
case SHAPE_T::RECTANGLE:
if( m_shape->IsAnnotationProxy() )
SetTitle( _( "Number Box" ) );
else
SetTitle( _( "Rectangle" ) );
m_startX.SetValue( m_shape->GetStart().x );
m_startY.SetValue( m_shape->GetStart().y );
m_endX.SetValue( m_shape->GetEnd().x );
m_endY.SetValue( m_shape->GetEnd().y );
m_ctrl1X.Show( false, true );
m_ctrl1Y.Show( false, true );
m_ctrl2X.Show( false, true );
m_ctrl2Y.Show( false, true );
m_staticTextPosCtrl1->Show( false );
m_staticTextPosCtrl1->SetSize( 0, 0 );
m_staticTextPosCtrl2->Show( false );
m_staticTextPosCtrl2->SetSize( 0, 0 );
m_radius.Show( false );
m_filledCtrl->Show( false );
break;
case SHAPE_T::POLY:
// polygon has a specific dialog editor. So nothing here
break;
default:
SetTitle( "Unknown Basic Shape" );
break;
}
return true;
}
bool DIALOG_PAD_PRIMITIVES_PROPERTIES::TransferDataFromWindow()
{
if( m_thickness.GetValue() == 0 && !m_filledCtrl->GetValue() )
{
DisplayError( this, _( "Line width may not be 0 for unfilled shapes." ) );
m_thicknessCtrl->SetFocus();
return false;
}
// Transfer data out of the GUI.
STROKE_PARAMS stroke = m_shape->GetStroke();
stroke.SetWidth( m_thickness.GetIntValue() );
m_shape->SetStroke( stroke );
m_shape->SetFilled( m_filledCtrl->GetValue() );
switch( m_shape->GetShape() )
{
case SHAPE_T::SEGMENT:
case SHAPE_T::RECTANGLE:
m_shape->SetStart( VECTOR2I( m_startX.GetIntValue(), m_startY.GetIntValue() ) );
m_shape->SetEnd( VECTOR2I( m_endX.GetIntValue(), m_endY.GetIntValue() ) );
break;
case SHAPE_T::BEZIER:
m_shape->SetStart( VECTOR2I( m_startX.GetIntValue(), m_startY.GetIntValue() ) );
m_shape->SetEnd( VECTOR2I( m_endX.GetIntValue(), m_endY.GetIntValue() ) );
m_shape->SetBezierC1( VECTOR2I( m_ctrl1X.GetIntValue(), m_ctrl1Y.GetIntValue()));
m_shape->SetBezierC2( VECTOR2I( m_ctrl2X.GetIntValue(), m_ctrl2Y.GetIntValue()));
break;
case SHAPE_T::ARC:
m_shape->SetCenter( VECTOR2I( m_endX.GetIntValue(), m_endY.GetIntValue() ) );
m_shape->SetStart( VECTOR2I( m_startX.GetIntValue(), m_startY.GetIntValue() ) );
m_shape->SetArcAngleAndEnd( m_radius.GetAngleValue() );
break;
case SHAPE_T::CIRCLE:
m_shape->SetStart( VECTOR2I( m_startX.GetIntValue(), m_startY.GetIntValue() ) );
m_shape->SetEnd( m_shape->GetStart() + VECTOR2I( m_radius.GetIntValue(), 0 ) );
break;
case SHAPE_T::POLY:
// polygon has a specific dialog editor. So nothing here
break;
default:
break;
}
return true;
}
DIALOG_PAD_PRIMITIVE_POLY_PROPS::DIALOG_PAD_PRIMITIVE_POLY_PROPS( wxWindow* aParent,
PCB_BASE_FRAME* aFrame,
PCB_SHAPE* aShape ) :
DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE( aParent ),
m_shape( aShape ),
m_thickness( aFrame, m_thicknessLabel, m_thicknessCtrl, m_thicknessUnits )
{
if( !m_shape->GetPolyShape().IsEmpty() )
{
for( const VECTOR2I& pt : m_shape->GetPolyShape().Outline( 0 ).CPoints() )
m_currPoints.emplace_back( pt );
}
m_addButton->SetBitmap( KiBitmap( BITMAPS::small_plus ) );
m_deleteButton->SetBitmap( KiBitmap( BITMAPS::small_trash ) );
m_warningIcon->SetBitmap( KiBitmap( BITMAPS::dialog_warning ) );
m_gridCornersList->SetUnitsProvider( aFrame );
m_gridCornersList->SetAutoEvalCols( { 0, 1 } );
m_gridCornersList->SetDefaultRowSize( m_gridCornersList->GetDefaultRowSize() + 4 );
// Test for acceptable polygon (more than 2 corners, and not self-intersecting) and
// remove any redundant corners. A warning message is displayed if not OK.
doValidate( true );
TransferDataToWindow();
SetupStandardButtons();
m_gridCornersList->Connect( wxEVT_GRID_CELL_CHANGING,
wxGridEventHandler( DIALOG_PAD_PRIMITIVE_POLY_PROPS::onCellChanging ),
nullptr, this );
// Now all widgets have the size fixed, call FinishDialogSettings
finishDialogSettings();
}
DIALOG_PAD_PRIMITIVE_POLY_PROPS::~DIALOG_PAD_PRIMITIVE_POLY_PROPS()
{
m_gridCornersList->Disconnect( wxEVT_GRID_CELL_CHANGING,
wxGridEventHandler( DIALOG_PAD_PRIMITIVE_POLY_PROPS::onCellChanging ),
nullptr, this );
}
bool DIALOG_PAD_PRIMITIVE_POLY_PROPS::TransferDataToWindow()
{
if( m_shape == nullptr )
return false;
m_thickness.SetValue( m_shape->GetWidth() );
m_filledCtrl->SetValue( m_shape->IsFilled() );
// Populates the list of corners
int extra_rows = m_currPoints.size() - m_gridCornersList->GetNumberRows();
if( extra_rows > 0 )
{
m_gridCornersList->AppendRows( extra_rows );
}
else if( extra_rows < 0 )
{
extra_rows = -extra_rows;
m_gridCornersList->DeleteRows( 0, extra_rows );
}
// enter others corner coordinates
for( unsigned row = 0; row < m_currPoints.size(); ++row )
{
// Row label is "Corner x"
m_gridCornersList->SetRowLabelValue( row, wxString::Format( _( "Corner %d" ), row+1 ) );
m_gridCornersList->SetUnitValue( row, 0, m_currPoints[row].x );
m_gridCornersList->SetUnitValue( row, 1, m_currPoints[row].y );
}
return true;
}
bool DIALOG_PAD_PRIMITIVE_POLY_PROPS::TransferDataFromWindow()
{
if( !Validate() )
return false;
m_shape->SetPolyPoints( m_currPoints );
STROKE_PARAMS stroke = m_shape->GetStroke();
stroke.SetWidth( m_thickness.GetIntValue() );
m_shape->SetStroke( stroke );
m_shape->SetFilled( m_filledCtrl->GetValue() );
return true;
}
bool DIALOG_PAD_PRIMITIVE_POLY_PROPS::Validate()
{
// Don't remove redundant corners while user is editing corner list
return doValidate( false );
}
bool DIALOG_PAD_PRIMITIVE_POLY_PROPS::doValidate( bool aRemoveRedundantCorners )
{
if( !m_gridCornersList->CommitPendingChanges() )
return false;
if( m_currPoints.size() < 3 )
{
m_warningText->SetLabel( _("Polygon must have at least 3 corners" ) );
m_warningText->Show( true );
m_warningIcon->Show( true );
return false;
}
bool valid = true;
SHAPE_LINE_CHAIN polyline( m_currPoints, true );
// Remove redundant corners:
polyline.Simplify();
if( polyline.PointCount() < 3 )
{
m_warningText->SetLabel( _( "Polygon must have at least 3 corners after simplification" ) );
valid = false;
}
if( valid && polyline.SelfIntersecting() )
{
m_warningText->SetLabel( _( "Polygon can not be self-intersecting" ) );
valid = false;
}
m_warningIcon->Show( !valid );
m_warningText->Show( !valid );
if( aRemoveRedundantCorners )
{
if( polyline.PointCount() != (int) m_currPoints.size() )
{ // Happens after simplification
m_currPoints.clear();
for( const VECTOR2I& pt : polyline.CPoints() )
m_currPoints.emplace_back( pt );
m_warningIcon->Show( true );
m_warningText->Show( true );
m_warningText->SetLabel( _( "Note: redundant corners removed" ) );
}
}
return valid;
}
void DIALOG_PAD_PRIMITIVE_POLY_PROPS::OnButtonAdd( wxCommandEvent& event )
{
if( !m_gridCornersList->CommitPendingChanges() )
return;
// Insert a new corner after the currently selected:
wxArrayInt selections = m_gridCornersList->GetSelectedRows();
int row = -1;
if( m_gridCornersList->GetNumberRows() == 0 )
row = 0;
else if( selections.size() > 0 )
row = selections[ selections.size() - 1 ] + 1;
else
row = m_gridCornersList->GetGridCursorRow() + 1;
if( row < 0 )
{
wxMessageBox( _( "Select a corner to add the new corner after." ) );
return;
}
if( m_currPoints.size() == 0 || row >= (int) m_currPoints.size() )
m_currPoints.emplace_back( 0, 0 );
else
m_currPoints.insert( m_currPoints.begin() + row, VECTOR2I( 0, 0 ) );
Validate();
TransferDataToWindow();
m_gridCornersList->ForceRefresh();
// Select the new row
m_gridCornersList->SelectRow( row, false );
m_panelPoly->Refresh();
}
void DIALOG_PAD_PRIMITIVE_POLY_PROPS::OnButtonDelete( wxCommandEvent& event )
{
if( !m_gridCornersList->CommitPendingChanges() )
return;
wxArrayInt selections = m_gridCornersList->GetSelectedRows();
if( m_gridCornersList->GetNumberRows() == 0 )
return;
if( selections.size() == 0 && m_gridCornersList->GetGridCursorRow() >= 0 )
selections.push_back( m_gridCornersList->GetGridCursorRow() );
if( selections.size() == 0 )
{
wxMessageBox( _( "Select a corner to delete." ) );
return;
}
// remove corners:
std::sort( selections.begin(), selections.end() );
for( int ii = selections.size()-1; ii >= 0 ; --ii )
m_currPoints.erase( m_currPoints.begin() + selections[ii] );
Validate();
TransferDataToWindow();
m_gridCornersList->ForceRefresh();
// select the row previous to the last deleted row
m_gridCornersList->SelectRow( std::max( 0, selections[ 0 ] - 1 ) );
m_panelPoly->Refresh();
}
void DIALOG_PAD_PRIMITIVE_POLY_PROPS::onPaintPolyPanel( wxPaintEvent& event )
{
wxPaintDC dc( m_panelPoly );
wxSize dc_size = dc.GetSize();
dc.SetDeviceOrigin( dc_size.x / 2, dc_size.y / 2 );
// Calculate a suitable scale to fit the available draw area
int minsize( pcbIUScale.mmToIU( 0.5 ) );
for( unsigned ii = 0; ii < m_currPoints.size(); ++ii )
{
minsize = std::max( minsize, std::abs( m_currPoints[ii].x ) );
minsize = std::max( minsize, std::abs( m_currPoints[ii].y ) );
}
// The draw origin is the center of the window.
// Therefore the window size is twice the minsize just calculated
minsize *= 2;
minsize += m_thickness.GetIntValue();
// Give a margin
double scale = std::min( double( dc_size.x ) / minsize, double( dc_size.y ) / minsize ) * 0.9;
GRResetPenAndBrush( &dc );
// Draw X and Y axis. This is particularly useful to show the
// reference position of basic shape
// Axis are drawn before the polygon to avoid masking segments on axis
GRLine( &dc, -dc_size.x, 0, dc_size.x, 0, 0, LIGHTBLUE ); // X axis
GRLine( &dc, 0, -dc_size.y, 0, dc_size.y, 0, LIGHTBLUE ); // Y axis
// Draw polygon.
// The selected edge(s) are shown in selectcolor, the others in normalcolor.
EDA_COLOR_T normalcolor = WHITE;
EDA_COLOR_T selectcolor = RED;
for( unsigned ii = 0; ii < m_currPoints.size(); ++ii )
{
EDA_COLOR_T color = normalcolor;
if( m_gridCornersList->IsInSelection (ii, 0) ||
m_gridCornersList->IsInSelection (ii, 1) ||
m_gridCornersList->GetGridCursorRow() == (int)ii )
color = selectcolor;
unsigned jj = ii + 1;
if( jj >= m_currPoints.size() )
jj = 0;
GRLine( &dc, m_currPoints[ii].x * scale, m_currPoints[ii].y * scale,
m_currPoints[jj].x * scale, m_currPoints[jj].y * scale,
m_thickness.GetValue() * scale, color );
}
event.Skip();
}
void DIALOG_PAD_PRIMITIVE_POLY_PROPS::onPolyPanelResize( wxSizeEvent& event )
{
m_panelPoly->Refresh();
event.Skip();
}
void DIALOG_PAD_PRIMITIVE_POLY_PROPS::onGridSelect( wxGridRangeSelectEvent& event )
{
m_panelPoly->Refresh();
}
void DIALOG_PAD_PRIMITIVE_POLY_PROPS::onCellChanging( wxGridEvent& event )
{
int row = event.GetRow();
int col = event.GetCol();
CallAfter(
[this, row, col]()
{
if( col == 0 ) // Set the X value
m_currPoints[row].x = m_gridCornersList->GetUnitValue( row, col );
else // Set the Y value
m_currPoints[row].y = m_gridCornersList->GetUnitValue( row, col );
Validate();
m_panelPoly->Refresh();
} );
}
DIALOG_PAD_PRIMITIVES_TRANSFORM::DIALOG_PAD_PRIMITIVES_TRANSFORM( wxWindow* aParent,
PCB_BASE_FRAME* aFrame,
std::vector<std::shared_ptr<PCB_SHAPE>>& aList,
bool aShowDuplicate ) :
DIALOG_PAD_PRIMITIVES_TRANSFORM_BASE( aParent ),
m_list( aList ),
m_vectorX( aFrame, m_xLabel, m_xCtrl, m_xUnits ),
m_vectorY( aFrame, m_yLabel, m_yCtrl, m_yUnits ),
m_rotation( aFrame, m_rotationLabel, m_rotationCtrl, m_rotationUnits )
{
m_rotation.SetUnits( EDA_UNITS::DEGREES );
if( !aShowDuplicate ) // means no duplicate transform
{
m_staticTextDupCnt->Show( false );
m_spinCtrlDuplicateCount->Show( false );
}
SetupStandardButtons();
GetSizer()->SetSizeHints( this );
}
void DIALOG_PAD_PRIMITIVES_TRANSFORM::Transform( std::vector<std::shared_ptr<PCB_SHAPE>>* aList,
int aDuplicateCount )
{
VECTOR2I move_vect( m_vectorX.GetValue(), m_vectorY.GetValue() );
EDA_ANGLE rotation = m_rotation.GetAngleValue();
double scale = EDA_UNIT_UTILS::UI::DoubleValueFromString( m_scaleCtrl->GetValue() );
// Avoid too small / too large scale, which could create issues:
if( scale < 0.01 )
scale = 0.01;
if( scale > 100.0 )
scale = 100.0;
// Transform shapes
// shapes are scaled, then moved then rotated.
// if aList != NULL, the initial shape will be duplicated, and transform
// applied to the duplicated shape
VECTOR2I currMoveVect = move_vect;
EDA_ANGLE curr_rotation = rotation;
do {
for( unsigned idx = 0; idx < m_list.size(); ++idx )
{
std::shared_ptr<PCB_SHAPE> shape;
if( aList == nullptr )
{
shape = m_list[idx];
}
else
{
aList->emplace_back( std::make_shared<PCB_SHAPE>( *m_list[idx] ) );
shape = aList->back();
}
// Transform parameters common to all shape types (some can be unused)
STROKE_PARAMS stroke = shape->GetStroke();
stroke.SetWidth( KiROUND( shape->GetWidth() * scale ) );
shape->SetStroke( stroke );
shape->Move( currMoveVect );
shape->Scale( scale );
shape->Rotate( VECTOR2I( 0, 0 ), curr_rotation );
}
// Prepare new transform on duplication:
// Each new item is rotated (or moved) by the transform from the last duplication
curr_rotation += rotation;
currMoveVect += move_vect;
} while( aList && --aDuplicateCount > 0 );
}

View File

@ -1,166 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2008-2013 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef _DIALOG_PAD_PRIMITIVES_PROPERTIES_
#define _DIALOG_PAD_PRIMITIVES_PROPERTIES_
#include <pcb_base_frame.h>
#include <wx/valnum.h>
#include <board.h>
#include <footprint.h>
#include <pad_shapes.h>
#include <pcb_shape.h>
#include <origin_viewitem.h>
#include <dialog_pad_primitives_properties_base.h>
#include <widgets/text_ctrl_eval.h>
#include <pcb_draw_panel_gal.h>
#include <widgets/unit_binder.h>
/**
* A dialog to edit basic shape parameters.
*
* Polygonal shape is not handled by this dialog.
*/
class DIALOG_PAD_PRIMITIVES_PROPERTIES: public DIALOG_PAD_PRIMITIVES_PROPERTIES_BASE
{
public:
DIALOG_PAD_PRIMITIVES_PROPERTIES( wxWindow* aParent, PCB_BASE_FRAME* aFrame,
PCB_SHAPE* aShape );
/**
* Transfer data out of the GUI.
*/
bool TransferDataFromWindow() override;
private:
/**
* Function TransferDataToWindow
* Transfer data into the GUI.
*/
bool TransferDataToWindow() override;
// The basic shape currently edited
PCB_SHAPE* m_shape;
UNIT_BINDER m_startX;
UNIT_BINDER m_startY;
UNIT_BINDER m_ctrl1X;
UNIT_BINDER m_ctrl1Y;
UNIT_BINDER m_ctrl2X;
UNIT_BINDER m_ctrl2Y;
UNIT_BINDER m_endX;
UNIT_BINDER m_endY;
UNIT_BINDER m_radius;
UNIT_BINDER m_thickness;
};
/**
* A dialog to edit basic polygonal shape parameters.
*/
class DIALOG_PAD_PRIMITIVE_POLY_PROPS: public DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE
{
public:
DIALOG_PAD_PRIMITIVE_POLY_PROPS( wxWindow* aParent, PCB_BASE_FRAME* aFrame,
PCB_SHAPE* aShape );
~DIALOG_PAD_PRIMITIVE_POLY_PROPS();
/**
* Transfer data out of the GUI.
*/
bool TransferDataFromWindow() override;
private:
/**
* Transfer data into the GUI.
*/
bool TransferDataToWindow() override;
/**
* Test for a valid polygon (a not self intersectiong polygon).
*/
bool Validate() override;
// Events handlers:
void OnButtonAdd( wxCommandEvent& event ) override;
void OnButtonDelete( wxCommandEvent& event ) override;
void onPaintPolyPanel( wxPaintEvent& event ) override;
void onPolyPanelResize( wxSizeEvent& event ) override;
void onGridSelect( wxGridRangeSelectEvent& event ) override;
void onCellChanging( wxGridEvent& event );
void onCellSelect( wxGridEvent& event ) override
{
event.Skip();
}
bool doValidate( bool aRemoveRedundantCorners );
private:
PCB_SHAPE* m_shape;
std::vector<VECTOR2I> m_currPoints; // The working copy of the data being edited
UNIT_BINDER m_thickness;
};
/**
* A dialog to apply geometry transforms to a shape or set of shapes (move, rotate around
* origin, scaling factor, duplication).
*
* Shapes are scaled then moved then rotated.
*/
class DIALOG_PAD_PRIMITIVES_TRANSFORM : public DIALOG_PAD_PRIMITIVES_TRANSFORM_BASE
{
public:
DIALOG_PAD_PRIMITIVES_TRANSFORM( wxWindow* aParent, PCB_BASE_FRAME* aFrame,
std::vector<std::shared_ptr<PCB_SHAPE>>& aList,
bool aShowDuplicate );
/**
* Apply geometric transform (rotation, move, scale) defined in dialog
* aDuplicate = 1 .. n to duplicate the list of shapes
* aDuplicate = 0 to transform the list of shapes
* The duplicated items are transformed, but the initial shpes are not modified.
* The duplicated items are added to aList
*/
void Transform( std::vector<std::shared_ptr<PCB_SHAPE>>* aList = nullptr,
int aDuplicateCount = 0 );
/**
* @return the number of duplicate, chosen by user.
*/
int GetDuplicateCount() { return m_spinCtrlDuplicateCount->GetValue(); }
private:
std::vector<std::shared_ptr<PCB_SHAPE>>& m_list;
UNIT_BINDER m_vectorX;
UNIT_BINDER m_vectorY;
UNIT_BINDER m_rotation;
};
#endif // #ifndef _DIALOG_PAD_PRIMITIVES_PROPERTIES_

View File

@ -1,490 +0,0 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.0-39-g3487c3cb)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "widgets/std_bitmap_button.h"
#include "widgets/text_ctrl_eval.h"
#include "widgets/wx_grid.h"
#include "dialog_pad_primitives_properties_base.h"
///////////////////////////////////////////////////////////////////////////
DIALOG_PAD_PRIMITIVES_PROPERTIES_BASE::DIALOG_PAD_PRIMITIVES_PROPERTIES_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* bSizermain;
bSizermain = new wxBoxSizer( wxVERTICAL );
wxFlexGridSizer* fgSizerShapeProperties;
fgSizerShapeProperties = new wxFlexGridSizer( 0, 7, 5, 0 );
fgSizerShapeProperties->AddGrowableCol( 2 );
fgSizerShapeProperties->AddGrowableCol( 4 );
fgSizerShapeProperties->SetFlexibleDirection( wxBOTH );
fgSizerShapeProperties->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_staticTextPosStart = new wxStaticText( this, wxID_ANY, _("Start point"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextPosStart->Wrap( -1 );
fgSizerShapeProperties->Add( m_staticTextPosStart, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
m_startXLabel = new wxStaticText( this, wxID_ANY, _("X:"), wxDefaultPosition, wxDefaultSize, 0 );
m_startXLabel->Wrap( -1 );
fgSizerShapeProperties->Add( m_startXLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT, 5 );
m_startXCtrl = new TEXT_CTRL_EVAL( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerShapeProperties->Add( m_startXCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_startXUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_startXUnits->Wrap( -1 );
fgSizerShapeProperties->Add( m_startXUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 10 );
m_startYLabel = new wxStaticText( this, wxID_ANY, _("Y:"), wxDefaultPosition, wxDefaultSize, 0 );
m_startYLabel->Wrap( -1 );
fgSizerShapeProperties->Add( m_startYLabel, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
m_startYCtrl = new TEXT_CTRL_EVAL( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerShapeProperties->Add( m_startYCtrl, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_startYUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_startYUnits->Wrap( -1 );
fgSizerShapeProperties->Add( m_startYUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_staticTextPosCtrl1 = new wxStaticText( this, wxID_ANY, _("Control point 1"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextPosCtrl1->Wrap( -1 );
fgSizerShapeProperties->Add( m_staticTextPosCtrl1, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
m_ctrl1XLabel = new wxStaticText( this, wxID_ANY, _("X:"), wxDefaultPosition, wxDefaultSize, 0 );
m_ctrl1XLabel->Wrap( -1 );
fgSizerShapeProperties->Add( m_ctrl1XLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT, 5 );
m_ctrl1XCtrl = new TEXT_CTRL_EVAL( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerShapeProperties->Add( m_ctrl1XCtrl, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
m_ctrl1XUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_ctrl1XUnits->Wrap( -1 );
fgSizerShapeProperties->Add( m_ctrl1XUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_ctrl1YLabel = new wxStaticText( this, wxID_ANY, _("Y:"), wxDefaultPosition, wxDefaultSize, 0 );
m_ctrl1YLabel->Wrap( -1 );
fgSizerShapeProperties->Add( m_ctrl1YLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT, 5 );
m_ctrl1YCtrl = new TEXT_CTRL_EVAL( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerShapeProperties->Add( m_ctrl1YCtrl, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
m_ctrl1YUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_ctrl1YUnits->Wrap( -1 );
fgSizerShapeProperties->Add( m_ctrl1YUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_staticTextPosCtrl2 = new wxStaticText( this, wxID_ANY, _("Control point 2"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextPosCtrl2->Wrap( -1 );
fgSizerShapeProperties->Add( m_staticTextPosCtrl2, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
m_ctrl2XLabel = new wxStaticText( this, wxID_ANY, _("X:"), wxDefaultPosition, wxDefaultSize, 0 );
m_ctrl2XLabel->Wrap( -1 );
fgSizerShapeProperties->Add( m_ctrl2XLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT, 5 );
m_ctrl2XCtrl = new TEXT_CTRL_EVAL( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerShapeProperties->Add( m_ctrl2XCtrl, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
m_ctrl2XUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_ctrl2XUnits->Wrap( -1 );
fgSizerShapeProperties->Add( m_ctrl2XUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_ctrl2YLabel = new wxStaticText( this, wxID_ANY, _("Y:"), wxDefaultPosition, wxDefaultSize, 0 );
m_ctrl2YLabel->Wrap( -1 );
fgSizerShapeProperties->Add( m_ctrl2YLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT, 5 );
m_ctrl2YCtrl = new TEXT_CTRL_EVAL( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerShapeProperties->Add( m_ctrl2YCtrl, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
m_ctrl2YUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_ctrl2YUnits->Wrap( -1 );
fgSizerShapeProperties->Add( m_ctrl2YUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_staticTextPosEnd = new wxStaticText( this, wxID_ANY, _("End point"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextPosEnd->Wrap( -1 );
fgSizerShapeProperties->Add( m_staticTextPosEnd, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
m_endXLabel = new wxStaticText( this, wxID_ANY, _("X:"), wxDefaultPosition, wxDefaultSize, 0 );
m_endXLabel->Wrap( -1 );
fgSizerShapeProperties->Add( m_endXLabel, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
m_endXCtrl = new TEXT_CTRL_EVAL( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerShapeProperties->Add( m_endXCtrl, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
m_endXUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_endXUnits->Wrap( -1 );
fgSizerShapeProperties->Add( m_endXUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_endYLabel = new wxStaticText( this, wxID_ANY, _("Y:"), wxDefaultPosition, wxDefaultSize, 0 );
m_endYLabel->Wrap( -1 );
fgSizerShapeProperties->Add( m_endYLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT, 5 );
m_endYCtrl = new TEXT_CTRL_EVAL( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerShapeProperties->Add( m_endYCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_endYUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_endYUnits->Wrap( -1 );
fgSizerShapeProperties->Add( m_endYUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_radiusLabel = new wxStaticText( this, wxID_ANY, _("Radius:"), wxDefaultPosition, wxDefaultSize, 0 );
m_radiusLabel->Wrap( -1 );
fgSizerShapeProperties->Add( m_radiusLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
fgSizerShapeProperties->Add( 0, 0, 1, wxEXPAND, 5 );
m_radiusCtrl = new TEXT_CTRL_EVAL( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerShapeProperties->Add( m_radiusCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_radiusUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_radiusUnits->Wrap( -1 );
fgSizerShapeProperties->Add( m_radiusUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
fgSizerShapeProperties->Add( 0, 0, 1, wxEXPAND, 5 );
fgSizerShapeProperties->Add( 0, 0, 1, wxEXPAND, 5 );
fgSizerShapeProperties->Add( 0, 0, 1, wxEXPAND, 5 );
m_thicknessLabel = new wxStaticText( this, wxID_ANY, _("Line width:"), wxDefaultPosition, wxDefaultSize, 0 );
m_thicknessLabel->Wrap( -1 );
fgSizerShapeProperties->Add( m_thicknessLabel, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT, 5 );
fgSizerShapeProperties->Add( 0, 0, 1, wxEXPAND, 5 );
m_thicknessCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerShapeProperties->Add( m_thicknessCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_thicknessUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_thicknessUnits->Wrap( -1 );
fgSizerShapeProperties->Add( m_thicknessUnits, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 );
fgSizerShapeProperties->Add( 0, 0, 1, wxEXPAND, 5 );
m_filledCtrl = new wxCheckBox( this, wxID_ANY, _("Filled shape"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizerShapeProperties->Add( m_filledCtrl, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
bSizermain->Add( fgSizerShapeProperties, 1, wxEXPAND|wxALL, 10 );
m_sdbSizer = new wxStdDialogButtonSizer();
m_sdbSizerOK = new wxButton( this, wxID_OK );
m_sdbSizer->AddButton( m_sdbSizerOK );
m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
m_sdbSizer->AddButton( m_sdbSizerCancel );
m_sdbSizer->Realize();
bSizermain->Add( m_sdbSizer, 0, wxBOTTOM|wxEXPAND|wxTOP, 5 );
this->SetSizer( bSizermain );
this->Layout();
bSizermain->Fit( this );
this->Centre( wxBOTH );
}
DIALOG_PAD_PRIMITIVES_PROPERTIES_BASE::~DIALOG_PAD_PRIMITIVES_PROPERTIES_BASE()
{
}
DIALOG_PAD_PRIMITIVES_TRANSFORM_BASE::DIALOG_PAD_PRIMITIVES_TRANSFORM_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* bSizermain;
bSizermain = new wxBoxSizer( wxVERTICAL );
wxFlexGridSizer* fgSizerShapeProperties1;
fgSizerShapeProperties1 = new wxFlexGridSizer( 0, 7, 3, 0 );
fgSizerShapeProperties1->AddGrowableCol( 2 );
fgSizerShapeProperties1->AddGrowableCol( 4 );
fgSizerShapeProperties1->SetFlexibleDirection( wxBOTH );
fgSizerShapeProperties1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_staticTextMove = new wxStaticText( this, wxID_ANY, _("Move vector"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextMove->Wrap( -1 );
fgSizerShapeProperties1->Add( m_staticTextMove, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
m_xLabel = new wxStaticText( this, wxID_ANY, _("X:"), wxDefaultPosition, wxDefaultSize, 0 );
m_xLabel->Wrap( -1 );
fgSizerShapeProperties1->Add( m_xLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxLEFT, 5 );
m_xCtrl = new TEXT_CTRL_EVAL( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerShapeProperties1->Add( m_xCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_xUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_xUnits->Wrap( -1 );
fgSizerShapeProperties1->Add( m_xUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 10 );
m_yLabel = new wxStaticText( this, wxID_ANY, _("Y:"), wxDefaultPosition, wxDefaultSize, 0 );
m_yLabel->Wrap( -1 );
fgSizerShapeProperties1->Add( m_yLabel, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
m_yCtrl = new TEXT_CTRL_EVAL( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerShapeProperties1->Add( m_yCtrl, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_yUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_yUnits->Wrap( -1 );
fgSizerShapeProperties1->Add( m_yUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_rotationLabel = new wxStaticText( this, wxID_ANY, _("Rotation:"), wxDefaultPosition, wxDefaultSize, 0 );
m_rotationLabel->Wrap( -1 );
fgSizerShapeProperties1->Add( m_rotationLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
fgSizerShapeProperties1->Add( 0, 0, 1, wxEXPAND, 5 );
m_rotationCtrl = new TEXT_CTRL_EVAL( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerShapeProperties1->Add( m_rotationCtrl, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
m_rotationUnits = new wxStaticText( this, wxID_ANY, _("deg"), wxDefaultPosition, wxDefaultSize, 0 );
m_rotationUnits->Wrap( -1 );
fgSizerShapeProperties1->Add( m_rotationUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
fgSizerShapeProperties1->Add( 0, 0, 1, wxEXPAND, 5 );
fgSizerShapeProperties1->Add( 0, 0, 1, wxEXPAND, 5 );
fgSizerShapeProperties1->Add( 0, 0, 1, wxEXPAND, 5 );
m_scaleLabel = new wxStaticText( this, wxID_ANY, _("Scaling factor:"), wxDefaultPosition, wxDefaultSize, 0 );
m_scaleLabel->Wrap( -1 );
fgSizerShapeProperties1->Add( m_scaleLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
fgSizerShapeProperties1->Add( 0, 0, 1, wxEXPAND, 5 );
m_scaleCtrl = new TEXT_CTRL_EVAL( this, wxID_ANY, _("1"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizerShapeProperties1->Add( m_scaleCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 );
fgSizerShapeProperties1->Add( 0, 0, 1, wxEXPAND, 5 );
fgSizerShapeProperties1->Add( 0, 0, 1, wxEXPAND, 5 );
fgSizerShapeProperties1->Add( 0, 0, 1, wxEXPAND, 5 );
fgSizerShapeProperties1->Add( 0, 0, 1, wxEXPAND, 5 );
m_staticTextDupCnt = new wxStaticText( this, wxID_ANY, _("Duplicate:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextDupCnt->Wrap( -1 );
fgSizerShapeProperties1->Add( m_staticTextDupCnt, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
fgSizerShapeProperties1->Add( 0, 0, 1, wxEXPAND, 5 );
m_spinCtrlDuplicateCount = new wxSpinCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 1, 100, 1 );
fgSizerShapeProperties1->Add( m_spinCtrlDuplicateCount, 0, wxALL|wxEXPAND, 5 );
fgSizerShapeProperties1->Add( 0, 0, 1, wxEXPAND, 5 );
bSizermain->Add( fgSizerShapeProperties1, 1, wxALL|wxEXPAND, 10 );
m_sdbSizer = new wxStdDialogButtonSizer();
m_sdbSizerOK = new wxButton( this, wxID_OK );
m_sdbSizer->AddButton( m_sdbSizerOK );
m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
m_sdbSizer->AddButton( m_sdbSizerCancel );
m_sdbSizer->Realize();
bSizermain->Add( m_sdbSizer, 0, wxBOTTOM|wxEXPAND|wxTOP, 5 );
this->SetSizer( bSizermain );
this->Layout();
bSizermain->Fit( this );
this->Centre( wxBOTH );
}
DIALOG_PAD_PRIMITIVES_TRANSFORM_BASE::~DIALOG_PAD_PRIMITIVES_TRANSFORM_BASE()
{
}
DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE::DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* bSizerMain;
bSizerMain = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizerUpper;
bSizerUpper = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bLeftSizer;
bLeftSizer = new wxBoxSizer( wxVERTICAL );
m_gridCornersList = new WX_GRID( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_SIMPLE );
// Grid
m_gridCornersList->CreateGrid( 1, 2 );
m_gridCornersList->EnableEditing( true );
m_gridCornersList->EnableGridLines( true );
m_gridCornersList->EnableDragGridSize( false );
m_gridCornersList->SetMargins( 0, 0 );
// Columns
m_gridCornersList->SetColSize( 0, 124 );
m_gridCornersList->SetColSize( 1, 124 );
m_gridCornersList->EnableDragColMove( false );
m_gridCornersList->EnableDragColSize( true );
m_gridCornersList->SetColLabelValue( 0, _("Pos X") );
m_gridCornersList->SetColLabelValue( 1, _("Pos Y") );
m_gridCornersList->SetColLabelSize( 22 );
m_gridCornersList->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
// Rows
m_gridCornersList->AutoSizeRows();
m_gridCornersList->EnableDragRowSize( false );
m_gridCornersList->SetRowLabelSize( 80 );
m_gridCornersList->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
// Label Appearance
// Cell Defaults
m_gridCornersList->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
bLeftSizer->Add( m_gridCornersList, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 10 );
wxBoxSizer* bSizerRightButts;
bSizerRightButts = new wxBoxSizer( wxHORIZONTAL );
m_addButton = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
m_addButton->SetMinSize( wxSize( 30,30 ) );
bSizerRightButts->Add( m_addButton, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
bSizerRightButts->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_deleteButton = new STD_BITMAP_BUTTON( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
m_deleteButton->SetMinSize( wxSize( 30,30 ) );
bSizerRightButts->Add( m_deleteButton, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
bLeftSizer->Add( bSizerRightButts, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
wxFlexGridSizer* fgSizerThickness;
fgSizerThickness = new wxFlexGridSizer( 0, 4, 0, 0 );
fgSizerThickness->AddGrowableCol( 1 );
fgSizerThickness->SetFlexibleDirection( wxBOTH );
fgSizerThickness->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_thicknessLabel = new wxStaticText( this, wxID_ANY, _("Line width:"), wxDefaultPosition, wxDefaultSize, 0 );
m_thicknessLabel->Wrap( -1 );
fgSizerThickness->Add( m_thicknessLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 );
m_thicknessCtrl = new TEXT_CTRL_EVAL( this, wxID_ANY, _("0"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizerThickness->Add( m_thicknessCtrl, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 );
m_thicknessUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_thicknessUnits->Wrap( -1 );
fgSizerThickness->Add( m_thicknessUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 );
m_filledCtrl = new wxCheckBox( this, wxID_ANY, _("Filled shape"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizerThickness->Add( m_filledCtrl, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 20 );
bLeftSizer->Add( fgSizerThickness, 0, wxALL|wxEXPAND, 10 );
bSizerUpper->Add( bLeftSizer, 1, wxEXPAND|wxRIGHT, 5 );
wxBoxSizer* bRightSizer;
bRightSizer = new wxBoxSizer( wxVERTICAL );
m_panelPoly = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
m_panelPoly->SetBackgroundColour( wxColour( 0, 0, 0 ) );
m_panelPoly->SetMinSize( wxSize( 290,290 ) );
bRightSizer->Add( m_panelPoly, 1, wxEXPAND|wxTOP|wxRIGHT, 10 );
wxBoxSizer* m_warningSizer;
m_warningSizer = new wxBoxSizer( wxHORIZONTAL );
m_warningIcon = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
m_warningIcon->SetMinSize( wxSize( 50,50 ) );
m_warningSizer->Add( m_warningIcon, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_warningText = new wxStaticText( this, wxID_ANY, _("MyLabel"), wxDefaultPosition, wxDefaultSize, 0 );
m_warningText->Wrap( -1 );
m_warningSizer->Add( m_warningText, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5 );
m_warningSizer->Add( 5, 88, 0, 0, 5 );
bRightSizer->Add( m_warningSizer, 0, wxEXPAND|wxRIGHT, 10 );
bSizerUpper->Add( bRightSizer, 1, wxEXPAND|wxLEFT, 5 );
bSizerMain->Add( bSizerUpper, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
wxBoxSizer* bSizer24;
bSizer24 = new wxBoxSizer( wxHORIZONTAL );
m_statusLine1 = new wxStaticText( this, wxID_ANY, _("Coordinates are relative to anchor pad, rotated 0.0 deg."), wxDefaultPosition, wxDefaultSize, 0 );
m_statusLine1->Wrap( -1 );
bSizer24->Add( m_statusLine1, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 10 );
m_sdbSizer = new wxStdDialogButtonSizer();
m_sdbSizerOK = new wxButton( this, wxID_OK );
m_sdbSizer->AddButton( m_sdbSizerOK );
m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
m_sdbSizer->AddButton( m_sdbSizerCancel );
m_sdbSizer->Realize();
bSizer24->Add( m_sdbSizer, 0, wxBOTTOM|wxEXPAND|wxTOP, 5 );
bSizerMain->Add( bSizer24, 0, wxEXPAND, 5 );
this->SetSizer( bSizerMain );
this->Layout();
bSizerMain->Fit( this );
this->Centre( wxBOTH );
// Connect Events
m_gridCornersList->Connect( wxEVT_GRID_RANGE_SELECT, wxGridRangeSelectEventHandler( DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE::onGridSelect ), NULL, this );
m_gridCornersList->Connect( wxEVT_GRID_SELECT_CELL, wxGridEventHandler( DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE::onCellSelect ), NULL, this );
m_addButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE::OnButtonAdd ), NULL, this );
m_deleteButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE::OnButtonDelete ), NULL, this );
m_panelPoly->Connect( wxEVT_PAINT, wxPaintEventHandler( DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE::onPaintPolyPanel ), NULL, this );
m_panelPoly->Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE::onPolyPanelResize ), NULL, this );
}
DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE::~DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE()
{
// Disconnect Events
m_gridCornersList->Disconnect( wxEVT_GRID_RANGE_SELECT, wxGridRangeSelectEventHandler( DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE::onGridSelect ), NULL, this );
m_gridCornersList->Disconnect( wxEVT_GRID_SELECT_CELL, wxGridEventHandler( DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE::onCellSelect ), NULL, this );
m_addButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE::OnButtonAdd ), NULL, this );
m_deleteButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE::OnButtonDelete ), NULL, this );
m_panelPoly->Disconnect( wxEVT_PAINT, wxPaintEventHandler( DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE::onPaintPolyPanel ), NULL, this );
m_panelPoly->Disconnect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE::onPolyPanelResize ), NULL, this );
}

File diff suppressed because it is too large Load Diff

View File

@ -1,169 +0,0 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.0-39-g3487c3cb)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#pragma once
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
class DIALOG_SHIM;
class STD_BITMAP_BUTTON;
class TEXT_CTRL_EVAL;
class WX_GRID;
#include "dialog_shim.h"
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/textctrl.h>
#include <wx/checkbox.h>
#include <wx/sizer.h>
#include <wx/button.h>
#include <wx/dialog.h>
#include <wx/spinctrl.h>
#include <wx/grid.h>
#include <wx/bmpbuttn.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/panel.h>
#include <wx/statbmp.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_PAD_PRIMITIVES_PROPERTIES_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_PAD_PRIMITIVES_PROPERTIES_BASE : public DIALOG_SHIM
{
private:
protected:
wxStaticText* m_staticTextPosStart;
wxStaticText* m_startXLabel;
TEXT_CTRL_EVAL* m_startXCtrl;
wxStaticText* m_startXUnits;
wxStaticText* m_startYLabel;
TEXT_CTRL_EVAL* m_startYCtrl;
wxStaticText* m_startYUnits;
wxStaticText* m_staticTextPosCtrl1;
wxStaticText* m_ctrl1XLabel;
TEXT_CTRL_EVAL* m_ctrl1XCtrl;
wxStaticText* m_ctrl1XUnits;
wxStaticText* m_ctrl1YLabel;
TEXT_CTRL_EVAL* m_ctrl1YCtrl;
wxStaticText* m_ctrl1YUnits;
wxStaticText* m_staticTextPosCtrl2;
wxStaticText* m_ctrl2XLabel;
TEXT_CTRL_EVAL* m_ctrl2XCtrl;
wxStaticText* m_ctrl2XUnits;
wxStaticText* m_ctrl2YLabel;
TEXT_CTRL_EVAL* m_ctrl2YCtrl;
wxStaticText* m_ctrl2YUnits;
wxStaticText* m_staticTextPosEnd;
wxStaticText* m_endXLabel;
TEXT_CTRL_EVAL* m_endXCtrl;
wxStaticText* m_endXUnits;
wxStaticText* m_endYLabel;
TEXT_CTRL_EVAL* m_endYCtrl;
wxStaticText* m_endYUnits;
wxStaticText* m_radiusLabel;
TEXT_CTRL_EVAL* m_radiusCtrl;
wxStaticText* m_radiusUnits;
wxStaticText* m_thicknessLabel;
wxTextCtrl* m_thicknessCtrl;
wxStaticText* m_thicknessUnits;
wxCheckBox* m_filledCtrl;
wxStdDialogButtonSizer* m_sdbSizer;
wxButton* m_sdbSizerOK;
wxButton* m_sdbSizerCancel;
public:
DIALOG_PAD_PRIMITIVES_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_PAD_PRIMITIVES_PROPERTIES_BASE();
};
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_PAD_PRIMITIVES_TRANSFORM_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_PAD_PRIMITIVES_TRANSFORM_BASE : public DIALOG_SHIM
{
private:
protected:
wxStaticText* m_staticTextMove;
wxStaticText* m_xLabel;
TEXT_CTRL_EVAL* m_xCtrl;
wxStaticText* m_xUnits;
wxStaticText* m_yLabel;
TEXT_CTRL_EVAL* m_yCtrl;
wxStaticText* m_yUnits;
wxStaticText* m_rotationLabel;
TEXT_CTRL_EVAL* m_rotationCtrl;
wxStaticText* m_rotationUnits;
wxStaticText* m_scaleLabel;
TEXT_CTRL_EVAL* m_scaleCtrl;
wxStaticText* m_staticTextDupCnt;
wxSpinCtrl* m_spinCtrlDuplicateCount;
wxStdDialogButtonSizer* m_sdbSizer;
wxButton* m_sdbSizerOK;
wxButton* m_sdbSizerCancel;
public:
DIALOG_PAD_PRIMITIVES_TRANSFORM_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Pad Custom Shape Geometry Transform"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE );
~DIALOG_PAD_PRIMITIVES_TRANSFORM_BASE();
};
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE : public DIALOG_SHIM
{
private:
protected:
WX_GRID* m_gridCornersList;
STD_BITMAP_BUTTON* m_addButton;
STD_BITMAP_BUTTON* m_deleteButton;
wxStaticText* m_thicknessLabel;
TEXT_CTRL_EVAL* m_thicknessCtrl;
wxStaticText* m_thicknessUnits;
wxCheckBox* m_filledCtrl;
wxPanel* m_panelPoly;
wxStaticBitmap* m_warningIcon;
wxStaticText* m_warningText;
wxStaticText* m_statusLine1;
wxStdDialogButtonSizer* m_sdbSizer;
wxButton* m_sdbSizerOK;
wxButton* m_sdbSizerCancel;
// Virtual event handlers, override them in your derived class
virtual void onGridSelect( wxGridRangeSelectEvent& event ) { event.Skip(); }
virtual void onCellSelect( wxGridEvent& event ) { event.Skip(); }
virtual void OnButtonAdd( wxCommandEvent& event ) { event.Skip(); }
virtual void OnButtonDelete( wxCommandEvent& event ) { event.Skip(); }
virtual void onPaintPolyPanel( wxPaintEvent& event ) { event.Skip(); }
virtual void onPolyPanelResize( wxSizeEvent& event ) { event.Skip(); }
public:
DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Basic Shape Polygon"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_PAD_PRIMITIVE_POLY_PROPS_BASE();
};

View File

@ -50,7 +50,6 @@
#include <advanced_config.h> // for pad property feature management
#include <wx/choicdlg.h>
#include <dialog_pad_primitives_properties.h>
// list of pad shapes, ordered like the pad shape wxChoice in dialog.
static PAD_SHAPE code_shape[] =
@ -258,7 +257,6 @@ DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES( PCB_BASE_FRAME* aParent, PAD* aPad
infoFont.SetStyle( wxFONTSTYLE_ITALIC );
m_nonCopperNote->SetFont( infoFont );
m_staticTextInfoPaste->SetFont( infoFont );
m_staticTextPrimitiveListWarning->SetFont( infoFont );
m_minTrackWidthHint->SetFont( infoFont );
updateHoleControls();
@ -334,18 +332,6 @@ void DIALOG_PAD_PROPERTIES::OnCancel( wxCommandEvent& event )
}
void DIALOG_PAD_PROPERTIES::enablePrimitivePage( bool aEnable )
{
// Enable or disable the widgets in page managing custom shape primitives
m_listCtrlPrimitives->Enable( aEnable );
m_buttonDel->Enable( aEnable );
m_buttonEditShape->Enable( aEnable );
m_buttonAddShape->Enable( aEnable );
m_buttonDup->Enable( aEnable );
m_buttonGeometry->Enable( aEnable );
}
void DIALOG_PAD_PROPERTIES::prepareCanvas()
{
// Initialize the canvas to display the pad
@ -673,8 +659,6 @@ void DIALOG_PAD_PROPERTIES::initValues()
updateRoundRectCornerValues();
enablePrimitivePage( PAD_SHAPE::CUSTOM == m_previewPad->GetShape() );
// Type of pad selection
bool aperture =
m_previewPad->GetAttribute() == PAD_ATTRIB::SMD && m_previewPad->IsAperturePad();
@ -729,9 +713,6 @@ void DIALOG_PAD_PROPERTIES::initValues()
// by the call to OnPadShapeSelection()
m_previewPad->SetThermalSpokeAngle( spokeInitialAngle );
m_spokeAngle.SetAngleValue( m_previewPad->GetThermalSpokeAngle() );
// Update basic shapes list
displayPrimitivesList();
}
@ -744,94 +725,6 @@ static wxString formatCoord( EDA_UNITS aUnits, const VECTOR2I& aCoord )
}
void DIALOG_PAD_PROPERTIES::displayPrimitivesList()
{
m_listCtrlPrimitives->ClearAll();
wxListItem itemCol;
itemCol.SetImage(-1);
for( int ii = 0; ii < 5; ++ii )
m_listCtrlPrimitives->InsertColumn(ii, itemCol);
wxString bs_info[5];
for( unsigned ii = 0; ii < m_primitives.size(); ++ii )
{
const std::shared_ptr<PCB_SHAPE>& primitive = m_primitives[ii];
for( wxString& s : bs_info )
s.Empty();
bs_info[4] = _( "width" ) + wxS( " " )+ EDA_UNIT_UTILS::UI::MessageTextFromValue( pcbIUScale, m_units,
primitive->GetWidth() );
switch( primitive->GetShape() )
{
case SHAPE_T::SEGMENT:
bs_info[0] = _( "Segment" );
bs_info[1] = _( "from" ) + wxS( " " ) + formatCoord( m_units, primitive->GetStart() );
bs_info[2] = _( "to" ) + wxS( " " ) + formatCoord( m_units, primitive->GetEnd() );
break;
case SHAPE_T::BEZIER:
bs_info[0] = _( "Bezier" );
bs_info[1] = _( "from" ) + wxS( " " ) + formatCoord( m_units, primitive->GetStart() );
bs_info[2] = _( "to" ) + wxS( " " ) + formatCoord( m_units, primitive->GetEnd() );
break;
case SHAPE_T::ARC:
bs_info[0] = _( "Arc" );
bs_info[1] = _( "center" ) + wxS( " " ) + formatCoord( m_units, primitive->GetCenter() );
bs_info[2] = _( "start" ) + wxS( " " ) + formatCoord( m_units, primitive->GetStart() );
bs_info[3] = _( "angle" ) + wxS( " " ) + EDA_UNIT_UTILS::FormatAngle( primitive->GetArcAngle() );
break;
case SHAPE_T::CIRCLE:
if( primitive->GetWidth() )
bs_info[0] = _( "Ring" );
else
bs_info[0] = _( "Circle" );
bs_info[1] = _( "at" ) + wxS( " " ) + formatCoord( m_units, primitive->GetStart() );
bs_info[2] = _( "radius" ) + wxS( " " ) + EDA_UNIT_UTILS::UI::MessageTextFromValue( pcbIUScale, m_units,
primitive->GetRadius() );
break;
case SHAPE_T::POLY:
bs_info[0] = _( "Polygon" );
bs_info[1] = wxString::Format( _( "corners count %d" ),
primitive->GetPolyShape().Outline( 0 ).PointCount() );
break;
case SHAPE_T::RECTANGLE:
if( primitive->IsAnnotationProxy() )
bs_info[0] = _( "Number box" );
else
bs_info[0] = _( "Rectangle" );
bs_info[1] = _( "from" ) + wxS( " " ) + formatCoord( m_units, primitive->GetStart() );
bs_info[2] = _( "to" ) + wxS( " " ) + formatCoord( m_units, primitive->GetEnd() );
break;
default:
bs_info[0] = _( "Unknown primitive" );
break;
}
long tmp = m_listCtrlPrimitives->InsertItem( ii, bs_info[0] );
m_listCtrlPrimitives->SetItemData( tmp, ii );
for( int jj = 0, col = 0; jj < 5; ++jj )
m_listCtrlPrimitives->SetItem( tmp, col++, bs_info[jj] );
}
// Now columns are filled, ensure correct width of columns
for( unsigned ii = 0; ii < 5; ++ii )
m_listCtrlPrimitives->SetColumnWidth( ii, wxLIST_AUTOSIZE );
}
void DIALOG_PAD_PROPERTIES::OnResize( wxSizeEvent& event )
{
redraw();
@ -959,8 +852,6 @@ void DIALOG_PAD_PROPERTIES::OnPadShapeSelection( wxCommandEvent& event )
bool is_custom = m_PadShapeSelector->GetSelection() == CHOICE_SHAPE_CUSTOM_CIRC_ANCHOR
|| m_PadShapeSelector->GetSelection() == CHOICE_SHAPE_CUSTOM_RECT_ANCHOR;
enablePrimitivePage( is_custom );
if( transferDataToPad( m_previewPad ) )
updateRoundRectCornerValues();
@ -1562,22 +1453,6 @@ void DIALOG_PAD_PROPERTIES::redraw()
m_highlight.pop_back();
}
// highlight selected primitives:
long select = m_listCtrlPrimitives->GetFirstSelected();
while( select >= 0 )
{
PCB_SHAPE* dummyShape = static_cast<PCB_SHAPE*>( m_primitives[select]->Clone() );
dummyShape->SetLayer( SELECTED_ITEMS_LAYER );
dummyShape->Rotate( { 0, 0 }, m_previewPad->GetOrientation() );
dummyShape->Move( m_previewPad->GetPosition() );
view->Add( dummyShape );
m_highlight.push_back( dummyShape );
select = m_listCtrlPrimitives->GetNextSelected( select );
}
BOX2I bbox = m_previewPad->ViewBBox();
if( bbox.GetSize().x > 0 && bbox.GetSize().y > 0 )
@ -2171,208 +2046,3 @@ void DIALOG_PAD_PROPERTIES::OnValuesChanged( wxCommandEvent& event )
}
}
void DIALOG_PAD_PROPERTIES::editPrimitive()
{
long select = m_listCtrlPrimitives->GetFirstSelected();
if( select < 0 )
{
wxMessageBox( _( "No shape selected" ) );
return;
}
std::shared_ptr<PCB_SHAPE>& shape = m_primitives[select];
if( shape->GetShape() == SHAPE_T::POLY )
{
DIALOG_PAD_PRIMITIVE_POLY_PROPS dlg( this, m_parent, shape.get() );
if( dlg.ShowModal() != wxID_OK )
return;
dlg.TransferDataFromWindow();
}
else
{
DIALOG_PAD_PRIMITIVES_PROPERTIES dlg( this, m_parent, shape.get() );
if( dlg.ShowModal() != wxID_OK )
return;
dlg.TransferDataFromWindow();
}
displayPrimitivesList();
if( m_canUpdate && transferDataToPad( m_previewPad ) )
redraw();
}
void DIALOG_PAD_PROPERTIES::OnPrimitiveSelection( wxListEvent& event )
{
// Called on a double click on the basic shapes list
// To Do: highlight the primitive(s) currently selected.
redraw();
}
void DIALOG_PAD_PROPERTIES::onPrimitiveDClick( wxMouseEvent& event )
{
editPrimitive();
}
void DIALOG_PAD_PROPERTIES::onEditPrimitive( wxCommandEvent& event )
{
editPrimitive();
}
void DIALOG_PAD_PROPERTIES::onDeletePrimitive( wxCommandEvent& event )
{
long select = m_listCtrlPrimitives->GetFirstSelected();
if( select < 0 )
return;
// Multiple selections are allowed. get them and remove corresponding shapes
std::vector<long> indexes;
indexes.push_back( select );
while( ( select = m_listCtrlPrimitives->GetNextSelected( select ) ) >= 0 )
indexes.push_back( select );
// Erase all select shapes
for( unsigned ii = indexes.size(); ii > 0; --ii )
m_primitives.erase( m_primitives.begin() + indexes[ii-1] );
displayPrimitivesList();
if( m_canUpdate && transferDataToPad( m_previewPad ) )
redraw();
}
void DIALOG_PAD_PROPERTIES::onAddPrimitive( wxCommandEvent& event )
{
// Ask user for shape type
wxString shapelist[] = {
_( "Segment" ),
_( "Arc" ),
_( "Bezier" ),
_( "Ring/Circle" ),
_( "Polygon" ),
_( "Number box" ),
};
int type = wxGetSingleChoiceIndex( _( "Shape type:" ), _( "Add Primitive" ),
arrayDim( shapelist ), shapelist, 0, this );
// User pressed cancel
if( type == -1 )
return;
SHAPE_T listtype[] = { SHAPE_T::SEGMENT, SHAPE_T::ARC, SHAPE_T::BEZIER, SHAPE_T::CIRCLE,
SHAPE_T::POLY, SHAPE_T::RECTANGLE };
PCB_SHAPE* primitive = new PCB_SHAPE();
primitive->SetShape( listtype[type] );
if( type == static_cast<int>( arrayDim( shapelist ) ) - 1 )
primitive->SetIsAnnotationProxy();
primitive->SetStroke( STROKE_PARAMS( m_board->GetDesignSettings().GetLineThickness( F_Cu ),
PLOT_DASH_TYPE::SOLID ) );
primitive->SetFilled( true );
if( listtype[type] == SHAPE_T::POLY )
{
DIALOG_PAD_PRIMITIVE_POLY_PROPS dlg( this, m_parent, primitive );
if( dlg.ShowModal() != wxID_OK )
return;
}
else
{
DIALOG_PAD_PRIMITIVES_PROPERTIES dlg( this, m_parent, primitive );
if( dlg.ShowModal() != wxID_OK )
return;
}
m_primitives.emplace_back( primitive );
displayPrimitivesList();
if( m_canUpdate && transferDataToPad( m_previewPad ) )
redraw();
}
void DIALOG_PAD_PROPERTIES::onGeometryTransform( wxCommandEvent& event )
{
long select = m_listCtrlPrimitives->GetFirstSelected();
if( select < 0 )
{
wxMessageBox( _( "No shape selected" ) );
return;
}
// Multiple selections are allowed. Build selected shapes list
std::vector<std::shared_ptr<PCB_SHAPE>> shapeList;
shapeList.emplace_back( m_primitives[select] );
while( ( select = m_listCtrlPrimitives->GetNextSelected( select ) ) >= 0 )
shapeList.emplace_back( m_primitives[select] );
DIALOG_PAD_PRIMITIVES_TRANSFORM dlg( this, m_parent, shapeList, false );
if( dlg.ShowModal() != wxID_OK )
return;
dlg.Transform();
displayPrimitivesList();
if( m_canUpdate && transferDataToPad( m_previewPad ) )
redraw();
}
void DIALOG_PAD_PROPERTIES::onDuplicatePrimitive( wxCommandEvent& event )
{
long select = m_listCtrlPrimitives->GetFirstSelected();
if( select < 0 )
{
wxMessageBox( _( "No shape selected" ) );
return;
}
// Multiple selections are allowed. Build selected shapes list
std::vector<std::shared_ptr<PCB_SHAPE>> shapeList;
shapeList.emplace_back( m_primitives[select] );
while( ( select = m_listCtrlPrimitives->GetNextSelected( select ) ) >= 0 )
shapeList.emplace_back( m_primitives[select] );
DIALOG_PAD_PRIMITIVES_TRANSFORM dlg( this, m_parent, shapeList, true );
if( dlg.ShowModal() != wxID_OK )
return;
// Transfer new settings
// save duplicates to a separate vector to avoid m_primitives reallocation,
// as shapeList contains pointers to its elements
std::vector<std::shared_ptr<PCB_SHAPE>> duplicates;
dlg.Transform( &duplicates, dlg.GetDuplicateCount() );
std::move( duplicates.begin(), duplicates.end(), std::back_inserter( m_primitives ) );
displayPrimitivesList();
if( m_canUpdate && transferDataToPad( m_previewPad ) )
redraw();
}

View File

@ -55,12 +55,9 @@ public:
private:
void prepareCanvas(); // Initialize the canvases (legacy or gal) to display the pad
void initValues();
void displayPrimitivesList();
bool padValuesOK(); ///< test if all values are acceptable for the pad
void redraw();
void editPrimitive();
void updateRoundRectCornerValues();
void enablePrimitivePage( bool aEnable ); ///< enable (or disable) the primitive page editor
/**
* Updates the CheckBox states in pad layers list, based on the layer_mask (if non-empty)
@ -110,18 +107,6 @@ private:
bool TransferDataFromWindow() override;
bool TransferDataToWindow() override;
/// Event handlers of basic shapes list panel
void onDeletePrimitive( wxCommandEvent& event ) override;
void onEditPrimitive( wxCommandEvent& event ) override;
void onAddPrimitive( wxCommandEvent& event ) override;
void onGeometryTransform( wxCommandEvent& event ) override;
void onDuplicatePrimitive( wxCommandEvent& event ) override;
/// Called on a double click on the basic shapes list
void onPrimitiveDClick( wxMouseEvent& event ) override;
/// Called on selection/deselection of a basic shape
void OnPrimitiveSelection( wxListEvent& event ) override;
/// Return the pad property currently selected
PAD_PROP getSelectedProperty();

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.1-282-g1fa54006)
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -1014,61 +1014,6 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind
m_localSettingsPanel->Layout();
bSizerPanelClearance->Fit( m_localSettingsPanel );
m_notebook->AddPage( m_localSettingsPanel, _("Clearance Overrides"), false );
m_panelCustomShapePrimitives = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
m_bSizerPanelPrimitives = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizerAboveList;
bSizerAboveList = new wxBoxSizer( wxHORIZONTAL );
m_staticTextPrimitivesList = new wxStaticText( m_panelCustomShapePrimitives, wxID_ANY, _("Primitives list:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextPrimitivesList->Wrap( -1 );
bSizerAboveList->Add( m_staticTextPrimitivesList, 1, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 );
m_staticTextPrimitiveListWarning = new wxStaticText( m_panelCustomShapePrimitives, wxID_ANY, _("Note: coordinates are relative to anchor pad, orientation 0."), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextPrimitiveListWarning->Wrap( -1 );
bSizerAboveList->Add( m_staticTextPrimitiveListWarning, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 7 );
m_bSizerPanelPrimitives->Add( bSizerAboveList, 0, wxEXPAND|wxBOTTOM, 3 );
m_listCtrlPrimitives = new wxListView( m_panelCustomShapePrimitives, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_HRULES|wxLC_NO_HEADER|wxLC_REPORT );
m_bSizerPanelPrimitives->Add( m_listCtrlPrimitives, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
wxBoxSizer* bSizerButtons;
bSizerButtons = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizerButtonsUpper;
bSizerButtonsUpper = new wxBoxSizer( wxHORIZONTAL );
m_buttonAddShape = new wxButton( m_panelCustomShapePrimitives, wxID_ANY, _("Add Primitive"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerButtonsUpper->Add( m_buttonAddShape, 0, wxALL, 5 );
m_buttonEditShape = new wxButton( m_panelCustomShapePrimitives, wxID_ANY, _("Edit Primitive"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerButtonsUpper->Add( m_buttonEditShape, 0, wxALL, 5 );
m_buttonDup = new wxButton( m_panelCustomShapePrimitives, wxID_ANY, _("Duplicate Primitive"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerButtonsUpper->Add( m_buttonDup, 0, wxALL, 5 );
m_buttonGeometry = new wxButton( m_panelCustomShapePrimitives, wxID_ANY, _("Transform Primitive"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerButtonsUpper->Add( m_buttonGeometry, 0, wxALL, 5 );
bSizerButtonsUpper->Add( 0, 0, 1, wxEXPAND, 5 );
m_buttonDel = new wxButton( m_panelCustomShapePrimitives, wxID_ANY, _("Delete Primitive"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerButtonsUpper->Add( m_buttonDel, 0, wxALL, 5 );
bSizerButtons->Add( bSizerButtonsUpper, 0, wxEXPAND, 5 );
m_bSizerPanelPrimitives->Add( bSizerButtons, 0, wxEXPAND, 5 );
m_panelCustomShapePrimitives->SetSizer( m_bSizerPanelPrimitives );
m_panelCustomShapePrimitives->Layout();
m_bSizerPanelPrimitives->Fit( m_panelCustomShapePrimitives );
m_notebook->AddPage( m_panelCustomShapePrimitives, _("Custom Shape Primitives"), false );
bSizerUpper->Add( m_notebook, 0, wxEXPAND|wxTOP|wxBOTTOM, 12 );
@ -1299,14 +1244,6 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind
m_curvePointsCtrl->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_PAD_PROPERTIES_BASE::onTeardropCurvePointsUpdateUi ), NULL, this );
m_clearanceCtrl->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnValuesChanged ), NULL, this );
m_nonCopperWarningBook->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnUpdateUINonCopperWarning ), NULL, this );
m_listCtrlPrimitives->Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( DIALOG_PAD_PROPERTIES_BASE::onPrimitiveDClick ), NULL, this );
m_listCtrlPrimitives->Connect( wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnPrimitiveSelection ), NULL, this );
m_listCtrlPrimitives->Connect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnPrimitiveSelection ), NULL, this );
m_buttonAddShape->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onAddPrimitive ), NULL, this );
m_buttonEditShape->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onEditPrimitive ), NULL, this );
m_buttonDup->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onDuplicatePrimitive ), NULL, this );
m_buttonGeometry->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onGeometryTransform ), NULL, this );
m_buttonDel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onDeletePrimitive ), NULL, this );
m_cbShowPadOutline->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onChangePadMode ), NULL, this );
m_sdbSizerCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnCancel ), NULL, this );
}
@ -1382,14 +1319,6 @@ DIALOG_PAD_PROPERTIES_BASE::~DIALOG_PAD_PROPERTIES_BASE()
m_curvePointsCtrl->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_PAD_PROPERTIES_BASE::onTeardropCurvePointsUpdateUi ), NULL, this );
m_clearanceCtrl->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnValuesChanged ), NULL, this );
m_nonCopperWarningBook->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnUpdateUINonCopperWarning ), NULL, this );
m_listCtrlPrimitives->Disconnect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( DIALOG_PAD_PROPERTIES_BASE::onPrimitiveDClick ), NULL, this );
m_listCtrlPrimitives->Disconnect( wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnPrimitiveSelection ), NULL, this );
m_listCtrlPrimitives->Disconnect( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnPrimitiveSelection ), NULL, this );
m_buttonAddShape->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onAddPrimitive ), NULL, this );
m_buttonEditShape->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onEditPrimitive ), NULL, this );
m_buttonDup->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onDuplicatePrimitive ), NULL, this );
m_buttonGeometry->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onGeometryTransform ), NULL, this );
m_buttonDel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onDeletePrimitive ), NULL, this );
m_cbShowPadOutline->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::onChangePadMode ), NULL, this );
m_sdbSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnCancel ), NULL, this );

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.1-282-g1fa54006)
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -11,7 +11,6 @@
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
class TEXT_CTRL_EVAL;
class wxListView;
#include "dialog_shim.h"
#include <wx/string.h>
@ -36,9 +35,8 @@ class wxListView;
#include <wx/statbmp.h>
#include <wx/statbox.h>
#include <wx/spinctrl.h>
#include <wx/listctrl.h>
#include <wx/button.h>
#include <wx/notebook.h>
#include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
@ -232,16 +230,6 @@ class DIALOG_PAD_PROPERTIES_BASE : public DIALOG_SHIM
wxStaticText* m_staticTextInfoPaste;
wxStaticBitmap* m_nonCopperWarningIcon;
wxStaticText* m_nonCopperWarningText;
wxPanel* m_panelCustomShapePrimitives;
wxBoxSizer* m_bSizerPanelPrimitives;
wxStaticText* m_staticTextPrimitivesList;
wxStaticText* m_staticTextPrimitiveListWarning;
wxListView* m_listCtrlPrimitives;
wxButton* m_buttonAddShape;
wxButton* m_buttonEditShape;
wxButton* m_buttonDup;
wxButton* m_buttonGeometry;
wxButton* m_buttonDel;
wxSimplebook* m_stackupImagesBook;
wxPanel* page0;
wxStaticBitmap* m_stackupImage0;
@ -283,13 +271,6 @@ class DIALOG_PAD_PROPERTIES_BASE : public DIALOG_SHIM
virtual void onTeardropsUpdateUi( wxUpdateUIEvent& event ) { event.Skip(); }
virtual void onTeardropCurvePointsUpdateUi( wxUpdateUIEvent& event ) { event.Skip(); }
virtual void OnUpdateUINonCopperWarning( wxUpdateUIEvent& event ) { event.Skip(); }
virtual void onPrimitiveDClick( wxMouseEvent& event ) { event.Skip(); }
virtual void OnPrimitiveSelection( wxListEvent& event ) { event.Skip(); }
virtual void onAddPrimitive( wxCommandEvent& event ) { event.Skip(); }
virtual void onEditPrimitive( wxCommandEvent& event ) { event.Skip(); }
virtual void onDuplicatePrimitive( wxCommandEvent& event ) { event.Skip(); }
virtual void onGeometryTransform( wxCommandEvent& event ) { event.Skip(); }
virtual void onDeletePrimitive( wxCommandEvent& event ) { event.Skip(); }
virtual void onChangePadMode( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCancel( wxCommandEvent& event ) { event.Skip(); }