bug in cvpcb

This commit is contained in:
CHARRAS 2007-12-20 22:27:32 +00:00
parent 15b5df831b
commit 3104b5d885
9 changed files with 244 additions and 99 deletions

View File

@ -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) );

View File

@ -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

Binary file not shown.

View File

@ -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 <jean-pierre.charras@inpg.fr>\n"
"PO-Revision-Date: 2007-12-20 23:05+0100\n"
"Last-Translator: \n"
"Language-Team: kicad team <jean-pierre.charras@ujf-grenoble.fr>\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!"

View File

@ -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,9 +98,11 @@ 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;
@ -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 );
@ -433,7 +444,7 @@ void WinEDA_ZoneFrame::ExecFillZone( wxCommandEvent& event )
}
}
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 );
}

View File

@ -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
};

View File

@ -218,6 +218,7 @@
<string name="id-suffix">""</string>
<long name="use-xrc">0</long>
<long name="working-mode">0</long>
<string name="variable-0">"m_OutlinesOpt|int|OutlinesOpt|0|0|0|"</string>
<string name="proxy-Id name">"ID_DIALOG"</string>
<long name="proxy-Id value">10000</long>
<string name="proxy-Class">"WinEDA_ZoneFrame"</string>
@ -346,7 +347,7 @@
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<document>
<string name="title">"wxRadioBox: ID_RADIOBOX3"</string>
<string name="title">"wxRadioBox: ID_RADIOBOX_GRID_SELECTION"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"radiobox"</string>
@ -356,7 +357,7 @@
<long name="locked">0</long>
<string name="created">"15/12/2007"</string>
<string name="proxy-type">"wbRadioBoxProxy"</string>
<string name="proxy-Id name">"ID_RADIOBOX3"</string>
<string name="proxy-Id name">"ID_RADIOBOX_GRID_SELECTION"</string>
<long name="proxy-Id value">10003</long>
<string name="proxy-Name">""</string>
<string name="proxy-Class">"wxRadioBox"</string>
@ -368,7 +369,7 @@
<string name="proxy-Member variable name">"m_GridCtrl"</string>
<string name="proxy-Label">"Grid Size for Filling:"</string>
<long name="proxy-Major dimension count">1</long>
<string name="proxy-Items">"0.00000|0.00000|0.00000|0.00000"</string>
<string name="proxy-Items">"0.00000|0.00000|0.00000"</string>
<long name="proxy-Initial value">0</long>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
@ -561,6 +562,70 @@
<string name="proxy-Custom arguments">""</string>
<string name="proxy-Custom ctor arguments">""</string>
</document>
<document>
<string name="title">"wxRadioBox: ID_RADIOBOX_OUTLINES_OPTION"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"radiobox"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"20/12/2007"</string>
<string name="proxy-type">"wbRadioBoxProxy"</string>
<string name="proxy-Id name">"ID_RADIOBOX_OUTLINES_OPTION"</string>
<long name="proxy-Id value">10006</long>
<string name="proxy-Name">""</string>
<string name="proxy-Class">"wxRadioBox"</string>
<string name="proxy-Base class">"wxRadioBox"</string>
<bool name="proxy-External implementation">1</bool>
<bool name="proxy-Separate files">0</bool>
<string name="proxy-Implementation filename">""</string>
<string name="proxy-Header filename">""</string>
<string name="proxy-Member variable name">"m_OutlineAppearanceCtrl"</string>
<string name="proxy-Label">"Outlines Appearance"</string>
<long name="proxy-Major dimension count">1</long>
<string name="proxy-Items">"Line|Hatched Outline|Full Hatched"</string>
<long name="proxy-Initial value">0</long>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<string name="proxy-Data variable">"m_OutlinesOpt"</string>
<string name="proxy-Data validator">"wxGenericValidator(&amp; %VARIABLE%)"</string>
<string name="proxy-Data source">""</string>
<string name="proxy-Data class name">""</string>
<string name="proxy-Data class implementation filename">""</string>
<string name="proxy-Data class header filename">""</string>
<string name="proxy-Data class manager window">""</string>
<bool name="proxy-wxRA_SPECIFY_ROWS">0</bool>
<bool name="proxy-wxRA_SPECIFY_COLS">1</bool>
<bool name="proxy-wxWANTS_CHARS">0</bool>
<bool name="proxy-wxNO_FULL_REPAINT_ON_RESIZE">0</bool>
<bool name="proxy-wxFULL_REPAINT_ON_RESIZE">0</bool>
<string name="proxy-Custom styles">""</string>
<long name="proxy-X">-1</long>
<long name="proxy-Y">-1</long>
<long name="proxy-Width">-1</long>
<long name="proxy-Height">-1</long>
<string name="proxy-AlignH">"Expand"</string>
<string name="proxy-AlignV">"Centre"</string>
<long name="proxy-Stretch factor">0</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Custom arguments">""</string>
<string name="proxy-Custom ctor arguments">""</string>
</document>
</document>
<document>
<string name="title">"Spacer"</string>
@ -677,6 +742,32 @@
<string name="proxy-Custom arguments">""</string>
<string name="proxy-Custom ctor arguments">""</string>
</document>
<document>
<string name="title">"Spacer"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"spacer"</string>
<long name="is-transient">0</long>
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"18/12/2007"</string>
<string name="proxy-type">"wbSpacerProxy"</string>
<long name="proxy-Width">5</long>
<long name="proxy-Height">5</long>
<string name="proxy-AlignH">"Expand"</string>
<string name="proxy-AlignV">"Expand"</string>
<long name="proxy-Stretch factor">1</long>
<long name="proxy-Border">5</long>
<bool name="proxy-wxLEFT">1</bool>
<bool name="proxy-wxRIGHT">1</bool>
<bool name="proxy-wxTOP">1</bool>
<bool name="proxy-wxBOTTOM">1</bool>
<bool name="proxy-wxSHAPED">0</bool>
<bool name="proxy-wxADJUST_MINSIZE">0</bool>
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
</document>
<document>
<string name="title">"wxRadioBox: ID_RADIOBOX5"</string>
<string name="type">"dialog-control-document"</string>
@ -794,7 +885,7 @@
<bool name="proxy-wxFIXED_MINSIZE">0</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<document>
<string name="title">"wxButton: ID_BUTTON"</string>
<string name="title">"wxButton: wxID_OK"</string>
<string name="type">"dialog-control-document"</string>
<string name="filename">""</string>
<string name="icon-name">"dialogcontrol"</string>
@ -802,11 +893,11 @@
<long name="owns-file">1</long>
<long name="title-mode">0</long>
<long name="locked">0</long>
<string name="created">"15/12/2007"</string>
<string name="created">"18/12/2007"</string>
<string name="proxy-type">"wbButtonProxy"</string>
<string name="event-handler-0">"wxEVT_COMMAND_BUTTON_CLICKED|ExecFillZone|||WinEDA_ZoneFrame"</string>
<string name="proxy-Id name">"ID_BUTTON"</string>
<long name="proxy-Id value">10010</long>
<string name="event-handler-0">"wxEVT_COMMAND_BUTTON_CLICKED|OnOkClick|NONE||WinEDA_ZoneFrame"</string>
<string name="proxy-Id name">"wxID_OK"</string>
<long name="proxy-Id value">5100</long>
<string name="proxy-Name">""</string>
<string name="proxy-Class">"wxButton"</string>
<string name="proxy-Base class">"wxButton"</string>
@ -815,8 +906,8 @@
<string name="proxy-Implementation filename">""</string>
<string name="proxy-Header filename">""</string>
<string name="proxy-Member variable name">""</string>
<string name="proxy-Label">"Fill"</string>
<bool name="proxy-Default">1</bool>
<string name="proxy-Label">"OK"</string>
<bool name="proxy-Default">0</bool>
<string name="proxy-Help text">""</string>
<string name="proxy-Tooltip text">""</string>
<string name="proxy-Data variable">""</string>
@ -827,7 +918,7 @@
<string name="proxy-Data class header filename">""</string>
<string name="proxy-Data class manager window">""</string>
<string name="proxy-Background colour">""</string>
<string name="proxy-Foreground colour">"CC0000"</string>
<string name="proxy-Foreground colour">""</string>
<string name="proxy-Font">""</string>
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
@ -987,7 +1078,7 @@
<bool name="proxy-Hidden">0</bool>
<bool name="proxy-Enabled">1</bool>
<string name="proxy-Platform">"&lt;Any platform&gt;"</string>
<string name="proxy-Data variable">"s_NetSortingOpt"</string>
<string name="proxy-Data variable">"m_NetSorting"</string>
<string name="proxy-Data validator">"wxGenericValidator(&amp; %VARIABLE%)"</string>
<string name="proxy-Data source">""</string>
<string name="proxy-Data class name">""</string>

View File

@ -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" ) );

View File

@ -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,13 +351,39 @@ 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 */
|| (DrawPanel->ManageCurseur == NULL) ) /* reprise d'un trace complementaire */
@ -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 )
{
@ -577,6 +597,5 @@ 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();
}