KiCad PCB EDA Suite
DIALOG_PLOT Class Reference

Class DIALOG_PLOT. More...

#include <dialog_plot.h>

Inheritance diagram for DIALOG_PLOT:
DIALOG_PLOT_BASE DIALOG_SHIM KIWAY_HOLDER

Public Member Functions

 DIALOG_PLOT (PCB_EDIT_FRAME *parent)
 
void DIALOG_PLOT_BASEOnContextMenu (wxMouseEvent &event)
 
int ShowQuasiModal ()
 
void EndQuasiModal (int retCode)
 
bool IsQuasiModal ()
 
bool Show (bool show) override
 
bool Enable (bool enable) override
 
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...
 

Protected Types

enum  {
  ID_ALLOW_PRINT_PAD_ON_SILKSCREEN = 1000, ID_PRINT_REF, ID_MIROR_OPT, ID_CREATE_DRILL_FILE,
  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 FixOSXCancelButtonIssue ()
 A ugly hack to fix an issue on OSX: when typing ctrl+c in a wxTextCtrl inside a dialog, it is closed instead of copying a text if a button with wxID_CANCEL is used in a wxStdDialogButtonSizer, when the dlg is created by wxFormBuilder: the label is &Cancel, and this accelerator key has priority to copy text standard accelerator, and the dlg is closed when trying to copy text this function do nothing on other platforms. More...
 

Protected Attributes

wxBoxSizer * m_MainSizer
 
wxStaticText * m_staticTextPlotFmt
 
wxChoice * m_plotFormatOpt
 
wxStaticText * m_staticTextDir
 
wxTextCtrl * m_outputDirectoryName
 
wxButton * m_browseButton
 
wxStaticBoxSizer * m_LayersSizer
 
wxCheckListBox * m_layerCheckListBox
 
wxBoxSizer * m_PlotOptionsSizer
 
wxCheckBox * m_plotSheetRef
 
wxCheckBox * m_plotPads_on_Silkscreen
 
wxCheckBox * m_plotModuleValueOpt
 
wxCheckBox * m_plotModuleRefOpt
 
wxCheckBox * m_plotInvisibleText
 
wxCheckBox * m_plotNoViaOnMaskOpt
 
wxCheckBox * m_excludeEdgeLayerOpt
 
wxCheckBox * m_plotMirrorOpt
 
wxCheckBox * m_plotPSNegativeOpt
 
wxCheckBox * m_useAuxOriginCheckBox
 
wxStaticText * m_staticText11
 
wxChoice * m_drillShapeOpt
 
wxStaticText * m_staticText12
 
wxChoice * m_scaleOpt
 
wxStaticText * m_staticText13
 
wxChoice * m_plotModeOpt
 
wxStaticText * m_textDefaultPenSize
 
wxTextCtrl * m_linesWidth
 
wxStaticText * m_SolderMaskMarginLabel
 
wxStaticText * m_SolderMaskMarginCurrValue
 
wxStaticText * m_solderMaskMinWidthLabel
 
wxStaticText * m_SolderMaskMinWidthCurrValue
 
wxStaticBoxSizer * m_GerberOptionsSizer
 
wxCheckBox * m_useGerberExtensions
 
wxCheckBox * m_useGerberX2Attributes
 
wxCheckBox * m_useGerberNetAttributes
 
wxCheckBox * m_subtractMaskFromSilk
 
wxRadioBox * m_rbGerberFormat
 
wxStaticBoxSizer * m_HPGLOptionsSizer
 
wxStaticText * m_textPenSize
 
wxTextCtrl * m_HPGLPenSizeOpt
 
wxStaticBoxSizer * m_PSOptionsSizer
 
wxStaticText * m_staticText7
 
wxTextCtrl * m_fineAdjustXscaleOpt
 
wxStaticText * m_staticText8
 
wxTextCtrl * m_fineAdjustYscaleOpt
 
wxStaticText * m_textPSFineAdjustWidth
 
wxTextCtrl * m_PSFineAdjustWidthOpt
 
wxCheckBox * m_forcePSA4OutputOpt
 
WX_HTML_REPORT_PANELm_messagesPanel
 
wxButton * m_plotButton
 
wxButton * m_buttonDrill
 
wxButton * m_buttonDRC
 
wxButton * m_buttonQuit
 
wxMenu * m_popMenu
 
std::string m_hash_key
 
EVENT_LOOPm_qmodal_loop
 
bool m_qmodal_showing
 
WDO_ENABLE_DISABLEm_qmodal_parent_disabler
 

Private Member Functions

void Init_Dialog ()
 
void Plot (wxCommandEvent &event) override
 
void OnQuit (wxCommandEvent &event) override
 
void OnClose (wxCloseEvent &event) override
 
void OnOutputDirectoryBrowseClicked (wxCommandEvent &event) override
 
void OnRightClick (wxMouseEvent &event) override
 
void OnPopUpLayers (wxCommandEvent &event) override
 
void SetPlotFormat (wxCommandEvent &event) override
 
void OnSetScaleOpt (wxCommandEvent &event) override
 
void CreateDrillFile (wxCommandEvent &event) override
 
void OnGerberX2Checked (wxCommandEvent &event) override
 
virtual void onRunDRC (wxCommandEvent &event) override
 
void applyPlotSettings ()
 
PlotFormat getPlotFormat ()
 
void setPlotModeChoiceSelection (EDA_DRAW_MODE_T aPlotMode)
 

Private Attributes

PCB_EDIT_FRAMEm_parent
 
BOARDm_board
 
wxConfigBase * m_config
 
LSEQ m_layerList
 
double m_XScaleAdjust
 
double m_YScaleAdjust
 
int m_PSWidthAdjust
 
int m_widthAdjustMinValue
 
int m_widthAdjustMaxValue
 
PCB_PLOT_PARAMS m_plotOpts
 

Detailed Description

Class DIALOG_PLOT.

Definition at line 37 of file dialog_plot.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

DIALOG_PLOT::DIALOG_PLOT ( PCB_EDIT_FRAME parent)

Definition at line 46 of file dialog_plot.cpp.

References Init_Dialog(), Kiface(), KIFACE_I::KifaceSettings(), and m_config.

46  :
47  DIALOG_PLOT_BASE( aParent ), m_parent( aParent ),
48  m_board( aParent->GetBoard() ),
49  m_plotOpts( aParent->GetPlotSettings() )
50 {
52  Init_Dialog();
53 
54  GetSizer()->Fit( this );
55  GetSizer()->SetSizeHints( this );
56 }
BOARD * m_board
Definition: dialog_plot.h:43
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
Definition: kicad.cpp:52
DIALOG_PLOT_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Plot"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(733, 673), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
PCB_EDIT_FRAME * m_parent
Definition: dialog_plot.h:42
wxConfigBase * KifaceSettings() const
Definition: kiface_i.h:101
PCB_PLOT_PARAMS m_plotOpts
Definition: dialog_plot.h:58
void Init_Dialog()
Definition: dialog_plot.cpp:59
wxConfigBase * m_config
Definition: dialog_plot.h:44

Member Function Documentation

void DIALOG_PLOT::applyPlotSettings ( )
private

Definition at line 540 of file dialog_plot.cpp.

References LSET::AllCuMask(), CONFIG_PS_FINEWIDTH_ADJ, ConfigBaseWriteDouble(), FILLED, g_UserUnit, BOARD::GetEnabledLayers(), PCB_PLOT_PARAMS::GetHPGLPenDiameter(), PCB_PLOT_PARAMS::GetLineWidth(), getPlotFormat(), INCHES, m_board, m_config, DIALOG_PLOT_BASE::m_drillShapeOpt, DIALOG_PLOT_BASE::m_excludeEdgeLayerOpt, DIALOG_PLOT_BASE::m_fineAdjustXscaleOpt, DIALOG_PLOT_BASE::m_fineAdjustYscaleOpt, DIALOG_PLOT_BASE::m_forcePSA4OutputOpt, DIALOG_PLOT_BASE::m_HPGLPenSizeOpt, DIALOG_PLOT_BASE::m_layerCheckListBox, m_layerList, DIALOG_PLOT_BASE::m_linesWidth, DIALOG_PLOT_BASE::m_messagesPanel, DIALOG_PLOT_BASE::m_outputDirectoryName, m_parent, 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_plotPads_on_Silkscreen, DIALOG_PLOT_BASE::m_plotPSNegativeOpt, DIALOG_PLOT_BASE::m_plotSheetRef, DIALOG_PLOT_BASE::m_PSFineAdjustWidthOpt, m_PSWidthAdjust, DIALOG_PLOT_BASE::m_rbGerberFormat, DIALOG_PLOT_BASE::m_scaleOpt, DIALOG_PLOT_BASE::m_subtractMaskFromSilk, DIALOG_PLOT_BASE::m_useAuxOriginCheckBox, DIALOG_PLOT_BASE::m_useGerberExtensions, DIALOG_PLOT_BASE::m_useGerberNetAttributes, DIALOG_PLOT_BASE::m_useGerberX2Attributes, m_widthAdjustMaxValue, m_widthAdjustMinValue, m_XScaleAdjust, m_YScaleAdjust, PCB_EDIT_FRAME::OnModify(), OPTKEY_PLOT_X_FINESCALE_ADJ, OPTKEY_PLOT_Y_FINESCALE_ADJ, PLOT_MAX_SCALE, PLOT_MIN_SCALE, REPORTER::Report(), WX_HTML_REPORT_PANEL::Reporter(), REPORTER::RPT_INFO, REPORTER::RPT_WARNING, PCB_PLOT_PARAMS::SetA4Output(), setDouble(), PCB_PLOT_PARAMS::SetDrillMarksType(), 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::SetLineWidth(), 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::SetPlotPadsOnSilkLayer(), PCB_PLOT_PARAMS::SetPlotReference(), PCB_BASE_FRAME::SetPlotSettings(), PCB_PLOT_PARAMS::SetPlotValue(), PCB_PLOT_PARAMS::SetPlotViaOnMaskLayer(), PCB_PLOT_PARAMS::SetScaleSelection(), PCB_PLOT_PARAMS::SetSubtractMaskFromSilk(), PCB_PLOT_PARAMS::SetUseAuxOrigin(), PCB_PLOT_PARAMS::SetUseGerberAttributes(), PCB_PLOT_PARAMS::SetUseGerberProtelExtensions(), SKETCH, StringFromValue(), To_User_Unit(), and ValueFromString().

Referenced by OnClose(), and Plot().

541 {
542  REPORTER& reporter = m_messagesPanel->Reporter();
543 
544  PCB_PLOT_PARAMS tempOptions;
545 
546  tempOptions.SetExcludeEdgeLayer( m_excludeEdgeLayerOpt->GetValue() );
547  tempOptions.SetSubtractMaskFromSilk( m_subtractMaskFromSilk->GetValue() );
548  tempOptions.SetPlotFrameRef( m_plotSheetRef->GetValue() );
549  tempOptions.SetPlotPadsOnSilkLayer( m_plotPads_on_Silkscreen->GetValue() );
550  tempOptions.SetUseAuxOrigin( m_useAuxOriginCheckBox->GetValue() );
551  tempOptions.SetPlotValue( m_plotModuleValueOpt->GetValue() );
552  tempOptions.SetPlotReference( m_plotModuleRefOpt->GetValue() );
553  tempOptions.SetPlotInvisibleText( m_plotInvisibleText->GetValue() );
554  tempOptions.SetScaleSelection( m_scaleOpt->GetSelection() );
555  tempOptions.SetDrillMarksType( static_cast<PCB_PLOT_PARAMS::DrillMarksType>
556  ( m_drillShapeOpt->GetSelection() ) );
557  tempOptions.SetMirror( m_plotMirrorOpt->GetValue() );
558  tempOptions.SetPlotMode( m_plotModeOpt->GetSelection() == 1 ? SKETCH : FILLED );
559  tempOptions.SetPlotViaOnMaskLayer( m_plotNoViaOnMaskOpt->GetValue() );
560 
561  // Update settings from text fields. Rewrite values back to the fields,
562  // since the values may have been constrained by the setters.
563 
564  // read HPLG pen size (this param is stored in mils)
565  wxString msg = m_HPGLPenSizeOpt->GetValue();
566  int tmp = ValueFromString( g_UserUnit, msg ) / IU_PER_MILS;
567 
568  if( !tempOptions.SetHPGLPenDiameter( tmp ) )
569  {
570  msg = StringFromValue( g_UserUnit, tempOptions.GetHPGLPenDiameter() * IU_PER_MILS );
571  m_HPGLPenSizeOpt->SetValue( msg );
572  msg.Printf( _( "HPGL pen size constrained." ) );
573  reporter.Report( msg, REPORTER::RPT_INFO );
574  }
575 
576  // Default linewidth
577  msg = m_linesWidth->GetValue();
578  tmp = ValueFromString( g_UserUnit, msg );
579 
580  if( !tempOptions.SetLineWidth( tmp ) )
581  {
582  msg = StringFromValue( g_UserUnit, tempOptions.GetLineWidth() );
583  m_linesWidth->SetValue( msg );
584  msg.Printf( _( "Default line width constrained." ) );
585  reporter.Report( msg, REPORTER::RPT_INFO );
586  }
587 
588  // X scale
589  double tmpDouble;
590  msg = m_fineAdjustXscaleOpt->GetValue();
591  msg.ToDouble( &tmpDouble );
592 
593  if( !setDouble( &m_XScaleAdjust, tmpDouble, PLOT_MIN_SCALE, PLOT_MAX_SCALE ) )
594  {
595  msg.Printf( wxT( "%f" ), m_XScaleAdjust );
596  m_fineAdjustXscaleOpt->SetValue( msg );
597  msg.Printf( _( "X scale constrained." ) );
598  reporter.Report( msg, REPORTER::RPT_INFO );
599  }
600 
602 
603  // Y scale
604  msg = m_fineAdjustYscaleOpt->GetValue();
605  msg.ToDouble( &tmpDouble );
606 
607  if( !setDouble( &m_YScaleAdjust, tmpDouble, PLOT_MIN_SCALE, PLOT_MAX_SCALE ) )
608  {
609  msg.Printf( wxT( "%f" ), m_YScaleAdjust );
610  m_fineAdjustYscaleOpt->SetValue( msg );
611  msg.Printf( _( "Y scale constrained." ) );
612  reporter.Report( msg, REPORTER::RPT_INFO );
613  }
614 
616 
617  // PS Width correction
618  msg = m_PSFineAdjustWidthOpt->GetValue();
619  int itmp = ValueFromString( g_UserUnit, msg );
620 
622  {
624  m_PSFineAdjustWidthOpt->SetValue( msg );
625  msg.Printf( _( "Width correction constrained. "
626  "The reasonable width correction value must be in a range of "
627  " [%+f; %+f] (%s) for current design rules. " ),
630  ( g_UserUnit == INCHES ) ? wxT( "\"" ) : wxT( "mm" ) );
631  reporter.Report( msg, REPORTER::RPT_WARNING );
632  }
633 
634  // Store m_PSWidthAdjust in mm in user config
636  (double)m_PSWidthAdjust / IU_PER_MM );
637 
638  tempOptions.SetFormat( getPlotFormat() );
639 
640  tempOptions.SetUseGerberProtelExtensions( m_useGerberExtensions->GetValue() );
641  tempOptions.SetUseGerberAttributes( m_useGerberX2Attributes->GetValue() );
642  tempOptions.SetIncludeGerberNetlistInfo( m_useGerberNetAttributes->GetValue() );
643  tempOptions.SetGerberPrecision( m_rbGerberFormat->GetSelection() == 0 ? 5 : 6 );
644 
645  LSET selectedLayers;
646  for( unsigned i = 0; i < m_layerList.size(); i++ )
647  {
648  if( m_layerCheckListBox->IsChecked( i ) )
649  selectedLayers.set( m_layerList[i] );
650  }
651  // Get a list of copper layers that aren't being used by inverting enabled layers.
652  LSET disabledCopperLayers = LSET::AllCuMask() & ~m_board->GetEnabledLayers();
653  // Enable all of the disabled copper layers.
654  // If someone enables more copper layers they will be selected by default.
655  selectedLayers = selectedLayers | disabledCopperLayers;
656  tempOptions.SetLayerSelection( selectedLayers );
657 
658  tempOptions.SetNegative( m_plotPSNegativeOpt->GetValue() );
659  tempOptions.SetA4Output( m_forcePSA4OutputOpt->GetValue() );
660 
661  // Set output directory and replace backslashes with forward ones
662  wxString dirStr;
663  dirStr = m_outputDirectoryName->GetValue();
664  dirStr.Replace( wxT( "\\" ), wxT( "/" ) );
665  tempOptions.SetOutputDirectory( dirStr );
666 
667  if( m_plotOpts != tempOptions )
668  {
669  m_parent->SetPlotSettings( tempOptions );
670  m_plotOpts = tempOptions;
671  m_parent->OnModify();
672  }
673 }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Function AllCuMask returns a mask holding the requested number of Cu LAYER_IDs.
Definition: lset.cpp:638
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:45
void SetIncludeGerberNetlistInfo(bool aUse)
wxTextCtrl * m_linesWidth
double m_YScaleAdjust
Definition: dialog_plot.h:48
virtual void OnModify() override
Function OnModify must be called after a board change to set the modified flag.
Definition: pcbframe.cpp:1004
wxTextCtrl * m_fineAdjustYscaleOpt
int GetHPGLPenDiameter() const
wxCheckBox * m_useGerberExtensions
void SetGerberPrecision(int aPrecision)
void SetPlotViaOnMaskLayer(bool aFlag)
wxCheckBox * m_plotPads_on_Silkscreen
#define OPTKEY_PLOT_Y_FINESCALE_ADJ
Definition: pcbplot.h:62
void SetLayerSelection(LSET aSelection)
void SetUseAuxOrigin(bool aAux)
wxCheckBox * m_plotPSNegativeOpt
#define PLOT_MIN_SCALE
Definition: pcbplot.h:68
wxRadioBox * m_rbGerberFormat
wxString StringFromValue(EDA_UNITS_T aUnit, int aValue, bool aAddUnitSymbol)
Function StringFromValue returns the string from aValue according to units (inch, mm ...
Definition: base_units.cpp:203
void SetFormat(PlotFormat aFormat)
PlotFormat getPlotFormat()
wxCheckBox * m_excludeEdgeLayerOpt
void SetMirror(bool aFlag)
BOARD * m_board
Definition: dialog_plot.h:43
wxCheckBox * m_plotMirrorOpt
void SetDrillMarksType(DrillMarksType aVal)
Class REPORTER is a pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:61
LSET GetEnabledLayers() const
Function GetEnabledLayers is a proxy function that calls the corresponding function in m_BoardSetting...
wxCheckBox * m_useGerberX2Attributes
void SetA4Output(int aForce)
double m_XScaleAdjust
Definition: dialog_plot.h:46
bool SetHPGLPenDiameter(int aValue)
bool SetLineWidth(int aValue)
void SetPlotValue(bool aFlag)
wxCheckBox * m_plotSheetRef
void SetPlotFrameRef(bool aFlag)
wxTextCtrl * m_PSFineAdjustWidthOpt
Class LSET is a set of LAYER_IDs.
#define OPTKEY_PLOT_X_FINESCALE_ADJ
Definition: pcbplot.h:61
PCB_EDIT_FRAME * m_parent
Definition: dialog_plot.h:42
int GetLineWidth() const
int m_widthAdjustMaxValue
Definition: dialog_plot.h:55
Definition: common.h:145
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:69
int m_PSWidthAdjust
Definition: dialog_plot.h:50
int ValueFromString(EDA_UNITS_T aUnits, const wxString &aTextValue)
Function ValueFromString converts aTextValue in aUnits to internal units used by the application...
Definition: base_units.cpp:368
wxCheckBox * m_forcePSA4OutputOpt
void SetSubtractMaskFromSilk(bool aSubtract)
#define CONFIG_PS_FINEWIDTH_ADJ
Definition: pcbplot.h:63
virtual void SetPlotSettings(const PCB_PLOT_PARAMS &aSettings)
wxCheckBox * m_useGerberNetAttributes
void SetOutputDirectory(wxString aDir)
int m_widthAdjustMinValue
Definition: dialog_plot.h:54
void SetUseGerberAttributes(bool aUse)
Class PCB_PLOT_PARAMS handles plot parameters and options when plotting/printing a board...
wxTextCtrl * m_outputDirectoryName
void SetPlotInvisibleText(bool aFlag)
PCB_PLOT_PARAMS m_plotOpts
Definition: dialog_plot.h:58
void SetNegative(bool aFlag)
EDA_UNITS_T g_UserUnit
Global variables definitions.
Definition: common.cpp:56
wxChoice * m_scaleOpt
wxCheckBox * m_plotModuleRefOpt
void ConfigBaseWriteDouble(wxConfigBase *aConfig, const wxString &aKey, double aValue)
Function ConfigBaseWriteDouble This is a helper function to write doubles in config We cannot use wxC...
void SetPlotPadsOnSilkLayer(bool aFlag)
void SetPlotMode(EDA_DRAW_MODE_T aPlotMode)
wxCheckBox * m_subtractMaskFromSilk
wxCheckBox * m_plotNoViaOnMaskOpt
wxCheckBox * m_plotModuleValueOpt
wxChoice * m_drillShapeOpt
wxTextCtrl * m_fineAdjustXscaleOpt
static bool setInt(int *aResult, int aValue, int aMin, int aMax)
wxTextCtrl * m_HPGLPenSizeOpt
wxCheckBox * m_plotInvisibleText
wxCheckBox * m_useAuxOriginCheckBox
wxChoice * m_plotModeOpt
wxConfigBase * m_config
Definition: dialog_plot.h:44
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_UNDEFINED)=0
Function Report is a pure virtual function to override in the derived object.
double To_User_Unit(EDA_UNITS_T aUnit, double aValue)
Function To_User_Unit convert aValue in internal units to the appropriate user units defined by aUnit...
Definition: base_units.cpp:90
wxCheckListBox * m_layerCheckListBox
void DIALOG_PLOT::CreateDrillFile ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PLOT_BASE.

