40 #include <wx/checklst.h> 41 #include <wx/textdlg.h> 53 wxASSERT( dynamic_cast<PCBNEW_PRINTOUT_SETTINGS*>(
m_settings ) );
54 return static_cast<PCBNEW_PRINTOUT_SETTINGS*>(
m_settings );
76 void enableLayer(
unsigned int aLayer,
bool aValue );
149 m_layers[layer].first->Check( checkIndex,
settings()->m_LayerSet.test( layer ) );
164 int minwidth = width;
172 if(
settings->GetFilename() == target )
176 minwidth = std::max( minwidth, width );
179 m_colorTheme->SetMinSize( wxSize( minwidth + 50, -1 ) );
181 wxCommandEvent
dummy;
193 GetSizer()->Fit(
this );
203 int rows = optionsSizer->GetEffectiveRowsCount();
204 int cols = optionsSizer->GetEffectiveColsCount();
207 _(
"Print according to objects tab of appearance manager" ) );
208 optionsSizer->Add(
m_checkAsItems, wxGBPosition( rows++, 0 ), wxGBSpan( 1, 3 ),
209 wxLEFT|wxRIGHT|wxBOTTOM, 5 );
212 optionsSizer->Add(
m_checkBackground, wxGBPosition( rows++, 0 ), wxGBSpan( 1, 3 ),
213 wxLEFT|wxRIGHT|wxBOTTOM, 5 );
216 _(
"Use a different color theme for printing:" ) );
217 optionsSizer->Add(
m_checkUseTheme, wxGBPosition( rows++, 0 ), wxGBSpan( 1, 3 ),
223 wxArrayString m_colorThemeChoices;
224 m_colorTheme =
new wxChoice( box, wxID_ANY, wxDefaultPosition, wxDefaultSize,
225 m_colorThemeChoices, 0 );
228 optionsSizer->Add(
m_colorTheme, wxGBPosition( rows++, 0 ), wxGBSpan( 1, 2 ),
234 auto drillMarksLabel =
new wxStaticText( box, wxID_ANY,
_(
"Drill marks:" ) );
235 std::vector<wxString> drillMarkChoices = {
_(
"No drill mark" ),
239 drillMarkChoices.size(), drillMarkChoices.data(), 0 );
242 optionsSizer->Add( drillMarksLabel, wxGBPosition( rows, 0 ), wxGBSpan( 1, 1 ),
243 wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5 );
244 optionsSizer->Add(
m_drillMarksChoice, wxGBPosition( rows++, 1 ), wxGBSpan( 1, cols - 1 ),
245 wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5 );
250 optionsSizer->Add(
m_checkboxMirror, wxGBPosition( rows++, 0 ), wxGBSpan( 1, cols ),
251 wxLEFT|wxRIGHT|wxBOTTOM, 5 );
260 _(
"Print board edges on all pages" ) );
271 wxStaticBox* box =
new wxStaticBox(
this, wxID_ANY,
_(
"Included Layers" ) );
272 wxStaticBoxSizer* sbLayersSizer =
new wxStaticBoxSizer( box, wxVERTICAL );
275 auto copperLabel =
new wxStaticText( sbLayersSizer->GetStaticBox(), wxID_ANY,
276 _(
"Copper layers:" ) );
279 wxBoxSizer* sizerLeft =
new wxBoxSizer( wxVERTICAL );
280 sizerLeft->Add( copperLabel, 0, wxRIGHT, 5 );
284 auto technicalLabel =
new wxStaticText( sbLayersSizer->GetStaticBox(), wxID_ANY,
285 _(
"Technical layers:" ) );
286 m_listTechLayers =
new wxCheckListBox( sbLayersSizer->GetStaticBox(), wxID_ANY );
288 wxBoxSizer* sizerRight =
new wxBoxSizer( wxVERTICAL );
289 sizerRight->Add( technicalLabel, 0, wxLEFT, 5 );
293 wxBoxSizer* bLayerListsSizer =
new wxBoxSizer( wxHORIZONTAL );
294 bLayerListsSizer->Add( sizerLeft, 1, wxEXPAND, 5 );
295 bLayerListsSizer->Add( sizerRight, 1, wxEXPAND, 5 );
298 m_buttonSelectAll =
new wxButton( sbLayersSizer->GetStaticBox(), wxID_ANY,
_(
"Select all" ) );
300 _(
"Deselect all" ) );
309 wxBoxSizer* buttonSizer =
new wxBoxSizer( wxHORIZONTAL );
314 sbLayersSizer->Add( bLayerListsSizer, 1, wxRIGHT | wxEXPAND, 5 );
315 sbLayersSizer->Add( buttonSizer, 0, wxRIGHT | wxEXPAND, 5 );
317 getMainSizer()->Insert( 0, sbLayersSizer, 1, wxEXPAND | wxALL, 5 );
370 for(
unsigned int i = 0; i < aList->GetCount(); ++i )
371 aList->Check( i, aValue );
378 const auto& layerInfo =
m_layers[aLayer];
380 if( layerInfo.first )
381 return layerInfo.first->IsChecked( layerInfo.second );
390 const auto& layerInfo =
m_layers[aLayer];
391 layerInfo.first->Check( layerInfo.second, aValue );
474 dlg.ForcePrintBorder(
false );
static TOOL_ACTION selectionClear
Clear the current selection.
bool m_background
Print background color.
void onDeselectAllClick(wxCommandEvent &event)
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
SETTINGS_MANAGER * GetSettingsManager() const
Implementation of conversion functions that require both schematic and board internal units.
This file is part of the common library.
int setLayerSetFromList()
PCB_BASE_FRAME * m_frame
Grid origin marker.
std::vector< COLOR_SETTINGS * > GetColorSettingsList()
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
enum PCBNEW_PRINTOUT_SETTINGS::DRILL_MARK_SHAPE_T m_DrillMarks
std::pair< wxCheckListBox *, int > m_layers[PCB_LAYER_ID_COUNT]
void onUseThemeClicked(wxCommandEvent &event)
wxCheckBox * m_titleBlock
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
void saveSettings() override
wxString GetFilename() const
wxButton * m_buttonSelectAll
void enableLayer(unsigned int aLayer, bool aValue)
Update layerset basing on the selected layers.
wxPrintout * createPrintout(const wxString &aTitle) override
Create a printout with a requested title.
wxCheckBox * m_checkboxMirror
wxString color_theme
Color theme to use for printing.
void onColorModeClicked(wxCommandEvent &event)
(Un)check all items in a checklist box.
LSET m_LayerSet
Layers to print.
bool isLayerEnabled(unsigned int aLayer) const
Enable/disable layer in a listbox.
wxCheckListBox * m_listCopperLayers
LSET GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
bool use_theme
If false, display color theme will be used.
wxStaticBox * getOptionsBox()
wxCheckBox * m_checkAsItems
void onSelectAllClick(wxCommandEvent &event)
Board plot function definition file.
static LIB_SYMBOL * dummy()
Used to draw a dummy shape when a LIB_SYMBOL is not found in library.
COLOR_SETTINGS * m_colorSettings
The color settings to be used for printing.
LSET is a set of PCB_LAYER_IDs.
bool m_AsItemCheckboxes
Honor checkboxes in the Items tab of the Layers Manager.
wxCheckBox * m_checkboxPagePerLayer
PCB_BASE_EDIT_FRAME * m_parent
DIALOG_PRINT_PCBNEW(PCB_BASE_EDIT_FRAME *aParent, PCBNEW_PRINTOUT_SETTINGS *aSettings)
PRINTOUT_SETTINGS * m_settings
wxCheckListBox * m_listTechLayers
constexpr std::size_t arrayDim(T const (&)[N]) noexcept
Returns # of elements in an array.
void setListBoxValue(wxCheckListBox *aList, bool aValue)
Check whether a layer is enabled in a listbox.
void onPagePerLayerClicked(wxCommandEvent &event)
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
bool background
Whether or not to print background color.
bool m_PrintEdgeCutsOnAllPages
Print board outline on each page.
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
bool IsCopperLayer(LAYER_NUM aLayerId)
Tests whether a layer is a copper layer.
bool m_blackWhite
Print in B&W or Color.
bool TransferDataToWindow() override
bool TransferDataToWindow() override
int Print(const TOOL_EVENT &aEvent)
Common, abstract interface for edit frames.
Information pertinent to a Pcbnew printed circuit board.
int m_pageCount
Number of pages to print.
PCB_LAYER_ID
A quick note on layer IDs:
PCBNEW_PRINTOUT_SETTINGS * settings() const
PCBNEW_SETTINGS * GetPcbNewSettings() const
const PAGE_INFO & GetPageSettings() const override
APP_SETTINGS_BASE * KifaceSettings() const
wxChoice * m_drillMarksChoice
Color settings are a bit different than most of the settings objects in that there can be more than o...
wxGridBagSizer * getOptionsSizer()
wxCheckBox * m_checkUseTheme
bool m_Mirror
Print mirrored.
APP_SETTINGS_BASE * m_config
wxCheckBox * m_checkboxEdgesOnAllPages
wxCheckBox * m_checkBackground
COLOR_SETTINGS * GetColorSettings() const override
Helper to retrieve the current color settings.
enum PCBNEW_PRINTOUT_SETTINGS::PAGINATION_T m_Pagination
wxButton * m_buttonDeselectAll
virtual void saveSettings()
void createExtraOptions()
wxString m_ColorTheme
Active color theme name.