diff --git a/cvpcb/readschematicnetlist.cpp b/cvpcb/readschematicnetlist.cpp index d5401281b6..d09b618d60 100644 --- a/cvpcb/readschematicnetlist.cpp +++ b/cvpcb/readschematicnetlist.cpp @@ -116,6 +116,7 @@ int WinEDA_CvpcbFrame::ReadSchematicNetlist() /* i points the beginning of the schematic time stamp */ + memset( schematic_timestamp, 0, sizeof(schematic_timestamp) ); j = 0; while( Line[i] != ' ' ) schematic_timestamp[j++] = Line[i++]; @@ -128,7 +129,6 @@ int WinEDA_CvpcbFrame::ReadSchematicNetlist() /* i points the component value */ LibName = Line + i; - memset( schematic_timestamp, 0, sizeof(schematic_timestamp) ); memset( component_reference, 0, sizeof(component_reference) ); memset( footprint_name, 0, sizeof(footprint_name) ); memset( component_value, 0, sizeof(component_value) ); diff --git a/include/wxstruct.h b/include/wxstruct.h index 69d78a1a2b..65b0477c4f 100644 --- a/include/wxstruct.h +++ b/include/wxstruct.h @@ -751,7 +751,7 @@ public: // zone handling EDGE_ZONE* Del_SegmEdgeZone( wxDC* DC, EDGE_ZONE* edge_zone ); void CaptureNetName( wxDC* DC ); - EDGE_ZONE* Begin_Zone(); + EDGE_ZONE* Begin_Zone( wxDC* DC ); /** * Function End_Zone diff --git a/internat/fr/kicad.mo b/internat/fr/kicad.mo index fd9023beb4..e5230d6e01 100644 Binary files a/internat/fr/kicad.mo and b/internat/fr/kicad.mo differ diff --git a/internat/fr/kicad.po b/internat/fr/kicad.po index ffc77031b9..368cfdf16e 100644 --- a/internat/fr/kicad.po +++ b/internat/fr/kicad.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: kicad\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2007-12-06 08:31+0100\n" -"Last-Translator: jp charras \n" +"PO-Revision-Date: 2007-12-20 23:05+0100\n" +"Last-Translator: \n" "Language-Team: kicad team \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=iso-8859-1\n" @@ -3606,7 +3606,7 @@ msgstr "S #: pcbnew/netlist.cpp:945 #, c-format msgid "Component [%s]: footprint <%s> not found" -msgstr "Composant [%s]: Module <%sw non trouvé en librairies" +msgstr "Composant [%s]: Module <%s> non trouvé en librairie" #: pcbnew/editmod.cpp:144 msgid "Text is REFERENCE!" diff --git a/pcbnew/dialog_zones_by_polygon.cpp b/pcbnew/dialog_zones_by_polygon.cpp index 8fc239fee6..761402b778 100644 --- a/pcbnew/dialog_zones_by_polygon.cpp +++ b/pcbnew/dialog_zones_by_polygon.cpp @@ -48,7 +48,7 @@ IMPLEMENT_DYNAMIC_CLASS( WinEDA_ZoneFrame, wxDialog ) BEGIN_EVENT_TABLE( WinEDA_ZoneFrame, wxDialog ) ////@begin WinEDA_ZoneFrame event table entries - EVT_BUTTON( ID_BUTTON, WinEDA_ZoneFrame::ExecFillZone ) + EVT_BUTTON( wxID_OK, WinEDA_ZoneFrame::OnOkClick ) EVT_BUTTON( wxID_CANCEL, WinEDA_ZoneFrame::OnCancelClick ) @@ -75,7 +75,14 @@ WinEDA_ZoneFrame::WinEDA_ZoneFrame( WinEDA_PcbFrame* parent, long style ) { m_Parent = parent; + + if( m_Parent->m_Parent->m_EDA_Config ) + { + m_NetSorting = m_Parent->m_Parent->m_EDA_Config->Read( ZONE_NET_SORT_OPTION_KEY, (long) BOARD::PAD_CNT_SORT ); + } + Create( parent, id, caption, pos, size, style ); + SetReturnCode(ZONE_ABORT); // Will be changed on buttons click } @@ -91,16 +98,18 @@ bool WinEDA_ZoneFrame::Create( wxWindow* parent, long style ) { ////@begin WinEDA_ZoneFrame member initialisation + m_OutlinesOpt = 0; m_GridCtrl = NULL; m_ClearanceValueTitle = NULL; m_ZoneClearanceCtrl = NULL; + m_OutlineAppearanceCtrl = NULL; m_FillOpt = NULL; m_OrientEdgesOpt = NULL; m_NetSortingOption = NULL; m_ListNetNameSelection = NULL; m_LayerSelectionCtrl = NULL; ////@end WinEDA_ZoneFrame member initialisation - + ////@begin WinEDA_ZoneFrame creation SetExtraStyle(wxWS_EX_BLOCK_EVENTS); wxDialog::Create( parent, id, caption, pos, size, style ); @@ -126,7 +135,7 @@ void WinEDA_ZoneFrame::CreateControls() SetFont( *g_DialogFont ); ////@begin WinEDA_ZoneFrame content construction - // Generated by DialogBlocks, 17/12/2007 20:46:19 (unregistered) + // Generated by DialogBlocks, 20/12/2007 15:46:22 (unregistered) WinEDA_ZoneFrame* itemDialog1 = this; @@ -143,8 +152,7 @@ void WinEDA_ZoneFrame::CreateControls() m_GridCtrlStrings.Add(_("0.00000")); m_GridCtrlStrings.Add(_("0.00000")); m_GridCtrlStrings.Add(_("0.00000")); - m_GridCtrlStrings.Add(_("0.00000")); - m_GridCtrl = new wxRadioBox( itemDialog1, ID_RADIOBOX3, _("Grid Size for Filling:"), wxDefaultPosition, wxDefaultSize, m_GridCtrlStrings, 1, wxRA_SPECIFY_COLS ); + m_GridCtrl = new wxRadioBox( itemDialog1, ID_RADIOBOX_GRID_SELECTION, _("Grid Size for Filling:"), wxDefaultPosition, wxDefaultSize, m_GridCtrlStrings, 1, wxRA_SPECIFY_COLS ); m_GridCtrl->SetSelection(0); itemBoxSizer4->Add(m_GridCtrl, 0, wxGROW|wxALL, 5); @@ -154,10 +162,18 @@ void WinEDA_ZoneFrame::CreateControls() m_ZoneClearanceCtrl = new wxTextCtrl( itemDialog1, ID_TEXTCTRL1, _T(""), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer4->Add(m_ZoneClearanceCtrl, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); + wxArrayString m_OutlineAppearanceCtrlStrings; + m_OutlineAppearanceCtrlStrings.Add(_("Line")); + m_OutlineAppearanceCtrlStrings.Add(_("Hatched Outline")); + m_OutlineAppearanceCtrlStrings.Add(_("Full Hatched")); + m_OutlineAppearanceCtrl = new wxRadioBox( itemDialog1, ID_RADIOBOX_OUTLINES_OPTION, _("Outlines Appearance"), wxDefaultPosition, wxDefaultSize, m_OutlineAppearanceCtrlStrings, 1, wxRA_SPECIFY_COLS ); + m_OutlineAppearanceCtrl->SetSelection(0); + itemBoxSizer4->Add(m_OutlineAppearanceCtrl, 0, wxGROW|wxALL, 5); + itemBoxSizer3->Add(5, 5, 0, wxGROW|wxALL, 5); - wxBoxSizer* itemBoxSizer9 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer3->Add(itemBoxSizer9, 0, wxGROW|wxALL, 5); + wxBoxSizer* itemBoxSizer10 = new wxBoxSizer(wxVERTICAL); + itemBoxSizer3->Add(itemBoxSizer10, 0, wxGROW|wxALL, 5); wxArrayString m_FillOptStrings; m_FillOptStrings.Add(_("Include Pads")); @@ -165,57 +181,58 @@ void WinEDA_ZoneFrame::CreateControls() m_FillOptStrings.Add(_("Exclude Pads")); m_FillOpt = new wxRadioBox( itemDialog1, ID_RADIOBOX4, _("Pad options:"), wxDefaultPosition, wxDefaultSize, m_FillOptStrings, 1, wxRA_SPECIFY_COLS ); m_FillOpt->SetSelection(0); - itemBoxSizer9->Add(m_FillOpt, 0, wxGROW|wxALL, 5); + itemBoxSizer10->Add(m_FillOpt, 0, wxGROW|wxALL, 5); + + itemBoxSizer10->Add(5, 5, 1, wxGROW|wxALL, 5); wxArrayString m_OrientEdgesOptStrings; m_OrientEdgesOptStrings.Add(_("Any")); m_OrientEdgesOptStrings.Add(_("H , V and 45 deg")); m_OrientEdgesOpt = new wxRadioBox( itemDialog1, ID_RADIOBOX5, _("Zone edges orient:"), wxDefaultPosition, wxDefaultSize, m_OrientEdgesOptStrings, 1, wxRA_SPECIFY_COLS ); m_OrientEdgesOpt->SetSelection(0); - itemBoxSizer9->Add(m_OrientEdgesOpt, 0, wxGROW|wxALL, 5); + itemBoxSizer10->Add(m_OrientEdgesOpt, 0, wxGROW|wxALL, 5); itemBoxSizer3->Add(5, 5, 0, wxGROW|wxALL, 5); - wxBoxSizer* itemBoxSizer13 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer3->Add(itemBoxSizer13, 0, wxGROW|wxALL, 5); + wxBoxSizer* itemBoxSizer15 = new wxBoxSizer(wxVERTICAL); + itemBoxSizer3->Add(itemBoxSizer15, 0, wxGROW|wxALL, 5); - wxButton* itemButton14 = new wxButton( itemDialog1, ID_BUTTON, _("Fill"), wxDefaultPosition, wxDefaultSize, 0 ); - itemButton14->SetDefault(); - itemButton14->SetForegroundColour(wxColour(204, 0, 0)); - itemBoxSizer13->Add(itemButton14, 0, wxGROW|wxALL, 5); + wxButton* itemButton16 = new wxButton( itemDialog1, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 ); + itemBoxSizer15->Add(itemButton16, 0, wxGROW|wxALL, 5); - wxButton* itemButton15 = new wxButton( itemDialog1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); - itemButton15->SetForegroundColour(wxColour(0, 0, 255)); - itemBoxSizer13->Add(itemButton15, 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); - itemBoxSizer13->Add(5, 5, 1, wxGROW|wxALL, 5); + itemBoxSizer15->Add(5, 5, 1, wxGROW|wxALL, 5); wxArrayString m_NetSortingOptionStrings; m_NetSortingOptionStrings.Add(_("Alphabetic")); m_NetSortingOptionStrings.Add(_("Advanced")); m_NetSortingOption = new wxRadioBox( itemDialog1, ID_NET_SORTING_OPTION, _("Net sorting:"), wxDefaultPosition, wxDefaultSize, m_NetSortingOptionStrings, 1, wxRA_SPECIFY_COLS ); m_NetSortingOption->SetSelection(0); - itemBoxSizer13->Add(m_NetSortingOption, 0, wxGROW|wxALL, 5); + itemBoxSizer15->Add(m_NetSortingOption, 0, wxGROW|wxALL, 5); - wxBoxSizer* itemBoxSizer18 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer2->Add(itemBoxSizer18, 0, wxGROW|wxALL, 5); + wxBoxSizer* itemBoxSizer20 = new wxBoxSizer(wxVERTICAL); + itemBoxSizer2->Add(itemBoxSizer20, 0, wxGROW|wxALL, 5); - wxStaticText* itemStaticText19 = new wxStaticText( itemDialog1, wxID_STATIC, _("Net:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer18->Add(itemStaticText19, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5); + wxStaticText* itemStaticText21 = new wxStaticText( itemDialog1, wxID_STATIC, _("Net:"), wxDefaultPosition, wxDefaultSize, 0 ); + itemBoxSizer20->Add(itemStaticText21, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5); wxArrayString m_ListNetNameSelectionStrings; m_ListNetNameSelection = new wxListBox( itemDialog1, ID_NETNAME_SELECTION, wxDefaultPosition, wxDefaultSize, m_ListNetNameSelectionStrings, wxLB_SINGLE|wxSUNKEN_BORDER ); - itemBoxSizer18->Add(m_ListNetNameSelection, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); + itemBoxSizer20->Add(m_ListNetNameSelection, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); - wxStaticText* itemStaticText21 = new wxStaticText( itemDialog1, wxID_LAYER_SELECTION, _("Layer:"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer18->Add(itemStaticText21, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5); + wxStaticText* itemStaticText23 = new wxStaticText( itemDialog1, wxID_LAYER_SELECTION, _("Layer:"), wxDefaultPosition, wxDefaultSize, 0 ); + itemBoxSizer20->Add(itemStaticText23, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5); wxArrayString m_LayerSelectionCtrlStrings; m_LayerSelectionCtrl = new wxListBox( itemDialog1, ID_LAYER_CHOICE, wxDefaultPosition, wxDefaultSize, m_LayerSelectionCtrlStrings, wxLB_SINGLE ); - itemBoxSizer18->Add(m_LayerSelectionCtrl, 0, wxGROW|wxALL, 5); + itemBoxSizer20->Add(m_LayerSelectionCtrl, 0, wxGROW|wxALL, 5); // Set validators - m_NetSortingOption->SetValidator( wxGenericValidator(& s_NetSortingOpt) ); + m_OutlineAppearanceCtrl->SetValidator( wxGenericValidator(& m_OutlinesOpt) ); + m_NetSortingOption->SetValidator( wxGenericValidator(& m_NetSorting) ); ////@end WinEDA_ZoneFrame content construction wxString title = _( "Zone clearance value:" ) + ReturnUnitSymbol( g_UnitMetric ); m_ClearanceValueTitle->SetLabel( title ); @@ -233,7 +250,7 @@ void WinEDA_ZoneFrame::CreateControls() if( Zone_45_Only ) m_OrientEdgesOpt->SetSelection( 1 ); - static const int GridList[4] = { 50, 100, 250, 500 }; + static const int GridList[4] = { 50, 100, 250 }; int selection = 0; for( unsigned ii = 0; ii < (unsigned) m_GridCtrl->GetCount(); ii++ ) @@ -257,7 +274,7 @@ void WinEDA_ZoneFrame::CreateControls() m_FillOpt->SetSelection( 2 ); } - m_NetSortingOption->SetSelection(s_NetSortingOpt == 0 ? : 1 ); + m_NetSortingOption->SetSelection(m_NetSorting == 0 ? 0 : 1 ); int layer_cnt = g_DesignSettings.m_CopperLayerCount; for( int ii = 0; ii < g_DesignSettings.m_CopperLayerCount; ii++ ) @@ -277,7 +294,7 @@ void WinEDA_ZoneFrame::CreateControls() wxArrayString ListNetName; m_Parent->m_Pcb->ReturnSortedNetnamesList( ListNetName, - s_NetSortingOpt == 0 ? BOARD::ALPHA_SORT : BOARD::PAD_CNT_SORT ); + m_NetSorting == 0 ? BOARD::ALPHA_SORT : BOARD::PAD_CNT_SORT ); m_ListNetNameSelection->InsertItems( ListNetName, 0 ); // Select net: @@ -343,19 +360,16 @@ wxIcon WinEDA_ZoneFrame::GetIconResource( const wxString& name ) void WinEDA_ZoneFrame::OnCancelClick( wxCommandEvent& event ) { -////@begin wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL in WinEDA_ZoneFrame. - // Before editing this code, remove the block markers. - event.Skip(); -////@end wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL in WinEDA_ZoneFrame. + EndModal( ZONE_ABORT ); } -/*! - * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON2 +/**********************************************************/ +bool WinEDA_ZoneFrame::AcceptOptions(bool aPromptForErrors) +/**********************************************************/ +/** Function WinEDA_ZoneFrame::AcceptOptions( + * @return false if incorrect options, true if Ok. */ -/***********************************************************/ -void WinEDA_ZoneFrame::ExecFillZone( wxCommandEvent& event ) -/***********************************************************/ { switch( m_FillOpt->GetSelection() ) { @@ -385,13 +399,10 @@ void WinEDA_ZoneFrame::ExecFillZone( wxCommandEvent& event ) g_GridRoutingSize = 100; break; + default: case 2: g_GridRoutingSize = 250; break; - - case 3: - g_GridRoutingSize = 500; - break; } wxString txtvalue = m_ZoneClearanceCtrl->GetValue(); @@ -404,19 +415,19 @@ void WinEDA_ZoneFrame::ExecFillZone( wxCommandEvent& event ) /* Get the layer selection for this zone */ int ii = m_LayerSelectionCtrl->GetSelection(); - if( ii < 0 ) + if( ii < 0 && aPromptForErrors ) { DisplayError( this, _( "Error : you must choose a layer" ) ); - return; + return false; } s_Zone_Layer = m_LayerId[ii]; /* Get the net name selection for this zone */ ii = m_ListNetNameSelection->GetSelection(); - if( ii < 0 ) + if( ii < 0 && aPromptForErrors ) { DisplayError( this, _( "Error : you must choose a net name" ) ); - return; + return false; } wxString net_name = m_ListNetNameSelection->GetString( ii ); @@ -432,8 +443,8 @@ void WinEDA_ZoneFrame::ExecFillZone( wxCommandEvent& event ) break; } } - - EndModal( 0 ); + + return true; } @@ -444,10 +455,26 @@ void WinEDA_ZoneFrame::ExecFillZone( wxCommandEvent& event ) void WinEDA_ZoneFrame::OnNetSortingOptionSelected( wxCommandEvent& event ) { wxArrayString ListNetName; - s_NetSortingOpt = m_NetSortingOption->GetSelection(); + m_NetSorting = m_NetSortingOption->GetSelection(); m_Parent->m_Pcb->ReturnSortedNetnamesList( ListNetName, - s_NetSortingOpt == 0 ? BOARD::ALPHA_SORT : BOARD::PAD_CNT_SORT ); + m_NetSorting == 0 ? BOARD::ALPHA_SORT : BOARD::PAD_CNT_SORT ); m_ListNetNameSelection->Clear(); m_ListNetNameSelection->InsertItems( ListNetName, 0 ); + if( m_Parent->m_Parent->m_EDA_Config ) + { + m_Parent->m_Parent->m_EDA_Config->Write( ZONE_NET_SORT_OPTION_KEY, (long) m_NetSorting ); + } + +} + + +/*! + * wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK + */ + +void WinEDA_ZoneFrame::OnOkClick( wxCommandEvent& event ) +{ + if ( AcceptOptions(true) ) + EndModal( ZONE_OK ); } diff --git a/pcbnew/dialog_zones_by_polygon.h b/pcbnew/dialog_zones_by_polygon.h index 5ed9c26b58..c5cce26e9b 100644 --- a/pcbnew/dialog_zones_by_polygon.h +++ b/pcbnew/dialog_zones_by_polygon.h @@ -39,11 +39,11 @@ ////@begin control identifiers #define ID_DIALOG 10000 -#define ID_RADIOBOX3 10003 +#define ID_RADIOBOX_GRID_SELECTION 10003 #define ID_TEXTCTRL1 10007 +#define ID_RADIOBOX_OUTLINES_OPTION 10006 #define ID_RADIOBOX4 10008 #define ID_RADIOBOX5 10009 -#define ID_BUTTON 10010 #define ID_NET_SORTING_OPTION 10005 #define ID_NETNAME_SELECTION 10001 #define wxID_LAYER_SELECTION 10004 @@ -85,8 +85,8 @@ public: ////@begin WinEDA_ZoneFrame event handler declarations - /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON - void ExecFillZone( 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 ); @@ -98,6 +98,9 @@ public: ////@begin WinEDA_ZoneFrame member function declarations + int GetOutlinesOpt() const { return m_OutlinesOpt ; } + void SetOutlinesOpt(int value) { m_OutlinesOpt = value ; } + /// Retrieves bitmap resources wxBitmap GetBitmapResource( const wxString& name ); @@ -108,20 +111,25 @@ public: /// Should we show tooltips? static bool ShowToolTips(); + bool AcceptOptions(bool aPromptForErrors); + ////@begin WinEDA_ZoneFrame member variables wxRadioBox* m_GridCtrl; wxStaticText* m_ClearanceValueTitle; wxTextCtrl* m_ZoneClearanceCtrl; + wxRadioBox* m_OutlineAppearanceCtrl; wxRadioBox* m_FillOpt; wxRadioBox* m_OrientEdgesOpt; wxRadioBox* m_NetSortingOption; wxListBox* m_ListNetNameSelection; wxListBox* m_LayerSelectionCtrl; + int m_OutlinesOpt; ////@end WinEDA_ZoneFrame member variables WinEDA_PcbFrame * m_Parent; + int m_NetSorting; int m_LayerId[LAYER_COUNT]; // Handle the real layer number from layer name position in m_LayerSelectionCtrl }; diff --git a/pcbnew/dialog_zones_by_polygon.pjd b/pcbnew/dialog_zones_by_polygon.pjd index 8aa3df2c97..54bd36a53e 100644 --- a/pcbnew/dialog_zones_by_polygon.pjd +++ b/pcbnew/dialog_zones_by_polygon.pjd @@ -218,6 +218,7 @@ "" 0 0 + "m_OutlinesOpt|int|OutlinesOpt|0|0|0|" "ID_DIALOG" 10000 "WinEDA_ZoneFrame" @@ -346,7 +347,7 @@ 0 "<Any platform>" - "wxRadioBox: ID_RADIOBOX3" + "wxRadioBox: ID_RADIOBOX_GRID_SELECTION" "dialog-control-document" "" "radiobox" @@ -356,7 +357,7 @@ 0 "15/12/2007" "wbRadioBoxProxy" - "ID_RADIOBOX3" + "ID_RADIOBOX_GRID_SELECTION" 10003 "" "wxRadioBox" @@ -368,7 +369,7 @@ "m_GridCtrl" "Grid Size for Filling:" 1 - "0.00000|0.00000|0.00000|0.00000" + "0.00000|0.00000|0.00000" 0 "" "" @@ -561,6 +562,70 @@ "" "" + + "wxRadioBox: ID_RADIOBOX_OUTLINES_OPTION" + "dialog-control-document" + "" + "radiobox" + 0 + 1 + 0 + 0 + "20/12/2007" + "wbRadioBoxProxy" + "ID_RADIOBOX_OUTLINES_OPTION" + 10006 + "" + "wxRadioBox" + "wxRadioBox" + 1 + 0 + "" + "" + "m_OutlineAppearanceCtrl" + "Outlines Appearance" + 1 + "Line|Hatched Outline|Full Hatched" + 0 + "" + "" + "" + "" + "" + 0 + 1 + "<Any platform>" + "m_OutlinesOpt" + "wxGenericValidator(& %VARIABLE%)" + "" + "" + "" + "" + "" + 0 + 1 + 0 + 0 + 0 + "" + -1 + -1 + -1 + -1 + "Expand" + "Centre" + 0 + 5 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + "" + "" + "Spacer" @@ -677,6 +742,32 @@ "" "" + + "Spacer" + "dialog-control-document" + "" + "spacer" + 0 + 1 + 0 + 0 + "18/12/2007" + "wbSpacerProxy" + 5 + 5 + "Expand" + "Expand" + 1 + 5 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + "<Any platform>" + "wxRadioBox: ID_RADIOBOX5" "dialog-control-document" @@ -794,7 +885,7 @@ 0 "<Any platform>" - "wxButton: ID_BUTTON" + "wxButton: wxID_OK" "dialog-control-document" "" "dialogcontrol" @@ -802,11 +893,11 @@ 1 0 0 - "15/12/2007" + "18/12/2007" "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|ExecFillZone|||WinEDA_ZoneFrame" - "ID_BUTTON" - 10010 + "wxEVT_COMMAND_BUTTON_CLICKED|OnOkClick|NONE||WinEDA_ZoneFrame" + "wxID_OK" + 5100 "" "wxButton" "wxButton" @@ -815,8 +906,8 @@ "" "" "" - "Fill" - 1 + "OK" + 0 "" "" "" @@ -827,7 +918,7 @@ "" "" "" - "CC0000" + "" "" 0 1 @@ -987,7 +1078,7 @@ 0 1 "<Any platform>" - "s_NetSortingOpt" + "m_NetSorting" "wxGenericValidator(& %VARIABLE%)" "" "" diff --git a/pcbnew/onleftclick.cpp b/pcbnew/onleftclick.cpp index 964343c619..a632da9216 100644 --- a/pcbnew/onleftclick.cpp +++ b/pcbnew/onleftclick.cpp @@ -215,13 +215,13 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) case ID_PCB_ZONES_BUTT: if( (DrawStruct == NULL) || (DrawStruct->m_Flags == 0) ) { - SetCurItem( DrawStruct = Begin_Zone() ); + SetCurItem( DrawStruct = Begin_Zone( DC ) ); } else if( DrawStruct && (DrawStruct->Type() == TYPEEDGEZONE) && (DrawStruct->m_Flags & IS_NEW) ) { - SetCurItem( DrawStruct = Begin_Zone() ); + SetCurItem( DrawStruct = Begin_Zone( DC ) ); } else DisplayError( this, wxT( "Edit: zone internal error" ) ); diff --git a/pcbnew/zones_by_polygon.cpp b/pcbnew/zones_by_polygon.cpp index b71a6f17ba..58cf883c7e 100644 --- a/pcbnew/zones_by_polygon.cpp +++ b/pcbnew/zones_by_polygon.cpp @@ -61,10 +61,13 @@ static bool Zone_Exclude_Pads = TRUE; static bool s_Zone_Create_Thermal_Relief = TRUE; static int s_Zone_Layer; // Layer used to put the current zone static int s_NetcodeSelection; // Net code selection for the current zone -static int s_NetSortingOpt; // For the net list: sort option (by alphabetic order or bay pad count order #define ZONE_NET_SORT_OPTION_KEY wxT("Zone_NetSort_Opt") +enum zone_cmd { + ZONE_ABORT, + ZONE_OK +}; #include "dialog_zones_by_polygon.cpp" @@ -348,12 +351,38 @@ void WinEDA_BasePcbFrame::DelLimitesZone( wxDC* DC, bool Redraw ) * either initializes the first segment of a new zone, or adds an * intermediate segment. */ -EDGE_ZONE* WinEDA_PcbFrame::Begin_Zone() +EDGE_ZONE* WinEDA_PcbFrame::Begin_Zone( wxDC* DC ) { EDGE_ZONE* oldedge; EDGE_ZONE* newedge = NULL; oldedge = m_Pcb->m_CurrentLimitZone; + + if( m_Pcb->m_CurrentLimitZone == NULL ) /* Start a new contour: init zone params (net and layer) */ + { + DrawPanel->m_IgnoreMouseEvents = TRUE; + WinEDA_ZoneFrame* frame = new WinEDA_ZoneFrame( this ); + + int diag = frame->ShowModal(); + frame->Destroy(); + DrawPanel->MouseToCursorSchema(); + DrawPanel->m_IgnoreMouseEvents = FALSE; + + if( diag == ZONE_ABORT ) + return NULL; + + GetScreen()->m_Active_Layer = s_Zone_Layer; + + /* Show the Net */ + if( (g_HightLigth_NetCode > 0) && (g_HightLigth_NetCode != s_NetcodeSelection) ) + { + Hight_Light( DC ); // Remove old hightlight selection + } + + g_HightLigth_NetCode = s_NetcodeSelection; + if ( ! g_HightLigt_Status ) + Hight_Light( DC ); + } // if first segment if( (m_Pcb->m_CurrentLimitZone == NULL ) /* debut reel du trace */ @@ -411,7 +440,7 @@ void WinEDA_PcbFrame::End_Zone( wxDC* DC ) if( m_Pcb->m_CurrentLimitZone ) { - Begin_Zone(); + Begin_Zone( DC ); /* le dernier point genere est de longueur tj nulle donc inutile. */ /* il sera raccorde au point de depart */ @@ -519,25 +548,15 @@ void WinEDA_PcbFrame::Fill_Zone( wxDC* DC ) return; } - if( m_Parent && m_Parent->m_EDA_Config ) - { - s_NetSortingOpt = m_Parent->m_EDA_Config->Read( ZONE_NET_SORT_OPTION_KEY, (long) BOARD::PAD_CNT_SORT ); - } - int NetSortingOptImg = s_NetSortingOpt; DrawPanel->m_IgnoreMouseEvents = TRUE; WinEDA_ZoneFrame* frame = new WinEDA_ZoneFrame( this ); - int abrd = frame->ShowModal(); + int diag = frame->ShowModal(); frame->Destroy(); DrawPanel->MouseToCursorSchema(); DrawPanel->m_IgnoreMouseEvents = FALSE; - if( (NetSortingOptImg != s_NetSortingOpt ) && m_Parent && m_Parent->m_EDA_Config ) - { - m_Parent->m_EDA_Config->Write( ZONE_NET_SORT_OPTION_KEY, (long) s_NetSortingOpt ); - } - - if( abrd ) + if( diag == ZONE_ABORT ) return; // set all the EDGE_ZONEs to the currently active layer and redraw them @@ -551,14 +570,15 @@ void WinEDA_PcbFrame::Fill_Zone( wxDC* DC ) Trace_DrawSegmentPcb( DrawPanel, DC, PtLim, GR_XOR ); } - /* Show the NetName */ + /* Show the Net */ if( (g_HightLigth_NetCode > 0) && (g_HightLigth_NetCode != s_NetcodeSelection) ) { - Hight_Light( DC ); - g_HightLigth_NetCode = s_NetcodeSelection; - Hight_Light( DC ); - } + Hight_Light( DC ); // Remoive old hightlight selection + } + g_HightLigth_NetCode = s_NetcodeSelection; + if ( ! g_HightLigt_Status ) + Hight_Light( DC ); if( g_HightLigth_NetCode > 0 ) { @@ -576,7 +596,6 @@ void WinEDA_PcbFrame::Fill_Zone( wxDC* DC ) Affiche_1_Parametre( this, 22, _( "NetName" ), msg, RED ); - Build_Zone( this, DC, g_HightLigth_NetCode, Zone_Exclude_Pads, s_Zone_Create_Thermal_Relief ); - - GetScreen()->SetModify(); + Build_Zone( this, DC, g_HightLigth_NetCode, Zone_Exclude_Pads, s_Zone_Create_Thermal_Relief ); + GetScreen()->SetModify(); }