32#include <wx/statbox.h>
33#include <wx/statline.h>
34#include <wx/radiobut.h>
82#define MIN_THICKNESS 10*pcbIUScale.IU_PER_MILS
88 m_outlineHatchPitch( aParent, m_stBorderHatchPitchText,
89 m_outlineHatchPitchCtrl, m_outlineHatchUnits ),
90 m_minWidth( aParent, m_MinWidthLabel, m_MinWidthCtrl, m_MinWidthUnits ),
91 m_hatchRotation( aParent, m_hatchOrientLabel, m_hatchOrientCtrl, m_hatchOrientUnits ),
92 m_hatchWidth( aParent, m_hatchWidthLabel, m_hatchWidthCtrl, m_hatchWidthUnits),
93 m_hatchGap( aParent, m_hatchGapLabel, m_hatchGapCtrl, m_hatchGapUnits ),
95 m_cornerRadius( aParent, m_cornerRadiusLabel, m_cornerRadiusCtrl, m_cornerRadiusUnits ),
96 m_convertSettings( aConvertSettings ),
97 m_rbCenterline( nullptr ),
98 m_rbEnvelope( nullptr ),
99 m_cbDeleteOriginals( nullptr )
106 if( aConvertSettings )
108 wxStaticBox* bConvertBox =
new wxStaticBox(
this, wxID_ANY,
_(
"Conversion Settings" ) );
109 wxStaticBoxSizer* bConvertSizer =
new wxStaticBoxSizer( bConvertBox, wxVERTICAL );
111 m_rbCenterline =
new wxRadioButton(
this, wxID_ANY,
_(
"Use centerlines" ) );
114 bConvertSizer->AddSpacer( 2 );
115 m_rbEnvelope =
new wxRadioButton(
this, wxID_ANY,
_(
"Create bounding hull" ) );
116 bConvertSizer->Add(
m_rbEnvelope, 0, wxLEFT|wxRIGHT, 5 );
118 bConvertSizer->AddSpacer( 6 );
120 _(
"Delete source objects after conversion" ) );
123 GetSizer()->Insert( 0, bConvertSizer, 0, wxALL|wxEXPAND, 10 );
125 wxStaticLine* line =
new wxStaticLine(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
127 GetSizer()->Insert( 1, line, 0, wxLEFT|wxRIGHT|wxEXPAND, 10 );
129 SetTitle(
_(
"Convert to Non Copper Zone" ) );
183 case ZONE_BORDER_DISPLAY_STYLE::INVISIBLE_BORDER:
break;
192 case ZONE_FILL_MODE::HATCH_PATTERN:
m_GridStyleCtrl->SetSelection( 1 );
break;
223 wxCommandEvent event;
245 if( event.GetColumn() != 0 )
248 int row =
m_layers->ItemToRow( event.GetItem() );
249 bool val =
m_layers->GetToggleValue( row, 0 );
252 m_layers->GetValue( layerID, row, 2 );
317 for(
int ii = 0; ii <
m_layers->GetItemCount(); ++ii )
319 if(
m_layers->GetToggleValue( (
unsigned) ii, 0 ) )
constexpr EDA_IU_SCALE pcbIUScale
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)
int m_cornerSmoothingType
void OnStyleSelection(wxCommandEvent &event) override
CONVERT_SETTINGS * m_convertSettings
wxCheckBox * m_cbDeleteOriginals
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