Definition at line 292 of file dialog_plot.cpp.

References PCB_EDIT_FRAME::InstallDrillFrame(), and m_parent.

293 {
294  m_parent->InstallDrillFrame( event );
295 }
PCB_EDIT_FRAME * m_parent
Definition: dialog_plot.h:42
void InstallDrillFrame(wxCommandEvent &event)
void DIALOG_PLOT_BASE::DIALOG_PLOT_BASEOnContextMenu ( wxMouseEvent &  event)
inlineinherited

Definition at line 137 of file dialog_plot_base.h.

Referenced by DIALOG_PLOT_BASE::DIALOG_PLOT_BASE().

138  {
139  this->PopupMenu( m_popMenu, event.GetPosition() );
140  }
bool DIALOG_SHIM::Enable ( bool  enable)
overrideinherited

Definition at line 181 of file dialog_shim.cpp.

Referenced by DIALOG_PRINT_USING_PRINTER::InitValues().

182 {
183  // so we can do logging of this state change:
184 
185 #if defined(DEBUG)
186  const char* type_id = typeid( *this ).name();
187  printf( "wxDialog %s: %s\n", type_id, enable ? "enabled" : "disabled" );
188 #endif
189 
190  return wxDialog::Enable( enable );
191 }
void DIALOG_SHIM::EndQuasiModal ( int  retCode)
inherited

Definition at line 539 of file dialog_shim.cpp.

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

Referenced by HK_PROMPT_DIALOG::EndFlexible(), DIALOG_SHIM::OnButton(), DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::OnCancelButtonClick(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnCancelButtonClick(), DIALOG_EDIT_ONE_FIELD::OnCancelClick(), DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::OnCloseDialog(), DIALOG_EDIT_ONE_FIELD::OnCloseDialog(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnCloseDialog(), DIALOG_SHIM::OnCloseWindow(), DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::OnOKButtonClick(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnOKButtonClick(), DIALOG_EDIT_ONE_FIELD::OnOkClick(), DIALOG_EXCHANGE_MODULE::OnQuit(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::SetInitCmp(), and DIALOG_SHIM::~DIALOG_SHIM().

540 {
541  // Hook up validator and transfer data from controls handling so quasi-modal dialogs
542  // handle validation in the same way as other dialogs.
543  if( ( retCode == wxID_OK ) && ( !Validate() || !TransferDataFromWindow() ) )
544  return;
545 
546  SetReturnCode( retCode );
547 
548  if( !IsQuasiModal() )
549  {
550  wxFAIL_MSG( wxT( "either DIALOG_SHIM::EndQuasiModal called twice or ShowQuasiModal wasn't called" ) );
551  return;
552  }
553 
554  m_qmodal_showing = false;
555 
556  if( m_qmodal_loop )
557  {
558  if( m_qmodal_loop->IsRunning() )
559  m_qmodal_loop->Exit( 0 );
560  else
561  m_qmodal_loop->ScheduleExit( 0 );
562 
563  m_qmodal_loop = NULL;
564  }
565 
568 
569  Show( false );
570 }
bool m_qmodal_showing
Definition: dialog_shim.h:132
EVENT_LOOP * m_qmodal_loop
Definition: dialog_shim.h:131
bool IsQuasiModal()
Definition: dialog_shim.h:93
bool Show(bool show) override
WDO_ENABLE_DISABLE * m_qmodal_parent_disabler
Definition: dialog_shim.h:133
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 103 of file dialog_shim.cpp.

References PCAD2KICAD::Center.

Referenced by DIALOG_BOM::DIALOG_BOM(), DIALOG_COPPER_ZONE::DIALOG_COPPER_ZONE(), DIALOG_DESIGN_RULES::DIALOG_DESIGN_RULES(), DIALOG_DIMENSION_EDITOR::DIALOG_DIMENSION_EDITOR(), DIALOG_DISPLAY_OPTIONS::DIALOG_DISPLAY_OPTIONS(), DIALOG_DRC_CONTROL::DIALOG_DRC_CONTROL(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::DIALOG_EDIT_COMPONENT_IN_LIBRARY(), DIALOG_EESCHEMA_OPTIONS::DIALOG_EESCHEMA_OPTIONS(), DIALOG_ENUM_PADS::DIALOG_ENUM_PADS(), DIALOG_EXPORT_3DFILE::DIALOG_EXPORT_3DFILE(), DIALOG_EXPORT_IDF3::DIALOG_EXPORT_IDF3(), DIALOG_EXPORT_STEP::DIALOG_EXPORT_STEP(), DIALOG_FOOTPRINT_WIZARD_LIST::DIALOG_FOOTPRINT_WIZARD_LIST(), 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_TEXT::DIALOG_LIB_EDIT_TEXT(), DIALOG_LIB_NEW_COMPONENT::DIALOG_LIB_NEW_COMPONENT(), DIALOG_LIBEDIT_OPTIONS::DIALOG_LIBEDIT_OPTIONS(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), DIALOG_PLOT_SCHEMATIC::DIALOG_PLOT_SCHEMATIC(), DIALOG_SCH_EDIT_SHEET_PIN::DIALOG_SCH_EDIT_SHEET_PIN(), DIALOG_SCH_SHEET_PROPS::DIALOG_SCH_SHEET_PROPS(), DIALOG_SELECT_PRETTY_LIB::DIALOG_SELECT_PRETTY_LIB(), DIALOG_TRACK_VIA_SIZE::DIALOG_TRACK_VIA_SIZE(), DIALOG_EDIT_ONE_FIELD::init(), NETLIST_DIALOG::NETLIST_DIALOG(), DIALOG_LIB_EDIT_PIN::OnInitDialog(), DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::OnInitDialog(), DIALOG_TRACK_VIA_PROPERTIES::OnInitDlg(), DIALOG_GRAPHIC_ITEMS_OPTIONS::OnInitDlg(), DialogEditModuleText::OnInitDlg(), DIALOG_SET_GRID::OnInitDlg(), DIALOG_PCB_TEXT_PROPERTIES::OnInitDlg(), DIALOG_PRINT_FOR_MODEDIT::OnInitDlg(), DIALOG_GRAPHIC_ITEM_PROPERTIES::OnInitDlg(), DIALOG_MODULE_MODULE_EDITOR::OnInitDlg(), DIALOG_SIM_SETTINGS::onInitDlg(), DIALOG_SPICE_MODEL::onInitDlg(), DIALOG_MODULE_BOARD_EDITOR::OnInitDlg(), DIALOG_PRINT_USING_PRINTER::OnInitDlg(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnInitDlg(), TARGET_PROPERTIES_DIALOG_EDITOR::TARGET_PROPERTIES_DIALOG_EDITOR(), and DIALOG_SIGNAL_LIST::TransferDataToWindow().

104 {
105  // must be called from the constructor of derived classes,
106  // when all widgets are initialized, and therefore their size fixed
107 
108  // SetSizeHints fixes the minimal size of sizers in the dialog
109  // (SetSizeHints calls Fit(), so no need to call it)
110  GetSizer()->SetSizeHints( this );
111 
112  // the default position, when calling the first time the dlg
113  Center();
114 }
void DIALOG_SHIM::FixOSXCancelButtonIssue ( )
protectedinherited

A ugly hack to fix an issue on OSX: when typing ctrl+c in a wxTextCtrl inside a dialog, it is closed instead of copying a text if a button with wxID_CANCEL is used in a wxStdDialogButtonSizer, when the dlg is created by wxFormBuilder: the label is &Cancel, and this accelerator key has priority to copy text standard accelerator, and the dlg is closed when trying to copy text this function do nothing on other platforms.

Definition at line 116 of file dialog_shim.cpp.

Referenced by DIALOG_SHIM::Show().

117 {
118 #ifdef __WXMAC__
119  // A ugly hack to fix an issue on OSX: ctrl+c closes the dialog instead of
120  // copying a text if a button with wxID_CANCEL is used in a wxStdDialogButtonSizer
121  // created by wxFormBuilder: the label is &Cancel, and this accelerator key has priority
122  // to copy text standard accelerator, and the dlg is closed when trying to copy text
123  wxButton* button = dynamic_cast< wxButton* > ( wxWindow::FindWindowById( wxID_CANCEL, this ) );
124 
125  if( button )
126  button->SetLabel( _( "Cancel" ) );
127 #endif
128 }
PlotFormat DIALOG_PLOT::getPlotFormat ( )
private

Definition at line 344 of file dialog_plot.cpp.

References DIALOG_PLOT_BASE::m_plotFormatOpt, PLOT_FORMAT_DXF, PLOT_FORMAT_GERBER, PLOT_FORMAT_HPGL, PLOT_FORMAT_PDF, PLOT_FORMAT_POST, and PLOT_FORMAT_SVG.

Referenced by applyPlotSettings(), and SetPlotFormat().

345 {
346  // plot format id's are ordered like displayed in m_plotFormatOpt
347  static const PlotFormat plotFmt[] =
348  {
355  };
356 
357  return plotFmt[ m_plotFormatOpt->GetSelection() ];
358 }
PlotFormat
Enum PlotFormat is the set of supported output plot formats.
Definition: plot_common.h:49
wxChoice * m_plotFormatOpt
void DIALOG_PLOT::Init_Dialog ( )
private

Definition at line 59 of file dialog_plot.cpp.

References AddUnitSymbol(), CONFIG_PS_FINEWIDTH_ADJ, g_UserUnit, PCB_PLOT_PARAMS::GetA4Output(), BOARD::GetDesignSettings(), PCB_PLOT_PARAMS::GetDrillMarksType(), 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::GetLineWidth(), PCB_PLOT_PARAMS::GetMirror(), PCB_PLOT_PARAMS::GetNegative(), PCB_PLOT_PARAMS::GetOutputDirectory(), PCB_PLOT_PARAMS::GetPlotFrameRef(), PCB_PLOT_PARAMS::GetPlotInvisibleText(), PCB_PLOT_PARAMS::GetPlotMode(), PCB_PLOT_PARAMS::GetPlotPadsOnSilkLayer(), PCB_PLOT_PARAMS::GetPlotReference(), PCB_PLOT_PARAMS::GetPlotValue(), PCB_PLOT_PARAMS::GetPlotViaOnMaskLayer(), PCB_PLOT_PARAMS::GetScaleSelection(), BOARD_DESIGN_SETTINGS::GetSmallestClearanceValue(), PCB_PLOT_PARAMS::GetSubtractMaskFromSilk(), PCB_PLOT_PARAMS::GetUseAuxOrigin(), PCB_PLOT_PARAMS::GetUseGerberAttributes(), PCB_PLOT_PARAMS::GetUseGerberProtelExtensions(), KiROUND(), m_board, m_config, DIALOG_PLOT_BASE::m_drillShapeOpt, DIALOG_PLOT_BASE::m_excludeEdgeLayerOpt, DIALOG_PLOT_BASE::m_fineAdjustXscaleOpt, DIALOG_PLOT_BASE::m_fineAdjustYscaleOpt, DIALOG_PLOT_BASE::m_forcePSA4OutputOpt, DIALOG_PLOT_BASE::m_HPGLPenSizeOpt, DIALOG_PLOT_BASE::m_layerCheckListBox, m_layerList, DIALOG_PLOT_BASE::m_linesWidth, DIALOG_PLOT_BASE::m_outputDirectoryName, 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_plotPads_on_Silkscreen, DIALOG_PLOT_BASE::m_plotPSNegativeOpt, DIALOG_PLOT_BASE::m_plotSheetRef, DIALOG_PLOT_BASE::m_PSFineAdjustWidthOpt, m_PSWidthAdjust, DIALOG_PLOT_BASE::m_rbGerberFormat, DIALOG_PLOT_BASE::m_scaleOpt, BOARD_DESIGN_SETTINGS::m_SolderMaskMargin, DIALOG_PLOT_BASE::m_SolderMaskMarginCurrValue, BOARD_DESIGN_SETTINGS::m_SolderMaskMinWidth, DIALOG_PLOT_BASE::m_SolderMaskMinWidthCurrValue, DIALOG_PLOT_BASE::m_subtractMaskFromSilk, DIALOG_PLOT_BASE::m_textDefaultPenSize, DIALOG_PLOT_BASE::m_textPenSize, DIALOG_PLOT_BASE::m_textPSFineAdjustWidth, BOARD_DESIGN_SETTINGS::m_TrackMinWidth, DIALOG_PLOT_BASE::m_useAuxOriginCheckBox, DIALOG_PLOT_BASE::m_useGerberExtensions, DIALOG_PLOT_BASE::m_useGerberNetAttributes, DIALOG_PLOT_BASE::m_useGerberX2Attributes, m_widthAdjustMaxValue, m_widthAdjustMinValue, m_XScaleAdjust, m_YScaleAdjust, OnSetScaleOpt(), OPTKEY_PLOT_X_FINESCALE_ADJ, OPTKEY_PLOT_Y_FINESCALE_ADJ, PLOT_FORMAT_DXF, PLOT_FORMAT_GERBER, PLOT_FORMAT_HPGL, PLOT_FORMAT_PDF, PLOT_FORMAT_POST, PLOT_FORMAT_SVG, PLOT_MAX_SCALE, PLOT_MIN_SCALE, PCB_PLOT_PARAMS::SetIncludeGerberNetlistInfo(), SetPlotFormat(), setPlotModeChoiceSelection(), StringFromValue(), To_User_Unit(), and LSET::UIOrder().

Referenced by DIALOG_PLOT().

60 {
61  wxString msg;
62  wxFileName fileName;
63 
66 
67  // m_PSWidthAdjust is stored in mm in user config
68  double dtmp;
69  m_config->Read( CONFIG_PS_FINEWIDTH_ADJ, &dtmp, 0 );
70  m_PSWidthAdjust = KiROUND( dtmp * IU_PER_MM );
71 
72  // The reasonable width correction value must be in a range of
73  // [-(MinTrackWidth-1), +(MinClearanceValue-1)] decimils.
76 
77  switch( m_plotOpts.GetFormat() )
78  {
79  default:
80  case PLOT_FORMAT_GERBER:
81  m_plotFormatOpt->SetSelection( 0 );
82  break;
83 
84  case PLOT_FORMAT_POST:
85  m_plotFormatOpt->SetSelection( 1 );
86  break;
87 
88  case PLOT_FORMAT_SVG:
89  m_plotFormatOpt->SetSelection( 2 );
90  break;
91 
92  case PLOT_FORMAT_DXF:
93  m_plotFormatOpt->SetSelection( 3 );
94  break;
95 
96  case PLOT_FORMAT_HPGL:
97  m_plotFormatOpt->SetSelection( 4 );
98  break;
99 
100  case PLOT_FORMAT_PDF:
101  m_plotFormatOpt->SetSelection( 5 );
102  break;
103  }
104 
106  m_SolderMaskMarginCurrValue->SetLabel( msg );
108  m_SolderMaskMinWidthCurrValue->SetLabel( msg );
109 
110  // Set units and value for HPGL pen size (this param in in mils).
113  m_plotOpts.GetHPGLPenDiameter() * IU_PER_MILS );
114  m_HPGLPenSizeOpt->AppendText( msg );
115 
118  m_linesWidth->AppendText( msg );
119 
120  // Set units for PS global width correction.
122 
124 
125  // Test for a reasonable scale value. Set to 1 if problem
129 
130  msg.Printf( wxT( "%f" ), m_XScaleAdjust );
131  m_fineAdjustXscaleOpt->AppendText( msg );
132 
133  msg.Printf( wxT( "%f" ), m_YScaleAdjust );
134  m_fineAdjustYscaleOpt->AppendText( msg );
135 
136  // Test for a reasonable PS width correction value. Set to 0 if problem.
137  if( m_PSWidthAdjust < m_widthAdjustMinValue || m_PSWidthAdjust > m_widthAdjustMaxValue )
138  m_PSWidthAdjust = 0.;
139 
140  msg.Printf( wxT( "%f" ), To_User_Unit( g_UserUnit, m_PSWidthAdjust ) );
141  m_PSFineAdjustWidthOpt->AppendText( msg );
142 
145 
146  // Could devote a PlotOrder() function in place of UIOrder().
148 
149  // Populate the check list box by all enabled layers names
150  for( LSEQ seq = m_layerList; seq; ++seq )
151  {
152  LAYER_ID layer = *seq;
153 
154  int checkIndex = m_layerCheckListBox->Append( m_board->GetLayerName( layer ) );
155 
156  if( m_plotOpts.GetLayerSelection()[layer] )
157  m_layerCheckListBox->Check( checkIndex );
158  }
159 
160  // Option for using proper Gerber extensions
162 
163  // Option for including Gerber attributes (from Gerber X2 format) in the output
165 
166  // Option for including Gerber netlist info (from Gerber X2 format) in the output
167 #ifdef KICAD_USE_GBR_NETATTRIBUTES
169 
170  // Grey out if m_useGerberX2Attributes is not checked
171  m_useGerberNetAttributes->Enable( m_useGerberX2Attributes->GetValue() );
172 #else
174  m_useGerberNetAttributes->SetValue( false );
175 #endif
176  // Gerber precision for coordinates
177  m_rbGerberFormat->SetSelection( m_plotOpts.GetGerberPrecision() == 5 ? 0 : 1 );
178 
179  // Option for excluding contents of "Edges Pcb" layer
181 
183 
184  // Option to plot page references:
186 
187  // Option to allow pads on silkscreen layers
189 
190  // Options to plot texts on footprints
194 
195  // Options to plot pads and vias holes
196  m_drillShapeOpt->SetSelection( m_plotOpts.GetDrillMarksType() );
197 
198  // Scale option
199  m_scaleOpt->SetSelection( m_plotOpts.GetScaleSelection() );
200 
201  // Plot mode
203 
204  // Plot mirror option
205  m_plotMirrorOpt->SetValue( m_plotOpts.GetMirror() );
206 
207  // Put vias on mask layer
209 
210  // Output directory
212 
213  // Update options values:
214  wxCommandEvent cmd_event;
215  SetPlotFormat( cmd_event );
216  OnSetScaleOpt( cmd_event );
217 }
bool GetUseGerberProtelExtensions() const
wxStaticText * m_textPSFineAdjustWidth
LSEQ m_layerList
Definition: dialog_plot.h:45
void SetIncludeGerberNetlistInfo(bool aUse)
int m_SolderMaskMargin
Solder mask margin.
wxTextCtrl * m_linesWidth
bool GetMirror() const
double m_YScaleAdjust
Definition: dialog_plot.h:48
bool GetSubtractMaskFromSilk() const
wxTextCtrl * m_fineAdjustYscaleOpt
int GetHPGLPenDiameter() const
wxCheckBox * m_useGerberExtensions
wxCheckBox * m_plotPads_on_Silkscreen
wxStaticText * m_SolderMaskMarginCurrValue
static int KiROUND(double v)
KiROUND rounds a floating point number to an int using "round halfway cases away from zero"...
Definition: common.h:107
#define OPTKEY_PLOT_Y_FINESCALE_ADJ
Definition: pcbplot.h:62
int GetSmallestClearanceValue()
Function GetSmallestClearanceValue.
bool GetUseGerberAttributes() const
wxStaticText * m_textPenSize
wxCheckBox * m_plotPSNegativeOpt
#define PLOT_MIN_SCALE
Definition: pcbplot.h:68
wxRadioBox * m_rbGerberFormat
wxString StringFromValue(EDA_UNITS_T aUnit, int aValue, bool aAddUnitSymbol)
Function StringFromValue returns the string from aValue according to units (inch, mm ...
Definition: base_units.cpp:203
wxCheckBox * m_excludeEdgeLayerOpt
BOARD * m_board
Definition: dialog_plot.h:43
wxCheckBox * m_plotMirrorOpt
bool GetUseAuxOrigin() const
LSET GetLayerSelection() const
wxChoice * m_plotFormatOpt
const wxString GetLayerName(LAYER_ID aLayer) const
Function GetLayerName returns the name of a layer given by aLayer.
LSET GetEnabledLayers() const
Function GetEnabledLayers is a proxy function that calls the corresponding function in m_BoardSetting...
bool GetPlotValue() const
wxCheckBox * m_useGerberX2Attributes
double m_XScaleAdjust
Definition: dialog_plot.h:46
bool GetA4Output() const
bool GetExcludeEdgeLayer() const
wxCheckBox * m_plotSheetRef
wxString GetOutputDirectory() const
void SetPlotFormat(wxCommandEvent &event) override
wxTextCtrl * m_PSFineAdjustWidthOpt
DrillMarksType GetDrillMarksType() const
bool GetIncludeGerberNetlistInfo() const
#define OPTKEY_PLOT_X_FINESCALE_ADJ
Definition: pcbplot.h:61
int GetLineWidth() const
int m_widthAdjustMaxValue
Definition: dialog_plot.h:55
wxStaticText * m_SolderMaskMinWidthCurrValue
int m_TrackMinWidth
track min value for width ((min copper size value
#define PLOT_MAX_SCALE
Definition: pcbplot.h:69
int m_PSWidthAdjust
Definition: dialog_plot.h:50
wxCheckBox * m_forcePSA4OutputOpt
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:530
#define CONFIG_PS_FINEWIDTH_ADJ
Definition: pcbplot.h:63
void setPlotModeChoiceSelection(EDA_DRAW_MODE_T aPlotMode)
Definition: dialog_plot.h:78
bool GetPlotViaOnMaskLayer() const
int GetScaleSelection() const
void OnSetScaleOpt(wxCommandEvent &event) override
wxCheckBox * m_useGerberNetAttributes
bool GetPlotReference() const
int m_widthAdjustMinValue
Definition: dialog_plot.h:54
PlotFormat GetFormat() const
wxTextCtrl * m_outputDirectoryName
Class LSEQ is a sequence (and therefore also a set) of LAYER_IDs.
PCB_PLOT_PARAMS m_plotOpts
Definition: dialog_plot.h:58
EDA_UNITS_T g_UserUnit
Global variables definitions.
Definition: common.cpp:56
wxChoice * m_scaleOpt
wxCheckBox * m_plotModuleRefOpt
wxCheckBox * m_subtractMaskFromSilk
wxCheckBox * m_plotNoViaOnMaskOpt
wxCheckBox * m_plotModuleValueOpt
bool GetPlotInvisibleText() const
wxChoice * m_drillShapeOpt
void AddUnitSymbol(wxStaticText &Stext, EDA_UNITS_T aUnit)
Definition: base_units.cpp:509
wxTextCtrl * m_fineAdjustXscaleOpt
LAYER_ID
Enum LAYER_ID is the set of PCB layers.
bool GetNegative() const
bool GetPlotFrameRef() const
wxTextCtrl * m_HPGLPenSizeOpt
wxCheckBox * m_plotInvisibleText
EDA_DRAW_MODE_T GetPlotMode() const
bool GetPlotPadsOnSilkLayer() const
wxCheckBox * m_useAuxOriginCheckBox
wxConfigBase * m_config
Definition: dialog_plot.h:44
double To_User_Unit(EDA_UNITS_T aUnit, double aValue)
Function To_User_Unit convert aValue in internal units to the appropriate user units defined by aUnit...
Definition: base_units.cpp:90
wxStaticText * m_textDefaultPenSize
wxCheckListBox * m_layerCheckListBox
int m_SolderMaskMinWidth
Solder mask min width.
LSEQ UIOrder() const
Definition: lset.cpp:751
int GetGerberPrecision() const
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 60 of file kiway_player.h.

References KIWAY_HOLDER::m_kiway.

Referenced by SCH_EDIT_FRAME::AppendOneEEProject(), DIALOG_CHOOSE_COMPONENT::ConstructRightPanel(), CVPCB_MAINFRAME::CreateScreenCmp(), DIALOG_SHIM::DIALOG_SHIM(), EDIT_TOOL::editFootprintInFpEditor(), SCH_EDIT_FRAME::EditSheet(), FOOTPRINT_EDIT_FRAME::GetPlotSettings(), DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::initBuffers(), LIB_EDIT_FRAME::InstallConfigFrame(), PCB_EDIT_FRAME::InstallModuleOptionsFrame(), KIWAY_PLAYER::language_change(), SCH_SHEET::Load(), KIWAY_PLAYER::OnChangeIconsOptions(), SCH_EDIT_FRAME::OnLeftClick(), SCH_BASE_FRAME::OnOpenLibraryViewer(), SCH_EDIT_FRAME::OnSimulate(), DIALOG_EDIT_ONE_FIELD::OnTextValueSelectButtonClick(), FOOTPRINT_EDIT_FRAME::OnUpdateInsertModuleInBoard(), FOOTPRINT_EDIT_FRAME::OnUpdateLoadModuleFromBoard(), FOOTPRINT_EDIT_FRAME::OnUpdateReplaceModuleInBoard(), SCH_EDIT_FRAME::OpenProjectFiles(), KIWAY_HOLDER::Prj(), PCB_EDIT_FRAME::Process_Config(), PCB_EDIT_FRAME::Process_Special_Functions(), FOOTPRINT_EDIT_FRAME::ProcessPreferences(), LIB_EDIT_FRAME::refreshSchematic(), SCH_EDIT_FRAME::SaveEEFile(), CVPCB_MAINFRAME::SaveFootprintAssociation(), SCH_BASE_FRAME::SelectComponentFromLibBrowser(), CVPCB_MAINFRAME::SendMessageToEESCHEMA(), PCB_EDIT_FRAME::SendMessageToEESCHEMA(), SCH_EDIT_FRAME::SendMessageToPCBNEW(), SCH_EDIT_FRAME::sendNetlist(), FOOTPRINT_EDIT_FRAME::SetPlotSettings(), DISPLAY_FOOTPRINTS_FRAME::Show3D_Frame(), FOOTPRINT_VIEWER_FRAME::Show3D_Frame(), FOOTPRINT_EDIT_FRAME::Show3D_Frame(), FOOTPRINT_WIZARD_FRAME::Show3D_Frame(), DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::showButtonHandler(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::showButtonHandler(), SIM_PLOT_FRAME::SIM_PLOT_FRAME(), and DIALOG_EXCHANGE_MODULE::ViewAndSelectFootprint().

61  {
62  wxASSERT( m_kiway ); // smoke out bugs in Debug build, then Release runs fine.
63  return *m_kiway;
64  }
KIWAY * m_kiway
Definition: kiway_player.h:85
void DIALOG_PLOT::OnClose ( wxCloseEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PLOT_BASE.

Definition at line 226 of file dialog_plot.cpp.

References applyPlotSettings().

227 {
229  EndModal( 0 );
230 }
void applyPlotSettings()
void DIALOG_PLOT::OnGerberX2Checked ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PLOT_BASE.

Definition at line 676 of file dialog_plot.cpp.

References DIALOG_PLOT_BASE::m_useGerberNetAttributes, and DIALOG_PLOT_BASE::m_useGerberX2Attributes.

677 {
678  // m_useGerberNetAttributes is useless if m_useGerberX2Attributes
679  // is not checked. So disabled (greyed out) when Gerber X2 gets unchecked
680  // to make it clear to the user.
681  if( m_useGerberX2Attributes->GetValue() )
682  {
683  m_useGerberNetAttributes->Enable( true );
684  }
685  else
686  {
687  m_useGerberNetAttributes->Enable( false );
688  m_useGerberNetAttributes->SetValue( false );
689  }
690 }
wxCheckBox * m_useGerberX2Attributes
wxCheckBox * m_useGerberNetAttributes
virtual void DIALOG_PLOT_BASE::OnInitDialog ( wxInitDialogEvent &  event)
inlineprotectedvirtualinherited

Definition at line 119 of file dialog_plot_base.h.

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

119 { event.Skip(); }
void DIALOG_PLOT::OnOutputDirectoryBrowseClicked ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PLOT_BASE.

Definition at line 310 of file dialog_plot.cpp.

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

311 {
312  // Build the absolute path of current output plot directory
313  // to preselect it when opening the dialog.
314  wxFileName fn( m_outputDirectoryName->GetValue() );
315  wxString path = Prj().AbsolutePath( m_outputDirectoryName->GetValue() );
316 
317  wxDirDialog dirDialog( this, _( "Select Output Directory" ), path );
318 
319  if( dirDialog.ShowModal() == wxID_CANCEL )
320  return;
321 
322  wxFileName dirName = wxFileName::DirName( dirDialog.GetPath() );
323 
324  fn = Prj().AbsolutePath( m_parent->GetBoard()->GetFileName() );
325  wxString defaultPath = fn.GetPathWithSep();
326  wxString msg;
327  msg.Printf( _( "Do you want to use a path relative to\n'%s'" ),
328  GetChars( defaultPath ) );
329 
330  wxMessageDialog dialog( this, msg, _( "Plot Output Directory" ),
331  wxYES_NO | wxICON_QUESTION | wxYES_DEFAULT );
332 
333  if( dialog.ShowModal() == wxID_YES )
334  {
335  if( !dirName.MakeRelativeTo( defaultPath ) )
336  wxMessageBox( _( "Cannot make path relative (target volume different from file volume)!" ),
337  _( "Plot Output Directory" ), wxOK | wxICON_ERROR );
338  }
339 
340  m_outputDirectoryName->SetValue( dirName.GetFullPath() );
341 }
BOARD * GetBoard() const
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
PCB_EDIT_FRAME * m_parent
Definition: dialog_plot.h:42
const wxString & GetFileName() const
Definition: class_board.h:237
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:370
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:92
void DIALOG_PLOT::OnPopUpLayers ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PLOT_BASE.

Definition at line 242 of file dialog_plot.cpp.

References LSET::AllCuMask(), LSET::AllTechMask(), 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.

243 {
244  unsigned int i;
245 
246  switch( event.GetId() )
247  {
248  case ID_LAYER_FAB: // Select layers usually needed to build a board
249  for( i = 0; i < m_layerList.size(); i++ )
250  {
251  LSET layermask( m_layerList[ i ] );
252 
253  if( ( layermask & ( LSET::AllCuMask() | LSET::AllTechMask() ) ).any() )
254  m_layerCheckListBox->Check( i, true );
255  else
256  m_layerCheckListBox->Check( i, false );
257  }
258  break;
259 
261  for( i = 0; i < m_layerList.size(); i++ )
262  {
263  if( IsCopperLayer( m_layerList[i] ) )
264  m_layerCheckListBox->Check( i, true );
265  }
266  break;
267 
269  for( i = 0; i < m_layerList.size(); i++ )
270  {
271  if( IsCopperLayer( m_layerList[i] ) )
272  m_layerCheckListBox->Check( i, false );
273  }
274  break;
275 
277  for( i = 0; i < m_layerList.size(); i++ )
278  m_layerCheckListBox->Check( i, true );
279  break;
280 
282  for( i = 0; i < m_layerList.size(); i++ )
283  m_layerCheckListBox->Check( i, false );
284  break;
285 
286  default:
287  break;
288  }
289 }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Function AllCuMask returns a mask holding the requested number of Cu LAYER_IDs.
Definition: lset.cpp:638
LSEQ m_layerList
Definition: dialog_plot.h:45
static LSET AllTechMask()
Function AllTechMask returns a mask holding all technical layers (no CU layer) on both side...
Definition: lset.cpp:708
Class LSET is a set of LAYER_IDs.
bool IsCopperLayer(LAYER_NUM aLayerId)
Function IsCopperLayer tests whether a layer is a copper layer.
wxCheckListBox * m_layerCheckListBox
void DIALOG_PLOT::OnQuit ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PLOT_BASE.

Definition at line 220 of file dialog_plot.cpp.

221 {
222  Close( true ); // true is to force the frame to close
223 }
void DIALOG_PLOT::OnRightClick ( wxMouseEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PLOT_BASE.

Definition at line 234 of file dialog_plot.cpp.

References DIALOG_PLOT_BASE::m_popMenu.

235 {
236  PopupMenu( m_popMenu );
237 }
void DIALOG_PLOT::onRunDRC ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PLOT_BASE.

Definition at line 825 of file dialog_plot.cpp.

References DRC::DestroyDRCDialog(), PCB_EDIT_FRAME::GetDrcController(), and DRC::ShowDRCDialog().

826 {
827  PCB_EDIT_FRAME* parent = dynamic_cast<PCB_EDIT_FRAME*>( GetParent() );
828 
829  if( parent )
830  {
831  // First close an existing dialog if open
832  // (low probability, but can happen)
833  parent->GetDrcController()->DestroyDRCDialog( wxID_OK );
834 
835  // Open a new drc dialod, with the right parent frame, and in Modal Mode
836  parent->GetDrcController()->ShowDRCDialog( this );
837  }
838 }
void DestroyDRCDialog(int aReason)
Function DestroyDRCDialog deletes this ui dialog box and zeros out its pointer to remember the state ...
Definition: drc.cpp:98
void ShowDRCDialog(wxWindow *aParent=NULL)
Function ShowDRCDialog opens a dialog and prompts the user, then if a test run button is clicked...
Definition: drc.cpp:57
DRC * GetDrcController()
Definition: wxPcbStruct.h:910
void DIALOG_PLOT::OnSetScaleOpt ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PLOT_BASE.

Definition at line 298 of file dialog_plot.cpp.

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

Referenced by Init_Dialog(), and SetPlotFormat().

299 {
300  /* Disable sheet reference for scale != 1:1 */
301  bool scale1 = ( m_scaleOpt->GetSelection() == 1 );
302 
303  m_plotSheetRef->Enable( scale1 );
304 
305  if( !scale1 )
306  m_plotSheetRef->SetValue( false );
307 }
wxCheckBox * m_plotSheetRef
wxChoice * m_scaleOpt
void DIALOG_PLOT::Plot ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PLOT_BASE.

Definition at line 693 of file dialog_plot.cpp.

References LSET::AllCuMask(), applyPlotSettings(), BuildPlotFileName(), DisplayError(), DisplayInfoMessage(), dummy(), PLOTTER::EndPlot(), EnsureFileDirectoryExists(), PCB_BASE_FRAME::GetBoard(), GetChars(), GetDefaultPlotExtension(), BOARD::GetEnabledLayers(), BOARD::GetFileName(), PCB_PLOT_PARAMS::GetFormat(), GetGerberProtelExtension(), BOARD::GetLayerName(), PCB_PLOT_PARAMS::GetLayerSelection(), PCB_PLOT_PARAMS::GetOutputDirectory(), PCB_PLOT_PARAMS::GetScale(), PCB_PLOT_PARAMS::GetScaleSelection(), m_board, DIALOG_PLOT_BASE::m_fineAdjustXscaleOpt, DIALOG_PLOT_BASE::m_fineAdjustYscaleOpt, DIALOG_PLOT_BASE::m_messagesPanel, m_parent, m_plotOpts, DIALOG_PLOT_BASE::m_PSFineAdjustWidthOpt, m_PSWidthAdjust, DIALOG_PLOT_BASE::m_useGerberExtensions, m_XScaleAdjust, m_YScaleAdjust, PLOT_FORMAT_GERBER, PLOT_MAX_SCALE, PLOT_MIN_SCALE, PlotOneBoardLayer(), REPORTER::Report(), WX_HTML_REPORT_PANEL::Reporter(), REPORTER::RPT_ACTION, REPORTER::RPT_ERROR, PCB_PLOT_PARAMS::SetAutoScale(), PCB_PLOT_PARAMS::SetFineScaleAdjustX(), PCB_PLOT_PARAMS::SetFineScaleAdjustY(), PCB_BASE_FRAME::SetPlotSettings(), PCB_PLOT_PARAMS::SetScale(), PCB_PLOT_PARAMS::SetWidthAdjust(), StartPlotBoard(), and LSET::UIOrder().

694 {
696 
697  // Create output directory if it does not exist (also transform it in
698  // absolute form). Bail if it fails
699  wxFileName outputDir = wxFileName::DirName( m_plotOpts.GetOutputDirectory() );
700  wxString boardFilename = m_parent->GetBoard()->GetFileName();
701  REPORTER& reporter = m_messagesPanel->Reporter();
702 
703  if( !EnsureFileDirectoryExists( &outputDir, boardFilename, &reporter ) )
704  {
705  wxString msg;
706  msg.Printf( _( "Could not write plot files to folder \"%s\"." ),
707  GetChars( outputDir.GetPath() ) );
708  DisplayError( this, msg );
709  return;
710  }
711 
712  m_plotOpts.SetAutoScale( false );
713  m_plotOpts.SetScale( 1 );
714 
715  switch( m_plotOpts.GetScaleSelection() )
716  {
717  default:
718  break;
719 
720  case 0: // Autoscale option
721  m_plotOpts.SetAutoScale( true );
722  break;
723 
724  case 2: // 3:2 option
725  m_plotOpts.SetScale( 1.5 );
726  break;
727 
728  case 3: // 2:1 option
729  m_plotOpts.SetScale( 2 );
730  break;
731 
732  case 4: // 3:1 option
733  m_plotOpts.SetScale( 3 );
734  break;
735  }
736 
737  /* If the scale factor edit controls are disabled or the scale value
738  * is 0, don't adjust the base scale factor. This fixes a bug when
739  * the default scale adjust is initialized to 0 and saved in program
740  * settings resulting in a divide by zero fault.
741  */
742  if( m_fineAdjustXscaleOpt->IsEnabled() && m_XScaleAdjust != 0.0 )
744 
745  if( m_fineAdjustYscaleOpt->IsEnabled() && m_YScaleAdjust != 0.0 )
747 
748  if( m_PSFineAdjustWidthOpt->IsEnabled() )
750 
751  wxString file_ext( GetDefaultPlotExtension( m_plotOpts.GetFormat() ) );
752 
753  // Test for a reasonable scale value
754  // XXX could this actually happen? isn't it constrained in the apply
755  // function?
757  DisplayInfoMessage( this,
758  _( "Warning: Scale option set to a very small value" ) );
759 
761  DisplayInfoMessage( this,
762  _( "Warning: Scale option set to a very large value" ) );
763 
764  // Save the current plot options in the board
766 
767  wxBusyCursor dummy;
768 
769  for( LSEQ seq = m_plotOpts.GetLayerSelection().UIOrder(); seq; ++seq )
770  {
771  LAYER_ID layer = *seq;
772 
773  // All copper layers that are disabled are actually selected
774  // This is due to wonkyness in automatically selecting copper layers
775  // for plotting when adding more than two layers to a board.
776  // If plot options become accessible to the layers setup dialog
777  // please move this functionality there!
778  // This skips a copper layer if it is actually disabled on the board.
779  if( ( LSET::AllCuMask() & ~m_board->GetEnabledLayers() )[layer] )
780  continue;
781 
782  // Pick the basename from the board file
783  wxFileName fn( boardFilename );
784 
785  // Use Gerber Extensions based on layer number
786  // (See http://en.wikipedia.org/wiki/Gerber_File)
788  file_ext = GetGerberProtelExtension( layer );
789 
790  BuildPlotFileName( &fn, outputDir.GetPath(),
791  m_board->GetLayerName( layer ),
792  file_ext );
793 
794  LOCALE_IO toggle;
795 
796  BOARD* board = m_parent->GetBoard();
797  PLOTTER* plotter = StartPlotBoard( board, &m_plotOpts, layer, fn.GetFullPath(), wxEmptyString );
798 
799  // Print diags in messages box:
800  wxString msg;
801 
802  if( plotter )
803  {
804  PlotOneBoardLayer( board, plotter, layer, m_plotOpts );
805  plotter->EndPlot();
806  delete plotter;
807 
808  msg.Printf( _( "Plot file '%s' created." ), GetChars( fn.GetFullPath() ) );
809  reporter.Report( msg, REPORTER::RPT_ACTION );
810  }
811  else
812  {
813  msg.Printf( _( "Unable to create file '%s'." ), GetChars( fn.GetFullPath() ) );
814  reporter.Report( msg, REPORTER::RPT_ERROR );
815  }
816  }
817 
818  // If no layer selected, we have nothing plotted.
819  // Prompt user if it happens because he could think there is a bug in Pcbnew.
820  if( !m_plotOpts.GetLayerSelection().any() )
821  DisplayError( this, _( "No layer selected" ) );
822 }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Function AllCuMask returns a mask holding the requested number of Cu LAYER_IDs.
Definition: lset.cpp:638
WX_HTML_REPORT_PANEL * m_messagesPanel
double m_YScaleAdjust
Definition: dialog_plot.h:48
wxTextCtrl * m_fineAdjustYscaleOpt
wxCheckBox * m_useGerberExtensions
double GetScale() const
Class LOCALE_IO is a class that can be instantiated within a scope in which you are expecting excepti...
Definition: common.h:166
#define PLOT_MIN_SCALE
Definition: pcbplot.h:68
wxString GetDefaultPlotExtension(PlotFormat aFormat)
Returns the default plot extension for a format.
const wxString GetGerberProtelExtension(LAYER_NUM aLayer)
Function GetGerberProtelExtension.
Definition: pcbplot.cpp:48
BOARD * m_board
Definition: dialog_plot.h:43
BOARD * GetBoard() const
void PlotOneBoardLayer(BOARD *aBoard, PLOTTER *aPlotter, LAYER_ID aLayer, const PCB_PLOT_PARAMS &aPlotOpt)
Function PlotOneBoardLayer main function to plot one copper or technical layer.
Class REPORTER is a pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:61
LSET GetLayerSelection() const
const wxString GetLayerName(LAYER_ID aLayer) const
Function GetLayerName returns the name of a layer given by aLayer.
LSET GetEnabledLayers() const
Function GetEnabledLayers is a proxy function that calls the corresponding function in m_BoardSetting...
double m_XScaleAdjust
Definition: dialog_plot.h:46
virtual bool EndPlot()=0
wxString GetOutputDirectory() const
wxTextCtrl * m_PSFineAdjustWidthOpt
PCB_EDIT_FRAME * m_parent
Definition: dialog_plot.h:42
const wxString & GetFileName() const
Definition: class_board.h:237
bool EnsureFileDirectoryExists(wxFileName *aTargetFullFileName, const wxString &aBaseFilename, REPORTER *aReporter)
Helper function EnsureFileDirectoryExists make aTargetFullFileName absolute and creates the path of t...
Definition: common.cpp:267
REPORTER & Reporter()
returns the reporter object that reports to this panel
#define PLOT_MAX_SCALE
Definition: pcbplot.h:69
int m_PSWidthAdjust
Definition: dialog_plot.h:50
int GetScaleSelection() const
virtual void SetPlotSettings(const PCB_PLOT_PARAMS &aSettings)
PlotFormat GetFormat() const
void SetScale(double aVal)
Class LSEQ is a sequence (and therefore also a set) of LAYER_IDs.
PCB_PLOT_PARAMS m_plotOpts
Definition: dialog_plot.h:58
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:355
Base plotter engine class.
Definition: plot_common.h:86
void DisplayInfoMessage(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayInfoMessage displays an informational message box with aMessage.
Definition: confirm.cpp:89
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:92
wxTextCtrl * m_fineAdjustXscaleOpt
void applyPlotSettings()
void SetWidthAdjust(int aVal)
static LIB_PART * dummy()
Used when a LIB_PART is not found in library to draw a dummy shape This component is a 400 mils squar...
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:166
LAYER_ID
Enum LAYER_ID is the set of PCB layers.
void SetAutoScale(bool aFlag)
void SetFineScaleAdjustY(double aVal)
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_UNDEFINED)=0
Function Report is a pure virtual function to override in the derived object.
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...
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:69
LSEQ UIOrder() const
Definition: lset.cpp:751
PROJECT & KIWAY_HOLDER::Prj ( ) const
inherited

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

Definition at line 34 of file kiway_holder.cpp.

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

Referenced by SCH_EDIT_FRAME::AnnotateComponents(), SCH_EDIT_FRAME::AppendOneEEProject(), PCB_EDIT_FRAME::ArchiveModulesOnBoard(), LIB_VIEW_FRAME::BestZoom(), DIALOG_MODULE_MODULE_EDITOR::BrowseAndAdd3DShapeFile(), DIALOG_MODULE_BOARD_EDITOR::BrowseAndAdd3DShapeFile(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::BrowseAndSelectDocFile(), DIALOG_EXCHANGE_MODULE::BrowseAndSelectFootprint(), CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX(), DIALOG_MODULE_MODULE_EDITOR::Cfg3DPath(), DIALOG_MODULE_BOARD_EDITOR::Cfg3DPath(), SCH_EDIT_FRAME::CheckAnnotate(), SCH_SCREEN::CheckComponentsToPartsLinks(), SCH_EDIT_FRAME::ConvertPart(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToOptions(), SCH_EDIT_FRAME::CreateArchiveLibrary(), PCB_BASE_EDIT_FRAME::CreateNewLibrary(), DIALOG_PLOT_SCHEMATIC::createPlotFileName(), FOOTPRINT_EDIT_FRAME::DeleteModuleFromCurrentLibrary(), LIB_EDIT_FRAME::DeleteOnePart(), DIALOG_CONFIG_EQUFILES::DIALOG_CONFIG_EQUFILES(), DIALOG_EESCHEMA_CONFIG::DIALOG_EESCHEMA_CONFIG(), DIALOG_FP_LIB_TABLE::DIALOG_FP_LIB_TABLE(), DIALOG_MODULE_MODULE_EDITOR::DIALOG_MODULE_MODULE_EDITOR(), DIALOG_PAGES_SETTINGS::DIALOG_PAGES_SETTINGS(), DIALOG_SCH_EDIT_ONE_FIELD::DIALOG_SCH_EDIT_ONE_FIELD(), LIB_VIEW_FRAME::DisplayLibInfos(), SCH_BASE_FRAME::DisplayListComponentsInLib(), PCB_EDIT_FRAME::doAutoSave(), DIALOG_MODULE_MODULE_EDITOR::Edit3DShapeFileName(), DIALOG_MODULE_BOARD_EDITOR::Edit3DShapeFileName(), SCH_EDIT_FRAME::EditComponentFieldText(), SCH_EDIT_FRAME::EditSheet(), PCB_EDIT_FRAME::Export_IDF3(), PCB_EDIT_FRAME::ExportToGenCAD(), PCB_EDIT_FRAME::ExportVRML_File(), PCB_EDIT_FRAME::Files_io_from_id(), PCB_EDIT_FRAME::GenD356File(), DIALOG_GENDRILL::GenDrillAndMapFiles(), NETLIST_DIALOG::GenNetlist(), DISPLAY_FOOTPRINTS_FRAME::Get_Module(), FOOTPRINT_VIEWER_FRAME::getCurFootprintName(), LIB_EDIT_FRAME::GetCurLib(), FOOTPRINT_VIEWER_FRAME::getCurNickname(), LIB_EDIT_FRAME::GetCurPart(), FOOTPRINT_EDIT_FRAME::GetCurrentLib(), FOOTPRINT_EDIT_FRAME::getLibPath(), DIALOG_BOM::getPluginFileName(), LIB_VIEW_FRAME::getSelectedAlias(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::InitBuffers(), DIALOG_MODULE_MODULE_EDITOR::initModeditProperties(), DIALOG_MODULE_BOARD_EDITOR::InitModeditProperties(), LIB_EDIT_FRAME::InstallConfigFrame(), SCH_EDIT_FRAME::InstallConfigFrame(), PCB_EDIT_FRAME::InstallNetlistFrame(), SCH_EDIT_FRAME::IsSearchCacheObsolete(), SCH_EDIT_FRAME::Load_Component(), SCH_EDIT_FRAME::LoadCmpToFootprintLinkFile(), CVPCB_MAINFRAME::LoadFootprintFiles(), SCH_EDIT_FRAME::LoadOneEEFile(), LIB_EDIT_FRAME::LoadOneLibraryPart(), LIB_EDIT_FRAME::LoadOneSymbol(), CVPCB_MAINFRAME::LoadProjectFile(), SCH_EDIT_FRAME::LoadProjectFile(), PCB_EDIT_FRAME::LoadProjectSettings(), DIALOG_DRC_CONTROL::makeValidFileNameReport(), FOOTPRINT_VIEWER_FRAME::OnActivate(), DIALOG_EESCHEMA_CONFIG::OnAddOrInsertLibClick(), DIALOG_EESCHEMA_CONFIG::OnAddOrInsertPath(), DIALOG_DRC_CONTROL::OnButtonBrowseRptFileClick(), LIB_EDIT_FRAME::OnCloseWindow(), CVPCB_MAINFRAME::OnEditFootprintLibraryTable(), DIALOG_GENDRILL::OnGenReportFile(), PCB_EDIT_FRAME::OnLeftClick(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnOKButtonClick(), DIALOG_NETLIST::OnOpenNetlistClick(), OnOutputDirectoryBrowseClicked(), DIALOG_SVG_PRINT::OnOutputDirectoryBrowseClicked(), DIALOG_GENDRILL::OnOutputDirectoryBrowseClicked(), DIALOG_PLOT_SCHEMATIC::OnOutputDirectoryBrowseClicked(), DIALOG_GEN_MODULE_POSITION::OnOutputDirectoryBrowseClicked(), LIB_EDIT_FRAME::OnPlotCurrentComponent(), SCH_EDIT_FRAME::OnRightClick(), DIALOG_BOM::OnRunPlugin(), DIALOG_NETLIST::OnSaveMessagesToFile(), SCH_EDIT_FRAME::OnSaveProject(), DIALOG_SPICE_MODEL::onSelectIcLib(), LIB_VIEW_FRAME::OnSelectSymbol(), SCH_EDIT_FRAME::OnSelectUnit(), DIALOG_SPICE_MODEL::onSemiSelectLib(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnTestChipName(), FOOTPRINT_EDIT_FRAME::OnUpdateSelectCurrentLib(), LIB_EDIT_FRAME::OnViewEntryDoc(), LIB_VIEW_FRAME::onViewSymbolDocument(), SCH_EDIT_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::OpenProjectFiles(), SCH_EDIT_FRAME::PasteListOfItems(), PCB_EDITOR_CONTROL::PlaceModule(), SCH_EDIT_FRAME::prepareForNetlist(), SCH_EDIT_FRAME::Process_Config(), PCB_EDIT_FRAME::Process_Config(), SCH_EDIT_FRAME::Process_Special_Functions(), SCH_EDIT_FRAME::ProcessCmpToFootprintLinkFile(), FP_LOADER_THREAD::ProcessEntry(), FOOTPRINT_EDIT_FRAME::ProcessPreferences(), CVPCB_MAINFRAME::ReadNetListAndLinkFiles(), PCB_EDIT_FRAME::RecreateCmpFileFromBoard(), FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList(), LIB_VIEW_FRAME::ReCreateHToolbar(), FOOTPRINT_VIEWER_FRAME::ReCreateLibraryList(), LIB_VIEW_FRAME::ReCreateListCmp(), LIB_VIEW_FRAME::ReCreateListLib(), LIB_VIEW_FRAME::RedrawActiveWindow(), EDA_3D_VIEWER::ReloadRequest(), SCH_EDIT_FRAME::RescueProject(), FOOTPRINT_EDIT_FRAME::restoreLastFootprint(), FOOTPRINT_EDIT_FRAME::retainLastFootprint(), SCH_SCREEN::Save(), LIB_EDIT_FRAME::SaveActiveLibrary(), SCH_EDIT_FRAME::SaveEEFile(), FOOTPRINT_EDIT_FRAME::SaveFootprintInLibrary(), LIB_EDIT_FRAME::SaveOneSymbol(), CVPCB_MAINFRAME::SaveProjectFile(), SCH_EDIT_FRAME::SaveProjectSettings(), PCB_EDIT_FRAME::SaveProjectSettings(), FOOTPRINT_VIEWER_FRAME::SelectAndViewFootprint(), SCH_BASE_FRAME::SelectComponentFromLibrary(), FOOTPRINT_VIEWER_FRAME::SelectCurrentFootprint(), PCB_BASE_FRAME::SelectLibrary(), SCH_BASE_FRAME::SelectLibraryFromList(), SCH_EDIT_FRAME::sendNetlist(), FOOTPRINT_VIEWER_FRAME::setCurFootprintName(), LIB_EDIT_FRAME::SetCurLib(), FOOTPRINT_VIEWER_FRAME::setCurNickname(), LIB_EDIT_FRAME::SetCurPart(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::SetInitCmp(), SIM_PLOT_FRAME::SIM_PLOT_FRAME(), EDA_3D_VIEWER::takeScreenshot(), DIALOG_ERC::TestErc(), DIALOG_SPICE_MODEL::updateFromFile(), SIM_PLOT_FRAME::updateNetlistExporter(), FOOTPRINT_VIEWER_FRAME::UpdateTitle(), CVPCB_MAINFRAME::UpdateTitle(), FOOTPRINT_EDIT_FRAME::updateTitle(), SCH_EDIT_FRAME::WriteNetListFile(), DIALOG_MODULE_BOARD_EDITOR::~DIALOG_MODULE_BOARD_EDITOR(), and DIALOG_MODULE_MODULE_EDITOR::~DIALOG_MODULE_MODULE_EDITOR().

35 {
36  return Kiway().Prj();
37 }
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_player.h:60
VTBL_ENTRY PROJECT & Prj() const
Function Prj returns the PROJECT associated with this KIWAY.
Definition: kiway.cpp:144
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 41 of file kiway_holder.cpp.

References KIWAY_HOLDER::m_kiway.

Referenced by DIALOG_SHIM::DIALOG_SHIM(), and SIM_PLOT_FRAME::SIM_PLOT_FRAME().

42 {
43 #if defined(DEBUG)
44  // offer a trap point for debugging most any window
45  wxASSERT( aDest );
46  if( !strcmp( typeid(aDest).name(), "DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB" ) )
47  {
48  int breakhere=1;
49  (void) breakhere;
50  }
51 #endif
52 
53  (void) aDest;
54 
55  m_kiway = aKiway;
56 }
KIWAY * m_kiway
Definition: kiway_player.h:85
void DIALOG_PLOT::SetPlotFormat ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PLOT_BASE.

Definition at line 363 of file dialog_plot.cpp.

References FILLED, getPlotFormat(), DIALOG_PLOT_BASE::m_drillShapeOpt, DIALOG_PLOT_BASE::m_excludeEdgeLayerOpt, DIALOG_PLOT_BASE::m_fineAdjustXscaleOpt, DIALOG_PLOT_BASE::m_fineAdjustYscaleOpt, DIALOG_PLOT_BASE::m_forcePSA4OutputOpt, DIALOG_PLOT_BASE::m_GerberOptionsSizer, DIALOG_PLOT_BASE::m_HPGLOptionsSizer, DIALOG_PLOT_BASE::m_HPGLPenSizeOpt, DIALOG_PLOT_BASE::m_linesWidth, 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_PSFineAdjustWidthOpt, DIALOG_PLOT_BASE::m_PSOptionsSizer, DIALOG_PLOT_BASE::m_scaleOpt, DIALOG_PLOT_BASE::m_useAuxOriginCheckBox, DIALOG_PLOT_BASE::m_useGerberNetAttributes, OnSetScaleOpt(), PLOT_FORMAT_DXF, PLOT_FORMAT_GERBER, PLOT_FORMAT_HPGL, PLOT_FORMAT_PDF, PLOT_FORMAT_POST, PLOT_FORMAT_SVG, and setPlotModeChoiceSelection().

Referenced by Init_Dialog().

364 {
365  switch( getPlotFormat() )
366  {
367  case PLOT_FORMAT_PDF:
368  case PLOT_FORMAT_SVG:
369  m_drillShapeOpt->Enable( true );
370  m_plotModeOpt->Enable( false );
372  m_plotMirrorOpt->Enable( true );
373  m_useAuxOriginCheckBox->Enable( false );
374  m_useAuxOriginCheckBox->SetValue( false );
375  m_linesWidth->Enable( true );
376  m_HPGLPenSizeOpt->Enable( false );
377  m_excludeEdgeLayerOpt->Enable( true );
378  m_scaleOpt->Enable( false );
379  m_scaleOpt->SetSelection( 1 );
380  m_fineAdjustXscaleOpt->Enable( false );
381  m_fineAdjustYscaleOpt->Enable( false );
382  m_PSFineAdjustWidthOpt->Enable( false );
383  m_plotPSNegativeOpt->Enable( true );
384  m_forcePSA4OutputOpt->Enable( false );
385  m_forcePSA4OutputOpt->SetValue( false );
386 
390  break;
391 
392  case PLOT_FORMAT_POST:
393  m_drillShapeOpt->Enable( true );
394  m_plotModeOpt->Enable( true );
395  m_plotMirrorOpt->Enable( true );
396  m_useAuxOriginCheckBox->Enable( false );
397  m_useAuxOriginCheckBox->SetValue( false );
398  m_linesWidth->Enable( true );
399  m_HPGLPenSizeOpt->Enable( false );
400  m_excludeEdgeLayerOpt->Enable( true );
401  m_scaleOpt->Enable( true );
402  m_fineAdjustXscaleOpt->Enable( true );
403  m_fineAdjustYscaleOpt->Enable( true );
404  m_PSFineAdjustWidthOpt->Enable( true );
405  m_plotPSNegativeOpt->Enable( true );
406  m_forcePSA4OutputOpt->Enable( true );
407 
411  break;
412 
413  case PLOT_FORMAT_GERBER:
414  m_drillShapeOpt->Enable( false );
415  m_drillShapeOpt->SetSelection( 0 );
416  m_plotModeOpt->Enable( false );
418  m_plotMirrorOpt->Enable( false );
419  m_plotMirrorOpt->SetValue( false );
420  m_useAuxOriginCheckBox->Enable( true );
421  m_linesWidth->Enable( true );
422  m_HPGLPenSizeOpt->Enable( false );
423  m_excludeEdgeLayerOpt->Enable( true );
424  m_scaleOpt->Enable( false );
425  m_scaleOpt->SetSelection( 1 );
426  m_fineAdjustXscaleOpt->Enable( false );
427  m_fineAdjustYscaleOpt->Enable( false );
428  m_PSFineAdjustWidthOpt->Enable( false );
429  m_plotPSNegativeOpt->Enable( false );
430  m_plotPSNegativeOpt->SetValue( false );
431  m_forcePSA4OutputOpt->Enable( false );
432  m_forcePSA4OutputOpt->SetValue( false );
433 
437 #ifndef KICAD_USE_GBR_NETATTRIBUTES
438  m_useGerberNetAttributes->Show( false );
439 #endif
440  break;
441 
442  case PLOT_FORMAT_HPGL:
443  m_drillShapeOpt->Enable( true );
444  m_plotModeOpt->Enable( true );
445  m_plotMirrorOpt->Enable( true );
446  m_useAuxOriginCheckBox->Enable( false );
447  m_useAuxOriginCheckBox->SetValue( false );
448  m_linesWidth->Enable( false );
449  m_HPGLPenSizeOpt->Enable( true );
450  m_excludeEdgeLayerOpt->Enable( true );
451  m_scaleOpt->Enable( true );
452  m_fineAdjustXscaleOpt->Enable( false );
453  m_fineAdjustYscaleOpt->Enable( false );
454  m_PSFineAdjustWidthOpt->Enable( false );
455  m_plotPSNegativeOpt->SetValue( false );
456  m_plotPSNegativeOpt->Enable( false );
457  m_forcePSA4OutputOpt->Enable( true );
458 
462  break;
463 
464  case PLOT_FORMAT_DXF:
465  m_drillShapeOpt->Enable( true );
466  m_plotModeOpt->Enable( false );
467  m_plotMirrorOpt->Enable( false );
468  m_plotMirrorOpt->SetValue( false );
469  m_useAuxOriginCheckBox->Enable( true );
470  m_linesWidth->Enable( false );
471  m_HPGLPenSizeOpt->Enable( false );
472  m_excludeEdgeLayerOpt->Enable( true );
473  m_scaleOpt->Enable( false );
474  m_scaleOpt->SetSelection( 1 );
475  m_fineAdjustXscaleOpt->Enable( false );
476  m_fineAdjustYscaleOpt->Enable( false );
477  m_PSFineAdjustWidthOpt->Enable( false );
478  m_plotPSNegativeOpt->Enable( false );
479  m_plotPSNegativeOpt->SetValue( false );
480  m_forcePSA4OutputOpt->Enable( false );
481  m_forcePSA4OutputOpt->SetValue( false );
482 
486  break;
487 
488  default:
489  wxASSERT( false );
490  }
491 
492  /* Update the interlock between scale and frame reference
493  * (scaling would mess up the frame border...) */
494  OnSetScaleOpt( event );
495 
496  Layout();
497  m_MainSizer->SetSizeHints( this );
498 }
wxStaticBoxSizer * m_HPGLOptionsSizer
wxTextCtrl * m_linesWidth
wxTextCtrl * m_fineAdjustYscaleOpt
wxCheckBox * m_plotPSNegativeOpt
PlotFormat getPlotFormat()
wxCheckBox * m_excludeEdgeLayerOpt
wxCheckBox * m_plotMirrorOpt
wxTextCtrl * m_PSFineAdjustWidthOpt
wxCheckBox * m_forcePSA4OutputOpt
void setPlotModeChoiceSelection(EDA_DRAW_MODE_T aPlotMode)
Definition: dialog_plot.h:78
void OnSetScaleOpt(wxCommandEvent &event) override
wxStaticBoxSizer * m_GerberOptionsSizer
wxCheckBox * m_useGerberNetAttributes
wxChoice * m_scaleOpt
wxChoice * m_drillShapeOpt
wxTextCtrl * m_fineAdjustXscaleOpt
wxTextCtrl * m_HPGLPenSizeOpt
wxCheckBox * m_useAuxOriginCheckBox
wxChoice * m_plotModeOpt
wxBoxSizer * m_MainSizer
wxStaticBoxSizer * m_PSOptionsSizer
wxBoxSizer * m_PlotOptionsSizer
void DIALOG_PLOT::setPlotModeChoiceSelection ( EDA_DRAW_MODE_T  aPlotMode)
inlineprivate

Definition at line 78 of file dialog_plot.h.

References DIALOG_PLOT_BASE::m_plotModeOpt, and SKETCH.

Referenced by Init_Dialog(), and SetPlotFormat().

79  {
80  m_plotModeOpt->SetSelection( aPlotMode == SKETCH ? 1 : 0 );
81  }
wxChoice * m_plotModeOpt
bool DIALOG_SHIM::Show ( bool  show)
overrideinherited

Definition at line 138 of file dialog_shim.cpp.

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

Referenced by DisplayHotkeyList(), DIALOG_SHIM::EndQuasiModal(), InvokeDialogERC(), DIALOG_SCH_FIND::OnCancel(), DIALOG_DRC_CONTROL::OnLeftDClickClearance(), DIALOG_DRC_CONTROL::OnLeftDClickUnconnected(), DIALOG_DRC_CONTROL::OnPopupMenu(), DIALOG_EXCHANGE_MODULE::OnQuit(), CVPCB_MAINFRAME::ReadNetListAndLinkFiles(), DRC::ShowDRCDialog(), and DIALOG_SHIM::ShowQuasiModal().

139 {
140  bool ret;
141  const char* hash_key;
142 
143  if( m_hash_key.size() )
144  {
145  // a special case like EDA_LIST_DIALOG, which has multiple uses.
146  hash_key = m_hash_key.c_str();
147  }
148  else
149  {
150  hash_key = typeid(*this).name();
151  }
152 
153  // Show or hide the window. If hiding, save current position and size.
154  // If showing, use previous position and size.
155  if( show )
156  {
157  wxDialog::Raise(); // Needed on OS X and some other window managers (i.e. Unity)
158  ret = wxDialog::Show( show );
159 
160  // classname is key, returns a zeroed out default EDA_RECT if none existed before.
161  EDA_RECT r = class_map[ hash_key ];
162 
163  if( r.GetSize().x != 0 && r.GetSize().y != 0 )
164  SetSize( r.GetPosition().x, r.GetPosition().y, r.GetSize().x, r.GetSize().y, 0 );
165  }
166  else
167  {
168  // Save the dialog's position & size before hiding, using classname as key
169  EDA_RECT r( wxDialog::GetPosition(), wxDialog::GetSize() );
170  class_map[ hash_key ] = r;
171 
172  ret = wxDialog::Show( show );
173  }
174 
176 
177  return ret;
178 }
std::string m_hash_key
Definition: dialog_shim.h:128
void FixOSXCancelButtonIssue()
A ugly hack to fix an issue on OSX: when typing ctrl+c in a wxTextCtrl inside a dialog, it is closed instead of copying a text if a button with wxID_CANCEL is used in a wxStdDialogButtonSizer, when the dlg is created by wxFormBuilder: the label is &Cancel, and this accelerator key has priority to copy text standard accelerator, and the dlg is closed when trying to copy text this function do nothing on other platforms.
static RECT_MAP class_map
const wxPoint & GetPosition() const
Class EDA_RECT handles the component boundary box.
const wxSize & GetSize() const
int DIALOG_SHIM::ShowQuasiModal ( )
inherited

Definition at line 494 of file dialog_shim.cpp.

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

Referenced by SCH_EDIT_FRAME::EditComponent(), SCH_EDIT_FRAME::EditComponentFieldText(), LIB_EDIT_FRAME::EditField(), EDIT_TOOL::ExchangeFootprints(), PCB_EDIT_FRAME::InstallExchangeModuleFrame(), and LIB_EDIT_FRAME::InstallFieldsEditorDialog().

495 {
496  // This is an exception safe way to zero a pointer before returning.
497  // Yes, even though DismissModal() clears this first normally, this is
498  // here in case there's an exception before the dialog is dismissed.
499  struct NULLER
500  {
501  void*& m_what;
502  NULLER( void*& aPtr ) : m_what( aPtr ) {}
503  ~NULLER() { m_what = 0; } // indeed, set it to NULL on destruction
504  } clear_this( (void*&) m_qmodal_loop );
505 
506  // release the mouse if it's currently captured as the window having it
507  // will be disabled when this dialog is shown -- but will still keep the
508  // capture making it impossible to do anything in the modal dialog itself
509  wxWindow* win = wxWindow::GetCapture();
510  if( win )
511  win->ReleaseMouse();
512 
513  // Get the optimal parent
514  wxWindow* parent = GetParentForModalDialog( GetParent(), GetWindowStyle() );
515 
516  // Show the optimal parent
517  DBG( if( parent ) printf( "%s: optimal parent: %s\n", __func__, typeid(*parent).name() );)
518 
519  wxASSERT_MSG( !m_qmodal_parent_disabler,
520  wxT( "Caller using ShowQuasiModal() twice on same window?" ) );
521 
522  // quasi-modal: disable only my "optimal" parent
524 
525  Show( true );
526 
527  m_qmodal_showing = true;
528 
529  EVENT_LOOP event_loop;
530 
531  m_qmodal_loop = &event_loop;
532 
533  event_loop.Run();
534 
535  return GetReturnCode();
536 }
bool m_qmodal_showing
Definition: dialog_shim.h:132
EVENT_LOOP * m_qmodal_loop
Definition: dialog_shim.h:131
bool Show(bool show) override
WDO_ENABLE_DISABLE * m_qmodal_parent_disabler
Definition: dialog_shim.h:133
Toggle a window's "enable" status to disabled, then enabled on destruction.
Definition: dialog_shim.cpp:33
#define DBG(x)
Definition: fctsys.h:33

Member Data Documentation

BOARD* DIALOG_PLOT::m_board
private

Definition at line 43 of file dialog_plot.h.

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

wxButton* DIALOG_PLOT_BASE::m_browseButton
protectedinherited
wxButton* DIALOG_PLOT_BASE::m_buttonDRC
protectedinherited
wxButton* DIALOG_PLOT_BASE::m_buttonDrill
protectedinherited
wxButton* DIALOG_PLOT_BASE::m_buttonQuit
protectedinherited
wxConfigBase* DIALOG_PLOT::m_config
private

Definition at line 44 of file dialog_plot.h.

Referenced by applyPlotSettings(), DIALOG_PLOT(), and Init_Dialog().

wxChoice* DIALOG_PLOT_BASE::m_drillShapeOpt
protectedinherited
wxCheckBox* DIALOG_PLOT_BASE::m_excludeEdgeLayerOpt
protectedinherited
wxTextCtrl* DIALOG_PLOT_BASE::m_fineAdjustXscaleOpt
protectedinherited
wxTextCtrl* DIALOG_PLOT_BASE::m_fineAdjustYscaleOpt
protectedinherited
wxCheckBox* DIALOG_PLOT_BASE::m_forcePSA4OutputOpt
protectedinherited
wxStaticBoxSizer* DIALOG_PLOT_BASE::m_GerberOptionsSizer
protectedinherited

Definition at line 93 of file dialog_plot_base.h.

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

std::string DIALOG_SHIM::m_hash_key
protectedinherited
wxStaticBoxSizer* DIALOG_PLOT_BASE::m_HPGLOptionsSizer
protectedinherited

Definition at line 99 of file dialog_plot_base.h.

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

wxTextCtrl* DIALOG_PLOT_BASE::m_HPGLPenSizeOpt
protectedinherited
wxCheckListBox* DIALOG_PLOT_BASE::m_layerCheckListBox
protectedinherited
LSEQ DIALOG_PLOT::m_layerList
private

Definition at line 45 of file dialog_plot.h.

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

wxStaticBoxSizer* DIALOG_PLOT_BASE::m_LayersSizer
protectedinherited

Definition at line 68 of file dialog_plot_base.h.

Referenced by DIALOG_PLOT_BASE::DIALOG_PLOT_BASE().

wxTextCtrl* DIALOG_PLOT_BASE::m_linesWidth
protectedinherited
wxBoxSizer* DIALOG_PLOT_BASE::m_MainSizer
protectedinherited

Definition at line 62 of file dialog_plot_base.h.

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

WX_HTML_REPORT_PANEL* DIALOG_PLOT_BASE::m_messagesPanel
protectedinherited

Definition at line 110 of file dialog_plot_base.h.

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

wxTextCtrl* DIALOG_PLOT_BASE::m_outputDirectoryName
protectedinherited
PCB_EDIT_FRAME* DIALOG_PLOT::m_parent
private
wxButton* DIALOG_PLOT_BASE::m_plotButton
protectedinherited
wxChoice* DIALOG_PLOT_BASE::m_plotFormatOpt
protectedinherited
wxCheckBox* DIALOG_PLOT_BASE::m_plotInvisibleText
protectedinherited
wxCheckBox* DIALOG_PLOT_BASE::m_plotMirrorOpt
protectedinherited
wxChoice* DIALOG_PLOT_BASE::m_plotModeOpt
protectedinherited
wxCheckBox* DIALOG_PLOT_BASE::m_plotModuleRefOpt
protectedinherited
wxCheckBox* DIALOG_PLOT_BASE::m_plotModuleValueOpt
protectedinherited
wxCheckBox* DIALOG_PLOT_BASE::m_plotNoViaOnMaskOpt
protectedinherited
wxBoxSizer* DIALOG_PLOT_BASE::m_PlotOptionsSizer
protectedinherited

Definition at line 70 of file dialog_plot_base.h.

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

PCB_PLOT_PARAMS DIALOG_PLOT::m_plotOpts
private

Definition at line 58 of file dialog_plot.h.

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

wxCheckBox* DIALOG_PLOT_BASE::m_plotPads_on_Silkscreen
protectedinherited
wxCheckBox* DIALOG_PLOT_BASE::m_plotPSNegativeOpt
protectedinherited
wxCheckBox* DIALOG_PLOT_BASE::m_plotSheetRef
protectedinherited
wxMenu* DIALOG_PLOT_BASE::m_popMenu
protectedinherited
wxTextCtrl* DIALOG_PLOT_BASE::m_PSFineAdjustWidthOpt
protectedinherited
wxStaticBoxSizer* DIALOG_PLOT_BASE::m_PSOptionsSizer
protectedinherited

Definition at line 102 of file dialog_plot_base.h.

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

int DIALOG_PLOT::m_PSWidthAdjust
private

Definition at line 50 of file dialog_plot.h.

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

EVENT_LOOP* DIALOG_SHIM::m_qmodal_loop
protectedinherited

Definition at line 131 of file dialog_shim.h.

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

WDO_ENABLE_DISABLE* DIALOG_SHIM::m_qmodal_parent_disabler
protectedinherited
bool DIALOG_SHIM::m_qmodal_showing
protectedinherited
wxRadioBox* DIALOG_PLOT_BASE::m_rbGerberFormat
protectedinherited
wxChoice* DIALOG_PLOT_BASE::m_scaleOpt
protectedinherited
wxStaticText* DIALOG_PLOT_BASE::m_SolderMaskMarginCurrValue
protectedinherited

Definition at line 90 of file dialog_plot_base.h.

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

wxStaticText* DIALOG_PLOT_BASE::m_SolderMaskMarginLabel
protectedinherited

Definition at line 89 of file dialog_plot_base.h.

Referenced by DIALOG_PLOT_BASE::DIALOG_PLOT_BASE().

wxStaticText* DIALOG_PLOT_BASE::m_SolderMaskMinWidthCurrValue
protectedinherited

Definition at line 92 of file dialog_plot_base.h.

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

wxStaticText* DIALOG_PLOT_BASE::m_solderMaskMinWidthLabel
protectedinherited

Definition at line 91 of file dialog_plot_base.h.

Referenced by DIALOG_PLOT_BASE::DIALOG_PLOT_BASE().

wxStaticText* DIALOG_PLOT_BASE::m_staticText11
protectedinherited

Definition at line 81 of file dialog_plot_base.h.

Referenced by DIALOG_PLOT_BASE::DIALOG_PLOT_BASE().

wxStaticText* DIALOG_PLOT_BASE::m_staticText12
protectedinherited

Definition at line 83 of file dialog_plot_base.h.

Referenced by DIALOG_PLOT_BASE::DIALOG_PLOT_BASE().

wxStaticText* DIALOG_PLOT_BASE::m_staticText13
protectedinherited

Definition at line 85 of file dialog_plot_base.h.

Referenced by DIALOG_PLOT_BASE::DIALOG_PLOT_BASE().

wxStaticText* DIALOG_PLOT_BASE::m_staticText7
protectedinherited

Definition at line 103 of file dialog_plot_base.h.

Referenced by DIALOG_PLOT_BASE::DIALOG_PLOT_BASE().

wxStaticText* DIALOG_PLOT_BASE::m_staticText8
protectedinherited

Definition at line 105 of file dialog_plot_base.h.

Referenced by DIALOG_PLOT_BASE::DIALOG_PLOT_BASE().

wxStaticText* DIALOG_PLOT_BASE::m_staticTextDir
protectedinherited

Definition at line 65 of file dialog_plot_base.h.

Referenced by DIALOG_PLOT_BASE::DIALOG_PLOT_BASE().

wxStaticText* DIALOG_PLOT_BASE::m_staticTextPlotFmt
protectedinherited

Definition at line 63 of file dialog_plot_base.h.

Referenced by DIALOG_PLOT_BASE::DIALOG_PLOT_BASE().

wxCheckBox* DIALOG_PLOT_BASE::m_subtractMaskFromSilk
protectedinherited
wxStaticText* DIALOG_PLOT_BASE::m_textDefaultPenSize
protectedinherited

Definition at line 87 of file dialog_plot_base.h.

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

wxStaticText* DIALOG_PLOT_BASE::m_textPenSize
protectedinherited

Definition at line 100 of file dialog_plot_base.h.

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

wxStaticText* DIALOG_PLOT_BASE::m_textPSFineAdjustWidth
protectedinherited

Definition at line 107 of file dialog_plot_base.h.

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

wxCheckBox* DIALOG_PLOT_BASE::m_useAuxOriginCheckBox
protectedinherited
wxCheckBox* DIALOG_PLOT_BASE::m_useGerberExtensions
protectedinherited
wxCheckBox* DIALOG_PLOT_BASE::m_useGerberNetAttributes
protectedinherited
wxCheckBox* DIALOG_PLOT_BASE::m_useGerberX2Attributes
protectedinherited
int DIALOG_PLOT::m_widthAdjustMaxValue
private

Definition at line 55 of file dialog_plot.h.

Referenced by applyPlotSettings(), and Init_Dialog().

int DIALOG_PLOT::m_widthAdjustMinValue
private

Definition at line 54 of file dialog_plot.h.

Referenced by applyPlotSettings(), and Init_Dialog().

double DIALOG_PLOT::m_XScaleAdjust
private

Definition at line 46 of file dialog_plot.h.

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

double DIALOG_PLOT::m_YScaleAdjust
private

Definition at line 48 of file dialog_plot.h.

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


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