Combine PCBnew and ModEdit Graphic Item Properties dialogs.

Also UNIT_BINDERizes the result.

(cherry picked from commit edd3b25)
This commit is contained in:
Jeff Young 2018-06-11 16:03:16 +01:00
parent ef3e045a9b
commit 40c1c8285d
15 changed files with 237 additions and 1062 deletions

View File

@ -107,7 +107,6 @@ set( PCBNEW_DIALOGS
dialogs/dialog_global_pads_edition_base.cpp
dialogs/dialog_graphic_item_properties.cpp
dialogs/dialog_graphic_item_properties_base.cpp
dialogs/dialog_graphic_item_properties_for_fp_editor.cpp
dialogs/dialog_graphic_items_options.cpp
dialogs/dialog_graphic_items_options_base.cpp
dialogs/dialog_keepout_area_properties.cpp

View File

@ -151,9 +151,7 @@ void DIALOG_SVG_PRINT::initDialog()
m_printMirrorOpt->SetValue( m_printMirror );
m_rbFileOpt->SetSelection( m_oneFileOnly ? 1 : 0 );
AddUnitSymbol( *m_TextPenWidth, g_UserUnit );
m_DialogDefaultPenSize->SetValue( StringFromValue( g_UserUnit, g_DrawDefaultLineThickness ) );
m_DialogDefaultPenSize->SetValue( StringFromValue( g_UserUnit, g_DrawDefaultLineThickness, true ) );
LSEQ seq = m_board->GetEnabledLayers().UIOrder();

View File

@ -571,7 +571,7 @@ void DIALOG_DESIGN_RULES::CopyDimensionsListsToBoard()
if( !msg.IsEmpty() )
{
value = ValueFromString( g_UserUnit, msg );
value = ValueFromString( GetUserUnits(), msg );
via_dim.m_Drill = value;
}
@ -949,11 +949,11 @@ void DIALOG_DESIGN_RULES::setNetClass( const wxString& aNetName, const wxString&
bool DIALOG_DESIGN_RULES::validateData()
{
wxString msg;
int minViaDia = ValueFromTextCtrl( *m_SetViasMinSizeCtrl );
int minViaDrill = ValueFromTextCtrl( *m_SetViasMinDrillCtrl );
int minUViaDia = ValueFromTextCtrl( *m_SetMicroViasMinSizeCtrl );
int minUViaDrill = ValueFromTextCtrl( *m_SetMicroViasMinDrillCtrl );
int minTrackWidth = ValueFromTextCtrl( *m_SetTrackMinWidthCtrl );
int minViaDia = m_viaMinDiameter.GetValue();
int minViaDrill = m_viaMinDrill.GetValue();
int minUViaDia = m_microViaMinDiameter.GetValue();
int minUViaDrill = m_microViaMinDrill.GetValue();
int minTrackWidth = m_trackMinWidth.GetValue();
// Test net class parameters.
for( int row = 0; row < m_grid->GetNumberRows(); row++ )

View File

@ -22,60 +22,49 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file dialog_graphic_item_properties.cpp
/*
* Edit properties of Lines, Circles, Arcs and Polygons for PCBNew and ModEdit
*/
/* Edit parameters values of graphic items type DRAWSEGMENTS:
* Lines
* Circles
* Arcs
* polygon (only layer and contour thickness)
* used as graphic elements found on non copper layers in boards
* items on edge layers are considered as graphic items
* Pcb texts are not always graphic items and are not handled here
*/
#include <fctsys.h>
#include <macros.h>
#include <gr_basic.h>
#include <confirm.h>
#include <class_drawpanel.h>
#include <pcbnew.h>
#include <pcb_edit_frame.h>
#include <board_design_settings.h>
#include <base_units.h>
#include <pcb_base_edit_frame.h>
#include <wx/valnum.h>
#include <board_commit.h>
#include <widgets/text_ctrl_eval.h>
#include <class_board.h>
#include <class_drawsegment.h>
#include <dialog_graphic_item_properties_base.h>
#include <pcb_layer_box_selector.h>
#include <html_messagebox.h>
#include <widgets/text_ctrl_eval.h>
#include <class_board.h>
#include <class_drawsegment.h>
#include <class_edge_mod.h>
#include <widgets/unit_binder.h>
#include <dialog_graphic_item_properties_base.h>
class DIALOG_GRAPHIC_ITEM_PROPERTIES : public DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE
{
private:
PCB_EDIT_FRAME* m_parent;
PCB_BASE_EDIT_FRAME* m_parent;
wxDC* m_DC;
DRAWSEGMENT* m_item;
BOARD_DESIGN_SETTINGS m_brdSettings;
EDGE_MODULE* m_moduleItem;
UNIT_BINDER m_startX, m_startY;
UNIT_BINDER m_endX, m_endY;
UNIT_BINDER m_angle;
UNIT_BINDER m_thickness;
wxFloatingPointValidator<double> m_AngleValidator;
double m_AngleValue;
public:
DIALOG_GRAPHIC_ITEM_PROPERTIES( PCB_EDIT_FRAME* aParent, DRAWSEGMENT* aItem, wxDC* aDC );
DIALOG_GRAPHIC_ITEM_PROPERTIES( PCB_BASE_EDIT_FRAME* aParent, BOARD_ITEM* aItem, wxDC* aDC );
~DIALOG_GRAPHIC_ITEM_PROPERTIES() {};
private:
bool TransferDataToWindow() override;
bool TransferDataFromWindow() override;
void OnLayerChoice( wxCommandEvent& event );
void OnInitDlg( wxInitDialogEvent& event ) override
{
@ -89,85 +78,80 @@ private:
bool Validate() override;
};
DIALOG_GRAPHIC_ITEM_PROPERTIES::DIALOG_GRAPHIC_ITEM_PROPERTIES( PCB_EDIT_FRAME* aParent,
DRAWSEGMENT* aItem, wxDC* aDC ):
DIALOG_GRAPHIC_ITEM_PROPERTIES::DIALOG_GRAPHIC_ITEM_PROPERTIES( PCB_BASE_EDIT_FRAME* aParent,
BOARD_ITEM* aItem, wxDC* aDC ):
DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE( aParent ),
m_startX( aParent, m_startXLabel, m_startXCtrl, m_startXUnits ),
m_startY( aParent, m_startYLabel, m_startYCtrl, m_startYUnits ),
m_endX( aParent, m_endXLabel, m_endXCtrl, m_endXUnits ),
m_endY( aParent, m_endYLabel, m_endYCtrl, m_endYUnits ),
m_angle( aParent, m_angleLabel, m_angleCtrl, m_angleUnits ),
m_thickness( aParent, m_thicknessLabel, m_thicknessCtrl, m_thicknessUnits, true ),
m_AngleValidator( 1, &m_AngleValue ),
m_AngleValue( 0.0 )
{
m_parent = aParent;
m_DC = aDC;
m_item = aItem;
m_brdSettings = m_parent->GetDesignSettings();
m_item = dynamic_cast<DRAWSEGMENT*>( aItem );
m_moduleItem = dynamic_cast<EDGE_MODULE*>( aItem );
m_angle.SetUnits( DEGREES );
m_AngleValidator.SetRange( -360.0, 360.0 );
m_AngleCtrl->SetValidator( m_AngleValidator );
m_AngleValidator.SetWindow( m_AngleCtrl );
m_angleCtrl->SetValidator( m_AngleValidator );
m_AngleValidator.SetWindow( m_angleCtrl );
SetInitialFocus( m_startXCtrl );
m_StandardButtonsSizerOK->SetDefault();
}
void PCB_EDIT_FRAME::InstallGraphicItemPropertiesDialog( DRAWSEGMENT* aItem, wxDC* aDC )
void PCB_BASE_EDIT_FRAME::InstallGraphicItemPropertiesDialog( BOARD_ITEM* aItem, wxDC* aDC )
{
wxCHECK_RET( aItem != NULL, wxT( "InstallGraphicItemPropertiesDialog() error: NULL item" ) );
#ifdef USE_WX_OVERLAY
// #1277772 - Draw into dialog converted in refresh request
aDC = nullptr;
#endif
m_canvas->SetIgnoreMouseEvents( true );
DIALOG_GRAPHIC_ITEM_PROPERTIES dlg( this, aItem, aDC );
dlg.ShowModal();
m_canvas->MoveCursorToCrossHair();
m_canvas->SetIgnoreMouseEvents( false );
if( !aDC )
m_canvas->Refresh();
}
bool DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataToWindow()
{
// Set unit symbol
wxStaticText* texts_unit[] =
{
m_StartPointXUnit,
m_StartPointYUnit,
m_EndPointXUnit,
m_EndPointYUnit,
m_ThicknessTextUnit,
m_DefaulThicknessTextUnit,
};
for( size_t ii = 0; ii < DIM( texts_unit ); ii++ )
{
texts_unit[ii]->SetLabel( GetAbbreviatedUnitsLabel() );
}
if( !m_item )
return false;
// Only an arc has a angle parameter. So do not show this parameter for other shapes
if( m_item->GetShape() != S_ARC )
{
m_AngleText->Show( false );
m_AngleCtrl->Show( false );
m_AngleUnit->Show( false );
}
wxString msg;
m_angle.Show( false );
// Change texts according to the segment shape:
switch( m_item->GetShape() )
{
case S_CIRCLE:
SetTitle( _( "Circle Properties" ) );
m_StartPointXLabel->SetLabel( _( "Center X:" ) );
m_StartPointYLabel->SetLabel( _( "Center Y:" ) );
m_EndPointXLabel->SetLabel( _( "Radius:" ) );
m_EndPointYLabel->Show( false );
m_EndPointYUnit->Show( false );
m_EndY_Ctrl->Show( false );
m_startXLabel->SetLabel( _( "Center X:" ) );
m_startYLabel->SetLabel( _( "Center Y:" ) );
m_endXLabel->SetLabel( _( "Radius:" ) );
m_endY.Show( false );
break;
case S_ARC:
SetTitle( _( "Arc Properties" ) );
m_StartPointXLabel->SetLabel( _( "Center X:" ) );
m_StartPointYLabel->SetLabel( _( "Center Y:" ) );
m_EndPointXLabel->SetLabel( _( "Start Point X:" ) );
m_EndPointYLabel->SetLabel( _( "Start Point Y:" ) );
m_startXLabel->SetLabel( _( "Center X:" ) );
m_startYLabel->SetLabel( _( "Center Y:" ) );
m_endXLabel->SetLabel( _( "Start Point X:" ) );
m_endYLabel->SetLabel( _( "Start Point Y:" ) );
m_AngleValue = m_item->GetAngle() / 10.0;
break;
@ -185,68 +169,61 @@ bool DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataToWindow()
break;
}
PutValueInLocalUnits( *m_Center_StartXCtrl, m_item->GetStart().x );
PutValueInLocalUnits( *m_Center_StartYCtrl, m_item->GetStart().y );
m_startX.SetValue( m_item->GetStart().x );
m_startY.SetValue( m_item->GetStart().y );
if( m_item->GetShape() == S_CIRCLE )
{
PutValueInLocalUnits( *m_EndX_Radius_Ctrl, m_item->GetRadius() );
m_endX.SetValue( m_item->GetRadius() );
}
else
{
PutValueInLocalUnits( *m_EndX_Radius_Ctrl, m_item->GetEnd().x );
PutValueInLocalUnits( *m_EndY_Ctrl, m_item->GetEnd().y );
m_endX.SetValue( m_item->GetEnd().x );
m_endY.SetValue( m_item->GetEnd().y );
}
PutValueInLocalUnits( *m_ThicknessCtrl, m_item->GetWidth() );
int thickness;
if( m_item->GetLayer() == Edge_Cuts )
thickness = m_brdSettings.m_EdgeSegmentWidth;
else
thickness = m_brdSettings.m_DrawSegmentWidth;
PutValueInLocalUnits( *m_DefaultThicknessCtrl, thickness );
m_thickness.SetValue( m_item->GetWidth() );
// Configure the layers list selector
if( m_moduleItem )
m_LayerSelectionCtrl->SetNotAllowedLayerSet( LSET::InternalCuMask().set( Edge_Cuts ) );
else
m_LayerSelectionCtrl->SetNotAllowedLayerSet( LSET::AllCuMask() );
m_LayerSelectionCtrl->SetLayersHotkeys( false );
m_LayerSelectionCtrl->SetNotAllowedLayerSet( LSET::AllCuMask() );
m_LayerSelectionCtrl->SetBoardFrame( m_parent );
m_LayerSelectionCtrl->Resync();
if( m_LayerSelectionCtrl->SetLayerSelection( m_item->GetLayer() ) < 0 )
{
wxMessageBox( _( "This item was on a not allowed or non existing layer.\n"
"It has been moved to the first allowed layer.\n\n"
"Please fix it." ) );
//m_LayerSelectionCtrl->SetLayerSelection( Dwgs_User );
m_LayerSelectionCtrl->SetSelection( 0 );
wxMessageBox( _( "This item was on a forbidden or non-existing layer.\n"
"It has been moved to the first allowed layer." ) );
m_LayerSelectionCtrl->SetSelection( F_SilkS );
}
return DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::TransferDataToWindow();
}
void DIALOG_GRAPHIC_ITEM_PROPERTIES::OnLayerChoice( wxCommandEvent& event )
{
int thickness;
if( m_LayerSelectionCtrl->GetLayerSelection() == Edge_Cuts )
thickness = m_brdSettings.m_EdgeSegmentWidth;
else
thickness = m_brdSettings.m_DrawSegmentWidth;
PutValueInLocalUnits( *m_DefaultThicknessCtrl, thickness );
}
bool DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataFromWindow()
{
if( !DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::TransferDataFromWindow() )
return false;
LAYER_NUM layer = m_LayerSelectionCtrl->GetLayerSelection();
if( IsCopperLayer( layer ) )
{
// An graphic item is put on a copper layer.
// This is sometimes useful, for instance for microwave applications ans net tees.
// Because the DRC does not handle graphic items, it can break boards.
// Therefore a confirmation is requested
if( !IsOK( this, _( "The graphic item will be on a copper layer.\n"
"This is very dangerous because DRC does not handle it.\n"
"Are you sure?" ) ) )
return false;
}
BOARD_COMMIT commit( m_parent );
commit.Modify( m_item );
@ -255,38 +232,27 @@ bool DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataFromWindow()
if( m_DC )
m_item->Draw( m_parent->GetCanvas(), m_DC, GR_XOR );
msg = m_Center_StartXCtrl->GetValue();
m_item->SetStartX( ValueFromString( g_UserUnit, msg ) );
msg = m_Center_StartYCtrl->GetValue();
m_item->SetStartY( ValueFromString( g_UserUnit, msg ) );
m_item->SetStartX( m_startX.GetValue() );
m_item->SetStartY( m_startY.GetValue() );
if( m_item->GetShape() == S_CIRCLE )
{
msg = m_EndX_Radius_Ctrl->GetValue();
m_item->SetEnd( m_item->GetStart() + wxPoint( ValueFromString( g_UserUnit, msg ), 0 ) );
m_item->SetEnd( m_item->GetStart() + wxPoint( m_endX.GetValue(), 0 ) );
}
else
{
msg = m_EndX_Radius_Ctrl->GetValue();
m_item->SetEndX( ValueFromString( g_UserUnit, msg ) );
msg = m_EndY_Ctrl->GetValue();
m_item->SetEndY( ValueFromString( g_UserUnit, msg ) );
m_item->SetEndX( m_endX.GetValue() );
m_item->SetEndY( m_endY.GetValue() );
}
msg = m_ThicknessCtrl->GetValue();
m_item->SetWidth( ValueFromString( g_UserUnit, msg ) );
if( m_moduleItem )
{
m_moduleItem->SetStart0( m_moduleItem->GetStart() );
m_moduleItem->SetEnd0( m_moduleItem->GetEnd() );
}
msg = m_DefaultThicknessCtrl->GetValue();
int thickness = ValueFromString( g_UserUnit, msg );
m_item->SetLayer( ToLAYER_ID( m_LayerSelectionCtrl->GetLayerSelection() ) );
if( m_item->GetLayer() == Edge_Cuts )
m_brdSettings.m_EdgeSegmentWidth = thickness;
else
m_brdSettings.m_DrawSegmentWidth = thickness;
m_item->SetWidth( m_thickness.GetValue() );
m_item->SetLayer( ToLAYER_ID( layer ) );
if( m_item->GetShape() == S_ARC )
{
@ -300,9 +266,6 @@ bool DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataFromWindow()
m_parent->SetMsgPanel( m_item );
m_parent->SetDesignSettings( m_brdSettings );
m_parent->OnModify();
return true;
}
@ -314,33 +277,19 @@ bool DIALOG_GRAPHIC_ITEM_PROPERTIES::Validate()
if( !DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::Validate() )
return false;
// Load the start and end points -- all types use these in the checks.
int startx = ValueFromString( g_UserUnit, m_Center_StartXCtrl->GetValue() );
int starty = ValueFromString( g_UserUnit, m_Center_StartYCtrl->GetValue() );
int endx = ValueFromString( g_UserUnit, m_EndX_Radius_Ctrl->GetValue() );
int endy = ValueFromString( g_UserUnit, m_EndY_Ctrl->GetValue() );
// Type specific checks.
switch( m_item->GetShape() )
{
case S_ARC:
// Check angle of arc.
double angle;
m_AngleCtrl->GetValue().ToDouble( &angle );
if( angle == 0.0 )
{
if( m_angle.GetValue() == 0 )
error_msgs.Add( _( "The arc angle cannot be zero." ) );
}
// Fall through.
case S_CIRCLE:
// Check radius.
if( (startx == endx) && (starty == endy) )
{
if( m_startX.GetValue() == m_endX.GetValue() && m_startY.GetValue() == m_endY.GetValue() )
error_msgs.Add( _( "The radius must be greater than zero." ) );
}
break;
case S_POLYGON:
@ -348,32 +297,26 @@ bool DIALOG_GRAPHIC_ITEM_PROPERTIES::Validate()
default:
// Check start and end are not the same.
if( (startx == endx) && (starty == endy) )
{
if( m_startX.GetValue() == m_endX.GetValue() && m_startY.GetValue() == m_endY.GetValue() )
error_msgs.Add( _( "The start and end points cannot be the same." ) );
}
break;
}
// Check the item thickness. Note the polygon outline thickness is allowed
// to be set to 0, because if the shape is exactly the polygon, its outline
// thickness must be 0
int thickness = ValueFromString( g_UserUnit, m_ThicknessCtrl->GetValue() );
int thickness = m_thickness.GetValue();
if( m_item->GetShape() == S_POLYGON )
{
if( thickness < 0 )
error_msgs.Add( _( "The polygon outline thickness must be >= 0." ) );
}
else if( thickness <= 0 )
error_msgs.Add( _( "The item thickness must be greater than zero." ) );
// And the default thickness.
thickness = ValueFromString( g_UserUnit, m_DefaultThicknessCtrl->GetValue() );
if( thickness <= 0 )
error_msgs.Add( _( "The default thickness must be greater than zero." ) );
else
{
if( thickness <= 0 )
error_msgs.Add( _( "The item thickness must be greater than zero." ) );
}
if( error_msgs.GetCount() )
{

View File

@ -1,12 +1,11 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Aug 4 2017)
// C++ code generated with wxFormBuilder (version Dec 30 2017)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "pcb_layer_box_selector.h"
#include "widgets/text_ctrl_eval.h"
#include "dialog_graphic_item_properties_base.h"
@ -27,55 +26,52 @@ DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE( wxWind
m_fgUpperLeftGridSizer->SetFlexibleDirection( wxBOTH );
m_fgUpperLeftGridSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_StartPointXLabel = new wxStaticText( this, wxID_ANY, _("Start point X:"), wxDefaultPosition, wxDefaultSize, 0 );
m_StartPointXLabel->Wrap( -1 );
m_fgUpperLeftGridSizer->Add( m_StartPointXLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxBOTTOM|wxLEFT|wxTOP, 5 );
m_startXLabel = new wxStaticText( this, wxID_ANY, _("Start point X:"), wxDefaultPosition, wxDefaultSize, 0 );
m_startXLabel->Wrap( -1 );
m_fgUpperLeftGridSizer->Add( m_startXLabel, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT|wxTOP, 5 );
m_Center_StartXCtrl = new TEXT_CTRL_EVAL( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_fgUpperLeftGridSizer->Add( m_Center_StartXCtrl, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxEXPAND|wxLEFT|wxTOP, 5 );
m_startXCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_fgUpperLeftGridSizer->Add( m_startXCtrl, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxEXPAND|wxLEFT|wxTOP, 5 );
m_StartPointXUnit = new wxStaticText( this, wxID_ANY, _("Unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_StartPointXUnit->Wrap( -1 );
m_fgUpperLeftGridSizer->Add( m_StartPointXUnit, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
m_startXUnits = new wxStaticText( this, wxID_ANY, _("Unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_startXUnits->Wrap( -1 );
m_fgUpperLeftGridSizer->Add( m_startXUnits, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
m_StartPointYLabel = new wxStaticText( this, wxID_ANY, _("Start point Y:"), wxDefaultPosition, wxDefaultSize, 0 );
m_StartPointYLabel->Wrap( -1 );
m_fgUpperLeftGridSizer->Add( m_StartPointYLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxBOTTOM|wxLEFT|wxTOP, 5 );
m_startYLabel = new wxStaticText( this, wxID_ANY, _("Start point Y:"), wxDefaultPosition, wxDefaultSize, 0 );
m_startYLabel->Wrap( -1 );
m_fgUpperLeftGridSizer->Add( m_startYLabel, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT|wxTOP, 5 );
m_Center_StartYCtrl = new TEXT_CTRL_EVAL( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_fgUpperLeftGridSizer->Add( m_Center_StartYCtrl, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxEXPAND|wxLEFT|wxTOP, 5 );
m_startYCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_fgUpperLeftGridSizer->Add( m_startYCtrl, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxEXPAND|wxLEFT|wxTOP, 5 );
m_StartPointYUnit = new wxStaticText( this, wxID_ANY, _("Unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_StartPointYUnit->Wrap( -1 );
m_fgUpperLeftGridSizer->Add( m_StartPointYUnit, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
m_startYUnits = new wxStaticText( this, wxID_ANY, _("Unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_startYUnits->Wrap( -1 );
m_fgUpperLeftGridSizer->Add( m_startYUnits, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
m_EndPointXLabel = new wxStaticText( this, wxID_ANY, _("End point X:"), wxDefaultPosition, wxDefaultSize, 0 );
m_EndPointXLabel->Wrap( -1 );
m_fgUpperLeftGridSizer->Add( m_EndPointXLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxBOTTOM|wxLEFT|wxTOP, 5 );
m_endXLabel = new wxStaticText( this, wxID_ANY, _("End point X:"), wxDefaultPosition, wxDefaultSize, 0 );
m_endXLabel->Wrap( -1 );
m_fgUpperLeftGridSizer->Add( m_endXLabel, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT|wxTOP, 5 );
m_EndX_Radius_Ctrl = new TEXT_CTRL_EVAL( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_fgUpperLeftGridSizer->Add( m_EndX_Radius_Ctrl, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxEXPAND|wxLEFT|wxTOP, 5 );
m_endXCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_fgUpperLeftGridSizer->Add( m_endXCtrl, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxEXPAND|wxLEFT|wxTOP, 5 );
m_EndPointXUnit = new wxStaticText( this, wxID_ANY, _("Unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_EndPointXUnit->Wrap( -1 );
m_fgUpperLeftGridSizer->Add( m_EndPointXUnit, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
m_endXUnits = new wxStaticText( this, wxID_ANY, _("Unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_endXUnits->Wrap( -1 );
m_fgUpperLeftGridSizer->Add( m_endXUnits, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
m_EndPointYLabel = new wxStaticText( this, wxID_ANY, _("End point Y:"), wxDefaultPosition, wxDefaultSize, 0 );
m_EndPointYLabel->Wrap( -1 );
m_fgUpperLeftGridSizer->Add( m_EndPointYLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxBOTTOM|wxLEFT|wxTOP, 5 );
m_endYLabel = new wxStaticText( this, wxID_ANY, _("End point Y:"), wxDefaultPosition, wxDefaultSize, 0 );
m_endYLabel->Wrap( -1 );
m_fgUpperLeftGridSizer->Add( m_endYLabel, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT|wxTOP, 5 );
m_EndY_Ctrl = new TEXT_CTRL_EVAL( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_fgUpperLeftGridSizer->Add( m_EndY_Ctrl, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxEXPAND|wxLEFT|wxTOP, 5 );
m_endYCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_fgUpperLeftGridSizer->Add( m_endYCtrl, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxEXPAND|wxLEFT|wxTOP, 5 );
m_EndPointYUnit = new wxStaticText( this, wxID_ANY, _("Unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_EndPointYUnit->Wrap( -1 );
m_fgUpperLeftGridSizer->Add( m_EndPointYUnit, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT|wxRIGHT|wxTOP, 5 );
m_endYUnits = new wxStaticText( this, wxID_ANY, _("Unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_endYUnits->Wrap( -1 );
m_fgUpperLeftGridSizer->Add( m_endYUnits, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
bUpperSizer->Add( m_fgUpperLeftGridSizer, 0, wxEXPAND, 5 );
m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
bUpperSizer->Add( m_staticline2, 0, wxEXPAND | wxALL, 5 );
bUpperSizer->Add( m_fgUpperLeftGridSizer, 1, wxEXPAND|wxRIGHT, 30 );
wxBoxSizer* bUpperRightSizer;
bUpperRightSizer = new wxBoxSizer( wxVERTICAL );
@ -86,45 +82,34 @@ DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE( wxWind
fgUpperRightGridSizer->SetFlexibleDirection( wxBOTH );
fgUpperRightGridSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_AngleText = new wxStaticText( this, wxID_ANY, _("Arc angle:"), wxDefaultPosition, wxDefaultSize, 0 );
m_AngleText->Wrap( -1 );
fgUpperRightGridSizer->Add( m_AngleText, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxBOTTOM|wxLEFT|wxTOP, 5 );
m_angleLabel = new wxStaticText( this, wxID_ANY, _("Arc angle:"), wxDefaultPosition, wxDefaultSize, 0 );
m_angleLabel->Wrap( -1 );
fgUpperRightGridSizer->Add( m_angleLabel, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT|wxTOP, 5 );
m_AngleCtrl = new TEXT_CTRL_EVAL( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgUpperRightGridSizer->Add( m_AngleCtrl, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxEXPAND|wxLEFT|wxTOP, 5 );
m_angleCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgUpperRightGridSizer->Add( m_angleCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxALL, 5 );
m_AngleUnit = new wxStaticText( this, wxID_ANY, _("degrees"), wxDefaultPosition, wxDefaultSize, 0 );
m_AngleUnit->Wrap( -1 );
fgUpperRightGridSizer->Add( m_AngleUnit, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
m_angleUnits = new wxStaticText( this, wxID_ANY, _("deg"), wxDefaultPosition, wxDefaultSize, 0 );
m_angleUnits->Wrap( -1 );
fgUpperRightGridSizer->Add( m_angleUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 );
m_ThicknessLabel = new wxStaticText( this, wxID_ANY, _("Item thickness:"), wxDefaultPosition, wxDefaultSize, 0 );
m_ThicknessLabel->Wrap( -1 );
fgUpperRightGridSizer->Add( m_ThicknessLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxTOP|wxBOTTOM|wxLEFT, 5 );
m_thicknessLabel = new wxStaticText( this, wxID_ANY, _("Line thickness:"), wxDefaultPosition, wxDefaultSize, 0 );
m_thicknessLabel->Wrap( -1 );
fgUpperRightGridSizer->Add( m_thicknessLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
m_ThicknessCtrl = new TEXT_CTRL_EVAL( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgUpperRightGridSizer->Add( m_ThicknessCtrl, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxEXPAND|wxLEFT|wxTOP, 5 );
m_thicknessCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgUpperRightGridSizer->Add( m_thicknessCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxALL, 5 );
m_ThicknessTextUnit = new wxStaticText( this, wxID_ANY, _("Unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_ThicknessTextUnit->Wrap( -1 );
fgUpperRightGridSizer->Add( m_ThicknessTextUnit, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
m_DefaultThicknessLabel = new wxStaticText( this, wxID_ANY, _("Default thickness:"), wxDefaultPosition, wxDefaultSize, 0 );
m_DefaultThicknessLabel->Wrap( -1 );
fgUpperRightGridSizer->Add( m_DefaultThicknessLabel, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT|wxTOP, 5 );
m_DefaultThicknessCtrl = new TEXT_CTRL_EVAL( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgUpperRightGridSizer->Add( m_DefaultThicknessCtrl, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxEXPAND|wxLEFT|wxTOP, 5 );
m_DefaulThicknessTextUnit = new wxStaticText( this, wxID_ANY, _("Unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_DefaulThicknessTextUnit->Wrap( -1 );
fgUpperRightGridSizer->Add( m_DefaulThicknessTextUnit, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
m_thicknessUnits = new wxStaticText( this, wxID_ANY, _("Unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_thicknessUnits->Wrap( -1 );
fgUpperRightGridSizer->Add( m_thicknessUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 );
m_LayerLabel = new wxStaticText( this, wxID_ANY, _("Layer:"), wxDefaultPosition, wxDefaultSize, 0 );
m_LayerLabel->Wrap( -1 );
fgUpperRightGridSizer->Add( m_LayerLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxTOP|wxBOTTOM|wxLEFT, 5 );
fgUpperRightGridSizer->Add( m_LayerLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
m_LayerSelectionCtrl = new PCB_LAYER_BOX_SELECTOR( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
fgUpperRightGridSizer->Add( m_LayerSelectionCtrl, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT|wxTOP, 5 );
fgUpperRightGridSizer->Add( m_LayerSelectionCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
fgUpperRightGridSizer->Add( 0, 0, 1, wxEXPAND, 5 );
@ -136,10 +121,10 @@ DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE( wxWind
bUpperSizer->Add( bUpperRightSizer, 0, wxEXPAND, 5 );
bMainSizer->Add( bUpperSizer, 1, wxALL|wxEXPAND, 5 );
bMainSizer->Add( bUpperSizer, 1, wxEXPAND|wxALL, 10 );
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bMainSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
bMainSizer->Add( m_staticline1, 0, wxEXPAND|wxRIGHT|wxLEFT, 10 );
m_StandardButtonsSizer = new wxStdDialogButtonSizer();
m_StandardButtonsSizerOK = new wxButton( this, wxID_OK );

View File

@ -94,8 +94,8 @@
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="border">10</property>
<property name="flag">wxEXPAND|wxALL</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
@ -103,9 +103,9 @@
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<property name="border">30</property>
<property name="flag">wxEXPAND|wxRIGHT</property>
<property name="proportion">1</property>
<object class="wxFlexGridSizer" expanded="1">
<property name="cols">3</property>
<property name="flexible_direction">wxBOTH</property>
@ -120,7 +120,7 @@
<property name="vgap">0</property>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxBOTTOM|wxLEFT|wxTOP</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT|wxTOP</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property>
@ -158,7 +158,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_StartPointXLabel</property>
<property name="name">m_startXLabel</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -241,7 +241,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_Center_StartXCtrl</property>
<property name="name">m_startXCtrl</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -252,7 +252,7 @@
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">TEXT_CTRL_EVAL; widgets/text_ctrl_eval.h</property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
@ -332,7 +332,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_StartPointXUnit</property>
<property name="name">m_startXUnits</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -377,7 +377,7 @@
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxBOTTOM|wxLEFT|wxTOP</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT|wxTOP</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property>
@ -415,7 +415,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_StartPointYLabel</property>
<property name="name">m_startYLabel</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -498,7 +498,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_Center_StartYCtrl</property>
<property name="name">m_startYCtrl</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -509,7 +509,7 @@
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">TEXT_CTRL_EVAL; widgets/text_ctrl_eval.h</property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
@ -589,7 +589,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_StartPointYUnit</property>
<property name="name">m_startYUnits</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -634,7 +634,7 @@
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxBOTTOM|wxLEFT|wxTOP</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT|wxTOP</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property>
@ -672,7 +672,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_EndPointXLabel</property>
<property name="name">m_endXLabel</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -755,7 +755,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_EndX_Radius_Ctrl</property>
<property name="name">m_endXCtrl</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -766,7 +766,7 @@
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">TEXT_CTRL_EVAL; widgets/text_ctrl_eval.h</property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
@ -846,7 +846,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_EndPointXUnit</property>
<property name="name">m_endXUnits</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -891,7 +891,7 @@
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxBOTTOM|wxLEFT|wxTOP</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT|wxTOP</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property>
@ -929,7 +929,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_EndPointYLabel</property>
<property name="name">m_endYLabel</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -1012,7 +1012,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_EndY_Ctrl</property>
<property name="name">m_endYCtrl</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -1023,7 +1023,7 @@
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">TEXT_CTRL_EVAL; widgets/text_ctrl_eval.h</property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
@ -1065,7 +1065,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT|wxRIGHT|wxTOP</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
@ -1103,7 +1103,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_EndPointYUnit</property>
<property name="name">m_endYUnits</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -1148,87 +1148,6 @@
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND | wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticLine" 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="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="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_staticline2</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">wxLI_VERTICAL</property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
@ -1256,7 +1175,7 @@
<property name="vgap">0</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxBOTTOM|wxLEFT|wxTOP</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT|wxTOP</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
@ -1294,7 +1213,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_AngleText</property>
<property name="name">m_angleLabel</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -1339,7 +1258,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxEXPAND|wxLEFT|wxTOP</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxALL</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="1">
<property name="BottomDockable">1</property>
@ -1377,7 +1296,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_AngleCtrl</property>
<property name="name">m_angleCtrl</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -1388,7 +1307,7 @@
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">TEXT_CTRL_EVAL; widgets/text_ctrl_eval.h</property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
@ -1430,7 +1349,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
@ -1460,7 +1379,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">degrees</property>
<property name="label">deg</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -1468,7 +1387,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_AngleUnit</property>
<property name="name">m_angleUnits</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -1513,7 +1432,7 @@
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxTOP|wxBOTTOM|wxLEFT</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property>
@ -1543,7 +1462,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Item thickness:</property>
<property name="label">Line thickness:</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -1551,7 +1470,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_ThicknessLabel</property>
<property name="name">m_thicknessLabel</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -1596,7 +1515,7 @@
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxEXPAND|wxLEFT|wxTOP</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxALL</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="0">
<property name="BottomDockable">1</property>
@ -1634,7 +1553,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_ThicknessCtrl</property>
<property name="name">m_thicknessCtrl</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -1645,7 +1564,7 @@
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">TEXT_CTRL_EVAL; widgets/text_ctrl_eval.h</property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
@ -1687,7 +1606,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
@ -1725,264 +1644,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_ThicknessTextUnit</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT|wxTOP</property>
<property name="proportion">0</property>
<object class="wxStaticText" 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="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">0</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">Default thickness:</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_DefaultThicknessLabel</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxEXPAND|wxLEFT|wxTOP</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" 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="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="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="maxlength">0</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_DefaultThicknessCtrl</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">TEXT_CTRL_EVAL; widgets/text_ctrl_eval.h</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="value"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnText"></event>
<event name="OnTextEnter"></event>
<event name="OnTextMaxLen"></event>
<event name="OnTextURL"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
<property name="proportion">0</property>
<object class="wxStaticText" 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="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">Unit</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_DefaulThicknessTextUnit</property>
<property name="name">m_thicknessUnits</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -2027,7 +1689,7 @@
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxTOP|wxBOTTOM|wxLEFT</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property>
@ -2109,8 +1771,8 @@
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT|wxTOP</property>
<property name="border">3</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
<property name="proportion">0</property>
<object class="wxBitmapComboBox" expanded="1">
<property name="BottomDockable">1</property>
@ -2216,8 +1878,8 @@
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND | wxALL</property>
<property name="border">10</property>
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticLine" expanded="1">
<property name="BottomDockable">1</property>

View File

@ -1,8 +1,8 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Aug 4 2017)
// C++ code generated with wxFormBuilder (version Dec 30 2017)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE_H__
@ -11,9 +11,7 @@
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
class DIALOG_SHIM;
class PCB_LAYER_BOX_SELECTOR;
class TEXT_CTRL_EVAL;
#include "dialog_shim.h"
#include <wx/string.h>
@ -24,8 +22,8 @@ class TEXT_CTRL_EVAL;
#include <wx/settings.h>
#include <wx/textctrl.h>
#include <wx/sizer.h>
#include <wx/statline.h>
#include <wx/bmpcbox.h>
#include <wx/statline.h>
#include <wx/button.h>
#include <wx/dialog.h>
@ -41,28 +39,24 @@ class DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE : public DIALOG_SHIM
protected:
wxFlexGridSizer* m_fgUpperLeftGridSizer;
wxStaticText* m_StartPointXLabel;
TEXT_CTRL_EVAL* m_Center_StartXCtrl;
wxStaticText* m_StartPointXUnit;
wxStaticText* m_StartPointYLabel;
TEXT_CTRL_EVAL* m_Center_StartYCtrl;
wxStaticText* m_StartPointYUnit;
wxStaticText* m_EndPointXLabel;
TEXT_CTRL_EVAL* m_EndX_Radius_Ctrl;
wxStaticText* m_EndPointXUnit;
wxStaticText* m_EndPointYLabel;
TEXT_CTRL_EVAL* m_EndY_Ctrl;
wxStaticText* m_EndPointYUnit;
wxStaticLine* m_staticline2;
wxStaticText* m_AngleText;
TEXT_CTRL_EVAL* m_AngleCtrl;
wxStaticText* m_AngleUnit;
wxStaticText* m_ThicknessLabel;
TEXT_CTRL_EVAL* m_ThicknessCtrl;
wxStaticText* m_ThicknessTextUnit;
wxStaticText* m_DefaultThicknessLabel;
TEXT_CTRL_EVAL* m_DefaultThicknessCtrl;
wxStaticText* m_DefaulThicknessTextUnit;
wxStaticText* m_startXLabel;
wxTextCtrl* m_startXCtrl;
wxStaticText* m_startXUnits;
wxStaticText* m_startYLabel;
wxTextCtrl* m_startYCtrl;
wxStaticText* m_startYUnits;
wxStaticText* m_endXLabel;
wxTextCtrl* m_endXCtrl;
wxStaticText* m_endXUnits;
wxStaticText* m_endYLabel;
wxTextCtrl* m_endYCtrl;
wxStaticText* m_endYUnits;
wxStaticText* m_angleLabel;
wxTextCtrl* m_angleCtrl;
wxStaticText* m_angleUnits;
wxStaticText* m_thicknessLabel;
wxTextCtrl* m_thicknessCtrl;
wxStaticText* m_thicknessUnits;
wxStaticText* m_LayerLabel;
PCB_LAYER_BOX_SELECTOR* m_LayerSelectionCtrl;
wxStaticLine* m_staticline1;

View File

@ -1,389 +0,0 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2012-2018 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 1992-2018 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
*/
/**
* @file dialog_graphic_item_properties_for_fp_editor.cpp
*/
/* Edit parameters values of graphic items in a footprint body:
* Lines
* Circles
* Arcs
* used as graphic elements found on non copper layers in boards
* Footprint texts are not graphic items and are not handled here
*/
#include <fctsys.h>
#include <macros.h>
#include <confirm.h>
#include <class_drawpanel.h>
#include <pcbnew.h>
#include <pcb_edit_frame.h>
#include <board_design_settings.h>
#include <footprint_edit_frame.h>
#include <base_units.h>
#include <wx/valnum.h>
#include <board_commit.h>
#include <class_board.h>
#include <class_module.h>
#include <class_edge_mod.h>
#include <dialog_graphic_item_properties_base.h>
#include <pcb_layer_box_selector.h>
#include <html_messagebox.h>
#include <widgets/text_ctrl_eval.h>
class DIALOG_MODEDIT_FP_BODY_ITEM_PROPERTIES : public DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE
{
private:
FOOTPRINT_EDIT_FRAME* m_parent;
EDGE_MODULE* m_item;
BOARD_DESIGN_SETTINGS m_brdSettings;
MODULE* m_module;
wxFloatingPointValidator<double> m_AngleValidator;
double m_AngleValue;
public:
DIALOG_MODEDIT_FP_BODY_ITEM_PROPERTIES( FOOTPRINT_EDIT_FRAME* aParent,
EDGE_MODULE* aItem );
~DIALOG_MODEDIT_FP_BODY_ITEM_PROPERTIES() {};
private:
bool TransferDataToWindow() override;
bool TransferDataFromWindow() override;
void OnLayerChoice( wxCommandEvent& event );
void OnInitDlg( wxInitDialogEvent& event ) override
{
// Call the default wxDialog handler of a wxInitDialogEvent
TransferDataToWindow();
// Now all widgets have the size fixed, call FinishDialogSettings
FinishDialogSettings();
}
bool Validate() override;
};
DIALOG_MODEDIT_FP_BODY_ITEM_PROPERTIES::DIALOG_MODEDIT_FP_BODY_ITEM_PROPERTIES(
FOOTPRINT_EDIT_FRAME* aParent,
EDGE_MODULE * aItem ):
DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE( aParent ),
m_AngleValidator( 1, &m_AngleValue ),
m_AngleValue( 0.0 )
{
m_parent = aParent;
m_item = aItem;
m_brdSettings = m_parent->GetDesignSettings();
m_module = m_parent->GetBoard()->m_Modules;
m_AngleValidator.SetRange( -360.0, 360.0 );
m_AngleCtrl->SetValidator( m_AngleValidator );
m_AngleValidator.SetWindow( m_AngleCtrl );
SetFocus();
m_StandardButtonsSizerOK->SetDefault();
Layout();
GetSizer()->SetSizeHints( this );
Centre();
}
/*
* Dialog to edit a graphic item of a footprint body.
*/
void FOOTPRINT_EDIT_FRAME::InstallFootprintBodyItemPropertiesDlg( EDGE_MODULE* aItem )
{
if( aItem == NULL )
{
wxMessageBox( wxT( "InstallGraphicItemPropertiesDialog() error: NULL item" ) );
return;
}
m_canvas->SetIgnoreMouseEvents( true );
DIALOG_MODEDIT_FP_BODY_ITEM_PROPERTIES* dialog =
new DIALOG_MODEDIT_FP_BODY_ITEM_PROPERTIES( this, aItem );
dialog->ShowModal();
dialog->Destroy();
m_canvas->MoveCursorToCrossHair();
m_canvas->SetIgnoreMouseEvents( false );
}
bool DIALOG_MODEDIT_FP_BODY_ITEM_PROPERTIES::TransferDataToWindow()
{
// Set unit symbol
wxStaticText* texts_unit[] =
{
m_StartPointXUnit,
m_StartPointYUnit,
m_EndPointXUnit,
m_EndPointYUnit,
m_ThicknessTextUnit,
m_DefaulThicknessTextUnit,
};
for( size_t ii = 0; ii < DIM( texts_unit ); ii++ )
{
texts_unit[ii]->SetLabel( GetAbbreviatedUnitsLabel() );
}
// Only an arc has a angle parameter. So do not show this parameter for other shapes
if( m_item->GetShape() != S_ARC )
{
m_AngleText->Show( false );
m_AngleCtrl->Show( false );
m_AngleUnit->Show( false );
}
wxString msg;
// Change texts according to the segment shape:
switch( m_item->GetShape() )
{
case S_CIRCLE:
SetTitle( _( "Circle Properties" ) );
m_StartPointXLabel->SetLabel( _( "Center X:" ) );
m_StartPointYLabel->SetLabel( _( "Center Y:" ) );
m_EndPointXLabel->SetLabel( _( "Radius:" ) );
m_EndPointYLabel->Show( false );
m_EndPointYUnit->Show( false );
m_EndY_Ctrl->Show( false );
break;
case S_ARC:
SetTitle( _( "Arc Properties" ) );
m_StartPointXLabel->SetLabel( _( "Center X:" ) );
m_StartPointYLabel->SetLabel( _( "Center Y:" ) );
m_EndPointXLabel->SetLabel( _( "Start Point X:" ) );
m_EndPointYLabel->SetLabel( _( "Start Point Y:" ) );
m_AngleValue = m_item->GetAngle() / 10.0;
break;
case S_POLYGON:
SetTitle( _( "Polygon Properties" ) );
m_fgUpperLeftGridSizer->Show( false );
break;
case S_SEGMENT:
SetTitle( _( "Line Segment Properties" ) );
break;
default:
break;
}
PutValueInLocalUnits( *m_Center_StartXCtrl, m_item->GetStart().x );
PutValueInLocalUnits( *m_Center_StartYCtrl, m_item->GetStart().y );
if( m_item->GetShape() == S_CIRCLE )
{
PutValueInLocalUnits( *m_EndX_Radius_Ctrl, m_item->GetRadius() );
}
else
{
PutValueInLocalUnits( *m_EndX_Radius_Ctrl, m_item->GetEnd().x );
PutValueInLocalUnits( *m_EndY_Ctrl, m_item->GetEnd().y );
}
PutValueInLocalUnits( *m_ThicknessCtrl, m_item->GetWidth() );
PutValueInLocalUnits( *m_DefaultThicknessCtrl, m_brdSettings.m_ModuleSegmentWidth );
// Configure the layers list selector
m_LayerSelectionCtrl->SetLayersHotkeys( false );
m_LayerSelectionCtrl->SetNotAllowedLayerSet( LSET::InternalCuMask().set( Edge_Cuts ) );
m_LayerSelectionCtrl->SetBoardFrame( m_parent );
m_LayerSelectionCtrl->Resync();
if( m_LayerSelectionCtrl->SetLayerSelection( m_item->GetLayer() ) < 0 )
{
wxMessageBox( _( "This item was on an unknown layer.\n"
"It has been moved to the front silk screen layer. Please fix it." ) );
m_LayerSelectionCtrl->SetLayerSelection( F_SilkS );
}
return DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::TransferDataToWindow();
}
void DIALOG_MODEDIT_FP_BODY_ITEM_PROPERTIES::OnLayerChoice( wxCommandEvent& event )
{
}
bool DIALOG_MODEDIT_FP_BODY_ITEM_PROPERTIES::TransferDataFromWindow()
{
BOARD_COMMIT commit( m_parent );
commit.Modify( m_module );
if( !DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::TransferDataFromWindow() )
return false;
LAYER_NUM layer = m_LayerSelectionCtrl->GetLayerSelection();
if( IsCopperLayer( layer ) )
{
// An graphic item is put on a copper layer.
// This is sometimes useful, for instance for microwave applications ans net tees.
// Because the DRC does not handle graphic items, it can break boards.
// Therefore a confirmation is requested
if( !IsOK( this,
_( "The graphic item will be on a copper layer.\n"
"This is very dangerous because DRC does not handle it.\n"
"Are you sure?" ) ) )
return false;
}
wxString msg;
wxPoint coord;
msg = m_Center_StartXCtrl->GetValue();
coord.x = ValueFromString( g_UserUnit, msg );
msg = m_Center_StartYCtrl->GetValue();
coord.y = ValueFromString( g_UserUnit, msg );
m_item->SetStart( coord );
m_item->SetStart0( coord );
if( m_item->GetShape() == S_CIRCLE )
{
msg = m_EndX_Radius_Ctrl->GetValue();
m_item->SetEnd( coord + wxPoint( ValueFromString( g_UserUnit, msg ), 0 ) );
m_item->SetEnd0( m_item->GetEnd() );
}
else
{
msg = m_EndX_Radius_Ctrl->GetValue();
coord.x = ValueFromString( g_UserUnit, msg );
msg = m_EndY_Ctrl->GetValue();
coord.y = ValueFromString( g_UserUnit, msg );
m_item->SetEnd( coord );
m_item->SetEnd0( coord );
}
msg = m_ThicknessCtrl->GetValue();
m_item->SetWidth( ValueFromString( g_UserUnit, msg ) );
msg = m_DefaultThicknessCtrl->GetValue();
int thickness = ValueFromString( g_UserUnit, msg );
m_brdSettings.m_ModuleSegmentWidth = thickness;
m_parent->SetDesignSettings( m_brdSettings );
m_parent->OnModify();
m_item->SetLayer( ToLAYER_ID( layer ) );
if( m_item->GetShape() == S_ARC )
{
m_item->SetAngle( m_AngleValue * 10.0 );
}
commit.Push( "Modify footprint graphic item" );
m_parent->SetMsgPanel( m_item );
return true;
}
bool DIALOG_MODEDIT_FP_BODY_ITEM_PROPERTIES::Validate()
{
wxArrayString error_msgs;
if( !DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::Validate() )
return false;
// Load the start and end points -- all types use these in the checks.
int startx = ValueFromString( g_UserUnit, m_Center_StartXCtrl->GetValue() );
int starty = ValueFromString( g_UserUnit, m_Center_StartYCtrl->GetValue() );
int endx = ValueFromString( g_UserUnit, m_EndX_Radius_Ctrl->GetValue() );
int endy = ValueFromString( g_UserUnit, m_EndY_Ctrl->GetValue() );
// Type specific checks.
switch( m_item->GetShape() )
{
case S_ARC:
// Check angle of arc.
double angle;
m_AngleCtrl->GetValue().ToDouble( &angle );
if( angle == 0.0 )
{
error_msgs.Add( _( "The arc angle cannot be zero." ) );
}
// Fall through.
case S_CIRCLE:
// Check radius.
if( (startx == endx) && (starty == endy) )
{
error_msgs.Add( _( "The radius must be greater than zero." ) );
}
break;
case S_POLYGON:
break;
default:
// Check start and end are not the same.
if( (startx == endx) && (starty == endy) )
{
error_msgs.Add( _( "The start and end points cannot be the same." ) );
}
break;
}
// Check the item thickness. Note the polygon outline thickness is allowed
// to be set to 0, because if the shape is exactly the polygon, its outline
// thickness must be 0
int thickness = ValueFromString( g_UserUnit, m_ThicknessCtrl->GetValue() );
if( m_item->GetShape() == S_POLYGON )
{
if( thickness < 0 )
error_msgs.Add( _( "The polygon outline thickness must be >= 0." ) );
}
else if( thickness <= 0 )
error_msgs.Add( _( "The item thickness must be greater than zero." ) );
// And the default thickness.
thickness = ValueFromString( g_UserUnit, m_DefaultThicknessCtrl->GetValue() );
if( thickness <= 0 )
error_msgs.Add( _( "The default thickness must be greater than zero." ) );
if( error_msgs.GetCount() )
{
HTML_MESSAGE_BOX dlg( this, _( "Error List" ) );
dlg.ListSet( error_msgs );
dlg.ShowModal();
}
return error_msgs.GetCount() == 0;
}

View File

@ -1144,14 +1144,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
break;
case ID_POPUP_PCB_EDIT_DRAWING:
#ifndef USE_WX_OVERLAY
InstallGraphicItemPropertiesDialog( (DRAWSEGMENT*) GetCurItem(), &dc );
#else
// #1277772 - Draw into dialog converted in refresh request
InstallGraphicItemPropertiesDialog( (DRAWSEGMENT*) GetCurItem(), NULL );
m_canvas->Refresh();
#endif
m_canvas->MoveCursorToCrossHair();
InstallGraphicItemPropertiesDialog( GetCurItem(), &dc );
break;
case ID_POPUP_PCB_MOVE_DRAWING_REQUEST:

View File

@ -391,13 +391,6 @@ public:
/// Function to place a graphic item type EDGE_MODULE currently moved
void Place_EdgeMod( EDGE_MODULE* drawitem );
/**
* Function InstallFootprintBodyItemPropertiesDlg
* Install a dialog to edit a graphic item of a footprint body.
* @param aItem = a pointer to the graphic item to edit
*/
void InstallFootprintBodyItemPropertiesDlg( EDGE_MODULE* aItem );
/**
* Function DlgGlobalChange_PadSettings
* changes pad characteristics for the given footprint

View File

@ -548,9 +548,7 @@ void FOOTPRINT_EDIT_FRAME::OnEditItemRequest( wxDC* aDC, BOARD_ITEM* aItem )
break;
case PCB_MODULE_EDGE_T :
m_canvas->MoveCursorToCrossHair();
InstallFootprintBodyItemPropertiesDlg( static_cast<EDGE_MODULE*>( aItem ) );
m_canvas->Refresh();
InstallGraphicItemPropertiesDialog( aItem, nullptr );
break;
default:

View File

@ -730,9 +730,7 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
break;
case ID_POPUP_MODEDIT_EDIT_BODY_ITEM :
m_canvas->MoveCursorToCrossHair();
InstallFootprintBodyItemPropertiesDlg( (EDGE_MODULE*) GetScreen()->GetCurItem() );
m_canvas->Refresh();
InstallGraphicItemPropertiesDialog( GetScreen()->GetCurItem(), nullptr );
break;
case ID_POPUP_MODEDIT_EDIT_WIDTH_ALL_EDGE:

View File

@ -609,7 +609,7 @@ void PCB_EDIT_FRAME::OnEditItemRequest( wxDC* aDC, BOARD_ITEM* aItem )
break;
case PCB_LINE_T:
InstallGraphicItemPropertiesDialog( static_cast<DRAWSEGMENT*>( aItem ), aDC );
InstallGraphicItemPropertiesDialog( aItem, aDC );
break;
case PCB_ZONE_AREA_T:

View File

@ -158,6 +158,8 @@ public:
*/
void SetRotationAngle( int aRotationAngle );
void InstallGraphicItemPropertiesDialog( BOARD_ITEM* aItem, wxDC* aDC );
///> @copydoc EDA_DRAW_FRAME::UseGalCanvas()
void UseGalCanvas( bool aEnable ) override;

View File

@ -1100,7 +1100,6 @@ public:
// Graphic Segments type DRAWSEGMENT
void Start_Move_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC );
void Place_DrawItem( DRAWSEGMENT* drawitem, wxDC* DC );
void InstallGraphicItemPropertiesDialog( DRAWSEGMENT* aItem, wxDC* aDC );
// Footprint edition (see also PCB_BASE_FRAME)
void InstallFootprintPropertiesDialog( MODULE* Module, wxDC* DC );