Commit ca51c6eb authored by charras's avatar charras

use wxFormBuilder in dialog zone, and minor enhancements

parent b18eedb4
No preview for this file type
This diff is collapsed.
......@@ -41,6 +41,8 @@ set(PCBNEW_SRCS
cotation.cpp
cross-probing.cpp
deltrack.cpp
dialog_copper_zones.cpp
dialog_copper_zones_frame.cpp
# dialog_display_options.cpp
# dialog_drc.cpp
dialog_edit_mod_text.cpp
......@@ -57,7 +59,6 @@ set(PCBNEW_SRCS
dialog_setup_libs.cpp
dialog_orient_footprints.cpp
# dialog_track_options.cpp
# dialog_zones_by_polygon.cpp
dist.cpp
dragsegm.cpp
drc.cpp
......
......@@ -332,7 +332,10 @@ int ZONE_CONTAINER::ReadDescr( FILE* aFile, int* aLineNum )
}
if( !IsOnCopperLayer() )
{
m_GridFillValue = 0;
SetNet( 0 );
}
return error ? 0 : 1;
}
......
/* dialog_copper_zones.h */
#ifndef DIALOG_COPPER_ZONES
#define DIALOG_COPPER_ZONES
#include "dialog_copper_zones_frame.h"
/* here is the derivated class from dialog_copper_zone_frame created by wxFormBuilder
*/
class dialog_copper_zone: public dialog_copper_zone_frame
{
public:
WinEDA_PcbFrame* m_Parent;
ZONE_CONTAINER * m_Zone_Container;
long m_NetSorting;
int m_LayerId[LAYER_COUNT]; // Handle the real layer number from layer name position in m_LayerSelectionCtrl
public:
dialog_copper_zone( WinEDA_PcbFrame* parent, ZONE_CONTAINER * zone_container);
void OnInitDialog( wxInitDialogEvent& event );
void OnButtonOkClick( wxCommandEvent& event );
void OnButtonCancelClick( wxCommandEvent& event );
bool AcceptOptions(bool aPromptForErrors);
void OnNetSortingOptionSelected( wxCommandEvent& event );
};
#endif // #ifndef DIALOG_COPPER_ZONES
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_copper_zones_frame.h"
///////////////////////////////////////////////////////////////////////////
BEGIN_EVENT_TABLE( dialog_copper_zone_frame, wxDialog )
EVT_INIT_DIALOG( dialog_copper_zone_frame::_wxFB_OnInitDialog )
EVT_BUTTON( wxID_OK, dialog_copper_zone_frame::_wxFB_OnButtonOkClick )
EVT_BUTTON( wxID_CANCEL, dialog_copper_zone_frame::_wxFB_OnButtonCancelClick )
EVT_RADIOBOX( ID_NET_SORTING_OPTION, dialog_copper_zone_frame::_wxFB_OnNetSortingOptionSelected )
END_EVENT_TABLE()
dialog_copper_zone_frame::dialog_copper_zone_frame( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* m_MainBoxSize;
m_MainBoxSize = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* m_OptionsBoxSizer;
m_OptionsBoxSizer = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* m_LeftBoxSizer;
m_LeftBoxSizer = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* m_FillOptionsBox;
m_FillOptionsBox = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Zone Fill Options:") ), wxVERTICAL );
wxString m_GridCtrlChoices[] = { _("0.00000"), _("0.00000"), _("0.00000"), _("0.00000"), _("No Grid (For tests only!)") };
int m_GridCtrlNChoices = sizeof( m_GridCtrlChoices ) / sizeof( wxString );
m_GridCtrl = new wxRadioBox( this, ID_RADIOBOX_GRID_SELECTION, _("Grid Size for Filling:"), wxDefaultPosition, wxDefaultSize, m_GridCtrlNChoices, m_GridCtrlChoices, 1, wxRA_SPECIFY_COLS );
m_GridCtrl->SetSelection( 4 );
m_FillOptionsBox->Add( m_GridCtrl, 0, wxALL, 5 );
m_ClearanceValueTitle = new wxStaticText( this, wxID_ANY, _("Zone clearance value (mm):"), wxDefaultPosition, wxDefaultSize, 0 );
m_ClearanceValueTitle->Wrap( -1 );
m_FillOptionsBox->Add( m_ClearanceValueTitle, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_ZoneClearanceCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_FillOptionsBox->Add( m_ZoneClearanceCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
wxString m_FillOptChoices[] = { _("Include Pads"), _("Thermal Relief"), _("Exclude Pads") };
int m_FillOptNChoices = sizeof( m_FillOptChoices ) / sizeof( wxString );
m_FillOpt = new wxRadioBox( this, wxID_ANY, _("Pad in Zone:"), wxDefaultPosition, wxDefaultSize, m_FillOptNChoices, m_FillOptChoices, 1, wxRA_SPECIFY_COLS );
m_FillOpt->SetSelection( 1 );
m_FillOptionsBox->Add( m_FillOpt, 0, wxALL|wxEXPAND, 5 );
m_LeftBoxSizer->Add( m_FillOptionsBox, 1, wxEXPAND, 5 );
m_OptionsBoxSizer->Add( m_LeftBoxSizer, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
m_OptionsBoxSizer->Add( 5, 5, 0, wxEXPAND, 5 );
wxBoxSizer* m_MiddleBoxSizer;
m_MiddleBoxSizer = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* m_OutilinesBoxOpt;
m_OutilinesBoxOpt = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Outlines Options:") ), wxVERTICAL );
wxString m_OutlineAppearanceCtrlChoices[] = { _("Line"), _("Hatched Outline"), _("Full Hatched") };
int m_OutlineAppearanceCtrlNChoices = sizeof( m_OutlineAppearanceCtrlChoices ) / sizeof( wxString );
m_OutlineAppearanceCtrl = new wxRadioBox( this, ID_RADIOBOX_OUTLINES_OPTION, _("Outlines Appearance"), wxDefaultPosition, wxDefaultSize, m_OutlineAppearanceCtrlNChoices, m_OutlineAppearanceCtrlChoices, 1, wxRA_SPECIFY_COLS );
m_OutlineAppearanceCtrl->SetSelection( 0 );
m_OutilinesBoxOpt->Add( m_OutlineAppearanceCtrl, 0, wxALL|wxEXPAND, 5 );
m_OutilinesBoxOpt->Add( 5, 5, 0, 0, 5 );
wxString m_OrientEdgesOptChoices[] = { _("Any"), _("H , V and 45 deg") };
int m_OrientEdgesOptNChoices = sizeof( m_OrientEdgesOptChoices ) / sizeof( wxString );
m_OrientEdgesOpt = new wxRadioBox( this, wxID_ANY, _("Zone edges orient:"), wxDefaultPosition, wxDefaultSize, m_OrientEdgesOptNChoices, m_OrientEdgesOptChoices, 1, wxRA_SPECIFY_COLS );
m_OrientEdgesOpt->SetSelection( 0 );
m_OutilinesBoxOpt->Add( m_OrientEdgesOpt, 0, wxALL, 5 );
m_MiddleBoxSizer->Add( m_OutilinesBoxOpt, 1, wxEXPAND, 5 );
m_OptionsBoxSizer->Add( m_MiddleBoxSizer, 0, 0, 5 );
m_OptionsBoxSizer->Add( 0, 0, 0, wxEXPAND, 5 );
wxBoxSizer* m_RightBoxSizer;
m_RightBoxSizer = new wxBoxSizer( wxVERTICAL );
m_OkButton = new wxButton( this, wxID_OK, _("Ok"), wxDefaultPosition, wxDefaultSize, 0 );
m_RightBoxSizer->Add( m_OkButton, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
m_ButtonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
m_RightBoxSizer->Add( m_ButtonCancel, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
m_RightBoxSizer->Add( 5, 20, 0, wxEXPAND, 5 );
wxStaticBoxSizer* m_NetSortOptSizer;
m_NetSortOptSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Nets Display Options:") ), wxVERTICAL );
wxString m_NetSortingOptionChoices[] = { _("Alphabetic"), _("Advanced") };
int m_NetSortingOptionNChoices = sizeof( m_NetSortingOptionChoices ) / sizeof( wxString );
m_NetSortingOption = new wxRadioBox( this, ID_NET_SORTING_OPTION, _("Net sorting:"), wxDefaultPosition, wxDefaultSize, m_NetSortingOptionNChoices, m_NetSortingOptionChoices, 1, wxRA_SPECIFY_COLS );
m_NetSortingOption->SetSelection( 0 );
m_NetSortOptSizer->Add( m_NetSortingOption, 0, wxALL|wxEXPAND, 5 );
m_staticText5 = new wxStaticText( this, wxID_ANY, _("Filter"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText5->Wrap( -1 );
m_NetSortOptSizer->Add( m_staticText5, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_NetNameFilter = new wxTextCtrl( this, ID_TEXTCTRL_NETNAMES_FILTER, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_NetSortOptSizer->Add( m_NetNameFilter, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_RightBoxSizer->Add( m_NetSortOptSizer, 1, wxEXPAND, 5 );
m_OptionsBoxSizer->Add( m_RightBoxSizer, 0, wxALIGN_CENTER_VERTICAL, 5 );
m_MainBoxSize->Add( m_OptionsBoxSizer, 0, 0, 5 );
wxBoxSizer* m_NetAndLayersLiastBoxSizer;
m_NetAndLayersLiastBoxSizer = new wxBoxSizer( wxVERTICAL );
m_staticText2 = new wxStaticText( this, wxID_ANY, _("Net:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText2->Wrap( -1 );
m_NetAndLayersLiastBoxSizer->Add( m_staticText2, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_ListNetNameSelection = new wxListBox( this, ID_NETNAME_SELECTION, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
m_NetAndLayersLiastBoxSizer->Add( m_ListNetNameSelection, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_staticText3 = new wxStaticText( this, wxID_ANY, _("Layer:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText3->Wrap( -1 );
m_NetAndLayersLiastBoxSizer->Add( m_staticText3, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_LayerSelectionCtrl = new wxListBox( this, ID_LAYER_CHOICE, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
m_NetAndLayersLiastBoxSizer->Add( m_LayerSelectionCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_MainBoxSize->Add( m_NetAndLayersLiastBoxSizer, 0, wxEXPAND, 5 );
this->SetSizer( m_MainBoxSize );
this->Layout();
}
dialog_copper_zone_frame::~dialog_copper_zone_frame()
{
}
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_copper_zones_frame.cpp.h"
///////////////////////////////////////////////////////////////////////////
BEGIN_EVENT_TABLE( dialog_copper_zone_frame, wxDialog )
EVT_INIT_DIALOG( dialog_copper_zone_frame::_wxFB_OnInitDialog )
EVT_BUTTON( wxID_OK, dialog_copper_zone_frame::_wxFB_OnOkButtonClick )
EVT_BUTTON( wxID_CANCEL, dialog_copper_zone_frame::_wxFB_OnButtonCancleClick )
EVT_RADIOBOX( ID_NET_SORTING_OPTION, dialog_copper_zone_frame::_wxFB_OnNetSortingOptionSelected )
END_EVENT_TABLE()
dialog_copper_zone_frame::dialog_copper_zone_frame( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* m_MainBoxSize;
m_MainBoxSize = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* m_OptionsBoxSizer;
m_OptionsBoxSizer = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* m_LeftBoxSizer;
m_LeftBoxSizer = new wxBoxSizer( wxVERTICAL );
wxString m_GridCtrlChoices[] = { _("0.00000"), _("0.00000"), _("0.00000"), _("0.00000"), _("|No Grid (For tests only!)") };
int m_GridCtrlNChoices = sizeof( m_GridCtrlChoices ) / sizeof( wxString );
m_GridCtrl = new wxRadioBox( this, ID_RADIOBOX_GRID_SELECTION, _("Grid Size for Filling:"), wxDefaultPosition, wxDefaultSize, m_GridCtrlNChoices, m_GridCtrlChoices, 1, wxRA_SPECIFY_COLS );
m_GridCtrl->SetSelection( 4 );
m_LeftBoxSizer->Add( m_GridCtrl, 0, wxALL, 5 );
m_ClearanceValueTitle = new wxStaticText( this, wxID_ANY, _("Zone clearance value (mm):"), wxDefaultPosition, wxDefaultSize, 0 );
m_ClearanceValueTitle->Wrap( -1 );
m_LeftBoxSizer->Add( m_ClearanceValueTitle, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_ZoneClearanceCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_LeftBoxSizer->Add( m_ZoneClearanceCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
wxString m_OutlineAppearanceCtrlChoices[] = { _("Line"), _("Hatched Outline"), _("Full Hatched") };
int m_OutlineAppearanceCtrlNChoices = sizeof( m_OutlineAppearanceCtrlChoices ) / sizeof( wxString );
m_OutlineAppearanceCtrl = new wxRadioBox( this, ID_RADIOBOX_OUTLINES_OPTION, _("Outlines Appearance"), wxDefaultPosition, wxDefaultSize, m_OutlineAppearanceCtrlNChoices, m_OutlineAppearanceCtrlChoices, 1, wxRA_SPECIFY_COLS );
m_OutlineAppearanceCtrl->SetSelection( 0 );
m_LeftBoxSizer->Add( m_OutlineAppearanceCtrl, 0, wxALL|wxEXPAND, 5 );
m_OptionsBoxSizer->Add( m_LeftBoxSizer, 1, wxEXPAND, 5 );
wxBoxSizer* m_MiddleBoxSizer;
m_MiddleBoxSizer = new wxBoxSizer( wxVERTICAL );
wxString m_FillOptChoices[] = { _("Include Pads"), _("Thermal"), _("Exclude Pads") };
int m_FillOptNChoices = sizeof( m_FillOptChoices ) / sizeof( wxString );
m_FillOpt = new wxRadioBox( this, wxID_ANY, _("Pad options:"), wxDefaultPosition, wxDefaultSize, m_FillOptNChoices, m_FillOptChoices, 1, wxRA_SPECIFY_COLS );
m_FillOpt->SetSelection( 1 );
m_MiddleBoxSizer->Add( m_FillOpt, 0, wxALL|wxEXPAND, 5 );
m_MiddleBoxSizer->Add( 0, 0, 1, wxEXPAND, 5 );
wxString m_OrientEdgesOptChoices[] = { _("Any"), _("H , V and 45 deg") };
int m_OrientEdgesOptNChoices = sizeof( m_OrientEdgesOptChoices ) / sizeof( wxString );
m_OrientEdgesOpt = new wxRadioBox( this, wxID_ANY, _("Zone edges orient:"), wxDefaultPosition, wxDefaultSize, m_OrientEdgesOptNChoices, m_OrientEdgesOptChoices, 1, wxRA_SPECIFY_COLS );
m_OrientEdgesOpt->SetSelection( 0 );
m_MiddleBoxSizer->Add( m_OrientEdgesOpt, 0, wxALL|wxEXPAND, 5 );
m_OptionsBoxSizer->Add( m_MiddleBoxSizer, 1, wxEXPAND, 5 );
m_OptionsBoxSizer->Add( 0, 0, 1, wxEXPAND, 5 );
wxBoxSizer* m_RightBoxSizer;
m_RightBoxSizer = new wxBoxSizer( wxVERTICAL );
m_OkButton = new wxButton( this, wxID_OK, _("Ok"), wxDefaultPosition, wxDefaultSize, 0 );
m_RightBoxSizer->Add( m_OkButton, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
m_ButtonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
m_RightBoxSizer->Add( m_ButtonCancel, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
m_RightBoxSizer->Add( 0, 0, 1, wxEXPAND, 5 );
wxString m_NetSortingOptionChoices[] = { _("Alphabetic"), _("Advanced") };
int m_NetSortingOptionNChoices = sizeof( m_NetSortingOptionChoices ) / sizeof( wxString );
m_NetSortingOption = new wxRadioBox( this, ID_NET_SORTING_OPTION, _("Net sorting:"), wxDefaultPosition, wxDefaultSize, m_NetSortingOptionNChoices, m_NetSortingOptionChoices, 1, wxRA_SPECIFY_COLS );
m_NetSortingOption->SetSelection( 0 );
m_RightBoxSizer->Add( m_NetSortingOption, 0, wxALL|wxEXPAND, 5 );
m_staticText5 = new wxStaticText( this, wxID_ANY, _("Filter"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText5->Wrap( -1 );
m_RightBoxSizer->Add( m_staticText5, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_NetNameFilter = new wxTextCtrl( this, ID_TEXTCTRL_NETNAMES_FILTER, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_RightBoxSizer->Add( m_NetNameFilter, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_OptionsBoxSizer->Add( m_RightBoxSizer, 1, wxEXPAND, 5 );
m_MainBoxSize->Add( m_OptionsBoxSizer, 1, wxEXPAND, 5 );
wxBoxSizer* m_NetAndLayersLiastBoxSizer;
m_NetAndLayersLiastBoxSizer = new wxBoxSizer( wxVERTICAL );
m_staticText2 = new wxStaticText( this, wxID_ANY, _("Net:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText2->Wrap( -1 );
m_NetAndLayersLiastBoxSizer->Add( m_staticText2, 0, wxALL, 5 );
m_ListNetNameSelection = new wxListBox( this, ID_NETNAME_SELECTION, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
m_NetAndLayersLiastBoxSizer->Add( m_ListNetNameSelection, 0, wxALL|wxEXPAND, 5 );
m_staticText3 = new wxStaticText( this, wxID_ANY, _("Layer:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText3->Wrap( -1 );
m_NetAndLayersLiastBoxSizer->Add( m_staticText3, 0, wxALL, 5 );
m_LayerSelectionCtrl = new wxListBox( this, ID_LAYER_CHOICE, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
m_NetAndLayersLiastBoxSizer->Add( m_LayerSelectionCtrl, 0, wxALL|wxEXPAND, 5 );
m_MainBoxSize->Add( m_NetAndLayersLiastBoxSizer, 1, wxEXPAND, 5 );
this->SetSizer( m_MainBoxSize );
this->Layout();
}
dialog_copper_zone_frame::~dialog_copper_zone_frame()
{
}
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_copper_zones_frame__
#define __dialog_copper_zones_frame__
#include <wx/intl.h>
#include <wx/string.h>
#include <wx/radiobox.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/stattext.h>
#include <wx/textctrl.h>
#include <wx/sizer.h>
#include <wx/button.h>
#include <wx/listbox.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class dialog_copper_zone_frame
///////////////////////////////////////////////////////////////////////////////
class dialog_copper_zone_frame : public wxDialog
{
DECLARE_EVENT_TABLE()
private:
// Private event handlers
void _wxFB_OnInitDialog( wxInitDialogEvent& event ){ OnInitDialog( event ); }
void _wxFB_OnOkButtonClick( wxCommandEvent& event ){ OnOkButtonClick( event ); }
void _wxFB_OnButtonCancleClick( wxCommandEvent& event ){ OnButtonCancleClick( event ); }
void _wxFB_OnNetSortingOptionSelected( wxCommandEvent& event ){ OnNetSortingOptionSelected( event ); }
protected:
enum
{
ID_RADIOBOX_GRID_SELECTION = 1000,
ID_RADIOBOX_OUTLINES_OPTION,
ID_NET_SORTING_OPTION,
ID_TEXTCTRL_NETNAMES_FILTER,
ID_NETNAME_SELECTION,
ID_LAYER_CHOICE,
};
wxRadioBox* m_GridCtrl;
wxStaticText* m_ClearanceValueTitle;
wxTextCtrl* m_ZoneClearanceCtrl;
wxRadioBox* m_OutlineAppearanceCtrl;
wxRadioBox* m_FillOpt;
wxRadioBox* m_OrientEdgesOpt;
wxButton* m_OkButton;
wxButton* m_ButtonCancel;
wxRadioBox* m_NetSortingOption;
wxStaticText* m_staticText5;
wxTextCtrl* m_NetNameFilter;
wxStaticText* m_staticText2;
wxListBox* m_ListNetNameSelection;
wxStaticText* m_staticText3;
wxListBox* m_LayerSelectionCtrl;
// Virtual event handlers, overide them in your derived class
virtual void OnInitDialog( wxInitDialogEvent& event ){ event.Skip(); }
virtual void OnOkButtonClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonCancleClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnNetSortingOptionSelected( wxCommandEvent& event ){ event.Skip(); }
public:
dialog_copper_zone_frame( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 578,567 ), long style = wxDEFAULT_DIALOG_STYLE );
~dialog_copper_zone_frame();
};
#endif //__dialog_copper_zones_frame__
This diff is collapsed.
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_copper_zones_frame__
#define __dialog_copper_zones_frame__
#include <wx/intl.h>
#include <wx/string.h>
#include <wx/radiobox.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/stattext.h>
#include <wx/textctrl.h>
#include <wx/sizer.h>
#include <wx/statbox.h>
#include <wx/button.h>
#include <wx/listbox.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class dialog_copper_zone_frame
///////////////////////////////////////////////////////////////////////////////
class dialog_copper_zone_frame : public wxDialog
{
DECLARE_EVENT_TABLE()
private:
// Private event handlers
void _wxFB_OnInitDialog( wxInitDialogEvent& event ){ OnInitDialog( event ); }
void _wxFB_OnButtonOkClick( wxCommandEvent& event ){ OnButtonOkClick( event ); }
void _wxFB_OnButtonCancelClick( wxCommandEvent& event ){ OnButtonCancelClick( event ); }
void _wxFB_OnNetSortingOptionSelected( wxCommandEvent& event ){ OnNetSortingOptionSelected( event ); }
protected:
enum
{
ID_RADIOBOX_GRID_SELECTION = 1000,
ID_RADIOBOX_OUTLINES_OPTION,
ID_NET_SORTING_OPTION,
ID_TEXTCTRL_NETNAMES_FILTER,
ID_NETNAME_SELECTION,
ID_LAYER_CHOICE,
};
wxRadioBox* m_GridCtrl;
wxStaticText* m_ClearanceValueTitle;
wxTextCtrl* m_ZoneClearanceCtrl;
wxRadioBox* m_FillOpt;
wxRadioBox* m_OutlineAppearanceCtrl;
wxRadioBox* m_OrientEdgesOpt;
wxButton* m_OkButton;
wxButton* m_ButtonCancel;
wxRadioBox* m_NetSortingOption;
wxStaticText* m_staticText5;
wxTextCtrl* m_NetNameFilter;
wxStaticText* m_staticText2;
wxListBox* m_ListNetNameSelection;
wxStaticText* m_staticText3;
wxListBox* m_LayerSelectionCtrl;
// Virtual event handlers, overide them in your derived class
virtual void OnInitDialog( wxInitDialogEvent& event ){ event.Skip(); }
virtual void OnButtonOkClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonCancelClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnNetSortingOptionSelected( wxCommandEvent& event ){ event.Skip(); }
public:
dialog_copper_zone_frame( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Fill Zones Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 452,493 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSUNKEN_BORDER );
~dialog_copper_zone_frame();
};
#endif //__dialog_copper_zones_frame__
/////////////////////////////////////////////////////////////////////////////
// Name: dialog_zones_by_polygon.h
// Purpose:
// Author: jean-pierre Charras
// Modified by:
// Created: 25/01/2006 11:35:19
// RCS-ID:
// Copyright: GNU License
// Licence:
/////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 25/01/2006 11:35:19
#ifndef DIALOG_ZONES_H_
#define DIALOG_ZONES_H_
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma interface "dialog_zones_by_polygon.h"
#endif
/*!
* Includes
*/
////@begin includes
#include "wx/valgen.h"
////@end includes
/*!
* Forward declarations
*/
////@begin forward declarations
////@end forward declarations
/*!
* Control identifiers
*/
////@begin control identifiers
#define ID_DIALOG 10000
#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_NET_SORTING_OPTION 10005
#define ID_TEXTCTRL_NETNAMES_FILTER 10010
#define ID_NETNAME_SELECTION 10001
#define wxID_LAYER_SELECTION 10004
#define ID_LAYER_CHOICE 10002
#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_IDNAME ID_DIALOG
#define SYMBOL_WINEDA_ZONEFRAME_SIZE wxSize(400, 300)
#define SYMBOL_WINEDA_ZONEFRAME_POSITION wxDefaultPosition
////@end control identifiers
/*!
* Compatibility
*/
#ifndef wxCLOSE_BOX
#define wxCLOSE_BOX 0x1000
#endif
/*!
* WinEDA_ZoneFrame class declaration
*/
class WinEDA_ZoneFrame: public wxDialog
{
DECLARE_DYNAMIC_CLASS( WinEDA_ZoneFrame )
DECLARE_EVENT_TABLE()
public:
/// Constructors
WinEDA_ZoneFrame( );
WinEDA_ZoneFrame( WinEDA_PcbFrame* parent,
ZONE_CONTAINER * zone_container,
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
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
void CreateControls();
////@begin WinEDA_ZoneFrame event handler declarations
/// wxEVT_INIT_DIALOG event handler for ID_DIALOG
void OnInitDialog( wxInitDialogEvent& 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 );
/// wxEVT_COMMAND_RADIOBOX_SELECTED event handler for ID_NET_SORTING_OPTION
void OnNetSortingOptionSelected( wxCommandEvent& event );
////@end WinEDA_ZoneFrame event handler declarations
////@begin WinEDA_ZoneFrame member function declarations
/// Retrieves bitmap resources
wxBitmap GetBitmapResource( const wxString& name );
/// Retrieves icon resources
wxIcon GetIconResource( const wxString& name );
////@end WinEDA_ZoneFrame member function declarations
/// 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;
wxTextCtrl* m_NetNameFilter;
wxListBox* m_ListNetNameSelection;
wxListBox* m_LayerSelectionCtrl;
////@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
ZONE_CONTAINER * m_Zone_Container;
};
#endif // DIALOG_ZONES_H_
This diff is collapsed.
......@@ -22,6 +22,8 @@ OBJECTS= $(TARGET).o classpcb.o\
$(SPECCTRA_TOOLS)\
lay2plot.o\
dialog_freeroute_exchange.o\
dialog_copper_zones_frame.o\
dialog_copper_zones.o\
dialog_non_copper_zones_properties.o\
zones_non_copper_type_functions.o\
modedit_undo_redo.o\
......@@ -297,7 +299,9 @@ graphpcb.o: graphpcb.cpp cell.h autorout.h $(COMMON)
zones.o: zones.cpp cell.h $(COMMON)
zones_by_polygon.o: zones_by_polygon.cpp dialog_zones_by_polygon.cpp dialog_zones_by_polygon.h $(COMMON)
zones_by_polygon.o: zones_by_polygon.cpp $(COMMON)
undelete.o: undelete.cpp $(COMMON)
......
......@@ -400,6 +400,12 @@ void WinEDA_PcbFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
case TYPEDRAWSEGMENT:
break;
case TYPEZONE_CONTAINER:
if( DrawStruct->m_Flags )
break;
Edit_Zone_Params( &dc, (ZONE_CONTAINER*) DrawStruct );
break;
default:
break;
}
......
......@@ -31,7 +31,14 @@ eda_global bool g_Zone_45_Only
= FALSE
#endif
;
eda_global int g_NetcodeSelection; // Net code selection for the current zone
eda_global int g_CurrentZone_Layer; // Layer used to create the current zone
eda_global int g_Zone_Hatching; // Option to show the zone area (outlines only, short hatches or full hatches
eda_global ZONE_CONTAINER::m_PadInZone g_Zone_Pad_Options
#ifdef MAIN
= ZONE_CONTAINER::THERMAL_PAD
#endif
;
#endif // ifndef ZONES_H
......@@ -48,15 +48,13 @@ static void Show_Zone_Corner_Or_Outline_While_Move_Mouse( WinEDA_DrawPanel* pane
bool erase );
/* Local variables */
static ZONE_CONTAINER::m_PadInZone s_Zone_Pad_Options = ZONE_CONTAINER::THERMAL_PAD;
static int s_NetcodeSelection; // Net code selection for the current zone
static wxPoint s_CornerInitialPosition; // Used to abort a move corner command
static bool s_CornerIsNew; // Used to abort a move corner command (if it is a new corner, it must be deleted)
static bool s_AddCutoutToCurrentZone; // if true, the next outline will be addes to s_CurrentZone
static ZONE_CONTAINER* s_CurrentZone; // if != NULL, these ZONE_CONTAINER params will be used for the next zone
static wxPoint s_CursorLastPosition; // in move zone outline, last cursor position. Used to calculate the move vector
#include "dialog_zones_by_polygon.cpp"
#include "dialog_copper_zones.h"
/**********************************************************************************/
void WinEDA_PcbFrame::Add_Similar_Zone( wxDC* DC, ZONE_CONTAINER* zone_container )
......@@ -225,7 +223,7 @@ void WinEDA_PcbFrame::Start_Move_Zone_Corner( wxDC* DC, ZONE_CONTAINER* zone_con
Hight_Light( DC ); // Remove old hightlight selection
}
g_HightLigth_NetCode = s_NetcodeSelection = zone_container->GetNet();
g_HightLigth_NetCode = g_NetcodeSelection = zone_container->GetNet();
if( DC )
Hight_Light( DC );
}
......@@ -278,7 +276,7 @@ void WinEDA_PcbFrame::Start_Move_Zone_Outlines( wxDC* DC, ZONE_CONTAINER* zone_c
Hight_Light( DC ); // Remove old hightlight selection
}
g_HightLigth_NetCode = s_NetcodeSelection = zone_container->GetNet();
g_HightLigth_NetCode = g_NetcodeSelection = zone_container->GetNet();
Hight_Light( DC );
}
......@@ -518,14 +516,14 @@ int WinEDA_PcbFrame::Begin_Zone( wxDC* DC )
zone->SetLayer( ( (PCB_SCREEN*) GetScreen() )->m_Active_Layer );
if( zone->IsOnCopperLayer() )
{ // Put a zone on a copper layer
WinEDA_ZoneFrame* frame = new WinEDA_ZoneFrame( this, zone );
dialog_copper_zone* frame = new dialog_copper_zone( this, zone );
diag = frame->ShowModal();
frame->Destroy();
}
else // Put a zone on a non copper layer (technical layer)
{
diag = InstallDialogNonCopperZonesEditor( this, zone );
s_NetcodeSelection = 0; // No net for non copper zones
g_NetcodeSelection = 0; // No net for non copper zones
}
DrawPanel->MouseToCursorSchema();
DrawPanel->m_IgnoreMouseEvents = FALSE;
......@@ -545,14 +543,14 @@ int WinEDA_PcbFrame::Begin_Zone( wxDC* DC )
/* Show the Net for zones on copper layers */
if( g_CurrentZone_Layer < FIRST_NO_COPPER_LAYER )
{
if( g_HightLigt_Status && (g_HightLigth_NetCode != s_NetcodeSelection) )
if( g_HightLigt_Status && (g_HightLigth_NetCode != g_NetcodeSelection) )
{
Hight_Light( DC ); // Remove old hightlight selection
}
if( s_CurrentZone )
s_NetcodeSelection = s_CurrentZone->GetNet();
g_HightLigth_NetCode = s_NetcodeSelection;
g_NetcodeSelection = s_CurrentZone->GetNet();
g_HightLigth_NetCode = g_NetcodeSelection;
Hight_Light( DC );
}
if( !s_AddCutoutToCurrentZone )
......@@ -564,9 +562,9 @@ int WinEDA_PcbFrame::Begin_Zone( wxDC* DC )
{
zone->m_Flags = IS_NEW;
zone->SetLayer( g_CurrentZone_Layer );
zone->SetNet( s_NetcodeSelection );
zone->SetNet( g_NetcodeSelection );
zone->m_TimeStamp = GetTimeStamp();
zone->m_PadOption = s_Zone_Pad_Options;
zone->m_PadOption = g_Zone_Pad_Options;
zone->m_ZoneClearance = g_DesignSettings.m_ZoneClearence;
zone->m_GridFillValue = g_GridRoutingSize;
zone->m_Poly->Start( g_CurrentZone_Layer,
......@@ -758,7 +756,7 @@ void WinEDA_PcbFrame::Edit_Zone_Params( wxDC* DC, ZONE_CONTAINER* zone_container
DrawPanel->m_IgnoreMouseEvents = TRUE;
if( zone_container->GetLayer() < FIRST_NO_COPPER_LAYER )
{ // edit a zone on a copper layer
WinEDA_ZoneFrame* frame = new WinEDA_ZoneFrame( this, zone_container );
dialog_copper_zone* frame = new dialog_copper_zone( this, zone_container );
diag = frame->ShowModal();
frame->Destroy();
}
......@@ -779,12 +777,12 @@ void WinEDA_PcbFrame::Edit_Zone_Params( wxDC* DC, ZONE_CONTAINER* zone_container
}
zone_container->SetLayer( g_CurrentZone_Layer );
zone_container->SetNet( s_NetcodeSelection );
EQUIPOT* net = m_Pcb->FindNet( s_NetcodeSelection );
zone_container->SetNet( g_NetcodeSelection );
EQUIPOT* net = m_Pcb->FindNet( g_NetcodeSelection );
if( net )
zone_container->m_Netname = net->m_Netname;
zone_container->m_Poly->SetHatch( g_Zone_Hatching );
zone_container->m_PadOption = s_Zone_Pad_Options;
zone_container->m_PadOption = g_Zone_Pad_Options;
zone_container->m_ZoneClearance = g_DesignSettings.m_ZoneClearence;
zone_container->m_GridFillValue = g_GridRoutingSize;
......@@ -858,13 +856,13 @@ int WinEDA_PcbFrame::Fill_Zone( wxDC* DC, ZONE_CONTAINER* zone_container, bool v
}
/* Show the Net */
s_NetcodeSelection = zone_container->GetNet();
if( g_HightLigt_Status && (g_HightLigth_NetCode != s_NetcodeSelection) && DC )
g_NetcodeSelection = zone_container->GetNet();
if( g_HightLigt_Status && (g_HightLigth_NetCode != g_NetcodeSelection) && DC )
{
Hight_Light( DC ); // Remove old hightlight selection
}
g_HightLigth_NetCode = s_NetcodeSelection;
g_HightLigth_NetCode = g_NetcodeSelection;
if( DC )
Hight_Light( DC );
......@@ -892,6 +890,7 @@ int WinEDA_PcbFrame::Fill_Zone( wxDC* DC, ZONE_CONTAINER* zone_container, bool v
int error_level = 0;
if( zone_container->m_GridFillValue == 0 )
{
zone_container->m_FilledPolysList.clear();
zone_container->BuildFilledPolysListData( m_Pcb );
if ( DC )
DrawPanel->Refresh();
......@@ -936,7 +935,6 @@ int WinEDA_PcbFrame::Fill_All_Zones( wxDC* DC, bool verbose )
for( int ii = 0; ii < m_Pcb->GetAreaCount(); ii++ )
{
zone_container = m_Pcb->GetArea( ii );
zone_container->m_FilledPolysList.clear();
error_level = Fill_Zone( NULL, zone_container, verbose );
if( error_level && !verbose )
break;
......
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