KiCad PCB EDA Suite
DIALOG_PLOT Class Reference

DIALOG_PLOT is the dialog to set the plot options, and create plot files in various formats. More...

#include <dialog_plot.h>

Inheritance diagram for DIALOG_PLOT:
DIALOG_PLOT_BASE DIALOG_SHIM KIWAY_HOLDER

Public Types

enum  HOLDER_TYPE { DIALOG, FRAME, PANEL }
 

Public Member Functions

 DIALOG_PLOT (PCB_EDIT_FRAME *parent)
 
void DIALOG_PLOT_BASEOnContextMenu (wxMouseEvent &event)
 
void SetInitialFocus (wxWindow *aWindow)
 Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown. More...
 
int ShowQuasiModal ()
 
void EndQuasiModal (int retCode)
 
bool IsQuasiModal ()
 
bool Show (bool show) override
 
bool Enable (bool enable) override
 
void OnPaint (wxPaintEvent &event)
 
EDA_UNITS GetUserUnits () const
 
HOLDER_TYPE GetType ()
 
KIWAYKiway () const
 Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in. More...
 
PROJECTPrj () const
 Function Prj returns a reference to the PROJECT "associated with" this KIWAY. More...
 
void SetKiway (wxWindow *aDest, KIWAY *aKiway)
 Function SetKiway. More...
 

Static Public Member Functions

static bool IsCtrl (int aChar, const wxKeyEvent &e)
 
static bool IsShiftCtrl (int aChar, const wxKeyEvent &e)
 

Protected Types

enum  {
  ID_PRINT_REF = 1000, ID_ALLOW_PRINT_PAD_ON_SILKSCREEN, ID_MIROR_OPT, ID_LAYER_FAB,
  ID_SELECT_COPPER_LAYERS, ID_DESELECT_COPPER_LAYERS, ID_SELECT_ALL_LAYERS, ID_DESELECT_ALL_LAYERS
}
 

Protected Member Functions

virtual void OnInitDialog (wxInitDialogEvent &event)
 
void FinishDialogSettings ()
 In all dialogs, we must call the same functions to fix minimal dlg size, the default position and perhaps some others to fix a few issues depending on Windows Managers this helper function does these calls. More...
 
void SetSizeInDU (int x, int y)
 Set the dialog to the given dimensions in "dialog units". More...
 
int HorizPixelsFromDU (int x)
 Convert an integer number of dialog units to pixels, horizontally. More...
 
int VertPixelsFromDU (int y)
 Convert an integer number of dialog units to pixels, vertically. More...
 
void ResetSize ()
 Clear the existing dialog size and position. More...
 

Protected Attributes

wxBoxSizer * m_MainSizer
 
wxStaticText * m_staticTextPlotFmt
 
wxChoice * m_plotFormatOpt
 
wxStaticText * m_staticTextDir
 
wxTextCtrl * m_outputDirectoryName
 
wxBitmapButton * m_browseButton
 
wxStaticBoxSizer * m_LayersSizer
 
wxCheckListBox * m_layerCheckListBox
 
wxBoxSizer * m_PlotOptionsSizer
 
wxCheckBox * m_plotSheetRef
 
wxCheckBox * m_plotModuleValueOpt
 
wxCheckBox * m_plotModuleRefOpt
 
wxCheckBox * m_plotInvisibleText
 
wxCheckBox * m_excludeEdgeLayerOpt
 
wxCheckBox * m_sketchPadsOnFabLayers
 
wxCheckBox * m_plotNoViaOnMaskOpt
 
wxCheckBox * m_useAuxOriginCheckBox
 
wxStaticText * drillMarksLabel
 
wxChoice * m_drillShapeOpt
 
wxStaticText * scalingLabel
 
wxChoice * m_scaleOpt
 
wxStaticText * plotModeLabel
 
wxChoice * m_plotModeOpt
 
wxCheckBox * m_plotMirrorOpt
 
wxCheckBox * m_plotPSNegativeOpt
 
wxCheckBox * m_zoneFillCheck
 
wxStaticBoxSizer * m_GerberOptionsSizer
 
wxCheckBox * m_useGerberExtensions
 
wxCheckBox * m_generateGerberJobFile
 
wxCheckBox * m_subtractMaskFromSilk
 
wxStaticText * coordFormatLabel
 
wxChoice * m_coordFormatCtrl
 
wxCheckBox * m_useGerberX2Format
 
wxCheckBox * m_useGerberNetAttributes
 
wxStaticBoxSizer * m_HPGLOptionsSizer
 
wxStaticText * m_hpglPenLabel
 
wxTextCtrl * m_hpglPenCtrl
 
wxStaticText * m_hpglPenUnits
 
wxStaticBoxSizer * m_PSOptionsSizer
 
wxStaticText * m_fineAdjustXLabel
 
wxTextCtrl * m_fineAdjustXCtrl
 
wxStaticText * m_fineAdjustYLabel
 
wxTextCtrl * m_fineAdjustYCtrl
 
wxStaticText * m_widthAdjustLabel
 
wxTextCtrl * m_widthAdjustCtrl
 
wxStaticText * m_widthAdjustUnits
 
wxCheckBox * m_forcePSA4OutputOpt
 
wxStaticBoxSizer * m_SizerDXF_options
 
wxCheckBox * m_DXF_plotModeOpt
 
wxCheckBox * m_DXF_plotTextStrokeFontOpt
 
wxStaticText * DXF_exportUnitsLabel
 
wxChoice * m_DXF_plotUnits
 
wxStaticBoxSizer * m_svgOptionsSizer
 
wxStaticText * svgUnitLabel
 
wxChoice * m_svgUnits
 
wxStaticText * svgPrecisionLabel
 
wxSpinCtrl * m_svgPrecsision
 
WX_HTML_REPORT_PANELm_messagesPanel
 
wxBoxSizer * m_sizerButtons
 
wxButton * m_buttonDRC
 
wxStaticText * m_DRCExclusionsWarning
 
wxStdDialogButtonSizer * m_sdbSizer1
 
wxButton * m_sdbSizer1OK
 
wxButton * m_sdbSizer1Apply
 
wxButton * m_sdbSizer1Cancel
 
wxMenu * m_popMenu
 
EDA_UNITS m_units
 
std::string m_hash_key
 
bool m_firstPaintEvent
 
wxWindow * m_initialFocusTarget
 
WX_EVENT_LOOPm_qmodal_loop
 
bool m_qmodal_showing
 
WDO_ENABLE_DISABLEm_qmodal_parent_disabler
 
EDA_BASE_FRAMEm_parentFrame
 
std::vector< wxWindow * > m_tabOrder
 

Private Member Functions

void Plot (wxCommandEvent &event) override
 
void OnOutputDirectoryBrowseClicked (wxCommandEvent &event) override
 
void OnRightClick (wxMouseEvent &event) override
 
void OnPopUpLayers (wxCommandEvent &event) override
 
void SetPlotFormat (wxCommandEvent &event) override
 
void OnChangeDXFPlotMode (wxCommandEvent &event) override
 
void OnSetScaleOpt (wxCommandEvent &event) override
 
void CreateDrillFile (wxCommandEvent &event) override
 
void OnGerberX2Checked (wxCommandEvent &event) override
 
void onRunDRC (wxCommandEvent &event) override
 
void init_Dialog ()
 
void reInitDialog ()
 
void applyPlotSettings ()
 
PLOT_FORMAT getPlotFormat ()
 
void setPlotModeChoiceSelection (EDA_DRAW_MODE_T aPlotMode)
 

Private Attributes

PCB_EDIT_FRAMEm_parent
 
LSEQ m_layerList
 
double m_XScaleAdjust
 
double m_YScaleAdjust
 
int m_PSWidthAdjust
 
int m_widthAdjustMinValue
 
int m_widthAdjustMaxValue
 
UNIT_BINDER m_defaultPenSize
 
UNIT_BINDER m_trackWidthCorrection
 
wxString m_DRCWarningTemplate
 
PCB_PLOT_PARAMS m_plotOpts
 

Detailed Description

DIALOG_PLOT is the dialog to set the plot options, and create plot files in various formats.

Definition at line 40 of file dialog_plot.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protectedinherited

◆ HOLDER_TYPE

enum KIWAY_HOLDER::HOLDER_TYPE
inherited
Enumerator
DIALOG 
FRAME 
PANEL 

Definition at line 42 of file kiway_holder.h.

Constructor & Destructor Documentation

◆ DIALOG_PLOT()

DIALOG_PLOT::DIALOG_PLOT ( PCB_EDIT_FRAME parent)

Definition at line 47 of file dialog_plot.cpp.

47  :
48  DIALOG_PLOT_BASE( aParent ), m_parent( aParent ),
51 {
52  SetName( DLG_WINDOW_NAME );
53  m_plotOpts = aParent->GetPlotSettings();
55 
56  init_Dialog();
57 
58  // We use a sdbSizer to get platform-dependent ordering of the action buttons, but
59  // that requires us to correct the button labels here.
60  m_sdbSizer1OK->SetLabel( _( "Plot" ) );
61  m_sdbSizer1Apply->SetLabel( _( "Generate Drill Files..." ) );
62  m_sdbSizer1Cancel->SetLabel( _( "Close" ) );
63  m_sizerButtons->Layout();
64 
65  m_sdbSizer1OK->SetDefault();
66 
67  GetSizer()->Fit( this );
68  GetSizer()->SetSizeHints( this );
69 }
wxStaticText * m_widthAdjustLabel
wxButton * m_sdbSizer1Cancel
wxStaticText * m_hpglPenUnits
wxButton * m_sdbSizer1OK
UNIT_BINDER m_trackWidthCorrection
Definition: dialog_plot.h:60
wxButton * m_sdbSizer1Apply
wxTextCtrl * m_widthAdjustCtrl
PCB_EDIT_FRAME * m_parent
Definition: dialog_plot.h:46
wxStaticText * m_hpglPenLabel
PCB_PLOT_PARAMS m_plotOpts
Definition: dialog_plot.h:64
wxStaticText * m_widthAdjustUnits
wxTextCtrl * m_hpglPenCtrl
DIALOG_PLOT_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Plot"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(762, 749), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
wxString m_DRCWarningTemplate
Definition: dialog_plot.h:62
wxBoxSizer * m_sizerButtons
void init_Dialog()
Definition: dialog_plot.cpp:72
#define _(s)
Definition: 3d_actions.cpp:33
UNIT_BINDER m_defaultPenSize
Definition: dialog_plot.h:59
#define DLG_WINDOW_NAME
wxStaticText * m_DRCExclusionsWarning

References _, DLG_WINDOW_NAME, PCB_BASE_FRAME::GetPlotSettings(), init_Dialog(), DIALOG_PLOT_BASE::m_DRCExclusionsWarning, m_DRCWarningTemplate, m_plotOpts, DIALOG_PLOT_BASE::m_sdbSizer1Apply, DIALOG_PLOT_BASE::m_sdbSizer1Cancel, DIALOG_PLOT_BASE::m_sdbSizer1OK, and DIALOG_PLOT_BASE::m_sizerButtons.

Member Function Documentation

◆ applyPlotSettings()

void DIALOG_PLOT::applyPlotSettings ( )
private

Definition at line 581 of file dialog_plot.cpp.

