KiCad PCB EDA Suite
dialog_print_using_printer.cpp
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 2015-2019 KiCad Developers, see CHANGELOG.TXT for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
25 #include <fctsys.h>
26 #include <pgm_base.h>
27 #include <gr_basic.h>
28 #include <confirm.h>
29 #include <sch_screen.h>
30 #include <sch_edit_frame.h>
31 #include <base_units.h>
32 #include <general.h>
35 #include <sch_sheet.h>
36 #include <schematic.h>
37 #include <sch_sheet_path.h>
39 #include <sch_painter.h>
40 
42 {
43 public:
45  ~DIALOG_PRINT_USING_PRINTER() override;
46 
47 protected:
48  void OnMonochromeChecked( wxCommandEvent& event ) override;
49  void OnUseColorThemeChecked( wxCommandEvent& event ) override;
50 
51 private:
52  bool TransferDataToWindow() override;
53  bool TransferDataFromWindow() override;
54 
55  void OnPageSetup( wxCommandEvent& event ) override;
56  void OnPrintPreview( wxCommandEvent& event ) override;
57 
58  void SavePrintOptions();
59 
61 };
62 
63 
64 
68 class SCH_PRINTOUT : public wxPrintout
69 {
70 private:
72 
73 public:
74  SCH_PRINTOUT( SCH_EDIT_FRAME* aParent, const wxString& aTitle ) :
75  wxPrintout( aTitle )
76  {
77  wxASSERT( aParent != NULL );
78  m_parent = aParent;
79  }
80 
81  bool OnPrintPage( int page ) override;
82  bool HasPage( int page ) override;
83  bool OnBeginDocument( int startPage, int endPage ) override;
84  void GetPageInfo( int* minPage, int* maxPage, int* selPageFrom, int* selPageTo ) override;
85  void PrintPage( SCH_SCREEN* aScreen );
86 };
87 
88 
93 class SCH_PREVIEW_FRAME : public wxPreviewFrame
94 {
95 public:
96  SCH_PREVIEW_FRAME( wxPrintPreview* aPreview, wxWindow* aParent,
97  const wxString& aTitle, const wxPoint& aPos = wxDefaultPosition,
98  const wxSize& aSize = wxDefaultSize ) :
99  wxPreviewFrame( aPreview, aParent, aTitle, aPos, aSize )
100  {
101  }
102 
103  bool Show( bool show ) override
104  {
105  bool ret;
106 
107  // Show or hide the window. If hiding, save current position and size.
108  // If showing, use previous position and size.
109  if( show )
110  {
111  ret = wxPreviewFrame::Show( show );
112 
113  if( s_size.x != 0 && s_size.y != 0 )
114  SetSize( s_pos.x, s_pos.y, s_size.x, s_size.y, 0 );
115  }
116  else
117  {
118  // Save the dialog's position & size before hiding
119  s_size = GetSize();
120  s_pos = GetPosition();
121 
122  ret = wxPreviewFrame::Show( show );
123  }
124 
125  return ret;
126  }
127 
128 private:
129  static wxPoint s_pos;
130  static wxSize s_size;
131 };
132 
133 
136 
137 
140  m_parent( aParent )
141 {
142  wxASSERT( aParent );
143 
144  // We use a sdbSizer to get platform-dependent ordering of the action buttons, but
145  // that requires us to correct the button labels here.
146  m_sdbSizer1OK->SetLabel( _( "Print" ) );
147  m_sdbSizer1Apply->SetLabel( _( "Preview" ) );
148  m_sdbSizer1Cancel->SetLabel( _( "Close" ) );
149  m_sdbSizer1->Layout();
150 
151 #ifdef __WXMAC__
152  // Problems with modal on wx-2.9 - Anyway preview is standard for OSX
153  m_sdbSizer1Apply->Hide();
154 #endif
155 
156  m_sdbSizer1OK->SetDefault(); // on linux, this is inadequate to determine
157  // what ENTER does. Must also SetFocus().
158  m_sdbSizer1OK->SetFocus();
159 
161 }
162 
163 
165 {
167 }
168 
169 
171 {
173 
174  m_checkReference->SetValue( cfg->m_Printing.title_block );
175  m_checkMonochrome->SetValue( cfg->m_Printing.monochrome );
176  m_checkBackgroundColor->SetValue( cfg->m_Printing.background );
177  m_checkUseColorTheme->SetValue( cfg->m_Printing.use_theme );
178 
179  m_colorTheme->Clear();
180 
181  int width = 0;
182  int height = 0;
183  int minwidth = width;
184 
185  wxString target = cfg->m_Printing.use_theme ? cfg->m_Printing.color_theme : cfg->m_ColorTheme;
186 
187  for( COLOR_SETTINGS* settings : Pgm().GetSettingsManager().GetColorSettingsList() )
188  {
189  int pos = m_colorTheme->Append( settings->GetName(), static_cast<void*>( settings ) );
190 
191  if( settings->GetFilename() == target )
192  m_colorTheme->SetSelection( pos );
193 
194  m_colorTheme->GetTextExtent( settings->GetName(), &width, &height );
195  minwidth = std::max( minwidth, width );
196  }
197 
198  m_colorTheme->SetMinSize( wxSize( minwidth + 50, -1 ) );
199 
200  m_lblTheme->Enable( cfg->m_Printing.use_theme );
201  m_colorTheme->Enable( cfg->m_Printing.use_theme );
202 
203  // Initialize page specific print setup dialog settings.
204  const PAGE_INFO& pageInfo = m_parent->GetScreen()->GetPageSettings();
205  wxPageSetupDialogData& pageSetupDialogData = m_parent->GetPageSetupData();
206 
207  pageSetupDialogData.SetPaperId( pageInfo.GetPaperId() );
208 
209  if( pageInfo.IsCustom() )
210  {
211  if( pageInfo.IsPortrait() )
212  pageSetupDialogData.SetPaperSize( wxSize( Mils2mm( pageInfo.GetWidthMils() ),
213  Mils2mm( pageInfo.GetHeightMils() ) ) );
214  else
215  pageSetupDialogData.SetPaperSize( wxSize( Mils2mm( pageInfo.GetHeightMils() ),
216  Mils2mm( pageInfo.GetWidthMils() ) ) );
217  }
218 
219  pageSetupDialogData.GetPrintData().SetOrientation( pageInfo.GetWxOrientation() );
220 
221  Layout();
222 
223  return true;
224 }
225 
226 
228 {
229  m_lblTheme->Enable( m_checkUseColorTheme->GetValue() );
230  m_colorTheme->Enable( m_checkUseColorTheme->GetValue() );
231 }
232 
233 
235 {
236  m_checkBackgroundColor->Enable( !m_checkMonochrome->GetValue() );
237 
238  if( m_checkMonochrome->GetValue() )
239  m_checkBackgroundColor->SetValue( false );
240  else
242 }
243 
244 
246 {
248 
249  cfg->m_Printing.monochrome = m_checkMonochrome->IsChecked();
250  cfg->m_Printing.title_block = m_checkReference->IsChecked();
251  cfg->m_Printing.background = m_checkBackgroundColor->IsChecked();
252  cfg->m_Printing.use_theme = m_checkUseColorTheme->IsChecked();
253 
254  COLOR_SETTINGS* theme = static_cast<COLOR_SETTINGS*>(
255  m_colorTheme->GetClientData( m_colorTheme->GetSelection() ) );
256 
257  if( theme && m_checkUseColorTheme->IsChecked() )
258  cfg->m_Printing.color_theme = theme->GetFilename();
259 }
260 
261 
262 /* Open a dialog box for printer setup (printer options, page size ...)
263  */
264 void DIALOG_PRINT_USING_PRINTER::OnPageSetup( wxCommandEvent& event )
265 {
266  wxPageSetupDialog pageSetupDialog( this, &m_parent->GetPageSetupData() );
267  pageSetupDialog.ShowModal();
268 
269  m_parent->GetPageSetupData() = pageSetupDialog.GetPageSetupDialogData();
270 }
271 
272 
273 /* Open and display a previewer frame for printing
274  */
275 void DIALOG_PRINT_USING_PRINTER::OnPrintPreview( wxCommandEvent& event )
276 {
278 
279  // Pass two printout objects: for preview, and possible printing.
280  wxString title = _( "Preview" );
281  wxPrintPreview* preview = new wxPrintPreview( new SCH_PRINTOUT( m_parent, title ),
282  new SCH_PRINTOUT( m_parent, title ),
283  &m_parent->GetPageSetupData().GetPrintData() );
284 
285  preview->SetZoom( 100 );
286 
287  SCH_PREVIEW_FRAME* frame = new SCH_PREVIEW_FRAME( preview, this, title );
288  frame->SetMinSize( wxSize( 550, 350 ) );
289 
290  // on first invocation in this runtime session, set to 2/3 size of my parent,
291  // but will be changed in Show() if not first time as will position.
292  frame->SetSize( (m_parent->GetSize() * 2) / 3 );
293  frame->Center();
294 
295  // On wxGTK, set the flag wxTOPLEVEL_EX_DIALOG is mandatory, if we want
296  // close the frame using the X box in caption, when the preview frame is run
297  // from a dialog
298  frame->SetExtraStyle( frame->GetExtraStyle() | wxTOPLEVEL_EX_DIALOG );
299 
300  // We use here wxPreviewFrame_WindowModal option to make the wxPrintPreview frame
301  // modal for its caller only.
302  // another reason is the fact when closing the frame without this option,
303  // all top level frames are reenabled.
304  // With this option, only the parent is reenabled.
305  // Reenabling all top level frames should be made by the parent dialog.
306  frame->InitializeWithModality( wxPreviewFrame_WindowModal );
307 
308  frame->Raise(); // Needed on Ubuntu/Unity to display the frame
309  frame->Show( true );
310 }
311 
312 
314 {
315  if( Pgm().m_Printing )
316  {
317  DisplayError( this, _( "Previous print job not yet complete." ) );
318  return false;
319  }
320 
322 
323  int sheet_count = m_parent->Schematic().Root().CountSheets();
324 
325  wxPrintDialogData printDialogData( m_parent->GetPageSetupData().GetPrintData() );
326  printDialogData.SetMaxPage( sheet_count );
327 
328  if( sheet_count > 1 )
329  printDialogData.EnablePageNumbers( true );
330 
331  wxPrinter printer( &printDialogData );
332  SCH_PRINTOUT printout( m_parent, _( "Print Schematic" ) );
333 
334  Pgm().m_Printing = true;
335  {
336  if( !printer.Print( this, &printout, true ) )
337  {
338  if( wxPrinter::GetLastError() == wxPRINTER_ERROR )
339  DisplayError( this, _( "An error occurred attempting to print the schematic." ) );
340  }
341  else
342  {
343  m_parent->GetPageSetupData() = printer.GetPrintDialogData().GetPrintData();
344  }
345  }
346  Pgm().m_Printing = false;
347 
348  return true;
349 }
350 
351 
353 {
354  SCH_SHEET_LIST sheetList = m_parent->Schematic().GetSheets();
355 
356  wxCHECK_MSG( page >= 1 && page <= (int)sheetList.size(), false,
357  wxT( "Cannot print invalid page number." ) );
358 
359  wxCHECK_MSG( sheetList[ page - 1].LastScreen() != NULL, false,
360  wxT( "Cannot print page with NULL screen." ) );
361 
362  wxString msg;
363  msg.Printf( _( "Print page %d" ), page );
365  m_parent->AppendMsgPanel( msg, wxEmptyString, CYAN );
366 
367  SCH_SCREEN* screen = m_parent->GetScreen();
368  SCH_SHEET_PATH oldsheetpath = m_parent->GetCurrentSheet();
369  m_parent->SetCurrentSheet( sheetList[ page - 1 ] );
372  screen = m_parent->GetCurrentSheet().LastScreen();
373  PrintPage( screen );
374  m_parent->SetCurrentSheet( oldsheetpath );
377 
378  return true;
379 }
380 
381 
382 void SCH_PRINTOUT::GetPageInfo( int* minPage, int* maxPage, int* selPageFrom, int* selPageTo )
383 {
384  *minPage = *selPageFrom = 1;
385  *maxPage = *selPageTo = m_parent->Schematic().Root().CountSheets();
386 }
387 
388 
389 bool SCH_PRINTOUT::HasPage( int pageNum )
390 {
391  return m_parent->Schematic().Root().CountSheets() >= pageNum;
392 }
393 
394 
395 bool SCH_PRINTOUT::OnBeginDocument( int startPage, int endPage )
396 {
397  if( !wxPrintout::OnBeginDocument( startPage, endPage ) )
398  return false;
399 
400 #ifdef DEBUG
402 
403  wxLogDebug( wxT( "Printer name: " ) +
404  m_parent->GetPageSetupData().GetPrintData().GetPrinterName() );
405  wxLogDebug( wxT( "Paper ID: %d" ),
406  m_parent->GetPageSetupData().GetPrintData().GetPaperId() );
407  wxLogDebug( wxT( "Color: %d" ),
408  (int)m_parent->GetPageSetupData().GetPrintData().GetColour() );
409  wxLogDebug( wxT( "Monochrome: %d" ), cfg->m_Printing.monochrome );
410  wxLogDebug( wxT( "Orientation: %d:" ),
411  m_parent->GetPageSetupData().GetPrintData().GetOrientation() );
412  wxLogDebug( wxT( "Quality: %d"),
413  m_parent->GetPageSetupData().GetPrintData().GetQuality() );
414 #endif
415 
416  return true;
417 }
418 
419 
420 /*
421  * This is the real print function: print the active screen
422  */
424 {
425  wxPoint tmp_startvisu;
426  wxSize pageSizeIU; // Page size in internal units
427  wxPoint old_org;
428  wxRect fitRect;
429  wxDC* dc = GetDC();
430 
431  wxBusyCursor dummy;
432 
433  // Save current offsets and clip box.
434  tmp_startvisu = aScreen->m_StartVisu;
435  old_org = aScreen->m_DrawOrg;
436 
437  SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
440 
441  // Change scale factor and offset to print the whole page.
442  bool printReference = cfg->m_Printing.title_block;
443 
444  pageSizeIU = aScreen->GetPageSettings().GetSizeIU();
445  FitThisSizeToPaper( pageSizeIU );
446 
447  fitRect = GetLogicalPaperRect();
448 
449  wxLogDebug( wxT( "Fit rectangle: x = %d, y = %d, w = %d, h = %d" ),
450  fitRect.x, fitRect.y, fitRect.width, fitRect.height );
451 
452  // When is the actual paper size does not match the schematic page size, the drawing will
453  // not be centered on X or Y axis. Give a draw offset to center the schematic page on the
454  // paper draw area.
455  int xoffset = ( fitRect.width - pageSizeIU.x ) / 2;
456  int yoffset = ( fitRect.height - pageSizeIU.y ) / 2;
457 
458  if( dc->CanUseTransformMatrix() )
459  {
460  wxAffineMatrix2D matrix = dc->GetTransformMatrix();
461 
462  // Check for portrait/landscape mismatch:
463  if( ( fitRect.width > fitRect.height ) != ( pageSizeIU.x > pageSizeIU.y ) )
464  {
465  matrix.Rotate( M_PI_2 );
466  xoffset = ( fitRect.height - pageSizeIU.x ) / 2;
467  yoffset = ( fitRect.width - pageSizeIU.y ) / 2;
468  }
469 
470  matrix.Translate( xoffset, yoffset );
471  dc->SetTransformMatrix( matrix );
472  }
473  else
474  {
475  // wxWidgets appears to have a bug when OffsetLogicalOrigin()'s yoffset changes from
476  // page to page.
477  // NB: this is a workaround, not a fix. The Y centering will be off, but this is less
478  // annoying than a blank page. See https://bugs.launchpad.net/kicad/+bug/1464773.
479  yoffset = 0;
480 
481  OffsetLogicalOrigin( xoffset, yoffset );
482  }
483 
484  dc->SetLogicalFunction( wxCOPY );
485  GRResetPenAndBrush( dc );
486 
487  COLOR4D savedBgColor = m_parent->GetDrawBgColor();
489 
490  if( cfg->m_Printing.background )
491  {
492  if( cfg->m_Printing.use_theme && theme )
493  bgColor = theme->GetColor( LAYER_SCHEMATIC_BACKGROUND );
494  }
495  else
496  {
497  bgColor = COLOR4D::WHITE;
498  }
499 
500  m_parent->SetDrawBgColor( bgColor );
501 
502  GRSFilledRect( nullptr, dc, fitRect.GetX(), fitRect.GetY(), fitRect.GetRight(),
503  fitRect.GetBottom(), 0, bgColor, bgColor );
504 
505  if( cfg->m_Printing.monochrome )
506  GRForceBlackPen( true );
507 
509  renderSettings.SetPrintDC( dc );
510 
511  if( cfg->m_Printing.use_theme && theme )
512  renderSettings.LoadColors( theme );
513 
514  // The worksheet item print code is shared between PCBNew and EESchema, so it's easier
515  // if they just use the PCB layer.
516  renderSettings.SetLayerColor( LAYER_WORKSHEET,
517  renderSettings.GetLayerColor( LAYER_SCHEMATIC_WORKSHEET ) );
518 
519  if( printReference )
520  {
521  m_parent->PrintWorkSheet( &renderSettings, aScreen, IU_PER_MILS, aScreen->GetFileName(),
522  wxEmptyString );
523  }
524 
525  aScreen->Print( &renderSettings );
526 
527  m_parent->SetDrawBgColor( savedBgColor );
528 
529  GRForceBlackPen( false );
530 
531  aScreen->m_StartVisu = tmp_startvisu;
532  aScreen->m_DrawOrg = old_org;
533 }
534 
535 
537 {
538  DIALOG_PRINT_USING_PRINTER dlg( aCaller );
539 
540  return dlg.ShowModal();
541 }
void SetCurrentSheet(const SCH_SHEET_PATH &aSheet)
void OnMonochromeChecked(wxCommandEvent &event) override
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:239
SCH_SHEET_LIST.
void GRResetPenAndBrush(wxDC *DC)
Definition: gr_basic.cpp:120
const wxString & GetFileName() const
Definition: sch_screen.h:189
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:104
wxPrintOrientation GetWxOrientation() const
Function GetWxOrientation.
Definition: page_info.h:127
SCH_SHEET_LIST GetSheets() const
Builds and returns an updated schematic hierarchy TODO: can this be cached?
Definition: schematic.h:92
void GRSFilledRect(EDA_RECT *aClipBox, wxDC *aDC, int x1, int y1, int x2, int y2, int aWidth, COLOR4D aColor, COLOR4D aBgColor)
Definition: gr_basic.cpp:919
Implementation of conversion functions that require both schematic and board internal units.
This file is part of the common library.
int GetHeightMils() const
Definition: page_info.h:140
#define M_PI_2
Definition: transline.cpp:36
void FinishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
virtual void SetDrawBgColor(COLOR4D aColor)
void PrintWorkSheet(RENDER_SETTINGS *aSettings, BASE_SCREEN *aScreen, double aScale, const wxString &aFilename, const wxString &aSheetLayer=wxEmptyString)
Prints the page layout with the frame and the basic inscriptions.
wxString color_theme
Color theme to use for printing.
Definition: app_settings.h:121
bool title_block
Whether or not to print title block.
Definition: app_settings.h:122
KIGFX::SCH_RENDER_SETTINGS * GetRenderSettings()
Schematic editor (Eeschema) main window.
COLOR_SETTINGS * GetColorSettings() override
Returns a pointer to the active color theme settings.
SCH_PREVIEW_FRAME(wxPrintPreview *aPreview, wxWindow *aParent, const wxString &aTitle, const wxPoint &aPos=wxDefaultPosition, const wxSize &aSize=wxDefaultSize)
bool use_theme
If false, display color theme will be used.
Definition: app_settings.h:120
bool IsCustom() const
Function IsCustom returns true if the type is Custom.
Definition: page_info.cpp:176
void GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, int *selPageTo) override
void UpdateAllScreenReferences()
Function UpdateAllScreenReferences updates the reference and the m_Multi parameter (part selection) f...
const PAGE_INFO & GetPageSettings() const
Definition: sch_screen.h:184
bool monochrome
Whether or not to print in monochrome.
Definition: app_settings.h:118
wxPaperSize GetPaperId() const
Function GetPaperId.
Definition: page_info.h:134
EESCHEMA_SETTINGS * eeconfig() const
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
SCH_EDIT_FRAME * m_parent
wxPoint m_StartVisu
Coordinates in drawing units of the current view position (upper left corner of device)
Definition: base_screen.h:67
void PrintPage(SCH_SCREEN *aScreen)
Custom print out for printing schematics.
int InvokeDialogPrintUsingPrinter(SCH_EDIT_FRAME *aCaller)
Create and show DIALOG_PRINT_USING_PRINTER and return whatever DIALOG_PRINT_USING_PRINTER::ShowModal(...
#define NULL
void GRForceBlackPen(bool flagforce)
Function GRForceBlackPen.
Definition: gr_basic.cpp:201
PAGE_INFO describes the page size and margins of a paper page on which to eventually print or plot.
Definition: page_info.h:54
bool OnPrintPage(int page) override
int Mils2mm(double x)
Convert mils to mm.
Definition: base_units.h:65
Class DIALOG_PRINT_USING_PRINTER_BASE.
void OnUseColorThemeChecked(wxCommandEvent &event) override
SCHEMATIC & Schematic() const
void Print(RENDER_SETTINGS *aSettings)
Print all the items in the screen to aDC.
Definition: sch_screen.cpp:710
Definition: color4d.h:58
Custom schematic print preview frame.
SCH_PRINTOUT(SCH_EDIT_FRAME *aParent, const wxString &aTitle)
SCH_SHEET_PATH.
wxPageSetupDialogData & GetPageSetupData()
virtual void ClearMsgPanel()
Clear all messages from the message panel.
bool background
Whether or not to print background color.
Definition: app_settings.h:117
SETTINGS_MANAGER * GetSettingsManager()
void OnPageSetup(wxCommandEvent &event) override
Definition: color4d.h:48
int CountSheets() const
Count the number of sheets found in "this" sheet including all of the subsheets.
Definition: sch_sheet.cpp:694
COLOR_SETTINGS * GetColorSettings(const wxString &aName="user")
Retrieves a color settings object that applications can read colors from.
void AppendMsgPanel(const wxString &textUpper, const wxString &textLower, COLOR4D color, int pad=6)
Append a message to the message panel.
COLOR4D GetColor(int aLayer) const
SCH_SHEET & Root() const
Definition: schematic.h:97
bool Show(bool show) override
see class PGM_BASE
SCH_SCREEN * LastScreen()
Function LastScreen.
void SetSheetNumberAndCount()
Set the m_ScreenNumber and m_NumberOfScreens members for screens.
static LIB_PART * dummy()
Used to draw a dummy shape when a LIB_PART is not found in library.
bool OnBeginDocument(int startPage, int endPage) override
bool IsPortrait() const
Definition: page_info.h:121
#define _(s)
Definition: 3d_actions.cpp:33
wxPoint m_DrawOrg
offsets for drawing the circuit on the screen
Definition: base_screen.h:62
#define IU_PER_MILS
Definition: plotter.cpp:138
SCH_RENDER_SETTINGS Stores schematic-specific render settings.
Definition: sch_painter.h:70
void OnPrintPreview(wxCommandEvent &event) override
Color settings are a bit different than most of the settings objects in that there can be more than o...
SCH_SHEET_PATH & GetCurrentSheet() const
std::string GetFilename() const
Definition: json_settings.h:56
virtual COLOR4D GetDrawBgColor() const
DIALOG_PRINT_USING_PRINTER(SCH_EDIT_FRAME *aParent)
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
bool HasPage(int page) override
void SetPrintDC(wxDC *aDC)
int GetWidthMils() const
Definition: page_info.h:137
wxString m_ColorTheme
Active color theme name.
Definition: app_settings.h:156
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:99