Commit 0893f3f3 authored by charras's avatar charras

Pcbnew: make global edit pads function compatible with new pads changes and make it undoable.

parent 3901e152
No preview for this file type
...@@ -2,8 +2,8 @@ msgid "" ...@@ -2,8 +2,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: kicad\n" "Project-Id-Version: kicad\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-12-12 09:09+0100\n" "POT-Creation-Date: 2009-12-13 11:15+0100\n"
"PO-Revision-Date: 2009-12-12 09:14+0100\n" "PO-Revision-Date: 2009-12-13 11:16+0100\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: kicad team <jean-pierre.charras@ujf-grenoble.fr>\n" "Language-Team: kicad team <jean-pierre.charras@ujf-grenoble.fr>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
...@@ -4791,7 +4791,7 @@ msgstr "Supprimer Contour de Zone" ...@@ -4791,7 +4791,7 @@ msgstr "Supprimer Contour de Zone"
#: pcbnew/onrightclick.cpp:622 #: pcbnew/onrightclick.cpp:622
#: pcbnew/onrightclick.cpp:667 #: pcbnew/onrightclick.cpp:667
#: pcbnew/onrightclick.cpp:717 #: pcbnew/onrightclick.cpp:717
#: pcbnew/onrightclick.cpp:774 #: pcbnew/onrightclick.cpp:773
msgid "Move" msgid "Move"
msgstr "Déplacer" msgstr "Déplacer"
...@@ -4812,66 +4812,70 @@ msgstr "Rotation -" ...@@ -4812,66 +4812,70 @@ msgstr "Rotation -"
msgid "Flip" msgid "Flip"
msgstr "Change côté" msgstr "Change côté"
#: pcbnew/onrightclick.cpp:726 #: pcbnew/onrightclick.cpp:725
msgid "Copy current pad settings to this pad" msgid "Copy Current Settings to this Pad"
msgstr "Copier les réglages courants pour ce pad" msgstr "Copier les Réglages Courants dans ce Pad"
#: pcbnew/onrightclick.cpp:730 #: pcbnew/onrightclick.cpp:729
msgid "Copy this pad settings to current pad settings" msgid "Copy this Pad Settings to Current Settings"
msgstr "Copier les caractéristiques de ce pad vers les caractéristiques courantes" msgstr "Copier les Caractéristiques de ce Pad dans les Caractéristiques Courantes"
#: pcbnew/onrightclick.cpp:736 #: pcbnew/onrightclick.cpp:734
msgid "Global Pads Edition"
msgstr "Edition Globale des Pads"
#: pcbnew/onrightclick.cpp:735
msgid "Copy this pad settings to all pads in this footprint (or similar footprints)" msgid "Copy this pad settings to all pads in this footprint (or similar footprints)"
msgstr "Copier les caractéristiques de ce pad vers tous les autres pads de ce module( ou modules similaires)" msgstr "Copier les caractéristiques de ce pad vers tous les autres pads de ce module( ou modules similaires)"
#: pcbnew/onrightclick.cpp:745 #: pcbnew/onrightclick.cpp:744
msgid "Autoroute Pad" msgid "Autoroute Pad"
msgstr "Autoroute Pad" msgstr "Autoroute Pad"
#: pcbnew/onrightclick.cpp:746 #: pcbnew/onrightclick.cpp:745
msgid "Autoroute Net" msgid "Autoroute Net"
msgstr "Autoroute Net" msgstr "Autoroute Net"
#: pcbnew/onrightclick.cpp:791 #: pcbnew/onrightclick.cpp:790
msgid "Delete Marker" msgid "Delete Marker"
msgstr "Effacer Marqueur" msgstr "Effacer Marqueur"
#: pcbnew/onrightclick.cpp:792 #: pcbnew/onrightclick.cpp:791
msgid "Marker Error Info" msgid "Marker Error Info"
msgstr "Info du Marqueur d'Erreur" msgstr "Info du Marqueur d'Erreur"
#: pcbnew/onrightclick.cpp:812 #: pcbnew/onrightclick.cpp:811
msgid "Auto Width" msgid "Auto Width"
msgstr "Epaisseur Automatique" msgstr "Epaisseur Automatique"
#: pcbnew/onrightclick.cpp:814 #: pcbnew/onrightclick.cpp:813
msgid "Use the track width when starting on a track, otherwise the current track width" msgid "Use the track width when starting on a track, otherwise the current track width"
msgstr "Si on démarre sur une piste existante, utiliser sa largeur, sinon utiliser la largeur courante" msgstr "Si on démarre sur une piste existante, utiliser sa largeur, sinon utiliser la largeur courante"
#: pcbnew/onrightclick.cpp:824 #: pcbnew/onrightclick.cpp:823
msgid "Use Netclass Values" msgid "Use Netclass Values"
msgstr "Utiliser les Valeurs des NetClass" msgstr "Utiliser les Valeurs des NetClass"
#: pcbnew/onrightclick.cpp:825 #: pcbnew/onrightclick.cpp:824
msgid "Use track and via sizes from their Netclass values" msgid "Use track and via sizes from their Netclass values"
msgstr "Utiliser les dimensions de pistes et vias de leur valeurs en Netclasse" msgstr "Utiliser les dimensions de pistes et vias de leur valeurs en Netclasse"
#: pcbnew/onrightclick.cpp:832 #: pcbnew/onrightclick.cpp:831
#, c-format #, c-format
msgid "Track %s" msgid "Track %s"
msgstr "Piste %s" msgstr "Piste %s"
#: pcbnew/onrightclick.cpp:834 #: pcbnew/onrightclick.cpp:833
#: pcbnew/onrightclick.cpp:862 #: pcbnew/onrightclick.cpp:861
msgid " (use NetClass)" msgid " (use NetClass)"
msgstr " (NetClass)" msgstr " (NetClass)"
#: pcbnew/onrightclick.cpp:856 #: pcbnew/onrightclick.cpp:855
#, c-format #, c-format
msgid "Via %s" msgid "Via %s"
msgstr "Via %s" msgstr "Via %s"
#: pcbnew/onrightclick.cpp:859 #: pcbnew/onrightclick.cpp:858
#, c-format #, c-format
msgid "Via %s; (drl %s)" msgid "Via %s; (drl %s)"
msgstr "Via %s; (perçage %s)" msgstr "Via %s; (perçage %s)"
...@@ -5569,58 +5573,6 @@ msgstr "Créer Fichier " ...@@ -5569,58 +5573,6 @@ msgstr "Créer Fichier "
msgid " error" msgid " error"
msgstr " erreur" msgstr " erreur"
#: pcbnew/globaleditpad.cpp:75
msgid "Edit Pads Global"
msgstr "Pads: Edition globale"
#: pcbnew/globaleditpad.cpp:90
msgid "Pad Settings..."
msgstr "Caract pad ..."
#: pcbnew/globaleditpad.cpp:94
msgid "Change Module"
msgstr "Change module"
#: pcbnew/globaleditpad.cpp:98
msgid "Change ID Modules"
msgstr "Change Modules ident."
#: pcbnew/globaleditpad.cpp:106
msgid "Pad Filter :"
msgstr "Filtre Pad :"
#: pcbnew/globaleditpad.cpp:110
msgid "Shape Filter"
msgstr "Filtre sur forme"
#: pcbnew/globaleditpad.cpp:115
msgid "Layer Filter"
msgstr "Filtre sur couche"
#: pcbnew/globaleditpad.cpp:120
msgid "Orient Filter"
msgstr "Filtre Orientation"
#: pcbnew/globaleditpad.cpp:127
msgid "Change Items :"
msgstr "Eléments à changer:"
#: pcbnew/globaleditpad.cpp:131
msgid "Change Size"
msgstr "Change Taille"
#: pcbnew/globaleditpad.cpp:136
msgid "Change Shape"
msgstr "Change Forme"
#: pcbnew/globaleditpad.cpp:141
msgid "Change Drill"
msgstr "Change Perçage"
#: pcbnew/globaleditpad.cpp:146
msgid "Change Orientation"
msgstr "Change Orientation"
#: pcbnew/onleftclick.cpp:201 #: pcbnew/onleftclick.cpp:201
msgid "Graphic not authorized on Copper layers" msgid "Graphic not authorized on Copper layers"
msgstr "Graphique non autorisé sur Couches Cuivre" msgstr "Graphique non autorisé sur Couches Cuivre"
...@@ -9918,7 +9870,6 @@ msgid "General :" ...@@ -9918,7 +9870,6 @@ msgid "General :"
msgstr "Général :" msgstr "Général :"
#: eeschema/dialog_edit_component_in_lib_base.cpp:27 #: eeschema/dialog_edit_component_in_lib_base.cpp:27
#: eeschema/dialog_create_component.cpp:172
msgid "As Convert" msgid "As Convert"
msgstr "A une forme \"convertie\"" msgstr "A une forme \"convertie\""
...@@ -9931,7 +9882,6 @@ msgid "Show or hide pin numbers" ...@@ -9931,7 +9882,6 @@ msgid "Show or hide pin numbers"
msgstr "Affichage ou non des numéroes de pins" msgstr "Affichage ou non des numéroes de pins"
#: eeschema/dialog_edit_component_in_lib_base.cpp:40 #: eeschema/dialog_edit_component_in_lib_base.cpp:40
#: eeschema/dialog_create_component.cpp:241
msgid "Show Pin Name" msgid "Show Pin Name"
msgstr "Montre Nom de Pin" msgstr "Montre Nom de Pin"
...@@ -9940,7 +9890,6 @@ msgid "Show or hide pin names" ...@@ -9940,7 +9890,6 @@ msgid "Show or hide pin names"
msgstr "Affichage ou non des noms des pins" msgstr "Affichage ou non des noms des pins"
#: eeschema/dialog_edit_component_in_lib_base.cpp:47 #: eeschema/dialog_edit_component_in_lib_base.cpp:47
#: eeschema/dialog_create_component.cpp:245
msgid "Pin Name Inside" msgid "Pin Name Inside"
msgstr "Nom de pin à l'intérieur" msgstr "Nom de pin à l'intérieur"
...@@ -9957,7 +9906,6 @@ msgid "Number of Units:" ...@@ -9957,7 +9906,6 @@ msgid "Number of Units:"
msgstr "Nombre de Parts:" msgstr "Nombre de Parts:"
#: eeschema/dialog_edit_component_in_lib_base.cpp:79 #: eeschema/dialog_edit_component_in_lib_base.cpp:79
#: eeschema/dialog_create_component.cpp:249
msgid "Skew:" msgid "Skew:"
msgstr "Décalage:" msgstr "Décalage:"
...@@ -12216,10 +12164,12 @@ msgid "Back View" ...@@ -12216,10 +12164,12 @@ msgid "Back View"
msgstr "Vue arrière" msgstr "Vue arrière"
#: 3d-viewer/3d_canvas.cpp:353 #: 3d-viewer/3d_canvas.cpp:353
#: 3d-viewer/3d_toolbar.cpp:85
msgid "Move left <-" msgid "Move left <-"
msgstr "Vers la gauche <-" msgstr "Vers la gauche <-"
#: 3d-viewer/3d_canvas.cpp:358 #: 3d-viewer/3d_canvas.cpp:358
#: 3d-viewer/3d_toolbar.cpp:88
msgid "Move right ->" msgid "Move right ->"
msgstr "Vers la droite ->" msgstr "Vers la droite ->"
...@@ -12504,6 +12454,7 @@ msgid "Exchange Modules" ...@@ -12504,6 +12454,7 @@ msgid "Exchange Modules"
msgstr "Echange modules:" msgstr "Echange modules:"
#: pcbnew/dialog_edit_module_for_Modedit_base.h:105 #: pcbnew/dialog_edit_module_for_Modedit_base.h:105
#: pcbnew/dialog_edit_module_for_BoardEditor_base.h:118
msgid "Module properties" msgid "Module properties"
msgstr "Propriétés du Module" msgstr "Propriétés du Module"
...@@ -12819,6 +12770,40 @@ msgstr "Options d'Affichage" ...@@ -12819,6 +12770,40 @@ msgstr "Options d'Affichage"
msgid "Page Settings" msgid "Page Settings"
msgstr "Ajustage opt Page" msgstr "Ajustage opt Page"
#, fuzzy
#~ msgid "Set to Current Settings"
#~ msgstr "Ajustages Courants:"
#, fuzzy
#~ msgid "Use this Pad Settings as Current"
#~ msgstr ""
#~ "Copier les caractéristiques de ce pad vers les caractéristiques courantes"
#~ msgid "Edit Pads Global"
#~ msgstr "Pads: Edition globale"
#~ msgid "Pad Settings..."
#~ msgstr "Caract pad ..."
#~ msgid "Change Module"
#~ msgstr "Change module"
#~ msgid "Change ID Modules"
#~ msgstr "Change Modules ident."
#~ msgid "Pad Filter :"
#~ msgstr "Filtre Pad :"
#~ msgid "Shape Filter"
#~ msgstr "Filtre sur forme"
#~ msgid "Layer Filter"
#~ msgstr "Filtre sur couche"
#~ msgid "Orient Filter"
#~ msgstr "Filtre Orientation"
#~ msgid "Change Items :"
#~ msgstr "Eléments à changer:"
#~ msgid "Change Size"
#~ msgstr "Change Taille"
#~ msgid "Change Shape"
#~ msgstr "Change Forme"
#~ msgid "Change Drill"
#~ msgstr "Change Perçage"
#~ msgid "Change Orientation"
#~ msgstr "Change Orientation"
#~ msgid "Single Sided" #~ msgid "Single Sided"
#~ msgstr "Simple Face" #~ msgstr "Simple Face"
#~ msgid "Single Sided, SMD on Back" #~ msgid "Single Sided, SMD on Back"
......
...@@ -47,6 +47,7 @@ set(PCBNEW_SRCS ...@@ -47,6 +47,7 @@ set(PCBNEW_SRCS
dialog_general_options_BoardEditor_base.cpp dialog_general_options_BoardEditor_base.cpp
dialog_global_edit_tracks_and_vias.cpp dialog_global_edit_tracks_and_vias.cpp
dialog_global_edit_tracks_and_vias_base.cpp dialog_global_edit_tracks_and_vias_base.cpp
dialog_global_pads_edition_base.cpp
# dialog_graphic_items_options.cpp # dialog_graphic_items_options.cpp
dialog_graphic_item_properties.cpp dialog_graphic_item_properties.cpp
dialog_graphic_item_properties_base.cpp dialog_graphic_item_properties_base.cpp
......
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_global_pads_edition_base.h"
///////////////////////////////////////////////////////////////////////////
DIALOG_GLOBAL_PADS_EDITION_BASE::DIALOG_GLOBAL_PADS_EDITION_BASE( 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* bMainSizer;
bMainSizer = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bLeftSizer;
bLeftSizer = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* sbSizer1;
sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxT("Pad Filter :") ), wxVERTICAL );
m_Pad_Shape_Filter_CB = new wxCheckBox( this, wxID_ANY, wxT("Do not modify pads having a different shape"), wxDefaultPosition, wxDefaultSize, 0 );
sbSizer1->Add( m_Pad_Shape_Filter_CB, 0, wxALL, 5 );
m_Pad_Layer_Filter_CB = new wxCheckBox( this, wxID_ANY, wxT("Do not modify pads having different layers"), wxDefaultPosition, wxDefaultSize, 0 );
sbSizer1->Add( m_Pad_Layer_Filter_CB, 0, wxALL, 5 );
m_Pad_Orient_Filter_CB = new wxCheckBox( this, wxID_ANY, wxT("Do not modify pads having a different orientation"), wxDefaultPosition, wxDefaultSize, 0 );
sbSizer1->Add( m_Pad_Orient_Filter_CB, 0, wxALL, 5 );
bLeftSizer->Add( sbSizer1, 1, wxEXPAND, 5 );
bMainSizer->Add( bLeftSizer, 1, wxEXPAND, 5 );
wxBoxSizer* bRightSizer;
bRightSizer = new wxBoxSizer( wxVERTICAL );
m_buttonPadEditor = new wxButton( this, ID_CHANGE_GET_PAD_SETTINGS, wxT("Pad Editor"), wxDefaultPosition, wxDefaultSize, 0 );
bRightSizer->Add( m_buttonPadEditor, 0, wxALL|wxEXPAND, 5 );
bRightSizer->Add( 10, 10, 0, 0, 5 );
m_button2 = new wxButton( this, ID_CHANGE_CURRENT_MODULE, wxT("Change Pads on Module"), wxDefaultPosition, wxDefaultSize, 0 );
bRightSizer->Add( m_button2, 0, wxALL|wxEXPAND, 5 );
m_button3 = new wxButton( this, ID_CHANGE_ID_MODULES, wxT("Change Pads on Same Modules"), wxDefaultPosition, wxDefaultSize, 0 );
bRightSizer->Add( m_button3, 0, wxALL|wxEXPAND, 5 );
m_button4 = new wxButton( this, wxID_CANCEL, wxT("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
bRightSizer->Add( m_button4, 0, wxALL|wxEXPAND, 5 );
bMainSizer->Add( bRightSizer, 0, wxEXPAND, 5 );
this->SetSizer( bMainSizer );
this->Layout();
// Connect Events
m_buttonPadEditor->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_PADS_EDITION_BASE::InstallPadEditor ), NULL, this );
m_button2->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_PADS_EDITION_BASE::PadPropertiesAccept ), NULL, this );
m_button3->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_PADS_EDITION_BASE::PadPropertiesAccept ), NULL, this );
m_button4->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_PADS_EDITION_BASE::OnCancelClick ), NULL, this );
}
DIALOG_GLOBAL_PADS_EDITION_BASE::~DIALOG_GLOBAL_PADS_EDITION_BASE()
{
// Disconnect Events
m_buttonPadEditor->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_PADS_EDITION_BASE::InstallPadEditor ), NULL, this );
m_button2->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_PADS_EDITION_BASE::PadPropertiesAccept ), NULL, this );
m_button3->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_PADS_EDITION_BASE::PadPropertiesAccept ), NULL, this );
m_button4->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GLOBAL_PADS_EDITION_BASE::OnCancelClick ), NULL, this );
}
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="9" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
<property name="disconnect_events">1</property>
<property name="encoding">UTF-8</property>
<property name="event_generation">connect</property>
<property name="file">dialog_global_pads_edition_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="internationalize">0</property>
<property name="name">dialog_global_pads_edition</property>
<property name="namespace"></property>
<property name="path">.</property>
<property name="precompiled_header"></property>
<property name="relative_path">1</property>
<property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property>
<object class="Dialog" expanded="1">
<property name="bg"></property>
<property name="center"></property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="extra_style"></property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">DIALOG_GLOBAL_PADS_EDITION_BASE</property>
<property name="pos"></property>
<property name="size">482,165</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass"></property>
<property name="title">Global Pads Edition</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnActivate"></event>
<event name="OnActivateApp"></event>
<event name="OnChar"></event>
<event name="OnClose"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnHibernate"></event>
<event name="OnIconize"></event>
<event name="OnIdle"></event>
<event name="OnInitDialog"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bMainSizer</property>
<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">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bLeftSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label">Pad Filter :</property>
<property name="minimum_size"></property>
<property name="name">sbSizer1</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="bg"></property>
<property name="checked">0</property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Do not modify pads having a different shape</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_Pad_Shape_Filter_CB</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></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="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="bg"></property>
<property name="checked">0</property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Do not modify pads having different layers</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_Pad_Layer_Filter_CB</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></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="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="bg"></property>
<property name="checked">0</property>
<property name="context_help"></property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Do not modify pads having a different orientation</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_Pad_Orient_Filter_CB</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></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="OnCheckBox"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bRightSizer</property>
<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="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="default">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">ID_CHANGE_GET_PAD_SETTINGS</property>
<property name="label">Pad Editor</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_buttonPadEditor</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">InstallPadEditor</event>
<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"></property>
<property name="proportion">0</property>
<object class="spacer" expanded="1">
<property name="height">10</property>
<property name="permission">protected</property>
<property name="width">10</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="default">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">ID_CHANGE_CURRENT_MODULE</property>
<property name="label">Change Pads on Module</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_button2</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">PadPropertiesAccept</event>
<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">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="default">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">ID_CHANGE_ID_MODULES</property>
<property name="label">Change Pads on Same Modules</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_button3</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">PadPropertiesAccept</event>
<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">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxButton" expanded="1">
<property name="bg"></property>
<property name="context_help"></property>
<property name="default">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_CANCEL</property>
<property name="label">Cancel</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">m_button4</property>
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnButtonClick">OnCancelClick</event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</wxFormBuilder_Project>
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_global_pads_edition_base__
#define __dialog_global_pads_edition_base__
#include <wx/string.h>
#include <wx/checkbox.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/sizer.h>
#include <wx/statbox.h>
#include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
#define ID_CHANGE_GET_PAD_SETTINGS 1000
#define ID_CHANGE_CURRENT_MODULE 1001
#define ID_CHANGE_ID_MODULES 1002
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_GLOBAL_PADS_EDITION_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_GLOBAL_PADS_EDITION_BASE : public wxDialog
{
private:
protected:
wxCheckBox* m_Pad_Shape_Filter_CB;
wxCheckBox* m_Pad_Layer_Filter_CB;
wxCheckBox* m_Pad_Orient_Filter_CB;
wxButton* m_buttonPadEditor;
wxButton* m_button2;
wxButton* m_button3;
wxButton* m_button4;
// Virtual event handlers, overide them in your derived class
virtual void InstallPadEditor( wxCommandEvent& event ){ event.Skip(); }
virtual void PadPropertiesAccept( wxCommandEvent& event ){ event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); }
public:
DIALOG_GLOBAL_PADS_EDITION_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Global Pads Edition"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 482,165 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_GLOBAL_PADS_EDITION_BASE();
};
#endif //__dialog_global_pads_edition_base__
...@@ -33,10 +33,10 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -33,10 +33,10 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
int itmp; int itmp;
wxClientDC dc( DrawPanel ); wxClientDC dc( DrawPanel );
DrawPanel->PrepareGraphicContext( &dc );
BOARD_ITEM* DrawStruct = GetCurItem(); BOARD_ITEM* DrawStruct = GetCurItem();
DrawPanel->CursorOff( &dc ); DrawPanel->CursorOff( &dc );
DrawPanel->PrepareGraphicContext( &dc );
wxGetMousePosition( &pos.x, &pos.y ); wxGetMousePosition( &pos.x, &pos.y );
......
...@@ -3,184 +3,107 @@ ...@@ -3,184 +3,107 @@
/*************/ /*************/
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h"
//#include "gr_basic.h"
#include "common.h" #include "common.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "confirm.h" #include "confirm.h"
#include "pcbnew.h" #include "pcbnew.h"
#include "trigo.h"
#include "drag.h"
#include "protos.h" //#include "trigo.h"
/* Variables Locales */ //#include "drag.h"
static bool Pad_Shape_Filter = TRUE;
static bool Pad_Layer_Filter = TRUE;
static bool Pad_Orient_Filter = TRUE;
static bool Pad_Size_Change = TRUE;
static bool Pad_Shape_Change = FALSE;
static bool Pad_Orient_Change = FALSE;
static bool Pad_Drill_Change = TRUE;
enum id_pad_global_edit { //#include "protos.h"
ID_CHANGE_CURRENT_MODULE = 1900, #include "dialog_global_pads_edition_base.h"
ID_CHANGE_ID_MODULES,
ID_CHANGE_GET_PAD_SETTINGS
};
/************************************/ /************************************/
/* class WinEDA_PadGlobalEditFrame */ /* class DIALOG_GLOBAL_PADS_EDITION */
/************************************/ /************************************/
class WinEDA_PadGlobalEditFrame : public wxDialog class DIALOG_GLOBAL_PADS_EDITION : public DIALOG_GLOBAL_PADS_EDITION_BASE
{ {
private: private:
WinEDA_BasePcbFrame* m_Parent; WinEDA_BasePcbFrame* m_Parent;
D_PAD* CurrentPad; D_PAD* m_CurrentPad;
wxCheckBox* m_Pad_Shape_Filter;
wxCheckBox* m_Pad_Layer_Filter; public:
wxCheckBox* m_Pad_Orient_Filter; static bool m_Pad_Shape_Filter;
wxCheckBox* m_Pad_Size_Change; static bool m_Pad_Layer_Filter;
wxCheckBox* m_Pad_Shape_Change; static bool m_Pad_Orient_Filter;
wxCheckBox* m_Pad_Drill_Change;
wxCheckBox* m_Pad_Orient_Change;
public: public:
WinEDA_PadGlobalEditFrame( WinEDA_BasePcbFrame* parent, D_PAD* Pad ); DIALOG_GLOBAL_PADS_EDITION( WinEDA_BasePcbFrame* parent, D_PAD* Pad );
~WinEDA_PadGlobalEditFrame() { } ~DIALOG_GLOBAL_PADS_EDITION() { }
private: private:
void InstallPadEditor( wxCommandEvent& event );
void PadPropertiesAccept( wxCommandEvent& event ); void PadPropertiesAccept( wxCommandEvent& event );
void OnCancelClick( wxCommandEvent& event ); void OnCancelClick( wxCommandEvent& event );
DECLARE_EVENT_TABLE()
}; };
BEGIN_EVENT_TABLE( WinEDA_PadGlobalEditFrame, wxDialog )
EVT_BUTTON( ID_CHANGE_CURRENT_MODULE, DIALOG_GLOBAL_PADS_EDITION::DIALOG_GLOBAL_PADS_EDITION(
WinEDA_PadGlobalEditFrame::PadPropertiesAccept )
EVT_BUTTON( ID_CHANGE_ID_MODULES,
WinEDA_PadGlobalEditFrame::PadPropertiesAccept )
EVT_BUTTON( ID_CHANGE_GET_PAD_SETTINGS,
WinEDA_PadGlobalEditFrame::PadPropertiesAccept )
EVT_BUTTON( wxID_CANCEL, WinEDA_PadGlobalEditFrame::OnCancelClick )
END_EVENT_TABLE()
WinEDA_PadGlobalEditFrame::WinEDA_PadGlobalEditFrame(
WinEDA_BasePcbFrame* parent, WinEDA_BasePcbFrame* parent,
D_PAD* Pad ) : D_PAD* Pad ) :
wxDialog( parent, -1, _( "Edit Pads Global" ), wxDefaultPosition, DIALOG_GLOBAL_PADS_EDITION_BASE( parent )
wxSize( 310, 235 ), DIALOG_STYLE )
{ {
wxPoint pos;
wxButton* Button;
m_Parent = parent; m_Parent = parent;
Centre(); m_CurrentPad = Pad;
CurrentPad = Pad;
/* Create command buttons. */
pos.x = 150;
pos.y = 10;
Button = new wxButton( this, ID_CHANGE_GET_PAD_SETTINGS,
_( "Pad Settings..." ), pos );
pos.y += Button->GetDefaultSize().y + 50;
Button = new wxButton( this, ID_CHANGE_CURRENT_MODULE,
_( "Change Module" ), pos );
pos.y += Button->GetDefaultSize().y + 10;
Button = new wxButton( this, ID_CHANGE_ID_MODULES,
_( "Change ID Modules" ), pos );
pos.y += Button->GetDefaultSize().y + 10;
Button = new wxButton( this, wxID_CANCEL, _( "Cancel" ), pos );
// Pad filter selection. // Pad filter selection.
pos.x = 5; m_Pad_Shape_Filter_CB->SetValue( m_Pad_Shape_Filter );
pos.y = 5; m_Pad_Layer_Filter_CB->SetValue( m_Pad_Layer_Filter );
new wxStaticBox( this, -1, _( "Pad Filter :" ), pos, wxSize( 130, 75 ) ); m_Pad_Orient_Filter_CB->SetValue( m_Pad_Orient_Filter );
pos.x += 5;
pos.y += 18;
m_Pad_Shape_Filter = new wxCheckBox( this, -1, _( "Shape Filter" ), pos );
m_Pad_Shape_Filter->SetValue( Pad_Shape_Filter );
pos.y += 18;
m_Pad_Layer_Filter = new wxCheckBox( this, -1, _( "Layer Filter" ), pos );
m_Pad_Layer_Filter->SetValue( Pad_Layer_Filter );
pos.y += 18; GetSizer()->Fit( this );
m_Pad_Orient_Filter = new wxCheckBox( this, -1, _( "Orient Filter" ), pos ); Centre();
}
m_Pad_Orient_Filter->SetValue( Pad_Orient_Filter );
// Items a editer
pos.x -= 5;
pos.y += 25;
new wxStaticBox( this, -1, _( "Change Items :" ), pos, wxSize( 130, 95 ) );
pos.x += 5;
pos.y += 18;
m_Pad_Size_Change = new wxCheckBox( this, -1, _( "Change Size" ), pos );
m_Pad_Size_Change->SetValue( Pad_Size_Change );
pos.y += 18;
m_Pad_Shape_Change = new wxCheckBox( this, -1, _( "Change Shape" ), pos );
m_Pad_Shape_Change->SetValue( Pad_Shape_Change );
pos.y += 18;
m_Pad_Drill_Change = new wxCheckBox( this, -1, _( "Change Drill" ), pos );
m_Pad_Drill_Change->SetValue( Pad_Drill_Change ); /*Class DIALOG_GLOBAL_PADS_EDITION static variables */
bool DIALOG_GLOBAL_PADS_EDITION::m_Pad_Shape_Filter = true;
bool DIALOG_GLOBAL_PADS_EDITION::m_Pad_Layer_Filter = true;
bool DIALOG_GLOBAL_PADS_EDITION::m_Pad_Orient_Filter = true;
pos.y += 18;
m_Pad_Orient_Change = new wxCheckBox( this, -1, _( "Change Orientation" ),
pos );
m_Pad_Orient_Change->SetValue( Pad_Orient_Change ); void DIALOG_GLOBAL_PADS_EDITION::OnCancelClick( wxCommandEvent& event )
{
EndModal( -1 );
} }
void WinEDA_PadGlobalEditFrame::OnCancelClick( wxCommandEvent& WXUNUSED( event ) ) /* Calls the Pad editor.
*/
void DIALOG_GLOBAL_PADS_EDITION::InstallPadEditor( wxCommandEvent& event )
{ {
EndModal( -1 ); wxClientDC dc( m_Parent->DrawPanel );
m_Parent->DrawPanel->PrepareGraphicContext( &dc );
m_Parent->DrawPanel->CursorOff( &dc );
m_Parent->InstallPadOptionsFrame( m_CurrentPad, &dc, wxDefaultPosition );
m_Parent->DrawPanel->CursorOn( &dc );
} }
/* Update the parameters for the component being edited. /* Update the parameters for the component being edited.
*/ */
void WinEDA_PadGlobalEditFrame::PadPropertiesAccept( wxCommandEvent& event ) void DIALOG_GLOBAL_PADS_EDITION::PadPropertiesAccept( wxCommandEvent& event )
{ {
int returncode = 0; int returncode = 0;
switch( event.GetId() ) switch( event.GetId() )
{ {
case ID_CHANGE_GET_PAD_SETTINGS:
m_Parent->InstallPadOptionsFrame( NULL, NULL, wxPoint( -1, -1 ) );
break;
case ID_CHANGE_ID_MODULES: case ID_CHANGE_ID_MODULES:
returncode = 1; returncode = 1;
// Fall through // Fall through
case ID_CHANGE_CURRENT_MODULE: case ID_CHANGE_CURRENT_MODULE:
Pad_Shape_Filter = m_Pad_Shape_Filter->GetValue(); m_Pad_Shape_Filter = m_Pad_Shape_Filter_CB->GetValue();
Pad_Layer_Filter = m_Pad_Layer_Filter->GetValue(); m_Pad_Layer_Filter = m_Pad_Layer_Filter_CB->GetValue();
Pad_Orient_Filter = m_Pad_Orient_Filter->GetValue(); m_Pad_Orient_Filter = m_Pad_Orient_Filter_CB->GetValue();
Pad_Size_Change = m_Pad_Size_Change->GetValue();
Pad_Shape_Change = m_Pad_Shape_Change->GetValue();
Pad_Drill_Change = m_Pad_Drill_Change->GetValue();
Pad_Orient_Change = m_Pad_Orient_Change->GetValue();
EndModal( returncode ); EndModal( returncode );
break; break;
} }
...@@ -198,10 +121,10 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw ) ...@@ -198,10 +121,10 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw )
{ {
MODULE* Module_Ref, * Module; MODULE* Module_Ref, * Module;
int diag; int diag;
bool Edit_Same_Modules = FALSE; bool edit_Same_Modules = false;
if( aPad == NULL ) if( aPad == NULL )
return; aPad = &g_Pad_Master;
Module = (MODULE*) aPad->GetParent(); Module = (MODULE*) aPad->GetParent();
...@@ -212,39 +135,74 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw ) ...@@ -212,39 +135,74 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw )
return; return;
} }
wxString ref_name_module = Module->m_LibRef;
Module->DisplayInfo( this ); Module->DisplayInfo( this );
WinEDA_PadGlobalEditFrame* frame = new WinEDA_PadGlobalEditFrame( this, DIALOG_GLOBAL_PADS_EDITION* dlg = new DIALOG_GLOBAL_PADS_EDITION( this, aPad );
aPad );
diag = frame->ShowModal(); diag = dlg->ShowModal();
frame->Destroy(); dlg->Destroy();
if( diag == -1 ) if( diag == -1 )
return; return;
if( diag == 1 ) if( diag == 1 )
Edit_Same_Modules = TRUE; edit_Same_Modules = true;
/* Search and copy the name of library reference. */ /* Search and copy the name of library reference. */
Module_Ref = Module; Module_Ref = Module;
int pad_orient = aPad->m_Orient - Module_Ref->m_Orient;
/* Update the modules or module. */ // Prepare une undo list:
PICKED_ITEMS_LIST itemsList;
Module = (MODULE*) m_Pcb->m_Modules; Module = (MODULE*) m_Pcb->m_Modules;
for( ; Module != NULL; Module = Module->Next() ) for( ; Module != NULL; Module = Module->Next() )
{ {
if( !Edit_Same_Modules ) if( !edit_Same_Modules && (Module != Module_Ref) )
if( Module != Module_Ref )
continue; continue;
if( ref_name_module != Module->m_LibRef ) if( Module->m_LibRef != Module->m_LibRef )
continue; continue;
Module->DisplayInfo( this ); bool saveMe = false;
D_PAD* pt_pad = (D_PAD*) Module->m_Pads;
for( ; pt_pad != NULL; pt_pad = pt_pad->Next() )
{
/* Filters changes prohibited. */
if( DIALOG_GLOBAL_PADS_EDITION::m_Pad_Shape_Filter
&& ( pt_pad->m_PadShape != aPad->m_PadShape ) )
continue;
/* Erase module */ if( DIALOG_GLOBAL_PADS_EDITION::m_Pad_Orient_Filter
&& ( (pt_pad->m_Orient - Module->m_Orient) != pad_orient ) )
continue;
if( DIALOG_GLOBAL_PADS_EDITION::m_Pad_Layer_Filter
&& ( pt_pad->m_Masque_Layer != aPad->m_Masque_Layer ) )
continue;
saveMe = true;
}
if( saveMe )
{
ITEM_PICKER itemWrapper( Module, UR_CHANGED );
itemWrapper.m_PickedItemType = Module->Type();
itemsList.PushItem( itemWrapper );
}
}
SaveCopyInUndoList( itemsList, UR_CHANGED );
/* Update the current module and same others modules if requested. */
Module = (MODULE*) m_Pcb->m_Modules;
for( ; Module != NULL; Module = Module->Next() )
{
if( !edit_Same_Modules && (Module != Module_Ref) )
continue;
if( Module->m_LibRef != Module->m_LibRef )
continue;
/* Erase module on screen */
if( aDraw ) if( aDraw )
{ {
Module->m_Flags |= DO_NOT_DRAW; Module->m_Flags |= DO_NOT_DRAW;
...@@ -256,22 +214,17 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw ) ...@@ -256,22 +214,17 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw )
for( ; pt_pad != NULL; pt_pad = pt_pad->Next() ) for( ; pt_pad != NULL; pt_pad = pt_pad->Next() )
{ {
/* Filters changes prohibited. */ /* Filters changes prohibited. */
if( Pad_Shape_Filter ) if( DIALOG_GLOBAL_PADS_EDITION::m_Pad_Shape_Filter
{ && ( pt_pad->m_PadShape != aPad->m_PadShape ) )
if( pt_pad->m_PadShape != g_Pad_Master.m_PadShape )
continue; continue;
}
if( Pad_Orient_Filter ) if( DIALOG_GLOBAL_PADS_EDITION::m_Pad_Orient_Filter
{ && ( (pt_pad->m_Orient - Module->m_Orient) != pad_orient ) )
if( (pt_pad->m_Orient - Module->m_Orient) !=
g_Pad_Master.m_Orient )
continue; continue;
}
if( Pad_Layer_Filter ) if( DIALOG_GLOBAL_PADS_EDITION::m_Pad_Layer_Filter )
{ {
if( pt_pad->m_Masque_Layer != g_Pad_Master.m_Masque_Layer ) if( pt_pad->m_Masque_Layer != aPad->m_Masque_Layer )
continue; continue;
else else
m_Pcb->m_Status_Pcb &= m_Pcb->m_Status_Pcb &=
...@@ -279,41 +232,37 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw ) ...@@ -279,41 +232,37 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* aPad, bool aDraw )
} }
/* Change characteristics.: */ /* Change characteristics.: */
if( Pad_Shape_Change ) pt_pad->m_Attribut = aPad->m_Attribut;
{ pt_pad->m_PadShape = aPad->m_PadShape;
pt_pad->m_Attribut = g_Pad_Master.m_Attribut;
pt_pad->m_PadShape = g_Pad_Master.m_PadShape;
}
pt_pad->m_Masque_Layer = g_Pad_Master.m_Masque_Layer; pt_pad->m_Masque_Layer = aPad->m_Masque_Layer;
if( Pad_Size_Change ) pt_pad->m_Size = aPad->m_Size;
{ pt_pad->m_DeltaSize = aPad->m_DeltaSize;
pt_pad->m_Size = g_Pad_Master.m_Size; pt_pad->m_Offset = aPad->m_Offset;
pt_pad->m_DeltaSize = g_Pad_Master.m_DeltaSize;
pt_pad->m_Offset = g_Pad_Master.m_Offset;
}
if( Pad_Drill_Change ) pt_pad->m_Drill = aPad->m_Drill;
{ pt_pad->m_DrillShape = aPad->m_DrillShape;
pt_pad->m_Drill = g_Pad_Master.m_Drill;
pt_pad->m_DrillShape = g_Pad_Master.m_DrillShape; pt_pad->m_Orient = pad_orient + Module->m_Orient;
}
// copy also local mask margins,
// because these parameters usually depend on
// pads sizes and layers
pt_pad->m_LocalSolderMaskMargin = aPad->m_LocalSolderMaskMargin;
pt_pad->m_LocalSolderPasteMargin = aPad->m_LocalSolderPasteMargin;
pt_pad->m_LocalSolderPasteMarginRatio = aPad->m_LocalSolderPasteMarginRatio;
if( Pad_Orient_Change )
{
pt_pad->m_Orient = g_Pad_Master.m_Orient + Module->m_Orient;
}
if( g_Pad_Master.m_PadShape != PAD_TRAPEZOID ) if( pt_pad->m_PadShape != PAD_TRAPEZOID )
{ {
pt_pad->m_DeltaSize.x = 0; pt_pad->m_DeltaSize.x = 0;
pt_pad->m_DeltaSize.y = 0; pt_pad->m_DeltaSize.y = 0;
} }
if( g_Pad_Master.m_PadShape == PAD_CIRCLE ) if( pt_pad->m_PadShape == PAD_CIRCLE )
pt_pad->m_Size.y = pt_pad->m_Size.x; pt_pad->m_Size.y = pt_pad->m_Size.x;
switch( g_Pad_Master.m_Attribut & 0x7F ) switch( pt_pad->m_Attribut & 0x7F )
{ {
case PAD_SMD: case PAD_SMD:
case PAD_CONN: case PAD_CONN:
......
...@@ -722,18 +722,17 @@ void WinEDA_PcbFrame::createPopUpMenuForFpPads( D_PAD* Pad, wxMenu* menu ) ...@@ -722,18 +722,17 @@ void WinEDA_PcbFrame::createPopUpMenuForFpPads( D_PAD* Pad, wxMenu* menu )
sub_menu_Pad->AppendSeparator(); sub_menu_Pad->AppendSeparator();
ADD_MENUITEM_WITH_HELP( sub_menu_Pad, ID_POPUP_PCB_IMPORT_PAD_SETTINGS, ADD_MENUITEM_WITH_HELP( sub_menu_Pad, ID_POPUP_PCB_IMPORT_PAD_SETTINGS,
_( "New Pad Settings" ), _( "Copy Current Settings to this Pad" ),
_( "Copy current pad settings to this pad" ), wxEmptyString,
options_new_pad_xpm ); options_new_pad_xpm );
ADD_MENUITEM_WITH_HELP( sub_menu_Pad, ID_POPUP_PCB_EXPORT_PAD_SETTINGS, ADD_MENUITEM_WITH_HELP( sub_menu_Pad, ID_POPUP_PCB_EXPORT_PAD_SETTINGS,
_( "Export Pad Settings" ), _( "Copy this Pad Settings to Current Settings" ),
_( "Copy this pad settings to current pad settings" ), wxEmptyString,
export_options_pad_xpm ); export_options_pad_xpm );
ADD_MENUITEM_WITH_HELP( sub_menu_Pad, ID_POPUP_PCB_GLOBAL_IMPORT_PAD_SETTINGS, ADD_MENUITEM_WITH_HELP( sub_menu_Pad, ID_POPUP_PCB_GLOBAL_IMPORT_PAD_SETTINGS,
_( "Global Pad Settings" ), _( "Global Pads Edition" ),
_( _( "Copy this pad settings to all pads in this footprint (or similar footprints)" ),
"Copy this pad settings to all pads in this footprint (or similar footprints)" ),
global_options_pad_xpm ); global_options_pad_xpm );
sub_menu_Pad->AppendSeparator(); sub_menu_Pad->AppendSeparator();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment