32#include <wx/statbox.h>
33#include <wx/statline.h>
34#include <wx/radiobut.h>
89#define MIN_THICKNESS 10*pcbIUScale.IU_PER_MILS
95 m_outlineHatchPitch( aParent, m_stBorderHatchPitchText,
96 m_outlineHatchPitchCtrl, m_outlineHatchUnits ),
97 m_minWidth( aParent, m_MinWidthLabel, m_MinWidthCtrl, m_MinWidthUnits ),
98 m_hatchRotation( aParent, m_hatchOrientLabel, m_hatchOrientCtrl, m_hatchOrientUnits ),
99 m_hatchWidth( aParent, m_hatchWidthLabel, m_hatchWidthCtrl, m_hatchWidthUnits),
100 m_hatchGap( aParent, m_hatchGapLabel, m_hatchGapCtrl, m_hatchGapUnits ),
102 m_cornerRadius( aParent, m_cornerRadiusLabel, m_cornerRadiusCtrl, m_cornerRadiusUnits ),
103 m_convertSettings( aConvertSettings ),
104 m_rbCenterline( nullptr ),
105 m_rbEnvelope( nullptr ),
106 m_cbDeleteOriginals( nullptr )
113 if( aConvertSettings )
115 wxStaticBox* bConvertBox =
new wxStaticBox(
this, wxID_ANY,
_(
"Conversion Settings" ) );
116 wxStaticBoxSizer* bConvertSizer =
new wxStaticBoxSizer( bConvertBox, wxVERTICAL );
118 m_rbCenterline =
new wxRadioButton(
this, wxID_ANY,
_(
"Use centerlines" ) );
121 bConvertSizer->AddSpacer( 2 );
122 m_rbEnvelope =
new wxRadioButton(
this, wxID_ANY,
_(
"Create bounding hull" ) );
123 bConvertSizer->Add(
m_rbEnvelope, 0, wxLEFT|wxRIGHT, 5 );
125 m_gapLabel =
new wxStaticText(
this, wxID_ANY,
_(
"Gap:" ) );
126 m_gapCtrl =
new wxTextCtrl(
this, wxID_ANY );
127 m_gapUnits =
new wxStaticText(
this, wxID_ANY,
_(
"mm" ) );
131 wxBoxSizer* hullParamsSizer =
new wxBoxSizer( wxHORIZONTAL );
132 hullParamsSizer->Add(
m_gapLabel, 0, wxALIGN_CENTRE_VERTICAL|wxRIGHT, 5 );
133 hullParamsSizer->Add(
m_gapCtrl, 1, wxALIGN_CENTRE_VERTICAL|wxLEFT|wxRIGHT, 5 );
134 hullParamsSizer->Add(
m_gapUnits, 0, wxALIGN_CENTRE_VERTICAL|wxLEFT, 5 );
135 bConvertSizer->AddSpacer( 2 );
136 bConvertSizer->Add( hullParamsSizer, 0, wxLEFT, 26 );
138 bConvertSizer->AddSpacer( 6 );
140 _(
"Delete source objects after conversion" ) );
143 GetSizer()->Insert( 0, bConvertSizer, 0, wxALL|wxEXPAND, 10 );
145 wxStaticLine* line =
new wxStaticLine(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
147 GetSizer()->Insert( 1, line, 0, wxLEFT|wxRIGHT|wxEXPAND, 10 );
149 SetTitle(
_(
"Convert to Non Copper Zone" ) );
215 case ZONE_BORDER_DISPLAY_STYLE::INVISIBLE_BORDER:
break;
224 case ZONE_FILL_MODE::HATCH_PATTERN:
m_GridStyleCtrl->SetSelection( 1 );
break;
255 wxCommandEvent event;
277 if( event.GetColumn() != 0 )
280 int row =
m_layers->ItemToRow( event.GetItem() );
281 bool val =
m_layers->GetToggleValue( row, 0 );
284 m_layers->GetValue( layerID, row, 2 );
350 for(
int ii = 0; ii <
m_layers->GetItemCount(); ++ii )
352 if(
m_layers->GetToggleValue( (
unsigned) ii, 0 ) )
constexpr EDA_IU_SCALE pcbIUScale
BASE_SET & set(size_t pos)
Class DIALOG_NONCOPPER_ZONES_PROPERTIES_BASE.
wxStaticText * m_smoothValueLabel
wxStaticText * m_cornerRadiusLabel
wxStaticText * m_smoothLevelLabel
wxStaticText * m_staticTextLayerSelection
wxSpinCtrl * m_spinCtrlSmoothLevel
wxSpinCtrlDouble * m_spinCtrlSmoothValue
wxChoice * m_cornerSmoothingChoice
wxTextCtrl * m_cornerRadiusCtrl
wxChoice * m_OutlineDisplayCtrl
wxDataViewListCtrl * m_layers
wxChoice * m_GridStyleCtrl
wxRadioButton * m_rbEnvelope
UNIT_BINDER m_cornerRadius
bool TransferDataFromWindow() override
void OnUpdateUI(wxUpdateUIEvent &) override
UNIT_BINDER m_hatchRotation
wxRadioButton * m_rbCenterline
bool TransferDataToWindow() override
DIALOG_NON_COPPER_ZONES_EDITOR(PCB_BASE_FRAME *aParent, ZONE_SETTINGS *aSettings, CONVERT_SETTINGS *aConvertSettings)
wxStaticText * m_gapUnits
int m_cornerSmoothingType
void OnStyleSelection(wxCommandEvent &event) override
~DIALOG_NON_COPPER_ZONES_EDITOR()
CONVERT_SETTINGS * m_convertSettings
wxCheckBox * m_cbDeleteOriginals
wxStaticText * m_gapLabel
PCB_BASE_FRAME * m_parent
UNIT_BINDER m_outlineHatchPitch
void OnLayerSelection(wxDataViewEvent &event) override
void SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
void SetupStandardButtons(std::map< int, wxString > aLabels={})
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
bool IsType(FRAME_T aType) const
static LSET AllNonCuMask()
Return a mask holding all layer minus CU layers.
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
virtual long long int GetValue()
Return the current value in Internal Units.
void Enable(bool aEnable)
Enable/disable the label, widget and units label.
virtual void SetUnits(EDA_UNITS aUnits)
Normally not needed (as the UNIT_BINDER inherits from the parent frame), but can be used to set to DE...
virtual EDA_ANGLE GetAngleValue()
virtual void SetAngleValue(const EDA_ANGLE &aValue)
virtual bool Validate(double aMin, double aMax, EDA_UNITS aUnits=EDA_UNITS::UNSCALED)
Validate the control against the given range, informing the user of any errors found.
virtual void SetValue(long long int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
ZONE_SETTINGS handles zones parameters.
EDA_ANGLE m_HatchOrientation
double m_HatchSmoothingValue
void SetCornerRadius(int aRadius)
void SetupLayersList(wxDataViewListCtrl *aList, PCB_BASE_FRAME *aFrame, LSET aLayers, bool aFpEditorMode)
A helper routine for the various zone dialogs (copper, non-copper, keepout).
int GetCornerSmoothingType() const
ZONE_FILL_MODE m_FillMode
void SetCornerSmoothingType(int aType)
int m_HatchSmoothingLevel
unsigned int GetCornerRadius() const
ZONE_BORDER_DISPLAY_STYLE m_ZoneBorderDisplayStyle
Option to show the zone area (outlines only, short hatches or full hatches.
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
This file is part of the common library.
int InvokeNonCopperZonesEditor(PCB_BASE_FRAME *aParent, ZONE_SETTINGS *aSettings, CONVERT_SETTINGS *aConvertSettings)
Function InvokeNonCopperZonesEditor invokes up a modal dialog window for non-copper zone editing.
PCB_LAYER_ID ToLAYER_ID(int aLayer)
KICOMMON_API wxFont GetInfoFont(wxWindow *aWindow)
CONVERT_STRATEGY m_Strategy
constexpr int mmToIU(double mm) const
Class ZONE_SETTINGS used to handle zones parameters in dialogs.
#define ZONE_BORDER_HATCH_MINDIST_MM
#define ZONE_BORDER_HATCH_MAXDIST_MM