Some cleanup and libraries update
This commit is contained in:
parent
0a3fdeedf6
commit
346914c9e3
|
@ -5,6 +5,11 @@ Started 2007-June-11
|
|||
Please add newer entries at the top, list the date and your name with
|
||||
email address.
|
||||
|
||||
2008-Nov-22 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
|
||||
================================================================================
|
||||
++pcbnew
|
||||
Some cleanup in dialog pad edition.
|
||||
|
||||
|
||||
2008-Nov-19 UPDATE Jerry Jacobs <jerkejacobs@gmail.com>
|
||||
================================================================================
|
||||
|
|
|
@ -195,11 +195,11 @@ void LibDrawSquare::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aO
|
|||
|
||||
if( fill == FILLED_WITH_BG_BODYCOLOR && !aData )
|
||||
GRFilledRect( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y,
|
||||
color, linewidth,
|
||||
linewidth, color,
|
||||
ReturnLayerColor( LAYER_DEVICE_BACKGROUND ) );
|
||||
else if( m_Fill == FILLED_SHAPE && !aData )
|
||||
GRFilledRect( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y,
|
||||
color, color );
|
||||
linewidth, color, color );
|
||||
else
|
||||
GRRect( &aPanel->m_ClipBox, aDC, pos1.x, pos1.y, pos2.x, pos2.y,
|
||||
linewidth, color );
|
||||
|
|
|
@ -39,20 +39,20 @@ void WinEDA_SchematicFrame::ReCreateMenuBar()
|
|||
// Menu File:
|
||||
wxMenuItem* item = new wxMenuItem( m_FilesMenu, ID_NEW_PROJECT,
|
||||
_( "&New" ),
|
||||
_( "New schematic sheet" ) );
|
||||
_( "New schematic project" ) );
|
||||
item->SetBitmap( new_xpm );
|
||||
m_FilesMenu->Append( item );
|
||||
|
||||
item = new wxMenuItem( m_FilesMenu, ID_LOAD_PROJECT,
|
||||
_( "&Open" ),
|
||||
_( "Open a schematic sheet" ) );
|
||||
_( "Open an existing schematic project" ) );
|
||||
item->SetBitmap( open_xpm );
|
||||
m_FilesMenu->Append( item );
|
||||
|
||||
m_FilesMenu->AppendSeparator();
|
||||
item = new wxMenuItem( m_FilesMenu, ID_SAVE_PROJECT,
|
||||
_( "&Save Project" ),
|
||||
_( "Save project" ) );
|
||||
_( "Save all sheets in the schematic project" ) );
|
||||
item->SetBitmap( save_project_xpm );
|
||||
m_FilesMenu->Append( item );
|
||||
|
||||
|
|
|
@ -153,28 +153,28 @@ void WinEDA_SchematicFrame::ReCreateVToolbar()
|
|||
m_VToolBar->AddSeparator();
|
||||
m_VToolBar->AddTool( ID_COMPONENT_BUTT, wxEmptyString,
|
||||
BITMAP( add_component_xpm ),
|
||||
_( "Place the component" ), wxITEM_CHECK );
|
||||
_( "Place a component" ), wxITEM_CHECK );
|
||||
|
||||
m_VToolBar->AddTool( ID_PLACE_POWER_BUTT, wxEmptyString,
|
||||
BITMAP( add_power_xpm ),
|
||||
_( "Place the power port" ), wxITEM_CHECK );
|
||||
_( "Place a power port" ), wxITEM_CHECK );
|
||||
|
||||
m_VToolBar->AddSeparator();
|
||||
m_VToolBar->AddTool( ID_WIRE_BUTT, wxEmptyString,
|
||||
BITMAP( add_line_xpm ),
|
||||
_( "Place the wire" ), wxITEM_CHECK );
|
||||
_( "Place a wire" ), wxITEM_CHECK );
|
||||
|
||||
m_VToolBar->AddTool( ID_BUS_BUTT, wxEmptyString,
|
||||
BITMAP( add_bus_xpm ),
|
||||
_( "Place bus" ), wxITEM_CHECK );
|
||||
_( "Place a bus" ), wxITEM_CHECK );
|
||||
|
||||
m_VToolBar->AddTool( ID_WIRETOBUS_ENTRY_BUTT, wxEmptyString,
|
||||
BITMAP( add_line2bus_xpm ),
|
||||
_( "Place the wire to bus entry" ), wxITEM_CHECK );
|
||||
_( "Place a wire to bus entry" ), wxITEM_CHECK );
|
||||
|
||||
m_VToolBar->AddTool( ID_BUSTOBUS_ENTRY_BUTT, wxEmptyString,
|
||||
BITMAP( add_bus2bus_xpm ),
|
||||
_( "Place bus to bus entry" ), wxITEM_CHECK );
|
||||
_( "Place a bus to bus entry" ), wxITEM_CHECK );
|
||||
|
||||
m_VToolBar->AddSeparator();
|
||||
m_VToolBar->AddTool( ID_NOCONN_BUTT, wxEmptyString,
|
||||
|
@ -187,17 +187,17 @@ void WinEDA_SchematicFrame::ReCreateVToolbar()
|
|||
|
||||
m_VToolBar->AddTool( ID_GLABEL_BUTT, wxEmptyString,
|
||||
BITMAP( add_glabel_xpm ),
|
||||
_( "Place the global label.\nWarning: all global labels with the same name are connected in whole hierarchy" ),
|
||||
_( "Place a global label.\nWarning: all global labels with the same name are connected in whole hierarchy" ),
|
||||
wxITEM_CHECK );
|
||||
|
||||
m_VToolBar->AddTool( ID_JUNCTION_BUTT, wxEmptyString,
|
||||
BITMAP( add_junction_xpm ),
|
||||
_( "Place junction" ), wxITEM_CHECK );
|
||||
_( "Place a junction" ), wxITEM_CHECK );
|
||||
|
||||
m_VToolBar->AddSeparator();
|
||||
m_VToolBar->AddTool( ID_HIERLABEL_BUTT, wxEmptyString,
|
||||
BITMAP( add_hierarchical_label_xpm ),
|
||||
_( "Place the hierarchical label. This label will be seen as a pin sheet in the sheet symbol" ),
|
||||
_( "Place a hierarchical label. This label will be seen as a pin sheet in the sheet symbol" ),
|
||||
wxITEM_CHECK );
|
||||
|
||||
m_VToolBar->AddTool( ID_SHEET_SYMBOL_BUTT, wxEmptyString,
|
||||
|
|
Binary file not shown.
1120
internat/fr/kicad.po
1120
internat/fr/kicad.po
File diff suppressed because it is too large
Load Diff
|
@ -57,7 +57,8 @@ set(PCBNEW_SRCS
|
|||
# dialog_netlist.cpp
|
||||
zones_non_copper_type_functions.cpp
|
||||
dialog_non_copper_zones_properties_base.cpp
|
||||
# dialog_pad_edit.cpp
|
||||
dialog_pad_properties.cpp
|
||||
dialog_pad_properties_base.cpp
|
||||
dialog_setup_libs.cpp
|
||||
dialog_orient_footprints.cpp
|
||||
# dialog_track_options.cpp
|
||||
|
@ -70,7 +71,6 @@ set(PCBNEW_SRCS
|
|||
edit.cpp
|
||||
editedge.cpp
|
||||
editmod.cpp
|
||||
editpads.cpp
|
||||
editrack.cpp
|
||||
editrack-part2.cpp
|
||||
edit_track_width.cpp
|
||||
|
|
|
@ -40,11 +40,12 @@ dialog_copper_zone::dialog_copper_zone( WinEDA_PcbFrame* parent, ZONE_SETTING* z
|
|||
/************************************************************************************************/
|
||||
{
|
||||
m_Parent = parent;
|
||||
m_Config = m_Parent->m_Parent->m_EDA_Config;
|
||||
m_Zone_Setting = zone_setting;
|
||||
m_NetSorting = 1; // 0 = alphabetic sort, 1 = pad count sort
|
||||
if( m_Parent->m_Parent->m_EDA_Config )
|
||||
if( m_Config )
|
||||
{
|
||||
m_NetSorting = m_Parent->m_Parent->m_EDA_Config->Read( ZONE_NET_SORT_OPTION_KEY, 1l );
|
||||
m_NetSorting = m_Config->Read( ZONE_NET_SORT_OPTION_KEY, 1l );
|
||||
}
|
||||
|
||||
SetReturnCode( ZONE_ABORT ); // Will be changed on buttons click
|
||||
|
@ -70,8 +71,8 @@ void dialog_copper_zone::OnInitDialog( wxInitDialogEvent& event )
|
|||
m_GridCtrl->SetLabel( msg );
|
||||
|
||||
msg = ReturnStringFromValue( g_UnitMetric,
|
||||
m_Zone_Setting->m_ZoneClearance,
|
||||
m_Parent->m_InternalUnits );
|
||||
m_Zone_Setting->m_ZoneClearance,
|
||||
m_Parent->m_InternalUnits );
|
||||
m_ZoneClearanceCtrl->SetValue( msg );
|
||||
|
||||
if( g_Zone_45_Only )
|
||||
|
@ -85,8 +86,8 @@ void dialog_copper_zone::OnInitDialog( wxInitDialogEvent& event )
|
|||
for( unsigned ii = 0; ii < 4; ii++ )
|
||||
{
|
||||
msg = ReturnStringFromValue( g_UnitMetric,
|
||||
GridList[ii],
|
||||
m_Parent->m_InternalUnits );
|
||||
GridList[ii],
|
||||
m_Parent->m_InternalUnits );
|
||||
m_GridCtrl->SetString( ii, msg );
|
||||
if( grid_routing == GridList[ii] )
|
||||
selection = ii;
|
||||
|
@ -98,8 +99,8 @@ void dialog_copper_zone::OnInitDialog( wxInitDialogEvent& event )
|
|||
m_GridCtrl->SetSelection( selection );
|
||||
|
||||
msg = ReturnStringFromValue( g_UnitMetric,
|
||||
m_Zone_Setting->m_ZoneClearance,
|
||||
m_Parent->m_InternalUnits );
|
||||
m_Zone_Setting->m_ZoneClearance,
|
||||
m_Parent->m_InternalUnits );
|
||||
m_ZoneClearanceCtrl->SetValue( msg );
|
||||
|
||||
switch( m_Zone_Setting->m_Zone_Pad_Options )
|
||||
|
@ -135,11 +136,11 @@ void dialog_copper_zone::OnInitDialog( wxInitDialogEvent& event )
|
|||
AddUnitSymbol( *m_AntipadSizeText, g_UnitMetric );
|
||||
AddUnitSymbol( *m_CopperBridgeWidthText, g_UnitMetric );
|
||||
PutValueInLocalUnits( *m_AntipadSizeValue,
|
||||
m_Zone_Setting->m_ThermalReliefGapValue,
|
||||
PCB_INTERNAL_UNIT );
|
||||
m_Zone_Setting->m_ThermalReliefGapValue,
|
||||
PCB_INTERNAL_UNIT );
|
||||
PutValueInLocalUnits( *m_CopperWidthValue,
|
||||
m_Zone_Setting->m_ThermalReliefCopperBridgeValue,
|
||||
PCB_INTERNAL_UNIT );
|
||||
m_Zone_Setting->m_ThermalReliefCopperBridgeValue,
|
||||
PCB_INTERNAL_UNIT );
|
||||
|
||||
switch( m_Zone_Setting->m_Zone_HatchingStyle )
|
||||
{
|
||||
|
@ -180,19 +181,17 @@ void dialog_copper_zone::OnInitDialog( wxInitDialogEvent& event )
|
|||
|
||||
m_NetSortingOption->SetSelection( m_NetSorting );
|
||||
|
||||
wxString NetNameFilter;
|
||||
if( m_Parent->m_Parent->m_EDA_Config )
|
||||
wxString NetNameFilter = wxT( "N_0*" );
|
||||
if( m_Config )
|
||||
{
|
||||
NetNameFilter =
|
||||
m_Parent->m_Parent->m_EDA_Config->Read( ZONE_NET_FILTER_STRING_KEY, wxT( "N_0*" ) );
|
||||
m_Config->Read( ZONE_NET_FILTER_STRING_KEY );
|
||||
}
|
||||
|
||||
m_NetNameFilter->SetValue( NetNameFilter );
|
||||
wxArrayString ListNetName;
|
||||
m_Parent->m_Pcb->ReturnSortedNetnamesList(
|
||||
ListNetName,
|
||||
m_NetSorting ==
|
||||
0 ? BOARD::ALPHA_SORT : BOARD::PAD_CNT_SORT );
|
||||
m_Parent->m_Pcb->ReturnSortedNetnamesList( ListNetName,
|
||||
m_NetSorting == 0 ? BOARD::ALPHA_SORT : BOARD::PAD_CNT_SORT );
|
||||
|
||||
if( m_NetSorting != 0 )
|
||||
{
|
||||
|
@ -286,10 +285,12 @@ bool dialog_copper_zone::AcceptOptions( bool aPromptForErrors, bool aUseExportab
|
|||
|
||||
m_Zone_Setting->m_ArcToSegmentsCount = m_ArcApproximationOpt->GetSelection() == 1 ? 32 : 16;
|
||||
|
||||
if( m_Parent->m_Parent->m_EDA_Config )
|
||||
if( m_Config )
|
||||
{
|
||||
m_Parent->m_Parent->m_EDA_Config->Write( ZONE_NET_OUTLINES_HATCH_OPTION_KEY,
|
||||
(long) m_Zone_Setting->m_Zone_HatchingStyle );
|
||||
m_Config->Write( ZONE_NET_OUTLINES_HATCH_OPTION_KEY,
|
||||
(long) m_Zone_Setting->m_Zone_HatchingStyle );
|
||||
wxString Filter = m_NetNameFilter->GetValue();
|
||||
m_Config->Write( ZONE_NET_FILTER_STRING_KEY, Filter );
|
||||
}
|
||||
|
||||
switch( m_GridCtrl->GetSelection() )
|
||||
|
@ -315,7 +316,7 @@ bool dialog_copper_zone::AcceptOptions( bool aPromptForErrors, bool aUseExportab
|
|||
m_Zone_Setting->m_GridFillValue = 0;
|
||||
#if 0 // I hope this feature works fine ( JP Charras)
|
||||
DisplayInfo( this, wxT(
|
||||
"You are using No grid for filling zones\nThis is currently in development and for tests only.\n Do not use for production" ) );
|
||||
"You are using No grid for filling zones\nThis is currently in development and for tests only.\n Do not use for production" ) );
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
@ -331,14 +332,14 @@ bool dialog_copper_zone::AcceptOptions( bool aPromptForErrors, bool aUseExportab
|
|||
m_Zone_Setting->m_FilledAreasShowMode = m_ShowFilledAreasInSketchOpt->IsChecked() ? 1 : 0;
|
||||
|
||||
m_Zone_Setting->m_ThermalReliefGapValue = ReturnValueFromTextCtrl( *m_AntipadSizeValue,
|
||||
PCB_INTERNAL_UNIT );
|
||||
PCB_INTERNAL_UNIT );
|
||||
m_Zone_Setting->m_ThermalReliefCopperBridgeValue = ReturnValueFromTextCtrl(
|
||||
*m_CopperWidthValue,
|
||||
PCB_INTERNAL_UNIT );
|
||||
|
||||
m_Parent->m_Parent->m_EDA_Config->Write( ZONE_THERMAL_RELIEF_GAP_STRING_KEY,
|
||||
(long) m_Zone_Setting->m_ThermalReliefGapValue );
|
||||
m_Parent->m_Parent->m_EDA_Config->Write(
|
||||
m_Config->Write( ZONE_THERMAL_RELIEF_GAP_STRING_KEY,
|
||||
(long) m_Zone_Setting->m_ThermalReliefGapValue );
|
||||
m_Config->Write(
|
||||
ZONE_THERMAL_RELIEF_COPPER_WIDTH_STRING_KEY,
|
||||
(long) m_Zone_Setting->
|
||||
m_ThermalReliefCopperBridgeValue );
|
||||
|
@ -410,11 +411,11 @@ void dialog_copper_zone::OnNetSortingOptionSelected( wxCommandEvent& event )
|
|||
}
|
||||
m_ListNetNameSelection->Clear();
|
||||
m_ListNetNameSelection->InsertItems( ListNetName, 0 );
|
||||
if( m_Parent->m_Parent->m_EDA_Config )
|
||||
if( m_Config )
|
||||
{
|
||||
m_Parent->m_Parent->m_EDA_Config->Write( ZONE_NET_SORT_OPTION_KEY, (long) m_NetSorting );
|
||||
m_Parent->m_Parent->m_EDA_Config->Write( ZONE_NET_FILTER_STRING_KEY,
|
||||
m_NetNameFilter->GetValue() );
|
||||
m_Config->Write( ZONE_NET_SORT_OPTION_KEY, (long) m_NetSorting );
|
||||
wxString Filter = m_NetNameFilter->GetValue();
|
||||
m_Config->Write( ZONE_NET_FILTER_STRING_KEY, Filter );
|
||||
}
|
||||
|
||||
// Select and isplay current zone net name in listbox:
|
||||
|
|
|
@ -11,6 +11,7 @@ class dialog_copper_zone: public dialog_copper_zone_base
|
|||
{
|
||||
public:
|
||||
WinEDA_PcbFrame* m_Parent;
|
||||
wxConfig* m_Config; // Current config
|
||||
ZONE_SETTING * m_Zone_Setting;
|
||||
long m_NetSorting;
|
||||
int m_LayerId[LAYER_COUNT]; // Handle the real layer number from layer name position in m_LayerSelectionCtrl
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
#include "wx/msw/wx.rc"
|
|
@ -1,409 +0,0 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dialog_pad_edit.cpp
|
||||
// Purpose:
|
||||
// Author: jean-pierre Charras
|
||||
// Modified by:
|
||||
// Created: 28/02/2006 13:34:48
|
||||
// RCS-ID:
|
||||
// Copyright: License GNU
|
||||
// Licence:
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Generated by DialogBlocks (unregistered), 28/02/2006 13:34:48
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma implementation "dialog_pad_edit.h"
|
||||
#endif
|
||||
|
||||
// For compilers that support precompilation, includes "wx/wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/wx.h"
|
||||
#endif
|
||||
|
||||
////@begin includes
|
||||
////@end includes
|
||||
|
||||
#include "dialog_pad_edit.h"
|
||||
|
||||
////@begin XPM images
|
||||
////@end XPM images
|
||||
|
||||
/*!
|
||||
* WinEDA_PadPropertiesFrame type definition
|
||||
*/
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS( WinEDA_PadPropertiesFrame, wxDialog )
|
||||
|
||||
/*!
|
||||
* WinEDA_PadPropertiesFrame event table definition
|
||||
*/
|
||||
|
||||
BEGIN_EVENT_TABLE( WinEDA_PadPropertiesFrame, wxDialog )
|
||||
|
||||
////@begin WinEDA_PadPropertiesFrame event table entries
|
||||
EVT_RADIOBOX( ID_RADIOBOX_DRILL_SHAPE, WinEDA_PadPropertiesFrame::OnRadioboxDrillShapeSelected )
|
||||
|
||||
EVT_RADIOBOX( ID_LISTBOX_ORIENT_PAD, WinEDA_PadPropertiesFrame::OnListboxOrientPadSelected )
|
||||
|
||||
EVT_RADIOBOX( ID_LISTBOX_SHAPE_PAD, WinEDA_PadPropertiesFrame::OnListboxShapePadSelected )
|
||||
|
||||
EVT_RADIOBOX( ID_LISTBOX_TYPE_PAD, WinEDA_PadPropertiesFrame::OnListboxTypePadSelected )
|
||||
|
||||
EVT_BUTTON( wxID_OK, WinEDA_PadPropertiesFrame::OnOkClick )
|
||||
|
||||
EVT_BUTTON( wxID_CANCEL, WinEDA_PadPropertiesFrame::OnCancelClick )
|
||||
|
||||
////@end WinEDA_PadPropertiesFrame event table entries
|
||||
|
||||
END_EVENT_TABLE()
|
||||
|
||||
/*!
|
||||
* WinEDA_PadPropertiesFrame constructors
|
||||
*/
|
||||
|
||||
WinEDA_PadPropertiesFrame::WinEDA_PadPropertiesFrame( )
|
||||
{
|
||||
}
|
||||
|
||||
WinEDA_PadPropertiesFrame::WinEDA_PadPropertiesFrame( WinEDA_BasePcbFrame* parent,
|
||||
D_PAD * Pad,wxDC * DC,
|
||||
wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
|
||||
{
|
||||
m_Parent = parent;
|
||||
m_DC = DC;
|
||||
m_Module = NULL;
|
||||
CurrentPad = Pad;
|
||||
|
||||
if ( CurrentPad )
|
||||
{
|
||||
Current_PadNetName = CurrentPad->m_Netname;
|
||||
g_Current_PadName = CurrentPad->ReturnStringPadName();
|
||||
m_Module = (MODULE*) CurrentPad->m_Parent;
|
||||
}
|
||||
|
||||
Create(parent, id, caption, pos, size, style);
|
||||
}
|
||||
|
||||
/*!
|
||||
* WinEDA_PadPropertiesFrame creator
|
||||
*/
|
||||
|
||||
bool WinEDA_PadPropertiesFrame::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
|
||||
{
|
||||
////@begin WinEDA_PadPropertiesFrame member initialisation
|
||||
m_LeftBoxSizer = NULL;
|
||||
m_PadNumCtrl = NULL;
|
||||
m_PadNetNameCtrl = NULL;
|
||||
m_PadPositionBoxSizer = NULL;
|
||||
m_DrillShapeBoxSizer = NULL;
|
||||
m_DrillShapeCtrl = NULL;
|
||||
m_PadOptSizer = NULL;
|
||||
m_PadOrient = NULL;
|
||||
m_PadShape = NULL;
|
||||
m_PadType = NULL;
|
||||
m_PadLayerCu = NULL;
|
||||
m_PadLayerCmp = NULL;
|
||||
m_PadLayerAdhCmp = NULL;
|
||||
m_PadLayerAdhCu = NULL;
|
||||
m_PadLayerPateCmp = NULL;
|
||||
m_PadLayerPateCu = NULL;
|
||||
m_PadLayerSilkCmp = NULL;
|
||||
m_PadLayerSilkCu = NULL;
|
||||
m_PadLayerMaskCmp = NULL;
|
||||
m_PadLayerMaskCu = NULL;
|
||||
m_PadLayerECO1 = NULL;
|
||||
m_PadLayerECO2 = NULL;
|
||||
m_PadLayerDraft = NULL;
|
||||
////@end WinEDA_PadPropertiesFrame member initialisation
|
||||
|
||||
////@begin WinEDA_PadPropertiesFrame creation
|
||||
SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
|
||||
wxDialog::Create( parent, id, caption, pos, size, style );
|
||||
|
||||
CreateControls();
|
||||
if (GetSizer())
|
||||
{
|
||||
GetSizer()->SetSizeHints(this);
|
||||
}
|
||||
Centre();
|
||||
////@end WinEDA_PadPropertiesFrame creation
|
||||
return true;
|
||||
}
|
||||
|
||||
/*!
|
||||
* Control creation for WinEDA_PadPropertiesFrame
|
||||
*/
|
||||
|
||||
void WinEDA_PadPropertiesFrame::CreateControls()
|
||||
{
|
||||
SetFont(*g_DialogFont);
|
||||
////@begin WinEDA_PadPropertiesFrame content construction
|
||||
// Generated by DialogBlocks, 30/07/2008 22:05:19 (unregistered)
|
||||
|
||||
WinEDA_PadPropertiesFrame* itemDialog1 = this;
|
||||
|
||||
wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxHORIZONTAL);
|
||||
itemDialog1->SetSizer(itemBoxSizer2);
|
||||
|
||||
m_LeftBoxSizer = new wxBoxSizer(wxVERTICAL);
|
||||
itemBoxSizer2->Add(m_LeftBoxSizer, 0, wxGROW|wxALL, 5);
|
||||
|
||||
wxStaticText* itemStaticText4 = new wxStaticText( itemDialog1, wxID_STATIC, _("Pad Num :"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_LeftBoxSizer->Add(itemStaticText4, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
|
||||
|
||||
m_PadNumCtrl = new wxTextCtrl( itemDialog1, ID_TEXTCTRL_PADNUM, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_LeftBoxSizer->Add(m_PadNumCtrl, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5);
|
||||
|
||||
wxStaticText* itemStaticText6 = new wxStaticText( itemDialog1, wxID_STATIC, _("Pad Net Name :"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_LeftBoxSizer->Add(itemStaticText6, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
|
||||
|
||||
m_PadNetNameCtrl = new wxTextCtrl( itemDialog1, ID_TEXTCTRL_NETNAME, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_LeftBoxSizer->Add(m_PadNetNameCtrl, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5);
|
||||
|
||||
m_PadPositionBoxSizer = new wxBoxSizer(wxVERTICAL);
|
||||
m_LeftBoxSizer->Add(m_PadPositionBoxSizer, 0, wxGROW|wxTOP, 5);
|
||||
|
||||
m_DrillShapeBoxSizer = new wxBoxSizer(wxVERTICAL);
|
||||
itemBoxSizer2->Add(m_DrillShapeBoxSizer, 0, wxGROW|wxTOP, 5);
|
||||
|
||||
wxArrayString m_DrillShapeCtrlStrings;
|
||||
m_DrillShapeCtrlStrings.Add(_("Circle"));
|
||||
m_DrillShapeCtrlStrings.Add(_("Oval"));
|
||||
m_DrillShapeCtrl = new wxRadioBox( itemDialog1, ID_RADIOBOX_DRILL_SHAPE, _("Drill Shape:"), wxDefaultPosition, wxDefaultSize, m_DrillShapeCtrlStrings, 1, wxRA_SPECIFY_COLS );
|
||||
m_DrillShapeCtrl->SetSelection(0);
|
||||
m_DrillShapeBoxSizer->Add(m_DrillShapeCtrl, 0, wxGROW|wxALL, 5);
|
||||
|
||||
m_PadOptSizer = new wxBoxSizer(wxVERTICAL);
|
||||
itemBoxSizer2->Add(m_PadOptSizer, 0, wxGROW|wxALL, 5);
|
||||
|
||||
wxArrayString m_PadOrientStrings;
|
||||
m_PadOrientStrings.Add(_("0"));
|
||||
m_PadOrientStrings.Add(_("90"));
|
||||
m_PadOrientStrings.Add(_("-90"));
|
||||
m_PadOrientStrings.Add(_("180"));
|
||||
m_PadOrientStrings.Add(_("User"));
|
||||
m_PadOrient = new wxRadioBox( itemDialog1, ID_LISTBOX_ORIENT_PAD, _("Pad Orient:"), wxDefaultPosition, wxDefaultSize, m_PadOrientStrings, 1, wxRA_SPECIFY_COLS );
|
||||
m_PadOrient->SetSelection(0);
|
||||
m_PadOptSizer->Add(m_PadOrient, 0, wxGROW|wxALL, 5);
|
||||
|
||||
wxArrayString m_PadShapeStrings;
|
||||
m_PadShapeStrings.Add(_("Circle"));
|
||||
m_PadShapeStrings.Add(_("Oval"));
|
||||
m_PadShapeStrings.Add(_("Rect"));
|
||||
m_PadShapeStrings.Add(_("Trapezoidal"));
|
||||
m_PadShape = new wxRadioBox( itemDialog1, ID_LISTBOX_SHAPE_PAD, _("Pad Shape:"), wxDefaultPosition, wxDefaultSize, m_PadShapeStrings, 1, wxRA_SPECIFY_COLS );
|
||||
m_PadShape->SetSelection(0);
|
||||
m_PadOptSizer->Add(m_PadShape, 0, wxGROW|wxALL, 5);
|
||||
|
||||
wxArrayString m_PadTypeStrings;
|
||||
m_PadTypeStrings.Add(_("Standard"));
|
||||
m_PadTypeStrings.Add(_("SMD"));
|
||||
m_PadTypeStrings.Add(_("Conn"));
|
||||
m_PadType = new wxRadioBox( itemDialog1, ID_LISTBOX_TYPE_PAD, _("Pad Type:"), wxDefaultPosition, wxDefaultSize, m_PadTypeStrings, 1, wxRA_SPECIFY_COLS );
|
||||
m_PadType->SetSelection(0);
|
||||
m_PadOptSizer->Add(m_PadType, 0, wxGROW|wxALL, 5);
|
||||
|
||||
wxBoxSizer* itemBoxSizer15 = new wxBoxSizer(wxVERTICAL);
|
||||
itemBoxSizer2->Add(itemBoxSizer15, 0, wxGROW|wxALL, 5);
|
||||
|
||||
wxButton* itemButton16 = new wxButton( itemDialog1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
itemButton16->SetForegroundColour(wxColour(204, 0, 0));
|
||||
itemBoxSizer15->Add(itemButton16, 0, wxGROW|wxALL, 5);
|
||||
|
||||
wxButton* itemButton17 = new wxButton( itemDialog1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
itemButton17->SetForegroundColour(wxColour(0, 0, 255));
|
||||
itemBoxSizer15->Add(itemButton17, 0, wxGROW|wxALL, 5);
|
||||
|
||||
wxStaticBox* itemStaticBoxSizer18Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Layers:"));
|
||||
wxStaticBoxSizer* itemStaticBoxSizer18 = new wxStaticBoxSizer(itemStaticBoxSizer18Static, wxVERTICAL);
|
||||
itemBoxSizer15->Add(itemStaticBoxSizer18, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT, 5);
|
||||
|
||||
m_PadLayerCu = new wxCheckBox( itemDialog1, ID_CHECKBOX, _("Copper layer"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
|
||||
m_PadLayerCu->SetValue(false);
|
||||
itemStaticBoxSizer18->Add(m_PadLayerCu, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5);
|
||||
|
||||
m_PadLayerCmp = new wxCheckBox( itemDialog1, ID_CHECKBOX1, _("Comp layer"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
|
||||
m_PadLayerCmp->SetValue(false);
|
||||
itemStaticBoxSizer18->Add(m_PadLayerCmp, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5);
|
||||
|
||||
itemStaticBoxSizer18->Add(5, 5, 0, wxGROW|wxALL, 5);
|
||||
|
||||
m_PadLayerAdhCmp = new wxCheckBox( itemDialog1, ID_CHECKBOX2, _("Adhesive Cmp"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
|
||||
m_PadLayerAdhCmp->SetValue(false);
|
||||
itemStaticBoxSizer18->Add(m_PadLayerAdhCmp, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5);
|
||||
|
||||
m_PadLayerAdhCu = new wxCheckBox( itemDialog1, ID_CHECKBOX3, _("Adhesive Copper"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
|
||||
m_PadLayerAdhCu->SetValue(false);
|
||||
itemStaticBoxSizer18->Add(m_PadLayerAdhCu, 0, wxGROW|wxLEFT|wxRIGHT, 5);
|
||||
|
||||
m_PadLayerPateCmp = new wxCheckBox( itemDialog1, ID_CHECKBOX4, _("Solder paste Cmp"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
|
||||
m_PadLayerPateCmp->SetValue(false);
|
||||
itemStaticBoxSizer18->Add(m_PadLayerPateCmp, 0, wxGROW|wxLEFT|wxRIGHT, 5);
|
||||
|
||||
m_PadLayerPateCu = new wxCheckBox( itemDialog1, ID_CHECKBOX5, _("Solder paste Copper"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
|
||||
m_PadLayerPateCu->SetValue(false);
|
||||
itemStaticBoxSizer18->Add(m_PadLayerPateCu, 0, wxGROW|wxLEFT|wxRIGHT, 5);
|
||||
|
||||
m_PadLayerSilkCmp = new wxCheckBox( itemDialog1, ID_CHECKBOX6, _("Silkscreen Cmp"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
|
||||
m_PadLayerSilkCmp->SetValue(false);
|
||||
itemStaticBoxSizer18->Add(m_PadLayerSilkCmp, 0, wxGROW|wxLEFT|wxRIGHT, 5);
|
||||
|
||||
m_PadLayerSilkCu = new wxCheckBox( itemDialog1, ID_CHECKBOX7, _("Silkscreen Copper"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
|
||||
m_PadLayerSilkCu->SetValue(false);
|
||||
itemStaticBoxSizer18->Add(m_PadLayerSilkCu, 0, wxGROW|wxLEFT|wxRIGHT, 5);
|
||||
|
||||
m_PadLayerMaskCmp = new wxCheckBox( itemDialog1, ID_CHECKBOX8, _("Solder mask Cmp"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
|
||||
m_PadLayerMaskCmp->SetValue(false);
|
||||
itemStaticBoxSizer18->Add(m_PadLayerMaskCmp, 0, wxGROW|wxLEFT|wxRIGHT, 5);
|
||||
|
||||
m_PadLayerMaskCu = new wxCheckBox( itemDialog1, ID_CHECKBOX9, _("Solder mask Copper"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
|
||||
m_PadLayerMaskCu->SetValue(false);
|
||||
itemStaticBoxSizer18->Add(m_PadLayerMaskCu, 0, wxGROW|wxLEFT|wxRIGHT, 5);
|
||||
|
||||
m_PadLayerECO1 = new wxCheckBox( itemDialog1, ID_CHECKBOX10, _("E.C.O.1 layer"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
|
||||
m_PadLayerECO1->SetValue(false);
|
||||
itemStaticBoxSizer18->Add(m_PadLayerECO1, 0, wxGROW|wxLEFT|wxRIGHT, 5);
|
||||
|
||||
m_PadLayerECO2 = new wxCheckBox( itemDialog1, ID_CHECKBOX11, _("E.C.O.2 layer"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
|
||||
m_PadLayerECO2->SetValue(false);
|
||||
itemStaticBoxSizer18->Add(m_PadLayerECO2, 0, wxGROW|wxLEFT|wxRIGHT, 5);
|
||||
|
||||
m_PadLayerDraft = new wxCheckBox( itemDialog1, ID_CHECKBOX12, _("Draft layer"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
|
||||
m_PadLayerDraft->SetValue(false);
|
||||
itemStaticBoxSizer18->Add(m_PadLayerDraft, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5);
|
||||
|
||||
////@end WinEDA_PadPropertiesFrame content construction
|
||||
|
||||
SetOthersControls();
|
||||
}
|
||||
|
||||
/*!
|
||||
* Should we show tooltips?
|
||||
*/
|
||||
|
||||
bool WinEDA_PadPropertiesFrame::ShowToolTips()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/*!
|
||||
* Get bitmap resources
|
||||
*/
|
||||
|
||||
wxBitmap WinEDA_PadPropertiesFrame::GetBitmapResource( const wxString& name )
|
||||
{
|
||||
// Bitmap retrieval
|
||||
////@begin WinEDA_PadPropertiesFrame bitmap retrieval
|
||||
wxUnusedVar(name);
|
||||
return wxNullBitmap;
|
||||
////@end WinEDA_PadPropertiesFrame bitmap retrieval
|
||||
}
|
||||
|
||||
/*!
|
||||
* Get icon resources
|
||||
*/
|
||||
|
||||
wxIcon WinEDA_PadPropertiesFrame::GetIconResource( const wxString& name )
|
||||
{
|
||||
// Icon retrieval
|
||||
////@begin WinEDA_PadPropertiesFrame icon retrieval
|
||||
wxUnusedVar(name);
|
||||
return wxNullIcon;
|
||||
////@end WinEDA_PadPropertiesFrame icon retrieval
|
||||
}
|
||||
/*!
|
||||
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
|
||||
*/
|
||||
|
||||
void WinEDA_PadPropertiesFrame::OnOkClick( wxCommandEvent& event )
|
||||
{
|
||||
PadPropertiesAccept(event);
|
||||
}
|
||||
|
||||
/*!
|
||||
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
|
||||
*/
|
||||
|
||||
void WinEDA_PadPropertiesFrame::OnCancelClick( wxCommandEvent& event )
|
||||
{
|
||||
////@begin wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL in WinEDA_PadPropertiesFrame.
|
||||
// Before editing this code, remove the block markers.
|
||||
event.Skip();
|
||||
////@end wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL in WinEDA_PadPropertiesFrame.
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* wxEVT_COMMAND_RADIOBOX_SELECTED event handler for ID_LISTBOX_ORIENT_PAD
|
||||
*/
|
||||
|
||||
void WinEDA_PadPropertiesFrame::OnListboxOrientPadSelected( wxCommandEvent& event )
|
||||
{
|
||||
PadOrientEvent(event);
|
||||
}
|
||||
|
||||
/*!
|
||||
* wxEVT_COMMAND_RADIOBOX_SELECTED event handler for ID_LISTBOX_SHAPE_PAD
|
||||
*/
|
||||
|
||||
void WinEDA_PadPropertiesFrame::OnListboxShapePadSelected( wxCommandEvent& event )
|
||||
{
|
||||
switch (m_PadShape->GetSelection() )
|
||||
{
|
||||
case 0: //CIRCLE:
|
||||
m_PadDeltaSizeCtrl->Enable(FALSE, FALSE);
|
||||
m_PadSizeCtrl->Enable(TRUE, FALSE);
|
||||
break;
|
||||
|
||||
case 1: //OVALE:
|
||||
m_PadDeltaSizeCtrl->Enable(FALSE, FALSE);
|
||||
m_PadSizeCtrl->Enable(TRUE, TRUE);
|
||||
break;
|
||||
|
||||
case 2: // PAD_RECT:
|
||||
m_PadDeltaSizeCtrl->Enable(FALSE, FALSE);
|
||||
m_PadSizeCtrl->Enable(TRUE, TRUE);
|
||||
break;
|
||||
|
||||
case 3: //TRAPEZE:
|
||||
m_PadDeltaSizeCtrl->Enable(TRUE, TRUE);
|
||||
m_PadSizeCtrl->Enable(TRUE, TRUE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
* wxEVT_COMMAND_RADIOBOX_SELECTED event handler for ID_LISTBOX_TYPE_PAD
|
||||
*/
|
||||
|
||||
void WinEDA_PadPropertiesFrame::OnListboxTypePadSelected( wxCommandEvent& event )
|
||||
{
|
||||
PadTypeSelected();
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* wxEVT_COMMAND_RADIOBOX_SELECTED event handler for ID_RADIOBOX_DRILL_SHAPE
|
||||
*/
|
||||
|
||||
void WinEDA_PadPropertiesFrame::OnRadioboxDrillShapeSelected( wxCommandEvent& event )
|
||||
{
|
||||
switch ( m_DrillShapeCtrl->GetSelection() )
|
||||
{
|
||||
case 0: //CIRCLE:
|
||||
m_PadDrillCtrl->Enable(TRUE,FALSE);
|
||||
break;
|
||||
|
||||
case 1: //OVALE:
|
||||
m_PadDrillCtrl->Enable(TRUE, TRUE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,178 +0,0 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dialog_pad_edit.h
|
||||
// Purpose:
|
||||
// Author: jean-pierre Charras
|
||||
// Modified by:
|
||||
// Created: 28/02/2006 13:34:48
|
||||
// RCS-ID:
|
||||
// Copyright: License GNU
|
||||
// Licence:
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Generated by DialogBlocks (unregistered), 28/02/2006 13:34:48
|
||||
|
||||
#ifndef _DIALOG_PAD_EDIT_H_
|
||||
#define _DIALOG_PAD_EDIT_H_
|
||||
|
||||
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
||||
#pragma interface "dialog_pad_edit.h"
|
||||
#endif
|
||||
|
||||
/*!
|
||||
* Includes
|
||||
*/
|
||||
|
||||
////@begin includes
|
||||
////@end includes
|
||||
|
||||
/*!
|
||||
* Forward declarations
|
||||
*/
|
||||
|
||||
////@begin forward declarations
|
||||
class wxBoxSizer;
|
||||
////@end forward declarations
|
||||
|
||||
/*!
|
||||
* Control identifiers
|
||||
*/
|
||||
|
||||
////@begin control identifiers
|
||||
#define ID_DIALOG 10000
|
||||
#define ID_TEXTCTRL_PADNUM 10001
|
||||
#define ID_TEXTCTRL_NETNAME 10002
|
||||
#define ID_RADIOBOX_DRILL_SHAPE 10019
|
||||
#define ID_LISTBOX_ORIENT_PAD 10003
|
||||
#define ID_LISTBOX_SHAPE_PAD 10004
|
||||
#define ID_LISTBOX_TYPE_PAD 10005
|
||||
#define ID_CHECKBOX 10006
|
||||
#define ID_CHECKBOX1 10007
|
||||
#define ID_CHECKBOX2 10008
|
||||
#define ID_CHECKBOX3 10009
|
||||
#define ID_CHECKBOX4 10010
|
||||
#define ID_CHECKBOX5 10011
|
||||
#define ID_CHECKBOX6 10012
|
||||
#define ID_CHECKBOX7 10013
|
||||
#define ID_CHECKBOX8 10014
|
||||
#define ID_CHECKBOX9 10015
|
||||
#define ID_CHECKBOX10 10016
|
||||
#define ID_CHECKBOX11 10017
|
||||
#define ID_CHECKBOX12 10018
|
||||
#define SYMBOL_WINEDA_PADPROPERTIESFRAME_STYLE wxCAPTION|wxSYSTEM_MENU|wxCLOSE_BOX|MAYBE_RESIZE_BORDER
|
||||
#define SYMBOL_WINEDA_PADPROPERTIESFRAME_TITLE _("Pad properties")
|
||||
#define SYMBOL_WINEDA_PADPROPERTIESFRAME_IDNAME ID_DIALOG
|
||||
#define SYMBOL_WINEDA_PADPROPERTIESFRAME_SIZE wxSize(400, 300)
|
||||
#define SYMBOL_WINEDA_PADPROPERTIESFRAME_POSITION wxDefaultPosition
|
||||
////@end control identifiers
|
||||
|
||||
/*!
|
||||
* Compatibility
|
||||
*/
|
||||
|
||||
#ifndef wxCLOSE_BOX
|
||||
#define wxCLOSE_BOX 0x1000
|
||||
#endif
|
||||
|
||||
/*!
|
||||
* WinEDA_PadPropertiesFrame class declaration
|
||||
*/
|
||||
|
||||
class WinEDA_PadPropertiesFrame: public wxDialog
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS( WinEDA_PadPropertiesFrame )
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
public:
|
||||
/// Constructors
|
||||
WinEDA_PadPropertiesFrame( );
|
||||
WinEDA_PadPropertiesFrame( WinEDA_BasePcbFrame* parent,
|
||||
D_PAD * Pad,wxDC * DC,
|
||||
wxWindowID id = SYMBOL_WINEDA_PADPROPERTIESFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_PADPROPERTIESFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_PADPROPERTIESFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_PADPROPERTIESFRAME_SIZE, long style = SYMBOL_WINEDA_PADPROPERTIESFRAME_STYLE );
|
||||
|
||||
/// Creation
|
||||
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WINEDA_PADPROPERTIESFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_PADPROPERTIESFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_PADPROPERTIESFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_PADPROPERTIESFRAME_SIZE, long style = SYMBOL_WINEDA_PADPROPERTIESFRAME_STYLE );
|
||||
|
||||
/// Creates the controls and sizers
|
||||
void CreateControls();
|
||||
|
||||
////@begin WinEDA_PadPropertiesFrame event handler declarations
|
||||
|
||||
/// wxEVT_COMMAND_RADIOBOX_SELECTED event handler for ID_RADIOBOX_DRILL_SHAPE
|
||||
void OnRadioboxDrillShapeSelected( wxCommandEvent& event );
|
||||
|
||||
/// wxEVT_COMMAND_RADIOBOX_SELECTED event handler for ID_LISTBOX_ORIENT_PAD
|
||||
void OnListboxOrientPadSelected( wxCommandEvent& event );
|
||||
|
||||
/// wxEVT_COMMAND_RADIOBOX_SELECTED event handler for ID_LISTBOX_SHAPE_PAD
|
||||
void OnListboxShapePadSelected( wxCommandEvent& event );
|
||||
|
||||
/// wxEVT_COMMAND_RADIOBOX_SELECTED event handler for ID_LISTBOX_TYPE_PAD
|
||||
void OnListboxTypePadSelected( wxCommandEvent& event );
|
||||
|
||||
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
|
||||
void OnOkClick( wxCommandEvent& event );
|
||||
|
||||
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
|
||||
void OnCancelClick( wxCommandEvent& event );
|
||||
|
||||
////@end WinEDA_PadPropertiesFrame event handler declarations
|
||||
|
||||
////@begin WinEDA_PadPropertiesFrame member function declarations
|
||||
|
||||
/// Retrieves bitmap resources
|
||||
wxBitmap GetBitmapResource( const wxString& name );
|
||||
|
||||
/// Retrieves icon resources
|
||||
wxIcon GetIconResource( const wxString& name );
|
||||
////@end WinEDA_PadPropertiesFrame member function declarations
|
||||
|
||||
/// Should we show tooltips?
|
||||
static bool ShowToolTips();
|
||||
|
||||
void PadPropertiesAccept(wxCommandEvent& event);
|
||||
void PadTypeSelected();
|
||||
void PadOrientEvent(wxCommandEvent& event);
|
||||
void SetPadLayersList(long layer_mask);
|
||||
void SetOthersControls();
|
||||
|
||||
////@begin WinEDA_PadPropertiesFrame member variables
|
||||
wxBoxSizer* m_LeftBoxSizer;
|
||||
wxTextCtrl* m_PadNumCtrl;
|
||||
wxTextCtrl* m_PadNetNameCtrl;
|
||||
wxBoxSizer* m_PadPositionBoxSizer;
|
||||
wxBoxSizer* m_DrillShapeBoxSizer;
|
||||
wxRadioBox* m_DrillShapeCtrl;
|
||||
wxBoxSizer* m_PadOptSizer;
|
||||
wxRadioBox* m_PadOrient;
|
||||
wxRadioBox* m_PadShape;
|
||||
wxRadioBox* m_PadType;
|
||||
wxCheckBox* m_PadLayerCu;
|
||||
wxCheckBox* m_PadLayerCmp;
|
||||
wxCheckBox* m_PadLayerAdhCmp;
|
||||
wxCheckBox* m_PadLayerAdhCu;
|
||||
wxCheckBox* m_PadLayerPateCmp;
|
||||
wxCheckBox* m_PadLayerPateCu;
|
||||
wxCheckBox* m_PadLayerSilkCmp;
|
||||
wxCheckBox* m_PadLayerSilkCu;
|
||||
wxCheckBox* m_PadLayerMaskCmp;
|
||||
wxCheckBox* m_PadLayerMaskCu;
|
||||
wxCheckBox* m_PadLayerECO1;
|
||||
wxCheckBox* m_PadLayerECO2;
|
||||
wxCheckBox* m_PadLayerDraft;
|
||||
////@end WinEDA_PadPropertiesFrame member variables
|
||||
WinEDA_BasePcbFrame * m_Parent;
|
||||
wxDC * m_DC;
|
||||
MODULE * m_Module;
|
||||
D_PAD * CurrentPad;
|
||||
|
||||
WinEDA_SizeCtrl * m_PadSizeCtrl;
|
||||
WinEDA_PositionCtrl * m_PadPositionCtrl;
|
||||
WinEDA_SizeCtrl * m_PadDeltaSizeCtrl;
|
||||
WinEDA_SizeCtrl * m_PadOffsetCtrl;
|
||||
WinEDA_SizeCtrl * m_PadDrillCtrl;
|
||||
WinEDA_ValueCtrl * m_PadOrientCtrl; // Pour orientation a 0.1 degre pres
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
// _DIALOG_PAD_EDIT_H_
|
File diff suppressed because it is too large
Load Diff
|
@ -1 +0,0 @@
|
|||
#include "wx/msw/wx.rc"
|
|
@ -0,0 +1,585 @@
|
|||
/******************************************************/
|
||||
/* editpads.cpp: Pad editing functions and dialog box */
|
||||
/******************************************************/
|
||||
|
||||
#include "fctsys.h"
|
||||
#include "common.h"
|
||||
#include "pcbnew.h"
|
||||
#include "trigo.h"
|
||||
|
||||
/* Local variables */
|
||||
static wxString Current_PadNetName;
|
||||
|
||||
|
||||
#define NBSHAPES 4
|
||||
int CodeShape[NBSHAPES] = /* forme des pads */
|
||||
{
|
||||
PAD_CIRCLE, PAD_OVAL, PAD_RECT, PAD_TRAPEZOID
|
||||
};
|
||||
|
||||
|
||||
#define NBTYPES 4
|
||||
int CodeType[NBTYPES] =
|
||||
{
|
||||
PAD_STANDARD, PAD_SMD, PAD_CONN, PAD_HOLE_NOT_PLATED
|
||||
};
|
||||
|
||||
// Default mask layers for pads according to the pad type
|
||||
static long Std_Pad_Layers[NBTYPES] =
|
||||
{
|
||||
// PAD_STANDARD:
|
||||
ALL_CU_LAYERS | SILKSCREEN_LAYER_CMP | SOLDERMASK_LAYER_CU | SOLDERMASK_LAYER_CMP,
|
||||
|
||||
// PAD_CONN:
|
||||
CMP_LAYER | SOLDERPASTE_LAYER_CMP | SOLDERMASK_LAYER_CMP,
|
||||
|
||||
// PAD_SMD:
|
||||
CMP_LAYER | SOLDERMASK_LAYER_CMP,
|
||||
|
||||
//PAD_HOLE_NOT_PLATED:
|
||||
CUIVRE_LAYER | SILKSCREEN_LAYER_CMP | SOLDERMASK_LAYER_CU | SOLDERMASK_LAYER_CMP
|
||||
};
|
||||
|
||||
|
||||
#include "dialog_pad_properties_base.h"
|
||||
|
||||
|
||||
/********************************************************************/
|
||||
/* class DialogPadProperties, derived from DialogPadPropertiesBase, */
|
||||
/* created by wxFormBuilder */
|
||||
/********************************************************************/
|
||||
class DialogPadProperties : public DialogPadPropertiesBase
|
||||
{
|
||||
public:
|
||||
WinEDA_BasePcbFrame* m_Parent;
|
||||
wxDC* m_DC;
|
||||
D_PAD* m_CurrentPad;
|
||||
|
||||
WinEDA_SizeCtrl* m_PadSizeCtrl;
|
||||
WinEDA_PositionCtrl* m_PadPositionCtrl;
|
||||
WinEDA_SizeCtrl* m_PadDeltaSizeCtrl;
|
||||
WinEDA_SizeCtrl* m_PadOffsetCtrl;
|
||||
WinEDA_SizeCtrl* m_PadDrillCtrl;
|
||||
|
||||
public:
|
||||
DialogPadProperties( WinEDA_BasePcbFrame* parent, D_PAD* Pad, wxDC* DC );
|
||||
void InitDialog( wxInitDialogEvent& event );
|
||||
void OnPadShapeSelection( wxCommandEvent& event );
|
||||
void OnDrillShapeSelected( wxCommandEvent& event );
|
||||
void PadOrientEvent( wxCommandEvent& event );
|
||||
void PadTypeSelected( wxCommandEvent& event );
|
||||
void PadPropertiesAccept( wxCommandEvent& event );
|
||||
void SetPadLayersList( long layer_mask );
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************************/
|
||||
DialogPadProperties::DialogPadProperties( WinEDA_BasePcbFrame* parent, D_PAD* Pad, wxDC* DC ) :
|
||||
DialogPadPropertiesBase( parent )
|
||||
/*******************************************************************************************/
|
||||
{
|
||||
m_Parent = parent;
|
||||
m_DC = DC;
|
||||
m_CurrentPad = Pad;
|
||||
|
||||
if( m_CurrentPad )
|
||||
{
|
||||
Current_PadNetName = m_CurrentPad->m_Netname;
|
||||
g_Current_PadName = m_CurrentPad->ReturnStringPadName();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*************************************************************/
|
||||
void WinEDA_BasePcbFrame::InstallPadOptionsFrame( D_PAD* Pad, wxDC* DC, const wxPoint& pos )
|
||||
/*************************************************************/
|
||||
{
|
||||
DialogPadProperties* frame = new DialogPadProperties( this, Pad, DC );
|
||||
|
||||
frame->ShowModal(); frame->Destroy();
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************/
|
||||
void DialogPadProperties::InitDialog( wxInitDialogEvent& event )
|
||||
/**************************************************************/
|
||||
{
|
||||
int tmp;
|
||||
wxCommandEvent cmd_event;
|
||||
|
||||
SetFont( *g_DialogFont );
|
||||
|
||||
SetFocus(); // Required under wxGTK if we want to demiss the dialog with the ESC key
|
||||
|
||||
m_PadNumCtrl->SetValue( g_Current_PadName );
|
||||
m_PadNetNameCtrl->SetValue( Current_PadNetName );
|
||||
D_PAD* pad = m_CurrentPad;
|
||||
if( pad == NULL )
|
||||
pad = &g_Pad_Master;
|
||||
|
||||
m_PadPositionCtrl = new WinEDA_PositionCtrl( this, _( "Pad Position" ),
|
||||
pad->m_Pos,
|
||||
g_UnitMetric, m_PadPositionBoxSizer,
|
||||
m_Parent->m_InternalUnits );
|
||||
|
||||
m_PadSizeCtrl = new WinEDA_SizeCtrl( this, _( "Pad Size" ),
|
||||
pad->m_Size,
|
||||
g_UnitMetric, m_PadPositionBoxSizer,
|
||||
m_Parent->m_InternalUnits );
|
||||
|
||||
m_PadDeltaSizeCtrl = new WinEDA_SizeCtrl( this, _( "Delta" ),
|
||||
pad->m_DeltaSize,
|
||||
g_UnitMetric, m_PadPositionBoxSizer,
|
||||
m_Parent->m_InternalUnits );
|
||||
|
||||
m_PadOffsetCtrl = new WinEDA_SizeCtrl( this, _( "Offset" ),
|
||||
pad->m_Offset,
|
||||
g_UnitMetric, m_PadPositionBoxSizer,
|
||||
m_Parent->m_InternalUnits );
|
||||
|
||||
/* In second column */
|
||||
m_PadDrillCtrl = new WinEDA_SizeCtrl( this, _( "Pad drill" ),
|
||||
pad->m_Drill,
|
||||
g_UnitMetric, m_DrillShapeBoxSizer,
|
||||
m_Parent->m_InternalUnits );
|
||||
|
||||
if( m_CurrentPad )
|
||||
{
|
||||
MODULE* Module = (MODULE*) m_CurrentPad->m_Parent;
|
||||
tmp = m_CurrentPad->m_Orient - Module->m_Orient;
|
||||
}
|
||||
else
|
||||
tmp = g_Pad_Master.m_Orient;
|
||||
wxString msg; msg << tmp;
|
||||
m_PadOrientCtrl->SetValue( msg );
|
||||
|
||||
|
||||
// Pad Orient
|
||||
switch( tmp )
|
||||
{
|
||||
case 0:
|
||||
m_PadOrient->SetSelection( 0 );
|
||||
m_PadOrientCtrl->Enable( FALSE );
|
||||
break;
|
||||
|
||||
case - 2700:
|
||||
case 900:
|
||||
m_PadOrient->SetSelection( 1 );
|
||||
m_PadOrientCtrl->Enable( FALSE );
|
||||
break;
|
||||
|
||||
case - 900:
|
||||
case 2700:
|
||||
m_PadOrient->SetSelection( 2 );
|
||||
m_PadOrientCtrl->Enable( FALSE );
|
||||
break;
|
||||
|
||||
case 1800:
|
||||
case - 1800:
|
||||
m_PadOrient->SetSelection( 3 );
|
||||
m_PadOrientCtrl->Enable( FALSE );
|
||||
break;
|
||||
|
||||
default:
|
||||
m_PadOrient->SetSelection( 4 );
|
||||
break;
|
||||
}
|
||||
|
||||
switch( pad->m_PadShape )
|
||||
{
|
||||
default:
|
||||
case PAD_CIRCLE:
|
||||
m_PadShape->SetSelection( 0 );
|
||||
break;
|
||||
|
||||
case PAD_OVAL:
|
||||
m_PadShape->SetSelection( 1 );
|
||||
break;
|
||||
|
||||
case PAD_RECT:
|
||||
m_PadShape->SetSelection( 2 );
|
||||
break;
|
||||
|
||||
case PAD_TRAPEZOID:
|
||||
m_PadShape->SetSelection( 3 );
|
||||
break;
|
||||
}
|
||||
|
||||
cmd_event.SetId( m_PadShape->GetSelection() );
|
||||
OnPadShapeSelection( cmd_event );
|
||||
|
||||
// Selection du type
|
||||
tmp = pad->m_Attribut;
|
||||
m_PadType->SetSelection( 0 );
|
||||
for( int ii = 0; ii < NBTYPES; ii++ )
|
||||
{
|
||||
if( CodeType[ii] == tmp )
|
||||
{
|
||||
m_PadType->SetSelection( ii ); break;
|
||||
}
|
||||
}
|
||||
|
||||
if( pad->m_DrillShape != PAD_OVAL )
|
||||
m_DrillShapeCtrl->SetSelection( 0 );
|
||||
else
|
||||
m_DrillShapeCtrl->SetSelection( 1 );
|
||||
cmd_event.SetId( m_DrillShapeCtrl->GetSelection() );
|
||||
OnDrillShapeSelected( cmd_event );
|
||||
|
||||
// Set layers used by this pad: :
|
||||
if( m_CurrentPad )
|
||||
SetPadLayersList( m_CurrentPad->m_Masque_Layer );
|
||||
else
|
||||
{
|
||||
cmd_event.SetId( m_PadType->GetSelection() );
|
||||
PadTypeSelected( cmd_event );
|
||||
}
|
||||
|
||||
if( GetSizer() )
|
||||
{
|
||||
GetSizer()->SetSizeHints( this );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*********************************************************************/
|
||||
void DialogPadProperties::OnPadShapeSelection( wxCommandEvent& event )
|
||||
/*********************************************************************/
|
||||
{
|
||||
switch( m_PadShape->GetSelection() )
|
||||
{
|
||||
case 0: //CIRCLE:
|
||||
m_PadDeltaSizeCtrl->Enable( FALSE, FALSE );
|
||||
m_PadSizeCtrl->Enable( TRUE, FALSE );
|
||||
break;
|
||||
|
||||
case 1: //OVALE:
|
||||
m_PadDeltaSizeCtrl->Enable( FALSE, FALSE );
|
||||
m_PadSizeCtrl->Enable( TRUE, TRUE );
|
||||
break;
|
||||
|
||||
case 2: // PAD_RECT:
|
||||
m_PadDeltaSizeCtrl->Enable( FALSE, FALSE );
|
||||
m_PadSizeCtrl->Enable( TRUE, TRUE );
|
||||
break;
|
||||
|
||||
case 3: //TRAPEZE:
|
||||
m_PadDeltaSizeCtrl->Enable( TRUE, TRUE );
|
||||
m_PadSizeCtrl->Enable( TRUE, TRUE );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**********************************************************************/
|
||||
void DialogPadProperties::OnDrillShapeSelected( wxCommandEvent& event )
|
||||
/**********************************************************************/
|
||||
{
|
||||
if ( (m_PadType->GetSelection() == 1) || (m_PadType->GetSelection() == 2) )
|
||||
{ // pad type = SMD or CONN: no hole allowed
|
||||
m_PadDrillCtrl->Enable( FALSE, FALSE );
|
||||
return;
|
||||
}
|
||||
switch( m_DrillShapeCtrl->GetSelection() )
|
||||
{
|
||||
case 0: //CIRCLE:
|
||||
m_PadDrillCtrl->Enable( TRUE, FALSE );
|
||||
break;
|
||||
|
||||
case 1: //OVALE:
|
||||
m_PadDrillCtrl->Enable( TRUE, TRUE );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************/
|
||||
void DialogPadProperties::PadOrientEvent( wxCommandEvent& event )
|
||||
/********************************************************************/
|
||||
{
|
||||
switch( m_PadOrient->GetSelection() )
|
||||
{
|
||||
case 0:
|
||||
m_PadOrientCtrl->SetValue( wxT( "0" ) );
|
||||
m_PadOrientCtrl->Enable( FALSE );
|
||||
break;
|
||||
|
||||
case 1:
|
||||
m_PadOrientCtrl->SetValue( wxT( "900" ) );
|
||||
m_PadOrientCtrl->Enable( FALSE );
|
||||
break;
|
||||
|
||||
case 2:
|
||||
m_PadOrientCtrl->SetValue( wxT( "2700" ) );
|
||||
m_PadOrientCtrl->Enable( FALSE );
|
||||
break;
|
||||
|
||||
case 3:
|
||||
m_PadOrientCtrl->SetValue( wxT( "1800" ) );
|
||||
m_PadOrientCtrl->Enable( FALSE );
|
||||
break;
|
||||
|
||||
default:
|
||||
m_PadOrientCtrl->Enable( TRUE );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************/
|
||||
void DialogPadProperties::PadTypeSelected( wxCommandEvent& event )
|
||||
/*****************************************************************/
|
||||
|
||||
/* Adjust the better mask layer according to the selected pad type
|
||||
*/
|
||||
{
|
||||
long layer_mask;
|
||||
int ii;
|
||||
|
||||
ii = m_PadType->GetSelection();
|
||||
if( (ii < 0) || ( ii >= NBTYPES) )
|
||||
ii = 0;
|
||||
|
||||
layer_mask = Std_Pad_Layers[ii];
|
||||
SetPadLayersList( layer_mask );
|
||||
|
||||
// Enable/disable drill dialog items:
|
||||
event.SetId(m_DrillShapeCtrl->GetSelection());
|
||||
OnDrillShapeSelected( event );
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************/
|
||||
void DialogPadProperties::SetPadLayersList( long layer_mask )
|
||||
/****************************************************************/
|
||||
|
||||
/** SetPadLayersList
|
||||
* Update the CheckBoxes state in pad layers list,
|
||||
* @param layer_mask = pad layer mask (ORed layers bit mask)
|
||||
*/
|
||||
{
|
||||
m_PadLayerCu->SetValue( ( layer_mask & CUIVRE_LAYER ) );
|
||||
m_PadLayerCmp->SetValue( ( layer_mask & CMP_LAYER ) );
|
||||
|
||||
m_PadLayerAdhCmp->SetValue( ( layer_mask & ADHESIVE_LAYER_CMP ) );
|
||||
m_PadLayerAdhCu->SetValue( ( layer_mask & ADHESIVE_LAYER_CU ) );
|
||||
|
||||
m_PadLayerPateCmp->SetValue( ( layer_mask & SOLDERPASTE_LAYER_CMP ) );
|
||||
m_PadLayerPateCu->SetValue( ( layer_mask & SOLDERPASTE_LAYER_CU ) );
|
||||
|
||||
m_PadLayerSilkCmp->SetValue( ( layer_mask & SILKSCREEN_LAYER_CMP ) );
|
||||
m_PadLayerSilkCu->SetValue( ( layer_mask & SILKSCREEN_LAYER_CU ) );
|
||||
|
||||
m_PadLayerMaskCmp->SetValue( ( layer_mask & SOLDERMASK_LAYER_CMP ) );
|
||||
m_PadLayerMaskCu->SetValue( ( layer_mask & SOLDERMASK_LAYER_CU ) );
|
||||
|
||||
m_PadLayerECO1->SetValue( ( layer_mask & ECO1_LAYER ) );
|
||||
m_PadLayerECO2->SetValue( ( layer_mask & ECO2_LAYER ) );
|
||||
|
||||
m_PadLayerDraft->SetValue( ( layer_mask & DRAW_LAYER ) );
|
||||
}
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
void DialogPadProperties::PadPropertiesAccept( wxCommandEvent& event )
|
||||
/*************************************************************************/
|
||||
|
||||
/* Met a jour les differents parametres pour le composant en cours d'édition
|
||||
*/
|
||||
{
|
||||
long PadLayerMask;
|
||||
bool error = FALSE;
|
||||
bool RastnestIsChanged = false;
|
||||
|
||||
if( m_DC )
|
||||
m_Parent->DrawPanel->CursorOff( m_DC );
|
||||
|
||||
g_Pad_Master.m_Attribut = CodeType[m_PadType->GetSelection()];
|
||||
g_Pad_Master.m_PadShape = CodeShape[m_PadShape->GetSelection()];
|
||||
g_Pad_Master.m_Pos = m_PadPositionCtrl->GetValue();
|
||||
g_Pad_Master.m_Pos0 = g_Pad_Master.m_Pos;
|
||||
g_Pad_Master.m_Size = m_PadSizeCtrl->GetValue();
|
||||
if( g_Pad_Master.m_PadShape == PAD_CIRCLE )
|
||||
g_Pad_Master.m_Size.y = g_Pad_Master.m_Size.x;
|
||||
g_Pad_Master.m_DeltaSize = m_PadDeltaSizeCtrl->GetValue();
|
||||
g_Pad_Master.m_Offset = m_PadOffsetCtrl->GetValue();
|
||||
g_Pad_Master.m_Drill = m_PadDrillCtrl->GetValue();
|
||||
if( m_DrillShapeCtrl->GetSelection() == 0 )
|
||||
{
|
||||
g_Pad_Master.m_DrillShape = PAD_CIRCLE;
|
||||
g_Pad_Master.m_Drill.y = g_Pad_Master.m_Drill.x;
|
||||
}
|
||||
else
|
||||
g_Pad_Master.m_DrillShape = PAD_OVAL;
|
||||
long ovalue = 0;
|
||||
wxString msg = m_PadOrientCtrl->GetValue();
|
||||
msg.ToLong( &ovalue );
|
||||
g_Pad_Master.m_Orient = ovalue;
|
||||
|
||||
g_Current_PadName = m_PadNumCtrl->GetValue().Left( 4 );
|
||||
Current_PadNetName = m_PadNetNameCtrl->GetValue();
|
||||
|
||||
/* Test for incorrect values */
|
||||
if( (g_Pad_Master.m_Size.x < g_Pad_Master.m_Drill.x)
|
||||
|| (g_Pad_Master.m_Size.y < g_Pad_Master.m_Drill.y) )
|
||||
{
|
||||
error = TRUE;
|
||||
DisplayError( this, _( "Incorrect value for pad drill: pad drill bigger than pad size" ) );
|
||||
}
|
||||
if( ( g_Pad_Master.m_Size.x / 2 <= ABS( g_Pad_Master.m_Offset.x ) )
|
||||
|| ( g_Pad_Master.m_Size.y / 2 <= ABS( g_Pad_Master.m_Offset.y ) ) )
|
||||
{
|
||||
error = TRUE;
|
||||
DisplayError( this, _( "Incorrect value for pad offset" ) );
|
||||
}
|
||||
|
||||
if( error )
|
||||
{
|
||||
if( m_DC )
|
||||
m_Parent->DrawPanel->CursorOn( m_DC );
|
||||
return;
|
||||
}
|
||||
|
||||
PadLayerMask = 0;
|
||||
if( m_PadLayerCu->GetValue() )
|
||||
PadLayerMask |= CUIVRE_LAYER;
|
||||
if( m_PadLayerCmp->GetValue() )
|
||||
PadLayerMask |= CMP_LAYER;
|
||||
if( ( PadLayerMask & (CUIVRE_LAYER | CMP_LAYER) ) == (CUIVRE_LAYER | CMP_LAYER) )
|
||||
PadLayerMask |= ALL_CU_LAYERS;
|
||||
if( m_PadLayerAdhCmp->GetValue() )
|
||||
PadLayerMask |= ADHESIVE_LAYER_CMP;
|
||||
if( m_PadLayerAdhCu->GetValue() )
|
||||
PadLayerMask |= ADHESIVE_LAYER_CU;
|
||||
if( m_PadLayerPateCmp->GetValue() )
|
||||
PadLayerMask |= SOLDERPASTE_LAYER_CMP;
|
||||
if( m_PadLayerPateCu->GetValue() )
|
||||
PadLayerMask |= SOLDERPASTE_LAYER_CU;
|
||||
if( m_PadLayerSilkCmp->GetValue() )
|
||||
PadLayerMask |= SILKSCREEN_LAYER_CMP;
|
||||
if( m_PadLayerSilkCu->GetValue() )
|
||||
PadLayerMask |= SILKSCREEN_LAYER_CU;
|
||||
if( m_PadLayerMaskCmp->GetValue() )
|
||||
PadLayerMask |= SOLDERMASK_LAYER_CMP;
|
||||
if( m_PadLayerMaskCu->GetValue() )
|
||||
PadLayerMask |= SOLDERMASK_LAYER_CU;
|
||||
if( m_PadLayerECO1->GetValue() )
|
||||
PadLayerMask |= ECO1_LAYER;
|
||||
if( m_PadLayerECO2->GetValue() )
|
||||
PadLayerMask |= ECO2_LAYER;
|
||||
if( m_PadLayerDraft->GetValue() )
|
||||
PadLayerMask |= DRAW_LAYER;
|
||||
|
||||
g_Pad_Master.m_Masque_Layer = PadLayerMask;
|
||||
|
||||
if( m_CurrentPad ) // Set Pad Name & Num
|
||||
{
|
||||
m_Parent->SaveCopyInUndoList( m_Parent->m_Pcb->m_Modules );
|
||||
MODULE* Module = (MODULE*) m_CurrentPad->m_Parent;
|
||||
Module->m_LastEdit_Time = time( NULL );
|
||||
|
||||
if( m_DC ) // redraw the area where the pad was, without pad (delete pad on screen)
|
||||
{
|
||||
m_CurrentPad->m_Flags |= DO_NOT_DRAW;
|
||||
m_Parent->DrawPanel->PostDirtyRect( m_CurrentPad->GetBoundingBox() );
|
||||
m_CurrentPad->m_Flags &= ~DO_NOT_DRAW;
|
||||
}
|
||||
m_CurrentPad->m_PadShape = g_Pad_Master.m_PadShape;
|
||||
m_CurrentPad->m_Attribut = g_Pad_Master.m_Attribut;
|
||||
if( m_CurrentPad->m_Pos != g_Pad_Master.m_Pos )
|
||||
{
|
||||
m_CurrentPad->m_Pos = g_Pad_Master.m_Pos;
|
||||
RastnestIsChanged = true;
|
||||
}
|
||||
|
||||
/* compute the pos 0 value, i.e. pad position for module orient = 0 i.e.
|
||||
* refer to module origin (module position) */
|
||||
m_CurrentPad->m_Pos0 = m_CurrentPad->m_Pos;
|
||||
m_CurrentPad->m_Pos0 -= Module->m_Pos;
|
||||
m_CurrentPad->m_Orient = g_Pad_Master.m_Orient + Module->m_Orient;
|
||||
RotatePoint( &m_CurrentPad->m_Pos0.x, &m_CurrentPad->m_Pos0.y, -Module->m_Orient );
|
||||
|
||||
m_CurrentPad->m_Size = g_Pad_Master.m_Size;
|
||||
m_CurrentPad->m_DeltaSize = g_Pad_Master.m_DeltaSize;
|
||||
m_CurrentPad->m_Drill = g_Pad_Master.m_Drill;
|
||||
m_CurrentPad->m_DrillShape = g_Pad_Master.m_DrillShape;
|
||||
m_CurrentPad->m_Offset = g_Pad_Master.m_Offset;
|
||||
if( m_CurrentPad->m_Masque_Layer != g_Pad_Master.m_Masque_Layer )
|
||||
{
|
||||
RastnestIsChanged = true;
|
||||
m_CurrentPad->m_Masque_Layer = g_Pad_Master.m_Masque_Layer;
|
||||
}
|
||||
m_CurrentPad->SetPadName( g_Current_PadName );
|
||||
|
||||
if( m_CurrentPad->m_Netname != Current_PadNetName )
|
||||
{
|
||||
if( Current_PadNetName.IsEmpty() )
|
||||
m_CurrentPad->SetNet( 0 );
|
||||
else
|
||||
{
|
||||
const EQUIPOT* net = m_Parent->m_Pcb->FindNet( Current_PadNetName );
|
||||
if( net )
|
||||
{
|
||||
RastnestIsChanged = true;
|
||||
m_CurrentPad->m_Netname = Current_PadNetName;
|
||||
m_CurrentPad->SetNet( net->GetNet() );
|
||||
}
|
||||
else
|
||||
DisplayError( this, _( "Unknown netname, no change" ) );
|
||||
}
|
||||
}
|
||||
|
||||
switch( m_CurrentPad->m_PadShape )
|
||||
{
|
||||
case PAD_CIRCLE:
|
||||
m_CurrentPad->m_DeltaSize = wxSize( 0, 0 );
|
||||
m_CurrentPad->m_Size.y = m_CurrentPad->m_Size.x;
|
||||
break;
|
||||
|
||||
case PAD_RECT:
|
||||
m_CurrentPad->m_DeltaSize = wxSize( 0, 0 );
|
||||
break;
|
||||
|
||||
case PAD_OVAL:
|
||||
m_CurrentPad->m_DeltaSize = wxSize( 0, 0 );
|
||||
break;
|
||||
|
||||
case PAD_TRAPEZOID:
|
||||
break;
|
||||
}
|
||||
|
||||
switch( m_CurrentPad->m_Attribut )
|
||||
{
|
||||
case PAD_STANDARD:
|
||||
break;
|
||||
|
||||
case PAD_CONN:
|
||||
case PAD_SMD:
|
||||
m_CurrentPad->m_Offset = wxSize( 0, 0 );
|
||||
m_CurrentPad->m_Drill = wxSize( 0, 0 );
|
||||
break;
|
||||
|
||||
case PAD_HOLE_NOT_PLATED:
|
||||
break;
|
||||
|
||||
default:
|
||||
DisplayError( this, wxT( "Error: unknown pad type" ) );
|
||||
break;
|
||||
}
|
||||
|
||||
m_CurrentPad->ComputeRayon();
|
||||
|
||||
Module->Set_Rectangle_Encadrement();
|
||||
m_CurrentPad->Display_Infos( m_Parent );
|
||||
if( m_DC ) // redraw the area where the pad was
|
||||
m_Parent->DrawPanel->PostDirtyRect( m_CurrentPad->GetBoundingBox() );
|
||||
m_Parent->GetScreen()->SetModify();
|
||||
}
|
||||
|
||||
Close();
|
||||
|
||||
if( m_DC )
|
||||
m_Parent->DrawPanel->CursorOn( m_DC );
|
||||
if( RastnestIsChanged ) // The net ratsnest must be recalculated
|
||||
m_Parent->m_Pcb->m_Status_Pcb = 0;
|
||||
}
|
|
@ -0,0 +1,190 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Apr 16 2008)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "dialog_pad_properties_base.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
DialogPadPropertiesBase::DialogPadPropertiesBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
|
||||
{
|
||||
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
|
||||
|
||||
wxBoxSizer* m_MainSizer;
|
||||
m_MainSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
wxBoxSizer* m_LeftBoxSizer;
|
||||
m_LeftBoxSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_PadNumText = new wxStaticText( this, wxID_ANY, _("Pad Num :"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_PadNumText->Wrap( -1 );
|
||||
m_LeftBoxSizer->Add( m_PadNumText, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_PadNumCtrl = new wxTextCtrl( this, wxID_PADNUMCTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_LeftBoxSizer->Add( m_PadNumCtrl, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
|
||||
|
||||
m_PadNameText = new wxStaticText( this, wxID_ANY, _("Pad Net Name :"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_PadNameText->Wrap( -1 );
|
||||
m_LeftBoxSizer->Add( m_PadNameText, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_PadNetNameCtrl = new wxTextCtrl( this, wxID_PADNETNAMECTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_LeftBoxSizer->Add( m_PadNetNameCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_PadPositionBoxSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_LeftBoxSizer->Add( m_PadPositionBoxSizer, 0, wxEXPAND, 5 );
|
||||
|
||||
m_MainSizer->Add( m_LeftBoxSizer, 0, wxBOTTOM|wxLEFT, 5 );
|
||||
|
||||
m_DrillShapeBoxSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
wxString m_PadShapeChoices[] = { _("Circle"), _("Oval"), _("Rect"), _("Trapezoidal") };
|
||||
int m_PadShapeNChoices = sizeof( m_PadShapeChoices ) / sizeof( wxString );
|
||||
m_PadShape = new wxRadioBox( this, ID_LISTBOX_SHAPE_PAD, _("Pad Shape:"), wxDefaultPosition, wxDefaultSize, m_PadShapeNChoices, m_PadShapeChoices, 1, wxRA_SPECIFY_COLS );
|
||||
m_PadShape->SetSelection( 0 );
|
||||
m_DrillShapeBoxSizer->Add( m_PadShape, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
m_DrillShapeBoxSizer->Add( 0, 8, 1, wxEXPAND, 5 );
|
||||
|
||||
wxString m_DrillShapeCtrlChoices[] = { _("Circle"), _("Oval") };
|
||||
int m_DrillShapeCtrlNChoices = sizeof( m_DrillShapeCtrlChoices ) / sizeof( wxString );
|
||||
m_DrillShapeCtrl = new wxRadioBox( this, ID_RADIOBOX_DRILL_SHAPE, _("Drill Shape:"), wxDefaultPosition, wxDefaultSize, m_DrillShapeCtrlNChoices, m_DrillShapeCtrlChoices, 1, wxRA_SPECIFY_COLS );
|
||||
m_DrillShapeCtrl->SetSelection( 1 );
|
||||
m_DrillShapeBoxSizer->Add( m_DrillShapeCtrl, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
m_MainSizer->Add( m_DrillShapeBoxSizer, 1, wxBOTTOM, 5 );
|
||||
|
||||
wxBoxSizer* m_MiddleRightBoxSizer;
|
||||
m_MiddleRightBoxSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
wxString m_PadOrientChoices[] = { _("0"), _("90"), _("-90"), _("180"), _("User") };
|
||||
int m_PadOrientNChoices = sizeof( m_PadOrientChoices ) / sizeof( wxString );
|
||||
m_PadOrient = new wxRadioBox( this, ID_LISTBOX_ORIENT_PAD, _("Pad Orient:"), wxDefaultPosition, wxDefaultSize, m_PadOrientNChoices, m_PadOrientChoices, 1, wxRA_SPECIFY_COLS );
|
||||
m_PadOrient->SetSelection( 0 );
|
||||
m_MiddleRightBoxSizer->Add( m_PadOrient, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
m_PadOrientText = new wxStaticText( this, wxID_ANY, _("Pad Orient (0.1 deg)"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_PadOrientText->Wrap( -1 );
|
||||
m_MiddleRightBoxSizer->Add( m_PadOrientText, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_PadOrientCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_MiddleRightBoxSizer->Add( m_PadOrientCtrl, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
|
||||
m_MiddleRightBoxSizer->Add( 0, 8, 1, wxEXPAND, 5 );
|
||||
|
||||
wxString m_PadTypeChoices[] = { _("Standard"), _("SMD"), _("Conn") };
|
||||
int m_PadTypeNChoices = sizeof( m_PadTypeChoices ) / sizeof( wxString );
|
||||
m_PadType = new wxRadioBox( this, ID_LISTBOX_TYPE_PAD, _("Pad Type:"), wxDefaultPosition, wxDefaultSize, m_PadTypeNChoices, m_PadTypeChoices, 1, wxRA_SPECIFY_COLS );
|
||||
m_PadType->SetSelection( 0 );
|
||||
m_MiddleRightBoxSizer->Add( m_PadType, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
m_MainSizer->Add( m_MiddleRightBoxSizer, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
wxBoxSizer* m_RightBoxSizer;
|
||||
m_RightBoxSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_buttonOk = new wxButton( this, wxID_OK, _("Ok"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_buttonOk->SetDefault();
|
||||
m_buttonOk->SetForegroundColour( wxColour( 209, 26, 5 ) );
|
||||
|
||||
m_RightBoxSizer->Add( m_buttonOk, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
|
||||
|
||||
m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_buttonCancel->SetForegroundColour( wxColour( 14, 2, 164 ) );
|
||||
|
||||
m_RightBoxSizer->Add( m_buttonCancel, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
m_RightBoxSizer->Add( 0, 8, 1, wxEXPAND, 5 );
|
||||
|
||||
wxStaticBoxSizer* m_LayersSizer;
|
||||
m_LayersSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Layers:") ), wxVERTICAL );
|
||||
|
||||
m_PadLayerCu = new wxCheckBox( this, wxID_ANY, _("Copper layer"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
||||
m_LayersSizer->Add( m_PadLayerCu, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_PadLayerCmp = new wxCheckBox( this, wxID_ANY, _("Component layer"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
||||
m_LayersSizer->Add( m_PadLayerCmp, 0, wxALL, 5 );
|
||||
|
||||
|
||||
m_LayersSizer->Add( 0, 8, 1, wxEXPAND, 5 );
|
||||
|
||||
m_PadLayerAdhCmp = new wxCheckBox( this, wxID_ANY, _("Adhesive Cmp"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
||||
m_LayersSizer->Add( m_PadLayerAdhCmp, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_PadLayerAdhCu = new wxCheckBox( this, wxID_ANY, _("Adhesive Copper"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
||||
m_LayersSizer->Add( m_PadLayerAdhCu, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_PadLayerPateCmp = new wxCheckBox( this, wxID_ANY, _("Solder paste Cmp"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
||||
m_LayersSizer->Add( m_PadLayerPateCmp, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_PadLayerPateCu = new wxCheckBox( this, wxID_ANY, _("Solder paste Copper"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
||||
m_LayersSizer->Add( m_PadLayerPateCu, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_PadLayerSilkCmp = new wxCheckBox( this, wxID_ANY, _("Silkscreen Cmp"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
||||
m_LayersSizer->Add( m_PadLayerSilkCmp, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_PadLayerSilkCu = new wxCheckBox( this, wxID_ANY, _("Silkscreen Copper"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
||||
m_LayersSizer->Add( m_PadLayerSilkCu, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_PadLayerMaskCmp = new wxCheckBox( this, wxID_ANY, _("Solder mask Cmp"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
||||
m_LayersSizer->Add( m_PadLayerMaskCmp, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_PadLayerMaskCu = new wxCheckBox( this, wxID_ANY, _("Solder mask Copper"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
||||
m_LayersSizer->Add( m_PadLayerMaskCu, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_PadLayerECO1 = new wxCheckBox( this, wxID_ANY, _("E.C.O.1 layer"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
||||
m_LayersSizer->Add( m_PadLayerECO1, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_PadLayerECO2 = new wxCheckBox( this, wxID_ANY, _("E.C.O.2 layer"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
||||
m_LayersSizer->Add( m_PadLayerECO2, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_PadLayerDraft = new wxCheckBox( this, wxID_ANY, _("Draft layer"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
|
||||
m_LayersSizer->Add( m_PadLayerDraft, 0, wxALL, 5 );
|
||||
|
||||
m_RightBoxSizer->Add( m_LayersSizer, 0, 0, 5 );
|
||||
|
||||
m_MainSizer->Add( m_RightBoxSizer, 0, wxBOTTOM|wxRIGHT, 5 );
|
||||
|
||||
this->SetSizer( m_MainSizer );
|
||||
this->Layout();
|
||||
|
||||
this->Centre( wxBOTH );
|
||||
|
||||
// Connect Events
|
||||
this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DialogPadPropertiesBase::InitDialog ) );
|
||||
m_PadShape->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DialogPadPropertiesBase::OnPadShapeSelection ), NULL, this );
|
||||
m_DrillShapeCtrl->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DialogPadPropertiesBase::OnDrillShapeSelected ), NULL, this );
|
||||
m_PadOrient->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DialogPadPropertiesBase::PadOrientEvent ), NULL, this );
|
||||
m_PadType->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DialogPadPropertiesBase::PadTypeSelected ), NULL, this );
|
||||
m_buttonOk->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DialogPadPropertiesBase::PadPropertiesAccept ), NULL, this );
|
||||
}
|
||||
|
||||
DialogPadPropertiesBase::~DialogPadPropertiesBase()
|
||||
{
|
||||
// Disconnect Events
|
||||
this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DialogPadPropertiesBase::InitDialog ) );
|
||||
m_PadShape->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DialogPadPropertiesBase::OnPadShapeSelection ), NULL, this );
|
||||
m_DrillShapeCtrl->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DialogPadPropertiesBase::OnDrillShapeSelected ), NULL, this );
|
||||
m_PadOrient->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DialogPadPropertiesBase::PadOrientEvent ), NULL, this );
|
||||
m_PadType->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DialogPadPropertiesBase::PadTypeSelected ), NULL, this );
|
||||
m_buttonOk->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DialogPadPropertiesBase::PadPropertiesAccept ), NULL, this );
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,95 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Apr 16 2008)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __dialog_pad_properties_base__
|
||||
#define __dialog_pad_properties_base__
|
||||
|
||||
#include <wx/intl.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/sizer.h>
|
||||
#include <wx/radiobox.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/checkbox.h>
|
||||
#include <wx/statbox.h>
|
||||
#include <wx/dialog.h>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// Class DialogPadPropertiesBase
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class DialogPadPropertiesBase : public wxDialog
|
||||
{
|
||||
private:
|
||||
|
||||
protected:
|
||||
enum
|
||||
{
|
||||
wxID_DIALOG_EDIT_PAD = 1000,
|
||||
wxID_PADNUMCTRL,
|
||||
wxID_PADNETNAMECTRL,
|
||||
ID_LISTBOX_SHAPE_PAD,
|
||||
ID_RADIOBOX_DRILL_SHAPE,
|
||||
ID_LISTBOX_ORIENT_PAD,
|
||||
ID_LISTBOX_TYPE_PAD,
|
||||
};
|
||||
|
||||
wxStaticText* m_PadNumText;
|
||||
wxTextCtrl* m_PadNumCtrl;
|
||||
wxStaticText* m_PadNameText;
|
||||
wxTextCtrl* m_PadNetNameCtrl;
|
||||
wxBoxSizer* m_PadPositionBoxSizer;
|
||||
wxBoxSizer* m_DrillShapeBoxSizer;
|
||||
wxRadioBox* m_PadShape;
|
||||
|
||||
wxRadioBox* m_DrillShapeCtrl;
|
||||
wxRadioBox* m_PadOrient;
|
||||
wxStaticText* m_PadOrientText;
|
||||
wxTextCtrl* m_PadOrientCtrl;
|
||||
|
||||
wxRadioBox* m_PadType;
|
||||
wxButton* m_buttonOk;
|
||||
wxButton* m_buttonCancel;
|
||||
|
||||
wxCheckBox* m_PadLayerCu;
|
||||
wxCheckBox* m_PadLayerCmp;
|
||||
|
||||
wxCheckBox* m_PadLayerAdhCmp;
|
||||
wxCheckBox* m_PadLayerAdhCu;
|
||||
wxCheckBox* m_PadLayerPateCmp;
|
||||
wxCheckBox* m_PadLayerPateCu;
|
||||
wxCheckBox* m_PadLayerSilkCmp;
|
||||
wxCheckBox* m_PadLayerSilkCu;
|
||||
wxCheckBox* m_PadLayerMaskCmp;
|
||||
wxCheckBox* m_PadLayerMaskCu;
|
||||
wxCheckBox* m_PadLayerECO1;
|
||||
wxCheckBox* m_PadLayerECO2;
|
||||
wxCheckBox* m_PadLayerDraft;
|
||||
|
||||
// Virtual event handlers, overide them in your derived class
|
||||
virtual void InitDialog( wxInitDialogEvent& event ){ event.Skip(); }
|
||||
virtual void OnPadShapeSelection( wxCommandEvent& event ){ event.Skip(); }
|
||||
virtual void OnDrillShapeSelected( wxCommandEvent& event ){ event.Skip(); }
|
||||
virtual void PadOrientEvent( wxCommandEvent& event ){ event.Skip(); }
|
||||
virtual void PadTypeSelected( wxCommandEvent& event ){ event.Skip(); }
|
||||
virtual void PadPropertiesAccept( wxCommandEvent& event ){ event.Skip(); }
|
||||
|
||||
|
||||
public:
|
||||
DialogPadPropertiesBase( wxWindow* parent, wxWindowID id = wxID_DIALOG_EDIT_PAD, const wxString& title = _("Pad Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 520,396 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSUNKEN_BORDER );
|
||||
~DialogPadPropertiesBase();
|
||||
|
||||
};
|
||||
|
||||
#endif //__dialog_pad_properties_base__
|
|
@ -1,550 +0,0 @@
|
|||
/******************************************************/
|
||||
/* editpads.cpp: Pad editing functions and dialog box */
|
||||
/******************************************************/
|
||||
|
||||
#include "fctsys.h"
|
||||
#include "gr_basic.h"
|
||||
#include "common.h"
|
||||
#include "pcbnew.h"
|
||||
#include "autorout.h"
|
||||
#include "trigo.h"
|
||||
|
||||
#include "drag.h"
|
||||
|
||||
#include "protos.h"
|
||||
|
||||
/* Routines Locales */
|
||||
|
||||
/* Variables locales */
|
||||
static wxString Current_PadNetName;
|
||||
|
||||
|
||||
#define NBSHAPES 4
|
||||
int CodeShape[NBSHAPES] = /* forme des pads */
|
||||
{
|
||||
PAD_CIRCLE, PAD_OVAL, PAD_RECT, PAD_TRAPEZOID
|
||||
};
|
||||
|
||||
|
||||
#define NBTYPES 4
|
||||
int CodeType[NBTYPES] =
|
||||
{
|
||||
PAD_STANDARD, PAD_SMD, PAD_CONN, PAD_HOLE_NOT_PLATED
|
||||
};
|
||||
|
||||
// Default mask layers for pads according to the pas type
|
||||
static long Std_Pad_Layers[NBTYPES] =
|
||||
{
|
||||
// PAD_STANDARD:
|
||||
ALL_CU_LAYERS | SILKSCREEN_LAYER_CMP | SOLDERMASK_LAYER_CU | SOLDERMASK_LAYER_CMP,
|
||||
|
||||
// PAD_CONN:
|
||||
CMP_LAYER | SOLDERPASTE_LAYER_CMP | SOLDERMASK_LAYER_CMP,
|
||||
|
||||
// PAD_SMD:
|
||||
CMP_LAYER | SOLDERMASK_LAYER_CMP,
|
||||
|
||||
//PAD_HOLE_NOT_PLATED:
|
||||
ALL_CU_LAYERS | SILKSCREEN_LAYER_CMP | SOLDERMASK_LAYER_CU | SOLDERMASK_LAYER_CMP
|
||||
};
|
||||
|
||||
|
||||
/************************************/
|
||||
/* class WinEDA_PadPropertiesFrame */
|
||||
/************************************/
|
||||
|
||||
#include "dialog_pad_edit.cpp"
|
||||
|
||||
|
||||
/*************************************************************/
|
||||
void WinEDA_BasePcbFrame::InstallPadOptionsFrame( D_PAD* Pad,
|
||||
wxDC* DC, const wxPoint& pos )
|
||||
/*************************************************************/
|
||||
{
|
||||
WinEDA_PadPropertiesFrame* frame = new WinEDA_PadPropertiesFrame( this,
|
||||
Pad, DC );
|
||||
|
||||
frame->ShowModal(); frame->Destroy();
|
||||
}
|
||||
|
||||
|
||||
/********************************************************/
|
||||
void WinEDA_PadPropertiesFrame::SetOthersControls()
|
||||
/********************************************************/
|
||||
{
|
||||
int tmp;
|
||||
|
||||
m_PadNumCtrl->SetValue( g_Current_PadName );
|
||||
m_PadNetNameCtrl->SetValue( Current_PadNetName );
|
||||
|
||||
m_PadPositionCtrl = new WinEDA_PositionCtrl( this, _(
|
||||
"Pad Position" ),
|
||||
CurrentPad ? CurrentPad->m_Pos : g_Pad_Master
|
||||
.m_Pos,
|
||||
g_UnitMetric, m_PadPositionBoxSizer,
|
||||
m_Parent->m_InternalUnits );
|
||||
|
||||
m_PadSizeCtrl = new WinEDA_SizeCtrl( this, _(
|
||||
"Pad Size" ),
|
||||
CurrentPad ? CurrentPad->m_Size : g_Pad_Master.
|
||||
m_Size,
|
||||
g_UnitMetric, m_PadPositionBoxSizer,
|
||||
m_Parent->m_InternalUnits );
|
||||
|
||||
m_PadDeltaSizeCtrl = new WinEDA_SizeCtrl( this, _(
|
||||
"Delta" ),
|
||||
CurrentPad ? CurrentPad->m_DeltaSize :
|
||||
g_Pad_Master.m_DeltaSize,
|
||||
g_UnitMetric, m_PadPositionBoxSizer,
|
||||
m_Parent->m_InternalUnits );
|
||||
|
||||
m_PadOffsetCtrl = new WinEDA_SizeCtrl( this, _(
|
||||
"Offset" ),
|
||||
CurrentPad ? CurrentPad->m_Offset : g_Pad_Master.
|
||||
m_Offset,
|
||||
g_UnitMetric, m_PadPositionBoxSizer,
|
||||
m_Parent->m_InternalUnits );
|
||||
|
||||
/* In second column */
|
||||
|
||||
m_PadDrillCtrl = new WinEDA_SizeCtrl( this, _(
|
||||
"Pad drill" ),
|
||||
CurrentPad ? CurrentPad->m_Drill : g_Pad_Master.m_Drill,
|
||||
g_UnitMetric, m_DrillShapeBoxSizer,
|
||||
m_Parent->m_InternalUnits );
|
||||
|
||||
if( CurrentPad )
|
||||
{
|
||||
tmp = CurrentPad->m_Orient - m_Module->m_Orient;
|
||||
}
|
||||
else
|
||||
tmp = g_Pad_Master.m_Orient;
|
||||
m_DrillShapeBoxSizer->Add( 5, 5, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5 );
|
||||
m_PadOrientCtrl = new WinEDA_ValueCtrl( this, _( "Pad Orientation (in 0.1 degrees)" ),
|
||||
tmp, 2, m_DrillShapeBoxSizer, 1 );
|
||||
|
||||
|
||||
// Pad Orient
|
||||
switch( tmp )
|
||||
{
|
||||
case 0:
|
||||
m_PadOrient->SetSelection( 0 );
|
||||
m_PadOrientCtrl->Enable( FALSE );
|
||||
break;
|
||||
|
||||
case - 2700:
|
||||
case 900:
|
||||
m_PadOrient->SetSelection( 1 );
|
||||
m_PadOrientCtrl->Enable( FALSE );
|
||||
break;
|
||||
|
||||
case - 900:
|
||||
case 2700:
|
||||
m_PadOrient->SetSelection( 2 );
|
||||
m_PadOrientCtrl->Enable( FALSE );
|
||||
break;
|
||||
|
||||
case 1800:
|
||||
case - 1800:
|
||||
m_PadOrient->SetSelection( 3 );
|
||||
m_PadOrientCtrl->Enable( FALSE );
|
||||
break;
|
||||
|
||||
default:
|
||||
m_PadOrient->SetSelection( 4 );
|
||||
break;
|
||||
}
|
||||
|
||||
tmp = CurrentPad ? CurrentPad->m_PadShape : g_Pad_Master.m_PadShape;
|
||||
|
||||
switch( tmp )
|
||||
{
|
||||
case PAD_CIRCLE:
|
||||
m_PadDeltaSizeCtrl->Enable( FALSE, FALSE );
|
||||
m_PadSizeCtrl->Enable( TRUE, FALSE );
|
||||
m_PadShape->SetSelection( 0 );
|
||||
break;
|
||||
|
||||
case PAD_OVAL:
|
||||
m_PadDeltaSizeCtrl->Enable( FALSE, FALSE );
|
||||
m_PadSizeCtrl->Enable( TRUE, TRUE );
|
||||
m_PadShape->SetSelection( 1 );
|
||||
break;
|
||||
|
||||
case PAD_RECT:
|
||||
m_PadDeltaSizeCtrl->Enable( FALSE, FALSE );
|
||||
m_PadSizeCtrl->Enable( TRUE, TRUE );
|
||||
m_PadShape->SetSelection( 2 );
|
||||
break;
|
||||
|
||||
case PAD_TRAPEZOID:
|
||||
m_PadDeltaSizeCtrl->Enable( TRUE, TRUE );
|
||||
m_PadSizeCtrl->Enable( TRUE, TRUE );
|
||||
m_PadShape->SetSelection( 3 );
|
||||
break;
|
||||
}
|
||||
|
||||
// Selection du type
|
||||
tmp = CurrentPad ? CurrentPad->m_Attribut : g_Pad_Master.m_Attribut;
|
||||
m_PadType->SetSelection( 0 );
|
||||
for( int ii = 0; ii < NBTYPES; ii++ )
|
||||
{
|
||||
if( CodeType[ii] == tmp )
|
||||
{
|
||||
m_PadType->SetSelection( ii ); break;
|
||||
}
|
||||
}
|
||||
|
||||
tmp = CurrentPad ? CurrentPad->m_DrillShape : g_Pad_Master.m_DrillShape;
|
||||
|
||||
switch( tmp )
|
||||
{
|
||||
case PAD_CIRCLE:
|
||||
m_DrillShapeCtrl->SetSelection( 0 );
|
||||
m_PadDrillCtrl->Enable( TRUE, FALSE );
|
||||
break;
|
||||
|
||||
case PAD_OVAL:
|
||||
m_DrillShapeCtrl->SetSelection( 1 );
|
||||
m_PadDrillCtrl->Enable( TRUE, TRUE );
|
||||
break;
|
||||
}
|
||||
|
||||
// Selection des couches cuivre :
|
||||
if( CurrentPad )
|
||||
SetPadLayersList( CurrentPad->m_Masque_Layer );
|
||||
else
|
||||
PadTypeSelected();
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************/
|
||||
void WinEDA_PadPropertiesFrame::PadOrientEvent( wxCommandEvent& event )
|
||||
/********************************************************************/
|
||||
{
|
||||
switch( m_PadOrient->GetSelection() )
|
||||
{
|
||||
case 0:
|
||||
m_PadOrientCtrl->SetValue( 0 );
|
||||
m_PadOrientCtrl->Enable( FALSE );
|
||||
break;
|
||||
|
||||
case 1:
|
||||
m_PadOrientCtrl->SetValue( 900 );
|
||||
m_PadOrientCtrl->Enable( FALSE );
|
||||
break;
|
||||
|
||||
case 2:
|
||||
m_PadOrientCtrl->SetValue( 2700 );
|
||||
m_PadOrientCtrl->Enable( FALSE );
|
||||
break;
|
||||
|
||||
case 3:
|
||||
m_PadOrientCtrl->SetValue( 1800 );
|
||||
m_PadOrientCtrl->Enable( FALSE );
|
||||
break;
|
||||
|
||||
default:
|
||||
m_PadOrientCtrl->Enable( TRUE );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/************************************************/
|
||||
void WinEDA_PadPropertiesFrame::PadTypeSelected()
|
||||
/************************************************/
|
||||
/* Adjust the better mask layer according to the selected pad type
|
||||
*/
|
||||
{
|
||||
long layer_mask;
|
||||
int ii;
|
||||
|
||||
ii = m_PadType->GetSelection();
|
||||
if( (ii < 0) || ( ii >= NBTYPES) )
|
||||
ii = 0;
|
||||
|
||||
layer_mask = Std_Pad_Layers[ii];
|
||||
SetPadLayersList( layer_mask );
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************/
|
||||
void WinEDA_PadPropertiesFrame::SetPadLayersList( long layer_mask )
|
||||
/****************************************************************/
|
||||
|
||||
/* Met a jour l'etat des CheckBoxes de la liste des layers actives,
|
||||
* données bit a bit dans layer_mask
|
||||
*/
|
||||
{
|
||||
if( layer_mask & CUIVRE_LAYER )
|
||||
m_PadLayerCu->SetValue( TRUE );
|
||||
else
|
||||
m_PadLayerCu->SetValue( FALSE );
|
||||
|
||||
if( layer_mask & CMP_LAYER )
|
||||
m_PadLayerCmp->SetValue( TRUE );
|
||||
else
|
||||
m_PadLayerCmp->SetValue( FALSE );
|
||||
|
||||
if( layer_mask & ADHESIVE_LAYER_CMP )
|
||||
m_PadLayerAdhCmp->SetValue( TRUE );
|
||||
else
|
||||
m_PadLayerAdhCmp->SetValue( FALSE );
|
||||
|
||||
if( layer_mask & ADHESIVE_LAYER_CU )
|
||||
m_PadLayerAdhCu->SetValue( TRUE );
|
||||
else
|
||||
m_PadLayerAdhCu->SetValue( FALSE );
|
||||
|
||||
if( layer_mask & SOLDERPASTE_LAYER_CMP )
|
||||
m_PadLayerPateCmp->SetValue( TRUE );
|
||||
else
|
||||
m_PadLayerPateCmp->SetValue( FALSE );
|
||||
|
||||
if( layer_mask & SOLDERPASTE_LAYER_CU )
|
||||
m_PadLayerPateCu->SetValue( TRUE );
|
||||
else
|
||||
m_PadLayerPateCu->SetValue( FALSE );
|
||||
|
||||
if( layer_mask & SILKSCREEN_LAYER_CMP )
|
||||
m_PadLayerSilkCmp->SetValue( TRUE );
|
||||
else
|
||||
m_PadLayerSilkCmp->SetValue( FALSE );
|
||||
|
||||
if( layer_mask & SILKSCREEN_LAYER_CU )
|
||||
m_PadLayerSilkCu->SetValue( TRUE );
|
||||
else
|
||||
m_PadLayerSilkCu->SetValue( FALSE );
|
||||
|
||||
if( layer_mask & SOLDERMASK_LAYER_CMP )
|
||||
m_PadLayerMaskCmp->SetValue( TRUE );
|
||||
else
|
||||
m_PadLayerMaskCmp->SetValue( FALSE );
|
||||
|
||||
if( layer_mask & SOLDERMASK_LAYER_CU )
|
||||
m_PadLayerMaskCu->SetValue( TRUE );
|
||||
else
|
||||
m_PadLayerMaskCu->SetValue( FALSE );
|
||||
|
||||
if( layer_mask & ECO1_LAYER )
|
||||
m_PadLayerECO1->SetValue( TRUE );
|
||||
else
|
||||
m_PadLayerECO1->SetValue( FALSE );
|
||||
|
||||
if( layer_mask & ECO2_LAYER )
|
||||
m_PadLayerECO2->SetValue( TRUE );
|
||||
else
|
||||
m_PadLayerECO2->SetValue( FALSE );
|
||||
|
||||
if( layer_mask & DRAW_LAYER )
|
||||
m_PadLayerDraft->SetValue( TRUE );
|
||||
else
|
||||
m_PadLayerDraft->SetValue( FALSE );
|
||||
}
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
void WinEDA_PadPropertiesFrame::PadPropertiesAccept( wxCommandEvent& event )
|
||||
/*************************************************************************/
|
||||
|
||||
/* Met a jour les differents parametres pour le composant en cours d'édition
|
||||
*/
|
||||
{
|
||||
long PadLayerMask;
|
||||
bool error = FALSE;
|
||||
bool RastnestIsChanged = false;
|
||||
|
||||
if( m_DC )
|
||||
m_Parent->DrawPanel->CursorOff( m_DC );
|
||||
|
||||
g_Pad_Master.m_Attribut = CodeType[m_PadType->GetSelection()];
|
||||
g_Pad_Master.m_PadShape = CodeShape[m_PadShape->GetSelection()];
|
||||
g_Pad_Master.m_Pos = m_PadPositionCtrl->GetValue();
|
||||
g_Pad_Master.m_Pos0 = g_Pad_Master.m_Pos;
|
||||
g_Pad_Master.m_Size = m_PadSizeCtrl->GetValue();
|
||||
if( g_Pad_Master.m_PadShape == PAD_CIRCLE )
|
||||
g_Pad_Master.m_Size.y = g_Pad_Master.m_Size.x;
|
||||
g_Pad_Master.m_DeltaSize = m_PadDeltaSizeCtrl->GetValue();
|
||||
g_Pad_Master.m_Offset = m_PadOffsetCtrl->GetValue();
|
||||
g_Pad_Master.m_Drill = m_PadDrillCtrl->GetValue();
|
||||
if( m_DrillShapeCtrl->GetSelection() == 0 )
|
||||
{
|
||||
g_Pad_Master.m_DrillShape = PAD_CIRCLE;
|
||||
g_Pad_Master.m_Drill.y = g_Pad_Master.m_Drill.x;
|
||||
}
|
||||
else
|
||||
g_Pad_Master.m_DrillShape = PAD_OVAL;
|
||||
g_Pad_Master.m_Orient = m_PadOrientCtrl->GetValue();
|
||||
g_Current_PadName = m_PadNumCtrl->GetValue().Left( 4 );
|
||||
Current_PadNetName = m_PadNetNameCtrl->GetValue();
|
||||
|
||||
/* Test for incorrect values */
|
||||
if( (g_Pad_Master.m_Size.x < g_Pad_Master.m_Drill.x)
|
||||
|| (g_Pad_Master.m_Size.y < g_Pad_Master.m_Drill.y) )
|
||||
{
|
||||
error = TRUE;
|
||||
DisplayError( this, _( "Incorrect value for pad drill: pad drill bigger than pad size" ) );
|
||||
}
|
||||
if( ( g_Pad_Master.m_Size.x / 2 <= ABS( g_Pad_Master.m_Offset.x ) )
|
||||
|| ( g_Pad_Master.m_Size.y / 2 <= ABS( g_Pad_Master.m_Offset.y ) ) )
|
||||
{
|
||||
error = TRUE;
|
||||
DisplayError( this, _( "Incorrect value for pad offset" ) );
|
||||
}
|
||||
|
||||
if( error )
|
||||
{
|
||||
if( m_DC )
|
||||
m_Parent->DrawPanel->CursorOn( m_DC );
|
||||
return;
|
||||
}
|
||||
|
||||
PadLayerMask = 0;
|
||||
if( m_PadLayerCu->GetValue() )
|
||||
PadLayerMask |= CUIVRE_LAYER;
|
||||
if( m_PadLayerCmp->GetValue() )
|
||||
PadLayerMask |= CMP_LAYER;
|
||||
if( ( PadLayerMask & (CUIVRE_LAYER | CMP_LAYER) ) == (CUIVRE_LAYER | CMP_LAYER) )
|
||||
PadLayerMask |= ALL_CU_LAYERS;
|
||||
if( m_PadLayerAdhCmp->GetValue() )
|
||||
PadLayerMask |= ADHESIVE_LAYER_CMP;
|
||||
if( m_PadLayerAdhCu->GetValue() )
|
||||
PadLayerMask |= ADHESIVE_LAYER_CU;
|
||||
if( m_PadLayerPateCmp->GetValue() )
|
||||
PadLayerMask |= SOLDERPASTE_LAYER_CMP;
|
||||
if( m_PadLayerPateCu->GetValue() )
|
||||
PadLayerMask |= SOLDERPASTE_LAYER_CU;
|
||||
if( m_PadLayerSilkCmp->GetValue() )
|
||||
PadLayerMask |= SILKSCREEN_LAYER_CMP;
|
||||
if( m_PadLayerSilkCu->GetValue() )
|
||||
PadLayerMask |= SILKSCREEN_LAYER_CU;
|
||||
if( m_PadLayerMaskCmp->GetValue() )
|
||||
PadLayerMask |= SOLDERMASK_LAYER_CMP;
|
||||
if( m_PadLayerMaskCu->GetValue() )
|
||||
PadLayerMask |= SOLDERMASK_LAYER_CU;
|
||||
if( m_PadLayerECO1->GetValue() )
|
||||
PadLayerMask |= ECO1_LAYER;
|
||||
if( m_PadLayerECO2->GetValue() )
|
||||
PadLayerMask |= ECO2_LAYER;
|
||||
if( m_PadLayerDraft->GetValue() )
|
||||
PadLayerMask |= DRAW_LAYER;
|
||||
|
||||
g_Pad_Master.m_Masque_Layer = PadLayerMask;
|
||||
|
||||
if( CurrentPad ) // Set Pad Name & Num
|
||||
{
|
||||
m_Parent->SaveCopyInUndoList( m_Parent->m_Pcb->m_Modules );
|
||||
MODULE* Module;
|
||||
Module = (MODULE*) CurrentPad->m_Parent;
|
||||
Module->m_LastEdit_Time = time( NULL );
|
||||
|
||||
if( m_DC )// redraw the area where the pas was, without pad
|
||||
{
|
||||
CurrentPad->m_Flags |= DO_NOT_DRAW;
|
||||
m_Parent->DrawPanel->PostDirtyRect( CurrentPad->GetBoundingBox() );
|
||||
CurrentPad->m_Flags &= ~DO_NOT_DRAW;
|
||||
}
|
||||
CurrentPad->m_PadShape = g_Pad_Master.m_PadShape;
|
||||
CurrentPad->m_Attribut = g_Pad_Master.m_Attribut;
|
||||
if (CurrentPad->m_Pos != g_Pad_Master.m_Pos )
|
||||
{
|
||||
CurrentPad->m_Pos = g_Pad_Master.m_Pos;
|
||||
RastnestIsChanged = true;
|
||||
}
|
||||
|
||||
/* compute the pos 0 value, i.e. pad position for module orient = 0 i.e.
|
||||
* refer to module origin (module position) */
|
||||
CurrentPad->m_Pos0 = CurrentPad->m_Pos;
|
||||
CurrentPad->m_Pos0.x -= Module->m_Pos.x;
|
||||
CurrentPad->m_Pos0.y -= Module->m_Pos.y;
|
||||
CurrentPad->m_Orient = g_Pad_Master.m_Orient + Module->m_Orient;
|
||||
RotatePoint( &CurrentPad->m_Pos0.x, &CurrentPad->m_Pos0.y, -Module->m_Orient );
|
||||
|
||||
CurrentPad->m_Size = g_Pad_Master.m_Size;
|
||||
CurrentPad->m_DeltaSize = g_Pad_Master.m_DeltaSize;
|
||||
CurrentPad->m_Drill = g_Pad_Master.m_Drill;
|
||||
CurrentPad->m_DrillShape = g_Pad_Master.m_DrillShape;
|
||||
CurrentPad->m_Offset = g_Pad_Master.m_Offset;
|
||||
if ( CurrentPad->m_Masque_Layer != g_Pad_Master.m_Masque_Layer )
|
||||
{
|
||||
RastnestIsChanged = true;
|
||||
CurrentPad->m_Masque_Layer = g_Pad_Master.m_Masque_Layer;
|
||||
}
|
||||
CurrentPad->SetPadName( g_Current_PadName );
|
||||
|
||||
if ( CurrentPad->m_Netname != Current_PadNetName )
|
||||
{
|
||||
if( Current_PadNetName.IsEmpty() )
|
||||
CurrentPad->SetNet( 0 );
|
||||
else
|
||||
{
|
||||
const EQUIPOT* net = m_Parent->m_Pcb->FindNet( Current_PadNetName );
|
||||
if ( net )
|
||||
{
|
||||
RastnestIsChanged = true;
|
||||
CurrentPad->m_Netname = Current_PadNetName;
|
||||
CurrentPad->SetNet(net->GetNet());
|
||||
}
|
||||
else
|
||||
DisplayError(this, _("Unknown netname, no change"));
|
||||
}
|
||||
}
|
||||
|
||||
switch( CurrentPad->m_PadShape )
|
||||
{
|
||||
case PAD_CIRCLE:
|
||||
CurrentPad->m_DeltaSize = wxSize( 0, 0 );
|
||||
CurrentPad->m_Size.y = CurrentPad->m_Size.x;
|
||||
break;
|
||||
|
||||
case PAD_RECT:
|
||||
CurrentPad->m_DeltaSize = wxSize( 0, 0 );
|
||||
break;
|
||||
|
||||
case PAD_OVAL:
|
||||
CurrentPad->m_DeltaSize = wxSize( 0, 0 );
|
||||
break;
|
||||
|
||||
case PAD_TRAPEZOID:
|
||||
break;
|
||||
}
|
||||
|
||||
switch( CurrentPad->m_Attribut )
|
||||
{
|
||||
case PAD_STANDARD:
|
||||
break;
|
||||
|
||||
case PAD_CONN:
|
||||
case PAD_SMD:
|
||||
CurrentPad->m_Offset = wxSize( 0, 0 );
|
||||
CurrentPad->m_Drill = wxSize( 0, 0 );
|
||||
break;
|
||||
|
||||
case PAD_HOLE_NOT_PLATED:
|
||||
break;
|
||||
|
||||
default:
|
||||
DisplayError(this, wxT("Error: unknown pad type"));
|
||||
break;
|
||||
}
|
||||
|
||||
CurrentPad->ComputeRayon();
|
||||
|
||||
Module->Set_Rectangle_Encadrement();
|
||||
CurrentPad->Display_Infos( m_Parent );
|
||||
if( m_DC )// redraw the area where the pas was
|
||||
m_Parent->DrawPanel->PostDirtyRect( CurrentPad->GetBoundingBox() );
|
||||
m_Parent->GetScreen()->SetModify();
|
||||
}
|
||||
|
||||
Close();
|
||||
|
||||
if( m_DC )
|
||||
m_Parent->DrawPanel->CursorOn( m_DC );
|
||||
if ( RastnestIsChanged ) // The net ratsnest must be recalculated
|
||||
m_Parent->m_Pcb->m_Status_Pcb = 0;
|
||||
|
||||
|
||||
}
|
|
@ -30,6 +30,8 @@ OBJECTS= $(TARGET).o classpcb.o\
|
|||
dialog_freeroute_exchange.o\
|
||||
modedit_undo_redo.o\
|
||||
block_module_editor.o\
|
||||
dialog_pad_properties.o\
|
||||
dialog_pad_properties_base.o\
|
||||
onrightclick.o\
|
||||
onleftclick.o\
|
||||
modedit_onclick.o\
|
||||
|
@ -87,7 +89,6 @@ OBJECTS= $(TARGET).o classpcb.o\
|
|||
editrack-part2.o \
|
||||
deltrack.o edit_track_width.o \
|
||||
editmod.o\
|
||||
editpads.o \
|
||||
move-drag_pads.o\
|
||||
globaleditpad.o \
|
||||
editedge.o\
|
||||
|
@ -245,8 +246,6 @@ edit_track_width.o: edit_track_width.cpp $(COMMON)
|
|||
|
||||
editmod.o: editmod.cpp dialog_edit_module.cpp dialog_edit_module.h $(COMMON)
|
||||
|
||||
editpads.o: editpads.cpp dialog_pad_edit.cpp dialog_pad_edit.h $(COMMON)
|
||||
|
||||
move-drag_pads.o: move-drag_pads.cpp drag.h $(COMMON)
|
||||
|
||||
editedge.o: editedge.cpp $(COMMON)
|
||||
|
|
|
@ -56,21 +56,6 @@ static PARAM_CFG_INT PadDimVCfg
|
|||
);
|
||||
|
||||
|
||||
static PARAM_CFG_INT PadFormeCfg
|
||||
(
|
||||
wxT( "PadForm" ), /* Keyword */
|
||||
&g_Pad_Master.m_PadShape, /* Parameter address */
|
||||
PAD_CIRCLE, /* Default value */
|
||||
0, 0x7F /* Min and max values*/
|
||||
);
|
||||
|
||||
static PARAM_CFG_INT PadMasqueLayerCfg
|
||||
(
|
||||
wxT( "PadMask" ), /* Keyword */
|
||||
&g_Pad_Master.m_Masque_Layer, /* Parameter address */
|
||||
0x0000FFFF /* Default value */
|
||||
);
|
||||
|
||||
static PARAM_CFG_INT ViaDiametreCfg
|
||||
(
|
||||
wxT( "ViaDiam" ), /* Keyword */
|
||||
|
@ -770,6 +755,7 @@ static PARAM_CFG_INT DivGrillePcbCfg
|
|||
|
||||
static PARAM_CFG_INT TimeOutCfg //Duree entre Sauvegardes auto en secondes
|
||||
(
|
||||
INSETUP,
|
||||
wxT( "TimeOut" ), /* Keyword */
|
||||
&g_TimeOut, /* Parameter address */
|
||||
600, /* Default value */
|
||||
|
@ -804,6 +790,7 @@ static PARAM_CFG_INT PrmMaxLinksShowed
|
|||
|
||||
static PARAM_CFG_BOOL ShowRatsnestCfg
|
||||
(
|
||||
INSETUP,
|
||||
wxT( "ShowRat" ), /* Keyword */
|
||||
&g_Show_Ratsnest, /* Parameter address */
|
||||
FALSE /* Default value */
|
||||
|
@ -811,6 +798,7 @@ static PARAM_CFG_BOOL ShowRatsnestCfg
|
|||
|
||||
static PARAM_CFG_BOOL ShowModuleRatsnestCfg
|
||||
(
|
||||
INSETUP,
|
||||
wxT( "ShowMRa" ), /* Keyword */
|
||||
&g_Show_Module_Ratsnest, /* Parameter address */
|
||||
TRUE /* Default value */
|
||||
|
@ -831,8 +819,6 @@ PARAM_CFG_BASE* ParamCfgList[] =
|
|||
&PadDrillCfg,
|
||||
&PadDimHCfg,
|
||||
&PadDimVCfg,
|
||||
&PadFormeCfg,
|
||||
&PadMasqueLayerCfg,
|
||||
&ViaDiametreCfg,
|
||||
&ViaDrillCfg,
|
||||
&MicroViaDiametreCfg,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
update=23/9/2008-19:07:03
|
||||
update=20/11/2008-19:07:03
|
||||
version=1
|
||||
last_client=eeschema
|
||||
[general]
|
||||
|
@ -71,7 +71,7 @@ ShowRat=0
|
|||
ShowMRa=1
|
||||
[pcbnew/libraries]
|
||||
LibDir=
|
||||
LibName1=supports
|
||||
LibName1=sockets
|
||||
LibName2=connect
|
||||
LibName3=discret
|
||||
LibName4=pin_array
|
||||
|
@ -145,4 +145,3 @@ LibName27=opto
|
|||
LibName28=atmel
|
||||
LibName29=contrib
|
||||
LibName30=valves
|
||||
LibName31=atmel
|
||||
|
|
Loading…
Reference in New Issue