582 {
583  REPORTER& reporter = m_messagesPanel->Reporter();
584  int sel;
585  PCB_PLOT_PARAMS tempOptions;
586 
587  tempOptions.SetExcludeEdgeLayer( m_excludeEdgeLayerOpt->GetValue() );
588  tempOptions.SetSubtractMaskFromSilk( m_subtractMaskFromSilk->GetValue() );
589  tempOptions.SetPlotFrameRef( m_plotSheetRef->GetValue() );
590  tempOptions.SetSketchPadsOnFabLayers( m_sketchPadsOnFabLayers->GetValue());
591  tempOptions.SetUseAuxOrigin( m_useAuxOriginCheckBox->GetValue() );
592  tempOptions.SetPlotValue( m_plotModuleValueOpt->GetValue() );
593  tempOptions.SetPlotReference( m_plotModuleRefOpt->GetValue() );
594  tempOptions.SetPlotInvisibleText( m_plotInvisibleText->GetValue() );
595  tempOptions.SetScaleSelection( m_scaleOpt->GetSelection() );
596 
597  sel = m_drillShapeOpt->GetSelection();
598  tempOptions.SetDrillMarksType( static_cast<PCB_PLOT_PARAMS::DrillMarksType>( sel ) );
599 
600  tempOptions.SetMirror( m_plotMirrorOpt->GetValue() );
601  tempOptions.SetPlotMode( m_plotModeOpt->GetSelection() == 1 ? SKETCH : FILLED );
602  tempOptions.SetDXFPlotPolygonMode( m_DXF_plotModeOpt->GetValue() );
603 
604  sel = m_DXF_plotUnits->GetSelection();
605  tempOptions.SetDXFPlotUnits( static_cast<DXF_PLOTTER::DXF_UNITS>( sel ) );
606 
607  tempOptions.SetPlotViaOnMaskLayer( m_plotNoViaOnMaskOpt->GetValue() );
608 
609  if( !m_DXF_plotTextStrokeFontOpt->IsEnabled() ) // Currently, only DXF supports this option
610  tempOptions.SetTextMode( PLOT_TEXT_MODE::DEFAULT );
611  else
614 
615  // Update settings from text fields. Rewrite values back to the fields,
616  // since the values may have been constrained by the setters.
617  wxString msg;
618 
619  // read HPLG pen size (this param is stored in mils)
620  // However, due to issues when converting this value from or to mm
621  // that can slightly change the value, update this param only if it
622  // is in use
624  {
625  if( !tempOptions.SetHPGLPenDiameter( m_defaultPenSize.GetValue() / IU_PER_MILS ) )
626  {
628  msg.Printf( _( "HPGL pen size constrained." ) );
629  reporter.Report( msg, RPT_SEVERITY_INFO );
630  }
631  }
632  else // keep the last value (initial value if no HPGL plot made)
634 
635  // X scale
636  double tmpDouble;
637  msg = m_fineAdjustXCtrl->GetValue();
638  msg.ToDouble( &tmpDouble );
639 
640  if( !setDouble( &m_XScaleAdjust, tmpDouble, PLOT_MIN_SCALE, PLOT_MAX_SCALE ) )
641  {
642  msg.Printf( wxT( "%f" ), m_XScaleAdjust );
643  m_fineAdjustXCtrl->SetValue( msg );
644  msg.Printf( _( "X scale constrained." ) );
645  reporter.Report( msg, RPT_SEVERITY_INFO );
646  }
647 
648  // Y scale
649  msg = m_fineAdjustYCtrl->GetValue();
650  msg.ToDouble( &tmpDouble );
651 
652  if( !setDouble( &m_YScaleAdjust, tmpDouble, PLOT_MIN_SCALE, PLOT_MAX_SCALE ) )
653  {
654  msg.Printf( wxT( "%f" ), m_YScaleAdjust );
655  m_fineAdjustYCtrl->SetValue( msg );
656  msg.Printf( _( "Y scale constrained." ) );
657  reporter.Report( msg, RPT_SEVERITY_INFO );
658  }
659 
660  auto cfg = m_parent->GetPcbNewSettings();
661 
663  cfg->m_Plot.fine_scale_y = m_YScaleAdjust;
664 
665  cfg->m_Plot.check_zones_before_plotting = m_zoneFillCheck->GetValue();
666 
667  // PS Width correction
670  {
672  msg.Printf( _( "Width correction constrained. "
673  "The reasonable width correction value must be in a range of "
674  " [%s; %s] (%s) for current design rules." ),
678  reporter.Report( msg, RPT_SEVERITY_WARNING );
679  }
680 
681  // Store m_PSWidthAdjust in mm in user config
682  cfg->m_Plot.ps_fine_width_adjust = Iu2Millimeter( m_PSWidthAdjust );
683 
684  tempOptions.SetFormat( getPlotFormat() );
685 
686  tempOptions.SetUseGerberProtelExtensions( m_useGerberExtensions->GetValue() );
687  tempOptions.SetUseGerberX2format( m_useGerberX2Format->GetValue() );
688  tempOptions.SetIncludeGerberNetlistInfo( m_useGerberNetAttributes->GetValue() );
689  tempOptions.SetCreateGerberJobFile( m_generateGerberJobFile->GetValue() );
690 
691  tempOptions.SetGerberPrecision( m_coordFormatCtrl->GetSelection() == 0 ? 5 : 6 );
692  tempOptions.SetSvgPrecision( m_svgPrecsision->GetValue(), m_svgUnits->GetSelection() );
693 
694  LSET selectedLayers;
695  for( unsigned i = 0; i < m_layerList.size(); i++ )
696  {
697  if( m_layerCheckListBox->IsChecked( i ) )
698  selectedLayers.set( m_layerList[i] );
699  }
700  // Get a list of copper layers that aren't being used by inverting enabled layers.
701  LSET disabledCopperLayers = LSET::AllCuMask() & ~m_parent->GetBoard()->GetEnabledLayers();
702  // Enable all of the disabled copper layers.
703  // If someone enables more copper layers they will be selected by default.
704  selectedLayers = selectedLayers | disabledCopperLayers;
705  tempOptions.SetLayerSelection( selectedLayers );
706 
707  tempOptions.SetNegative( m_plotPSNegativeOpt->GetValue() );
708  tempOptions.SetA4Output( m_forcePSA4OutputOpt->GetValue() );
709 
710  // Set output directory and replace backslashes with forward ones
711  wxString dirStr;
712  dirStr = m_outputDirectoryName->GetValue();
713  dirStr.Replace( wxT( "\\" ), wxT( "/" ) );
714  tempOptions.SetOutputDirectory( dirStr );
715 
716  if( !m_plotOpts.IsSameAs( tempOptions, false ) )
717  {
718  // First, mark board as modified only for parameters saved in file
719  if( !m_plotOpts.IsSameAs( tempOptions, true ) )
720  m_parent->OnModify();
721 
722  // Now, save any change, for the session
723  m_parent->SetPlotSettings( tempOptions );
724  m_plotOpts = tempOptions;
725  }
726 }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Function AllCuMask returns a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:710
void SetUseGerberProtelExtensions(bool aUse)
void SetPlotReference(bool aFlag)
void SetExcludeEdgeLayer(bool aFlag)
WX_HTML_REPORT_PANEL * m_messagesPanel
void SetScaleSelection(int aSelection)
LSEQ m_layerList
Definition: dialog_plot.h:47
void SetIncludeGerberNetlistInfo(bool aUse)
void SetDXFPlotPolygonMode(bool aFlag)
double m_YScaleAdjust
Definition: dialog_plot.h:50
void OnModify() override
Function OnModify must be called after a board change to set the modified flag.
wxCheckBox * m_useGerberExtensions
void SetGerberPrecision(int aPrecision)
void SetPlotViaOnMaskLayer(bool aFlag)
void SetLayerSelection(LSET aSelection)
void SetUseAuxOrigin(bool aAux)
wxCheckBox * m_plotPSNegativeOpt
#define PLOT_MIN_SCALE
Definition: pcbplot.h:56
wxCheckBox * m_excludeEdgeLayerOpt
void SetCreateGerberJobFile(bool aCreate)
void SetMirror(bool aFlag)
wxString StringFromValue(EDA_UNITS aUnits, double aValue, bool aAddUnitSymbol, bool aUseMils)
Function StringFromValue returns the string from aValue according to units (inch, mm ....
Definition: base_units.cpp:233
wxCheckBox * m_plotMirrorOpt
void SetTextMode(PLOT_TEXT_MODE aVal)
LSET GetEnabledLayers() const
Function GetEnabledLayers is a proxy function that calls the corresponding function in m_BoardSetting...
wxCheckBox * m_zoneFillCheck
void SetDrillMarksType(DrillMarksType aVal)
PCBNEW_SETTINGS * GetPcbNewSettings()
REPORTER is a pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:62
wxString GetAbbreviatedUnitsLabel(EDA_UNITS aUnit, bool aUseMils, EDA_DATA_TYPE aType)
Get the units string for a given units type.
Definition: base_units.cpp:466
wxChoice * m_coordFormatCtrl
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)=0
Function Report is a pure virtual function to override in the derived object.
UNIT_BINDER m_trackWidthCorrection
Definition: dialog_plot.h:60
void SetA4Output(int aForce)
double m_XScaleAdjust
Definition: dialog_plot.h:48
wxTextCtrl * m_fineAdjustYCtrl
wxCheckBox * m_DXF_plotModeOpt
void SetPlotValue(bool aFlag)
EDA_UNITS GetUserUnits() const
Definition: dialog_shim.h:132
wxCheckBox * m_plotSheetRef
void SetPlotFrameRef(bool aFlag)
wxTextCtrl * m_fineAdjustXCtrl
wxSpinCtrl * m_svgPrecsision
LSET is a set of PCB_LAYER_IDs.
PCB_EDIT_FRAME * m_parent
Definition: dialog_plot.h:46
int m_widthAdjustMaxValue
Definition: dialog_plot.h:57
void SetDXFPlotUnits(DXF_PLOTTER::DXF_UNITS aUnit)
PLOT_FORMAT getPlotFormat()
static bool setDouble(double *aResult, double aValue, double aMin, double aMax)
REPORTER & Reporter()
returns the reporter object that reports to this panel
#define PLOT_MAX_SCALE
Definition: pcbplot.h:57
int m_PSWidthAdjust
Definition: dialog_plot.h:52
wxCheckBox * m_forcePSA4OutputOpt
void SetSubtractMaskFromSilk(bool aSubtract)
void SetUseGerberX2format(bool aUse)
virtual void SetPlotSettings(const PCB_PLOT_PARAMS &aSettings)
wxCheckBox * m_useGerberNetAttributes
void SetOutputDirectory(wxString aDir)
wxChoice * m_DXF_plotUnits
void SetFormat(PLOT_FORMAT aFormat)
int m_widthAdjustMinValue
Definition: dialog_plot.h:56
wxCheckBox * m_generateGerberJobFile
PCB_PLOT_PARAMS handles plot parameters and options when plotting/printing a board.
wxTextCtrl * m_outputDirectoryName
void SetPlotInvisibleText(bool aFlag)
wxCheckBox * m_DXF_plotTextStrokeFontOpt
PCB_PLOT_PARAMS m_plotOpts
Definition: dialog_plot.h:64
void SetNegative(bool aFlag)
void SetSvgPrecision(unsigned aPrecision, bool aUseInch)
wxChoice * m_scaleOpt
wxCheckBox * m_plotModuleRefOpt
void SetPlotMode(EDA_DRAW_MODE_T aPlotMode)
bool SetHPGLPenDiameter(double aValue)
wxCheckBox * m_subtractMaskFromSilk
wxCheckBox * m_plotNoViaOnMaskOpt
wxCheckBox * m_plotModuleValueOpt
wxChoice * m_drillShapeOpt
#define _(s)
Definition: 3d_actions.cpp:33
static bool setInt(int *aResult, int aValue, int aMin, int aMax)
virtual void SetValue(int aValue)
Function SetValue Sets new value (in Internal Units) for the text field, taking care of units convers...
wxCheckBox * m_plotInvisibleText
double GetHPGLPenDiameter() const
wxCheckBox * m_sketchPadsOnFabLayers
bool IsSameAs(const PCB_PLOT_PARAMS &aPcbPlotParams, bool aCompareOnlySavedPrms) const
Compare current settings to aPcbPlotParams, including not saved parameters in brd file.
#define IU_PER_MILS
Definition: plotter.cpp:138
wxCheckBox * m_useAuxOriginCheckBox
DIALOG_PLOT m_Plot
wxChoice * m_plotModeOpt
virtual long long int GetValue()
Function GetValue Returns the current value in Internal Units.
UNIT_BINDER m_defaultPenSize
Definition: dialog_plot.h:59
wxCheckBox * m_useGerberX2Format
BOARD * GetBoard() const
wxCheckListBox * m_layerCheckListBox
void SetSketchPadsOnFabLayers(bool aFlag)

References _, LSET::AllCuMask(), DEFAULT, FILLED, PCBNEW_SETTINGS::DIALOG_PLOT::fine_scale_x, GetAbbreviatedUnitsLabel(), PCB_BASE_FRAME::GetBoard(), BOARD::GetEnabledLayers(), PCB_PLOT_PARAMS::GetHPGLPenDiameter(), PCB_BASE_FRAME::GetPcbNewSettings(), getPlotFormat(), DIALOG_SHIM::GetUserUnits(), UNIT_BINDER::GetValue(), HPGL, PCB_PLOT_PARAMS::IsSameAs(), IU_PER_MILS, DIALOG_PLOT_BASE::m_coordFormatCtrl, m_defaultPenSize, DIALOG_PLOT_BASE::m_drillShapeOpt, DIALOG_PLOT_BASE::m_DXF_plotModeOpt, DIALOG_PLOT_BASE::m_DXF_plotTextStrokeFontOpt, DIALOG_PLOT_BASE::m_DXF_plotUnits, DIALOG_PLOT_BASE::m_excludeEdgeLayerOpt, DIALOG_PLOT_BASE::m_fineAdjustXCtrl, DIALOG_PLOT_BASE::m_fineAdjustYCtrl, DIALOG_PLOT_BASE::m_forcePSA4OutputOpt, DIALOG_PLOT_BASE::m_generateGerberJobFile, DIALOG_PLOT_BASE::m_layerCheckListBox, m_layerList, DIALOG_PLOT_BASE::m_messagesPanel, DIALOG_PLOT_BASE::m_outputDirectoryName, m_parent, PCBNEW_SETTINGS::m_Plot, DIALOG_PLOT_BASE::m_plotInvisibleText, DIALOG_PLOT_BASE::m_plotMirrorOpt, DIALOG_PLOT_BASE::m_plotModeOpt, DIALOG_PLOT_BASE::m_plotModuleRefOpt, DIALOG_PLOT_BASE::m_plotModuleValueOpt, DIALOG_PLOT_BASE::m_plotNoViaOnMaskOpt, m_plotOpts, DIALOG_PLOT_BASE::m_plotPSNegativeOpt, DIALOG_PLOT_BASE::m_plotSheetRef, m_PSWidthAdjust, DIALOG_PLOT_BASE::m_scaleOpt, DIALOG_PLOT_BASE::m_sketchPadsOnFabLayers, DIALOG_PLOT_BASE::m_subtractMaskFromSilk, DIALOG_PLOT_BASE::m_svgPrecsision, DIALOG_PLOT_BASE::m_svgUnits, m_trackWidthCorrection, DIALOG_PLOT_BASE::m_useAuxOriginCheckBox, DIALOG_PLOT_BASE::m_useGerberExtensions, DIALOG_PLOT_BASE::m_useGerberNetAttributes, DIALOG_PLOT_BASE::m_useGerberX2Format, m_widthAdjustMaxValue, m_widthAdjustMinValue, m_XScaleAdjust, m_YScaleAdjust, DIALOG_PLOT_BASE::m_zoneFillCheck, NATIVE, PCB_EDIT_FRAME::OnModify(), PLOT_MAX_SCALE, PLOT_MIN_SCALE, REPORTER::Report(), WX_HTML_REPORT_PANEL::Reporter(), RPT_SEVERITY_INFO, RPT_SEVERITY_WARNING, PCB_PLOT_PARAMS::SetA4Output(), PCB_PLOT_PARAMS::SetCreateGerberJobFile(), setDouble(), PCB_PLOT_PARAMS::SetDrillMarksType(), PCB_PLOT_PARAMS::SetDXFPlotPolygonMode(), PCB_PLOT_PARAMS::SetDXFPlotUnits(), PCB_PLOT_PARAMS::SetExcludeEdgeLayer(), PCB_PLOT_PARAMS::SetFormat(), PCB_PLOT_PARAMS::SetGerberPrecision(), PCB_PLOT_PARAMS::SetHPGLPenDiameter(), PCB_PLOT_PARAMS::SetIncludeGerberNetlistInfo(), setInt(), PCB_PLOT_PARAMS::SetLayerSelection(), PCB_PLOT_PARAMS::SetMirror(), PCB_PLOT_PARAMS::SetNegative(), PCB_PLOT_PARAMS::SetOutputDirectory(), PCB_PLOT_PARAMS::SetPlotFrameRef(), PCB_PLOT_PARAMS::SetPlotInvisibleText(), PCB_PLOT_PARAMS::SetPlotMode(), PCB_PLOT_PARAMS::SetPlotReference(), PCB_BASE_FRAME::SetPlotSettings(), PCB_PLOT_PARAMS::SetPlotValue(), PCB_PLOT_PARAMS::SetPlotViaOnMaskLayer(), PCB_PLOT_PARAMS::SetScaleSelection(), PCB_PLOT_PARAMS::SetSketchPadsOnFabLayers(), PCB_PLOT_PARAMS::SetSubtractMaskFromSilk(), PCB_PLOT_PARAMS::SetSvgPrecision(), PCB_PLOT_PARAMS::SetTextMode(), PCB_PLOT_PARAMS::SetUseAuxOrigin(), PCB_PLOT_PARAMS::SetUseGerberProtelExtensions(), PCB_PLOT_PARAMS::SetUseGerberX2format(), UNIT_BINDER::SetValue(), SKETCH, and StringFromValue().

Referenced by CreateDrillFile(), and Plot().

◆ CreateDrillFile()

void DIALOG_PLOT::CreateDrillFile ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PLOT_BASE.

Definition at line 309 of file dialog_plot.cpp.

310 {
311  // Be sure drill file use the same settings (axis option, plot directory)
312  // as plot files:
314 
315  DIALOG_GENDRILL dlg( m_parent, this );
316  dlg.ShowModal();
317 
318  // a few plot settings can be modified: take them in account
320  reInitDialog();
321 }
virtual const PCB_PLOT_PARAMS & GetPlotSettings() const
Function GetPlotSettings returns the PCB_PLOT_PARAMS for the BOARD owned by this frame.
PCB_EDIT_FRAME * m_parent
Definition: dialog_plot.h:46
PCB_PLOT_PARAMS m_plotOpts
Definition: dialog_plot.h:64
void reInitDialog()
void applyPlotSettings()

References applyPlotSettings(), PCB_BASE_FRAME::GetPlotSettings(), m_parent, m_plotOpts, and reInitDialog().

◆ DIALOG_PLOT_BASEOnContextMenu()

void DIALOG_PLOT_BASE::DIALOG_PLOT_BASEOnContextMenu ( wxMouseEvent &  event)
inlineinherited

Definition at line 147 of file dialog_plot_base.h.

148  {
149  this->PopupMenu( m_popMenu, event.GetPosition() );
150  }

References DIALOG_PLOT_BASE::m_popMenu.

Referenced by DIALOG_PLOT_BASE::DIALOG_PLOT_BASE().

◆ Enable()

bool DIALOG_SHIM::Enable ( bool  enable)
overrideinherited

Definition at line 264 of file dialog_shim.cpp.

265 {
266  // so we can do logging of this state change:
267 
268 #if 0 && defined(DEBUG)
269  const char* type_id = typeid( *this ).name();
270  printf( "DIALOG_SHIM %s: %s\n", type_id, enable ? "enabled" : "disabled" );
271  fflush(0); //Needed on msys2 to immediately print the message
272 #endif
273 
274  return wxDialog::Enable( enable );
275 }

◆ EndQuasiModal()

void DIALOG_SHIM::EndQuasiModal ( int  retCode)
inherited

Definition at line 421 of file dialog_shim.cpp.

422 {
423  // Hook up validator and transfer data from controls handling so quasi-modal dialogs
424  // handle validation in the same way as other dialogs.
425  if( ( retCode == wxID_OK ) && ( !Validate() || !TransferDataFromWindow() ) )
426  return;
427 
428  SetReturnCode( retCode );
429 
430  if( !IsQuasiModal() )
431  {
432  wxFAIL_MSG( "either DIALOG_SHIM::EndQuasiModal called twice or ShowQuasiModal"
433  "wasn't called" );
434  return;
435  }
436 
437  if( m_qmodal_loop )
438  {
439  if( m_qmodal_loop->IsRunning() )
440  m_qmodal_loop->Exit( 0 );
441  else
442  m_qmodal_loop->ScheduleExit( 0 );
443 
445  }
446 
449 
450  Show( false );
451 }
WX_EVENT_LOOP * m_qmodal_loop
Definition: dialog_shim.h:205
#define NULL
bool IsQuasiModal()
Definition: dialog_shim.h:124
bool Show(bool show) override
WDO_ENABLE_DISABLE * m_qmodal_parent_disabler
Definition: dialog_shim.h:208

References DIALOG_SHIM::IsQuasiModal(), DIALOG_SHIM::m_qmodal_loop, DIALOG_SHIM::m_qmodal_parent_disabler, NULL, and DIALOG_SHIM::Show().

Referenced by HK_PROMPT_DIALOG::EndFlexible(), DIALOG_SHIM::OnButton(), DIALOG_EDIT_COMPONENTS_LIBID::onCancel(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnCancelButtonClick(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnCancelButtonClick(), DIALOG_LIB_EDIT_PIN_TABLE::OnClose(), DIALOG_PRINT_GENERIC::onCloseButton(), DIALOG_CHOOSE_FOOTPRINT::OnCloseTimer(), DIALOG_CHOOSE_COMPONENT::OnCloseTimer(), DIALOG_SHIM::OnCloseWindow(), HTML_MESSAGE_BOX::OnOKButtonClick(), DIALOG_CHOOSE_FOOTPRINT::OnUseBrowser(), DIALOG_CHOOSE_COMPONENT::OnUseBrowser(), and DIALOG_SHIM::~DIALOG_SHIM().

◆ FinishDialogSettings()

void DIALOG_SHIM::FinishDialogSettings ( )
protectedinherited

In all dialogs, we must call the same functions to fix minimal dlg size, the default position and perhaps some others to fix a few issues depending on Windows Managers this helper function does these calls.

FinishDialogSettings must be called from derived classes, when all widgets are initialized, and therefore their size fixed. If TransferDataToWindow() is used to initialize widgets, at end of TransferDataToWindow, or better at end of a wxInitDialogEvent handler

In any case, the best way is to call it in a wxInitDialogEvent handler after calling TransfertDataToWindow(), which is the default wxInitDialogEvent handler wxDialog

Definition at line 139 of file dialog_shim.cpp.

140 {
141  // must be called from the constructor of derived classes,
142  // when all widgets are initialized, and therefore their size fixed
143 
144  // SetSizeHints fixes the minimal size of sizers in the dialog
145  // (SetSizeHints calls Fit(), so no need to call it)
146  GetSizer()->SetSizeHints( this );
147 
148  // the default position, when calling the first time the dlg
149  Center();
150 }

References PCAD2KICAD::Center.

Referenced by DIALOG_3D_VIEW_OPTIONS::DIALOG_3D_VIEW_OPTIONS(), DIALOG_ANNOTATE::DIALOG_ANNOTATE(), DIALOG_BOARD_SETUP::DIALOG_BOARD_SETUP(), DIALOG_BOM::DIALOG_BOM(), DIALOG_COPPER_ZONE::DIALOG_COPPER_ZONE(), DIALOG_DRC::DIALOG_DRC(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::DIALOG_EDIT_COMPONENT_IN_LIBRARY(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC(), DIALOG_EDIT_COMPONENTS_LIBID::DIALOG_EDIT_COMPONENTS_LIBID(), DIALOG_EDIT_LINE_STYLE::DIALOG_EDIT_LINE_STYLE(), DIALOG_EDIT_SHEET_PIN::DIALOG_EDIT_SHEET_PIN(), DIALOG_EDITOR_DATA::DIALOG_EDITOR_DATA(), DIALOG_ENUM_PADS::DIALOG_ENUM_PADS(), DIALOG_ERC::DIALOG_ERC(), DIALOG_EXCHANGE_FOOTPRINTS::DIALOG_EXCHANGE_FOOTPRINTS(), DIALOG_EXPORT_3DFILE::DIALOG_EXPORT_3DFILE(), DIALOG_EXPORT_IDF3::DIALOG_EXPORT_IDF3(), DIALOG_EXPORT_STEP::DIALOG_EXPORT_STEP(), DIALOG_EXPORT_SVG::DIALOG_EXPORT_SVG(), DIALOG_FIELDS_EDITOR_GLOBAL::DIALOG_FIELDS_EDITOR_GLOBAL(), DIALOG_FOOTPRINT_BOARD_EDITOR::DIALOG_FOOTPRINT_BOARD_EDITOR(), DIALOG_FOOTPRINT_FP_EDITOR::DIALOG_FOOTPRINT_FP_EDITOR(), DIALOG_FOOTPRINT_WIZARD_LIST::DIALOG_FOOTPRINT_WIZARD_LIST(), DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::DIALOG_FOOTPRINTS_DISPLAY_OPTIONS(), DIALOG_GENCAD_EXPORT_OPTIONS::DIALOG_GENCAD_EXPORT_OPTIONS(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS(), DIALOG_GLOBAL_LIB_TABLE_CONFIG::DIALOG_GLOBAL_LIB_TABLE_CONFIG(), DIALOG_IMAGE_EDITOR::DIALOG_IMAGE_EDITOR(), DIALOG_INSPECTOR::DIALOG_INSPECTOR(), DIALOG_KEEPOUT_AREA_PROPERTIES::DIALOG_KEEPOUT_AREA_PROPERTIES(), DIALOG_LABEL_EDITOR::DIALOG_LABEL_EDITOR(), DIALOG_LIB_EDIT_DRAW_ITEM::DIALOG_LIB_EDIT_DRAW_ITEM(), DIALOG_LIB_EDIT_PIN::DIALOG_LIB_EDIT_PIN(), DIALOG_LIB_EDIT_TEXT::DIALOG_LIB_EDIT_TEXT(), DIALOG_LIB_NEW_COMPONENT::DIALOG_LIB_NEW_COMPONENT(), DIALOG_LIST_HOTKEYS::DIALOG_LIST_HOTKEYS(), DIALOG_MOVE_EXACT::DIALOG_MOVE_EXACT(), DIALOG_NETLIST::DIALOG_NETLIST(), DIALOG_NON_COPPER_ZONES_EDITOR::DIALOG_NON_COPPER_ZONES_EDITOR(), DIALOG_PAD_PRIMITIVE_POLY_PROPS::DIALOG_PAD_PRIMITIVE_POLY_PROPS(), DIALOG_PAD_PRIMITIVES_PROPERTIES::DIALOG_PAD_PRIMITIVES_PROPERTIES(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), DIALOG_PASTE_SPECIAL::DIALOG_PASTE_SPECIAL(), DIALOG_PLOT_SCHEMATIC::DIALOG_PLOT_SCHEMATIC(), DIALOG_POSITION_RELATIVE::DIALOG_POSITION_RELATIVE(), DIALOG_PRINT_GENERIC::DIALOG_PRINT_GENERIC(), DIALOG_PRINT_USING_PRINTER::DIALOG_PRINT_USING_PRINTER(), DIALOG_PUSH_PAD_PROPERTIES::DIALOG_PUSH_PAD_PROPERTIES(), DIALOG_SCH_SHEET_PROPS::DIALOG_SCH_SHEET_PROPS(), DIALOG_SCHEMATIC_SETUP::DIALOG_SCHEMATIC_SETUP(), DIALOG_SELECT_NET_FROM_LIST::DIALOG_SELECT_NET_FROM_LIST(), DIALOG_SET_GRID::DIALOG_SET_GRID(), DIALOG_SWAP_LAYERS::DIALOG_SWAP_LAYERS(), DIALOG_TARGET_PROPERTIES::DIALOG_TARGET_PROPERTIES(), DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES(), DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES(), DIALOG_TRACK_VIA_SIZE::DIALOG_TRACK_VIA_SIZE(), DIALOG_UPDATE_FROM_PCB::DIALOG_UPDATE_FROM_PCB(), DIALOG_UPDATE_PCB::DIALOG_UPDATE_PCB(), DLG_SELECT_3DMODEL::DLG_SELECT_3DMODEL(), PAGED_DIALOG::finishInitialization(), DIALOG_EDIT_ONE_FIELD::init(), DIALOG_EDIT_LIBRARY_TABLES::InstallPanel(), NETLIST_DIALOG::NETLIST_DIALOG(), DIALOG_GRAPHIC_ITEM_PROPERTIES::OnInitDlg(), DIALOG_SCH_SHEET_PROPS::OnInitDlg(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnInitDlg(), DIALOG_SIM_SETTINGS::onInitDlg(), DIALOG_SPICE_MODEL::onInitDlg(), DIALOG_SIGNAL_LIST::TransferDataToWindow(), DIALOG_UPDATE_FIELDS::TransferDataToWindow(), DIALOG_COLOR_PICKER::TransferDataToWindow(), and DIALOG_BOARD_STATISTICS::TransferDataToWindow().

◆ getPlotFormat()

PLOT_FORMAT DIALOG_PLOT::getPlotFormat ( )
private

Definition at line 382 of file dialog_plot.cpp.

383 {
384  // plot format id's are ordered like displayed in m_plotFormatOpt
387 
388  return plotFmt[m_plotFormatOpt->GetSelection()];
389 }
wxChoice * m_plotFormatOpt
PLOT_FORMAT
Enum PlotFormat is the set of supported output plot formats.
Definition: plotter.h:51

References DXF, GERBER, HPGL, DIALOG_PLOT_BASE::m_plotFormatOpt, PDF, POST, and SVG.

Referenced by applyPlotSettings(), Plot(), and SetPlotFormat().

◆ GetType()

HOLDER_TYPE KIWAY_HOLDER::GetType ( )
inlineinherited

Definition at line 49 of file kiway_holder.h.

49 { return m_type; }
HOLDER_TYPE m_type
Definition: kiway_holder.h:82

References KIWAY_HOLDER::m_type.

Referenced by DIALOG_SHIM::DIALOG_SHIM().

◆ GetUserUnits()

◆ HorizPixelsFromDU()

int DIALOG_SHIM::HorizPixelsFromDU ( int  x)
protectedinherited

Convert an integer number of dialog units to pixels, horizontally.

See SetSizeInDU or wxDialog documentation for more information.

Definition at line 160 of file dialog_shim.cpp.

161 {
162  wxSize sz( x, 0 );
163  return ConvertDialogToPixels( sz ).x;
164 }

Referenced by DIALOG_CHOOSE_COMPONENT::DIALOG_CHOOSE_COMPONENT(), and DIALOG_CHOOSE_FOOTPRINT::DIALOG_CHOOSE_FOOTPRINT().

◆ init_Dialog()

void DIALOG_PLOT::init_Dialog ( )
private

Definition at line 72 of file dialog_plot.cpp.

73 {
74  BOARD* board = m_parent->GetBoard();
75  wxFileName fileName;
76 
77  auto cfg = m_parent->GetPcbNewSettings();
78 
79  m_XScaleAdjust = cfg->m_Plot.fine_scale_x;
80  m_YScaleAdjust = cfg->m_Plot.fine_scale_y;
81 
82  m_zoneFillCheck->SetValue( cfg->m_Plot.check_zones_before_plotting );
83 
84  m_browseButton->SetBitmap( KiBitmap( folder_xpm ) );
85 
86  // m_PSWidthAdjust is stored in mm in user config
87  m_PSWidthAdjust = KiROUND( cfg->m_Plot.ps_fine_width_adjust * IU_PER_MM );
88 
89  // The reasonable width correction value must be in a range of
90  // [-(MinTrackWidth-1), +(MinClearanceValue-1)] decimils.
93 
94  switch( m_plotOpts.GetFormat() )
95  {
96  default:
97  case PLOT_FORMAT::GERBER: m_plotFormatOpt->SetSelection( 0 ); break;
98  case PLOT_FORMAT::POST: m_plotFormatOpt->SetSelection( 1 ); break;
99  case PLOT_FORMAT::SVG: m_plotFormatOpt->SetSelection( 2 ); break;
100  case PLOT_FORMAT::DXF: m_plotFormatOpt->SetSelection( 3 ); break;
101  case PLOT_FORMAT::HPGL: m_plotFormatOpt->SetSelection( 4 ); break;
102  case PLOT_FORMAT::PDF: m_plotFormatOpt->SetSelection( 5 ); break;
103  }
104 
105  // Set units and value for HPGL pen size (this param is in mils).
107 
108  // Test for a reasonable scale value. Set to 1 if problem
112 
115 
116  // Test for a reasonable PS width correction value. Set to 0 if problem.
117  if( m_PSWidthAdjust < m_widthAdjustMinValue || m_PSWidthAdjust > m_widthAdjustMaxValue )
118  m_PSWidthAdjust = 0.;
119 
121 
124 
125  // Could devote a PlotOrder() function in place of UIOrder().
126  m_layerList = board->GetEnabledLayers().UIOrder();
127 
128  // Populate the check list box by all enabled layers names
129  for( LSEQ seq = m_layerList; seq; ++seq )
130  {
131  PCB_LAYER_ID layer = *seq;
132 
133  int checkIndex = m_layerCheckListBox->Append( board->GetLayerName( layer ) );
134 
135  if( m_plotOpts.GetLayerSelection()[layer] )
136  m_layerCheckListBox->Check( checkIndex );
137  }
138 
139  // Option for using proper Gerber extensions. Note also Protel extensions are
140  // a broken feature. However, for now, we need to handle it.
142 
143  // Option for including Gerber attributes, from Gerber X2 format, in the output
144  // In X1 format, they will be added as comments
146 
147  // Option for including Gerber netlist info (from Gerber X2 format) in the output
149 
150  // Option to generate a Gerber job file
152 
153  // Gerber precision for coordinates
154  m_coordFormatCtrl->SetSelection( m_plotOpts.GetGerberPrecision() == 5 ? 0 : 1 );
155 
156  // SVG precision and units for coordinates
158  m_svgUnits->SetSelection( m_plotOpts.GetSvgUseInch() );
159 
160  // Option for excluding contents of "Edges Pcb" layer
162 
163  // Option to exclude pads from silkscreen layers
165 
166  // Option to tent vias
168 
169  // Option to use aux origin
171 
172  // Option to plot page references:
174 
175  // Options to plot texts on footprints
179 
180  // Options to plot pads and vias holes
181  m_drillShapeOpt->SetSelection( m_plotOpts.GetDrillMarksType() );
182 
183  // Scale option
184  m_scaleOpt->SetSelection( m_plotOpts.GetScaleSelection() );
185 
186  // Plot mode
188 
189  // DXF outline mode
191 
192  // DXF text mode
194 
195  // DXF units selection
196  m_DXF_plotUnits->SetSelection( static_cast<int>( m_plotOpts.GetDXFPlotUnits() ) );
197 
198  // Plot mirror option
199  m_plotMirrorOpt->SetValue( m_plotOpts.GetMirror() );
200 
201  // Put vias on mask layer
203 
204  // Initialize a few other parameters, which can also be modified
205  // from the drill dialog
206  reInitDialog();
207 
208  // Update options values:
209  wxCommandEvent cmd_event;
210  SetPlotFormat( cmd_event );
211  OnSetScaleOpt( cmd_event );
212 }
LSEQ m_layerList
Definition: dialog_plot.h:47
const BITMAP_OPAQUE folder_xpm[1]
Definition: folder.cpp:20
double m_YScaleAdjust
Definition: dialog_plot.h:50
bool GetCreateGerberJobFile() const
wxCheckBox * m_useGerberExtensions
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Function GetLayerName returns the name of a layer.
bool GetPlotFrameRef() const
bool GetDXFPlotPolygonMode() const
int GetSmallestClearanceValue()
Function GetSmallestClearanceValue.
wxCheckBox * m_plotPSNegativeOpt
#define PLOT_MIN_SCALE
Definition: pcbplot.h:56
wxCheckBox * m_excludeEdgeLayerOpt
wxString StringFromValue(EDA_UNITS aUnits, double aValue, bool aAddUnitSymbol, bool aUseMils)
Function StringFromValue returns the string from aValue according to units (inch, mm ....
Definition: base_units.cpp:233
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:542
wxCheckBox * m_plotMirrorOpt
LSET GetEnabledLayers() const
Function GetEnabledLayers is a proxy function that calls the corresponding function in m_BoardSetting...
wxCheckBox * m_zoneFillCheck
PCBNEW_SETTINGS * GetPcbNewSettings()
wxChoice * m_plotFormatOpt
wxChoice * m_coordFormatCtrl
UNIT_BINDER m_trackWidthCorrection
Definition: dialog_plot.h:60
bool GetUseGerberX2format() const
double m_XScaleAdjust
Definition: dialog_plot.h:48
wxTextCtrl * m_fineAdjustYCtrl
wxCheckBox * m_DXF_plotModeOpt
bool GetMirror() const
wxCheckBox * m_plotSheetRef
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:80
void SetPlotFormat(wxCommandEvent &event) override
wxTextCtrl * m_fineAdjustXCtrl
PCB_LAYER_ID
A quick note on layer IDs:
bool GetA4Output() const
int GetGerberPrecision() const
wxSpinCtrl * m_svgPrecsision
PLOT_FORMAT GetFormat() const
PCB_EDIT_FRAME * m_parent
Definition: dialog_plot.h:46
int m_widthAdjustMaxValue
Definition: dialog_plot.h:57
bool GetUseGerberProtelExtensions() const
unsigned GetSvgPrecision() const
#define PLOT_MAX_SCALE
Definition: pcbplot.h:57
bool GetIncludeGerberNetlistInfo() const
int m_PSWidthAdjust
Definition: dialog_plot.h:52
PLOT_TEXT_MODE GetTextMode() const
wxCheckBox * m_forcePSA4OutputOpt
void setPlotModeChoiceSelection(EDA_DRAW_MODE_T aPlotMode)
Definition: dialog_plot.h:84
void OnSetScaleOpt(wxCommandEvent &event) override
wxCheckBox * m_useGerberNetAttributes
wxChoice * m_DXF_plotUnits
int m_widthAdjustMinValue
Definition: dialog_plot.h:56
wxCheckBox * m_generateGerberJobFile
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
wxCheckBox * m_DXF_plotTextStrokeFontOpt
PCB_PLOT_PARAMS m_plotOpts
Definition: dialog_plot.h:64
bool GetPlotValue() const
wxChoice * m_scaleOpt
void reInitDialog()
wxCheckBox * m_plotModuleRefOpt
wxCheckBox * m_subtractMaskFromSilk
bool GetSketchPadsOnFabLayers() const
wxCheckBox * m_plotNoViaOnMaskOpt
wxCheckBox * m_plotModuleValueOpt
bool GetPlotViaOnMaskLayer() const
wxChoice * m_drillShapeOpt
BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:181
bool GetSubtractMaskFromSilk() const
virtual void SetValue(int aValue)
Function SetValue Sets new value (in Internal Units) for the text field, taking care of units convers...
wxCheckBox * m_plotInvisibleText
double GetHPGLPenDiameter() const
wxCheckBox * m_sketchPadsOnFabLayers
#define IU_PER_MILS
Definition: plotter.cpp:138
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: util.h:61
wxCheckBox * m_useAuxOriginCheckBox
bool GetPlotInvisibleText() const
int GetScaleSelection() const
UNIT_BINDER m_defaultPenSize
Definition: dialog_plot.h:59
bool GetSvgUseInch() const
wxBitmapButton * m_browseButton
bool GetNegative() const
wxCheckBox * m_useGerberX2Format
BOARD * GetBoard() const
bool GetUseAuxOrigin() const
wxCheckListBox * m_layerCheckListBox
LSET GetLayerSelection() const
DXF_PLOTTER::DXF_UNITS GetDXFPlotUnits() const
LSEQ UIOrder() const
Definition: lset.cpp:837
DrillMarksType GetDrillMarksType() const
bool GetPlotReference() const
bool GetExcludeEdgeLayer() const
EDA_DRAW_MODE_T GetPlotMode() const

References DEFAULT, DXF, folder_xpm, GERBER, PCB_PLOT_PARAMS::GetA4Output(), PCB_BASE_FRAME::GetBoard(), PCB_PLOT_PARAMS::GetCreateGerberJobFile(), BOARD::GetDesignSettings(), PCB_PLOT_PARAMS::GetDrillMarksType(), PCB_PLOT_PARAMS::GetDXFPlotPolygonMode(), PCB_PLOT_PARAMS::GetDXFPlotUnits(), BOARD::GetEnabledLayers(), PCB_PLOT_PARAMS::GetExcludeEdgeLayer(), PCB_PLOT_PARAMS::GetFormat(), PCB_PLOT_PARAMS::GetGerberPrecision(), PCB_PLOT_PARAMS::GetHPGLPenDiameter(), PCB_PLOT_PARAMS::GetIncludeGerberNetlistInfo(), BOARD::GetLayerName(), PCB_PLOT_PARAMS::GetLayerSelection(), PCB_PLOT_PARAMS::GetMirror(), PCB_PLOT_PARAMS::GetNegative(), PCB_BASE_FRAME::GetPcbNewSettings(), PCB_PLOT_PARAMS::GetPlotFrameRef(), PCB_PLOT_PARAMS::GetPlotInvisibleText(), PCB_PLOT_PARAMS::GetPlotMode(), PCB_PLOT_PARAMS::GetPlotReference(), PCB_PLOT_PARAMS::GetPlotValue(), PCB_PLOT_PARAMS::GetPlotViaOnMaskLayer(), PCB_PLOT_PARAMS::GetScaleSelection(), PCB_PLOT_PARAMS::GetSketchPadsOnFabLayers(), BOARD_DESIGN_SETTINGS::GetSmallestClearanceValue(), PCB_PLOT_PARAMS::GetSubtractMaskFromSilk(), PCB_PLOT_PARAMS::GetSvgPrecision(), PCB_PLOT_PARAMS::GetSvgUseInch(), PCB_PLOT_PARAMS::GetTextMode(), PCB_PLOT_PARAMS::GetUseAuxOrigin(), PCB_PLOT_PARAMS::GetUseGerberProtelExtensions(), PCB_PLOT_PARAMS::GetUseGerberX2format(), HPGL, IU_PER_MILS, KiBitmap(), KiROUND(), DIALOG_PLOT_BASE::m_browseButton, DIALOG_PLOT_BASE::m_coordFormatCtrl, m_defaultPenSize, DIALOG_PLOT_BASE::m_drillShapeOpt, DIALOG_PLOT_BASE::m_DXF_plotModeOpt, DIALOG_PLOT_BASE::m_DXF_plotTextStrokeFontOpt, DIALOG_PLOT_BASE::m_DXF_plotUnits, DIALOG_PLOT_BASE::m_excludeEdgeLayerOpt, DIALOG_PLOT_BASE::m_fineAdjustXCtrl, DIALOG_PLOT_BASE::m_fineAdjustYCtrl, DIALOG_PLOT_BASE::m_forcePSA4OutputOpt, DIALOG_PLOT_BASE::m_generateGerberJobFile, DIALOG_PLOT_BASE::m_layerCheckListBox, m_layerList, m_parent, DIALOG_PLOT_BASE::m_plotFormatOpt, DIALOG_PLOT_BASE::m_plotInvisibleText, DIALOG_PLOT_BASE::m_plotMirrorOpt, DIALOG_PLOT_BASE::m_plotModuleRefOpt, DIALOG_PLOT_BASE::m_plotModuleValueOpt, DIALOG_PLOT_BASE::m_plotNoViaOnMaskOpt, m_plotOpts, DIALOG_PLOT_BASE::m_plotPSNegativeOpt, DIALOG_PLOT_BASE::m_plotSheetRef, m_PSWidthAdjust, DIALOG_PLOT_BASE::m_scaleOpt, DIALOG_PLOT_BASE::m_sketchPadsOnFabLayers, DIALOG_PLOT_BASE::m_subtractMaskFromSilk, DIALOG_PLOT_BASE::m_svgPrecsision, DIALOG_PLOT_BASE::m_svgUnits, BOARD_DESIGN_SETTINGS::m_TrackMinWidth, m_trackWidthCorrection, DIALOG_PLOT_BASE::m_useAuxOriginCheckBox, DIALOG_PLOT_BASE::m_useGerberExtensions, DIALOG_PLOT_BASE::m_useGerberNetAttributes, DIALOG_PLOT_BASE::m_useGerberX2Format, m_widthAdjustMaxValue, m_widthAdjustMinValue, m_XScaleAdjust, m_YScaleAdjust, DIALOG_PLOT_BASE::m_zoneFillCheck, OnSetScaleOpt(), PDF, PLOT_MAX_SCALE, PLOT_MIN_SCALE, POST, reInitDialog(), SetPlotFormat(), setPlotModeChoiceSelection(), UNIT_BINDER::SetValue(), StringFromValue(), SVG, LSET::UIOrder(), and UNSCALED.

Referenced by DIALOG_PLOT().

◆ IsCtrl()

static bool DIALOG_SHIM::IsCtrl ( int  aChar,
const wxKeyEvent &  e 
)
inlinestaticinherited

Definition at line 137 of file dialog_shim.h.

138  {
139  return e.GetKeyCode() == aChar && e.ControlDown() && !e.AltDown() &&
140  !e.ShiftDown() && !e.MetaDown();
141  }

Referenced by DIALOG_LABEL_EDITOR::OnCharHook(), and DIALOG_TEXT_PROPERTIES::OnCharHook().

◆ IsQuasiModal()

◆ IsShiftCtrl()

static bool DIALOG_SHIM::IsShiftCtrl ( int  aChar,
const wxKeyEvent &  e 
)
inlinestaticinherited

Definition at line 143 of file dialog_shim.h.

144  {
145  return e.GetKeyCode() == aChar && e.ControlDown() && !e.AltDown() &&
146  e.ShiftDown() && !e.MetaDown();
147  }

Referenced by DIALOG_LABEL_EDITOR::OnCharHook(), and DIALOG_TEXT_PROPERTIES::OnCharHook().

◆ Kiway()

KIWAY& KIWAY_HOLDER::Kiway ( ) const
inlineinherited

Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in.

A KIWAY_HOLDER is not necessarily a KIWAY_PLAYER.

Definition at line 56 of file kiway_holder.h.

57  {
58  wxASSERT( m_kiway ); // smoke out bugs in Debug build, then Release runs fine.
59  return *m_kiway;
60  }
KIWAY * m_kiway
Definition: kiway_holder.h:81

References KIWAY_HOLDER::m_kiway.

Referenced by TREEPROJECT_ITEM::Activate(), FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), PCB_BASE_EDIT_FRAME::AddLibrary(), LIB_CONTROL::AddSymbolToSchematic(), CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX(), COMMON_CONTROL::ConfigurePaths(), DIALOG_CHOOSE_FOOTPRINT::ConstructRightPanel(), DIALOG_CHOOSE_COMPONENT::ConstructRightPanel(), PCB_BASE_FRAME::CreateAndShow3D_Frame(), CVPCB_MAINFRAME::CVPCB_MAINFRAME(), DIALOG_RESCUE_EACH::DIALOG_RESCUE_EACH(), DIALOG_SHIM::DIALOG_SHIM(), CVPCB_MAINFRAME::DisplayStatus(), FIELDS_GRID_TRICKS::doPopupSelection(), FIELDS_EDITOR_GRID_TRICKS::doPopupSelection(), EDIT_TOOL::EditFpInFpEditor(), SCH_EDITOR_CONTROL::EditWithLibEdit(), BACK_ANNOTATE::FetchNetlistFromPCB(), DISPLAY_FOOTPRINTS_FRAME::Get_Module(), FOOTPRINT_EDIT_FRAME::GetPlotSettings(), PCB_EDIT_FRAME::importFile(), KICAD_MANAGER_FRAME::language_change(), KIWAY_PLAYER::language_change(), LIB_TREE_MODEL_ADAPTER::LIB_TREE_MODEL_ADAPTER(), CVPCB_MAINFRAME::LoadFootprintFiles(), KICAD_MANAGER_FRAME::LoadProject(), TEXT_BUTTON_SYMBOL_CHOOSER::OnButtonClick(), TEXT_BUTTON_FP_CHOOSER::OnButtonClick(), KICAD_MANAGER_FRAME::OnCloseWindow(), SCH_EDIT_FRAME::OnCloseWindow(), PL_EDITOR_FRAME::OnExit(), SCH_EDIT_FRAME::OnExit(), FOOTPRINT_EDIT_FRAME::OnExitKiCad(), FOOTPRINT_VIEWER_FRAME::OnExitKiCad(), LIB_EDIT_FRAME::OnExitKiCad(), SAVE_AS_TRAVERSER::OnFile(), KICAD_MANAGER_FRAME::OnImportEagleFiles(), DIALOG_CHOOSE_COMPONENT::OnInitDialog(), SCH_EDIT_FRAME::OnOpenCvpcb(), SCH_EDIT_FRAME::OnOpenPcbnew(), EDA_BASE_FRAME::OnPreferences(), DIALOG_SYMBOL_REMAP::OnRemapSymbols(), DIALOG_EDIT_ONE_FIELD::OnTextValueSelectButtonClick(), FOOTPRINT_EDIT_FRAME::OnUpdateInsertModuleInBoard(), FOOTPRINT_EDIT_FRAME::OnUpdateLoadModuleFromBoard(), SCH_EDIT_FRAME::OnUpdatePCB(), KIWAY_HOLDER::Prj(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList(), LIB_EDIT_FRAME::refreshSchematic(), SCH_EDITOR_CONTROL::rescueProject(), EE_INSPECTION_TOOL::RunSimulation(), CVPCB_MAINFRAME::SaveFootprintAssociation(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), LIB_TREE_MODEL_ADAPTER::SavePinnedItems(), SCH_BASE_FRAME::SelectComponentFromLibBrowser(), SCH_EDIT_FRAME::SendCrossProbeClearHighlight(), SCH_EDIT_FRAME::SendCrossProbeNetName(), PCB_EDIT_FRAME::SendCrossProbeNetName(), CVPCB_MAINFRAME::SendMessageToEESCHEMA(), PCB_EDIT_FRAME::SendMessageToEESCHEMA(), SCH_EDIT_FRAME::SendMessageToPCBNEW(), SCH_EDIT_FRAME::sendNetlistToCvpcb(), SCH_EDIT_FRAME::SetCrossProbeConnection(), FOOTPRINT_EDIT_FRAME::SetPlotSettings(), CVPCB_CONTROL::ShowFootprintViewer(), COMMON_CONTROL::ShowLibraryTable(), COMMON_CONTROL::ShowPlayer(), KICAD_MANAGER_CONTROL::ShowPlayer(), SIM_PLOT_FRAME::SIM_PLOT_FRAME(), PCB_EDITOR_CONTROL::UpdateSchematicFromPCB(), and DIALOG_EXCHANGE_FOOTPRINTS::ViewAndSelectFootprint().

◆ OnChangeDXFPlotMode()

void DIALOG_PLOT::OnChangeDXFPlotMode ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PLOT_BASE.

Definition at line 324 of file dialog_plot.cpp.

325 {
326  // m_DXF_plotTextStrokeFontOpt is disabled if m_DXF_plotModeOpt
327  // is checked (plot in DXF polygon mode)
328  m_DXF_plotTextStrokeFontOpt->Enable( !m_DXF_plotModeOpt->GetValue() );
329 
330  // if m_DXF_plotTextStrokeFontOpt option is disabled (plot DXF in polygon mode),
331  // force m_DXF_plotTextStrokeFontOpt to true to use Pcbnew stroke font
332  if( !m_DXF_plotTextStrokeFontOpt->IsEnabled() )
333  m_DXF_plotTextStrokeFontOpt->SetValue( true );
334 }
wxCheckBox * m_DXF_plotModeOpt
wxCheckBox * m_DXF_plotTextStrokeFontOpt

References DIALOG_PLOT_BASE::m_DXF_plotModeOpt, and DIALOG_PLOT_BASE::m_DXF_plotTextStrokeFontOpt.

Referenced by SetPlotFormat().

◆ OnGerberX2Checked()

void DIALOG_PLOT::OnGerberX2Checked ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PLOT_BASE.

Definition at line 729 of file dialog_plot.cpp.

730 {
731  // Currently: do nothing
732 }

◆ OnInitDialog()

virtual void DIALOG_PLOT_BASE::OnInitDialog ( wxInitDialogEvent &  event)
inlineprotectedvirtualinherited

Definition at line 129 of file dialog_plot_base.h.

129 { event.Skip(); }

Referenced by DIALOG_PLOT_BASE::DIALOG_PLOT_BASE(), and DIALOG_PLOT_BASE::~DIALOG_PLOT_BASE().

◆ OnOutputDirectoryBrowseClicked()

void DIALOG_PLOT::OnOutputDirectoryBrowseClicked ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PLOT_BASE.

Definition at line 349 of file dialog_plot.cpp.

350 {
351  // Build the absolute path of current output directory to preselect it in the file browser.
352  wxString path = ExpandEnvVarSubstitutions( m_outputDirectoryName->GetValue(), &Prj() );
353  path = Prj().AbsolutePath( path );
354 
355  wxDirDialog dirDialog( this, _( "Select Output Directory" ), path );
356 
357  if( dirDialog.ShowModal() == wxID_CANCEL )
358  return;
359 
360  wxFileName dirName = wxFileName::DirName( dirDialog.GetPath() );
361 
362  wxFileName fn( Prj().AbsolutePath( m_parent->GetBoard()->GetFileName() ) );
363  wxString defaultPath = fn.GetPathWithSep();
364  wxString msg;
365  msg.Printf( _( "Do you want to use a path relative to\n\"%s\"" ),
366  GetChars( defaultPath ) );
367 
368  wxMessageDialog dialog( this, msg, _( "Plot Output Directory" ),
369  wxYES_NO | wxICON_QUESTION | wxYES_DEFAULT );
370 
371  if( dialog.ShowModal() == wxID_YES )
372  {
373  if( !dirName.MakeRelativeTo( defaultPath ) )
374  wxMessageBox( _( "Cannot make path relative (target volume different from file volume)!" ),
375  _( "Plot Output Directory" ), wxOK | wxICON_ERROR );
376  }
377 
378  m_outputDirectoryName->SetValue( dirName.GetFullPath() );
379 }
const wxString ExpandEnvVarSubstitutions(const wxString &aString, PROJECT *aProject)
Replace any environment variable & text variable references with their values.
Definition: common.cpp:566
const wxString & GetFileName() const
Definition: class_board.h:245
VTBL_ENTRY const wxString AbsolutePath(const wxString &aFileName) const
Function AbsolutePath fixes up aFileName if it is relative to the project's directory to be an absolu...
Definition: project.cpp:447
PCB_EDIT_FRAME * m_parent
Definition: dialog_plot.h:46
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
wxTextCtrl * m_outputDirectoryName
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:153
#define _(s)
Definition: 3d_actions.cpp:33
BOARD * GetBoard() const

References _, PROJECT::AbsolutePath(), ExpandEnvVarSubstitutions(), PCB_BASE_FRAME::GetBoard(), GetChars(), BOARD::GetFileName(), DIALOG_PLOT_BASE::m_outputDirectoryName, m_parent, and KIWAY_HOLDER::Prj().

◆ OnPaint()

void DIALOG_SHIM::OnPaint ( wxPaintEvent &  event)
inherited

Definition at line 322 of file dialog_shim.cpp.

323 {
324  if( m_firstPaintEvent )
325  {
326 #ifdef __WXMAC__
327  fixOSXCancelButtonIssue( this );
328 #endif
329 
330  selectAllInTextCtrls( GetChildren() );
331 
333  m_initialFocusTarget->SetFocus();
334  else
335  SetFocus(); // Focus the dialog itself
336 
337  m_firstPaintEvent = false;
338  }
339 
340  event.Skip();
341 }
wxWindow * m_initialFocusTarget
Definition: dialog_shim.h:203
bool m_firstPaintEvent
Definition: dialog_shim.h:202
static void selectAllInTextCtrls(wxWindowList &children)

References DIALOG_SHIM::m_firstPaintEvent, DIALOG_SHIM::m_initialFocusTarget, and selectAllInTextCtrls().

Referenced by DIALOG_SHIM::DIALOG_SHIM().

◆ OnPopUpLayers()

void DIALOG_PLOT::OnPopUpLayers ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PLOT_BASE.

Definition at line 256 of file dialog_plot.cpp.

257 {
258  // Build a list of layers for usual fabrication:
259  // copper layers + tech layers without courtyard
260  LSET fab_layer_set = ( LSET::AllCuMask() | LSET::AllTechMask() )
261  & ~LSET( 2, B_CrtYd, F_CrtYd );
262 
263  switch( event.GetId() )
264  {
265  case ID_LAYER_FAB: // Select layers usually needed to build a board
266  for( unsigned i = 0; i < m_layerList.size(); i++ )
267  {
268  LSET layermask( m_layerList[ i ] );
269 
270  if( ( layermask & fab_layer_set ).any() )
271  m_layerCheckListBox->Check( i, true );
272  else
273  m_layerCheckListBox->Check( i, false );
274  }
275  break;
276 
278  for( unsigned i = 0; i < m_layerList.size(); i++ )
279  {
280  if( IsCopperLayer( m_layerList[i] ) )
281  m_layerCheckListBox->Check( i, true );
282  }
283  break;
284 
286  for( unsigned i = 0; i < m_layerList.size(); i++ )
287  {
288  if( IsCopperLayer( m_layerList[i] ) )
289  m_layerCheckListBox->Check( i, false );
290  }
291  break;
292 
294  for( unsigned i = 0; i < m_layerList.size(); i++ )
295  m_layerCheckListBox->Check( i, true );
296  break;
297 
299  for( unsigned i = 0; i < m_layerList.size(); i++ )
300  m_layerCheckListBox->Check( i, false );
301  break;
302 
303  default:
304  break;
305  }
306 }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Function AllCuMask returns a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:710
LSEQ m_layerList
Definition: dialog_plot.h:47
static LSET AllTechMask()
Function AllTechMask returns a mask holding all technical layers (no CU layer) on both side.
Definition: lset.cpp:780
LSET is a set of PCB_LAYER_IDs.
bool IsCopperLayer(LAYER_NUM aLayerId)
Function IsCopperLayer tests whether a layer is a copper layer.
wxCheckListBox * m_layerCheckListBox

References LSET::AllCuMask(), LSET::AllTechMask(), B_CrtYd, F_CrtYd, DIALOG_PLOT_BASE::ID_DESELECT_ALL_LAYERS, DIALOG_PLOT_BASE::ID_DESELECT_COPPER_LAYERS, DIALOG_PLOT_BASE::ID_LAYER_FAB, DIALOG_PLOT_BASE::ID_SELECT_ALL_LAYERS, DIALOG_PLOT_BASE::ID_SELECT_COPPER_LAYERS, IsCopperLayer(), DIALOG_PLOT_BASE::m_layerCheckListBox, and m_layerList.

◆ OnRightClick()

void DIALOG_PLOT::OnRightClick ( wxMouseEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PLOT_BASE.

Definition at line 249 of file dialog_plot.cpp.

250 {
251  PopupMenu( m_popMenu );
252 }

References DIALOG_PLOT_BASE::m_popMenu.

◆ onRunDRC()

void DIALOG_PLOT::onRunDRC ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PLOT_BASE.

Definition at line 876 of file dialog_plot.cpp.

877 {
878  PCB_EDIT_FRAME* parent = dynamic_cast<PCB_EDIT_FRAME*>( GetParent() );
879 
880  if( parent )
881  {
882  DRC* drcTool = parent->GetToolManager()->GetTool<DRC>();
883 
884  // First close an existing dialog if open
885  // (low probability, but can happen)
886  drcTool->DestroyDRCDialog( wxID_OK );
887 
888  // Open a new drc dialod, with the right parent frame, and in Modal Mode
889  drcTool->ShowDRCDialog( this );
890 
891  // Update DRC warnings on return to this dialog
892  reInitDialog();
893  }
894 }
void DestroyDRCDialog(int aReason)
Deletes this ui dialog box and zeros out its pointer to remember the state of the dialog's existence.
void ShowDRCDialog(wxWindow *aParent)
Open a dialog and prompts the user, then if a test run button is clicked, runs the test(s) and create...
void reInitDialog()
Design Rule Checker object that performs all the DRC tests.
Definition: drc.h:149
PCB_EDIT_FRAME is the main frame for Pcbnew.
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
Definition: tools_holder.h:74

References DRC::DestroyDRCDialog(), TOOL_MANAGER::GetTool(), TOOLS_HOLDER::GetToolManager(), reInitDialog(), and DRC::ShowDRCDialog().

◆ OnSetScaleOpt()

void DIALOG_PLOT::OnSetScaleOpt ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PLOT_BASE.

Definition at line 337 of file dialog_plot.cpp.

338 {
339  /* Disable sheet reference for scale != 1:1 */
340  bool scale1 = ( m_scaleOpt->GetSelection() == 1 );
341 
342  m_plotSheetRef->Enable( scale1 );
343 
344  if( !scale1 )
345  m_plotSheetRef->SetValue( false );
346 }
wxCheckBox * m_plotSheetRef
wxChoice * m_scaleOpt

References DIALOG_PLOT_BASE::m_plotSheetRef, and DIALOG_PLOT_BASE::m_scaleOpt.

Referenced by init_Dialog(), and SetPlotFormat().

◆ Plot()

void DIALOG_PLOT::Plot ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PLOT_BASE.

Definition at line 735 of file dialog_plot.cpp.

736 {
737  BOARD* board = m_parent->GetBoard();
738 
740 
742 
743  // If no layer selected, we have nothing plotted.
744  // Prompt user if it happens because he could think there is a bug in Pcbnew.
745  if( !m_plotOpts.GetLayerSelection().any() )
746  {
747  DisplayError( this, _( "No layer selected, Nothing to plot" ) );
748  return;
749  }
750 
751  // Create output directory if it does not exist (also transform it in
752  // absolute form). Bail if it fails
754  wxFileName outputDir = wxFileName::DirName( path );
755  wxString boardFilename = m_parent->GetBoard()->GetFileName();
756  REPORTER& reporter = m_messagesPanel->Reporter();
757 
758  if( !EnsureFileDirectoryExists( &outputDir, boardFilename, &reporter ) )
759  {
760  wxString msg;
761  msg.Printf( _( "Could not write plot files to folder \"%s\"." ),
762  GetChars( outputDir.GetPath() ) );
763  DisplayError( this, msg );
764  return;
765  }
766 
767  if( m_zoneFillCheck->GetValue() )
768  m_parent->GetToolManager()->GetTool<ZONE_FILLER_TOOL>()->CheckAllZones( this );
769 
770  m_plotOpts.SetAutoScale( false );
771 
772  switch( m_plotOpts.GetScaleSelection() )
773  {
774  default: m_plotOpts.SetScale( 1 ); break;
775  case 0: m_plotOpts.SetAutoScale( true ); break;
776  case 2: m_plotOpts.SetScale( 1.5 ); break;
777  case 3: m_plotOpts.SetScale( 2 ); break;
778  case 4: m_plotOpts.SetScale( 3 ); break;
779  }
780 
781  /* If the scale factor edit controls are disabled or the scale value
782  * is 0, don't adjust the base scale factor. This fixes a bug when
783  * the default scale adjust is initialized to 0 and saved in program
784  * settings resulting in a divide by zero fault.
785  */
787  {
788  if( m_XScaleAdjust != 0.0 )
790 
791  if( m_YScaleAdjust != 0.0 )
793 
795  }
796 
797  wxString file_ext( GetDefaultPlotExtension( m_plotOpts.GetFormat() ) );
798 
799  // Test for a reasonable scale value
800  // XXX could this actually happen? isn't it constrained in the apply
801  // function?
803  DisplayInfoMessage( this, _( "Warning: Scale option set to a very small value" ) );
804 
806  DisplayInfoMessage( this, _( "Warning: Scale option set to a very large value" ) );
807 
808  GERBER_JOBFILE_WRITER jobfile_writer( board, &reporter );
809 
810  // Save the current plot options in the board
812 
813  wxBusyCursor dummy;
814 
815  for( LSEQ seq = m_plotOpts.GetLayerSelection().UIOrder(); seq; ++seq )
816  {
817  PCB_LAYER_ID layer = *seq;
818 
819  // All copper layers that are disabled are actually selected
820  // This is due to wonkyness in automatically selecting copper layers
821  // for plotting when adding more than two layers to a board.
822  // If plot options become accessible to the layers setup dialog
823  // please move this functionality there!
824  // This skips a copper layer if it is actually disabled on the board.
825  if( ( LSET::AllCuMask() & ~board->GetEnabledLayers() )[layer] )
826  continue;
827 
828  // Pick the basename from the board file
829  wxFileName fn( boardFilename );
830 
831  // Use Gerber Extensions based on layer number
832  // (See http://en.wikipedia.org/wiki/Gerber_File)
834  file_ext = GetGerberProtelExtension( layer );
835 
836  BuildPlotFileName( &fn, outputDir.GetPath(), board->GetLayerName( layer ), file_ext );
837  wxString fullname = fn.GetFullName();
838  jobfile_writer.AddGbrFile( layer, fullname );
839 
840  LOCALE_IO toggle;
841 
842  PLOTTER* plotter = StartPlotBoard( board, &m_plotOpts, layer, fn.GetFullPath(), wxEmptyString );
843 
844  // Print diags in messages box:
845  wxString msg;
846 
847  if( plotter )
848  {
849  PlotOneBoardLayer( board, plotter, layer, m_plotOpts );
850  plotter->EndPlot();
851  delete plotter;
852 
853  msg.Printf( _( "Plot file \"%s\" created." ), fn.GetFullPath() );
854  reporter.Report( msg, RPT_SEVERITY_ACTION );
855  }
856  else
857  {
858  msg.Printf( _( "Unable to create file \"%s\"." ), fn.GetFullPath() );
859  reporter.Report( msg, RPT_SEVERITY_ERROR );
860  }
861 
862  wxSafeYield(); // displays report message.
863  }
864 
866  {
867  // Pick the basename from the board file
868  wxFileName fn( boardFilename );
869  // Build gerber job file from basename
870  BuildPlotFileName( &fn, outputDir.GetPath(), "job", GerberJobFileExtension );
871  jobfile_writer.CreateJobFile( fn.GetFullPath() );
872  }
873 }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Function AllCuMask returns a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:710
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:239
WX_HTML_REPORT_PANEL * m_messagesPanel
double m_YScaleAdjust
Definition: dialog_plot.h:50
bool GetCreateGerberJobFile() const
wxCheckBox * m_useGerberExtensions
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Function GetLayerName returns the name of a layer.
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Definition: common.h:214
wxString GetDefaultPlotExtension(PLOT_FORMAT aFormat)
Returns the default plot extension for a format.
void SetSketchPadLineWidth(int aWidth)
void PlotOneBoardLayer(BOARD *aBoard, PLOTTER *aPlotter, PCB_LAYER_ID aLayer, const PCB_PLOT_PARAMS &aPlotOpt)
Function PlotOneBoardLayer main function to plot one copper or technical layer.
#define PLOT_MIN_SCALE
Definition: pcbplot.h:56
const wxString GetGerberProtelExtension(LAYER_NUM aLayer)
Function GetGerberProtelExtension.
Definition: pcbplot.cpp:48
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:542
LSET GetEnabledLayers() const
Function GetEnabledLayers is a proxy function that calls the corresponding function in m_BoardSetting...
wxCheckBox * m_zoneFillCheck
const wxString ExpandEnvVarSubstitutions(const wxString &aString, PROJECT *aProject)
Replace any environment variable & text variable references with their values.
Definition: common.cpp:566
REPORTER is a pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:62
const wxString & GetFileName() const
Definition: class_board.h:245
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)=0
Function Report is a pure virtual function to override in the derived object.
double GetScale() const
double m_XScaleAdjust
Definition: dialog_plot.h:48
int GetLineThickness(PCB_LAYER_ID aLayer) const
Function GetLineThickness Returns the default graphic segment thickness from the layer class for the ...
virtual bool EndPlot()=0
PCB_LAYER_ID
A quick note on layer IDs:
ZONE_FILLER_TOOL.
GERBER_JOBFILE_WRITER is a class used to create Gerber job file a Gerber job file stores info to make...
PLOT_FORMAT GetFormat() const
PCB_EDIT_FRAME * m_parent
Definition: dialog_plot.h:46
PLOT_FORMAT getPlotFormat()
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
bool EnsureFileDirectoryExists(wxFileName *aTargetFullFileName, const wxString &aBaseFilename, REPORTER *aReporter)
Make aTargetFullFileName absolute and create the path of this file if it doesn't yet exist.
Definition: common.cpp:594
REPORTER & Reporter()
returns the reporter object that reports to this panel
#define PLOT_MAX_SCALE
Definition: pcbplot.h:57
int m_PSWidthAdjust
Definition: dialog_plot.h:52
const std::string GerberJobFileExtension
virtual void SetPlotSettings(const PCB_PLOT_PARAMS &aSettings)
void SetScale(double aVal)
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
PCB_PLOT_PARAMS m_plotOpts
Definition: dialog_plot.h:64
wxString GetOutputDirectory() const
void SetFineScaleAdjustX(double aVal)
void BuildPlotFileName(wxFileName *aFilename, const wxString &aOutputDir, const wxString &aSuffix, const wxString &aExtension)
Function BuildPlotFileName (helper function) Complete a plot filename: forces the output directory,...
Definition: pcbplot.cpp:373
Base plotter engine class.
Definition: plotter.h:104
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:153
void applyPlotSettings()
void SetWidthAdjust(int aVal)
static LIB_PART * dummy()
Used to draw a dummy shape when a LIB_PART is not found in library.
BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:181
#define _(s)
Definition: 3d_actions.cpp:33
void SetAutoScale(bool aFlag)
void SetFineScaleAdjustY(double aVal)
int GetScaleSelection() const
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
Definition: tools_holder.h:74
PLOTTER * StartPlotBoard(BOARD *aBoard, PCB_PLOT_PARAMS *aPlotOpts, int aLayer, const wxString &aFullFileName, const wxString &aSheetDesc)
Open a new plotfile using the options (and especially the format) specified in the options and prepar...
BOARD * GetBoard() const
LSET GetLayerSelection() const
LSEQ UIOrder() const
Definition: lset.cpp:837
void DisplayInfoMessage(wxWindow *aParent, const wxString &aMessage, const wxString &aExtraInfo)
Display an informational message box with aMessage.
Definition: confirm.cpp:267

References _, GERBER_JOBFILE_WRITER::AddGbrFile(), LSET::AllCuMask(), applyPlotSettings(), BuildPlotFileName(), GERBER_JOBFILE_WRITER::CreateJobFile(), DisplayError(), DisplayInfoMessage(), dummy(), PLOTTER::EndPlot(), EnsureFileDirectoryExists(), ExpandEnvVarSubstitutions(), F_Fab, GERBER, GerberJobFileExtension, PCB_BASE_FRAME::GetBoard(), GetChars(), PCB_PLOT_PARAMS::GetCreateGerberJobFile(), GetDefaultPlotExtension(), BOARD::GetDesignSettings(), BOARD::GetEnabledLayers(), BOARD::GetFileName(), PCB_PLOT_PARAMS::GetFormat(), GetGerberProtelExtension(), BOARD::GetLayerName(), PCB_PLOT_PARAMS::GetLayerSelection(), BOARD_DESIGN_SETTINGS::GetLineThickness(), PCB_PLOT_PARAMS::GetOutputDirectory(), getPlotFormat(), PCB_PLOT_PARAMS::GetScale(), PCB_PLOT_PARAMS::GetScaleSelection(), TOOL_MANAGER::GetTool(), TOOLS_HOLDER::GetToolManager(), DIALOG_PLOT_BASE::m_messagesPanel, m_parent, m_plotOpts, m_PSWidthAdjust, DIALOG_PLOT_BASE::m_useGerberExtensions, m_XScaleAdjust, m_YScaleAdjust, DIALOG_PLOT_BASE::m_zoneFillCheck, PLOT_MAX_SCALE, PLOT_MIN_SCALE, PlotOneBoardLayer(), POST, KIWAY_HOLDER::Prj(), REPORTER::Report(), WX_HTML_REPORT_PANEL::Reporter(), RPT_SEVERITY_ACTION, RPT_SEVERITY_ERROR, PCB_PLOT_PARAMS::SetAutoScale(), PCB_PLOT_PARAMS::SetFineScaleAdjustX(), PCB_PLOT_PARAMS::SetFineScaleAdjustY(), PCB_BASE_FRAME::SetPlotSettings(), PCB_PLOT_PARAMS::SetScale(), PCB_PLOT_PARAMS::SetSketchPadLineWidth(), PCB_PLOT_PARAMS::SetWidthAdjust(), StartPlotBoard(), and LSET::UIOrder().

◆ Prj()

PROJECT & KIWAY_HOLDER::Prj ( ) const
inherited

Function Prj returns a reference to the PROJECT "associated with" this KIWAY.

Definition at line 35 of file kiway_holder.cpp.

36 {
37  return Kiway().Prj();
38 }
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_holder.h:56
VTBL_ENTRY PROJECT & Prj() const
Function Prj returns the PROJECT associated with this KIWAY.
Definition: kiway.cpp:171

References KIWAY_HOLDER::Kiway(), and KIWAY::Prj().

Referenced by PCB_BASE_EDIT_FRAME::AddLibrary(), LIB_MANAGER::addLibrary(), SCH_EDIT_FRAME::AppendSchematic(), PCB_EDIT_FRAME::ArchiveModulesOnBoard(), DIALOG_SYMBOL_REMAP::backupProject(), CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX(), DIALOG_FOOTPRINT_FP_EDITOR::Cfg3DPath(), DIALOG_FOOTPRINT_BOARD_EDITOR::Cfg3DPath(), DIALOG_GEN_FOOTPRINT_POSITION::CreateGerberFiles(), PCB_BASE_EDIT_FRAME::CreateNewLibrary(), KICAD_MANAGER_FRAME::CreateNewProject(), DIALOG_PLOT_SCHEMATIC::createPlotFileName(), DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable(), FOOTPRINT_EDIT_FRAME::DeleteModuleFromLibrary(), DIALOG_BOARD_SETUP::DIALOG_BOARD_SETUP(), DIALOG_BOARD_STATISTICS::DIALOG_BOARD_STATISTICS(), DIALOG_CHOOSE_COMPONENT::DIALOG_CHOOSE_COMPONENT(), DIALOG_CHOOSE_FOOTPRINT::DIALOG_CHOOSE_FOOTPRINT(), DIALOG_CONFIG_EQUFILES::DIALOG_CONFIG_EQUFILES(), DIALOG_FOOTPRINT_BOARD_EDITOR::DIALOG_FOOTPRINT_BOARD_EDITOR(), DIALOG_FOOTPRINT_FP_EDITOR::DIALOG_FOOTPRINT_FP_EDITOR(), DIALOG_PAGES_SETTINGS::DIALOG_PAGES_SETTINGS(), DIALOG_SCHEMATIC_SETUP::DIALOG_SCHEMATIC_SETUP(), DIALOG_SYMBOL_REMAP::DIALOG_SYMBOL_REMAP(), LIB_VIEW_FRAME::DisplayLibInfos(), CVPCB_MAINFRAME::DisplayStatus(), PL_DRAW_PANEL_GAL::DisplayWorksheet(), PCB_EDIT_FRAME::doAutoSave(), FIELDS_GRID_TRICKS::doPopupSelection(), FIELDS_EDITOR_GRID_TRICKS::doPopupSelection(), KICAD_MANAGER_CONTROL::Execute(), PCB_EDIT_FRAME::Export_IDF3(), DIALOG_EXPORT_SVG::ExportSVGFile(), LIB_CONTROL::ExportSymbolAsSVG(), LIB_CONTROL::ExportView(), PCB_EDIT_FRAME::ExportVRML_File(), PCB_EDIT_FRAME::Files_io_from_id(), PCB_EDIT_FRAME::GenD356File(), DIALOG_GENDRILL::GenDrillAndMapFiles(), DISPLAY_FOOTPRINTS_FRAME::Get_Module(), FOOTPRINT_VIEWER_FRAME::getCurFootprintName(), LIB_EDIT_FRAME::GetCurLib(), FOOTPRINT_VIEWER_FRAME::getCurNickname(), SCH_BASE_FRAME::GetLibPart(), DIALOG_SYMBOL_REMAP::getLibsNotInGlobalSymbolLibTable(), KICAD_MANAGER_FRAME::GetProjectFileName(), LIB_VIEW_FRAME::GetSelectedSymbol(), FP_THREAD_IFACE::GetTable(), PCB_EDIT_FRAME::importFile(), SCH_EDIT_FRAME::importFile(), SCH_EDITOR_CONTROL::ImportFPAssignments(), FOOTPRINT_EDIT_FRAME::initLibraryTree(), LIB_EDIT_FRAME::KiwayMailIn(), EDA_DRAW_FRAME::LibraryFileBrowser(), LIB_EDIT_FRAME::LoadComponentFromCurrentLib(), CVPCB_MAINFRAME::LoadFootprintFiles(), DIALOG_SPICE_MODEL::loadLibrary(), LIB_EDIT_FRAME::LoadOneSymbol(), KICAD_MANAGER_FRAME::LoadProject(), SCH_EDIT_FRAME::LoadProject(), SCH_EDIT_FRAME::LoadProjectFile(), CVPCB_MAINFRAME::LoadProjectFile(), PCB_EDIT_FRAME::LoadProjectSettings(), DRC::LoadRules(), SCH_EDIT_FRAME::LoadSheetFromFile(), DIALOG_FOOTPRINT_FP_EDITOR::On3DModelCellChanged(), DIALOG_FOOTPRINT_BOARD_EDITOR::On3DModelCellChanged(), FOOTPRINT_VIEWER_FRAME::OnActivate(), DIALOG_FOOTPRINT_FP_EDITOR::OnAdd3DModel(), DIALOG_FOOTPRINT_BOARD_EDITOR::OnAdd3DModel(), KICAD_MANAGER_FRAME::OnBrowseInFileExplorer(), TEXT_BUTTON_URL::OnButtonClick(), TEXT_BUTTON_FILE_BROWSER::OnButtonClick(), DIALOG_EDIT_COMPONENTS_LIBID::onClickOrphansButton(), SCH_EDIT_FRAME::OnCloseWindow(), DIALOG_GENDRILL::OnGenReportFile(), SCH_EDIT_FRAME::OnImportProject(), DIALOG_CHOOSE_COMPONENT::OnInitDialog(), SCH_EDIT_FRAME::OnOpenCvpcb(), KICAD_MANAGER_FRAME::OnOpenFileInTextEditor(), DIALOG_NETLIST::OnOpenNetlistClick(), SCH_EDIT_FRAME::OnOpenPcbnew(), DIALOG_EXPORT_SVG::OnOutputDirectoryBrowseClicked(), OnOutputDirectoryBrowseClicked(), DIALOG_PLOT_SCHEMATIC::OnOutputDirectoryBrowseClicked(), DIALOG_GEN_FOOTPRINT_POSITION::OnOutputDirectoryBrowseClicked(), DIALOG_GENDRILL::OnOutputDirectoryBrowseClicked(), DIALOG_SYMBOL_REMAP::OnRemapSymbols(), DIALOG_BOM::OnRunGenerator(), FOOTPRINT_EDIT_FRAME::OnSaveFootprintAsPng(), DIALOG_ERC::OnSaveReport(), DIALOG_DRC::OnSaveReport(), DIALOG_SPICE_MODEL::onSelectLibrary(), LIB_VIEW_FRAME::OnSelectSymbol(), KICAD_MANAGER_FRAME::OnUnarchiveFiles(), SCH_EDIT_FRAME::OnUpdatePCB(), SCH_EDIT_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::OpenProjectFiles(), PANEL_PREV_3D::PANEL_PREV_3D(), SCH_EDITOR_CONTROL::Paste(), FOOTPRINT_EDITOR_TOOLS::PasteFootprint(), PCB_BASE_EDIT_FRAME::PCB_BASE_EDIT_FRAME(), Plot(), DIALOG_PLOT_SCHEMATIC::Plot_1_Page_HPGL(), DIALOG_PLOT_SCHEMATIC::PlotOneSheetDXF(), DIALOG_CHOOSE_COMPONENT::PopulateFootprintSelector(), SCH_EDITOR_CONTROL::Print(), SCH_EDIT_FRAME::PrintPage(), EDA_DRAW_FRAME::PrintWorkSheet(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), PCB_EDIT_FRAME::RecreateCmpFileFromBoard(), FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList(), FOOTPRINT_VIEWER_FRAME::ReCreateLibraryList(), LIB_VIEW_FRAME::ReCreateListCmp(), LIB_VIEW_FRAME::ReCreateListLib(), EDA_3D_VIEWER::ReloadRequest(), DIALOG_SYMBOL_REMAP::remapSymbolToLibTable(), SCH_EDITOR_CONTROL::RescueLegacyProject(), SCH_EDITOR_CONTROL::RescueSymbolLibTableProject(), FOOTPRINT_EDIT_FRAME::restoreLastFootprint(), FOOTPRINT_EDIT_FRAME::retainLastFootprint(), DIALOG_EDIT_COMPONENTS_LIBID::revertChanges(), SCH_EDIT_FRAME::SaveEEFile(), FOOTPRINT_EDIT_FRAME::SaveFootprint(), FOOTPRINT_EDIT_FRAME::SaveFootprintAs(), FOOTPRINT_EDIT_FRAME::SaveFootprintInLibrary(), LIB_EDIT_FRAME::saveLibrary(), LIB_EDIT_FRAME::SaveOneSymbol(), LIB_EDIT_FRAME::savePartAs(), SCH_EDIT_FRAME::SaveProject(), CVPCB_MAINFRAME::SaveProjectFile(), SCH_EDIT_FRAME::SaveProjectSettings(), PCB_EDIT_FRAME::SaveProjectSettings(), DIALOG_BOARD_STATISTICS::saveReportClicked(), SCH_BASE_FRAME::saveSymbolLibTables(), FOOTPRINT_VIEWER_FRAME::SelectAndViewFootprint(), SCH_BASE_FRAME::SelectCompFromLibTree(), PCB_BASE_FRAME::SelectLibrary(), LIB_EDIT_FRAME::SelectLibraryFromList(), LIB_EDIT_FRAME::selectSymLibTable(), FOOTPRINT_VIEWER_FRAME::setCurFootprintName(), LIB_EDIT_FRAME::SetCurLib(), FOOTPRINT_VIEWER_FRAME::setCurNickname(), LIB_EDIT_FRAME::SetCurPart(), GERBVIEW_FRAME::SetPageSettings(), KICAD_MANAGER_FRAME::SetProjectFileName(), EE_INSPECTION_TOOL::ShowDatasheet(), DIALOG_CHOOSE_COMPONENT::ShowFootprintFor(), COMMON_CONTROL::ShowHelp(), LIB_VIEW_FRAME::ShowModal(), FOOTPRINT_VIEWER_FRAME::ShowModal(), SIM_PLOT_FRAME::SIM_PLOT_FRAME(), LIB_MANAGER::symTable(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::Sync(), FOOTPRINT_EDIT_FRAME::SyncLibraryTree(), EDA_3D_VIEWER::takeScreenshot(), PANEL_SETUP_RULES::TransferDataFromWindow(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::TransferDataFromWindow(), NETLIST_DIALOG::TransferDataFromWindow(), DIALOG_EDIT_COMPONENTS_LIBID::TransferDataFromWindow(), PANEL_SETUP_RULES::TransferDataToWindow(), DIALOG_FOOTPRINT_FP_EDITOR::TransferDataToWindow(), DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataToWindow(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::UpdateFieldsFromLibrary(), DIALOG_PAGES_SETTINGS::UpdatePageLayoutExample(), FOOTPRINT_VIEWER_FRAME::UpdateTitle(), FOOTPRINT_EDIT_FRAME::updateTitle(), SCH_EDIT_FRAME::UpdateTitle(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::Validate(), SCH_EDIT_FRAME::WriteNetListFile(), DIALOG_FOOTPRINT_BOARD_EDITOR::~DIALOG_FOOTPRINT_BOARD_EDITOR(), DIALOG_FOOTPRINT_FP_EDITOR::~DIALOG_FOOTPRINT_FP_EDITOR(), and PCB_BASE_EDIT_FRAME::~PCB_BASE_EDIT_FRAME().

◆ reInitDialog()

void DIALOG_PLOT::reInitDialog ( )
private

Definition at line 215 of file dialog_plot.cpp.

216 {
217  // after calling the Drill or DRC dialogs some parameters can be modified....
218 
219  // Output directory
221 
222  // Origin of coordinates:
224 
225  int knownViolations = 0;
226  int exclusions = 0;
227 
228  for( MARKER_PCB* marker : m_parent->GetBoard()->Markers() )
229  {
230  if( marker->IsExcluded() )
231  exclusions++;
232  else
233  knownViolations++;
234  }
235 
236  if( knownViolations || exclusions )
237  {
239  knownViolations,
240  exclusions ) );
241  m_DRCExclusionsWarning->Show();
242  }
243  else
244  m_DRCExclusionsWarning->Hide();
245 }
MARKERS & Markers()
Definition: class_board.h:275
PCB_EDIT_FRAME * m_parent
Definition: dialog_plot.h:46
wxTextCtrl * m_outputDirectoryName
PCB_PLOT_PARAMS m_plotOpts
Definition: dialog_plot.h:64
wxString GetOutputDirectory() const
wxString m_DRCWarningTemplate
Definition: dialog_plot.h:62
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
wxCheckBox * m_useAuxOriginCheckBox
BOARD * GetBoard() const
bool GetUseAuxOrigin() const
wxStaticText * m_DRCExclusionsWarning

References Format(), PCB_BASE_FRAME::GetBoard(), PCB_PLOT_PARAMS::GetOutputDirectory(), PCB_PLOT_PARAMS::GetUseAuxOrigin(), DIALOG_PLOT_BASE::m_DRCExclusionsWarning, m_DRCWarningTemplate, DIALOG_PLOT_BASE::m_outputDirectoryName, m_parent, m_plotOpts, DIALOG_PLOT_BASE::m_useAuxOriginCheckBox, and BOARD::Markers().

Referenced by CreateDrillFile(), init_Dialog(), and onRunDRC().

◆ ResetSize()

void DIALOG_SHIM::ResetSize ( )
protectedinherited

Clear the existing dialog size and position.

This will cause the dialog size to be clear so the next time the dialog is shown the sizers will layout the dialog accordingly. This useful when there are dialog windows that size changes due to layout dependency hidden controls.

Definition at line 239 of file dialog_shim.cpp.

240 {
241  const char* hash_key;
242 
243  if( m_hash_key.size() )
244  {
245  // a special case like EDA_LIST_DIALOG, which has multiple uses.
246  hash_key = m_hash_key.c_str();
247  }
248  else
249  {
250  hash_key = typeid(*this).name();
251  }
252 
253  RECT_MAP::iterator it = class_map.find( hash_key );
254 
255  if( it == class_map.end() )
256  return;
257 
258  EDA_RECT rect = it->second;
259  rect.SetSize( 0, 0 );
260  class_map[ hash_key ] = rect;
261 }
std::string m_hash_key
Definition: dialog_shim.h:197
static RECT_MAP class_map
void SetSize(const wxSize &size)
Definition: eda_rect.h:144
EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44

References class_map, DIALOG_SHIM::m_hash_key, and EDA_RECT::SetSize().

Referenced by DIALOG_EDIT_COMPONENT_IN_LIBRARY::DIALOG_EDIT_COMPONENT_IN_LIBRARY().

◆ SetInitialFocus()

void DIALOG_SHIM::SetInitialFocus ( wxWindow *  aWindow)
inlineinherited

Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.

Definition at line 115 of file dialog_shim.h.

116  {
117  m_initialFocusTarget = aWindow;
118  }
wxWindow * m_initialFocusTarget
Definition: dialog_shim.h:203

References DIALOG_SHIM::m_initialFocusTarget.

Referenced by DIALOG_BOM::DIALOG_BOM(), DIALOG_CHOOSE_COMPONENT::DIALOG_CHOOSE_COMPONENT(), DIALOG_CHOOSE_FOOTPRINT::DIALOG_CHOOSE_FOOTPRINT(), DIALOG_CONFIGURE_PATHS::DIALOG_CONFIGURE_PATHS(), DIALOG_EDIT_LINE_STYLE::DIALOG_EDIT_LINE_STYLE(), DIALOG_EDIT_SHEET_PIN::DIALOG_EDIT_SHEET_PIN(), DIALOG_FIELDS_EDITOR_GLOBAL::DIALOG_FIELDS_EDITOR_GLOBAL(), DIALOG_FIND::DIALOG_FIND(), DIALOG_FOOTPRINT_BOARD_EDITOR::DIALOG_FOOTPRINT_BOARD_EDITOR(), DIALOG_FOOTPRINT_FP_EDITOR::DIALOG_FOOTPRINT_FP_EDITOR(), DIALOG_FP_PLUGIN_OPTIONS::DIALOG_FP_PLUGIN_OPTIONS(), DIALOG_GRAPHIC_ITEM_PROPERTIES::DIALOG_GRAPHIC_ITEM_PROPERTIES(), DIALOG_IMPORT_GFX::DIALOG_IMPORT_GFX(), DIALOG_LABEL_EDITOR::DIALOG_LABEL_EDITOR(), DIALOG_LIB_EDIT_DRAW_ITEM::DIALOG_LIB_EDIT_DRAW_ITEM(), DIALOG_LIB_EDIT_PIN::DIALOG_LIB_EDIT_PIN(), DIALOG_LIB_EDIT_TEXT::DIALOG_LIB_EDIT_TEXT(), DIALOG_PAD_PRIMITIVES_PROPERTIES::DIALOG_PAD_PRIMITIVES_PROPERTIES(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), DIALOG_POSITION_RELATIVE::DIALOG_POSITION_RELATIVE(), DIALOG_SCH_FIND::DIALOG_SCH_FIND(), DIALOG_SET_GRID::DIALOG_SET_GRID(), DIALOG_TARGET_PROPERTIES::DIALOG_TARGET_PROPERTIES(), DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES(), DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES(), DIALOG_EDIT_ONE_FIELD::init(), DIALOG_EXCHANGE_FOOTPRINTS::OnMatchAllClicked(), DIALOG_EXCHANGE_FOOTPRINTS::OnMatchIDClicked(), DIALOG_EXCHANGE_FOOTPRINTS::OnMatchRefClicked(), DIALOG_EXCHANGE_FOOTPRINTS::OnMatchSelectedClicked(), DIALOG_EXCHANGE_FOOTPRINTS::OnMatchValueClicked(), PANEL_FP_LIB_TABLE::PANEL_FP_LIB_TABLE(), PANEL_SYM_LIB_TABLE::PANEL_SYM_LIB_TABLE(), FOOTPRINT_EDIT_FRAME::SaveFootprintAs(), LIB_EDIT_FRAME::savePartAs(), DIALOG_KEEPOUT_AREA_PROPERTIES::TransferDataToWindow(), DIALOG_NON_COPPER_ZONES_EDITOR::TransferDataToWindow(), and DIALOG_COPPER_ZONE::TransferDataToWindow().

◆ SetKiway()

void KIWAY_HOLDER::SetKiway ( wxWindow *  aDest,
KIWAY aKiway 
)
inherited

Function SetKiway.

Parameters
aDestis the recipient of aKiway pointer. It is only used for debugging, since "this" is not a wxWindow*. "this" is a KIWAY_HOLDER mix-in.
aKiwayis often from a parent window, or from KIFACE::CreateWindow().

Definition at line 42 of file kiway_holder.cpp.

43 {
44 #if defined(DEBUG)
45  // offer a trap point for debugging most any window
46  wxASSERT( aDest );
47  if( !strcmp( typeid(aDest).name(), "DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB" ) )
48  {
49  int breakhere=1;
50  (void) breakhere;
51  }
52 #endif
53 
54  (void) aDest;
55 
56  m_kiway = aKiway;
57 }
KIWAY * m_kiway
Definition: kiway_holder.h:81
const char * name
Definition: DXF_plotter.cpp:60

References KIWAY_HOLDER::m_kiway, and name.

Referenced by BM2CMP_FRAME::BM2CMP_FRAME(), InvokePcbLibTableEditor(), PCB_CALCULATOR_FRAME::PCB_CALCULATOR_FRAME(), and SIM_PLOT_FRAME::SIM_PLOT_FRAME().

◆ SetPlotFormat()

void DIALOG_PLOT::SetPlotFormat ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PLOT_BASE.

Definition at line 394 of file dialog_plot.cpp.

395 {
396  // this option exist only in DXF format:
398 
399  switch( getPlotFormat() )
400  {
401  case PLOT_FORMAT::SVG:
404 
405  case PLOT_FORMAT::PDF:
406  m_drillShapeOpt->Enable( true );
407  m_plotModeOpt->Enable( false );
409  m_plotMirrorOpt->Enable( true );
410  m_useAuxOriginCheckBox->Enable( false );
411  m_useAuxOriginCheckBox->SetValue( false );
412  m_defaultPenSize.Enable( false );
413  m_excludeEdgeLayerOpt->Enable( true );
414  m_scaleOpt->Enable( false );
415  m_scaleOpt->SetSelection( 1 );
416  m_fineAdjustXCtrl->Enable( false );
417  m_fineAdjustYCtrl->Enable( false );
419  m_plotPSNegativeOpt->Enable( true );
420  m_forcePSA4OutputOpt->Enable( false );
421  m_forcePSA4OutputOpt->SetValue( false );
422 
427  break;
428 
429  case PLOT_FORMAT::POST:
430  m_drillShapeOpt->Enable( true );
431  m_plotModeOpt->Enable( true );
432  m_plotMirrorOpt->Enable( true );
433  m_useAuxOriginCheckBox->Enable( false );
434  m_useAuxOriginCheckBox->SetValue( false );
435  m_defaultPenSize.Enable( false );
436  m_excludeEdgeLayerOpt->Enable( true );
437  m_scaleOpt->Enable( true );
438  m_fineAdjustXCtrl->Enable( true );
439  m_fineAdjustYCtrl->Enable( true );
441  m_plotPSNegativeOpt->Enable( true );
442  m_forcePSA4OutputOpt->Enable( true );
443 
449  break;
450 
451  case PLOT_FORMAT::GERBER:
452  m_drillShapeOpt->Enable( false );
453  m_drillShapeOpt->SetSelection( 0 );
454  m_plotModeOpt->Enable( false );
456  m_plotMirrorOpt->Enable( false );
457  m_plotMirrorOpt->SetValue( false );
458  m_useAuxOriginCheckBox->Enable( true );
459  m_defaultPenSize.Enable( false );
460  m_excludeEdgeLayerOpt->Enable( true );
461  m_scaleOpt->Enable( false );
462  m_scaleOpt->SetSelection( 1 );
463  m_fineAdjustXCtrl->Enable( false );
464  m_fineAdjustYCtrl->Enable( false );
466  m_plotPSNegativeOpt->Enable( false );
467  m_plotPSNegativeOpt->SetValue( false );
468  m_forcePSA4OutputOpt->Enable( false );
469  m_forcePSA4OutputOpt->SetValue( false );
470 
476  break;
477 
478  case PLOT_FORMAT::HPGL:
479  m_drillShapeOpt->Enable( true );
480  m_plotModeOpt->Enable( true );
481  m_plotMirrorOpt->Enable( true );
482  m_useAuxOriginCheckBox->Enable( false );
483  m_useAuxOriginCheckBox->SetValue( false );
484  m_defaultPenSize.Enable( true );
485  m_excludeEdgeLayerOpt->Enable( true );
486  m_scaleOpt->Enable( true );
487  m_fineAdjustXCtrl->Enable( false );
488  m_fineAdjustYCtrl->Enable( false );
490  m_plotPSNegativeOpt->SetValue( false );
491  m_plotPSNegativeOpt->Enable( false );
492  m_forcePSA4OutputOpt->Enable( true );
493 
499  break;
500 
501  case PLOT_FORMAT::DXF:
502  m_drillShapeOpt->Enable( true );
503  m_plotModeOpt->Enable( false );
505  m_plotMirrorOpt->Enable( false );
506  m_plotMirrorOpt->SetValue( false );
507  m_useAuxOriginCheckBox->Enable( true );
508  m_defaultPenSize.Enable( false );
509  m_excludeEdgeLayerOpt->Enable( true );
510  m_scaleOpt->Enable( false );
511  m_scaleOpt->SetSelection( 1 );
512  m_fineAdjustXCtrl->Enable( false );
513  m_fineAdjustYCtrl->Enable( false );
515  m_plotPSNegativeOpt->Enable( false );
516  m_plotPSNegativeOpt->SetValue( false );
517  m_forcePSA4OutputOpt->Enable( false );
518  m_forcePSA4OutputOpt->SetValue( false );
519 
525 
526  OnChangeDXFPlotMode( event );
527  break;
528 
530  break;
531  }
532 
533  /* Update the interlock between scale and frame reference
534  * (scaling would mess up the frame border...) */
535  OnSetScaleOpt( event );
536 
537  Layout();
538  m_MainSizer->SetSizeHints( this );
539 }
wxStaticBoxSizer * m_HPGLOptionsSizer
#define KI_FALLTHROUGH
void OnChangeDXFPlotMode(wxCommandEvent &event) override
wxCheckBox * m_plotPSNegativeOpt
wxCheckBox * m_excludeEdgeLayerOpt
wxCheckBox * m_plotMirrorOpt
wxStaticBoxSizer * m_SizerDXF_options
UNIT_BINDER m_trackWidthCorrection
Definition: dialog_plot.h:60
wxTextCtrl * m_fineAdjustYCtrl
wxCheckBox * m_DXF_plotModeOpt
wxTextCtrl * m_fineAdjustXCtrl
PLOT_FORMAT getPlotFormat()
wxCheckBox * m_forcePSA4OutputOpt
void setPlotModeChoiceSelection(EDA_DRAW_MODE_T aPlotMode)
Definition: dialog_plot.h:84
void OnSetScaleOpt(wxCommandEvent &event) override
wxStaticBoxSizer * m_GerberOptionsSizer
wxChoice * m_scaleOpt
wxChoice * m_drillShapeOpt
wxCheckBox * m_useAuxOriginCheckBox
wxChoice * m_plotModeOpt
UNIT_BINDER m_defaultPenSize
Definition: dialog_plot.h:59
wxBoxSizer * m_MainSizer
wxStaticBoxSizer * m_svgOptionsSizer
wxStaticBoxSizer * m_PSOptionsSizer
wxBoxSizer * m_PlotOptionsSizer
void Enable(bool aEnable)
Function Enable Enables/diasables the label, widget and units label.

References DXF, UNIT_BINDER::Enable(), FILLED, GERBER, getPlotFormat(), HPGL, KI_FALLTHROUGH, m_defaultPenSize, DIALOG_PLOT_BASE::m_drillShapeOpt, DIALOG_PLOT_BASE::m_DXF_plotModeOpt, DIALOG_PLOT_BASE::m_excludeEdgeLayerOpt, DIALOG_PLOT_BASE::m_fineAdjustXCtrl, DIALOG_PLOT_BASE::m_fineAdjustYCtrl, DIALOG_PLOT_BASE::m_forcePSA4OutputOpt, DIALOG_PLOT_BASE::m_GerberOptionsSizer, DIALOG_PLOT_BASE::m_HPGLOptionsSizer, DIALOG_PLOT_BASE::m_MainSizer, DIALOG_PLOT_BASE::m_plotMirrorOpt, DIALOG_PLOT_BASE::m_plotModeOpt, DIALOG_PLOT_BASE::m_PlotOptionsSizer, DIALOG_PLOT_BASE::m_plotPSNegativeOpt, DIALOG_PLOT_BASE::m_PSOptionsSizer, DIALOG_PLOT_BASE::m_scaleOpt, DIALOG_PLOT_BASE::m_SizerDXF_options, DIALOG_PLOT_BASE::m_svgOptionsSizer, m_trackWidthCorrection, DIALOG_PLOT_BASE::m_useAuxOriginCheckBox, OnChangeDXFPlotMode(), OnSetScaleOpt(), PDF, POST, setPlotModeChoiceSelection(), SVG, and UNDEFINED.

Referenced by init_Dialog().

◆ setPlotModeChoiceSelection()

void DIALOG_PLOT::setPlotModeChoiceSelection ( EDA_DRAW_MODE_T  aPlotMode)
inlineprivate

Definition at line 84 of file dialog_plot.h.

85  {
86  m_plotModeOpt->SetSelection( aPlotMode == SKETCH ? 1 : 0 );
87  }
wxChoice * m_plotModeOpt

References DIALOG_PLOT_BASE::m_plotModeOpt, and SKETCH.

Referenced by init_Dialog(), and SetPlotFormat().

◆ SetSizeInDU()

void DIALOG_SHIM::SetSizeInDU ( int  x,
int  y 
)
protectedinherited

Set the dialog to the given dimensions in "dialog units".

These are units equivalent to 4* the average character width and 8* the average character height, allowing a dialog to be sized in a way that scales it with the system font.

Definition at line 153 of file dialog_shim.cpp.

154 {
155  wxSize sz( x, y );
156  SetSize( ConvertDialogToPixels( sz ) );
157 }

Referenced by DIALOG_RESCUE_EACH::DIALOG_RESCUE_EACH(), HTML_MESSAGE_BOX::HTML_MESSAGE_BOX(), and HTML_MESSAGE_BOX::SetDialogSizeInDU().

◆ Show()

bool DIALOG_SHIM::Show ( bool  show)
overrideinherited

Definition at line 180 of file dialog_shim.cpp.

181 {
182  bool ret;
183  const char* hash_key;
184 
185  if( m_hash_key.size() )
186  {
187  // a special case like EDA_LIST_DIALOG, which has multiple uses.
188  hash_key = m_hash_key.c_str();
189  }
190  else
191  {
192  hash_key = typeid(*this).name();
193  }
194 
195  // Show or hide the window. If hiding, save current position and size.
196  // If showing, use previous position and size.
197  if( show )
198  {
199 #ifndef __WINDOWS__
200  wxDialog::Raise(); // Needed on OS X and some other window managers (i.e. Unity)
201 #endif
202  ret = wxDialog::Show( show );
203 
204  // classname is key, returns a zeroed out default EDA_RECT if none existed before.
205  EDA_RECT savedDialogRect = class_map[ hash_key ];
206 
207  if( savedDialogRect.GetSize().x != 0 && savedDialogRect.GetSize().y != 0 )
208  {
209  SetSize( savedDialogRect.GetPosition().x,
210  savedDialogRect.GetPosition().y,
211  std::max( wxDialog::GetSize().x, savedDialogRect.GetSize().x ),
212  std::max( wxDialog::GetSize().y, savedDialogRect.GetSize().y ),
213  0 );
214  }
215 
216  // Be sure that the dialog appears in a visible area
217  // (the dialog position might have been stored at the time when it was
218  // shown on another display)
219  if( wxDisplay::GetFromWindow( this ) == wxNOT_FOUND )
220  Centre();
221  }
222  else
223  {
224  // Save the dialog's position & size before hiding, using classname as key
225  class_map[ hash_key ] = EDA_RECT( wxDialog::GetPosition(), wxDialog::GetSize() );
226 
227 #ifdef __WXMAC__
228  if ( m_eventLoop )
229  m_eventLoop->Exit( GetReturnCode() ); // Needed for APP-MODAL dlgs on OSX
230 #endif
231 
232  ret = wxDialog::Show( show );
233  }
234 
235  return ret;
236 }
std::string m_hash_key
Definition: dialog_shim.h:197
static RECT_MAP class_map
const wxPoint GetPosition() const
Definition: eda_rect.h:115
EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
const wxSize GetSize() const
Definition: eda_rect.h:103

References class_map, EDA_RECT::GetPosition(), EDA_RECT::GetSize(), DIALOG_SHIM::m_hash_key, wxPoint::x, and wxPoint::y.

Referenced by DIALOG_SHIM::EndQuasiModal(), InvokeDialogERC(), SCH_EDIT_FRAME::OnAnnotate(), DIALOG_DRC::OnDRCItemDClick(), DIALOG_ERC::OnERCItemDClick(), DIALOG_CLEANUP_TRACKS_AND_VIAS::OnLeftDClickItem(), POSITION_RELATIVE_TOOL::PositionRelative(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), DRC::ShowDRCDialog(), SCH_EDIT_FRAME::ShowFindReplaceDialog(), DIALOG_SHIM::ShowQuasiModal(), DIALOG_POSITION_RELATIVE::UpdateAnchor(), and SCH_EDIT_FRAME::UpdateHierarchyNavigator().

◆ ShowQuasiModal()

int DIALOG_SHIM::ShowQuasiModal ( )
inherited

Definition at line 367 of file dialog_shim.cpp.

368 {
369  // This is an exception safe way to zero a pointer before returning.
370  // Yes, even though DismissModal() clears this first normally, this is
371  // here in case there's an exception before the dialog is dismissed.
372  struct NULLER
373  {
374  void*& m_what;
375  NULLER( void*& aPtr ) : m_what( aPtr ) {}
376  ~NULLER() { m_what = 0; } // indeed, set it to NULL on destruction
377  } clear_this( (void*&) m_qmodal_loop );
378 
379  // release the mouse if it's currently captured as the window having it
380  // will be disabled when this dialog is shown -- but will still keep the
381  // capture making it impossible to do anything in the modal dialog itself
382  wxWindow* win = wxWindow::GetCapture();
383  if( win )
384  win->ReleaseMouse();
385 
386  // Get the optimal parent
387  wxWindow* parent = GetParentForModalDialog( GetParent(), GetWindowStyle() );
388 
389  // Show the optimal parent
390  DBG( if( parent ) printf( "%s: optimal parent: %s\n", __func__, typeid(*parent).name() );)
391 
392  wxASSERT_MSG( !m_qmodal_parent_disabler,
393  wxT( "Caller using ShowQuasiModal() twice on same window?" ) );
394 
395  // quasi-modal: disable only my "optimal" parent
397 
398 #ifdef __WXMAC__
399  // Apple in its infinite wisdom will raise a disabled window before even passing
400  // us the event, so we have no way to stop it. Instead, we must set an order on
401  // the windows so that the quasi-modal will be pushed in front of the disabled
402  // window when it is raised.
403  ReparentQuasiModal();
404 #endif
405  Show( true );
406 
407  m_qmodal_showing = true;
408 
409  WX_EVENT_LOOP event_loop;
410 
411  m_qmodal_loop = &event_loop;
412 
413  event_loop.Run();
414 
415  m_qmodal_showing = false;
416 
417  return GetReturnCode();
418 }
bool m_qmodal_showing
Definition: dialog_shim.h:207
#define WX_EVENT_LOOP
Definition: kiway_player.h:41
WX_EVENT_LOOP * m_qmodal_loop
Definition: dialog_shim.h:205
bool Show(bool show) override
WDO_ENABLE_DISABLE * m_qmodal_parent_disabler
Definition: dialog_shim.h:208
Toggle a window's "enable" status to disabled, then enabled on destruction.
Definition: dialog_shim.cpp:35
#define DBG(x)
Definition: fctsys.h:33

References DBG, DIALOG_SHIM::m_qmodal_loop, DIALOG_SHIM::m_qmodal_parent_disabler, DIALOG_SHIM::m_qmodal_showing, DIALOG_SHIM::Show(), and WX_EVENT_LOOP.

Referenced by LIB_EDIT_TOOL::editFieldProperties(), SCH_EDITOR_CONTROL::EditSymbolFields(), LIB_EDIT_TOOL::editSymbolProperties(), GLOBAL_EDIT_TOOL::EditTracksAndVias(), GLOBAL_EDIT_TOOL::ExchangeFootprints(), PCB_EDIT_FRAME::InstallExchangeModuleFrame(), PCB_BASE_FRAME::InstallPadOptionsFrame(), InvokeDialogEditComponentsLibId(), InvokeDialogRescueEach(), InvokeDialogUpdateFields(), LIB_VIEW_FRAME::OnSelectSymbol(), SCH_EDIT_FRAME::OpenProjectFiles(), SCH_EDIT_TOOL::Properties(), EDIT_TOOL::Properties(), SCH_EDITOR_CONTROL::RemapSymbols(), SCH_BASE_FRAME::SelectCompFromLibTree(), PCB_BASE_FRAME::SelectFootprintFromLibTree(), PCB_EDIT_FRAME::ShowBoardSetupDialog(), and SCH_EDIT_FRAME::ShowSchematicSetupDialog().

◆ VertPixelsFromDU()

int DIALOG_SHIM::VertPixelsFromDU ( int  y)
protectedinherited

Convert an integer number of dialog units to pixels, vertically.

See SetSizeInDU or wxDialog documentation for more information.

Definition at line 167 of file dialog_shim.cpp.

168 {
169  wxSize sz( 0, y );
170  return ConvertDialogToPixels( sz ).y;
171 }

Referenced by DIALOG_CHOOSE_COMPONENT::DIALOG_CHOOSE_COMPONENT().

Member Data Documentation

◆ coordFormatLabel

wxStaticText* DIALOG_PLOT_BASE::coordFormatLabel
protectedinherited

Definition at line 91 of file dialog_plot_base.h.

Referenced by DIALOG_PLOT_BASE::DIALOG_PLOT_BASE().

◆ drillMarksLabel

wxStaticText* DIALOG_PLOT_BASE::drillMarksLabel
protectedinherited

Definition at line 78 of file dialog_plot_base.h.

Referenced by DIALOG_PLOT_BASE::DIALOG_PLOT_BASE().

◆ DXF_exportUnitsLabel

wxStaticText* DIALOG_PLOT_BASE::DXF_exportUnitsLabel
protectedinherited

Definition at line 111 of file dialog_plot_base.h.

Referenced by DIALOG_PLOT_BASE::DIALOG_PLOT_BASE().

◆ m_browseButton

wxBitmapButton* DIALOG_PLOT_BASE::m_browseButton
protectedinherited

◆ m_buttonDRC

wxButton* DIALOG_PLOT_BASE::m_buttonDRC
protectedinherited

◆ m_coordFormatCtrl

wxChoice* DIALOG_PLOT_BASE::m_coordFormatCtrl
protectedinherited

◆ m_defaultPenSize

UNIT_BINDER DIALOG_PLOT::m_defaultPenSize
private

Definition at line 59 of file dialog_plot.h.

Referenced by applyPlotSettings(), init_Dialog(), and SetPlotFormat().

◆ m_DRCExclusionsWarning

wxStaticText* DIALOG_PLOT_BASE::m_DRCExclusionsWarning
protectedinherited

◆ m_DRCWarningTemplate

wxString DIALOG_PLOT::m_DRCWarningTemplate
private

Definition at line 62 of file dialog_plot.h.

Referenced by DIALOG_PLOT(), and reInitDialog().

◆ m_drillShapeOpt

wxChoice* DIALOG_PLOT_BASE::m_drillShapeOpt
protectedinherited

◆ m_DXF_plotModeOpt

wxCheckBox* DIALOG_PLOT_BASE::m_DXF_plotModeOpt
protectedinherited

◆ m_DXF_plotTextStrokeFontOpt

wxCheckBox* DIALOG_PLOT_BASE::m_DXF_plotTextStrokeFontOpt
protectedinherited

◆ m_DXF_plotUnits

wxChoice* DIALOG_PLOT_BASE::m_DXF_plotUnits
protectedinherited

◆ m_excludeEdgeLayerOpt

wxCheckBox* DIALOG_PLOT_BASE::m_excludeEdgeLayerOpt
protectedinherited

◆ m_fineAdjustXCtrl

wxTextCtrl* DIALOG_PLOT_BASE::m_fineAdjustXCtrl
protectedinherited

◆ m_fineAdjustXLabel

wxStaticText* DIALOG_PLOT_BASE::m_fineAdjustXLabel
protectedinherited

Definition at line 100 of file dialog_plot_base.h.

Referenced by DIALOG_PLOT_BASE::DIALOG_PLOT_BASE().

◆ m_fineAdjustYCtrl

wxTextCtrl* DIALOG_PLOT_BASE::m_fineAdjustYCtrl
protectedinherited

◆ m_fineAdjustYLabel

wxStaticText* DIALOG_PLOT_BASE::m_fineAdjustYLabel
protectedinherited

Definition at line 102 of file dialog_plot_base.h.

Referenced by DIALOG_PLOT_BASE::DIALOG_PLOT_BASE().

◆ m_firstPaintEvent

bool DIALOG_SHIM::m_firstPaintEvent
protectedinherited

Definition at line 202 of file dialog_shim.h.

Referenced by DIALOG_SHIM::OnPaint().

◆ m_forcePSA4OutputOpt

wxCheckBox* DIALOG_PLOT_BASE::m_forcePSA4OutputOpt
protectedinherited

◆ m_generateGerberJobFile

wxCheckBox* DIALOG_PLOT_BASE::m_generateGerberJobFile
protectedinherited

◆ m_GerberOptionsSizer

wxStaticBoxSizer* DIALOG_PLOT_BASE::m_GerberOptionsSizer
protectedinherited

Definition at line 87 of file dialog_plot_base.h.

Referenced by DIALOG_PLOT_BASE::DIALOG_PLOT_BASE(), and SetPlotFormat().

◆ m_hash_key

◆ m_HPGLOptionsSizer

wxStaticBoxSizer* DIALOG_PLOT_BASE::m_HPGLOptionsSizer
protectedinherited

Definition at line 95 of file dialog_plot_base.h.

Referenced by DIALOG_PLOT_BASE::DIALOG_PLOT_BASE(), and SetPlotFormat().

◆ m_hpglPenCtrl

wxTextCtrl* DIALOG_PLOT_BASE::m_hpglPenCtrl
protectedinherited

Definition at line 97 of file dialog_plot_base.h.

Referenced by DIALOG_PLOT_BASE::DIALOG_PLOT_BASE().

◆ m_hpglPenLabel

wxStaticText* DIALOG_PLOT_BASE::m_hpglPenLabel
protectedinherited

Definition at line 96 of file dialog_plot_base.h.

Referenced by DIALOG_PLOT_BASE::DIALOG_PLOT_BASE().

◆ m_hpglPenUnits

wxStaticText* DIALOG_PLOT_BASE::m_hpglPenUnits
protectedinherited

Definition at line 98 of file dialog_plot_base.h.

Referenced by DIALOG_PLOT_BASE::DIALOG_PLOT_BASE().

◆ m_initialFocusTarget

wxWindow* DIALOG_SHIM::m_initialFocusTarget
protectedinherited

Definition at line 203 of file dialog_shim.h.

Referenced by DIALOG_SHIM::OnPaint(), and DIALOG_SHIM::SetInitialFocus().

◆ m_layerCheckListBox

wxCheckListBox* DIALOG_PLOT_BASE::m_layerCheckListBox
protectedinherited

◆ m_layerList

LSEQ DIALOG_PLOT::m_layerList
private

Definition at line 47 of file dialog_plot.h.

Referenced by applyPlotSettings(), init_Dialog(), and OnPopUpLayers().

◆ m_LayersSizer

wxStaticBoxSizer* DIALOG_PLOT_BASE::m_LayersSizer
protectedinherited

Definition at line 67 of file dialog_plot_base.h.

Referenced by DIALOG_PLOT_BASE::DIALOG_PLOT_BASE().

◆ m_MainSizer

wxBoxSizer* DIALOG_PLOT_BASE::m_MainSizer
protectedinherited

Definition at line 61 of file dialog_plot_base.h.

Referenced by DIALOG_PLOT_BASE::DIALOG_PLOT_BASE(), and SetPlotFormat().

◆ m_messagesPanel

WX_HTML_REPORT_PANEL* DIALOG_PLOT_BASE::m_messagesPanel
protectedinherited

Definition at line 118 of file dialog_plot_base.h.

Referenced by applyPlotSettings(), DIALOG_PLOT_BASE::DIALOG_PLOT_BASE(), and Plot().

◆ m_outputDirectoryName

wxTextCtrl* DIALOG_PLOT_BASE::m_outputDirectoryName
protectedinherited

◆ m_parent

PCB_EDIT_FRAME* DIALOG_PLOT::m_parent
private

◆ m_parentFrame

EDA_BASE_FRAME* DIALOG_SHIM::m_parentFrame
protectedinherited

Definition at line 210 of file dialog_shim.h.

Referenced by DIALOG_SHIM::OnCharHook().

◆ m_plotFormatOpt

wxChoice* DIALOG_PLOT_BASE::m_plotFormatOpt
protectedinherited

◆ m_plotInvisibleText

wxCheckBox* DIALOG_PLOT_BASE::m_plotInvisibleText
protectedinherited

◆ m_plotMirrorOpt

wxCheckBox* DIALOG_PLOT_BASE::m_plotMirrorOpt
protectedinherited

◆ m_plotModeOpt

wxChoice* DIALOG_PLOT_BASE::m_plotModeOpt
protectedinherited

◆ m_plotModuleRefOpt

wxCheckBox* DIALOG_PLOT_BASE::m_plotModuleRefOpt
protectedinherited

◆ m_plotModuleValueOpt

wxCheckBox* DIALOG_PLOT_BASE::m_plotModuleValueOpt
protectedinherited

◆ m_plotNoViaOnMaskOpt

wxCheckBox* DIALOG_PLOT_BASE::m_plotNoViaOnMaskOpt
protectedinherited

◆ m_PlotOptionsSizer

wxBoxSizer* DIALOG_PLOT_BASE::m_PlotOptionsSizer
protectedinherited

Definition at line 69 of file dialog_plot_base.h.

Referenced by DIALOG_PLOT_BASE::DIALOG_PLOT_BASE(), and SetPlotFormat().

◆ m_plotOpts

PCB_PLOT_PARAMS DIALOG_PLOT::m_plotOpts
private

◆ m_plotPSNegativeOpt

wxCheckBox* DIALOG_PLOT_BASE::m_plotPSNegativeOpt
protectedinherited

◆ m_plotSheetRef

wxCheckBox* DIALOG_PLOT_BASE::m_plotSheetRef
protectedinherited

◆ m_popMenu

wxMenu* DIALOG_PLOT_BASE::m_popMenu
protectedinherited

◆ m_PSOptionsSizer

wxStaticBoxSizer* DIALOG_PLOT_BASE::m_PSOptionsSizer
protectedinherited

Definition at line 99 of file dialog_plot_base.h.

Referenced by DIALOG_PLOT_BASE::DIALOG_PLOT_BASE(), and SetPlotFormat().

◆ m_PSWidthAdjust

int DIALOG_PLOT::m_PSWidthAdjust
private

Definition at line 52 of file dialog_plot.h.

Referenced by applyPlotSettings(), init_Dialog(), and Plot().

◆ m_qmodal_loop

WX_EVENT_LOOP* DIALOG_SHIM::m_qmodal_loop
protectedinherited

Definition at line 205 of file dialog_shim.h.

Referenced by DIALOG_SHIM::EndQuasiModal(), and DIALOG_SHIM::ShowQuasiModal().

◆ m_qmodal_parent_disabler

WDO_ENABLE_DISABLE* DIALOG_SHIM::m_qmodal_parent_disabler
protectedinherited

◆ m_qmodal_showing

bool DIALOG_SHIM::m_qmodal_showing
protectedinherited

Definition at line 207 of file dialog_shim.h.

Referenced by DIALOG_SHIM::IsQuasiModal(), and DIALOG_SHIM::ShowQuasiModal().

◆ m_scaleOpt

wxChoice* DIALOG_PLOT_BASE::m_scaleOpt
protectedinherited

◆ m_sdbSizer1

wxStdDialogButtonSizer* DIALOG_PLOT_BASE::m_sdbSizer1
protectedinherited

Definition at line 122 of file dialog_plot_base.h.

Referenced by DIALOG_PLOT_BASE::DIALOG_PLOT_BASE().

◆ m_sdbSizer1Apply

wxButton* DIALOG_PLOT_BASE::m_sdbSizer1Apply
protectedinherited

◆ m_sdbSizer1Cancel

wxButton* DIALOG_PLOT_BASE::m_sdbSizer1Cancel
protectedinherited

Definition at line 125 of file dialog_plot_base.h.

Referenced by DIALOG_PLOT(), and DIALOG_PLOT_BASE::DIALOG_PLOT_BASE().

◆ m_sdbSizer1OK

wxButton* DIALOG_PLOT_BASE::m_sdbSizer1OK
protectedinherited

◆ m_sizerButtons

wxBoxSizer* DIALOG_PLOT_BASE::m_sizerButtons
protectedinherited

Definition at line 119 of file dialog_plot_base.h.

Referenced by DIALOG_PLOT(), and DIALOG_PLOT_BASE::DIALOG_PLOT_BASE().

◆ m_SizerDXF_options

wxStaticBoxSizer* DIALOG_PLOT_BASE::m_SizerDXF_options
protectedinherited

Definition at line 108 of file dialog_plot_base.h.

Referenced by DIALOG_PLOT_BASE::DIALOG_PLOT_BASE(), and SetPlotFormat().

◆ m_sketchPadsOnFabLayers

wxCheckBox* DIALOG_PLOT_BASE::m_sketchPadsOnFabLayers
protectedinherited

◆ m_staticTextDir

wxStaticText* DIALOG_PLOT_BASE::m_staticTextDir
protectedinherited

Definition at line 64 of file dialog_plot_base.h.

Referenced by DIALOG_PLOT_BASE::DIALOG_PLOT_BASE().

◆ m_staticTextPlotFmt

wxStaticText* DIALOG_PLOT_BASE::m_staticTextPlotFmt
protectedinherited

Definition at line 62 of file dialog_plot_base.h.

Referenced by DIALOG_PLOT_BASE::DIALOG_PLOT_BASE().

◆ m_subtractMaskFromSilk

wxCheckBox* DIALOG_PLOT_BASE::m_subtractMaskFromSilk
protectedinherited

◆ m_svgOptionsSizer

wxStaticBoxSizer* DIALOG_PLOT_BASE::m_svgOptionsSizer
protectedinherited

Definition at line 113 of file dialog_plot_base.h.

Referenced by DIALOG_PLOT_BASE::DIALOG_PLOT_BASE(), and SetPlotFormat().

◆ m_svgPrecsision

wxSpinCtrl* DIALOG_PLOT_BASE::m_svgPrecsision
protectedinherited

◆ m_svgUnits

wxChoice* DIALOG_PLOT_BASE::m_svgUnits
protectedinherited

◆ m_tabOrder

◆ m_trackWidthCorrection

UNIT_BINDER DIALOG_PLOT::m_trackWidthCorrection
private

Definition at line 60 of file dialog_plot.h.

Referenced by applyPlotSettings(), init_Dialog(), and SetPlotFormat().

◆ m_units

◆ m_useAuxOriginCheckBox

wxCheckBox* DIALOG_PLOT_BASE::m_useAuxOriginCheckBox
protectedinherited

◆ m_useGerberExtensions

wxCheckBox* DIALOG_PLOT_BASE::m_useGerberExtensions
protectedinherited

◆ m_useGerberNetAttributes

wxCheckBox* DIALOG_PLOT_BASE::m_useGerberNetAttributes
protectedinherited

◆ m_useGerberX2Format

wxCheckBox* DIALOG_PLOT_BASE::m_useGerberX2Format
protectedinherited

◆ m_widthAdjustCtrl

wxTextCtrl* DIALOG_PLOT_BASE::m_widthAdjustCtrl
protectedinherited

Definition at line 105 of file dialog_plot_base.h.

Referenced by DIALOG_PLOT_BASE::DIALOG_PLOT_BASE().

◆ m_widthAdjustLabel

wxStaticText* DIALOG_PLOT_BASE::m_widthAdjustLabel
protectedinherited

Definition at line 104 of file dialog_plot_base.h.

Referenced by DIALOG_PLOT_BASE::DIALOG_PLOT_BASE().

◆ m_widthAdjustMaxValue

int DIALOG_PLOT::m_widthAdjustMaxValue
private

Definition at line 57 of file dialog_plot.h.

Referenced by applyPlotSettings(), and init_Dialog().

◆ m_widthAdjustMinValue

int DIALOG_PLOT::m_widthAdjustMinValue
private

Definition at line 56 of file dialog_plot.h.

Referenced by applyPlotSettings(), and init_Dialog().

◆ m_widthAdjustUnits

wxStaticText* DIALOG_PLOT_BASE::m_widthAdjustUnits
protectedinherited

Definition at line 106 of file dialog_plot_base.h.

Referenced by DIALOG_PLOT_BASE::DIALOG_PLOT_BASE().

◆ m_XScaleAdjust

double DIALOG_PLOT::m_XScaleAdjust
private

Definition at line 48 of file dialog_plot.h.

Referenced by applyPlotSettings(), init_Dialog(), and Plot().

◆ m_YScaleAdjust

double DIALOG_PLOT::m_YScaleAdjust
private

Definition at line 50 of file dialog_plot.h.

Referenced by applyPlotSettings(), init_Dialog(), and Plot().

◆ m_zoneFillCheck

wxCheckBox* DIALOG_PLOT_BASE::m_zoneFillCheck
protectedinherited

◆ plotModeLabel

wxStaticText* DIALOG_PLOT_BASE::plotModeLabel
protectedinherited

Definition at line 82 of file dialog_plot_base.h.

Referenced by DIALOG_PLOT_BASE::DIALOG_PLOT_BASE().

◆ scalingLabel

wxStaticText* DIALOG_PLOT_BASE::scalingLabel
protectedinherited

Definition at line 80 of file dialog_plot_base.h.

Referenced by DIALOG_PLOT_BASE::DIALOG_PLOT_BASE().

◆ svgPrecisionLabel

wxStaticText* DIALOG_PLOT_BASE::svgPrecisionLabel
protectedinherited

Definition at line 116 of file dialog_plot_base.h.

Referenced by DIALOG_PLOT_BASE::DIALOG_PLOT_BASE().

◆ svgUnitLabel

wxStaticText* DIALOG_PLOT_BASE::svgUnitLabel
protectedinherited

Definition at line 114 of file dialog_plot_base.h.

Referenced by DIALOG_PLOT_BASE::DIALOG_PLOT_BASE().


The documentation for this class was generated from the following files: