set eol-style native on new files

This commit is contained in:
raburton 2007-12-19 16:44:53 +00:00
parent fbe304722e
commit 6991b49691
4 changed files with 1777 additions and 1777 deletions

View File

@ -1,453 +1,453 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: zones.cpp // Name: zones.cpp
// Purpose: // Purpose:
// Author: jean-pierre Charras // Author: jean-pierre Charras
// Modified by: // Modified by:
// Created: 25/01/2006 11:35:19 // Created: 25/01/2006 11:35:19
// RCS-ID: // RCS-ID:
// Copyright: GNU License // Copyright: GNU License
// Licence: GNU License // Licence: GNU License
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 25/01/2006 11:35:19 // Generated by DialogBlocks (unregistered), 25/01/2006 11:35:19
#if defined (__GNUG__) && !defined (NO_GCC_PRAGMA) #if defined (__GNUG__) && !defined (NO_GCC_PRAGMA)
#pragma implementation "zones.h" #pragma implementation "zones.h"
#endif #endif
// For compilers that support precompilation, includes "wx/wx.h". // For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h" #include "wx/wxprec.h"
#ifdef __BORLANDC__ #ifdef __BORLANDC__
#pragma hdrstop #pragma hdrstop
#endif #endif
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
#include "wx/wx.h" #include "wx/wx.h"
#endif #endif
////@begin includes ////@begin includes
////@end includes ////@end includes
#include "dialog_zones_by_polygon.h" #include "dialog_zones_by_polygon.h"
////@begin XPM images ////@begin XPM images
////@end XPM images ////@end XPM images
/*! /*!
* WinEDA_ZoneFrame type definition * WinEDA_ZoneFrame type definition
*/ */
IMPLEMENT_DYNAMIC_CLASS( WinEDA_ZoneFrame, wxDialog ) IMPLEMENT_DYNAMIC_CLASS( WinEDA_ZoneFrame, wxDialog )
/*! /*!
* WinEDA_ZoneFrame event table definition * WinEDA_ZoneFrame event table definition
*/ */
BEGIN_EVENT_TABLE( WinEDA_ZoneFrame, wxDialog ) BEGIN_EVENT_TABLE( WinEDA_ZoneFrame, wxDialog )
////@begin WinEDA_ZoneFrame event table entries ////@begin WinEDA_ZoneFrame event table entries
EVT_BUTTON( ID_BUTTON, WinEDA_ZoneFrame::ExecFillZone ) EVT_BUTTON( ID_BUTTON, WinEDA_ZoneFrame::ExecFillZone )
EVT_BUTTON( wxID_CANCEL, WinEDA_ZoneFrame::OnCancelClick ) EVT_BUTTON( wxID_CANCEL, WinEDA_ZoneFrame::OnCancelClick )
EVT_RADIOBOX( ID_NET_SORTING_OPTION, WinEDA_ZoneFrame::OnNetSortingOptionSelected ) EVT_RADIOBOX( ID_NET_SORTING_OPTION, WinEDA_ZoneFrame::OnNetSortingOptionSelected )
////@end WinEDA_ZoneFrame event table entries ////@end WinEDA_ZoneFrame event table entries
END_EVENT_TABLE() END_EVENT_TABLE()
/*! /*!
* WinEDA_ZoneFrame constructors * WinEDA_ZoneFrame constructors
*/ */
WinEDA_ZoneFrame::WinEDA_ZoneFrame() WinEDA_ZoneFrame::WinEDA_ZoneFrame()
{ {
} }
WinEDA_ZoneFrame::WinEDA_ZoneFrame( WinEDA_PcbFrame* parent, WinEDA_ZoneFrame::WinEDA_ZoneFrame( WinEDA_PcbFrame* parent,
wxWindowID id, wxWindowID id,
const wxString& caption, const wxString& caption,
const wxPoint& pos, const wxPoint& pos,
const wxSize& size, const wxSize& size,
long style ) long style )
{ {
m_Parent = parent; m_Parent = parent;
Create( parent, id, caption, pos, size, style ); Create( parent, id, caption, pos, size, style );
} }
/*! /*!
* WinEDA_ZoneFrame creator * WinEDA_ZoneFrame creator
*/ */
bool WinEDA_ZoneFrame::Create( wxWindow* parent, bool WinEDA_ZoneFrame::Create( wxWindow* parent,
wxWindowID id, wxWindowID id,
const wxString& caption, const wxString& caption,
const wxPoint& pos, const wxPoint& pos,
const wxSize& size, const wxSize& size,
long style ) long style )
{ {
////@begin WinEDA_ZoneFrame member initialisation ////@begin WinEDA_ZoneFrame member initialisation
m_GridCtrl = NULL; m_GridCtrl = NULL;
m_ClearanceValueTitle = NULL; m_ClearanceValueTitle = NULL;
m_ZoneClearanceCtrl = NULL; m_ZoneClearanceCtrl = NULL;
m_FillOpt = NULL; m_FillOpt = NULL;
m_OrientEdgesOpt = NULL; m_OrientEdgesOpt = NULL;
m_NetSortingOption = NULL; m_NetSortingOption = NULL;
m_ListNetNameSelection = NULL; m_ListNetNameSelection = NULL;
m_LayerSelectionCtrl = NULL; m_LayerSelectionCtrl = NULL;
////@end WinEDA_ZoneFrame member initialisation ////@end WinEDA_ZoneFrame member initialisation
////@begin WinEDA_ZoneFrame creation ////@begin WinEDA_ZoneFrame creation
SetExtraStyle(wxWS_EX_BLOCK_EVENTS); SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
wxDialog::Create( parent, id, caption, pos, size, style ); wxDialog::Create( parent, id, caption, pos, size, style );
CreateControls(); CreateControls();
if (GetSizer()) if (GetSizer())
{ {
GetSizer()->SetSizeHints(this); GetSizer()->SetSizeHints(this);
} }
Centre(); Centre();
////@end WinEDA_ZoneFrame creation ////@end WinEDA_ZoneFrame creation
return true; return true;
} }
/*! /*!
* Control creation for WinEDA_ZoneFrame * Control creation for WinEDA_ZoneFrame
*/ */
void WinEDA_ZoneFrame::CreateControls() void WinEDA_ZoneFrame::CreateControls()
{ {
SetFont( *g_DialogFont ); SetFont( *g_DialogFont );
////@begin WinEDA_ZoneFrame content construction ////@begin WinEDA_ZoneFrame content construction
// Generated by DialogBlocks, 17/12/2007 20:46:19 (unregistered) // Generated by DialogBlocks, 17/12/2007 20:46:19 (unregistered)
WinEDA_ZoneFrame* itemDialog1 = this; WinEDA_ZoneFrame* itemDialog1 = this;
wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
itemDialog1->SetSizer(itemBoxSizer2); itemDialog1->SetSizer(itemBoxSizer2);
wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxVERTICAL); wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer3->Add(itemBoxSizer4, 0, wxGROW|wxALL, 5); itemBoxSizer3->Add(itemBoxSizer4, 0, wxGROW|wxALL, 5);
wxArrayString m_GridCtrlStrings; wxArrayString m_GridCtrlStrings;
m_GridCtrlStrings.Add(_("0.00000")); m_GridCtrlStrings.Add(_("0.00000"));
m_GridCtrlStrings.Add(_("0.00000")); m_GridCtrlStrings.Add(_("0.00000"));
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_RADIOBOX3, _("Grid Size for Filling:"), wxDefaultPosition, wxDefaultSize, m_GridCtrlStrings, 1, wxRA_SPECIFY_COLS );
m_GridCtrl->SetSelection(0); m_GridCtrl->SetSelection(0);
itemBoxSizer4->Add(m_GridCtrl, 0, wxGROW|wxALL, 5); itemBoxSizer4->Add(m_GridCtrl, 0, wxGROW|wxALL, 5);
m_ClearanceValueTitle = new wxStaticText( itemDialog1, wxID_STATIC, _("Zone clearance value (mm):"), wxDefaultPosition, wxDefaultSize, 0 ); m_ClearanceValueTitle = new wxStaticText( itemDialog1, wxID_STATIC, _("Zone clearance value (mm):"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer4->Add(m_ClearanceValueTitle, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); itemBoxSizer4->Add(m_ClearanceValueTitle, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
m_ZoneClearanceCtrl = new wxTextCtrl( itemDialog1, ID_TEXTCTRL1, _T(""), wxDefaultPosition, wxDefaultSize, 0 ); m_ZoneClearanceCtrl = new wxTextCtrl( itemDialog1, ID_TEXTCTRL1, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer4->Add(m_ZoneClearanceCtrl, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); itemBoxSizer4->Add(m_ZoneClearanceCtrl, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5);
itemBoxSizer3->Add(5, 5, 0, wxGROW|wxALL, 5); itemBoxSizer3->Add(5, 5, 0, wxGROW|wxALL, 5);
wxBoxSizer* itemBoxSizer9 = new wxBoxSizer(wxVERTICAL); wxBoxSizer* itemBoxSizer9 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer3->Add(itemBoxSizer9, 0, wxGROW|wxALL, 5); itemBoxSizer3->Add(itemBoxSizer9, 0, wxGROW|wxALL, 5);
wxArrayString m_FillOptStrings; wxArrayString m_FillOptStrings;
m_FillOptStrings.Add(_("Include Pads")); m_FillOptStrings.Add(_("Include Pads"));
m_FillOptStrings.Add(_("Thermal")); m_FillOptStrings.Add(_("Thermal"));
m_FillOptStrings.Add(_("Exclude Pads")); m_FillOptStrings.Add(_("Exclude Pads"));
m_FillOpt = new wxRadioBox( itemDialog1, ID_RADIOBOX4, _("Pad options:"), wxDefaultPosition, wxDefaultSize, m_FillOptStrings, 1, wxRA_SPECIFY_COLS ); m_FillOpt = new wxRadioBox( itemDialog1, ID_RADIOBOX4, _("Pad options:"), wxDefaultPosition, wxDefaultSize, m_FillOptStrings, 1, wxRA_SPECIFY_COLS );
m_FillOpt->SetSelection(0); m_FillOpt->SetSelection(0);
itemBoxSizer9->Add(m_FillOpt, 0, wxGROW|wxALL, 5); itemBoxSizer9->Add(m_FillOpt, 0, wxGROW|wxALL, 5);
wxArrayString m_OrientEdgesOptStrings; wxArrayString m_OrientEdgesOptStrings;
m_OrientEdgesOptStrings.Add(_("Any")); m_OrientEdgesOptStrings.Add(_("Any"));
m_OrientEdgesOptStrings.Add(_("H , V and 45 deg")); 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 = new wxRadioBox( itemDialog1, ID_RADIOBOX5, _("Zone edges orient:"), wxDefaultPosition, wxDefaultSize, m_OrientEdgesOptStrings, 1, wxRA_SPECIFY_COLS );
m_OrientEdgesOpt->SetSelection(0); m_OrientEdgesOpt->SetSelection(0);
itemBoxSizer9->Add(m_OrientEdgesOpt, 0, wxGROW|wxALL, 5); itemBoxSizer9->Add(m_OrientEdgesOpt, 0, wxGROW|wxALL, 5);
itemBoxSizer3->Add(5, 5, 0, wxGROW|wxALL, 5); itemBoxSizer3->Add(5, 5, 0, wxGROW|wxALL, 5);
wxBoxSizer* itemBoxSizer13 = new wxBoxSizer(wxVERTICAL); wxBoxSizer* itemBoxSizer13 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer3->Add(itemBoxSizer13, 0, wxGROW|wxALL, 5); itemBoxSizer3->Add(itemBoxSizer13, 0, wxGROW|wxALL, 5);
wxButton* itemButton14 = new wxButton( itemDialog1, ID_BUTTON, _("Fill"), wxDefaultPosition, wxDefaultSize, 0 ); wxButton* itemButton14 = new wxButton( itemDialog1, ID_BUTTON, _("Fill"), wxDefaultPosition, wxDefaultSize, 0 );
itemButton14->SetDefault(); itemButton14->SetDefault();
itemButton14->SetForegroundColour(wxColour(204, 0, 0)); itemButton14->SetForegroundColour(wxColour(204, 0, 0));
itemBoxSizer13->Add(itemButton14, 0, wxGROW|wxALL, 5); itemBoxSizer13->Add(itemButton14, 0, wxGROW|wxALL, 5);
wxButton* itemButton15 = new wxButton( itemDialog1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); wxButton* itemButton15 = new wxButton( itemDialog1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
itemButton15->SetForegroundColour(wxColour(0, 0, 255)); itemButton15->SetForegroundColour(wxColour(0, 0, 255));
itemBoxSizer13->Add(itemButton15, 0, wxGROW|wxALL, 5); itemBoxSizer13->Add(itemButton15, 0, wxGROW|wxALL, 5);
itemBoxSizer13->Add(5, 5, 1, wxGROW|wxALL, 5); itemBoxSizer13->Add(5, 5, 1, wxGROW|wxALL, 5);
wxArrayString m_NetSortingOptionStrings; wxArrayString m_NetSortingOptionStrings;
m_NetSortingOptionStrings.Add(_("Alphabetic")); m_NetSortingOptionStrings.Add(_("Alphabetic"));
m_NetSortingOptionStrings.Add(_("Advanced")); 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 = new wxRadioBox( itemDialog1, ID_NET_SORTING_OPTION, _("Net sorting:"), wxDefaultPosition, wxDefaultSize, m_NetSortingOptionStrings, 1, wxRA_SPECIFY_COLS );
m_NetSortingOption->SetSelection(0); m_NetSortingOption->SetSelection(0);
itemBoxSizer13->Add(m_NetSortingOption, 0, wxGROW|wxALL, 5); itemBoxSizer13->Add(m_NetSortingOption, 0, wxGROW|wxALL, 5);
wxBoxSizer* itemBoxSizer18 = new wxBoxSizer(wxVERTICAL); wxBoxSizer* itemBoxSizer18 = new wxBoxSizer(wxVERTICAL);
itemBoxSizer2->Add(itemBoxSizer18, 0, wxGROW|wxALL, 5); itemBoxSizer2->Add(itemBoxSizer18, 0, wxGROW|wxALL, 5);
wxStaticText* itemStaticText19 = new wxStaticText( itemDialog1, wxID_STATIC, _("Net:"), wxDefaultPosition, wxDefaultSize, 0 ); wxStaticText* itemStaticText19 = new wxStaticText( itemDialog1, wxID_STATIC, _("Net:"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer18->Add(itemStaticText19, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5); itemBoxSizer18->Add(itemStaticText19, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
wxArrayString m_ListNetNameSelectionStrings; wxArrayString m_ListNetNameSelectionStrings;
m_ListNetNameSelection = new wxListBox( itemDialog1, ID_NETNAME_SELECTION, wxDefaultPosition, wxDefaultSize, m_ListNetNameSelectionStrings, wxLB_SINGLE|wxSUNKEN_BORDER ); 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); itemBoxSizer18->Add(m_ListNetNameSelection, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5);
wxStaticText* itemStaticText21 = new wxStaticText( itemDialog1, wxID_LAYER_SELECTION, _("Layer:"), wxDefaultPosition, wxDefaultSize, 0 ); wxStaticText* itemStaticText21 = new wxStaticText( itemDialog1, wxID_LAYER_SELECTION, _("Layer:"), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer18->Add(itemStaticText21, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5); itemBoxSizer18->Add(itemStaticText21, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);
wxArrayString m_LayerSelectionCtrlStrings; wxArrayString m_LayerSelectionCtrlStrings;
m_LayerSelectionCtrl = new wxListBox( itemDialog1, ID_LAYER_CHOICE, wxDefaultPosition, wxDefaultSize, m_LayerSelectionCtrlStrings, wxLB_SINGLE ); m_LayerSelectionCtrl = new wxListBox( itemDialog1, ID_LAYER_CHOICE, wxDefaultPosition, wxDefaultSize, m_LayerSelectionCtrlStrings, wxLB_SINGLE );
itemBoxSizer18->Add(m_LayerSelectionCtrl, 0, wxGROW|wxALL, 5); itemBoxSizer18->Add(m_LayerSelectionCtrl, 0, wxGROW|wxALL, 5);
// Set validators // Set validators
m_NetSortingOption->SetValidator( wxGenericValidator(& s_NetSortingOpt) ); m_NetSortingOption->SetValidator( wxGenericValidator(& s_NetSortingOpt) );
////@end WinEDA_ZoneFrame content construction ////@end WinEDA_ZoneFrame content construction
wxString title = _( "Zone clearance value:" ) + ReturnUnitSymbol( g_UnitMetric ); wxString title = _( "Zone clearance value:" ) + ReturnUnitSymbol( g_UnitMetric );
m_ClearanceValueTitle->SetLabel( title ); m_ClearanceValueTitle->SetLabel( title );
title = _( "Grid :" ) + ReturnUnitSymbol( g_UnitMetric );; title = _( "Grid :" ) + ReturnUnitSymbol( g_UnitMetric );;
m_GridCtrl->SetLabel( title ); m_GridCtrl->SetLabel( title );
if( g_DesignSettings.m_ZoneClearence == 0 ) if( g_DesignSettings.m_ZoneClearence == 0 )
g_DesignSettings.m_ZoneClearence = g_DesignSettings.m_TrackClearence; g_DesignSettings.m_ZoneClearence = g_DesignSettings.m_TrackClearence;
title = ReturnStringFromValue( g_UnitMetric, title = ReturnStringFromValue( g_UnitMetric,
g_DesignSettings.m_ZoneClearence, g_DesignSettings.m_ZoneClearence,
m_Parent->m_InternalUnits ); m_Parent->m_InternalUnits );
m_ZoneClearanceCtrl->SetValue( title ); m_ZoneClearanceCtrl->SetValue( title );
if( Zone_45_Only ) if( Zone_45_Only )
m_OrientEdgesOpt->SetSelection( 1 ); m_OrientEdgesOpt->SetSelection( 1 );
static const int GridList[4] = { 50, 100, 250, 500 }; static const int GridList[4] = { 50, 100, 250, 500 };
int selection = 0; int selection = 0;
for( unsigned ii = 0; ii < (unsigned) m_GridCtrl->GetCount(); ii++ ) for( unsigned ii = 0; ii < (unsigned) m_GridCtrl->GetCount(); ii++ )
{ {
wxString msg = ReturnStringFromValue( g_UnitMetric, wxString msg = ReturnStringFromValue( g_UnitMetric,
GridList[ii], GridList[ii],
m_Parent->m_InternalUnits ); m_Parent->m_InternalUnits );
m_GridCtrl->SetString( ii, msg ); m_GridCtrl->SetString( ii, msg );
if( g_GridRoutingSize == GridList[ii] ) if( g_GridRoutingSize == GridList[ii] )
selection = ii; selection = ii;
} }
// Initialise options // Initialise options
m_GridCtrl->SetSelection( selection ); m_GridCtrl->SetSelection( selection );
if( Zone_Exclude_Pads ) if( Zone_Exclude_Pads )
{ {
if( s_Zone_Create_Thermal_Relief ) if( s_Zone_Create_Thermal_Relief )
m_FillOpt->SetSelection( 1 ); m_FillOpt->SetSelection( 1 );
else else
m_FillOpt->SetSelection( 2 ); m_FillOpt->SetSelection( 2 );
} }
m_NetSortingOption->SetSelection(s_NetSortingOpt == 0 ? : 1 ); m_NetSortingOption->SetSelection(s_NetSortingOpt == 0 ? : 1 );
int layer_cnt = g_DesignSettings.m_CopperLayerCount; int layer_cnt = g_DesignSettings.m_CopperLayerCount;
for( int ii = 0; ii < g_DesignSettings.m_CopperLayerCount; ii++ ) for( int ii = 0; ii < g_DesignSettings.m_CopperLayerCount; ii++ )
{ {
wxString msg; wxString msg;
int layer_number; int layer_number;
if( layer_cnt == 0 || ii < layer_cnt - 1 ) if( layer_cnt == 0 || ii < layer_cnt - 1 )
layer_number = ii; layer_number = ii;
else if( ii == layer_cnt - 1 ) else if( ii == layer_cnt - 1 )
layer_number = LAYER_CMP_N; layer_number = LAYER_CMP_N;
m_LayerId[ii] = layer_number; m_LayerId[ii] = layer_number;
msg = ReturnPcbLayerName( layer_number ).Trim(); msg = ReturnPcbLayerName( layer_number ).Trim();
m_LayerSelectionCtrl->InsertItems( 1, &msg, ii ); m_LayerSelectionCtrl->InsertItems( 1, &msg, ii );
if( m_Parent->GetScreen()->m_Active_Layer == layer_number ) if( m_Parent->GetScreen()->m_Active_Layer == layer_number )
m_LayerSelectionCtrl->SetSelection( ii ); m_LayerSelectionCtrl->SetSelection( ii );
} }
wxArrayString ListNetName; wxArrayString ListNetName;
m_Parent->m_Pcb->ReturnSortedNetnamesList( ListNetName, m_Parent->m_Pcb->ReturnSortedNetnamesList( ListNetName,
s_NetSortingOpt == 0 ? BOARD::ALPHA_SORT : BOARD::PAD_CNT_SORT ); s_NetSortingOpt == 0 ? BOARD::ALPHA_SORT : BOARD::PAD_CNT_SORT );
m_ListNetNameSelection->InsertItems( ListNetName, 0 ); m_ListNetNameSelection->InsertItems( ListNetName, 0 );
// Select net: // Select net:
if( g_HightLigth_NetCode > 0 ) if( g_HightLigth_NetCode > 0 )
{ {
EQUIPOT* equipot = m_Parent->m_Pcb->FindNet( g_HightLigth_NetCode ); EQUIPOT* equipot = m_Parent->m_Pcb->FindNet( g_HightLigth_NetCode );
if( equipot ) // Search net in list and select it if( equipot ) // Search net in list and select it
{ {
for( unsigned ii = 0; ii < ListNetName.GetCount(); ii++ ) for( unsigned ii = 0; ii < ListNetName.GetCount(); ii++ )
{ {
if( ListNetName[ii] == equipot->m_Netname ) if( ListNetName[ii] == equipot->m_Netname )
{ {
m_ListNetNameSelection->SetSelection( ii ); m_ListNetNameSelection->SetSelection( ii );
break; break;
} }
} }
} }
} }
} }
/*! /*!
* Should we show tooltips? * Should we show tooltips?
*/ */
bool WinEDA_ZoneFrame::ShowToolTips() bool WinEDA_ZoneFrame::ShowToolTips()
{ {
return true; return true;
} }
/*! /*!
* Get bitmap resources * Get bitmap resources
*/ */
wxBitmap WinEDA_ZoneFrame::GetBitmapResource( const wxString& name ) wxBitmap WinEDA_ZoneFrame::GetBitmapResource( const wxString& name )
{ {
// Bitmap retrieval // Bitmap retrieval
////@begin WinEDA_ZoneFrame bitmap retrieval ////@begin WinEDA_ZoneFrame bitmap retrieval
wxUnusedVar(name); wxUnusedVar(name);
return wxNullBitmap; return wxNullBitmap;
////@end WinEDA_ZoneFrame bitmap retrieval ////@end WinEDA_ZoneFrame bitmap retrieval
} }
/*! /*!
* Get icon resources * Get icon resources
*/ */
wxIcon WinEDA_ZoneFrame::GetIconResource( const wxString& name ) wxIcon WinEDA_ZoneFrame::GetIconResource( const wxString& name )
{ {
// Icon retrieval // Icon retrieval
////@begin WinEDA_ZoneFrame icon retrieval ////@begin WinEDA_ZoneFrame icon retrieval
wxUnusedVar(name); wxUnusedVar(name);
return wxNullIcon; return wxNullIcon;
////@end WinEDA_ZoneFrame icon retrieval ////@end WinEDA_ZoneFrame icon retrieval
} }
/*! /*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL * wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
*/ */
void WinEDA_ZoneFrame::OnCancelClick( wxCommandEvent& event ) void WinEDA_ZoneFrame::OnCancelClick( wxCommandEvent& event )
{ {
////@begin wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL in WinEDA_ZoneFrame. ////@begin wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL in WinEDA_ZoneFrame.
// Before editing this code, remove the block markers. // Before editing this code, remove the block markers.
event.Skip(); event.Skip();
////@end wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL in WinEDA_ZoneFrame. ////@end wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL in WinEDA_ZoneFrame.
} }
/*! /*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON2 * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON2
*/ */
/***********************************************************/ /***********************************************************/
void WinEDA_ZoneFrame::ExecFillZone( wxCommandEvent& event ) void WinEDA_ZoneFrame::ExecFillZone( wxCommandEvent& event )
/***********************************************************/ /***********************************************************/
{ {
switch( m_FillOpt->GetSelection() ) switch( m_FillOpt->GetSelection() )
{ {
case 0: case 0:
Zone_Exclude_Pads = FALSE; Zone_Exclude_Pads = FALSE;
s_Zone_Create_Thermal_Relief = FALSE; s_Zone_Create_Thermal_Relief = FALSE;
break; break;
case 1: case 1:
Zone_Exclude_Pads = TRUE; Zone_Exclude_Pads = TRUE;
s_Zone_Create_Thermal_Relief = TRUE; s_Zone_Create_Thermal_Relief = TRUE;
break; break;
case 2: case 2:
Zone_Exclude_Pads = TRUE; Zone_Exclude_Pads = TRUE;
s_Zone_Create_Thermal_Relief = FALSE; s_Zone_Create_Thermal_Relief = FALSE;
break; break;
} }
switch( m_GridCtrl->GetSelection() ) switch( m_GridCtrl->GetSelection() )
{ {
case 0: case 0:
g_GridRoutingSize = 50; g_GridRoutingSize = 50;
break; break;
case 1: case 1:
g_GridRoutingSize = 100; g_GridRoutingSize = 100;
break; break;
case 2: case 2:
g_GridRoutingSize = 250; g_GridRoutingSize = 250;
break; break;
case 3: case 3:
g_GridRoutingSize = 500; g_GridRoutingSize = 500;
break; break;
} }
wxString txtvalue = m_ZoneClearanceCtrl->GetValue(); wxString txtvalue = m_ZoneClearanceCtrl->GetValue();
g_DesignSettings.m_ZoneClearence = g_DesignSettings.m_ZoneClearence =
ReturnValueFromString( g_UnitMetric, txtvalue, m_Parent->m_InternalUnits ); ReturnValueFromString( g_UnitMetric, txtvalue, m_Parent->m_InternalUnits );
if( m_OrientEdgesOpt->GetSelection() == 0 ) if( m_OrientEdgesOpt->GetSelection() == 0 )
Zone_45_Only = FALSE; Zone_45_Only = FALSE;
else else
Zone_45_Only = TRUE; Zone_45_Only = TRUE;
/* Get the layer selection for this zone */ /* Get the layer selection for this zone */
int ii = m_LayerSelectionCtrl->GetSelection(); int ii = m_LayerSelectionCtrl->GetSelection();
if( ii < 0 ) if( ii < 0 )
{ {
DisplayError( this, _( "Error : you must choose a layer" ) ); DisplayError( this, _( "Error : you must choose a layer" ) );
return; return;
} }
s_Zone_Layer = m_LayerId[ii]; s_Zone_Layer = m_LayerId[ii];
/* Get the net name selection for this zone */ /* Get the net name selection for this zone */
ii = m_ListNetNameSelection->GetSelection(); ii = m_ListNetNameSelection->GetSelection();
if( ii < 0 ) if( ii < 0 )
{ {
DisplayError( this, _( "Error : you must choose a net name" ) ); DisplayError( this, _( "Error : you must choose a net name" ) );
return; return;
} }
wxString net_name = m_ListNetNameSelection->GetString( ii ); wxString net_name = m_ListNetNameSelection->GetString( ii );
/* Search net_code for this net */ /* Search net_code for this net */
EQUIPOT* net; EQUIPOT* net;
s_NetcodeSelection = 0; s_NetcodeSelection = 0;
for( net = m_Parent->m_Pcb->m_Equipots; net; net = net->Next() ) for( net = m_Parent->m_Pcb->m_Equipots; net; net = net->Next() )
{ {
if( net->m_Netname == net_name ) if( net->m_Netname == net_name )
{ {
s_NetcodeSelection = net->GetNet(); s_NetcodeSelection = net->GetNet();
break; break;
} }
} }
EndModal( 0 ); EndModal( 0 );
} }
/*! /*!
* wxEVT_COMMAND_RADIOBOX_SELECTED event handler for ID_NET_SORTING_OPTION * wxEVT_COMMAND_RADIOBOX_SELECTED event handler for ID_NET_SORTING_OPTION
*/ */
void WinEDA_ZoneFrame::OnNetSortingOptionSelected( wxCommandEvent& event ) void WinEDA_ZoneFrame::OnNetSortingOptionSelected( wxCommandEvent& event )
{ {
wxArrayString ListNetName; wxArrayString ListNetName;
s_NetSortingOpt = m_NetSortingOption->GetSelection(); s_NetSortingOpt = m_NetSortingOption->GetSelection();
m_Parent->m_Pcb->ReturnSortedNetnamesList( ListNetName, m_Parent->m_Pcb->ReturnSortedNetnamesList( ListNetName,
s_NetSortingOpt == 0 ? BOARD::ALPHA_SORT : BOARD::PAD_CNT_SORT ); s_NetSortingOpt == 0 ? BOARD::ALPHA_SORT : BOARD::PAD_CNT_SORT );
m_ListNetNameSelection->Clear(); m_ListNetNameSelection->Clear();
m_ListNetNameSelection->InsertItems( ListNetName, 0 ); m_ListNetNameSelection->InsertItems( ListNetName, 0 );
} }

View File

@ -1,130 +1,130 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: dialog_zones_by_polygon.h // Name: dialog_zones_by_polygon.h
// Purpose: // Purpose:
// Author: jean-pierre Charras // Author: jean-pierre Charras
// Modified by: // Modified by:
// Created: 25/01/2006 11:35:19 // Created: 25/01/2006 11:35:19
// RCS-ID: // RCS-ID:
// Copyright: GNU License // Copyright: GNU License
// Licence: // Licence:
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 25/01/2006 11:35:19 // Generated by DialogBlocks (unregistered), 25/01/2006 11:35:19
#ifndef DIALOG_ZONES_H_ #ifndef DIALOG_ZONES_H_
#define DIALOG_ZONES_H_ #define DIALOG_ZONES_H_
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma interface "dialog_zones_by_polygon.h" #pragma interface "dialog_zones_by_polygon.h"
#endif #endif
/*! /*!
* Includes * Includes
*/ */
////@begin includes ////@begin includes
#include "wx/valgen.h" #include "wx/valgen.h"
////@end includes ////@end includes
/*! /*!
* Forward declarations * Forward declarations
*/ */
////@begin forward declarations ////@begin forward declarations
////@end forward declarations ////@end forward declarations
/*! /*!
* Control identifiers * Control identifiers
*/ */
////@begin control identifiers ////@begin control identifiers
#define ID_DIALOG 10000 #define ID_DIALOG 10000
#define ID_RADIOBOX3 10003 #define ID_RADIOBOX3 10003
#define ID_TEXTCTRL1 10007 #define ID_TEXTCTRL1 10007
#define ID_RADIOBOX4 10008 #define ID_RADIOBOX4 10008
#define ID_RADIOBOX5 10009 #define ID_RADIOBOX5 10009
#define ID_BUTTON 10010 #define ID_BUTTON 10010
#define ID_NET_SORTING_OPTION 10005 #define ID_NET_SORTING_OPTION 10005
#define ID_NETNAME_SELECTION 10001 #define ID_NETNAME_SELECTION 10001
#define wxID_LAYER_SELECTION 10004 #define wxID_LAYER_SELECTION 10004
#define ID_LAYER_CHOICE 10002 #define ID_LAYER_CHOICE 10002
#define SYMBOL_WINEDA_ZONEFRAME_STYLE wxCAPTION|wxSYSTEM_MENU|wxCLOSE_BOX|MAYBE_RESIZE_BORDER #define SYMBOL_WINEDA_ZONEFRAME_STYLE wxCAPTION|wxSYSTEM_MENU|wxCLOSE_BOX|MAYBE_RESIZE_BORDER
#define SYMBOL_WINEDA_ZONEFRAME_TITLE _("Fill Zones Options") #define SYMBOL_WINEDA_ZONEFRAME_TITLE _("Fill Zones Options")
#define SYMBOL_WINEDA_ZONEFRAME_IDNAME ID_DIALOG #define SYMBOL_WINEDA_ZONEFRAME_IDNAME ID_DIALOG
#define SYMBOL_WINEDA_ZONEFRAME_SIZE wxSize(400, 300) #define SYMBOL_WINEDA_ZONEFRAME_SIZE wxSize(400, 300)
#define SYMBOL_WINEDA_ZONEFRAME_POSITION wxDefaultPosition #define SYMBOL_WINEDA_ZONEFRAME_POSITION wxDefaultPosition
////@end control identifiers ////@end control identifiers
/*! /*!
* Compatibility * Compatibility
*/ */
#ifndef wxCLOSE_BOX #ifndef wxCLOSE_BOX
#define wxCLOSE_BOX 0x1000 #define wxCLOSE_BOX 0x1000
#endif #endif
/*! /*!
* WinEDA_ZoneFrame class declaration * WinEDA_ZoneFrame class declaration
*/ */
class WinEDA_ZoneFrame: public wxDialog class WinEDA_ZoneFrame: public wxDialog
{ {
DECLARE_DYNAMIC_CLASS( WinEDA_ZoneFrame ) DECLARE_DYNAMIC_CLASS( WinEDA_ZoneFrame )
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
public: public:
/// Constructors /// Constructors
WinEDA_ZoneFrame( ); WinEDA_ZoneFrame( );
WinEDA_ZoneFrame( WinEDA_PcbFrame* parent, wxWindowID id = SYMBOL_WINEDA_ZONEFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_ZONEFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_ZONEFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_ZONEFRAME_SIZE, long style = SYMBOL_WINEDA_ZONEFRAME_STYLE ); WinEDA_ZoneFrame( WinEDA_PcbFrame* parent, wxWindowID id = SYMBOL_WINEDA_ZONEFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_ZONEFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_ZONEFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_ZONEFRAME_SIZE, long style = SYMBOL_WINEDA_ZONEFRAME_STYLE );
/// Creation /// Creation
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WINEDA_ZONEFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_ZONEFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_ZONEFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_ZONEFRAME_SIZE, long style = SYMBOL_WINEDA_ZONEFRAME_STYLE ); bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WINEDA_ZONEFRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_ZONEFRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_ZONEFRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_ZONEFRAME_SIZE, long style = SYMBOL_WINEDA_ZONEFRAME_STYLE );
/// Creates the controls and sizers /// Creates the controls and sizers
void CreateControls(); void CreateControls();
////@begin WinEDA_ZoneFrame event handler declarations ////@begin WinEDA_ZoneFrame event handler declarations
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON
void ExecFillZone( wxCommandEvent& event ); void ExecFillZone( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
void OnCancelClick( wxCommandEvent& event ); void OnCancelClick( wxCommandEvent& event );
/// wxEVT_COMMAND_RADIOBOX_SELECTED event handler for ID_NET_SORTING_OPTION /// wxEVT_COMMAND_RADIOBOX_SELECTED event handler for ID_NET_SORTING_OPTION
void OnNetSortingOptionSelected( wxCommandEvent& event ); void OnNetSortingOptionSelected( wxCommandEvent& event );
////@end WinEDA_ZoneFrame event handler declarations ////@end WinEDA_ZoneFrame event handler declarations
////@begin WinEDA_ZoneFrame member function declarations ////@begin WinEDA_ZoneFrame member function declarations
/// Retrieves bitmap resources /// Retrieves bitmap resources
wxBitmap GetBitmapResource( const wxString& name ); wxBitmap GetBitmapResource( const wxString& name );
/// Retrieves icon resources /// Retrieves icon resources
wxIcon GetIconResource( const wxString& name ); wxIcon GetIconResource( const wxString& name );
////@end WinEDA_ZoneFrame member function declarations ////@end WinEDA_ZoneFrame member function declarations
/// Should we show tooltips? /// Should we show tooltips?
static bool ShowToolTips(); static bool ShowToolTips();
////@begin WinEDA_ZoneFrame member variables ////@begin WinEDA_ZoneFrame member variables
wxRadioBox* m_GridCtrl; wxRadioBox* m_GridCtrl;
wxStaticText* m_ClearanceValueTitle; wxStaticText* m_ClearanceValueTitle;
wxTextCtrl* m_ZoneClearanceCtrl; wxTextCtrl* m_ZoneClearanceCtrl;
wxRadioBox* m_FillOpt; wxRadioBox* m_FillOpt;
wxRadioBox* m_OrientEdgesOpt; wxRadioBox* m_OrientEdgesOpt;
wxRadioBox* m_NetSortingOption; wxRadioBox* m_NetSortingOption;
wxListBox* m_ListNetNameSelection; wxListBox* m_ListNetNameSelection;
wxListBox* m_LayerSelectionCtrl; wxListBox* m_LayerSelectionCtrl;
////@end WinEDA_ZoneFrame member variables ////@end WinEDA_ZoneFrame member variables
WinEDA_PcbFrame * m_Parent; WinEDA_PcbFrame * m_Parent;
int m_LayerId[LAYER_COUNT]; // Handle the real layer number from layer name position in m_LayerSelectionCtrl int m_LayerId[LAYER_COUNT]; // Handle the real layer number from layer name position in m_LayerSelectionCtrl
}; };
#endif // DIALOG_ZONES_H_ #endif // DIALOG_ZONES_H_

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff