KiCad PCB EDA Suite
DIALOG_PLOT_SCHEMATIC Class Reference

#include <dialog_plot_schematic.h>

Inheritance diagram for DIALOG_PLOT_SCHEMATIC:
DIALOG_PLOT_SCHEMATIC_BASE DIALOG_SHIM KIWAY_HOLDER

Public Types

enum  HOLDER_TYPE { DIALOG, FRAME, PANEL }
 

Public Member Functions

 DIALOG_PLOT_SCHEMATIC (SCH_EDIT_FRAME *parent)
 
bool PrjConfigChanged ()
 
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)
 
static void FixOSXCancelButtonIssue (wxWindow *aWindow)
 

Protected Member Functions

virtual void OnCloseWindow (wxCloseEvent &event)
 
virtual void OnPlotFormatSelection (wxCommandEvent &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

wxStaticText * m_staticTextOutputDirectory
 
wxTextCtrl * m_outputDirectoryName
 
wxBitmapButton * m_browseButton
 
wxBoxSizer * m_optionsSizer
 
wxRadioBox * m_plotFormatOpt
 
wxStaticText * m_staticText4
 
wxChoice * m_paperSizeOption
 
wxCheckBox * m_PlotFrameRefOpt
 
wxChoice * m_ModeColorOption
 
wxCheckBox * m_plotBackgroundColor
 
wxStaticText * m_staticText9
 
wxChoice * m_colorTheme
 
wxStaticText * m_lineWidthLabel
 
wxTextCtrl * m_lineWidthCtrl
 
wxStaticText * m_lineWidthUnits
 
wxStaticBoxSizer * m_HPGLOptionsSizer
 
wxStaticText * m_plotOriginTitle
 
wxChoice * m_plotOriginOpt
 
wxStaticText * m_penWidthLabel
 
wxTextCtrl * m_penWidthCtrl
 
wxStaticText * m_penWidthUnits
 
WX_HTML_REPORT_PANELm_MessagesBox
 
wxStdDialogButtonSizer * m_sdbSizer1
 
wxButton * m_sdbSizer1OK
 
wxButton * m_sdbSizer1Apply
 
wxButton * m_sdbSizer1Cancel
 
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 OnPageSizeSelected (wxCommandEvent &event) override
 
void OnPlotCurrent (wxCommandEvent &event) override
 
void OnPlotAll (wxCommandEvent &event) override
 
void OnUpdateUI (wxUpdateUIEvent &event) override
 
void initDlg ()
 
void getPlotOptions (RENDER_SETTINGS *aSettings)
 
bool getModeColor ()
 
void setModeColor (bool aColor)
 
COLOR_SETTINGSgetColorSettings ()
 
void OnOutputDirectoryBrowseClicked (wxCommandEvent &event) override
 Set the m_outputDirectoryName variable to the selected directory from directory dialog. More...
 
PLOT_FORMAT GetPlotFileFormat ()
 
bool getPlotFrameRef ()
 
void setPlotFrameRef (bool aPlot)
 
void PlotSchematic (bool aPlotAll)
 
void createPDFFile (bool aPlotAll, bool aPlotFrameRef, RENDER_SETTINGS *aRenderSettings)
 
void plotOneSheetPDF (PLOTTER *aPlotter, SCH_SCREEN *aScreen, bool aPlotFrameRef)
 
void setupPlotPagePDF (PLOTTER *aPlotter, SCH_SCREEN *aScreen)
 
void restoreEnvironment (PDF_PLOTTER *aPlotter, SCH_SHEET_PATH &aOldsheetpath)
 Everything done, close the plot and restore the environment. More...
 
void CreateDXFFile (bool aPlotAll, bool aPlotFrameRef, RENDER_SETTINGS *aRenderSettings)
 
bool PlotOneSheetDXF (const wxString &aFileName, SCH_SCREEN *aScreen, RENDER_SETTINGS *aRenderSettings, wxPoint aPlot0ffset, double aScale, bool aPlotFrameRef)
 
bool GetPlotOriginCenter ()
 
void SetPlotOriginCenter (bool aCenter)
 
void createHPGLFile (bool aPlotAll, bool aPlotFrameRef, RENDER_SETTINGS *aRenderSettings)
 
void SetHPGLPenWidth ()
 
bool Plot_1_Page_HPGL (const wxString &aFileName, SCH_SCREEN *aScreen, const PAGE_INFO &aPageInfo, RENDER_SETTINGS *aRenderSettings, wxPoint aPlot0ffset, double aScale, bool aPlotFrameRef)
 
void createPSFile (bool aPlotAll, bool aPlotFrameRef, RENDER_SETTINGS *aSettings)
 
bool plotOneSheetPS (const wxString &aFileName, SCH_SCREEN *aScreen, RENDER_SETTINGS *aRenderSettings, const PAGE_INFO &aPageInfo, wxPoint aPlot0ffset, double aScale, bool aPlotFrameRef)
 
void createSVGFile (bool aPlotAll, bool aPlotFrameRef, RENDER_SETTINGS *aSettings)
 
bool plotOneSheetSVG (const wxString &aFileName, SCH_SCREEN *aScreen, RENDER_SETTINGS *aRenderSettings, bool aPlotBlackAndWhite, bool aPlotFrameRef)
 
wxFileName createPlotFileName (wxString &aPlotFileName, wxString &aExtension, REPORTER *aReporter=NULL)
 Create a file name with an absolute path name. More...
 

Private Attributes

SCH_EDIT_FRAMEm_parent
 
bool m_configChanged
 
PLOT_FORMAT m_plotFormat
 
double m_HPGLPenSize
 
UNIT_BINDER m_defaultLineWidth
 
UNIT_BINDER m_penWidth
 

Static Private Attributes

static int m_pageSizeSelect = PAGE_SIZE_AUTO
 
static int m_HPGLPaperSizeSelect = PAGE_SIZE_AUTO
 

Detailed Description

Definition at line 45 of file dialog_plot_schematic.h.

Member Enumeration Documentation

◆ 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_SCHEMATIC()

DIALOG_PLOT_SCHEMATIC::DIALOG_PLOT_SCHEMATIC ( SCH_EDIT_FRAME parent)

Definition at line 42 of file dialog_plot_schematic.cpp.

43  : DIALOG_PLOT_SCHEMATIC_BASE( parent ),
44  m_parent( parent ),
46  m_HPGLPenSize( 1.0 ),
49 {
50  m_configChanged = false;
51 
52  m_browseButton->SetBitmap( KiBitmap( folder_xpm ) );
53 
54  // We use a sdbSizer to get platform-dependent ordering of the action buttons, but
55  // that requires us to correct the button labels here.
56  m_sdbSizer1OK->SetLabel( _( "Plot All Pages" ) );
57  m_sdbSizer1Apply->SetLabel( _( "Plot Current Page" ) );
58  m_sdbSizer1Cancel->SetLabel( _( "Close" ) );
59  m_sdbSizer1->Layout();
60 
61  m_sdbSizer1OK->SetDefault();
62  initDlg();
63 
64  // Now all widgets have the size fixed, call FinishDialogSettings
66 }
const BITMAP_OPAQUE folder_xpm[1]
Definition: folder.cpp:20
wxStdDialogButtonSizer * m_sdbSizer1
void FinishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
DIALOG_PLOT_SCHEMATIC_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Plot Schematic Options"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:80
#define _(s)
Definition: 3d_actions.cpp:33

References _, DIALOG_SHIM::FinishDialogSettings(), folder_xpm, initDlg(), KiBitmap(), DIALOG_PLOT_SCHEMATIC_BASE::m_browseButton, m_configChanged, DIALOG_PLOT_SCHEMATIC_BASE::m_sdbSizer1, DIALOG_PLOT_SCHEMATIC_BASE::m_sdbSizer1Apply, DIALOG_PLOT_SCHEMATIC_BASE::m_sdbSizer1Cancel, DIALOG_PLOT_SCHEMATIC_BASE::m_sdbSizer1OK, and UNDEFINED.

Member Function Documentation

◆ CreateDXFFile()

void DIALOG_PLOT_SCHEMATIC::CreateDXFFile ( bool  aPlotAll,
bool  aPlotFrameRef,
RENDER_SETTINGS aRenderSettings 
)
private

Definition at line 41 of file plot_schematic_DXF.cpp.

43 {
44  SCH_EDIT_FRAME* schframe = m_parent;
45  SCH_SCREEN* screen = schframe->GetScreen();
46  SCH_SHEET_PATH oldsheetpath = schframe->GetCurrentSheet();
47 
48  /* When printing all pages, the printed page is not the current page.
49  * In complex hierarchies, we must setup references and others parameters
50  * in the printed SCH_SCREEN
51  * because in complex hierarchies a SCH_SCREEN (a schematic drawings)
52  * is shared between many sheets
53  */
54  SCH_SHEET_LIST sheetList;
55 
56  if( aPlotAll )
57  sheetList.BuildSheetList( &schframe->Schematic().Root() );
58  else
59  sheetList.push_back( schframe->GetCurrentSheet() );
60 
61  REPORTER& reporter = m_MessagesBox->Reporter();
62 
63  for( unsigned i = 0; i < sheetList.size(); i++ )
64  {
65  schframe->SetCurrentSheet( sheetList[i] );
67  schframe->SetSheetNumberAndCount();
68  screen = schframe->GetCurrentSheet().LastScreen();
69 
70  wxPoint plot_offset;
71  wxString msg;
72 
73  try
74  {
75  wxString fname = schframe->GetUniqueFilenameForCurrentSheet();
76  wxString ext = DXF_PLOTTER::GetDefaultFileExtension();
77  wxFileName plotFileName = createPlotFileName( fname, ext, &reporter );
78 
79  if( PlotOneSheetDXF( plotFileName.GetFullPath(), screen, aRenderSettings,
80  plot_offset, 1.0, aPlotFrameRef ) )
81  {
82  msg.Printf( _( "Plot: \"%s\" OK.\n" ), plotFileName.GetFullPath() );
83  reporter.Report( msg, RPT_SEVERITY_ACTION );
84  }
85  else // Error
86  {
87  msg.Printf( _( "Unable to create file \"%s\".\n" ), plotFileName.GetFullPath() );
88  reporter.Report( msg, RPT_SEVERITY_ERROR );
89  }
90  }
91  catch( IO_ERROR& e )
92  {
93  msg.Printf( wxT( "DXF Plotter exception: %s"), e.What() );
94  reporter.Report( msg, RPT_SEVERITY_ERROR );
95  schframe->SetCurrentSheet( oldsheetpath );
97  schframe->SetSheetNumberAndCount();
98  return;
99  }
100  }
101 
102  schframe->SetCurrentSheet( oldsheetpath );
104  schframe->SetSheetNumberAndCount();
105 }
void SetCurrentSheet(const SCH_SHEET_PATH &aSheet)
SCH_SHEET_LIST.
Schematic editor (Eeschema) main window.
REPORTER is a pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:64
void UpdateAllScreenReferences()
Function UpdateAllScreenReferences updates the reference and the m_Multi parameter (part selection) f...
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.
static wxString GetDefaultFileExtension()
Definition: plotter.h:1457
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:29
REPORTER & Reporter()
returns the reporter object that reports to this panel
SCHEMATIC & Schematic() const
SCH_SHEET_PATH.
void BuildSheetList(SCH_SHEET *aSheet)
Function BuildSheetList builds the list of sheets and their sheet path from aSheet.
SCH_SHEET & Root() const
Definition: schematic.h:97
SCH_SCREEN * LastScreen()
Function LastScreen.
void SetSheetNumberAndCount()
Set the m_ScreenNumber and m_NumberOfScreens members for screens.
#define _(s)
Definition: 3d_actions.cpp:33
bool PlotOneSheetDXF(const wxString &aFileName, SCH_SCREEN *aScreen, RENDER_SETTINGS *aRenderSettings, wxPoint aPlot0ffset, double aScale, bool aPlotFrameRef)
wxString GetUniqueFilenameForCurrentSheet()
SCH_SHEET_PATH & GetCurrentSheet() const
WX_HTML_REPORT_PANEL * m_MessagesBox
Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions con...
Definition: ki_exception.h:76
wxFileName createPlotFileName(wxString &aPlotFileName, wxString &aExtension, REPORTER *aReporter=NULL)
Create a file name with an absolute path name.

References _, SCH_SHEET_LIST::BuildSheetList(), createPlotFileName(), SCH_EDIT_FRAME::GetCurrentSheet(), DXF_PLOTTER::GetDefaultFileExtension(), SCH_EDIT_FRAME::GetScreen(), SCH_EDIT_FRAME::GetUniqueFilenameForCurrentSheet(), SCH_SHEET_PATH::LastScreen(), DIALOG_PLOT_SCHEMATIC_BASE::m_MessagesBox, m_parent, PlotOneSheetDXF(), REPORTER::Report(), WX_HTML_REPORT_PANEL::Reporter(), SCHEMATIC::Root(), RPT_SEVERITY_ACTION, RPT_SEVERITY_ERROR, SCH_EDIT_FRAME::Schematic(), SCH_EDIT_FRAME::SetCurrentSheet(), SCH_EDIT_FRAME::SetSheetNumberAndCount(), SCH_SHEET_PATH::UpdateAllScreenReferences(), and IO_ERROR::What().

Referenced by PlotSchematic().

◆ createHPGLFile()

void DIALOG_PLOT_SCHEMATIC::createHPGLFile ( bool  aPlotAll,
bool  aPlotFrameRef,
RENDER_SETTINGS aRenderSettings 
)
private

Definition at line 90 of file plot_schematic_HPGL.cpp.

92 {
93  SCH_SCREEN* screen = m_parent->GetScreen();
94  SCH_SHEET_PATH oldsheetpath = m_parent->GetCurrentSheet();
95 
96  /* When printing all pages, the printed page is not the current page.
97  * In complex hierarchies, we must setup references and other parameters
98  * in the printed SCH_SCREEN
99  * because in complex hierarchies a SCH_SCREEN (a schematic drawings)
100  * is shared between many sheets
101  */
102  SCH_SHEET_LIST sheetList;
103 
104  if( aPlotAll )
105  sheetList.BuildSheetList( &m_parent->Schematic().Root() );
106  else
107  sheetList.push_back( m_parent->GetCurrentSheet() );
108 
109  REPORTER& reporter = m_MessagesBox->Reporter();
110 
111  SetHPGLPenWidth();
112 
113  for( unsigned i = 0; i < sheetList.size(); i++ )
114  {
115  m_parent->SetCurrentSheet( sheetList[i] );
118 
119  screen = m_parent->GetCurrentSheet().LastScreen();
120 
121  if( !screen ) // LastScreen() may return NULL
122  screen = m_parent->GetScreen();
123 
124  const PAGE_INFO& curPage = screen->GetPageSettings();
125 
126  PAGE_INFO plotPage = curPage;
127 
128  // if plotting on a page size other than curPage
129  if( m_paperSizeOption->GetSelection() != PAGE_DEFAULT )
130  plotPage.SetType( plot_sheet_list( m_paperSizeOption->GetSelection() ) );
131 
132  // Calculation of conversion scales.
133  double plot_scale = (double) plotPage.GetWidthMils() / curPage.GetWidthMils();
134 
135  // Calculate offsets
136  wxPoint plotOffset;
137  wxString msg;
138 
139  if( GetPlotOriginCenter() )
140  {
141  plotOffset.x = plotPage.GetWidthIU() / 2;
142  plotOffset.y = -plotPage.GetHeightIU() / 2;
143  }
144 
145  try
146  {
147  wxString fname = m_parent->GetUniqueFilenameForCurrentSheet();
148  wxString ext = HPGL_PLOTTER::GetDefaultFileExtension();
149  wxFileName plotFileName = createPlotFileName( fname, ext, &reporter );
150 
151  LOCALE_IO toggle;
152 
153  if( Plot_1_Page_HPGL( plotFileName.GetFullPath(), screen, plotPage, aRenderSettings,
154  plotOffset, plot_scale, aPlotFrameRef ) )
155  {
156  msg.Printf( _( "Plot: \"%s\" OK.\n" ), plotFileName.GetFullPath() );
157  reporter.Report( msg, RPT_SEVERITY_ACTION );
158  }
159  else
160  {
161  msg.Printf( _( "Unable to create file \"%s\".\n" ), plotFileName.GetFullPath() );
162  reporter.Report( msg, RPT_SEVERITY_ERROR );
163  }
164  }
165  catch( IO_ERROR& e )
166  {
167  msg.Printf( wxT( "HPGL Plotter exception: %s"), e.What() );
168  reporter.Report( msg, RPT_SEVERITY_ERROR );
169  }
170 
171  }
172 
173  m_parent->SetCurrentSheet( oldsheetpath );
176 }
void SetCurrentSheet(const SCH_SHEET_PATH &aSheet)
SCH_SHEET_LIST.
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Definition: common.h:216
bool Plot_1_Page_HPGL(const wxString &aFileName, SCH_SCREEN *aScreen, const PAGE_INFO &aPageInfo, RENDER_SETTINGS *aRenderSettings, wxPoint aPlot0ffset, double aScale, bool aPlotFrameRef)
bool SetType(const wxString &aStandardPageDescriptionName, bool aIsPortrait=false)
Function SetType sets the name of the page type and also the sizes and margins commonly associated wi...
Definition: page_info.cpp:119
REPORTER is a pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:64
void UpdateAllScreenReferences()
Function UpdateAllScreenReferences updates the reference and the m_Multi parameter (part selection) f...
const PAGE_INFO & GetPageSettings() const
Definition: sch_screen.h:180
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.
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
static const wxChar * plot_sheet_list(int aSize)
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:29
PAGE_INFO describes the page size and margins of a paper page on which to eventually print or plot.
Definition: page_info.h:54
REPORTER & Reporter()
returns the reporter object that reports to this panel
SCHEMATIC & Schematic() const
SCH_SHEET_PATH.
void BuildSheetList(SCH_SHEET *aSheet)
Function BuildSheetList builds the list of sheets and their sheet path from aSheet.
SCH_SHEET & Root() const
Definition: schematic.h:97
SCH_SCREEN * LastScreen()
Function LastScreen.
void SetSheetNumberAndCount()
Set the m_ScreenNumber and m_NumberOfScreens members for screens.
#define _(s)
Definition: 3d_actions.cpp:33
static wxString GetDefaultFileExtension()
Definition: plotter.h:617
wxString GetUniqueFilenameForCurrentSheet()
SCH_SHEET_PATH & GetCurrentSheet() const
WX_HTML_REPORT_PANEL * m_MessagesBox
Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions con...
Definition: ki_exception.h:76
wxFileName createPlotFileName(wxString &aPlotFileName, wxString &aExtension, REPORTER *aReporter=NULL)
Create a file name with an absolute path name.
int GetWidthMils() const
Definition: page_info.h:138

References _, SCH_SHEET_LIST::BuildSheetList(), createPlotFileName(), SCH_EDIT_FRAME::GetCurrentSheet(), HPGL_PLOTTER::GetDefaultFileExtension(), SCH_SCREEN::GetPageSettings(), GetPlotOriginCenter(), SCH_EDIT_FRAME::GetScreen(), SCH_EDIT_FRAME::GetUniqueFilenameForCurrentSheet(), PAGE_INFO::GetWidthMils(), SCH_SHEET_PATH::LastScreen(), DIALOG_PLOT_SCHEMATIC_BASE::m_MessagesBox, DIALOG_PLOT_SCHEMATIC_BASE::m_paperSizeOption, m_parent, PAGE_DEFAULT, Plot_1_Page_HPGL(), plot_sheet_list(), REPORTER::Report(), WX_HTML_REPORT_PANEL::Reporter(), SCHEMATIC::Root(), RPT_SEVERITY_ACTION, RPT_SEVERITY_ERROR, SCH_EDIT_FRAME::Schematic(), SCH_EDIT_FRAME::SetCurrentSheet(), SetHPGLPenWidth(), SCH_EDIT_FRAME::SetSheetNumberAndCount(), PAGE_INFO::SetType(), SCH_SHEET_PATH::UpdateAllScreenReferences(), IO_ERROR::What(), wxPoint::x, and wxPoint::y.

Referenced by PlotSchematic().

◆ createPDFFile()

void DIALOG_PLOT_SCHEMATIC::createPDFFile ( bool  aPlotAll,
bool  aPlotFrameRef,
RENDER_SETTINGS aRenderSettings 
)
private

Definition at line 45 of file plot_schematic_PDF.cpp.

47 {
48  SCH_SHEET_PATH oldsheetpath = m_parent->GetCurrentSheet(); // sheetpath is saved here
49 
50  /* When printing all pages, the printed page is not the current page. In
51  * complex hierarchies, we must update component references and others
52  * parameters in the given printed SCH_SCREEN, accordint to the sheet path
53  * because in complex hierarchies a SCH_SCREEN (a drawing ) is shared
54  * between many sheets and component references depend on the actual sheet
55  * path used
56  */
57  SCH_SHEET_LIST sheetList;
58 
59  if( aPlotAll )
60  sheetList.BuildSheetList( &m_parent->Schematic().Root() );
61  else
62  sheetList.push_back( m_parent->GetCurrentSheet() );
63 
64  // Allocate the plotter and set the job level parameter
65  PDF_PLOTTER* plotter = new PDF_PLOTTER();
66  plotter->SetRenderSettings( aRenderSettings );
67  plotter->SetColorMode( getModeColor() );
68  plotter->SetCreator( wxT( "Eeschema-PDF" ) );
69  plotter->SetTitle( m_parent->GetTitleBlock().GetTitle() );
70 
71  wxString msg;
72  wxFileName plotFileName;
73  REPORTER& reporter = m_MessagesBox->Reporter();
74  LOCALE_IO toggle; // Switch the locale to standard C
75 
76  for( unsigned i = 0; i < sheetList.size(); i++ )
77  {
78  m_parent->SetCurrentSheet( sheetList[i] );
82 
83  if( i == 0 )
84  {
85 
86  try
87  {
88  wxString fname = m_parent->GetUniqueFilenameForCurrentSheet();
89  wxString ext = PDF_PLOTTER::GetDefaultFileExtension();
90  plotFileName = createPlotFileName( fname, ext, &reporter );
91 
92  if( !plotter->OpenFile( plotFileName.GetFullPath() ) )
93  {
94  msg.Printf( _( "Unable to create file \"%s\".\n" ), plotFileName.GetFullPath() );
95  reporter.Report( msg, RPT_SEVERITY_ERROR );
96  delete plotter;
97  return;
98  }
99 
100  // Open the plotter and do the first page
101  setupPlotPagePDF( plotter, screen );
102  plotter->StartPlot();
103  }
104  catch( const IO_ERROR& e )
105  {
106  // Cannot plot PDF file
107  msg.Printf( wxT( "PDF Plotter exception: %s" ), e.What() );
108  reporter.Report( msg, RPT_SEVERITY_ERROR );
109 
110  restoreEnvironment( plotter, oldsheetpath );
111  return;
112  }
113 
114  }
115  else
116  {
117  /* For the following pages you need to close the (finished) page,
118  * reconfigure, and then start a new one */
119  plotter->ClosePage();
120  setupPlotPagePDF( plotter, screen );
121  plotter->StartPage();
122  }
123 
124  plotOneSheetPDF( plotter, screen, aPlotFrameRef );
125  }
126 
127  // Everything done, close the plot and restore the environment
128  msg.Printf( _( "Plot: \"%s\" OK.\n" ), plotFileName.GetFullPath() );
129  reporter.Report( msg, RPT_SEVERITY_ACTION );
130 
131  restoreEnvironment( plotter, oldsheetpath );
132 }
static wxString GetDefaultFileExtension()
Definition: plotter.h:866
void SetCurrentSheet(const SCH_SHEET_PATH &aSheet)
SCH_SHEET_LIST.
virtual void SetCreator(const wxString &aCreator)
Definition: plotter.h:164
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Definition: common.h:216
virtual void StartPage()
Starts a new page in the PDF document.
virtual void SetTitle(const wxString &aTitle)
Definition: plotter.h:169
virtual void SetColorMode(bool aColorMode)
Plot in B/W or color.
Definition: plotter.h:143
void SetRenderSettings(RENDER_SETTINGS *aSettings)
Definition: plotter.h:146
REPORTER is a pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:64
void UpdateAllScreenReferences()
Function UpdateAllScreenReferences updates the reference and the m_Multi parameter (part selection) f...
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.
void restoreEnvironment(PDF_PLOTTER *aPlotter, SCH_SHEET_PATH &aOldsheetpath)
Everything done, close the plot and restore the environment.
void setupPlotPagePDF(PLOTTER *aPlotter, SCH_SCREEN *aScreen)
virtual void ClosePage()
Close the current page in the PDF document (and emit its compressed stream)
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:29
REPORTER & Reporter()
returns the reporter object that reports to this panel
SCHEMATIC & Schematic() const
SCH_SHEET_PATH.
void BuildSheetList(SCH_SHEET *aSheet)
Function BuildSheetList builds the list of sheets and their sheet path from aSheet.
SCH_SHEET & Root() const
Definition: schematic.h:97
SCH_SCREEN * LastScreen()
Function LastScreen.
void SetSheetNumberAndCount()
Set the m_ScreenNumber and m_NumberOfScreens members for screens.
#define _(s)
Definition: 3d_actions.cpp:33
const TITLE_BLOCK & GetTitleBlock() const override
wxString GetUniqueFilenameForCurrentSheet()
virtual bool OpenFile(const wxString &aFullFilename) override
Open or create the plot file aFullFilename.
SCH_SHEET_PATH & GetCurrentSheet() const
const wxString & GetTitle() const
Definition: title_block.h:65
WX_HTML_REPORT_PANEL * m_MessagesBox
virtual bool StartPlot() override
The PDF engine supports multiple pages; the first one is opened 'for free' the following are to be cl...
Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions con...
Definition: ki_exception.h:76
wxFileName createPlotFileName(wxString &aPlotFileName, wxString &aExtension, REPORTER *aReporter=NULL)
Create a file name with an absolute path name.
void plotOneSheetPDF(PLOTTER *aPlotter, SCH_SCREEN *aScreen, bool aPlotFrameRef)

References _, SCH_SHEET_LIST::BuildSheetList(), PDF_PLOTTER::ClosePage(), createPlotFileName(), SCH_EDIT_FRAME::GetCurrentSheet(), PDF_PLOTTER::GetDefaultFileExtension(), getModeColor(), TITLE_BLOCK::GetTitle(), SCH_BASE_FRAME::GetTitleBlock(), SCH_EDIT_FRAME::GetUniqueFilenameForCurrentSheet(), SCH_SHEET_PATH::LastScreen(), DIALOG_PLOT_SCHEMATIC_BASE::m_MessagesBox, m_parent, PDF_PLOTTER::OpenFile(), plotOneSheetPDF(), REPORTER::Report(), WX_HTML_REPORT_PANEL::Reporter(), restoreEnvironment(), SCHEMATIC::Root(), RPT_SEVERITY_ACTION, RPT_SEVERITY_ERROR, SCH_EDIT_FRAME::Schematic(), PLOTTER::SetColorMode(), PLOTTER::SetCreator(), SCH_EDIT_FRAME::SetCurrentSheet(), PLOTTER::SetRenderSettings(), SCH_EDIT_FRAME::SetSheetNumberAndCount(), PLOTTER::SetTitle(), setupPlotPagePDF(), PDF_PLOTTER::StartPage(), PDF_PLOTTER::StartPlot(), SCH_SHEET_PATH::UpdateAllScreenReferences(), and IO_ERROR::What().

Referenced by PlotSchematic().

◆ createPlotFileName()

wxFileName DIALOG_PLOT_SCHEMATIC::createPlotFileName ( wxString &  aPlotFileName,
wxString &  aExtension,
REPORTER aReporter = NULL 
)
private

Create a file name with an absolute path name.

Parameters
aPlotFileNamethe name for the file to plot without a path
aExtensionthe extension for the file to plot
aReportera point to a REPORTER object use to show messages (can be NULL)
Returns
the created file name
Exceptions
IO_ERRORon file I/O errors

Definition at line 351 of file dialog_plot_schematic.cpp.

354 {
355  wxString path = ExpandEnvVarSubstitutions( m_outputDirectoryName->GetValue(), &Prj() );
356  wxFileName outputDir = wxFileName::DirName( path );
357 
358  wxString plotFileName = Prj().AbsolutePath( aPlotFileName + wxT( "." ) + aExtension);
359 
360  if( !EnsureFileDirectoryExists( &outputDir, plotFileName, aReporter ) )
361  {
362  wxString msg = wxString::Format( _( "Could not write plot files to folder \"%s\"." ),
363  outputDir.GetPath() );
364  aReporter->Report( msg, RPT_SEVERITY_ERROR );
365  }
366 
367  wxFileName fn( plotFileName );
368  fn.SetPath( outputDir.GetFullPath() );
369  return fn;
370 }
const wxString ExpandEnvVarSubstitutions(const wxString &aString, PROJECT *aProject)
Replace any environment variable & text variable references with their values.
Definition: common.cpp:574
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.
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:277
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:602
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
#define _(s)
Definition: 3d_actions.cpp:33

References _, PROJECT::AbsolutePath(), EnsureFileDirectoryExists(), ExpandEnvVarSubstitutions(), Format(), DIALOG_PLOT_SCHEMATIC_BASE::m_outputDirectoryName, KIWAY_HOLDER::Prj(), REPORTER::Report(), and RPT_SEVERITY_ERROR.

Referenced by CreateDXFFile(), createHPGLFile(), createPDFFile(), createPSFile(), and createSVGFile().

◆ createPSFile()

void DIALOG_PLOT_SCHEMATIC::createPSFile ( bool  aPlotAll,
bool  aPlotFrameRef,
RENDER_SETTINGS aSettings 
)
private

Definition at line 41 of file plot_schematic_PS.cpp.

43 {
44  SCH_SHEET_PATH oldsheetpath = m_parent->GetCurrentSheet(); // sheetpath is saved here
45  PAGE_INFO plotPage; // page size selected to plot
46 
47  /* When printing all pages, the printed page is not the current page.
48  * In complex hierarchies, we must update component references
49  * and others parameters in the given printed SCH_SCREEN, accordint to the sheet path
50  * because in complex hierarchies a SCH_SCREEN (a drawing )
51  * is shared between many sheets and component references depend on the actual sheet path used
52  */
53  SCH_SHEET_LIST sheetList;
54 
55  if( aPlotAll )
56  sheetList.BuildSheetList( &m_parent->Schematic().Root() );
57  else
58  sheetList.push_back( m_parent->GetCurrentSheet() );
59 
60  for( unsigned i = 0; i < sheetList.size(); i++ )
61  {
62  m_parent->SetCurrentSheet( sheetList[i] );
65 
67  PAGE_INFO actualPage = screen->GetPageSettings();
68 
69  switch( m_pageSizeSelect )
70  {
71  case PAGE_SIZE_A:
72  plotPage.SetType( wxT( "A" ) );
73  plotPage.SetPortrait( actualPage.IsPortrait() );
74  break;
75 
76  case PAGE_SIZE_A4:
77  plotPage.SetType( wxT( "A4" ) );
78  plotPage.SetPortrait( actualPage.IsPortrait() );
79  break;
80 
81  case PAGE_SIZE_AUTO:
82  default:
83  plotPage = actualPage;
84  break;
85  }
86 
87  double scalex = (double) plotPage.GetWidthMils() / actualPage.GetWidthMils();
88  double scaley = (double) plotPage.GetHeightMils() / actualPage.GetHeightMils();
89 
90  double scale = std::min( scalex, scaley );
91 
92  wxPoint plot_offset;
93 
94  wxString msg;
95  REPORTER& reporter = m_MessagesBox->Reporter();
96 
97  try
98  {
99  wxString fname = m_parent->GetUniqueFilenameForCurrentSheet();
100  wxString ext = PS_PLOTTER::GetDefaultFileExtension();
101  wxFileName plotFileName = createPlotFileName( fname, ext, &reporter );
102 
103  if( plotOneSheetPS( plotFileName.GetFullPath(), screen, aRenderSettings, plotPage,
104  plot_offset, scale, aPlotFrameRef ) )
105  {
106  msg.Printf( _( "Plot: \"%s\" OK.\n" ), plotFileName.GetFullPath() );
107  reporter.Report( msg, RPT_SEVERITY_ACTION );
108  }
109  else
110  {
111  // Error
112  msg.Printf( _( "Unable to create file \"%s\".\n" ), plotFileName.GetFullPath() );
113  reporter.Report( msg, RPT_SEVERITY_ERROR );
114  }
115 
116  }
117  catch( IO_ERROR& e )
118  {
119  msg.Printf( wxT( "PS Plotter exception: %s"), e.What() );
120  reporter.Report( msg, RPT_SEVERITY_ERROR );
121  }
122  }
123 
124  m_parent->SetCurrentSheet( oldsheetpath );
127 }
void SetCurrentSheet(const SCH_SHEET_PATH &aSheet)
SCH_SHEET_LIST.
static wxString GetDefaultFileExtension()
Definition: plotter.h:801
int GetHeightMils() const
Definition: page_info.h:141
bool SetType(const wxString &aStandardPageDescriptionName, bool aIsPortrait=false)
Function SetType sets the name of the page type and also the sizes and margins commonly associated wi...
Definition: page_info.cpp:119
REPORTER is a pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:64
void UpdateAllScreenReferences()
Function UpdateAllScreenReferences updates the reference and the m_Multi parameter (part selection) f...
const PAGE_INFO & GetPageSettings() const
Definition: sch_screen.h:180
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.
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:29
bool plotOneSheetPS(const wxString &aFileName, SCH_SCREEN *aScreen, RENDER_SETTINGS *aRenderSettings, const PAGE_INFO &aPageInfo, wxPoint aPlot0ffset, double aScale, bool aPlotFrameRef)
PAGE_INFO describes the page size and margins of a paper page on which to eventually print or plot.
Definition: page_info.h:54
REPORTER & Reporter()
returns the reporter object that reports to this panel
SCHEMATIC & Schematic() const
SCH_SHEET_PATH.
void BuildSheetList(SCH_SHEET *aSheet)
Function BuildSheetList builds the list of sheets and their sheet path from aSheet.
SCH_SHEET & Root() const
Definition: schematic.h:97
const int scale
SCH_SCREEN * LastScreen()
Function LastScreen.
void SetSheetNumberAndCount()
Set the m_ScreenNumber and m_NumberOfScreens members for screens.
bool IsPortrait() const
Definition: page_info.h:122
#define _(s)
Definition: 3d_actions.cpp:33
wxString GetUniqueFilenameForCurrentSheet()
SCH_SHEET_PATH & GetCurrentSheet() const
WX_HTML_REPORT_PANEL * m_MessagesBox
void SetPortrait(bool aIsPortrait)
Function SetPortrait will rotate the paper page 90 degrees.
Definition: page_info.cpp:186
Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions con...
Definition: ki_exception.h:76
wxFileName createPlotFileName(wxString &aPlotFileName, wxString &aExtension, REPORTER *aReporter=NULL)
Create a file name with an absolute path name.
int GetWidthMils() const
Definition: page_info.h:138

References _, SCH_SHEET_LIST::BuildSheetList(), createPlotFileName(), SCH_EDIT_FRAME::GetCurrentSheet(), PS_PLOTTER::GetDefaultFileExtension(), PAGE_INFO::GetHeightMils(), SCH_SCREEN::GetPageSettings(), SCH_EDIT_FRAME::GetUniqueFilenameForCurrentSheet(), PAGE_INFO::GetWidthMils(), PAGE_INFO::IsPortrait(), SCH_SHEET_PATH::LastScreen(), DIALOG_PLOT_SCHEMATIC_BASE::m_MessagesBox, m_pageSizeSelect, m_parent, PAGE_SIZE_A, PAGE_SIZE_A4, PAGE_SIZE_AUTO, plotOneSheetPS(), REPORTER::Report(), WX_HTML_REPORT_PANEL::Reporter(), SCHEMATIC::Root(), RPT_SEVERITY_ACTION, RPT_SEVERITY_ERROR, scale, SCH_EDIT_FRAME::Schematic(), SCH_EDIT_FRAME::SetCurrentSheet(), PAGE_INFO::SetPortrait(), SCH_EDIT_FRAME::SetSheetNumberAndCount(), PAGE_INFO::SetType(), SCH_SHEET_PATH::UpdateAllScreenReferences(), and IO_ERROR::What().

Referenced by PlotSchematic().

◆ createSVGFile()

void DIALOG_PLOT_SCHEMATIC::createSVGFile ( bool  aPlotAll,
bool  aPlotFrameRef,
RENDER_SETTINGS aSettings 
)
private

Definition at line 46 of file plot_schematic_SVG.cpp.

48 {
49  wxString msg;
50  REPORTER& reporter = m_MessagesBox->Reporter();
51  SCH_SHEET_PATH oldsheetpath = m_parent->GetCurrentSheet();
52  SCH_SHEET_LIST sheetList;
53 
54  if( aPrintAll )
55  sheetList.BuildSheetList( &m_parent->Schematic().Root() );
56  else
57  sheetList.push_back( m_parent->GetCurrentSheet() );
58 
59  for( unsigned i = 0; i < sheetList.size(); i++ )
60  {
61  SCH_SCREEN* screen;
62  m_parent->SetCurrentSheet( sheetList[i] );
65  screen = m_parent->GetCurrentSheet().LastScreen();
66 
67  try
68  {
69  wxString fname = m_parent->GetUniqueFilenameForCurrentSheet();
70  wxString ext = SVG_PLOTTER::GetDefaultFileExtension();
71  wxFileName plotFileName = createPlotFileName( fname, ext, &reporter );
72 
73  bool success = plotOneSheetSVG( plotFileName.GetFullPath(), screen, aRenderSettings,
74  getModeColor() ? false : true, aPrintFrameRef );
75 
76  if( !success )
77  {
78  msg.Printf( _( "Cannot create file \"%s\".\n" ), plotFileName.GetFullPath() );
79  reporter.Report( msg, RPT_SEVERITY_ERROR );
80  }
81  else
82  {
83  msg.Printf( _( "Plot: \"%s\" OK.\n" ), plotFileName.GetFullPath() );
84  reporter.Report( msg, RPT_SEVERITY_ACTION );
85  }
86  }
87  catch( const IO_ERROR& e )
88  {
89  // Cannot plot SVG file
90  msg.Printf( wxT( "SVG Plotter exception: %s" ), e.What() );
91  reporter.Report( msg, RPT_SEVERITY_ERROR );
92  break;
93  }
94  }
95 
96  m_parent->SetCurrentSheet( oldsheetpath );
99 }
void SetCurrentSheet(const SCH_SHEET_PATH &aSheet)
SCH_SHEET_LIST.
static wxString GetDefaultFileExtension()
Definition: plotter.h:948
bool plotOneSheetSVG(const wxString &aFileName, SCH_SCREEN *aScreen, RENDER_SETTINGS *aRenderSettings, bool aPlotBlackAndWhite, bool aPlotFrameRef)
REPORTER is a pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:64
void UpdateAllScreenReferences()
Function UpdateAllScreenReferences updates the reference and the m_Multi parameter (part selection) f...
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.
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:29
REPORTER & Reporter()
returns the reporter object that reports to this panel
SCHEMATIC & Schematic() const
SCH_SHEET_PATH.
void BuildSheetList(SCH_SHEET *aSheet)
Function BuildSheetList builds the list of sheets and their sheet path from aSheet.
SCH_SHEET & Root() const
Definition: schematic.h:97
SCH_SCREEN * LastScreen()
Function LastScreen.
void SetSheetNumberAndCount()
Set the m_ScreenNumber and m_NumberOfScreens members for screens.
#define _(s)
Definition: 3d_actions.cpp:33
wxString GetUniqueFilenameForCurrentSheet()
SCH_SHEET_PATH & GetCurrentSheet() const
WX_HTML_REPORT_PANEL * m_MessagesBox
Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions con...
Definition: ki_exception.h:76
wxFileName createPlotFileName(wxString &aPlotFileName, wxString &aExtension, REPORTER *aReporter=NULL)
Create a file name with an absolute path name.

References _, SCH_SHEET_LIST::BuildSheetList(), createPlotFileName(), SCH_EDIT_FRAME::GetCurrentSheet(), SVG_PLOTTER::GetDefaultFileExtension(), getModeColor(), SCH_EDIT_FRAME::GetUniqueFilenameForCurrentSheet(), SCH_SHEET_PATH::LastScreen(), DIALOG_PLOT_SCHEMATIC_BASE::m_MessagesBox, m_parent, plotOneSheetSVG(), REPORTER::Report(), WX_HTML_REPORT_PANEL::Reporter(), SCHEMATIC::Root(), RPT_SEVERITY_ACTION, RPT_SEVERITY_ERROR, SCH_EDIT_FRAME::Schematic(), SCH_EDIT_FRAME::SetCurrentSheet(), SCH_EDIT_FRAME::SetSheetNumberAndCount(), SCH_SHEET_PATH::UpdateAllScreenReferences(), and IO_ERROR::What().

Referenced by PlotSchematic().

◆ Enable()

bool DIALOG_SHIM::Enable ( bool  enable)
overrideinherited

Definition at line 269 of file dialog_shim.cpp.

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

◆ EndQuasiModal()

void DIALOG_SHIM::EndQuasiModal ( int  retCode)
inherited

Definition at line 399 of file dialog_shim.cpp.

400 {
401  // Hook up validator and transfer data from controls handling so quasi-modal dialogs
402  // handle validation in the same way as other dialogs.
403  if( ( retCode == wxID_OK ) && ( !Validate() || !TransferDataFromWindow() ) )
404  return;
405 
406  SetReturnCode( retCode );
407 
408  if( !IsQuasiModal() )
409  {
410  wxFAIL_MSG( "either DIALOG_SHIM::EndQuasiModal called twice or ShowQuasiModal"
411  "wasn't called" );
412  return;
413  }
414 
415  if( m_qmodal_loop )
416  {
417  if( m_qmodal_loop->IsRunning() )
418  m_qmodal_loop->Exit( 0 );
419  else
420  m_qmodal_loop->ScheduleExit( 0 );
421 
423  }
424 
427 
428  Show( false );
429 }
WX_EVENT_LOOP * m_qmodal_loop
Definition: dialog_shim.h:206
#define NULL
bool IsQuasiModal()
Definition: dialog_shim.h:123
bool Show(bool show) override
WDO_ENABLE_DISABLE * m_qmodal_parent_disabler
Definition: dialog_shim.h:209

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 144 of file dialog_shim.cpp.

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

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_CLEANUP_TRACKS_AND_VIAS::DIALOG_CLEANUP_TRACKS_AND_VIAS(), 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_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_GRID_SETTINGS::DIALOG_GRID_SETTINGS(), DIALOG_IMAGE_EDITOR::DIALOG_IMAGE_EDITOR(), DIALOG_INSPECTOR::DIALOG_INSPECTOR(), DIALOG_JUNCTION_PROPS::DIALOG_JUNCTION_PROPS(), 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_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_PIN_PROPERTIES::DIALOG_PIN_PROPERTIES(), 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_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_UNUSED_PAD_LAYERS::DIALOG_UNUSED_PAD_LAYERS(), 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().

◆ FixOSXCancelButtonIssue()

static void DIALOG_SHIM::FixOSXCancelButtonIssue ( wxWindow *  aWindow)
staticinherited

◆ getColorSettings()

COLOR_SETTINGS * DIALOG_PLOT_SCHEMATIC::getColorSettings ( )
private

Definition at line 304 of file dialog_plot_schematic.cpp.

305 {
306  int selection = m_colorTheme->GetSelection();
307  return static_cast<COLOR_SETTINGS*>( m_colorTheme->GetClientData( selection ) );
308 }

References DIALOG_PLOT_SCHEMATIC_BASE::m_colorTheme.

Referenced by getPlotOptions(), Plot_1_Page_HPGL(), and PlotOneSheetDXF().

◆ getModeColor()

bool DIALOG_PLOT_SCHEMATIC::getModeColor ( )
inlineprivate

◆ GetPlotFileFormat()

PLOT_FORMAT DIALOG_PLOT_SCHEMATIC::GetPlotFileFormat ( )
private

Definition at line 176 of file dialog_plot_schematic.cpp.

177 {
178  switch( m_plotFormatOpt->GetSelection() )
179  {
180  default:
181  case 0:
182  return PLOT_FORMAT::POST;
183  case 1:
184  return PLOT_FORMAT::PDF;
185  case 2:
186  return PLOT_FORMAT::SVG;
187  case 3:
188  return PLOT_FORMAT::DXF;
189  case 4:
190  return PLOT_FORMAT::HPGL;
191  }
192 }

References DXF, HPGL, DIALOG_PLOT_SCHEMATIC_BASE::m_plotFormatOpt, PDF, POST, and SVG.

Referenced by getPlotOptions(), OnPageSizeSelected(), OnUpdateUI(), and PlotSchematic().

◆ getPlotFrameRef()

bool DIALOG_PLOT_SCHEMATIC::getPlotFrameRef ( )
inlineprivate

Definition at line 91 of file dialog_plot_schematic.h.

91 { return m_PlotFrameRefOpt->GetValue(); }

References DIALOG_PLOT_SCHEMATIC_BASE::m_PlotFrameRefOpt.

Referenced by getPlotOptions(), and PlotSchematic().

◆ getPlotOptions()

void DIALOG_PLOT_SCHEMATIC::getPlotOptions ( RENDER_SETTINGS aSettings)
private

Definition at line 260 of file dialog_plot_schematic.cpp.

261 {
263 
264  EESCHEMA_SETTINGS* cfg = dynamic_cast<EESCHEMA_SETTINGS*>( Kiface().KifaceSettings() );
265  wxASSERT( cfg );
266 
268 
269  if( cfg )
270  {
272  cfg->m_PlotPanel.color = getModeColor();
273  cfg->m_PlotPanel.color_theme = colors->GetFilename();
275  cfg->m_PlotPanel.format = static_cast<int>( GetPlotFileFormat() );
278 
279  // HPGL Pen Size is stored in mm in config
281  }
282 
283  aSettings->LoadColors( colors );
284  aSettings->SetDefaultPenWidth( (int) m_defaultLineWidth.GetValue() );
285 
286  if( m_plotBackgroundColor->GetValue() )
287  aSettings->SetBackgroundColor( colors->GetColor( LAYER_SCHEMATIC_BACKGROUND ) );
288  else
289  aSettings->SetBackgroundColor( COLOR4D::UNSPECIFIED );
290 
291  // Plot directory
292  wxString path = m_outputDirectoryName->GetValue();
293  path.Replace( '\\', '/' );
294 
296 
297  if( settings.m_PlotDirectoryName != path )
298  m_configChanged = true;
299 
300  settings.m_PlotDirectoryName = path;
301 }
static constexpr double IU_PER_MM
Mock up a conversion function.
SCHEMATIC_SETTINGS & Settings() const
Definition: schematic.cpp:138
COLOR_SETTINGS * getColorSettings()
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
SCHEMATIC & Schematic() const
virtual void SetBackgroundColor(const COLOR4D &aColor)=0
Sets the background color.
These settings were stored in SCH_BASE_FRAME previously.
virtual long long int GetValue()
Function GetValue Returns the current value in Internal Units.
Color settings are a bit different than most of the settings objects in that there can be more than o...
void SetDefaultPenWidth(int aWidth)
virtual void LoadColors(const COLOR_SETTINGS *aSettings)
static VRML_COLOR colors[VRML_COLOR_LAST]

References EESCHEMA_SETTINGS::PANEL_PLOT::background_color, EESCHEMA_SETTINGS::PANEL_PLOT::color, EESCHEMA_SETTINGS::PANEL_PLOT::color_theme, colors, EESCHEMA_SETTINGS::PANEL_PLOT::format, EESCHEMA_SETTINGS::PANEL_PLOT::frame_reference, getColorSettings(), getModeColor(), GetPlotFileFormat(), getPlotFrameRef(), GetPlotOriginCenter(), UNIT_BINDER::GetValue(), EESCHEMA_SETTINGS::PANEL_PLOT::hpgl_origin, EESCHEMA_SETTINGS::PANEL_PLOT::hpgl_paper_size, EESCHEMA_SETTINGS::PANEL_PLOT::hpgl_pen_size, IU_PER_MM, Kiface(), LAYER_SCHEMATIC_BACKGROUND, KIGFX::RENDER_SETTINGS::LoadColors(), m_configChanged, m_defaultLineWidth, m_HPGLPaperSizeSelect, m_HPGLPenSize, DIALOG_PLOT_SCHEMATIC_BASE::m_outputDirectoryName, m_parent, m_penWidth, DIALOG_PLOT_SCHEMATIC_BASE::m_plotBackgroundColor, SCHEMATIC_SETTINGS::m_PlotDirectoryName, EESCHEMA_SETTINGS::m_PlotPanel, SCH_EDIT_FRAME::Schematic(), KIGFX::RENDER_SETTINGS::SetBackgroundColor(), KIGFX::RENDER_SETTINGS::SetDefaultPenWidth(), and SCHEMATIC::Settings().

Referenced by PlotSchematic().

◆ GetPlotOriginCenter()

bool DIALOG_PLOT_SCHEMATIC::GetPlotOriginCenter ( )
inlineprivate

Definition at line 115 of file dialog_plot_schematic.h.

116  {
117  return m_plotOriginOpt->GetSelection() == 1;
118  }

References DIALOG_PLOT_SCHEMATIC_BASE::m_plotOriginOpt.

Referenced by createHPGLFile(), and getPlotOptions().

◆ 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 165 of file dialog_shim.cpp.

166 {
167  wxSize sz( x, 0 );
168  return ConvertDialogToPixels( sz ).x;
169 }

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

◆ initDlg()

void DIALOG_PLOT_SCHEMATIC::initDlg ( )
private

Definition at line 70 of file dialog_plot_schematic.cpp.

71 {
72  auto cfg = dynamic_cast<EESCHEMA_SETTINGS*>( Kiface().KifaceSettings() );
73  wxASSERT( cfg );
74 
75  if( cfg )
76  {
77  for( COLOR_SETTINGS* settings : Pgm().GetSettingsManager().GetColorSettingsList() )
78  {
79  int idx = m_colorTheme->Append( settings->GetName(), static_cast<void*>( settings ) );
80 
81  if( settings->GetFilename() == cfg->m_PlotPanel.color_theme )
82  m_colorTheme->SetSelection( idx );
83  }
84 
85  m_colorTheme->Enable( cfg->m_PlotPanel.color );
86 
87  m_plotBackgroundColor->Enable( cfg->m_PlotPanel.color );
88  m_plotBackgroundColor->SetValue( cfg->m_PlotPanel.background_color );
89 
90  // Set color or B&W plot option
91  setModeColor( cfg->m_PlotPanel.color );
92 
93  // Set plot or not frame reference option
94  setPlotFrameRef( cfg->m_PlotPanel.frame_reference );
95 
96  // Set HPGL plot origin to center of paper of left bottom corner
97  SetPlotOriginCenter( cfg->m_PlotPanel.hpgl_origin );
98 
99  m_HPGLPaperSizeSelect = cfg->m_PlotPanel.hpgl_paper_size;
100 
101  // HPGL Pen Size is stored in mm in config
102  m_HPGLPenSize = cfg->m_PlotPanel.hpgl_pen_size * IU_PER_MM;
103 
104  // Switch to the last save plot format
105  PLOT_FORMAT fmt = static_cast<PLOT_FORMAT>( cfg->m_PlotPanel.format );
106 
107  switch( fmt )
108  {
109  default:
110  case PLOT_FORMAT::POST: m_plotFormatOpt->SetSelection( 0 ); break;
111  case PLOT_FORMAT::PDF: m_plotFormatOpt->SetSelection( 1 ); break;
112  case PLOT_FORMAT::SVG: m_plotFormatOpt->SetSelection( 2 ); break;
113  case PLOT_FORMAT::DXF: m_plotFormatOpt->SetSelection( 3 ); break;
114  case PLOT_FORMAT::HPGL: m_plotFormatOpt->SetSelection( 4 ); break;
115  }
116 
117  if( fmt == PLOT_FORMAT::DXF || fmt == PLOT_FORMAT::HPGL )
118  m_plotBackgroundColor->Disable();
119 
120  // Set the default line width (pen width which should be used for
121  // items that do not have a pen size defined (like frame ref)
122  // the default line width is stored in mils in config
123  m_defaultLineWidth.SetValue( Mils2iu( cfg->m_Drawing.default_line_thickness ) );
124  }
125 
126  // Initialize HPGL specific widgets
128 
129  // Plot directory
131  wxString path = settings.m_PlotDirectoryName;
132 #ifdef __WINDOWS__
133  path.Replace( '/', '\\' );
134 #endif
135  m_outputDirectoryName->SetValue( path );
136 }
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:104
static constexpr double IU_PER_MM
Mock up a conversion function.
void SetPlotOriginCenter(bool aCenter)
SCHEMATIC_SETTINGS & Settings() const
Definition: schematic.cpp:138
void setPlotFrameRef(bool aPlot)
PLOT_FORMAT
Enum PlotFormat is the set of supported output plot formats.
Definition: plotter.h:51
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
SCHEMATIC & Schematic() const
SETTINGS_MANAGER * GetSettingsManager()
virtual void SetValue(int aValue)
Function SetValue Sets new value (in Internal Units) for the text field, taking care of units convers...
These settings were stored in SCH_BASE_FRAME previously.
Color settings are a bit different than most of the settings objects in that there can be more than o...
void setModeColor(bool aColor)

References DXF, GetSettingsManager(), HPGL, IU_PER_MM, Kiface(), DIALOG_PLOT_SCHEMATIC_BASE::m_colorTheme, m_defaultLineWidth, m_HPGLPaperSizeSelect, m_HPGLPenSize, DIALOG_PLOT_SCHEMATIC_BASE::m_outputDirectoryName, m_parent, m_penWidth, DIALOG_PLOT_SCHEMATIC_BASE::m_plotBackgroundColor, SCHEMATIC_SETTINGS::m_PlotDirectoryName, DIALOG_PLOT_SCHEMATIC_BASE::m_plotFormatOpt, PDF, Pgm(), POST, SCH_EDIT_FRAME::Schematic(), setModeColor(), setPlotFrameRef(), SetPlotOriginCenter(), SCHEMATIC::Settings(), UNIT_BINDER::SetValue(), and SVG.

Referenced by DIALOG_PLOT_SCHEMATIC().

◆ IsCtrl()

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

Definition at line 136 of file dialog_shim.h.

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

Referenced by DIALOG_TEXT_PROPERTIES::OnCharHook().

◆ IsQuasiModal()

◆ IsShiftCtrl()

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

Definition at line 142 of file dialog_shim.h.

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

Referenced by 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(), KICAD_MANAGER_FRAME::CloseProject(), 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(), PCB_EDITOR_CONTROL::EditFpInFpEditor(), SCH_EDITOR_CONTROL::EditWithLibEdit(), BACK_ANNOTATE::FetchNetlistFromPCB(), DISPLAY_FOOTPRINTS_FRAME::GetModule(), PCB_EDIT_FRAME::importFile(), KICAD_MANAGER_FRAME::language_change(), KIWAY_PLAYER::language_change(), LIB_TREE_MODEL_ADAPTER::LIB_TREE_MODEL_ADAPTER(), CVPCB_MAINFRAME::LoadFootprintFiles(), 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(), KICAD_MANAGER_FRAME::OnUnarchiveFiles(), FOOTPRINT_EDIT_FRAME::OnUpdateInsertModuleInBoard(), FOOTPRINT_EDIT_FRAME::OnUpdateLoadModuleFromBoard(), SCH_EDIT_FRAME::OnUpdatePCB(), PANEL_PCBNEW_COLOR_SETTINGS::PANEL_PCBNEW_COLOR_SETTINGS(), KIWAY_HOLDER::Prj(), BACK_ANNOTATE::PushNewLinksToPCB(), 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(), CVPCB_CONTROL::ShowFootprintViewer(), COMMON_CONTROL::ShowLibraryTable(), COMMON_CONTROL::ShowPlayer(), KICAD_MANAGER_CONTROL::ShowPlayer(), SCH_EDIT_FRAME::ShowSchematicSetupDialog(), SIM_PLOT_FRAME::SIM_PLOT_FRAME(), PCB_EDITOR_CONTROL::UpdateSchematicFromPCB(), and DIALOG_EXCHANGE_FOOTPRINTS::ViewAndSelectFootprint().

◆ OnCloseWindow()

virtual void DIALOG_PLOT_SCHEMATIC_BASE::OnCloseWindow ( wxCloseEvent &  event)
inlineprotectedvirtualinherited

◆ OnOutputDirectoryBrowseClicked()

void DIALOG_PLOT_SCHEMATIC::OnOutputDirectoryBrowseClicked ( wxCommandEvent &  event)
overrideprivatevirtual

Set the m_outputDirectoryName variable to the selected directory from directory dialog.

Todo:
Copy of DIALOG_PLOT::OnOutputDirectoryBrowseClicked in dialog_plot.cpp, maybe merge to a common method.

Reimplemented from DIALOG_PLOT_SCHEMATIC_BASE.

Definition at line 143 of file dialog_plot_schematic.cpp.

144 {
145  // Build the absolute path of current output directory to preselect it in the file browser.
146  wxString path = ExpandEnvVarSubstitutions( m_outputDirectoryName->GetValue(), &Prj() );
147  path = Prj().AbsolutePath( path );
148 
149  wxDirDialog dirDialog( this, _( "Select Output Directory" ), path );
150 
151  if( dirDialog.ShowModal() == wxID_CANCEL )
152  return;
153 
154  wxFileName dirName = wxFileName::DirName( dirDialog.GetPath() );
155 
156  wxFileName fn( Prj().AbsolutePath( m_parent->Schematic().Root().GetFileName() ) );
157  wxString defaultPath = fn.GetPathWithSep();
158  wxString msg;
159  msg.Printf( _( "Do you want to use a path relative to\n\"%s\"" ), GetChars( defaultPath ) );
160 
161  wxMessageDialog dialog( this, msg, _( "Plot Output Directory" ),
162  wxYES_NO | wxICON_QUESTION | wxYES_DEFAULT );
163 
164  // relative directory selected
165  if( dialog.ShowModal() == wxID_YES )
166  {
167  if( !dirName.MakeRelativeTo( defaultPath ) )
168  wxMessageBox( _( "Cannot make path relative (target volume different from file "
169  "volume)!" ), _( "Plot Output Directory" ), wxOK | wxICON_ERROR );
170  }
171 
172  m_outputDirectoryName->SetValue( dirName.GetFullPath() );
173 }
const wxString ExpandEnvVarSubstitutions(const wxString &aString, PROJECT *aProject)
Replace any environment variable & text variable references with their values.
Definition: common.cpp:574
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:277
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
SCHEMATIC & Schematic() const
wxString GetFileName() const
Return the filename corresponding to this sheet.
Definition: sch_sheet.h:496
SCH_SHEET & Root() const
Definition: schematic.h:97
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

References _, PROJECT::AbsolutePath(), ExpandEnvVarSubstitutions(), GetChars(), SCH_SHEET::GetFileName(), DIALOG_PLOT_SCHEMATIC_BASE::m_outputDirectoryName, m_parent, KIWAY_HOLDER::Prj(), SCHEMATIC::Root(), and SCH_EDIT_FRAME::Schematic().

◆ OnPageSizeSelected()

void DIALOG_PLOT_SCHEMATIC::OnPageSizeSelected ( wxCommandEvent &  event)
overrideprivatevirtual

◆ OnPaint()

void DIALOG_SHIM::OnPaint ( wxPaintEvent &  event)
inherited

Definition at line 302 of file dialog_shim.cpp.

303 {
304  if( m_firstPaintEvent )
305  {
307 
308  selectAllInTextCtrls( GetChildren() );
309 
311  m_initialFocusTarget->SetFocus();
312  else
313  SetFocus(); // Focus the dialog itself
314 
315  m_firstPaintEvent = false;
316  }
317 
318  event.Skip();
319 }
wxWindow * m_initialFocusTarget
Definition: dialog_shim.h:204
bool m_firstPaintEvent
Definition: dialog_shim.h:203
void FixupCancelButtonCmdKeyCollision(wxWindow *aWindow)
Definition: gtk/ui.cpp:38
static void selectAllInTextCtrls(wxWindowList &children)

References KIPLATFORM::UI::FixupCancelButtonCmdKeyCollision(), DIALOG_SHIM::m_firstPaintEvent, DIALOG_SHIM::m_initialFocusTarget, and selectAllInTextCtrls().

Referenced by DIALOG_SHIM::DIALOG_SHIM().

◆ OnPlotAll()

void DIALOG_PLOT_SCHEMATIC::OnPlotAll ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PLOT_SCHEMATIC_BASE.

Definition at line 317 of file dialog_plot_schematic.cpp.

318 {
319  PlotSchematic( true );
320 }
void PlotSchematic(bool aPlotAll)

References PlotSchematic().

◆ OnPlotCurrent()

void DIALOG_PLOT_SCHEMATIC::OnPlotCurrent ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PLOT_SCHEMATIC_BASE.

Definition at line 311 of file dialog_plot_schematic.cpp.

312 {
313  PlotSchematic( false );
314 }
void PlotSchematic(bool aPlotAll)

References PlotSchematic().

◆ OnPlotFormatSelection()

virtual void DIALOG_PLOT_SCHEMATIC_BASE::OnPlotFormatSelection ( wxCommandEvent &  event)
inlineprotectedvirtualinherited

◆ OnUpdateUI()

void DIALOG_PLOT_SCHEMATIC::OnUpdateUI ( wxUpdateUIEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PLOT_SCHEMATIC_BASE.

Definition at line 204 of file dialog_plot_schematic.cpp.

205 {
207 
208  if( fmt != m_plotFormat )
209  {
210  m_plotFormat = fmt;
211 
212  wxArrayString paperSizes;
213  paperSizes.push_back( _( "Schematic size" ) );
214 
215  int selection;
216 
217  if( fmt == PLOT_FORMAT::HPGL )
218  {
219  paperSizes.push_back( _( "A5" ) );
220  paperSizes.push_back( _( "A4" ) );
221  paperSizes.push_back( _( "A3" ) );
222  paperSizes.push_back( _( "A2" ) );
223  paperSizes.push_back( _( "A1" ) );
224  paperSizes.push_back( _( "A0" ) );
225  paperSizes.push_back( _( "A" ) );
226  paperSizes.push_back( _( "B" ) );
227  paperSizes.push_back( _( "C" ) );
228  paperSizes.push_back( _( "D" ) );
229  paperSizes.push_back( _( "E" ) );
230 
231  selection = m_HPGLPaperSizeSelect;
232  }
233  else
234  {
235  paperSizes.push_back( _( "A4" ) );
236  paperSizes.push_back( _( "A" ) );
237 
238  selection = m_pageSizeSelect;
239  }
240 
241  m_paperSizeOption->Set( paperSizes );
242  m_paperSizeOption->SetSelection( selection );
243 
245  fmt == PLOT_FORMAT::POST || fmt == PLOT_FORMAT::PDF || fmt == PLOT_FORMAT::SVG );
246 
247  m_plotOriginTitle->Enable( fmt == PLOT_FORMAT::HPGL );
248  m_plotOriginOpt->Enable( fmt == PLOT_FORMAT::HPGL );
250 
251  m_plotBackgroundColor->Enable(
252  fmt == PLOT_FORMAT::POST || fmt == PLOT_FORMAT::PDF || fmt == PLOT_FORMAT::SVG );
253 
254  m_colorTheme->Enable( fmt != PLOT_FORMAT::HPGL );
255  m_ModeColorOption->Enable( fmt != PLOT_FORMAT::HPGL );
256  }
257 }
PLOT_FORMAT
Enum PlotFormat is the set of supported output plot formats.
Definition: plotter.h:51
#define _(s)
Definition: 3d_actions.cpp:33
void Enable(bool aEnable)
Function Enable Enables/diasables the label, widget and units label.

References _, UNIT_BINDER::Enable(), GetPlotFileFormat(), HPGL, DIALOG_PLOT_SCHEMATIC_BASE::m_colorTheme, m_defaultLineWidth, m_HPGLPaperSizeSelect, DIALOG_PLOT_SCHEMATIC_BASE::m_ModeColorOption, m_pageSizeSelect, DIALOG_PLOT_SCHEMATIC_BASE::m_paperSizeOption, m_penWidth, DIALOG_PLOT_SCHEMATIC_BASE::m_plotBackgroundColor, m_plotFormat, DIALOG_PLOT_SCHEMATIC_BASE::m_plotOriginOpt, DIALOG_PLOT_SCHEMATIC_BASE::m_plotOriginTitle, PDF, POST, and SVG.

◆ Plot_1_Page_HPGL()

bool DIALOG_PLOT_SCHEMATIC::Plot_1_Page_HPGL ( const wxString &  aFileName,
SCH_SCREEN aScreen,
const PAGE_INFO aPageInfo,
RENDER_SETTINGS aRenderSettings,
wxPoint  aPlot0ffset,
double  aScale,
bool  aPlotFrameRef 
)
private

Definition at line 179 of file plot_schematic_HPGL.cpp.

186 {
187  HPGL_PLOTTER* plotter = new HPGL_PLOTTER();
188  // Currently, plot units are in decimil
189 
190  plotter->SetPageSettings( aPageInfo );
191  plotter->SetRenderSettings( aRenderSettings );
192  plotter->RenderSettings()->LoadColors( getColorSettings() );
193  plotter->SetColorMode( getModeColor() );
194  plotter->SetViewport( aPlot0ffset, IU_PER_MILS/10, aScale, false );
195 
196  // Init :
197  plotter->SetCreator( wxT( "Eeschema-HPGL" ) );
198 
199  if( ! plotter->OpenFile( aFileName ) )
200  {
201  delete plotter;
202  return false;
203  }
204 
205  LOCALE_IO toggle;
206 
207  // Pen num and pen speed are not initialized here.
208  // Default HPGL driver values are used
209  plotter->SetPenDiameter( m_HPGLPenSize );
210  plotter->StartPlot();
211 
212  if( aPlotFrameRef )
213  {
214  PlotWorkSheet( plotter, &m_parent->Prj(), m_parent->GetTitleBlock(), aPageInfo,
215  aScreen->m_ScreenNumber, aScreen->m_NumberOfScreens,
217  }
218 
219  aScreen->Plot( plotter );
220 
221  plotter->EndPlot();
222  delete plotter;
223 
224  return true;
225 }
virtual bool EndPlot() override
HPGL end of plot: pen return and release.
const wxString & GetFileName() const
Definition: sch_screen.h:185
int m_ScreenNumber
Definition: base_screen.h:79
virtual void SetCreator(const wxString &aCreator)
Definition: plotter.h:164
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Definition: common.h:216
virtual bool OpenFile(const wxString &aFullFilename)
Open or create the plot file aFullFilename.
Definition: plotter.cpp:77
virtual void SetColorMode(bool aColorMode)
Plot in B/W or color.
Definition: plotter.h:143
void SetRenderSettings(RENDER_SETTINGS *aSettings)
Definition: plotter.h:146
virtual void SetPenDiameter(double diameter)
COLOR_SETTINGS * getColorSettings()
Definition: color4d.h:44
virtual bool StartPlot() override
At the start of the HPGL plot pen speed and number are requested.
virtual void SetViewport(const wxPoint &aOffset, double aIusPerDecimil, double aScale, bool aMirror) override
Set the plot offset and scaling for the current plot.
wxString GetScreenDesc() const override
Return a human-readable description of the current screen.
void PlotWorkSheet(PLOTTER *plotter, const PROJECT *aProject, const TITLE_BLOCK &aTitleBlock, const PAGE_INFO &aPageInfo, int aSheetNumber, int aNumberOfSheets, const wxString &aSheetDesc, const wxString &aFilename, COLOR4D aColor)
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
void Plot(PLOTTER *aPlotter)
Plot all the schematic objects to aPlotter.
Definition: sch_screen.cpp:750
RENDER_SETTINGS * RenderSettings()
Definition: plotter.h:147
const TITLE_BLOCK & GetTitleBlock() const override
#define IU_PER_MILS
Definition: plotter.cpp:138
int m_NumberOfScreens
Definition: base_screen.h:80
virtual void LoadColors(const COLOR_SETTINGS *aSettings)
virtual void SetPageSettings(const PAGE_INFO &aPageSettings)
Definition: plotter.h:149

References BLACK, HPGL_PLOTTER::EndPlot(), getColorSettings(), SCH_SCREEN::GetFileName(), getModeColor(), SCH_EDIT_FRAME::GetScreenDesc(), SCH_BASE_FRAME::GetTitleBlock(), IU_PER_MILS, KIGFX::RENDER_SETTINGS::LoadColors(), m_HPGLPenSize, BASE_SCREEN::m_NumberOfScreens, m_parent, BASE_SCREEN::m_ScreenNumber, PLOTTER::OpenFile(), SCH_SCREEN::Plot(), PlotWorkSheet(), KIWAY_HOLDER::Prj(), PLOTTER::RenderSettings(), PLOTTER::SetColorMode(), PLOTTER::SetCreator(), PLOTTER::SetPageSettings(), HPGL_PLOTTER::SetPenDiameter(), PLOTTER::SetRenderSettings(), HPGL_PLOTTER::SetViewport(), and HPGL_PLOTTER::StartPlot().

Referenced by createHPGLFile().

◆ PlotOneSheetDXF()

bool DIALOG_PLOT_SCHEMATIC::PlotOneSheetDXF ( const wxString &  aFileName,
SCH_SCREEN aScreen,
RENDER_SETTINGS aRenderSettings,
wxPoint  aPlot0ffset,
double  aScale,
bool  aPlotFrameRef 
)
private

Definition at line 108 of file plot_schematic_DXF.cpp.

114 {
115  aRenderSettings->LoadColors( getColorSettings() );
116  aRenderSettings->SetDefaultPenWidth( 0 );
117 
118  const PAGE_INFO& pageInfo = aScreen->GetPageSettings();
119  DXF_PLOTTER* plotter = new DXF_PLOTTER();
120 
121  plotter->SetRenderSettings( aRenderSettings );
122  plotter->SetPageSettings( pageInfo );
123  plotter->SetColorMode( getModeColor() );
124  // Currently, plot units are in decimil
125  plotter->SetViewport( aPlotOffset, IU_PER_MILS/10, aScale, false );
126 
127  // Init :
128  plotter->SetCreator( wxT( "Eeschema-DXF" ) );
129 
130  if( ! plotter->OpenFile( aFileName ) )
131  {
132  delete plotter;
133  return false;
134  }
135 
136  LOCALE_IO toggle;
137 
138  plotter->StartPlot();
139 
140  if( aPlotFrameRef )
141  {
142  PlotWorkSheet( plotter, &m_parent->Prj(), m_parent->GetTitleBlock(), pageInfo,
143  aScreen->m_ScreenNumber, aScreen->m_NumberOfScreens,
144  m_parent->GetScreenDesc(), aScreen->GetFileName(),
145  plotter->GetColorMode() ?
147  COLOR4D::BLACK );
148  }
149 
150  aScreen->Plot( plotter );
151 
152  // finish
153  plotter->EndPlot();
154  delete plotter;
155 
156  return true;
157 }
const wxString & GetFileName() const
Definition: sch_screen.h:185
int m_ScreenNumber
Definition: base_screen.h:79
virtual void SetCreator(const wxString &aCreator)
Definition: plotter.h:164
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Definition: common.h:216
virtual void SetViewport(const wxPoint &aOffset, double aIusPerDecimil, double aScale, bool aMirror) override
Set the scale/position for the DXF plot The DXF engine doesn't support line widths and mirroring.
virtual bool OpenFile(const wxString &aFullFilename)
Open or create the plot file aFullFilename.
Definition: plotter.cpp:77
virtual void SetColorMode(bool aColorMode)
Plot in B/W or color.
Definition: plotter.h:143
void SetRenderSettings(RENDER_SETTINGS *aSettings)
Definition: plotter.h:146
const COLOR4D & GetLayerColor(int aLayer) const
Function GetLayerColor Returns the color used to draw a layer.
COLOR_SETTINGS * getColorSettings()
Definition: color4d.h:44
const PAGE_INFO & GetPageSettings() const
Definition: sch_screen.h:180
wxString GetScreenDesc() const override
Return a human-readable description of the current screen.
virtual bool StartPlot() override
Opens the DXF plot with a skeleton header.
void PlotWorkSheet(PLOTTER *plotter, const PROJECT *aProject, const TITLE_BLOCK &aTitleBlock, const PAGE_INFO &aPageInfo, int aSheetNumber, int aNumberOfSheets, const wxString &aSheetDesc, const wxString &aFilename, COLOR4D aColor)
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
PAGE_INFO describes the page size and margins of a paper page on which to eventually print or plot.
Definition: page_info.h:54
virtual bool EndPlot() override
void Plot(PLOTTER *aPlotter)
Plot all the schematic objects to aPlotter.
Definition: sch_screen.cpp:750
RENDER_SETTINGS * RenderSettings()
Definition: plotter.h:147
const TITLE_BLOCK & GetTitleBlock() const override
#define IU_PER_MILS
Definition: plotter.cpp:138
int m_NumberOfScreens
Definition: base_screen.h:80
void SetDefaultPenWidth(int aWidth)
virtual void LoadColors(const COLOR_SETTINGS *aSettings)
virtual void SetPageSettings(const PAGE_INFO &aPageSettings)
Definition: plotter.h:149
bool GetColorMode() const
Definition: plotter.h:144

References BLACK, DXF_PLOTTER::EndPlot(), PLOTTER::GetColorMode(), getColorSettings(), SCH_SCREEN::GetFileName(), KIGFX::RENDER_SETTINGS::GetLayerColor(), getModeColor(), SCH_SCREEN::GetPageSettings(), SCH_EDIT_FRAME::GetScreenDesc(), SCH_BASE_FRAME::GetTitleBlock(), IU_PER_MILS, LAYER_SCHEMATIC_WORKSHEET, KIGFX::RENDER_SETTINGS::LoadColors(), BASE_SCREEN::m_NumberOfScreens, m_parent, BASE_SCREEN::m_ScreenNumber, PLOTTER::OpenFile(), SCH_SCREEN::Plot(), PlotWorkSheet(), KIWAY_HOLDER::Prj(), PLOTTER::RenderSettings(), PLOTTER::SetColorMode(), PLOTTER::SetCreator(), KIGFX::RENDER_SETTINGS::SetDefaultPenWidth(), PLOTTER::SetPageSettings(), PLOTTER::SetRenderSettings(), DXF_PLOTTER::SetViewport(), and DXF_PLOTTER::StartPlot().

Referenced by CreateDXFFile().

◆ plotOneSheetPDF()

void DIALOG_PLOT_SCHEMATIC::plotOneSheetPDF ( PLOTTER aPlotter,
SCH_SCREEN aScreen,
bool  aPlotFrameRef 
)
private

Definition at line 148 of file plot_schematic_PDF.cpp.

151 {
152  if( m_plotBackgroundColor->GetValue() )
153  {
154  aPlotter->SetColor( aPlotter->RenderSettings()->GetBackgroundColor() );
155  wxPoint end( aPlotter->PageSettings().GetWidthIU(),
156  aPlotter->PageSettings().GetHeightIU() );
157  aPlotter->Rect( wxPoint( 0, 0 ), end, FILLED_SHAPE, 1.0 );
158  }
159 
160  if( aPlotFrameRef )
161  {
162  PlotWorkSheet( aPlotter, &aScreen->Schematic()->Prj(), m_parent->GetTitleBlock(),
165  aScreen->GetFileName(),
166  aPlotter->GetColorMode() ?
168  COLOR4D::BLACK );
169  }
170 
171  aScreen->Plot( aPlotter );
172 }
const wxString & GetFileName() const
Definition: sch_screen.h:185
int m_ScreenNumber
Definition: base_screen.h:79
virtual const COLOR4D & GetBackgroundColor()=0
Function GetBackgroundColor Returns current background color settings.
virtual void SetColor(COLOR4D color)=0
const COLOR4D & GetLayerColor(int aLayer) const
Function GetLayerColor Returns the color used to draw a layer.
Definition: color4d.h:44
wxString GetScreenDesc() const override
Return a human-readable description of the current screen.
void PlotWorkSheet(PLOTTER *plotter, const PROJECT *aProject, const TITLE_BLOCK &aTitleBlock, const PAGE_INFO &aPageInfo, int aSheetNumber, int aNumberOfSheets, const wxString &aSheetDesc, const wxString &aFilename, COLOR4D aColor)
void Plot(PLOTTER *aPlotter)
Plot all the schematic objects to aPlotter.
Definition: sch_screen.cpp:750
const PAGE_INFO & GetPageSettings() const override
RENDER_SETTINGS * RenderSettings()
Definition: plotter.h:147
SCHEMATIC * Schematic() const
Definition: sch_screen.cpp:92
const TITLE_BLOCK & GetTitleBlock() const override
PROJECT & Prj() const
Return a reference to the project this schematic is part of.
Definition: schematic.h:77
virtual void Rect(const wxPoint &p1, const wxPoint &p2, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH)=0
int m_NumberOfScreens
Definition: base_screen.h:80
PAGE_INFO & PageSettings()
Definition: plotter.h:150
bool GetColorMode() const
Definition: plotter.h:144

References BLACK, FILLED_SHAPE, KIGFX::RENDER_SETTINGS::GetBackgroundColor(), PLOTTER::GetColorMode(), SCH_SCREEN::GetFileName(), KIGFX::RENDER_SETTINGS::GetLayerColor(), SCH_BASE_FRAME::GetPageSettings(), SCH_EDIT_FRAME::GetScreenDesc(), SCH_BASE_FRAME::GetTitleBlock(), LAYER_SCHEMATIC_WORKSHEET, BASE_SCREEN::m_NumberOfScreens, m_parent, DIALOG_PLOT_SCHEMATIC_BASE::m_plotBackgroundColor, BASE_SCREEN::m_ScreenNumber, PLOTTER::PageSettings(), SCH_SCREEN::Plot(), PlotWorkSheet(), SCHEMATIC::Prj(), PLOTTER::Rect(), PLOTTER::RenderSettings(), SCH_SCREEN::Schematic(), and PLOTTER::SetColor().

Referenced by createPDFFile().

◆ plotOneSheetPS()

bool DIALOG_PLOT_SCHEMATIC::plotOneSheetPS ( const wxString &  aFileName,
SCH_SCREEN aScreen,
RENDER_SETTINGS aRenderSettings,
const PAGE_INFO aPageInfo,
wxPoint  aPlot0ffset,
double  aScale,
bool  aPlotFrameRef 
)
private

Definition at line 130 of file plot_schematic_PS.cpp.

137 {
138  PS_PLOTTER* plotter = new PS_PLOTTER();
139  plotter->SetRenderSettings( aRenderSettings );
140  plotter->SetPageSettings( aPageInfo );
141  plotter->SetColorMode( getModeColor() );
142  // Currently, plot units are in decimil
143  plotter->SetViewport( aPlot0ffset, IU_PER_MILS/10, aScale, false );
144 
145  // Init :
146  plotter->SetCreator( wxT( "Eeschema-PS" ) );
147 
148  if( ! plotter->OpenFile( aFileName ) )
149  {
150  delete plotter;
151  return false;
152  }
153 
154  LOCALE_IO toggle; // Switch the locale to standard C
155 
156  plotter->StartPlot();
157 
158  if( m_plotBackgroundColor->GetValue() )
159  {
161  wxPoint end( plotter->PageSettings().GetWidthIU(),
162  plotter->PageSettings().GetHeightIU() );
163  plotter->Rect( wxPoint( 0, 0 ), end, FILLED_SHAPE, 1.0 );
164  }
165 
166  if( aPlotFrameRef )
167  {
168  PlotWorkSheet( plotter, &aScreen->Schematic()->Prj(), m_parent->GetTitleBlock(), aPageInfo,
169  aScreen->m_ScreenNumber, aScreen->m_NumberOfScreens,
170  m_parent->GetScreenDesc(), aScreen->GetFileName(),
171  plotter->GetColorMode() ?
173  COLOR4D::BLACK );
174  }
175 
176  aScreen->Plot( plotter );
177 
178  plotter->EndPlot();
179  delete plotter;
180 
181  return true;
182 }
virtual void SetViewport(const wxPoint &aOffset, double aIusPerDecimil, double aScale, bool aMirror) override
Set the plot offset and scaling for the current plot.
Definition: PS_plotter.cpp:407
const wxString & GetFileName() const
Definition: sch_screen.h:185
int m_ScreenNumber
Definition: base_screen.h:79
virtual void SetCreator(const wxString &aCreator)
Definition: plotter.h:164
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Definition: common.h:216
virtual bool OpenFile(const wxString &aFullFilename)
Open or create the plot file aFullFilename.
Definition: plotter.cpp:77
virtual void SetColorMode(bool aColorMode)
Plot in B/W or color.
Definition: plotter.h:143
virtual bool EndPlot() override
Definition: PS_plotter.cpp:964
void SetRenderSettings(RENDER_SETTINGS *aSettings)
Definition: plotter.h:146
const COLOR4D & GetLayerColor(int aLayer) const
Function GetLayerColor Returns the color used to draw a layer.
Definition: color4d.h:44
wxString GetScreenDesc() const override
Return a human-readable description of the current screen.
virtual bool StartPlot() override
The code within this function (and the CloseFilePS function) creates postscript files whose contents ...
Definition: PS_plotter.cpp:810
void PlotWorkSheet(PLOTTER *plotter, const PROJECT *aProject, const TITLE_BLOCK &aTitleBlock, const PAGE_INFO &aPageInfo, int aSheetNumber, int aNumberOfSheets, const wxString &aSheetDesc, const wxString &aFilename, COLOR4D aColor)
virtual void SetColor(COLOR4D color) override
The SetColor implementation is split with the subclasses: The PSLIKE computes the rgb values,...
Definition: PS_plotter.cpp:52
void Plot(PLOTTER *aPlotter)
Plot all the schematic objects to aPlotter.
Definition: sch_screen.cpp:750
RENDER_SETTINGS * RenderSettings()
Definition: plotter.h:147
virtual void Rect(const wxPoint &p1, const wxPoint &p2, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH) override
Definition: PS_plotter.cpp:577
SCHEMATIC * Schematic() const
Definition: sch_screen.cpp:92
const TITLE_BLOCK & GetTitleBlock() const override
PROJECT & Prj() const
Return a reference to the project this schematic is part of.
Definition: schematic.h:77
#define IU_PER_MILS
Definition: plotter.cpp:138
int m_NumberOfScreens
Definition: base_screen.h:80
PAGE_INFO & PageSettings()
Definition: plotter.h:150
virtual void SetPageSettings(const PAGE_INFO &aPageSettings)
Definition: plotter.h:149
bool GetColorMode() const
Definition: plotter.h:144

References BLACK, PS_PLOTTER::EndPlot(), FILLED_SHAPE, PLOTTER::GetColorMode(), SCH_SCREEN::GetFileName(), KIGFX::RENDER_SETTINGS::GetLayerColor(), getModeColor(), SCH_EDIT_FRAME::GetScreenDesc(), SCH_BASE_FRAME::GetTitleBlock(), IU_PER_MILS, LAYER_SCHEMATIC_BACKGROUND, LAYER_SCHEMATIC_WORKSHEET, BASE_SCREEN::m_NumberOfScreens, m_parent, DIALOG_PLOT_SCHEMATIC_BASE::m_plotBackgroundColor, BASE_SCREEN::m_ScreenNumber, PLOTTER::OpenFile(), PLOTTER::PageSettings(), SCH_SCREEN::Plot(), PlotWorkSheet(), SCHEMATIC::Prj(), PS_PLOTTER::Rect(), PLOTTER::RenderSettings(), SCH_SCREEN::Schematic(), PSLIKE_PLOTTER::SetColor(), PLOTTER::SetColorMode(), PLOTTER::SetCreator(), PLOTTER::SetPageSettings(), PLOTTER::SetRenderSettings(), PS_PLOTTER::SetViewport(), and PS_PLOTTER::StartPlot().

Referenced by createPSFile().

◆ plotOneSheetSVG()

bool DIALOG_PLOT_SCHEMATIC::plotOneSheetSVG ( const wxString &  aFileName,
SCH_SCREEN aScreen,
RENDER_SETTINGS aRenderSettings,
bool  aPlotBlackAndWhite,
bool  aPlotFrameRef 
)
private

Definition at line 102 of file plot_schematic_SVG.cpp.

107 {
108  const PAGE_INFO& pageInfo = aScreen->GetPageSettings();
109 
110  SVG_PLOTTER* plotter = new SVG_PLOTTER();
111  plotter->SetRenderSettings( aRenderSettings );
112  plotter->SetPageSettings( pageInfo );
113  plotter->SetColorMode( aPlotBlackAndWhite ? false : true );
114  wxPoint plot_offset;
115  double scale = 1.0;
116  // Currently, plot units are in decimil
117  plotter->SetViewport( plot_offset, IU_PER_MILS/10, scale, false );
118 
119  // Init :
120  plotter->SetCreator( wxT( "Eeschema-SVG" ) );
121 
122  if( ! plotter->OpenFile( aFileName ) )
123  {
124  delete plotter;
125  return false;
126  }
127 
128  LOCALE_IO toggle;
129 
130  plotter->StartPlot();
131 
132  if( m_plotBackgroundColor->GetValue() )
133  {
135  wxPoint end( plotter->PageSettings().GetWidthIU(),
136  plotter->PageSettings().GetHeightIU() );
137  plotter->Rect( wxPoint( 0, 0 ), end, FILLED_SHAPE, 1.0 );
138  }
139 
140  if( aPlotFrameRef )
141  {
142  PlotWorkSheet( plotter, &aScreen->Schematic()->Prj(), m_parent->GetTitleBlock(), pageInfo,
143  aScreen->m_ScreenNumber, aScreen->m_NumberOfScreens,
144  m_parent->GetScreenDesc(), aScreen->GetFileName(),
145  plotter->GetColorMode() ?
147  COLOR4D::BLACK );
148  }
149 
150  aScreen->Plot( plotter );
151 
152  plotter->EndPlot();
153  delete plotter;
154 
155  return true;
156 }
const wxString & GetFileName() const
Definition: sch_screen.h:185
int m_ScreenNumber
Definition: base_screen.h:79
virtual void SetCreator(const wxString &aCreator)
Definition: plotter.h:164
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Definition: common.h:216
virtual void SetViewport(const wxPoint &aOffset, double aIusPerDecimil, double aScale, bool aMirror) override
Set the plot offset and scaling for the current plot.
virtual bool OpenFile(const wxString &aFullFilename)
Open or create the plot file aFullFilename.
Definition: plotter.cpp:77
virtual void SetColorMode(bool aColorMode)
Plot in B/W or color.
Definition: plotter.h:143
void SetRenderSettings(RENDER_SETTINGS *aSettings)
Definition: plotter.h:146
const COLOR4D & GetLayerColor(int aLayer) const
Function GetLayerColor Returns the color used to draw a layer.
Definition: color4d.h:44
const PAGE_INFO & GetPageSettings() const
Definition: sch_screen.h:180
virtual void Rect(const wxPoint &p1, const wxPoint &p2, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH) override
wxString GetScreenDesc() const override
Return a human-readable description of the current screen.
virtual bool EndPlot() override
virtual void SetColor(COLOR4D color) override
The SetColor implementation is split with the subclasses: The PSLIKE computes the rgb values,...
void PlotWorkSheet(PLOTTER *plotter, const PROJECT *aProject, const TITLE_BLOCK &aTitleBlock, const PAGE_INFO &aPageInfo, int aSheetNumber, int aNumberOfSheets, const wxString &aSheetDesc, const wxString &aFilename, COLOR4D aColor)
PAGE_INFO describes the page size and margins of a paper page on which to eventually print or plot.
Definition: page_info.h:54
virtual bool StartPlot() override
The code within this function creates SVG files header.
void Plot(PLOTTER *aPlotter)
Plot all the schematic objects to aPlotter.
Definition: sch_screen.cpp:750
RENDER_SETTINGS * RenderSettings()
Definition: plotter.h:147
const int scale
SCHEMATIC * Schematic() const
Definition: sch_screen.cpp:92
const TITLE_BLOCK & GetTitleBlock() const override
PROJECT & Prj() const
Return a reference to the project this schematic is part of.
Definition: schematic.h:77
#define IU_PER_MILS
Definition: plotter.cpp:138
int m_NumberOfScreens
Definition: base_screen.h:80
PAGE_INFO & PageSettings()
Definition: plotter.h:150
virtual void SetPageSettings(const PAGE_INFO &aPageSettings)
Definition: plotter.h:149
bool GetColorMode() const
Definition: plotter.h:144

References BLACK, SVG_PLOTTER::EndPlot(), FILLED_SHAPE, PLOTTER::GetColorMode(), SCH_SCREEN::GetFileName(), KIGFX::RENDER_SETTINGS::GetLayerColor(), SCH_SCREEN::GetPageSettings(), SCH_EDIT_FRAME::GetScreenDesc(), SCH_BASE_FRAME::GetTitleBlock(), IU_PER_MILS, LAYER_SCHEMATIC_BACKGROUND, LAYER_SCHEMATIC_WORKSHEET, BASE_SCREEN::m_NumberOfScreens, m_parent, DIALOG_PLOT_SCHEMATIC_BASE::m_plotBackgroundColor, BASE_SCREEN::m_ScreenNumber, PLOTTER::OpenFile(), PLOTTER::PageSettings(), SCH_SCREEN::Plot(), PlotWorkSheet(), SCHEMATIC::Prj(), SVG_PLOTTER::Rect(), PLOTTER::RenderSettings(), scale, SCH_SCREEN::Schematic(), SVG_PLOTTER::SetColor(), PLOTTER::SetColorMode(), PLOTTER::SetCreator(), PLOTTER::SetPageSettings(), PLOTTER::SetRenderSettings(), SVG_PLOTTER::SetViewport(), and SVG_PLOTTER::StartPlot().

Referenced by createSVGFile().

◆ PlotSchematic()

void DIALOG_PLOT_SCHEMATIC::PlotSchematic ( bool  aPlotAll)
private

Definition at line 323 of file dialog_plot_schematic.cpp.

324 {
326 
327  getPlotOptions( &renderSettings );
328 
329  switch( GetPlotFileFormat() )
330  {
331  default:
332  case PLOT_FORMAT::POST:
333  createPSFile( aPlotAll, getPlotFrameRef(), &renderSettings );
334  break;
335  case PLOT_FORMAT::DXF:
336  CreateDXFFile( aPlotAll, getPlotFrameRef(), &renderSettings );
337  break;
338  case PLOT_FORMAT::PDF:
339  createPDFFile( aPlotAll, getPlotFrameRef(), &renderSettings );
340  break;
341  case PLOT_FORMAT::SVG:
342  createSVGFile( aPlotAll, getPlotFrameRef(), &renderSettings );
343  break;
344  case PLOT_FORMAT::HPGL:
345  createHPGLFile( aPlotAll, getPlotFrameRef(), &renderSettings );
346  break;
347  }
348 }
KIGFX::SCH_RENDER_SETTINGS * GetRenderSettings()
void CreateDXFFile(bool aPlotAll, bool aPlotFrameRef, RENDER_SETTINGS *aRenderSettings)
void getPlotOptions(RENDER_SETTINGS *aSettings)
void createSVGFile(bool aPlotAll, bool aPlotFrameRef, RENDER_SETTINGS *aSettings)
void createPSFile(bool aPlotAll, bool aPlotFrameRef, RENDER_SETTINGS *aSettings)
void createPDFFile(bool aPlotAll, bool aPlotFrameRef, RENDER_SETTINGS *aRenderSettings)
SCH_RENDER_SETTINGS Stores schematic-specific render settings.
Definition: sch_painter.h:70
void createHPGLFile(bool aPlotAll, bool aPlotFrameRef, RENDER_SETTINGS *aRenderSettings)

References CreateDXFFile(), createHPGLFile(), createPDFFile(), createPSFile(), createSVGFile(), DXF, GetPlotFileFormat(), getPlotFrameRef(), getPlotOptions(), SCH_BASE_FRAME::GetRenderSettings(), HPGL, m_parent, PDF, POST, and SVG.

Referenced by OnPlotAll(), and OnPlotCurrent().

◆ 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:172

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::buildEquivalenceList(), CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX(), DIALOG_FOOTPRINT_FP_EDITOR::Cfg3DPath(), DIALOG_FOOTPRINT_BOARD_EDITOR::Cfg3DPath(), KICAD_MANAGER_FRAME::CloseProject(), DIALOG_GEN_FOOTPRINT_POSITION::CreateGerberFiles(), PCB_BASE_EDIT_FRAME::CreateNewLibrary(), createPlotFileName(), DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable(), SCH_EDIT_FRAME::CreateScreens(), 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(), BACK_ANNOTATE::FetchNetlistFromPCB(), PCB_EDIT_FRAME::Files_io_from_id(), PCB_EDIT_FRAME::GenD356File(), DIALOG_GENDRILL::GenDrillAndMapFiles(), FOOTPRINT_VIEWER_FRAME::getCurFootprintName(), LIB_EDIT_FRAME::GetCurLib(), FOOTPRINT_VIEWER_FRAME::getCurNickname(), SCH_BASE_FRAME::GetLibPart(), DIALOG_SYMBOL_REMAP::getLibsNotInGlobalSymbolLibTable(), DISPLAY_FOOTPRINTS_FRAME::GetModule(), KICAD_MANAGER_FRAME::GetProjectFileName(), LIB_VIEW_FRAME::GetSelectedSymbol(), FP_THREAD_IFACE::GetTable(), PCB_EDIT_FRAME::importFile(), SCH_EDIT_FRAME::importFile(), SCH_EDITOR_CONTROL::ImportFPAssignments(), DIALOG_CONFIG_EQUFILES::Init(), FOOTPRINT_EDIT_FRAME::initLibraryTree(), SCH_EDIT_FRAME::KiwayMailIn(), 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::LoadProjectSettings(), 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(), PCB_BASE_EDIT_FRAME::OnCloseWindow(), SCH_EDIT_FRAME::OnCloseWindow(), DIALOG_GENDRILL::OnGenReportFile(), SCH_EDIT_FRAME::OnImportProject(), DIALOG_CHOOSE_COMPONENT::OnInitDialog(), DIALOG_CONFIG_EQUFILES::OnOkClick(), SCH_EDIT_FRAME::OnOpenCvpcb(), KICAD_MANAGER_FRAME::OnOpenFileInTextEditor(), DIALOG_NETLIST::OnOpenNetlistClick(), SCH_EDIT_FRAME::OnOpenPcbnew(), DIALOG_EXPORT_SVG::OnOutputDirectoryBrowseClicked(), DIALOG_PLOT::OnOutputDirectoryBrowseClicked(), 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(), PROPERTIES_FRAME::onScintillaCharAdded(), DIALOG_LABEL_EDITOR::onScintillaCharAdded(), DIALOG_SCH_EDIT_ONE_FIELD::onScintillaCharAdded(), 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(), DIALOG_PLOT::Plot(), Plot_1_Page_HPGL(), 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(), SCH_EDIT_TOOL::RefreshSymbolFromLibrary(), EDA_3D_VIEWER::ReloadRequest(), DIALOG_SYMBOL_REMAP::remapSymbolToLibTable(), SCH_EDITOR_CONTROL::RescueLegacyProject(), SCH_EDITOR_CONTROL::RescueSymbolLibTableProject(), FOOTPRINT_EDIT_FRAME::restoreLastFootprint(), FOOTPRINT_EDIT_FRAME::retainLastFootprint(), 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(), PCB_EDIT_FRAME::SavePcbFile(), SCH_EDIT_FRAME::SaveProject(), 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(), EE_INSPECTION_TOOL::ShowDatasheet(), DIALOG_CHOOSE_COMPONENT::ShowFootprintFor(), COMMON_CONTROL::ShowHelp(), LIB_VIEW_FRAME::ShowModal(), FOOTPRINT_VIEWER_FRAME::ShowModal(), SCH_EDIT_FRAME::ShowSchematicSetupDialog(), 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 SCH_EDIT_FRAME::~SCH_EDIT_FRAME().

◆ PrjConfigChanged()

bool DIALOG_PLOT_SCHEMATIC::PrjConfigChanged ( )
inline

Definition at line 62 of file dialog_plot_schematic.h.

62 { return m_configChanged; } // return true if the prj config was modified

References m_configChanged.

Referenced by SCH_EDITOR_CONTROL::Plot().

◆ 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 244 of file dialog_shim.cpp.

245 {
246  const char* hash_key;
247 
248  if( m_hash_key.size() )
249  {
250  // a special case like EDA_LIST_DIALOG, which has multiple uses.
251  hash_key = m_hash_key.c_str();
252  }
253  else
254  {
255  hash_key = typeid(*this).name();
256  }
257 
258  RECT_MAP::iterator it = class_map.find( hash_key );
259 
260  if( it == class_map.end() )
261  return;
262 
263  EDA_RECT rect = it->second;
264  rect.SetSize( 0, 0 );
265  class_map[ hash_key ] = rect;
266 }
std::string m_hash_key
Definition: dialog_shim.h:198
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().

◆ restoreEnvironment()

void DIALOG_PLOT_SCHEMATIC::restoreEnvironment ( PDF_PLOTTER aPlotter,
SCH_SHEET_PATH aOldsheetpath 
)
private

Everything done, close the plot and restore the environment.

Parameters
aPlotterthe plotter to close and destroy
aOldsheetpaththe stored old sheet path for the current sheet before the plot started

Definition at line 135 of file plot_schematic_PDF.cpp.

137 {
138  aPlotter->EndPlot();
139  delete aPlotter;
140 
141  // Restore the previous sheet
142  m_parent->SetCurrentSheet( aOldsheetpath );
145 }
void SetCurrentSheet(const SCH_SHEET_PATH &aSheet)
virtual bool EndPlot() override
void UpdateAllScreenReferences()
Function UpdateAllScreenReferences updates the reference and the m_Multi parameter (part selection) f...
void SetSheetNumberAndCount()
Set the m_ScreenNumber and m_NumberOfScreens members for screens.
SCH_SHEET_PATH & GetCurrentSheet() const

References PDF_PLOTTER::EndPlot(), SCH_EDIT_FRAME::GetCurrentSheet(), m_parent, SCH_EDIT_FRAME::SetCurrentSheet(), SCH_EDIT_FRAME::SetSheetNumberAndCount(), and SCH_SHEET_PATH::UpdateAllScreenReferences().

Referenced by createPDFFile().

◆ SetHPGLPenWidth()

void DIALOG_PLOT_SCHEMATIC::SetHPGLPenWidth ( )
private

Definition at line 78 of file plot_schematic_HPGL.cpp.

79 {
81 
82  if( m_HPGLPenSize > Millimeter2iu( 2 ) )
84 
85  if( m_HPGLPenSize < Millimeter2iu( 0.01 ) )
86  m_HPGLPenSize = Millimeter2iu( 0.01 );
87 }
virtual long long int GetValue()
Function GetValue Returns the current value in Internal Units.
static constexpr int Millimeter2iu(double mm)

References UNIT_BINDER::GetValue(), m_HPGLPenSize, m_penWidth, and Millimeter2iu().

Referenced by createHPGLFile().

◆ 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 114 of file dialog_shim.h.

115  {
116  m_initialFocusTarget = aWindow;
117  }
wxWindow * m_initialFocusTarget
Definition: dialog_shim.h:204

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_GRID_SETTINGS::DIALOG_GRID_SETTINGS(), DIALOG_IMPORT_GFX::DIALOG_IMPORT_GFX(), DIALOG_JUNCTION_PROPS::DIALOG_JUNCTION_PROPS(), 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_PAD_PRIMITIVES_PROPERTIES::DIALOG_PAD_PRIMITIVES_PROPERTIES(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), DIALOG_PIN_PROPERTIES::DIALOG_PIN_PROPERTIES(), DIALOG_POSITION_RELATIVE::DIALOG_POSITION_RELATIVE(), DIALOG_SCH_FIND::DIALOG_SCH_FIND(), 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_NON_COPPER_ZONES_EDITOR::TransferDataToWindow(), DIALOG_KEEPOUT_AREA_PROPERTIES::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(), PCB::IFACE::CreateWindow(), InvokePcbLibTableEditor(), PCB_CALCULATOR_FRAME::PCB_CALCULATOR_FRAME(), and SIM_PLOT_FRAME::SIM_PLOT_FRAME().

◆ setModeColor()

void DIALOG_PLOT_SCHEMATIC::setModeColor ( bool  aColor)
inlineprivate

Definition at line 79 of file dialog_plot_schematic.h.

80  { m_ModeColorOption->SetSelection( aColor ? 0 : 1 ); }

References DIALOG_PLOT_SCHEMATIC_BASE::m_ModeColorOption.

Referenced by initDlg().

◆ setPlotFrameRef()

void DIALOG_PLOT_SCHEMATIC::setPlotFrameRef ( bool  aPlot)
inlineprivate

Definition at line 92 of file dialog_plot_schematic.h.

92 {m_PlotFrameRefOpt->SetValue( aPlot ); }

References DIALOG_PLOT_SCHEMATIC_BASE::m_PlotFrameRefOpt.

Referenced by initDlg().

◆ SetPlotOriginCenter()

void DIALOG_PLOT_SCHEMATIC::SetPlotOriginCenter ( bool  aCenter)
inlineprivate

Definition at line 120 of file dialog_plot_schematic.h.

121  {
122  m_plotOriginOpt->SetSelection( aCenter ? 1 : 0 );
123  }

References DIALOG_PLOT_SCHEMATIC_BASE::m_plotOriginOpt.

Referenced by initDlg().

◆ 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 158 of file dialog_shim.cpp.

159 {
160  wxSize sz( x, y );
161  SetSize( ConvertDialogToPixels( sz ) );
162 }

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

◆ setupPlotPagePDF()

void DIALOG_PLOT_SCHEMATIC::setupPlotPagePDF ( PLOTTER aPlotter,
SCH_SCREEN aScreen 
)
private

Definition at line 175 of file plot_schematic_PDF.cpp.

176 {
177  PAGE_INFO plotPage; // page size selected to plot
178  // Considerations on page size and scaling requests
179  const PAGE_INFO& actualPage = aScreen->GetPageSettings(); // page size selected in schematic
180 
181  switch( m_pageSizeSelect )
182  {
183  case PAGE_SIZE_A:
184  plotPage.SetType( wxT( "A" ) );
185  plotPage.SetPortrait( actualPage.IsPortrait() );
186  break;
187 
188  case PAGE_SIZE_A4:
189  plotPage.SetType( wxT( "A4" ) );
190  plotPage.SetPortrait( actualPage.IsPortrait() );
191  break;
192 
193  case PAGE_SIZE_AUTO:
194  default:
195  plotPage = actualPage;
196  break;
197  }
198 
199  double scalex = (double) plotPage.GetWidthMils() / actualPage.GetWidthMils();
200  double scaley = (double) plotPage.GetHeightMils() / actualPage.GetHeightMils();
201  double scale = std::min( scalex, scaley );
202  aPlotter->SetPageSettings( plotPage );
203  // Currently, plot units are in decimil
204  aPlotter->SetViewport( wxPoint( 0, 0 ), IU_PER_MILS/10, scale, false );
205 }
int GetHeightMils() const
Definition: page_info.h:141
bool SetType(const wxString &aStandardPageDescriptionName, bool aIsPortrait=false)
Function SetType sets the name of the page type and also the sizes and margins commonly associated wi...
Definition: page_info.cpp:119
const PAGE_INFO & GetPageSettings() const
Definition: sch_screen.h:180
PAGE_INFO describes the page size and margins of a paper page on which to eventually print or plot.
Definition: page_info.h:54
virtual void SetViewport(const wxPoint &aOffset, double aIusPerDecimil, double aScale, bool aMirror)=0
Set the plot offset and scaling for the current plot.
const int scale
bool IsPortrait() const
Definition: page_info.h:122
#define IU_PER_MILS
Definition: plotter.cpp:138
void SetPortrait(bool aIsPortrait)
Function SetPortrait will rotate the paper page 90 degrees.
Definition: page_info.cpp:186
int GetWidthMils() const
Definition: page_info.h:138
virtual void SetPageSettings(const PAGE_INFO &aPageSettings)
Definition: plotter.h:149

References PAGE_INFO::GetHeightMils(), SCH_SCREEN::GetPageSettings(), PAGE_INFO::GetWidthMils(), PAGE_INFO::IsPortrait(), IU_PER_MILS, m_pageSizeSelect, PAGE_SIZE_A, PAGE_SIZE_A4, PAGE_SIZE_AUTO, scale, PLOTTER::SetPageSettings(), PAGE_INFO::SetPortrait(), PAGE_INFO::SetType(), and PLOTTER::SetViewport().

Referenced by createPDFFile().

◆ Show()

bool DIALOG_SHIM::Show ( bool  show)
overrideinherited

Definition at line 185 of file dialog_shim.cpp.

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

346 {
347  // This is an exception safe way to zero a pointer before returning.
348  // Yes, even though DismissModal() clears this first normally, this is
349  // here in case there's an exception before the dialog is dismissed.
350  struct NULLER
351  {
352  void*& m_what;
353  NULLER( void*& aPtr ) : m_what( aPtr ) {}
354  ~NULLER() { m_what = 0; } // indeed, set it to NULL on destruction
355  } clear_this( (void*&) m_qmodal_loop );
356 
357  // release the mouse if it's currently captured as the window having it
358  // will be disabled when this dialog is shown -- but will still keep the
359  // capture making it impossible to do anything in the modal dialog itself
360  wxWindow* win = wxWindow::GetCapture();
361  if( win )
362  win->ReleaseMouse();
363 
364  // Get the optimal parent
365  wxWindow* parent = GetParentForModalDialog( GetParent(), GetWindowStyle() );
366 
367  // Show the optimal parent
368  DBG( if( parent ) printf( "%s: optimal parent: %s\n", __func__, typeid(*parent).name() );)
369 
370  wxASSERT_MSG( !m_qmodal_parent_disabler,
371  wxT( "Caller using ShowQuasiModal() twice on same window?" ) );
372 
373  // quasi-modal: disable only my "optimal" parent
375 
376 
377  // Apple in its infinite wisdom will raise a disabled window before even passing
378  // us the event, so we have no way to stop it. Instead, we must set an order on
379  // the windows so that the quasi-modal will be pushed in front of the disabled
380  // window when it is raised.
382 
383  Show( true );
384 
385  m_qmodal_showing = true;
386 
387  WX_EVENT_LOOP event_loop;
388 
389  m_qmodal_loop = &event_loop;
390 
391  event_loop.Run();
392 
393  m_qmodal_showing = false;
394 
395  return GetReturnCode();
396 }
bool m_qmodal_showing
Definition: dialog_shim.h:208
#define WX_EVENT_LOOP
Definition: kiway_player.h:41
WX_EVENT_LOOP * m_qmodal_loop
Definition: dialog_shim.h:206
bool Show(bool show) override
WDO_ENABLE_DISABLE * m_qmodal_parent_disabler
Definition: dialog_shim.h:209
Toggle a window's "enable" status to disabled, then enabled on destruction.
Definition: dialog_shim.cpp:40
#define DBG(x)
Definition: fctsys.h:33
void ReparentQuasiModal(wxNonOwnedWindow *aWindow)
Move a window's parent to be the top-level window and force the window to be on top.
Definition: gtk/ui.cpp:32

References DBG, DIALOG_SHIM::m_qmodal_loop, DIALOG_SHIM::m_qmodal_parent_disabler, DIALOG_SHIM::m_qmodal_showing, KIPLATFORM::UI::ReparentQuasiModal(), 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 172 of file dialog_shim.cpp.

173 {
174  wxSize sz( 0, y );
175  return ConvertDialogToPixels( sz ).y;
176 }

Referenced by DIALOG_CHOOSE_COMPONENT::DIALOG_CHOOSE_COMPONENT().

Member Data Documentation

◆ m_browseButton

wxBitmapButton* DIALOG_PLOT_SCHEMATIC_BASE::m_browseButton
protectedinherited

◆ m_colorTheme

wxChoice* DIALOG_PLOT_SCHEMATIC_BASE::m_colorTheme
protectedinherited

◆ m_configChanged

bool DIALOG_PLOT_SCHEMATIC::m_configChanged
private

Definition at line 49 of file dialog_plot_schematic.h.

Referenced by DIALOG_PLOT_SCHEMATIC(), getPlotOptions(), and PrjConfigChanged().

◆ m_defaultLineWidth

UNIT_BINDER DIALOG_PLOT_SCHEMATIC::m_defaultLineWidth
private

Definition at line 55 of file dialog_plot_schematic.h.

Referenced by getPlotOptions(), initDlg(), and OnUpdateUI().

◆ m_firstPaintEvent

bool DIALOG_SHIM::m_firstPaintEvent
protectedinherited

Definition at line 203 of file dialog_shim.h.

Referenced by DIALOG_SHIM::OnPaint().

◆ m_hash_key

◆ m_HPGLOptionsSizer

wxStaticBoxSizer* DIALOG_PLOT_SCHEMATIC_BASE::m_HPGLOptionsSizer
protectedinherited

◆ m_HPGLPaperSizeSelect

int DIALOG_PLOT_SCHEMATIC::m_HPGLPaperSizeSelect = PAGE_SIZE_AUTO
staticprivate

Definition at line 52 of file dialog_plot_schematic.h.

Referenced by getPlotOptions(), initDlg(), OnPageSizeSelected(), and OnUpdateUI().

◆ m_HPGLPenSize

double DIALOG_PLOT_SCHEMATIC::m_HPGLPenSize
private

Definition at line 53 of file dialog_plot_schematic.h.

Referenced by getPlotOptions(), initDlg(), Plot_1_Page_HPGL(), and SetHPGLPenWidth().

◆ m_initialFocusTarget

wxWindow* DIALOG_SHIM::m_initialFocusTarget
protectedinherited

Definition at line 204 of file dialog_shim.h.

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

◆ m_lineWidthCtrl

wxTextCtrl* DIALOG_PLOT_SCHEMATIC_BASE::m_lineWidthCtrl
protectedinherited

◆ m_lineWidthLabel

wxStaticText* DIALOG_PLOT_SCHEMATIC_BASE::m_lineWidthLabel
protectedinherited

◆ m_lineWidthUnits

wxStaticText* DIALOG_PLOT_SCHEMATIC_BASE::m_lineWidthUnits
protectedinherited

◆ m_MessagesBox

WX_HTML_REPORT_PANEL* DIALOG_PLOT_SCHEMATIC_BASE::m_MessagesBox
protectedinherited

◆ m_ModeColorOption

wxChoice* DIALOG_PLOT_SCHEMATIC_BASE::m_ModeColorOption
protectedinherited

◆ m_optionsSizer

wxBoxSizer* DIALOG_PLOT_SCHEMATIC_BASE::m_optionsSizer
protectedinherited

◆ m_outputDirectoryName

wxTextCtrl* DIALOG_PLOT_SCHEMATIC_BASE::m_outputDirectoryName
protectedinherited

◆ m_pageSizeSelect

int DIALOG_PLOT_SCHEMATIC::m_pageSizeSelect = PAGE_SIZE_AUTO
staticprivate

◆ m_paperSizeOption

wxChoice* DIALOG_PLOT_SCHEMATIC_BASE::m_paperSizeOption
protectedinherited

◆ m_parent

◆ m_parentFrame

EDA_BASE_FRAME* DIALOG_SHIM::m_parentFrame
protectedinherited

Definition at line 211 of file dialog_shim.h.

Referenced by DIALOG_SHIM::OnCharHook().

◆ m_penWidth

UNIT_BINDER DIALOG_PLOT_SCHEMATIC::m_penWidth
private

Definition at line 56 of file dialog_plot_schematic.h.

Referenced by getPlotOptions(), initDlg(), OnUpdateUI(), and SetHPGLPenWidth().

◆ m_penWidthCtrl

wxTextCtrl* DIALOG_PLOT_SCHEMATIC_BASE::m_penWidthCtrl
protectedinherited

◆ m_penWidthLabel

wxStaticText* DIALOG_PLOT_SCHEMATIC_BASE::m_penWidthLabel
protectedinherited

◆ m_penWidthUnits

wxStaticText* DIALOG_PLOT_SCHEMATIC_BASE::m_penWidthUnits
protectedinherited

◆ m_plotBackgroundColor

wxCheckBox* DIALOG_PLOT_SCHEMATIC_BASE::m_plotBackgroundColor
protectedinherited

◆ m_plotFormat

PLOT_FORMAT DIALOG_PLOT_SCHEMATIC::m_plotFormat
private

Definition at line 50 of file dialog_plot_schematic.h.

Referenced by OnUpdateUI().

◆ m_plotFormatOpt

wxRadioBox* DIALOG_PLOT_SCHEMATIC_BASE::m_plotFormatOpt
protectedinherited

◆ m_PlotFrameRefOpt

wxCheckBox* DIALOG_PLOT_SCHEMATIC_BASE::m_PlotFrameRefOpt
protectedinherited

◆ m_plotOriginOpt

wxChoice* DIALOG_PLOT_SCHEMATIC_BASE::m_plotOriginOpt
protectedinherited

◆ m_plotOriginTitle

wxStaticText* DIALOG_PLOT_SCHEMATIC_BASE::m_plotOriginTitle
protectedinherited

◆ m_qmodal_loop

WX_EVENT_LOOP* DIALOG_SHIM::m_qmodal_loop
protectedinherited

Definition at line 206 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 208 of file dialog_shim.h.

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

◆ m_sdbSizer1

wxStdDialogButtonSizer* DIALOG_PLOT_SCHEMATIC_BASE::m_sdbSizer1
protectedinherited

◆ m_sdbSizer1Apply

wxButton* DIALOG_PLOT_SCHEMATIC_BASE::m_sdbSizer1Apply
protectedinherited

◆ m_sdbSizer1Cancel

wxButton* DIALOG_PLOT_SCHEMATIC_BASE::m_sdbSizer1Cancel
protectedinherited

◆ m_sdbSizer1OK

wxButton* DIALOG_PLOT_SCHEMATIC_BASE::m_sdbSizer1OK
protectedinherited

◆ m_staticText4

wxStaticText* DIALOG_PLOT_SCHEMATIC_BASE::m_staticText4
protectedinherited

◆ m_staticText9

wxStaticText* DIALOG_PLOT_SCHEMATIC_BASE::m_staticText9
protectedinherited

◆ m_staticTextOutputDirectory

wxStaticText* DIALOG_PLOT_SCHEMATIC_BASE::m_staticTextOutputDirectory
protectedinherited

◆ m_tabOrder

◆ m_units


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