36#include <wx/statbox.h>
37#include <wx/statline.h>
38#include <wx/radiobut.h>
40#define LAYER_LIST_COLUMN_CHECK 0
41#define LAYER_LIST_COLUMN_ICON 1
42#define LAYER_LIST_COLUMN_NAME 2
43#define LAYER_LIST_ROW_ALL_INNER_LAYERS 1
145 if( aConvertSettings )
147 wxStaticBox* bConvertBox =
new wxStaticBox(
this, wxID_ANY,
148 _(
"Conversion Settings" ) );
149 wxStaticBoxSizer* bConvertSizer =
new wxStaticBoxSizer( bConvertBox, wxVERTICAL );
151 m_rbCenterline =
new wxRadioButton(
this, wxID_ANY,
_(
"Use centerlines" ) );
154 bConvertSizer->AddSpacer( 2 );
155 m_rbBoundingHull =
new wxRadioButton(
this, wxID_ANY,
_(
"Create bounding hull" ) );
158 m_gapLabel =
new wxStaticText(
this, wxID_ANY,
_(
"Gap:" ) );
159 m_gapCtrl =
new wxTextCtrl(
this, wxID_ANY );
160 m_gapUnits =
new wxStaticText(
this, wxID_ANY,
_(
"mm" ) );
163 wxBoxSizer* hullParamsSizer =
new wxBoxSizer( wxHORIZONTAL );
164 hullParamsSizer->Add(
m_gapLabel, 0, wxALIGN_CENTRE_VERTICAL, 5 );
165 hullParamsSizer->Add(
m_gapCtrl, 1, wxALIGN_CENTRE_VERTICAL|wxLEFT|wxRIGHT, 3 );
166 hullParamsSizer->Add(
m_gapUnits, 0, wxALIGN_CENTRE_VERTICAL, 5 );
168 bConvertSizer->AddSpacer( 2 );
169 bConvertSizer->Add( hullParamsSizer, 0, wxLEFT, 26 );
171 bConvertSizer->AddSpacer( 6 );
173 _(
"Delete source objects after conversion" ) );
176 GetSizer()->Insert( 0, bConvertSizer, 0, wxALL|wxEXPAND, 10 );
178 wxStaticLine* line =
new wxStaticLine(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
180 GetSizer()->Insert( 1, line, 0, wxLEFT|wxRIGHT|wxEXPAND, 10 );
182 SetTitle(
_(
"Convert to Rule Area" ) );
267 std::set<wxString> classNames;
269 for(
const wxString& className :
m_board->GetComponentClassManager().GetClassNames() )
270 classNames.insert( className );
272 for(
const wxString& sourceName : classNames )
275 if( !classNames.empty() )
279 std::set<wxString> sheetNames;
280 std::set<wxString> groupNames;
284 sheetNames.insert( fp->GetSheetname() );
286 if( fp->GetParentGroup() && !fp->GetParentGroup()->GetName().IsEmpty() )
287 groupNames.insert( fp->GetParentGroup()->GetName() );
290 for(
const wxString& sourceName : sheetNames )
293 for(
const wxString& groupName : groupNames )
296 if( !sheetNames.empty() )
299 if( !groupNames.empty() )
303 auto setupCurrentSourceSelection = [&]( wxComboBox* cb )
305 if( curSourceName == wxEmptyString )
308 if( !cb->SetStringSelection( curSourceName ) )
312 wxString notFoundDisplayName =
_(
"Not found on board: " ) + curSourceName;
313 cb->Insert( notFoundDisplayName, 0 );
376 if( event.GetColumn() != 0 )
379 int row =
m_layers->ItemToRow( event.GetItem() );
384 const auto setSelectedLayer = [&]()
446 auto setPlacementSource =
460 int selectedSourceIdx = cb->GetSelection();
462 if( selectedSourceIdx != wxNOT_FOUND )
471 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
wxString m_originalName
name the dialog opened with, to detect edits
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 const LSET & AllCuMask()
return AllCuMask( MAX_CU_LAYERS );
static LSET AllNonCuMask()
Return a mask holding all layer minus 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