39#include <wx/statbox.h>
40#include <wx/statline.h>
41#include <wx/radiobut.h>
43#define LAYER_LIST_COLUMN_CHECK 0
44#define LAYER_LIST_COLUMN_ICON 1
45#define LAYER_LIST_COLUMN_NAME 2
46#define LAYER_LIST_ROW_ALL_INNER_LAYERS 1
147 if( aConvertSettings )
149 wxStaticBox* bConvertBox =
new wxStaticBox(
this, wxID_ANY,
150 _(
"Conversion Settings" ) );
151 wxStaticBoxSizer* bConvertSizer =
new wxStaticBoxSizer( bConvertBox, wxVERTICAL );
153 m_rbCenterline =
new wxRadioButton(
this, wxID_ANY,
_(
"Use centerlines" ) );
156 bConvertSizer->AddSpacer( 2 );
157 m_rbBoundingHull =
new wxRadioButton(
this, wxID_ANY,
_(
"Create bounding hull" ) );
160 m_gapLabel =
new wxStaticText(
this, wxID_ANY,
_(
"Gap:" ) );
161 m_gapCtrl =
new wxTextCtrl(
this, wxID_ANY );
162 m_gapUnits =
new wxStaticText(
this, wxID_ANY,
_(
"mm" ) );
165 wxBoxSizer* hullParamsSizer =
new wxBoxSizer( wxHORIZONTAL );
166 hullParamsSizer->Add(
m_gapLabel, 0, wxALIGN_CENTRE_VERTICAL, 5 );
167 hullParamsSizer->Add(
m_gapCtrl, 1, wxALIGN_CENTRE_VERTICAL|wxLEFT|wxRIGHT, 3 );
168 hullParamsSizer->Add(
m_gapUnits, 0, wxALIGN_CENTRE_VERTICAL, 5 );
170 bConvertSizer->AddSpacer( 2 );
171 bConvertSizer->Add( hullParamsSizer, 0, wxLEFT, 26 );
173 bConvertSizer->AddSpacer( 6 );
175 _(
"Delete source objects after conversion" ) );
178 GetSizer()->Insert( 0, bConvertSizer, 0, wxALL|wxEXPAND, 10 );
180 wxStaticLine* line =
new wxStaticLine(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
182 GetSizer()->Insert( 1, line, 0, wxLEFT|wxRIGHT|wxEXPAND, 10 );
184 SetTitle(
_(
"Convert to Rule Area" ) );
269 std::set<wxString> classNames;
271 for(
const wxString& className :
m_board->GetComponentClassManager().GetClassNames() )
272 classNames.insert( className );
274 for(
const wxString& sourceName : classNames )
277 if( !classNames.empty() )
281 std::set<wxString> sheetNames;
282 std::set<wxString> groupNames;
286 sheetNames.insert( fp->GetSheetname() );
288 if( fp->GetParentGroup() && !fp->GetParentGroup()->GetName().IsEmpty() )
289 groupNames.insert( fp->GetParentGroup()->GetName() );
292 for(
const wxString& sourceName : sheetNames )
295 for(
const wxString& groupName : groupNames )
298 if( !sheetNames.empty() )
301 if( !groupNames.empty() )
305 auto setupCurrentSourceSelection = [&]( wxComboBox* cb )
307 if( curSourceName == wxEmptyString )
310 if( !cb->SetStringSelection( curSourceName ) )
314 wxString notFoundDisplayName =
_(
"Not found on board: " ) + curSourceName;
315 cb->Insert( notFoundDisplayName, 0 );
377 if( event.GetColumn() != 0 )
380 int row =
m_layers->ItemToRow( event.GetItem() );
385 const auto setSelectedLayer = [&]()
447 auto setPlacementSource =
461 int selectedSourceIdx = cb->GetSelection();
463 if( selectedSourceIdx != wxNOT_FOUND )
472 m_zonesettings.SetPlacementAreaSource( cb->GetString( selectedSourceIdx ) );
constexpr EDA_IU_SCALE pcbIUScale
Information pertinent to a Pcbnew printed circuit board.
int GetCopperLayerCount() const
wxNotebook * m_areaPropertiesNb
wxTextCtrl * m_outlineHatchPitchCtrl
wxStaticText * m_stBorderHatchPitchText
wxChoice * m_OutlineDisplayCtrl
wxStaticText * m_outlineHatchUnits
wxDataViewListCtrl * m_layers
DIALOG_RULE_AREA_PROPERTIES_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Rule Area Properties"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(708, 471), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxFULL_REPAINT_ON_RESIZE|wxBORDER_SUNKEN)
void OnLayerSelection(wxDataViewEvent &event) override
wxString m_notFoundPlacementSourceName
PCB_BASE_FRAME * m_parent
wxStaticText * m_gapUnits
ZONE_SETTINGS m_zonesettings
the working copy of zone settings
bool m_notFoundPlacementSource
UNIT_BINDER m_outlineHatchPitch
bool TransferDataFromWindow() override
void OnSheetNameClicked(wxCommandEvent &event)
PANEL_RULE_AREA_PROPERTIES_KEEPOUT_BASE * m_keepoutProperties
ZONE_SETTINGS * m_ptr
the pointer to the zone settings of the zone to edit
~DIALOG_RULE_AREA_PROPERTIES()
wxRadioButton * m_rbCenterline
wxStaticText * m_gapLabel
PLACEMENT_SOURCE_T m_originalPlacementSourceType
PANEL_RULE_AREA_PROPERTIES_PLACEMENT_BASE * m_placementProperties
wxCheckBox * m_cbDeleteOriginals
void OnGroupClicked(wxCommandEvent &event)
bool TransferDataToWindow() override
DIALOG_RULE_AREA_PROPERTIES(PCB_BASE_FRAME *aParent, ZONE_SETTINGS *aSettings, CONVERT_SETTINGS *aConvertSettings, BOARD *aBoard)
void OnComponentClassClicked(wxCommandEvent &event)
PLACEMENT_SOURCE_T m_lastPlacementSourceType
wxRadioButton * m_rbBoundingHull
CONVERT_SETTINGS * m_convertSettings
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...
FRAME_T GetFrameType() const
LSET is a set of PCB_LAYER_IDs.
static LSET AllNonCuMask()
Return a mask holding all layer minus CU layers.
static LSET AllCuMask()
return AllCuMask( MAX_CU_LAYERS );
static const LSET & InternalCuMask()
Return a complete set of internal copper layers which is all Cu layers except F_Cu and B_Cu.
Class PANEL_RULE_AREA_PROPERTIES_KEEPOUT_BASE.
Class PANEL_RULE_AREA_PROPERTIES_PLACEMENT_BASE.
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
ZONE_SETTINGS handles zones parameters.
void DisplayError(wxWindow *aParent, const wxString &aText)
Display an error or warning message box with aMessage.
This file is part of the common library.
#define LAYER_LIST_ROW_ALL_INNER_LAYERS
#define LAYER_LIST_COLUMN_NAME
#define LAYER_LIST_COLUMN_CHECK
int InvokeRuleAreaEditor(PCB_BASE_FRAME *aCaller, ZONE_SETTINGS *aZoneSettings, BOARD *aBoard, CONVERT_SETTINGS *aConvertSettings)
Function InvokeRuleAreaEditor invokes up a modal dialog window for copper zone editing.
PCB_LAYER_ID ToLAYER_ID(int aLayer)
Class ZONE_SETTINGS used to handle zones parameters in dialogs.
#define ZONE_BORDER_HATCH_MINDIST_MM
#define ZONE_BORDER_HATCH_MAXDIST_MM