34#include <wx/statbox.h>
35#include <wx/statline.h>
36#include <wx/radiobut.h>
38#define LAYER_LIST_COLUMN_CHECK 0
39#define LAYER_LIST_COLUMN_ICON 1
40#define LAYER_LIST_COLUMN_NAME 2
41#define LAYER_LIST_ROW_ALL_INNER_LAYERS 1
80 return dlg.ShowModal();
88 m_outlineHatchPitch( aParent, m_stBorderHatchPitchText,
89 m_outlineHatchPitchCtrl, m_outlineHatchUnits ),
90 m_convertSettings( aConvertSettings ),
91 m_rbCenterline( nullptr ),
92 m_rbBoundingHull( nullptr ),
93 m_cbDeleteOriginals( nullptr )
100 if( aConvertSettings )
102 wxStaticBox* bConvertBox =
new wxStaticBox(
this, wxID_ANY,
103 _(
"Conversion Settings" ) );
104 wxStaticBoxSizer* bConvertSizer =
new wxStaticBoxSizer( bConvertBox, wxVERTICAL );
106 m_rbCenterline =
new wxRadioButton(
this, wxID_ANY,
_(
"Use centerlines" ) );
109 bConvertSizer->AddSpacer( 2 );
110 m_rbBoundingHull =
new wxRadioButton(
this, wxID_ANY,
_(
"Create bounding hull" ) );
113 m_gapLabel =
new wxStaticText(
this, wxID_ANY,
_(
"Gap:" ) );
114 m_gapCtrl =
new wxTextCtrl(
this, wxID_ANY );
115 m_gapUnits =
new wxStaticText(
this, wxID_ANY,
_(
"mm" ) );
118 wxBoxSizer* hullParamsSizer =
new wxBoxSizer( wxHORIZONTAL );
119 hullParamsSizer->Add(
m_gapLabel, 0, wxALIGN_CENTRE_VERTICAL, 5 );
120 hullParamsSizer->Add(
m_gapCtrl, 1, wxALIGN_CENTRE_VERTICAL|wxLEFT|wxRIGHT, 3 );
121 hullParamsSizer->Add(
m_gapUnits, 0, wxALIGN_CENTRE_VERTICAL, 5 );
123 bConvertSizer->AddSpacer( 2 );
124 bConvertSizer->Add( hullParamsSizer, 0, wxLEFT, 26 );
126 bConvertSizer->AddSpacer( 6 );
128 _(
"Delete source objects after conversion" ) );
131 GetSizer()->Insert( 0, bConvertSizer, 0, wxALL|wxEXPAND, 10 );
133 wxStaticLine* line =
new wxStaticLine(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
135 GetSizer()->Insert( 1, line, 0, wxLEFT|wxRIGHT|wxEXPAND, 10 );
137 SetTitle(
_(
"Convert to Rule Area" ) );
191 case ZONE_BORDER_DISPLAY_STYLE::INVISIBLE_BORDER:
227 if( event.GetColumn() != 0 )
230 int row =
m_layers->ItemToRow( event.GetItem() );
constexpr EDA_IU_SCALE pcbIUScale
BASE_SET & set(size_t pos)
Information pertinent to a Pcbnew printed circuit board.
int GetCopperLayerCount() const
Class DIALOG_RULE_AREA_PROPERTIES_BASE.
wxRadioBox * m_rbRuleType
wxStyledTextCtrl * m_ruleText
wxCheckBox * m_cbViasCtrl
wxCheckBox * m_cbPadsCtrl
wxChoice * m_OutlineDisplayCtrl
wxCheckBox * m_cbCopperPourCtrl
wxFlexGridSizer * m_placementRuleSizer
wxCheckBox * m_cbTracksCtrl
wxDataViewListCtrl * m_layers
wxCheckBox * m_cbFootprintsCtrl
wxFlexGridSizer * m_keepoutRuleSizer
void OnRuleTypeSelect(wxCommandEvent &event) override
void OnLayerSelection(wxDataViewEvent &event) override
PCB_BASE_FRAME * m_parent
wxStaticText * m_gapUnits
ZONE_SETTINGS m_zonesettings
the working copy of zone settings
UNIT_BINDER m_outlineHatchPitch
bool TransferDataFromWindow() override
ZONE_SETTINGS * m_ptr
the pointer to the zone settings of the zone to edit
wxRadioButton * m_rbCenterline
wxStaticText * m_gapLabel
wxCheckBox * m_cbDeleteOriginals
bool TransferDataToWindow() override
wxRadioButton * m_rbBoundingHull
CONVERT_SETTINGS * m_convertSettings
DIALOG_RULE_AREA_PROPERTIES(PCB_BASE_FRAME *aParent, ZONE_SETTINGS *aSettings, CONVERT_SETTINGS *aConvertSettings)
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
LSET is a set of PCB_LAYER_IDs.
static LSET AllNonCuMask()
Return a mask holding all layer minus CU layers.
static LSET InternalCuMask()
Return a complete set of internal copper layers which is all Cu layers except F_Cu and B_Cu.
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
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.
bool GetDoNotAllowCopperPour() const
void SetIsRuleArea(bool aEnable)
RULE_AREA_TYPE GetRuleAreaType() const
const wxString & GetRuleAreaExpression() const
bool GetDoNotAllowTracks() const
void SetDoNotAllowVias(bool aEnable)
bool GetDoNotAllowFootprints() const
bool GetDoNotAllowPads() const
void SetDoNotAllowTracks(bool aEnable)
bool GetDoNotAllowVias() const
void SetupLayersList(wxDataViewListCtrl *aList, PCB_BASE_FRAME *aFrame, LSET aLayers, bool aFpEditorMode)
A helper routine for the various zone dialogs (copper, non-copper, keepout).
void SetDoNotAllowFootprints(bool aEnable)
void SetDoNotAllowPads(bool aEnable)
void SetRuleAreaType(RULE_AREA_TYPE aType)
ZONE_BORDER_DISPLAY_STYLE m_ZoneBorderDisplayStyle
Option to show the zone area (outlines only, short hatches or full hatches.
void SetRuleAreaExpression(const wxString &aExpr)
void SetDoNotAllowCopperPour(bool aEnable)
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.
#define LAYER_LIST_ROW_ALL_INNER_LAYERS
int InvokeRuleAreaEditor(PCB_BASE_FRAME *aCaller, ZONE_SETTINGS *aZoneSettings, CONVERT_SETTINGS *aConvertSettings)
Function InvokeRuleAreaEditor invokes up a modal dialog window for copper zone editing.
#define LAYER_LIST_COLUMN_NAME
#define LAYER_LIST_COLUMN_CHECK
PCB_LAYER_ID ToLAYER_ID(int aLayer)
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