KiCad PCB EDA Suite
DIALOG_PAGES_SETTINGS Class Reference

#include <dialog_page_settings.h>

Inheritance diagram for DIALOG_PAGES_SETTINGS:
DIALOG_PAGES_SETTINGS_BASE DIALOG_SHIM KIWAY_HOLDER

Public Member Functions

 DIALOG_PAGES_SETTINGS (EDA_DRAW_FRAME *parent)
 
 ~DIALOG_PAGES_SETTINGS ()
 
const wxString GetWksFileName ()
 
void SetWksFileName (const wxString &aFilename)
 
void EnableWksFileNamePicker (bool aEnable)
 
int ShowQuasiModal ()
 
void EndQuasiModal (int retCode)
 
bool IsQuasiModal ()
 
bool Show (bool show) override
 
bool Enable (bool enable) override
 
void OnPaint (wxPaintEvent &event)
 
KIWAYKiway () const
 Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in. More...
 
PROJECTPrj () const
 Function Prj returns a reference to the PROJECT "associated with" this KIWAY. More...
 
void SetKiway (wxWindow *aDest, KIWAY *aKiway)
 Function SetKiway. More...
 

Protected Member Functions

virtual void OnCheckboxTitleClick (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...
 

Protected Attributes

wxStaticText * m_staticTextPaper
 
wxStaticLine * m_staticline2
 
wxStaticText * m_staticTextSize
 
wxChoice * m_paperSizeComboBox
 
wxStaticText * m_staticTextOrient
 
wxChoice * m_orientationComboBox
 
wxStaticText * m_staticTextCustSize
 
wxStaticText * m_staticTextHeight
 
wxTextCtrl * m_TextUserSizeY
 
wxStaticText * m_staticTextWidth
 
wxTextCtrl * m_TextUserSizeX
 
wxStaticText * m_staticTextPreview
 
wxStaticBitmap * m_PageLayoutExampleBitmap
 
wxStaticLine * m_staticline1
 
wxStaticText * m_staticTexttbprm
 
wxStaticLine * m_staticline3
 
wxStaticText * m_TextSheetCount
 
wxStaticText * m_TextSheetNumber
 
wxStaticText * m_staticTextDate
 
wxTextCtrl * m_TextDate
 
wxButton * m_ApplyDate
 
wxDatePickerCtrl * m_PickDate
 
wxCheckBox * m_DateExport
 
wxStaticText * m_staticTextRev
 
wxTextCtrl * m_TextRevision
 
wxCheckBox * m_RevisionExport
 
wxStaticText * m_staticTextTitle
 
wxTextCtrl * m_TextTitle
 
wxCheckBox * m_TitleExport
 
wxStaticText * m_staticText13
 
wxTextCtrl * m_TextCompany
 
wxCheckBox * m_CompanyExport
 
wxStaticText * m_staticTextComment1
 
wxTextCtrl * m_TextComment1
 
wxCheckBox * m_Comment1Export
 
wxStaticText * m_staticTextComment2
 
wxTextCtrl * m_TextComment2
 
wxCheckBox * m_Comment2Export
 
wxStaticText * m_staticTextComment3
 
wxTextCtrl * m_TextComment3
 
wxCheckBox * m_Comment3Export
 
wxStaticText * m_staticTextComment4
 
wxTextCtrl * m_TextComment4
 
wxCheckBox * m_Comment4Export
 
wxStaticText * m_staticTextfilename
 
wxTextCtrl * m_textCtrlFilePicker
 
wxButton * m_buttonBrowse
 
wxStdDialogButtonSizer * m_sdbSizer
 
wxButton * m_sdbSizerOK
 
wxButton * m_sdbSizerCancel
 
bool m_fixupsRun
 
std::string m_hash_key
 
EVENT_LOOPm_qmodal_loop
 
bool m_qmodal_showing
 
WDO_ENABLE_DISABLEm_qmodal_parent_disabler
 

Private Member Functions

void initDialog ()
 
void OnOkClick (wxCommandEvent &event) override
 
void OnPaperSizeChoice (wxCommandEvent &event) override
 
void OnUserPageSizeXTextUpdated (wxCommandEvent &event) override
 
void OnUserPageSizeYTextUpdated (wxCommandEvent &event) override
 
void OnPageOrientationChoice (wxCommandEvent &event) override
 
void OnRevisionTextUpdated (wxCommandEvent &event) override
 
void OnDateTextUpdated (wxCommandEvent &event) override
 
void OnTitleTextUpdated (wxCommandEvent &event) override
 
void OnCompanyTextUpdated (wxCommandEvent &event) override
 
void OnComment1TextUpdated (wxCommandEvent &event) override
 
void OnComment2TextUpdated (wxCommandEvent &event) override
 
void OnComment3TextUpdated (wxCommandEvent &event) override
 
void OnComment4TextUpdated (wxCommandEvent &event) override
 
void OnDateApplyClick (wxCommandEvent &event) override
 
void OnWksFileSelection (wxCommandEvent &event) override
 
bool SavePageSettings ()
 
void SetCurrentPageSizeSelection (const wxString &aPaperSize)
 
void UpdatePageLayoutExample ()
 
void GetPageLayoutInfoFromDialog ()
 
void GetCustomSizeMilsFromDialog ()
 
bool LocalPrjConfigChanged ()
 

Private Attributes

EDA_DRAW_FRAMEm_parent
 
BASE_SCREENm_screen
 
wxString m_projectPath
 
wxArrayString m_pageFmt
 
bool m_initialized
 list of page sizes (not translated) More...
 
bool m_localPrjConfigChanged
 
wxBitmap * m_page_bitmap
 the page layuout filename was changed More...
 
wxSize m_layout_size
 Temporary bitmap for the page layout example. More...
 
PAGE_INFO m_pageInfo
 Logical page layout size. More...
 
bool m_customFmt
 Temporary page info. More...
 
TITLE_BLOCK m_tb
 true if the page selection is custom More...
 
WORKSHEET_LAYOUTm_pagelayout
 Temporary title block (basic inscriptions). More...
 

Detailed Description

DIALOG_PAGES_SETTINGS class declaration

Definition at line 35 of file dialog_page_settings.h.

Constructor & Destructor Documentation

DIALOG_PAGES_SETTINGS::DIALOG_PAGES_SETTINGS ( EDA_DRAW_FRAME parent)

Definition at line 93 of file dialog_page_settings.cpp.

References PROJECT::GetProjectPath(), EDA_DRAW_FRAME::GetScreen(), EDA_DRAW_FRAME::GetTitleBlock(), initDialog(), m_customFmt, m_localPrjConfigChanged, m_page_bitmap, m_pagelayout, m_parent, DIALOG_PAGES_SETTINGS_BASE::m_PickDate, m_projectPath, m_screen, m_tb, and KIWAY_HOLDER::Prj().

93  :
95  m_initialized( false )
96 {
97  m_parent = parent;
100  m_page_bitmap = NULL;
102  m_customFmt = false;
103  m_localPrjConfigChanged = false;
104  m_pagelayout = NULL;
105 
106  m_PickDate->SetValue( wxDateTime::Now() );
107 
108  initDialog();
109 
110  GetSizer()->SetSizeHints( this );
111  Centre();
112 }
virtual const TITLE_BLOCK & GetTitleBlock() const =0
TITLE_BLOCK m_tb
true if the page selection is custom
DIALOG_PAGES_SETTINGS_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Page Settings"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
bool m_initialized
list of page sizes (not translated)
wxBitmap * m_page_bitmap
the page layuout filename was changed
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
virtual BASE_SCREEN * GetScreen() const
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
Definition: draw_frame.h:361
WORKSHEET_LAYOUT * m_pagelayout
Temporary title block (basic inscriptions).
VTBL_ENTRY const wxString GetProjectPath() const
Function GetProjectPath returns the full path of the project.
Definition: project.cpp:100
bool m_customFmt
Temporary page info.
DIALOG_PAGES_SETTINGS::~DIALOG_PAGES_SETTINGS ( )

Definition at line 115 of file dialog_page_settings.cpp.

References m_page_bitmap, and m_pagelayout.

116 {
117  delete m_page_bitmap;
118  delete m_pagelayout;
119 }
wxBitmap * m_page_bitmap
the page layuout filename was changed
WORKSHEET_LAYOUT * m_pagelayout
Temporary title block (basic inscriptions).

Member Function Documentation

bool DIALOG_SHIM::Enable ( bool  enable)
overrideinherited

Definition at line 205 of file dialog_shim.cpp.

Referenced by DIALOG_PRINT_USING_PRINTER::InitValues(), and DIALOG_SHIM::IsQuasiModal().

206 {
207  // so we can do logging of this state change:
208 
209 #if defined(DEBUG)
210  const char* type_id = typeid( *this ).name();
211  printf( "wxDialog %s: %s\n", type_id, enable ? "enabled" : "disabled" );
212 #endif
213 
214  return wxDialog::Enable( enable );
215 }
void DIALOG_SHIM::EndQuasiModal ( int  retCode)
inherited

Definition at line 610 of file dialog_shim.cpp.

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

Referenced by DIALOG_SHIM::OnButton(), DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::OnCancelButtonClick(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnCancelButtonClick(), DIALOG_EDIT_ONE_FIELD::OnCancelClick(), DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::OnCloseDialog(), DIALOG_EDIT_ONE_FIELD::OnCloseDialog(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnCloseDialog(), DIALOG_CHOOSE_COMPONENT::OnCloseTimer(), DIALOG_SHIM::OnCloseWindow(), DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::OnOKButtonClick(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnOKButtonClick(), DIALOG_EDIT_ONE_FIELD::OnOkClick(), DIALOG_EXCHANGE_FOOTPRINTS::OnQuit(), DIALOG_CHOOSE_COMPONENT::OnSchViewDClick(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::SetInitCmp(), and DIALOG_SHIM::~DIALOG_SHIM().

611 {
612  // Hook up validator and transfer data from controls handling so quasi-modal dialogs
613  // handle validation in the same way as other dialogs.
614  if( ( retCode == wxID_OK ) && ( !Validate() || !TransferDataFromWindow() ) )
615  return;
616 
617  SetReturnCode( retCode );
618 
619  if( !IsQuasiModal() )
620  {
621  wxFAIL_MSG( wxT( "either DIALOG_SHIM::EndQuasiModal called twice or ShowQuasiModal wasn't called" ) );
622  return;
623  }
624 
625  m_qmodal_showing = false;
626 
627  if( m_qmodal_loop )
628  {
629  if( m_qmodal_loop->IsRunning() )
630  m_qmodal_loop->Exit( 0 );
631  else
632  m_qmodal_loop->ScheduleExit( 0 );
633 
634  m_qmodal_loop = NULL;
635  }
636 
639 
640  Show( false );
641 }
bool m_qmodal_showing
Definition: dialog_shim.h:155
EVENT_LOOP * m_qmodal_loop
Definition: dialog_shim.h:154
bool IsQuasiModal()
Definition: dialog_shim.h:103
bool Show(bool show) override
WDO_ENABLE_DISABLE * m_qmodal_parent_disabler
Definition: dialog_shim.h:156
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 104 of file dialog_shim.cpp.

References PCAD2KICAD::Center.

Referenced by COLOR4D_PICKER_DLG::COLOR4D_PICKER_DLG(), DIALOG_3D_VIEW_OPTIONS::DIALOG_3D_VIEW_OPTIONS(), DIALOG_ANNOTATE::DIALOG_ANNOTATE(), DIALOG_BOM::DIALOG_BOM(), DIALOG_COPPER_ZONE::DIALOG_COPPER_ZONE(), DIALOG_DESIGN_RULES::DIALOG_DESIGN_RULES(), DIALOG_DIMENSION_EDITOR::DIALOG_DIMENSION_EDITOR(), DIALOG_DISPLAY_OPTIONS::DIALOG_DISPLAY_OPTIONS(), DIALOG_DRC_CONTROL::DIALOG_DRC_CONTROL(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::DIALOG_EDIT_COMPONENT_IN_LIBRARY(), DIALOG_EDIT_LINE_STYLE::DIALOG_EDIT_LINE_STYLE(), DIALOG_EESCHEMA_OPTIONS::DIALOG_EESCHEMA_OPTIONS(), DIALOG_ENUM_PADS::DIALOG_ENUM_PADS(), 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_FIELDS_EDITOR_GLOBAL::DIALOG_FIELDS_EDITOR_GLOBAL(), DIALOG_FOOTPRINT_WIZARD_LIST::DIALOG_FOOTPRINT_WIZARD_LIST(), DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG::DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG(), DIALOG_KEEPOUT_AREA_PROPERTIES::DIALOG_KEEPOUT_AREA_PROPERTIES(), DIALOG_LABEL_EDITOR::DIALOG_LABEL_EDITOR(), DIALOG_LIB_EDIT_DRAW_ITEM::DIALOG_LIB_EDIT_DRAW_ITEM(), DIALOG_LIB_EDIT_TEXT::DIALOG_LIB_EDIT_TEXT(), DIALOG_LIB_NEW_COMPONENT::DIALOG_LIB_NEW_COMPONENT(), DIALOG_LIBEDIT_OPTIONS::DIALOG_LIBEDIT_OPTIONS(), DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES(), DIALOG_PADS_MASK_CLEARANCE::DIALOG_PADS_MASK_CLEARANCE(), DIALOG_PLOT_SCHEMATIC::DIALOG_PLOT_SCHEMATIC(), DIALOG_SCH_EDIT_SHEET_PIN::DIALOG_SCH_EDIT_SHEET_PIN(), DIALOG_SCH_SHEET_PROPS::DIALOG_SCH_SHEET_PROPS(), DIALOG_SELECT_PRETTY_LIB::DIALOG_SELECT_PRETTY_LIB(), DIALOG_TRACK_VIA_SIZE::DIALOG_TRACK_VIA_SIZE(), DIALOG_EDIT_ONE_FIELD::init(), DIALOG_SHIM::IsQuasiModal(), NETLIST_DIALOG::NETLIST_DIALOG(), DIALOG_LIB_EDIT_PIN::OnInitDialog(), DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::OnInitDialog(), DIALOG_TRACK_VIA_PROPERTIES::OnInitDlg(), DIALOG_GRAPHIC_ITEMS_OPTIONS::OnInitDlg(), DIALOG_EDIT_FPTEXT::OnInitDlg(), DIALOG_SET_GRID::OnInitDlg(), DIALOG_PCB_TEXT_PROPERTIES::OnInitDlg(), DIALOG_PRINT_FOR_MODEDIT::OnInitDlg(), DIALOG_FOOTPRINT_FP_EDITOR::OnInitDlg(), DIALOG_GRAPHIC_ITEM_PROPERTIES::OnInitDlg(), DIALOG_SIM_SETTINGS::onInitDlg(), DIALOG_SPICE_MODEL::onInitDlg(), DIALOG_FOOTPRINT_BOARD_EDITOR::OnInitDlg(), DIALOG_PRINT_USING_PRINTER::OnInitDlg(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnInitDlg(), TARGET_PROPERTIES_DIALOG_EDITOR::TARGET_PROPERTIES_DIALOG_EDITOR(), DIALOG_SIGNAL_LIST::TransferDataToWindow(), and DIALOG_UPDATE_FIELDS::TransferDataToWindow().

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

Definition at line 773 of file dialog_page_settings.cpp.

References Clamp(), g_UserUnit, INCHES, KiROUND(), m_layout_size, DIALOG_PAGES_SETTINGS_BASE::m_TextUserSizeX, DIALOG_PAGES_SETTINGS_BASE::m_TextUserSizeY, and MILLIMETRES.

Referenced by EnableWksFileNamePicker(), GetPageLayoutInfoFromDialog(), and SavePageSettings().

774 {
775  double customSizeX;
776  double customSizeY;
777  wxString msg;
778 
779  msg = m_TextUserSizeX->GetValue();
780  msg.ToDouble( &customSizeX );
781 
782  msg = m_TextUserSizeY->GetValue();
783  msg.ToDouble( &customSizeY );
784 
785  switch( g_UserUnit )
786  {
787  case MILLIMETRES:
788  customSizeX *= 1000. / 25.4;
789  customSizeY *= 1000. / 25.4;
790  break;
791 
792  default:
793  case INCHES:
794  customSizeX *= 1000.;
795  customSizeY *= 1000.;
796  }
797 
798  // Prepare to painless double -> int conversion.
799  customSizeX = Clamp( double( INT_MIN ), customSizeX, double( INT_MAX ) );
800  customSizeY = Clamp( double( INT_MIN ), customSizeY, double( INT_MAX ) );
801  m_layout_size = wxSize( KiROUND( customSizeX ), KiROUND( customSizeY ) );
802 }
const T & Clamp(const T &lower, const T &value, const T &upper)
Function Clamp limits value within the range lower <= value <= upper.
Definition: macros.h:127
static int KiROUND(double v)
KiROUND rounds a floating point number to an int using "round halfway cases away from zero"...
Definition: common.h:107
wxSize m_layout_size
Temporary bitmap for the page layout example.
Definition: common.h:145
EDA_UNITS_T g_UserUnit
Global variables definitions.
Definition: common.cpp:57
void DIALOG_PAGES_SETTINGS::GetPageLayoutInfoFromDialog ( )
private

Definition at line 703 of file dialog_page_settings.cpp.

References PAGE_INFO::A, PAGE_INFO::A0, PAGE_INFO::A1, PAGE_INFO::A2, PAGE_INFO::A3, PAGE_INFO::A4, PAGE_INFO::B, PAGE_INFO::C, PAGE_INFO::Custom, PAGE_INFO::D, DIM, PAGE_INFO::E, GetCustomSizeMilsFromDialog(), PAGE_INFO::GetSizeMils(), i, m_layout_size, DIALOG_PAGES_SETTINGS_BASE::m_orientationComboBox, m_pageFmt, DIALOG_PAGES_SETTINGS_BASE::m_paperSizeComboBox, PAGE_INFO::SetType(), PAGE_INFO::USLedger, PAGE_INFO::USLegal, and PAGE_INFO::USLetter.

Referenced by EnableWksFileNamePicker(), initDialog(), OnComment1TextUpdated(), OnComment2TextUpdated(), OnComment3TextUpdated(), OnComment4TextUpdated(), OnCompanyTextUpdated(), OnDateTextUpdated(), OnPageOrientationChoice(), OnPaperSizeChoice(), OnRevisionTextUpdated(), OnTitleTextUpdated(), OnUserPageSizeXTextUpdated(), OnUserPageSizeYTextUpdated(), and OnWksFileSelection().

704 {
705  int idx = m_paperSizeComboBox->GetSelection();
706 
707  if( idx < 0 )
708  idx = 0;
709 
710  const wxString paperType = m_pageFmt[idx];
711 
712  // here we assume translators will keep original paper size spellings
713  if( paperType.Contains( PAGE_INFO::Custom ) )
714  {
716 
717  if( m_layout_size.x && m_layout_size.y )
718  {
719  if( m_layout_size.x < m_layout_size.y )
720  m_orientationComboBox->SetStringSelection( _( "Portrait" ) );
721  else
722  m_orientationComboBox->SetStringSelection( _( "Landscape" ) );
723  }
724  }
725  else
726  {
727  PAGE_INFO pageInfo; // SetType() later to lookup size
728 
729  static const wxChar* papers[] = {
730  // longest common string first, since sequential search below
736  PAGE_INFO::A,
737  PAGE_INFO::B,
738  PAGE_INFO::C,
739  PAGE_INFO::D,
740  PAGE_INFO::E,
744  };
745 
746  unsigned i;
747 
748  for( i=0; i < DIM( papers ); ++i )
749  {
750  if( paperType.Contains( papers[i] ) )
751  {
752  pageInfo.SetType( papers[i] );
753  break;
754  }
755  }
756 
757  wxASSERT( i != DIM(papers) ); // dialog UI match the above list?
758 
759  m_layout_size = pageInfo.GetSizeMils();
760 
761  // swap sizes to match orientation
762  bool isPortrait = (bool) m_orientationComboBox->GetSelection();
763 
764  if( ( isPortrait && m_layout_size.x >= m_layout_size.y ) ||
765  ( !isPortrait && m_layout_size.x < m_layout_size.y ) )
766  {
768  }
769  }
770 }
#define DIM(x)
of elements in an array
Definition: macros.h:98
static const wxChar A[]
Definition: page_info.h:64
static const wxChar E[]
Definition: page_info.h:68
static const wxChar A3[]
Definition: page_info.h:60
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:117
static const wxChar Custom[]
"User" defined page type
Definition: page_info.h:73
static const wxChar D[]
Definition: page_info.h:67
wxSize m_layout_size
Temporary bitmap for the page layout example.
const wxSize & GetSizeMils() const
Definition: page_info.h:137
static const wxChar USLegal[]
Definition: page_info.h:71
static const wxChar B[]
Definition: page_info.h:65
static const wxChar C[]
Definition: page_info.h:66
Class PAGE_INFO describes the page size and margins of a paper page on which to eventually print or p...
Definition: page_info.h:49
static const wxChar A4[]
Definition: page_info.h:59
static const wxChar USLedger[]
Definition: page_info.h:72
static const wxChar A1[]
Definition: page_info.h:62
static const wxChar USLetter[]
Definition: page_info.h:70
size_t i
Definition: json11.cpp:597
static const wxChar A2[]
Definition: page_info.h:61
static const wxChar A0[]
Definition: page_info.h:63
const wxString DIALOG_PAGES_SETTINGS::GetWksFileName ( )
inline

Definition at line 56 of file dialog_page_settings.h.

References DIALOG_PAGES_SETTINGS_BASE::m_textCtrlFilePicker.

Referenced by OnWksFileSelection(), and SavePageSettings().

57  {
58  return m_textCtrlFilePicker->GetValue();
59  }
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 125 of file dialog_shim.cpp.

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

126 {
127  wxSize sz( x, 0 );
128  return ConvertDialogToPixels( sz ).x;
129 }
void DIALOG_PAGES_SETTINGS::initDialog ( )
private

Definition at line 122 of file dialog_page_settings.cpp.

References DIM, dummy(), g_UserUnit, TITLE_BLOCK::GetComment1(), TITLE_BLOCK::GetComment2(), TITLE_BLOCK::GetComment3(), TITLE_BLOCK::GetComment4(), TITLE_BLOCK::GetCompany(), PAGE_INFO::GetCustomHeightMils(), PAGE_INFO::GetCustomWidthMils(), TITLE_BLOCK::GetDate(), PAGE_INFO::GetHeightMils(), GetPageLayoutInfoFromDialog(), EDA_DRAW_FRAME::GetPageSettings(), TITLE_BLOCK::GetRevision(), TITLE_BLOCK::GetTitle(), PAGE_INFO::GetType(), PAGE_INFO::GetWidthMils(), INCHES, PAGE_INFO::IsPortrait(), DIALOG_PAGES_SETTINGS_BASE::m_Comment1Export, DIALOG_PAGES_SETTINGS_BASE::m_Comment2Export, DIALOG_PAGES_SETTINGS_BASE::m_Comment3Export, DIALOG_PAGES_SETTINGS_BASE::m_Comment4Export, DIALOG_PAGES_SETTINGS_BASE::m_CompanyExport, m_customFmt, DIALOG_PAGES_SETTINGS_BASE::m_DateExport, m_initialized, BASE_SCREEN::m_NumberOfScreens, DIALOG_PAGES_SETTINGS_BASE::m_orientationComboBox, m_pageFmt, m_pageInfo, BASE_SCREEN::m_PageLayoutDescrFileName, DIALOG_PAGES_SETTINGS_BASE::m_paperSizeComboBox, m_parent, DIALOG_PAGES_SETTINGS_BASE::m_RevisionExport, m_screen, BASE_SCREEN::m_ScreenNumber, DIALOG_PAGES_SETTINGS_BASE::m_sdbSizerOK, m_tb, DIALOG_PAGES_SETTINGS_BASE::m_TextComment1, DIALOG_PAGES_SETTINGS_BASE::m_TextComment2, DIALOG_PAGES_SETTINGS_BASE::m_TextComment3, DIALOG_PAGES_SETTINGS_BASE::m_TextComment4, DIALOG_PAGES_SETTINGS_BASE::m_TextCompany, DIALOG_PAGES_SETTINGS_BASE::m_TextDate, DIALOG_PAGES_SETTINGS_BASE::m_TextRevision, DIALOG_PAGES_SETTINGS_BASE::m_TextSheetCount, DIALOG_PAGES_SETTINGS_BASE::m_TextSheetNumber, DIALOG_PAGES_SETTINGS_BASE::m_TextTitle, DIALOG_PAGES_SETTINGS_BASE::m_TextUserSizeX, DIALOG_PAGES_SETTINGS_BASE::m_TextUserSizeY, DIALOG_PAGES_SETTINGS_BASE::m_TitleExport, MILLIMETRES, OnPaperSizeChoice(), pageFmts, SetCurrentPageSizeSelection(), SetWksFileName(), and UpdatePageLayoutExample().

Referenced by DIALOG_PAGES_SETTINGS(), and EnableWksFileNamePicker().

123 {
124  wxString msg;
125  double customSizeX;
126  double customSizeY;
127 
128  // initialize page format choice box and page format list.
129  // The first shows translated strings, the second contains not translated strings
130  m_paperSizeComboBox->Clear();
131 
132  for( unsigned ii = 0; ii < DIM(pageFmts); ii++ )
133  {
134  m_pageFmt.Add( pageFmts[ii] );
135  m_paperSizeComboBox->Append( wxGetTranslation( pageFmts[ii] ) );
136  }
137 
138  // initialize the page layout descr filename
140 
141 #ifdef EESCHEMA
142  // Init display value for schematic sub-sheet number
143  wxString format = m_TextSheetCount->GetLabel();
144  msg.Printf( format, m_screen->m_NumberOfScreens );
145  m_TextSheetCount->SetLabel( msg );
146 
147  format = m_TextSheetNumber->GetLabel();
148  msg.Printf( format, m_screen->m_ScreenNumber );
149  m_TextSheetNumber->SetLabel( msg );
150 #else
151  m_TextSheetCount->Show( false );
152  m_TextSheetNumber->Show( false );
153 #endif
154 
157  m_orientationComboBox->SetSelection( m_pageInfo.IsPortrait() );
158 
159  // only a click fires the "selection changed" event, so have to fabricate this check
160  wxCommandEvent dummy;
161  OnPaperSizeChoice( dummy );
162 
163  if( m_customFmt) // The custom value is defined by the page size
164  {
165  customSizeX = m_pageInfo.GetWidthMils();
166  customSizeY = m_pageInfo.GetHeightMils();
167  }
168  else // The custom value is set to a default value, or the last defined value
169  {
170  customSizeX = m_pageInfo.GetCustomWidthMils();
171  customSizeY = m_pageInfo.GetCustomHeightMils();
172  }
173 
174  switch( g_UserUnit )
175  {
176  case MILLIMETRES:
177  customSizeX *= 25.4e-3;
178  customSizeY *= 25.4e-3;
179 
180  msg.Printf( wxT( "%.2f" ), customSizeX );
181  m_TextUserSizeX->SetValue( msg );
182 
183  msg.Printf( wxT( "%.2f" ), customSizeY );
184  m_TextUserSizeY->SetValue( msg );
185  break;
186 
187  default:
188  case INCHES:
189  customSizeX /= 1000.0;
190  customSizeY /= 1000.0;
191 
192  msg.Printf( wxT( "%.3f" ), customSizeX );
193  m_TextUserSizeX->SetValue( msg );
194 
195  msg.Printf( wxT( "%.3f" ), customSizeY );
196  m_TextUserSizeY->SetValue( msg );
197  break;
198  }
199 
200  m_TextRevision->SetValue( m_tb.GetRevision() );
201  m_TextDate->SetValue( m_tb.GetDate() );
202  m_TextTitle->SetValue( m_tb.GetTitle() );
203  m_TextCompany->SetValue( m_tb.GetCompany() );
204  m_TextComment1->SetValue( m_tb.GetComment1() );
205  m_TextComment2->SetValue( m_tb.GetComment2() );
206  m_TextComment3->SetValue( m_tb.GetComment3() );
207  m_TextComment4->SetValue( m_tb.GetComment4() );
208 
209 #ifndef EESCHEMA
210  // these options have meaning only for Eeschema.
211  // disable them for other apps
212  m_RevisionExport->Show( false );
213  m_DateExport->Show( false );
214  m_TitleExport->Show( false );
215  m_CompanyExport->Show( false );
216  m_Comment1Export->Show( false );
217  m_Comment2Export->Show( false );
218  m_Comment3Export->Show( false );
219  m_Comment4Export->Show( false );
220 #endif
221 
224 
225  // Make the OK button the default.
226  m_sdbSizerOK->SetDefault();
227  m_initialized = true;
228 }
#define DIM(x)
of elements in an array
Definition: macros.h:98
int m_ScreenNumber
Definition: base_screen.h:216
static int GetCustomHeightMils()
Function GetCustomHeightMils.
Definition: page_info.h:171
const wxString & GetCompany() const
Definition: title_block.h:98
TITLE_BLOCK m_tb
true if the page selection is custom
void SetWksFileName(const wxString &aFilename)
const wxString & GetComment4() const
Definition: title_block.h:123
const wxString & GetDate() const
Definition: title_block.h:78
bool m_initialized
list of page sizes (not translated)
static wxString m_PageLayoutDescrFileName
the name of the page layout descr file, or emty to used the default pagelayout
Definition: base_screen.h:180
virtual const PAGE_INFO & GetPageSettings() const =0
const wxString & GetTitle() const
Definition: title_block.h:64
bool IsPortrait() const
Definition: page_info.h:116
const wxString & GetRevision() const
Definition: title_block.h:88
Definition: common.h:145
const wxString & GetComment3() const
Definition: title_block.h:122
void SetCurrentPageSizeSelection(const wxString &aPaperSize)
int GetWidthMils() const
Definition: page_info.h:132
const wxString & GetComment2() const
Definition: title_block.h:121
EDA_UNITS_T g_UserUnit
Global variables definitions.
Definition: common.cpp:57
const wxString & GetComment1() const
Definition: title_block.h:120
PAGE_INFO m_pageInfo
Logical page layout size.
static LIB_PART * dummy()
Used when a LIB_PART is not found in library to draw a dummy shape This component is a 400 mils squar...
static const wxString pageFmts[]
static int GetCustomWidthMils()
Function GetCustomWidthMils.
Definition: page_info.h:165
bool m_customFmt
Temporary page info.
int m_NumberOfScreens
Definition: base_screen.h:217
void OnPaperSizeChoice(wxCommandEvent &event) override
const wxString & GetType() const
Definition: page_info.h:92
int GetHeightMils() const
Definition: page_info.h:135
KIWAY& KIWAY_HOLDER::Kiway ( ) const
inlineinherited

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

A KIWAY_HOLDER is not necessarily a KIWAY_PLAYER.

Definition at line 60 of file kiway_player.h.

References KIWAY_HOLDER::m_kiway, KIWAY_HOLDER::Prj(), and KIWAY_HOLDER::SetKiway().

Referenced by SCH_EDIT_FRAME::AppendSchematic(), CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX(), DIALOG_CHOOSE_COMPONENT::ConstructRightPanel(), CVPCB_MAINFRAME::CreateScreenCmp(), CVPCB_MAINFRAME::CVPCB_MAINFRAME(), DIALOG_CHOOSE_COMPONENT::DIALOG_CHOOSE_COMPONENT(), DIALOG_SHIM::DIALOG_SHIM(), EDIT_TOOL::editFootprintInFpEditor(), SCH_EDIT_FRAME::EditSheet(), DISPLAY_FOOTPRINTS_FRAME::Get_Module(), LIB_MANAGER::GetBufferedPart(), FOOTPRINT_EDIT_FRAME::GetIconScale(), LIB_MANAGER::getLibraryBuffer(), FOOTPRINT_EDIT_FRAME::GetPlotSettings(), PCB_EDIT_FRAME::importFile(), SCH_EDIT_FRAME::importFile(), DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::initBuffers(), SCH_EDIT_FRAME::KiwayMailIn(), KIWAY_PLAYER::language_change(), CVPCB_MAINFRAME::LoadFootprintFiles(), KIWAY_PLAYER::OnChangeIconsOptions(), CVPCB_MAINFRAME::OnEditFootprintLibraryTable(), SCH_BASE_FRAME::OnEditSymbolLibTable(), DIALOG_CHOOSE_COMPONENT::OnIdle(), KICAD_MANAGER_FRAME::OnImportEagleFiles(), SCH_EDIT_FRAME::OnLeftClick(), SCH_BASE_FRAME::OnOpenLibraryViewer(), SCH_EDIT_FRAME::OnSimulate(), DIALOG_EDIT_ONE_FIELD::OnTextValueSelectButtonClick(), FOOTPRINT_EDIT_FRAME::OnUpdateInsertModuleInBoard(), FOOTPRINT_EDIT_FRAME::OnUpdateLoadModuleFromBoard(), FOOTPRINT_EDIT_FRAME::OnUpdateReplaceModuleInBoard(), SCH_EDIT_FRAME::OpenProjectFiles(), KIWAY_HOLDER::Prj(), PCB_EDIT_FRAME::Process_Config(), PCB_EDIT_FRAME::Process_Special_Functions(), FOOTPRINT_EDIT_FRAME::ProcessPreferences(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList(), FOOTPRINT_WIZARD_FRAME::ReCreateVToolbar(), LIB_EDIT_FRAME::refreshSchematic(), SCH_EDIT_FRAME::SaveEEFile(), CVPCB_MAINFRAME::SaveFootprintAssociation(), SCH_BASE_FRAME::SelectComponentFromLibBrowser(), SCH_EDIT_FRAME::SendCrossProbeNetName(), PCB_EDIT_FRAME::SendCrossProbeNetName(), CVPCB_MAINFRAME::SendMessageToEESCHEMA(), PCB_EDIT_FRAME::SendMessageToEESCHEMA(), SCH_EDIT_FRAME::SendMessageToPCBNEW(), SCH_EDIT_FRAME::sendNetlist(), FOOTPRINT_EDIT_FRAME::SetPlotSettings(), DISPLAY_FOOTPRINTS_FRAME::Show3D_Frame(), FOOTPRINT_EDIT_FRAME::Show3D_Frame(), FOOTPRINT_VIEWER_FRAME::Show3D_Frame(), FOOTPRINT_WIZARD_FRAME::Show3D_Frame(), DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::showButtonHandler(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::showButtonHandler(), SIM_PLOT_FRAME::SIM_PLOT_FRAME(), LIB_MANAGER::UpdatePart(), and DIALOG_EXCHANGE_FOOTPRINTS::ViewAndSelectFootprint().

61  {
62  wxASSERT( m_kiway ); // smoke out bugs in Debug build, then Release runs fine.
63  return *m_kiway;
64  }
KIWAY * m_kiway
Definition: kiway_player.h:85
bool DIALOG_PAGES_SETTINGS::LocalPrjConfigChanged ( )
inlineprivate
Returns
true if the local prj config is chande i.e. if the page layout descr file has chnaged

Definition at line 117 of file dialog_page_settings.h.

References m_localPrjConfigChanged.

Referenced by OnOkClick().

virtual void DIALOG_PAGES_SETTINGS_BASE::OnCheckboxTitleClick ( wxCommandEvent &  event)
inlineprotectedvirtualinherited
void DIALOG_PAGES_SETTINGS::OnComment1TextUpdated ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAGES_SETTINGS_BASE.

Definition at line 359 of file dialog_page_settings.cpp.

References GetPageLayoutInfoFromDialog(), m_initialized, m_tb, DIALOG_PAGES_SETTINGS_BASE::m_TextComment1, TITLE_BLOCK::SetComment1(), and UpdatePageLayoutExample().

Referenced by EnableWksFileNamePicker().

360 {
361  if( m_initialized && m_TextComment1->IsModified() )
362  {
364  m_tb.SetComment1( m_TextComment1->GetValue() );
366  }
367 }
void SetComment1(const wxString &aComment)
Definition: title_block.h:116
TITLE_BLOCK m_tb
true if the page selection is custom
bool m_initialized
list of page sizes (not translated)
void DIALOG_PAGES_SETTINGS::OnComment2TextUpdated ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAGES_SETTINGS_BASE.

Definition at line 370 of file dialog_page_settings.cpp.

References GetPageLayoutInfoFromDialog(), m_initialized, m_tb, DIALOG_PAGES_SETTINGS_BASE::m_TextComment2, TITLE_BLOCK::SetComment2(), and UpdatePageLayoutExample().

Referenced by EnableWksFileNamePicker().

371 {
372  if( m_initialized && m_TextComment2->IsModified() )
373  {
375  m_tb.SetComment2( m_TextComment2->GetValue() );
377  }
378 }
TITLE_BLOCK m_tb
true if the page selection is custom
bool m_initialized
list of page sizes (not translated)
void SetComment2(const wxString &aComment)
Definition: title_block.h:117
void DIALOG_PAGES_SETTINGS::OnComment3TextUpdated ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAGES_SETTINGS_BASE.

Definition at line 381 of file dialog_page_settings.cpp.

References GetPageLayoutInfoFromDialog(), m_initialized, m_tb, DIALOG_PAGES_SETTINGS_BASE::m_TextComment3, TITLE_BLOCK::SetComment3(), and UpdatePageLayoutExample().

Referenced by EnableWksFileNamePicker().

382 {
383  if( m_initialized && m_TextComment3->IsModified() )
384  {
386  m_tb.SetComment3( m_TextComment3->GetValue() );
388  }
389 }
TITLE_BLOCK m_tb
true if the page selection is custom
bool m_initialized
list of page sizes (not translated)
void SetComment3(const wxString &aComment)
Definition: title_block.h:118
void DIALOG_PAGES_SETTINGS::OnComment4TextUpdated ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAGES_SETTINGS_BASE.

Definition at line 392 of file dialog_page_settings.cpp.

References GetPageLayoutInfoFromDialog(), m_initialized, m_tb, DIALOG_PAGES_SETTINGS_BASE::m_TextComment4, TITLE_BLOCK::SetComment4(), and UpdatePageLayoutExample().

Referenced by EnableWksFileNamePicker().

393 {
394  if( m_initialized && m_TextComment4->IsModified() )
395  {
397  m_tb.SetComment4( m_TextComment4->GetValue() );
399  }
400 }
TITLE_BLOCK m_tb
true if the page selection is custom
bool m_initialized
list of page sizes (not translated)
void SetComment4(const wxString &aComment)
Definition: title_block.h:119
void DIALOG_PAGES_SETTINGS::OnCompanyTextUpdated ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAGES_SETTINGS_BASE.

Definition at line 348 of file dialog_page_settings.cpp.

References GetPageLayoutInfoFromDialog(), m_initialized, m_tb, DIALOG_PAGES_SETTINGS_BASE::m_TextCompany, TITLE_BLOCK::SetCompany(), and UpdatePageLayoutExample().

Referenced by EnableWksFileNamePicker().

349 {
350  if( m_initialized && m_TextCompany->IsModified() )
351  {
353  m_tb.SetCompany( m_TextCompany->GetValue() );
355  }
356 }
TITLE_BLOCK m_tb
true if the page selection is custom
bool m_initialized
list of page sizes (not translated)
void SetCompany(const wxString &aCompany)
Definition: title_block.h:93
void DIALOG_PAGES_SETTINGS::OnDateApplyClick ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAGES_SETTINGS_BASE.

Definition at line 403 of file dialog_page_settings.cpp.

References DIALOG_PAGES_SETTINGS_BASE::m_PickDate, and DIALOG_PAGES_SETTINGS_BASE::m_TextDate.

Referenced by EnableWksFileNamePicker().

404 {
405  wxDateTime datetime = m_PickDate->GetValue();
406  wxString date =
407  // We can choose different formats. Only one must be uncommented
408  //
409  // datetime.Format( wxLocale::GetInfo( wxLOCALE_SHORT_DATE_FMT ) );
410  // datetime.Format( wxLocale::GetInfo( wxLOCALE_LONG_DATE_FMT ) );
411  // datetime.Format( wxT("%Y-%b-%d") );
412  datetime.FormatISODate();
413 
414  m_TextDate->SetValue( date );
415 }
void DIALOG_PAGES_SETTINGS::OnDateTextUpdated ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAGES_SETTINGS_BASE.

Definition at line 326 of file dialog_page_settings.cpp.

References GetPageLayoutInfoFromDialog(), m_initialized, m_tb, DIALOG_PAGES_SETTINGS_BASE::m_TextDate, TITLE_BLOCK::SetDate(), and UpdatePageLayoutExample().

Referenced by EnableWksFileNamePicker().

327 {
328  if( m_initialized && m_TextDate->IsModified() )
329  {
331  m_tb.SetDate( m_TextDate->GetValue() );
333  }
334 }
TITLE_BLOCK m_tb
true if the page selection is custom
void SetDate(const wxString &aDate)
Function SetDate sets the date field, and defaults to the current time and date.
Definition: title_block.h:73
bool m_initialized
list of page sizes (not translated)
void DIALOG_PAGES_SETTINGS::OnOkClick ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAGES_SETTINGS_BASE.

Definition at line 231 of file dialog_page_settings.cpp.

References EDA_DRAW_FRAME::GetCanvas(), LocalPrjConfigChanged(), m_parent, m_screen, EDA_DRAW_PANEL::Refresh(), SavePageSettings(), EDA_BASE_FRAME::SaveProjectSettings(), and BASE_SCREEN::SetModify().

Referenced by EnableWksFileNamePicker().

232 {
233  if( SavePageSettings() )
234  {
235  m_screen->SetModify();
236  m_parent->GetCanvas()->Refresh();
237 
238  if( LocalPrjConfigChanged() )
239  m_parent->SaveProjectSettings( true );
240  }
241 
242  event.Skip();
243 }
virtual void Refresh(bool eraseBackground=true, const wxRect *rect=NULL) override
Update the board display after modifying it bu a python script (note: it is automatically called by a...
Definition: draw_panel.cpp:338
EDA_DRAW_PANEL * GetCanvas()
Definition: draw_frame.h:351
virtual void SaveProjectSettings(bool aAskForSave)
Function SaveProjectSettings saves changes to the project settings to the project (...
void SetModify()
Definition: base_screen.h:324
void DIALOG_PAGES_SETTINGS::OnPageOrientationChoice ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAGES_SETTINGS_BASE.

Definition at line 305 of file dialog_page_settings.cpp.

References GetPageLayoutInfoFromDialog(), m_initialized, and UpdatePageLayoutExample().

Referenced by EnableWksFileNamePicker().

306 {
307  if( m_initialized )
308  {
311  }
312 }
bool m_initialized
list of page sizes (not translated)
void DIALOG_SHIM::OnPaint ( wxPaintEvent &  event)
inherited

Definition at line 271 of file dialog_shim.cpp.

References DIALOG_SHIM::m_fixupsRun, and recursiveDescent().

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

272 {
273  if( !m_fixupsRun )
274  {
275 #if DLGSHIM_SELECT_ALL_IN_TEXT_CONTROLS
276  const bool selectAllInTextCtrls = true;
277 #else
278  const bool selectAllInTextCtrls = false;
279 #endif
280  wxWindow* firstTextCtrl = NULL;
281  wxWindow* windowWithFocus = NULL;
282 
283  recursiveDescent( GetChildren(), selectAllInTextCtrls, firstTextCtrl,
284  windowWithFocus );
285 
286 #if DLGSHIM_USE_SETFOCUS
287  // While it would be nice to honour any focus already set (which was
288  // recorded in windowWithFocus), the reality is that it's currently wrong
289  // far more often than it's right.
290  // So just focus on the first text control if we have one; otherwise the
291  // focus on the dialog itself, which will at least allow esc, return, etc.
292  // to function.
293  if( firstTextCtrl )
294  firstTextCtrl->SetFocus();
295  else
296  SetFocus();
297 #endif
298 
299 #ifdef __WXMAC__
300  fixOSXCancelButtonIssue( this );
301 #endif
302 
303  m_fixupsRun = true;
304  }
305 
306  event.Skip();
307 }
static void recursiveDescent(wxWindowList &children, const bool selectTextInTextCtrls, wxWindow *&firstTextCtrl, wxWindow *&windowWithFocus)
bool m_fixupsRun
Definition: dialog_shim.h:149
void DIALOG_PAGES_SETTINGS::OnPaperSizeChoice ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAGES_SETTINGS_BASE.

Definition at line 246 of file dialog_page_settings.cpp.

References PAGE_INFO::Custom, GetPageLayoutInfoFromDialog(), m_customFmt, DIALOG_PAGES_SETTINGS_BASE::m_orientationComboBox, m_pageFmt, DIALOG_PAGES_SETTINGS_BASE::m_paperSizeComboBox, DIALOG_PAGES_SETTINGS_BASE::m_TextUserSizeX, DIALOG_PAGES_SETTINGS_BASE::m_TextUserSizeY, and UpdatePageLayoutExample().

Referenced by EnableWksFileNamePicker(), and initDialog().

247 {
248  int idx = m_paperSizeComboBox->GetSelection();
249 
250  if( idx < 0 )
251  idx = 0;
252 
253  const wxString paperType = m_pageFmt[idx];
254 
255  if( paperType.Contains( PAGE_INFO::Custom ) )
256  {
257  m_orientationComboBox->Enable( false );
258  m_TextUserSizeX->Enable( true );
259  m_TextUserSizeY->Enable( true );
260  m_customFmt = true;
261  }
262  else
263  {
264  m_orientationComboBox->Enable( true );
265 
266 #if 0
267  // ForcePortrait() does not exist, but could be useful.
268  // so I leave these lines, which could be seen as a todo feature
269  if( paperType.ForcePortrait() )
270  {
271  m_orientationComboBox->SetStringSelection( _( "Portrait" ) );
272  m_orientationComboBox->Enable( false );
273  }
274 #endif
275  m_TextUserSizeX->Enable( false );
276  m_TextUserSizeY->Enable( false );
277  m_customFmt = false;
278  }
279 
282 }
static const wxChar Custom[]
"User" defined page type
Definition: page_info.h:73
bool m_customFmt
Temporary page info.
void DIALOG_PAGES_SETTINGS::OnRevisionTextUpdated ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAGES_SETTINGS_BASE.

Definition at line 315 of file dialog_page_settings.cpp.

References GetPageLayoutInfoFromDialog(), m_initialized, m_tb, DIALOG_PAGES_SETTINGS_BASE::m_TextRevision, TITLE_BLOCK::SetRevision(), and UpdatePageLayoutExample().

Referenced by EnableWksFileNamePicker().

316 {
317  if( m_initialized && m_TextRevision->IsModified() )
318  {
320  m_tb.SetRevision( m_TextRevision->GetValue() );
322  }
323 }
void SetRevision(const wxString &aRevision)
Definition: title_block.h:83
TITLE_BLOCK m_tb
true if the page selection is custom
bool m_initialized
list of page sizes (not translated)
void DIALOG_PAGES_SETTINGS::OnTitleTextUpdated ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAGES_SETTINGS_BASE.

Definition at line 337 of file dialog_page_settings.cpp.

References GetPageLayoutInfoFromDialog(), m_initialized, m_tb, DIALOG_PAGES_SETTINGS_BASE::m_TextTitle, TITLE_BLOCK::SetTitle(), and UpdatePageLayoutExample().

Referenced by EnableWksFileNamePicker().

338 {
339  if( m_initialized && m_TextTitle->IsModified() )
340  {
342  m_tb.SetTitle( m_TextTitle->GetValue() );
344  }
345 }
TITLE_BLOCK m_tb
true if the page selection is custom
bool m_initialized
list of page sizes (not translated)
void SetTitle(const wxString &aTitle)
Definition: title_block.h:59
void DIALOG_PAGES_SETTINGS::OnUserPageSizeXTextUpdated ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAGES_SETTINGS_BASE.

Definition at line 285 of file dialog_page_settings.cpp.

References GetPageLayoutInfoFromDialog(), m_initialized, DIALOG_PAGES_SETTINGS_BASE::m_TextUserSizeX, and UpdatePageLayoutExample().

Referenced by EnableWksFileNamePicker().

286 {
287  if( m_initialized && m_TextUserSizeX->IsModified() )
288  {
291  }
292 }
bool m_initialized
list of page sizes (not translated)
void DIALOG_PAGES_SETTINGS::OnUserPageSizeYTextUpdated ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAGES_SETTINGS_BASE.

Definition at line 295 of file dialog_page_settings.cpp.

References GetPageLayoutInfoFromDialog(), m_initialized, DIALOG_PAGES_SETTINGS_BASE::m_TextUserSizeY, and UpdatePageLayoutExample().

Referenced by EnableWksFileNamePicker().

296 {
297  if( m_initialized && m_TextUserSizeY->IsModified() )
298  {
301  }
302 }
bool m_initialized
list of page sizes (not translated)
void DIALOG_PAGES_SETTINGS::OnWksFileSelection ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from DIALOG_PAGES_SETTINGS_BASE.

Definition at line 805 of file dialog_page_settings.cpp.

References Format(), GetChars(), GetPageLayoutInfoFromDialog(), GetWksFileName(), IsOK(), m_pagelayout, m_projectPath, WORKSHEET_LAYOUT::MakeShortFileName(), name, PageLayoutDescrFileWildcard(), WORKSHEET_LAYOUT::SetPageLayout(), SetWksFileName(), and UpdatePageLayoutExample().

Referenced by EnableWksFileNamePicker().

806 {
807  wxFileName fn = GetWksFileName();
808  wxString name = GetWksFileName();
809  wxString path;
810 
811  if( fn.IsAbsolute() )
812  {
813  path = fn.GetPath();
814  name = fn.GetFullName();
815  }
816  else
817  {
818  path = m_projectPath;
819  }
820 
821  // Display a file picker dialog
822  wxFileDialog fileDialog( this, _( "Select Page Layout Description File" ),
823  path, name, PageLayoutDescrFileWildcard(),
824  wxFD_DEFAULT_STYLE | wxFD_FILE_MUST_EXIST );
825 
826  if( fileDialog.ShowModal() != wxID_OK )
827  return;
828 
829  wxString fileName = fileDialog.GetPath();
830 
831  // Try to remove the path, if the path is the current working dir,
832  // or the dir of kicad.pro (template), and use a relative path
833  wxString shortFileName = WORKSHEET_LAYOUT::MakeShortFileName( fileName, m_projectPath );
834 
835  // For Win/Linux/macOS compatibility, a relative path is a good idea
836  if( shortFileName != GetWksFileName() && shortFileName != fileName )
837  {
838  wxString msg = wxString::Format( _(
839  "The page layout description file name has changed.\n"
840  "Do you want to use the relative path:\n"
841  "\"%s\"\n"
842  "instead of\n"
843  "\"%s\"?" ), GetChars( shortFileName ), GetChars( fileName ) );
844 
845  if( !IsOK( this, msg ) )
846  shortFileName = fileName;
847  }
848 
849  SetWksFileName( shortFileName );
850 
851  if( m_pagelayout == NULL )
853 
854  m_pagelayout->SetPageLayout( fileName );
855 
858 }
wxString PageLayoutDescrFileWildcard()
void SetWksFileName(const wxString &aFilename)
const wxString GetWksFileName()
WORKSHEET_LAYOUT handles the graphic items list to draw/plot the title block and other items (page re...
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
const char * name
Definition: DXF_plotter.cpp:61
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
static const wxString MakeShortFileName(const wxString &aFullFileName, const wxString &aProjectPath)
WORKSHEET_LAYOUT * m_pagelayout
Temporary title block (basic inscriptions).
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Function IsOK displays a yes/no dialog with aMessage and returns the user response.
Definition: confirm.cpp:233
void SetPageLayout(const wxString &aFullFileName=wxEmptyString, bool Append=false)
Populates the list with a custom layout, or the default layout, if no custom layout available...
PROJECT & KIWAY_HOLDER::Prj ( ) const
inherited

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

Definition at line 34 of file kiway_holder.cpp.

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

Referenced by SCH_EDIT_FRAME::AppendSchematic(), PCB_EDIT_FRAME::ArchiveModulesOnBoard(), DIALOG_SYMBOL_REMAP::backupProject(), LIB_VIEW_FRAME::BestZoom(), DIALOG_FOOTPRINT_FP_EDITOR::BrowseAndAdd3DShapeFile(), DIALOG_FOOTPRINT_BOARD_EDITOR::BrowseAndAdd3DShapeFile(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::BrowseAndSelectDocFile(), DIALOG_SYMBOL_LIB_TABLE::browseLibrariesHandler(), CVPCB_MAINFRAME::BuildLIBRARY_LISTBOX(), DIALOG_FOOTPRINT_FP_EDITOR::Cfg3DPath(), DIALOG_FOOTPRINT_BOARD_EDITOR::Cfg3DPath(), DIALOG_EDIT_COMPONENT_IN_LIBRARY::checkNewAlias(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToOptions(), PCB_BASE_EDIT_FRAME::CreateNewLibrary(), DIALOG_PLOT_SCHEMATIC::createPlotFileName(), DIALOG_SYMBOL_REMAP::createProjectSymbolLibTable(), FOOTPRINT_EDIT_FRAME::DeleteModuleFromCurrentLibrary(), DIALOG_CHOOSE_COMPONENT::DIALOG_CHOOSE_COMPONENT(), 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_SYMBOL_LIB_TABLE::DIALOG_SYMBOL_LIB_TABLE(), DIALOG_SYMBOL_REMAP::DIALOG_SYMBOL_REMAP(), LIB_VIEW_FRAME::DisplayLibInfos(), LIB_EDIT_FRAME::DisplayLibInfos(), SCH_BASE_FRAME::DisplayListComponentsInLib(), PCB_EDIT_FRAME::doAutoSave(), DIALOG_FOOTPRINT_FP_EDITOR::Edit3DShapeFileName(), DIALOG_FOOTPRINT_BOARD_EDITOR::Edit3DShapeFileName(), SCH_EDIT_FRAME::EditSheet(), PCB_EDIT_FRAME::Export_IDF3(), PCB_EDIT_FRAME::Files_io_from_id(), NETLIST_DIALOG::GenNetlist(), DISPLAY_FOOTPRINTS_FRAME::Get_Module(), FOOTPRINT_VIEWER_FRAME::getCurFootprintName(), LIB_EDIT_FRAME::GetCurLib(), FOOTPRINT_VIEWER_FRAME::getCurNickname(), FOOTPRINT_EDIT_FRAME::GetCurrentLib(), SCH_BASE_FRAME::GetLibAlias(), SCH_BASE_FRAME::GetLibPart(), FOOTPRINT_EDIT_FRAME::getLibPath(), LIB_EDIT_FRAME::getLibraryFileName(), DIALOG_SYMBOL_REMAP::getLibsNotInGlobalSymbolLibTable(), DIALOG_BOM::getPluginFileName(), LIB_VIEW_FRAME::getSelectedAlias(), FP_THREAD_IFACE::GetTable(), PCB_EDIT_FRAME::importFile(), SCH_EDIT_FRAME::importFile(), DIALOG_FOOTPRINT_FP_EDITOR::initModeditProperties(), DIALOG_FOOTPRINT_BOARD_EDITOR::InitModeditProperties(), PCB_EDIT_FRAME::InstallNetlistFrame(), SCH_EDIT_FRAME::IsSearchCacheObsolete(), KIWAY_HOLDER::Kiway(), SCH_EDIT_FRAME::Load_Component(), SCH_EDIT_FRAME::LoadCmpToFootprintLinkFile(), LIB_EDIT_FRAME::LoadComponentFromCurrentLib(), CVPCB_MAINFRAME::LoadFootprintFiles(), DIALOG_SPICE_MODEL::loadLibrary(), LIB_EDIT_FRAME::LoadOneSymbol(), CVPCB_MAINFRAME::LoadProjectFile(), SCH_EDIT_FRAME::LoadProjectFile(), PCB_EDIT_FRAME::LoadProjectSettings(), DIALOG_DRC_CONTROL::makeValidFileNameReport(), FOOTPRINT_VIEWER_FRAME::OnActivate(), DIALOG_GENCAD_EXPORT_OPTIONS::onBrowse(), DIALOG_DRC_CONTROL::OnButtonBrowseRptFileClick(), DIALOG_EDIT_COMPONENTS_LIBID::onClickOrphansButton(), CVPCB_MAINFRAME::OnEditFootprintLibraryTable(), SCH_BASE_FRAME::OnEditSymbolLibTable(), DIALOG_GENDRILL::OnGenReportFile(), DIALOG_CHOOSE_COMPONENT::OnIdle(), SCH_EDIT_FRAME::OnImportProject(), PCB_EDIT_FRAME::OnLeftClick(), DIALOG_NETLIST::OnOpenNetlistClick(), DIALOG_PLOT::OnOutputDirectoryBrowseClicked(), DIALOG_SVG_PRINT::OnOutputDirectoryBrowseClicked(), DIALOG_GENDRILL::OnOutputDirectoryBrowseClicked(), DIALOG_PLOT_SCHEMATIC::OnOutputDirectoryBrowseClicked(), LIB_EDIT_FRAME::OnPlotCurrentComponent(), DIALOG_SYMBOL_REMAP::OnRemapSymbols(), SCH_EDIT_FRAME::OnRightClick(), DIALOG_BOM::OnRunPlugin(), SCH_EDIT_FRAME::OnSaveProject(), DIALOG_CHOOSE_COMPONENT::OnSchViewPaint(), DIALOG_SPICE_MODEL::onSelectLibrary(), LIB_VIEW_FRAME::OnSelectSymbol(), DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnTestChipName(), FOOTPRINT_EDIT_FRAME::OnUpdateSelectCurrentLib(), LIB_EDIT_FRAME::OnViewEntryDoc(), LIB_VIEW_FRAME::onViewSymbolDocument(), SCH_EDIT_FRAME::OpenProjectFiles(), PCB_EDIT_FRAME::OpenProjectFiles(), SCH_EDIT_FRAME::PasteListOfItems(), DIALOG_CHOOSE_COMPONENT::PopulateFootprintSelector(), SCH_EDIT_FRAME::Process_Config(), PCB_EDIT_FRAME::Process_Config(), FOOTPRINT_EDIT_FRAME::ProcessPreferences(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), PCB_EDIT_FRAME::RecreateCmpFileFromBoard(), FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList(), LIB_VIEW_FRAME::ReCreateHToolbar(), FOOTPRINT_VIEWER_FRAME::ReCreateLibraryList(), LIB_VIEW_FRAME::ReCreateListCmp(), LIB_VIEW_FRAME::ReCreateListLib(), LIB_VIEW_FRAME::RedrawActiveWindow(), EDA_3D_VIEWER::ReloadRequest(), DIALOG_SYMBOL_REMAP::remapSymbolToLibTable(), FOOTPRINT_EDIT_FRAME::restoreLastFootprint(), FOOTPRINT_EDIT_FRAME::retainLastFootprint(), SCH_EDIT_FRAME::SaveEEFile(), FOOTPRINT_EDIT_FRAME::SaveFootprintInLibrary(), LIB_EDIT_FRAME::saveLibrary(), LIB_EDIT_FRAME::SaveOneSymbol(), CVPCB_MAINFRAME::SaveProjectFile(), SCH_EDIT_FRAME::SaveProjectSettings(), PCB_EDIT_FRAME::SaveProjectSettings(), SCH_BASE_FRAME::saveSymbolLibTables(), FOOTPRINT_VIEWER_FRAME::SelectAndViewFootprint(), SCH_BASE_FRAME::SelectComponentFromLibrary(), PCB_BASE_FRAME::SelectLibrary(), SCH_BASE_FRAME::SelectLibraryFromList(), LIB_EDIT_FRAME::selectSymLibTable(), SCH_EDIT_FRAME::sendNetlist(), FOOTPRINT_VIEWER_FRAME::setCurFootprintName(), LIB_EDIT_FRAME::SetCurLib(), FOOTPRINT_VIEWER_FRAME::setCurNickname(), LIB_EDIT_FRAME::SetCurPart(), DIALOG_CHOOSE_COMPONENT::ShowFootprintFor(), SIM_PLOT_FRAME::SIM_PLOT_FRAME(), LIB_MANAGER::symTable(), EDA_3D_VIEWER::takeScreenshot(), SIM_PLOT_FRAME::updateNetlistExporter(), SCH_SCREEN::UpdateSymbolLinks(), FOOTPRINT_VIEWER_FRAME::UpdateTitle(), FOOTPRINT_EDIT_FRAME::updateTitle(), SCH_EDIT_FRAME::WriteNetListFile(), DIALOG_FOOTPRINT_BOARD_EDITOR::~DIALOG_FOOTPRINT_BOARD_EDITOR(), and DIALOG_FOOTPRINT_FP_EDITOR::~DIALOG_FOOTPRINT_FP_EDITOR().

35 {
36  return Kiway().Prj();
37 }
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_player.h:60
VTBL_ENTRY PROJECT & Prj() const
Function Prj returns the PROJECT associated with this KIWAY.
Definition: kiway.cpp:142
bool DIALOG_PAGES_SETTINGS::SavePageSettings ( )
private

Definition at line 418 of file dialog_page_settings.cpp.

References PAGE_INFO::A, PAGE_INFO::A0, PAGE_INFO::A1, PAGE_INFO::A2, PAGE_INFO::A3, PAGE_INFO::A4, PAGE_INFO::B, PAGE_INFO::C, Clamp(), PAGE_INFO::Custom, PAGE_INFO::D, PAGE_INFO::E, Format(), g_UserUnit, PAGE_INFO::GERBER, GetChars(), TITLE_BLOCK::GetComment1(), TITLE_BLOCK::GetComment2(), TITLE_BLOCK::GetComment3(), TITLE_BLOCK::GetComment4(), TITLE_BLOCK::GetCompany(), GetCustomSizeMilsFromDialog(), TITLE_BLOCK::GetDate(), SCH_SCREENS::GetFirst(), SCH_SCREENS::GetNext(), TITLE_BLOCK::GetRevision(), WORKSHEET_LAYOUT::GetTheInstance(), TITLE_BLOCK::GetTitle(), SCH_SCREEN::GetTitleBlock(), GetWksFileName(), INCHES, DIALOG_PAGES_SETTINGS_BASE::m_Comment1Export, DIALOG_PAGES_SETTINGS_BASE::m_Comment2Export, DIALOG_PAGES_SETTINGS_BASE::m_Comment3Export, DIALOG_PAGES_SETTINGS_BASE::m_Comment4Export, DIALOG_PAGES_SETTINGS_BASE::m_CompanyExport, DIALOG_PAGES_SETTINGS_BASE::m_DateExport, m_layout_size, m_localPrjConfigChanged, DIALOG_PAGES_SETTINGS_BASE::m_orientationComboBox, m_pageFmt, m_pageInfo, BASE_SCREEN::m_PageLayoutDescrFileName, DIALOG_PAGES_SETTINGS_BASE::m_paperSizeComboBox, m_parent, m_projectPath, DIALOG_PAGES_SETTINGS_BASE::m_RevisionExport, m_screen, m_tb, DIALOG_PAGES_SETTINGS_BASE::m_TextComment1, DIALOG_PAGES_SETTINGS_BASE::m_TextComment2, DIALOG_PAGES_SETTINGS_BASE::m_TextComment3, DIALOG_PAGES_SETTINGS_BASE::m_TextComment4, DIALOG_PAGES_SETTINGS_BASE::m_TextCompany, DIALOG_PAGES_SETTINGS_BASE::m_TextDate, DIALOG_PAGES_SETTINGS_BASE::m_TextRevision, DIALOG_PAGES_SETTINGS_BASE::m_TextTitle, DIALOG_PAGES_SETTINGS_BASE::m_TitleExport, WORKSHEET_LAYOUT::MakeFullFileName(), MAX_PAGE_SIZE, MIN_PAGE_SIZE, TITLE_BLOCK::SetComment1(), TITLE_BLOCK::SetComment2(), TITLE_BLOCK::SetComment3(), TITLE_BLOCK::SetComment4(), TITLE_BLOCK::SetCompany(), PAGE_INFO::SetCustomHeightMils(), PAGE_INFO::SetCustomWidthMils(), TITLE_BLOCK::SetDate(), PAGE_INFO::SetHeightMils(), WORKSHEET_LAYOUT::SetPageLayout(), EDA_DRAW_FRAME::SetPageSettings(), PAGE_INFO::SetPortrait(), TITLE_BLOCK::SetRevision(), TITLE_BLOCK::SetTitle(), SCH_SCREEN::SetTitleBlock(), EDA_DRAW_FRAME::SetTitleBlock(), PAGE_INFO::SetType(), PAGE_INFO::SetWidthMils(), PAGE_INFO::USLedger, PAGE_INFO::USLegal, and PAGE_INFO::USLetter.

Referenced by EnableWksFileNamePicker(), and OnOkClick().

419 {
420  bool retSuccess = false;
421 
422  wxString fileName = GetWksFileName();
423 
425  {
426  wxString fullFileName =
428 
429  if( !fullFileName.IsEmpty() )
430  {
431 
432  if( !wxFileExists( fullFileName ) )
433  {
434  wxString msg;
435  msg.Printf( _("Page layout description file \"%s\" not found. Abort"),
436  GetChars( fullFileName ) );
437  wxMessageBox( msg );
438  return false;
439  }
440  }
441 
444  pglayout.SetPageLayout( fullFileName );
446  }
447 
448  int idx = m_paperSizeComboBox->GetSelection();
449 
450  if( idx < 0 )
451  idx = 0;
452 
453  const wxString paperType = m_pageFmt[idx];
454 
455  if( paperType.Contains( PAGE_INFO::Custom ) )
456  {
458 
459  retSuccess = m_pageInfo.SetType( PAGE_INFO::Custom );
460 
461  if( retSuccess )
462  {
465  {
466  wxString msg = wxString::Format( _( "Selected custom paper size\n"
467  "is out of the permissible limits\n"
468  "%.1f - %.1f %s!\nSelect another custom "
469  "paper size?" ),
470  g_UserUnit == INCHES ? MIN_PAGE_SIZE / 1000. : MIN_PAGE_SIZE * 25.4 / 1000,
471  g_UserUnit == INCHES ? MAX_PAGE_SIZE / 1000. : MAX_PAGE_SIZE * 25.4 / 1000,
472  g_UserUnit == INCHES ? _( "inches" ) : _( "mm" ) );
473 
474  if( wxMessageBox( msg, _( "Warning!" ),
475  wxYES_NO | wxICON_EXCLAMATION, this ) == wxYES )
476  {
477  return false;
478  }
479 
482  }
483 
486 
489  }
490  }
491  else
492  {
493  // search for longest common string first, e.g. A4 before A
494  if( paperType.Contains( PAGE_INFO::USLetter ) )
495  retSuccess = m_pageInfo.SetType( PAGE_INFO::USLetter );
496  else if( paperType.Contains( PAGE_INFO::USLegal ) )
497  retSuccess = m_pageInfo.SetType( PAGE_INFO::USLegal );
498  else if( paperType.Contains( PAGE_INFO::USLedger ) )
499  retSuccess = m_pageInfo.SetType( PAGE_INFO::USLedger );
500  else if( paperType.Contains( PAGE_INFO::GERBER ) )
501  retSuccess = m_pageInfo.SetType( PAGE_INFO::GERBER );
502  else if( paperType.Contains( PAGE_INFO::A4 ) )
503  retSuccess = m_pageInfo.SetType( PAGE_INFO::A4 );
504  else if( paperType.Contains( PAGE_INFO::A3 ) )
505  retSuccess = m_pageInfo.SetType( PAGE_INFO::A3 );
506  else if( paperType.Contains( PAGE_INFO::A2 ) )
507  retSuccess = m_pageInfo.SetType( PAGE_INFO::A2 );
508  else if( paperType.Contains( PAGE_INFO::A1 ) )
509  retSuccess = m_pageInfo.SetType( PAGE_INFO::A1 );
510  else if( paperType.Contains( PAGE_INFO::A0 ) )
511  retSuccess = m_pageInfo.SetType( PAGE_INFO::A0 );
512  else if( paperType.Contains( PAGE_INFO::A ) )
513  retSuccess = m_pageInfo.SetType( PAGE_INFO::A );
514  else if( paperType.Contains( PAGE_INFO::B ) )
515  retSuccess = m_pageInfo.SetType( PAGE_INFO::B );
516  else if( paperType.Contains( PAGE_INFO::C ) )
517  retSuccess = m_pageInfo.SetType( PAGE_INFO::C );
518  else if( paperType.Contains( PAGE_INFO::D ) )
519  retSuccess = m_pageInfo.SetType( PAGE_INFO::D );
520  else if( paperType.Contains( PAGE_INFO::E ) )
521  retSuccess = m_pageInfo.SetType( PAGE_INFO::E );
522 
523  if( retSuccess )
524  {
525  int choice = m_orientationComboBox->GetSelection();
526  m_pageInfo.SetPortrait( choice != 0 );
527  }
528  }
529 
530  if( !retSuccess )
531  {
532  wxASSERT_MSG( false, wxT( "the translation for paper size must preserve original spellings" ) );
534  }
535 
537 
538  m_tb.SetRevision( m_TextRevision->GetValue() );
539  m_tb.SetDate( m_TextDate->GetValue() );
540  m_tb.SetCompany( m_TextCompany->GetValue() );
541  m_tb.SetTitle( m_TextTitle->GetValue() );
542  m_tb.SetComment1( m_TextComment1->GetValue() );
543  m_tb.SetComment2( m_TextComment2->GetValue() );
544  m_tb.SetComment3( m_TextComment3->GetValue() );
545  m_tb.SetComment4( m_TextComment4->GetValue() );
546 
548 
549 
550 #ifdef EESCHEMA
551  // Exports settings to other sheets if requested:
552  SCH_SCREEN* screen;
553 
554  // Build the screen list
555  SCH_SCREENS ScreenList;
556 
557  // Update title blocks for all screens
558  for( screen = ScreenList.GetFirst(); screen != NULL; screen = ScreenList.GetNext() )
559  {
560  if( screen == m_screen )
561  continue;
562 
563  TITLE_BLOCK tb2 = screen->GetTitleBlock();
564 
565  if( m_RevisionExport->IsChecked() )
566  tb2.SetRevision( m_tb.GetRevision() );
567 
568  if( m_DateExport->IsChecked() )
569  tb2.SetDate( m_tb.GetDate() );
570 
571  if( m_TitleExport->IsChecked() )
572  tb2.SetTitle( m_tb.GetTitle() );
573 
574  if( m_CompanyExport->IsChecked() )
575  tb2.SetCompany( m_tb.GetCompany() );
576 
577  if( m_Comment1Export->IsChecked() )
578  tb2.SetComment1( m_tb.GetComment1() );
579 
580  if( m_Comment2Export->IsChecked() )
581  tb2.SetComment2( m_tb.GetComment2() );
582 
583  if( m_Comment3Export->IsChecked() )
584  tb2.SetComment3( m_tb.GetComment3() );
585 
586  if( m_Comment4Export->IsChecked() )
587  tb2.SetComment4( m_tb.GetComment4() );
588 
589  screen->SetTitleBlock( tb2 );
590  }
591 
592 #endif
593 
594  return true;
595 }
void SetComment1(const wxString &aComment)
Definition: title_block.h:116
virtual void SetPageSettings(const PAGE_INFO &aPageSettings)=0
static const wxChar A[]
Definition: page_info.h:64
SCH_SCREEN * GetNext()
const T & Clamp(const T &lower, const T &value, const T &upper)
Function Clamp limits value within the range lower <= value <= upper.
Definition: macros.h:127
const wxString & GetCompany() const
Definition: title_block.h:98
virtual void SetTitleBlock(const TITLE_BLOCK &aTitleBlock)=0
void SetRevision(const wxString &aRevision)
Definition: title_block.h:83
static const wxChar E[]
Definition: page_info.h:68
static const wxChar GERBER[]
Definition: page_info.h:69
TITLE_BLOCK m_tb
true if the page selection is custom
static const wxChar A3[]
Definition: page_info.h:60
static void SetCustomWidthMils(int aWidthInMils)
Function SetCustomWidthMils sets the width of Custom page in mils, for any custom page constructed or...
Definition: page_info.cpp:227
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:117
const wxString & GetComment4() const
Definition: title_block.h:123
void SetDate(const wxString &aDate)
Function SetDate sets the date field, and defaults to the current time and date.
Definition: title_block.h:73
const wxString & GetDate() const
Definition: title_block.h:78
static const wxChar Custom[]
"User" defined page type
Definition: page_info.h:73
static const wxChar D[]
Definition: page_info.h:67
const wxString GetWksFileName()
Class TITLE_BLOCK holds the information shown in the lower right corner of a plot, printout, or editing view.
Definition: title_block.h:39
wxSize m_layout_size
Temporary bitmap for the page layout example.
void SetComment4(const wxString &aComment)
Definition: title_block.h:119
static WORKSHEET_LAYOUT & GetTheInstance()
static function: returns the instance of WORKSHEET_LAYOUT used in the application ...
static wxString m_PageLayoutDescrFileName
the name of the page layout descr file, or emty to used the default pagelayout
Definition: base_screen.h:180
const wxString & GetTitle() const
Definition: title_block.h:64
static const wxChar USLegal[]
Definition: page_info.h:71
static const wxChar B[]
Definition: page_info.h:65
static const wxChar C[]
Definition: page_info.h:66
const wxString & GetRevision() const
Definition: title_block.h:88
#define MAX_PAGE_SIZE
Definition: page_info.h:223
Definition: common.h:145
void SetCompany(const wxString &aCompany)
Definition: title_block.h:93
static const wxChar A4[]
Definition: page_info.h:59
const wxString & GetComment3() const
Definition: title_block.h:122
void SetTitleBlock(const TITLE_BLOCK &aTitleBlock)
Definition: sch_screen.h:127
void SetTitle(const wxString &aTitle)
Definition: title_block.h:59
void SetHeightMils(int aHeightInMils)
Definition: page_info.cpp:253
const TITLE_BLOCK & GetTitleBlock() const
Definition: sch_screen.h:125
static const wxChar USLedger[]
Definition: page_info.h:72
const wxString & GetComment2() const
Definition: title_block.h:121
WORKSHEET_LAYOUT handles the graphic items list to draw/plot the title block and other items (page re...
EDA_UNITS_T g_UserUnit
Global variables definitions.
Definition: common.cpp:57
static const wxChar A1[]
Definition: page_info.h:62
static const wxChar USLetter[]
Definition: page_info.h:70
void SetComment2(const wxString &aComment)
Definition: title_block.h:117
const wxString & GetComment1() const
Definition: title_block.h:120
PAGE_INFO m_pageInfo
Logical page layout size.
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
void 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
static const wxString MakeFullFileName(const wxString &aShortFileName, const wxString &aProjectPath)
Static function.
void SetWidthMils(int aWidthInMils)
Definition: page_info.cpp:239
static const wxChar A2[]
Definition: page_info.h:61
SCH_SCREEN * GetFirst()
void SetComment3(const wxString &aComment)
Definition: title_block.h:118
#define MIN_PAGE_SIZE
Min and max page sizes for clamping.
Definition: page_info.h:222
void SetPortrait(bool aIsPortrait)
Function SetPortrait will rotate the paper page 90 degrees.
Definition: page_info.cpp:182
static void SetCustomHeightMils(int aHeightInMils)
Function SetCustomHeightMils sets the height of Custom page in mils, for any custom page constructed ...
Definition: page_info.cpp:233
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
Definition: sch_screen.h:503
void SetPageLayout(const wxString &aFullFileName=wxEmptyString, bool Append=false)
Populates the list with a custom layout, or the default layout, if no custom layout available...
static const wxChar A0[]
Definition: page_info.h:63
void DIALOG_PAGES_SETTINGS::SetCurrentPageSizeSelection ( const wxString &  aPaperSize)
private

Definition at line 598 of file dialog_page_settings.cpp.

References i, m_pageFmt, and DIALOG_PAGES_SETTINGS_BASE::m_paperSizeComboBox.

Referenced by EnableWksFileNamePicker(), and initDialog().

599 {
600  // search all the not translated label list containing our paper type
601  for( unsigned i = 0; i < m_pageFmt.GetCount(); ++i )
602  {
603  // parse each label looking for aPaperSize within it
604  wxStringTokenizer st( m_pageFmt[i] );
605 
606  while( st.HasMoreTokens() )
607  {
608  if( st.GetNextToken() == aPaperSize )
609  {
610  m_paperSizeComboBox->SetSelection( i );
611  return;
612  }
613  }
614  }
615 }
size_t i
Definition: json11.cpp:597
void KIWAY_HOLDER::SetKiway ( wxWindow *  aDest,
KIWAY aKiway 
)
inherited

Function SetKiway.

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

Definition at line 41 of file kiway_holder.cpp.

References KIWAY_HOLDER::m_kiway, and name.

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

42 {
43 #if defined(DEBUG)
44  // offer a trap point for debugging most any window
45  wxASSERT( aDest );
46  if( !strcmp( typeid(aDest).name(), "DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB" ) )
47  {
48  int breakhere=1;
49  (void) breakhere;
50  }
51 #endif
52 
53  (void) aDest;
54 
55  m_kiway = aKiway;
56 }
KIWAY * m_kiway
Definition: kiway_player.h:85
const char * name
Definition: DXF_plotter.cpp:61
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 118 of file dialog_shim.cpp.

Referenced by DIALOG_CHOOSE_COMPONENT::DIALOG_CHOOSE_COMPONENT(), DIALOG_EDIT_COMPONENTS_LIBID::DIALOG_EDIT_COMPONENTS_LIBID(), DIALOG_FIELDS_EDITOR_GLOBAL::DIALOG_FIELDS_EDITOR_GLOBAL(), DIALOG_RESCUE_EACH::DIALOG_RESCUE_EACH(), DIALOG_SYMBOL_LIB_TABLE::DIALOG_SYMBOL_LIB_TABLE(), HOTKEYS_EDITOR_DIALOG::HOTKEYS_EDITOR_DIALOG(), HTML_MESSAGE_BOX::HTML_MESSAGE_BOX(), DIALOG_SHIM::IsQuasiModal(), DIALOG_LAYERS_SETUP::OnInitDialog(), and HTML_MESSAGE_BOX::SetDialogSizeInDU().

119 {
120  wxSize sz( x, y );
121  SetSize( ConvertDialogToPixels( sz ) );
122 }
void DIALOG_PAGES_SETTINGS::SetWksFileName ( const wxString &  aFilename)
inline
bool DIALOG_SHIM::Show ( bool  show)
overrideinherited

Definition at line 146 of file dialog_shim.cpp.

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

Referenced by DisplayHotkeyList(), DIALOG_SHIM::EndQuasiModal(), InvokeDialogERC(), DIALOG_SHIM::IsQuasiModal(), DIALOG_SCH_FIND::OnCancel(), DIALOG_DRC_CONTROL::OnLeftDClickClearance(), DIALOG_DRC_CONTROL::OnLeftDClickUnconnected(), DIALOG_DRC_CONTROL::OnPopupMenu(), DIALOG_EXCHANGE_FOOTPRINTS::OnQuit(), POSITION_RELATIVE_TOOL::PositionRelative(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), SCH_COMPONENT::SetPosition(), DRC::ShowDRCDialog(), and DIALOG_SHIM::ShowQuasiModal().

147 {
148  bool ret;
149  const char* hash_key;
150 
151  if( m_hash_key.size() )
152  {
153  // a special case like EDA_LIST_DIALOG, which has multiple uses.
154  hash_key = m_hash_key.c_str();
155  }
156  else
157  {
158  hash_key = typeid(*this).name();
159  }
160 
161  // Show or hide the window. If hiding, save current position and size.
162  // If showing, use previous position and size.
163  if( show )
164  {
165 #ifndef __WINDOWS__
166  wxDialog::Raise(); // Needed on OS X and some other window managers (i.e. Unity)
167 #endif
168  ret = wxDialog::Show( show );
169 
170  // classname is key, returns a zeroed out default EDA_RECT if none existed before.
171  EDA_RECT savedDialogRect = class_map[ hash_key ];
172 
173  if( savedDialogRect.GetSize().x != 0 && savedDialogRect.GetSize().y != 0 )
174  {
175  SetSize( savedDialogRect.GetPosition().x,
176  savedDialogRect.GetPosition().y,
177  std::max( wxDialog::GetSize().x, savedDialogRect.GetSize().x ),
178  std::max( wxDialog::GetSize().y, savedDialogRect.GetSize().y ),
179  0 );
180  }
181 
182  // Be sure that the dialog appears in a visible area
183  // (the dialog position might have been stored at the time when it was
184  // shown on another display)
185  if( wxDisplay::GetFromWindow( this ) == wxNOT_FOUND )
186  Centre();
187  }
188  else
189  {
190  // Save the dialog's position & size before hiding, using classname as key
191  class_map[ hash_key ] = EDA_RECT( wxDialog::GetPosition(), wxDialog::GetSize() );
192 
193 #ifdef __WXMAC__
194  if ( m_eventLoop )
195  m_eventLoop->Exit( GetReturnCode() ); // Needed for APP-MODAL dlgs on OSX
196 #endif
197 
198  ret = wxDialog::Show( show );
199  }
200 
201  return ret;
202 }
const wxSize GetSize() const
Definition: eda_rect.h:101
std::string m_hash_key
Definition: dialog_shim.h:151
static RECT_MAP class_map
const wxPoint GetPosition() const
Definition: eda_rect.h:113
#define max(a, b)
Definition: auxiliary.h:86
Class EDA_RECT handles the component boundary box.
Definition: eda_rect.h:44
int DIALOG_SHIM::ShowQuasiModal ( )
inherited

Definition at line 558 of file dialog_shim.cpp.

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

Referenced by SCH_EDIT_FRAME::EditComponent(), SCH_EDIT_FRAME::EditComponentFieldText(), LIB_EDIT_FRAME::EditField(), EDIT_TOOL::ExchangeFootprints(), PCB_EDIT_FRAME::InstallExchangeModuleFrame(), LIB_EDIT_FRAME::InstallFieldsEditorDialog(), SCH_EDIT_FRAME::InstallHierarchyFrame(), InvokeDialogCreateBOMEditor(), InvokeDialogEditComponentsLibId(), InvokeDialogUpdateFields(), SCH_EDIT_FRAME::OnRemapSymbols(), LIB_VIEW_FRAME::OnSelectSymbol(), SCH_EDIT_FRAME::OpenProjectFiles(), and SCH_BASE_FRAME::SelectComponentFromLibrary().

559 {
560  // This is an exception safe way to zero a pointer before returning.
561  // Yes, even though DismissModal() clears this first normally, this is
562  // here in case there's an exception before the dialog is dismissed.
563  struct NULLER
564  {
565  void*& m_what;
566  NULLER( void*& aPtr ) : m_what( aPtr ) {}
567  ~NULLER() { m_what = 0; } // indeed, set it to NULL on destruction
568  } clear_this( (void*&) m_qmodal_loop );
569 
570  // release the mouse if it's currently captured as the window having it
571  // will be disabled when this dialog is shown -- but will still keep the
572  // capture making it impossible to do anything in the modal dialog itself
573  wxWindow* win = wxWindow::GetCapture();
574  if( win )
575  win->ReleaseMouse();
576 
577  // Get the optimal parent
578  wxWindow* parent = GetParentForModalDialog( GetParent(), GetWindowStyle() );
579 
580  // Show the optimal parent
581  DBG( if( parent ) printf( "%s: optimal parent: %s\n", __func__, typeid(*parent).name() );)
582 
583  wxASSERT_MSG( !m_qmodal_parent_disabler,
584  wxT( "Caller using ShowQuasiModal() twice on same window?" ) );
585 
586  // quasi-modal: disable only my "optimal" parent
588 
589 #ifdef __WXMAC__
590  // Apple in its infinite wisdom will raise a disabled window before even passing
591  // us the event, so we have no way to stop it. Instead, we must set an order on
592  // the windows so that the quasi-modal will be pushed in front of the disabled
593  // window when it is raised.
594  ReparentQuasiModal();
595 #endif
596  Show( true );
597 
598  m_qmodal_showing = true;
599 
600  EVENT_LOOP event_loop;
601 
602  m_qmodal_loop = &event_loop;
603 
604  event_loop.Run();
605 
606  return GetReturnCode();
607 }
bool m_qmodal_showing
Definition: dialog_shim.h:155
EVENT_LOOP * m_qmodal_loop
Definition: dialog_shim.h:154
bool Show(bool show) override
WDO_ENABLE_DISABLE * m_qmodal_parent_disabler
Definition: dialog_shim.h:156
Toggle a window&#39;s "enable" status to disabled, then enabled on destruction.
Definition: dialog_shim.cpp:33
#define DBG(x)
Definition: fctsys.h:33
void DIALOG_PAGES_SETTINGS::UpdatePageLayoutExample ( )
private

Definition at line 618 of file dialog_page_settings.cpp.

References Clamp(), DARKGRAY, DrawPageLayout(), GRResetPenAndBrush(), KiROUND(), m_customFmt, m_layout_size, BASE_SCREEN::m_NumberOfScreens, m_page_bitmap, m_pageFmt, m_pagelayout, DIALOG_PAGES_SETTINGS_BASE::m_PageLayoutExampleBitmap, DIALOG_PAGES_SETTINGS_BASE::m_paperSizeComboBox, m_screen, BASE_SCREEN::m_ScreenNumber, m_tb, MAX_PAGE_EXAMPLE_SIZE, MAX_PAGE_SIZE, BASE_SCREEN::MilsToIuScalar(), MIN_PAGE_SIZE, RED, Refresh(), WORKSHEET_LAYOUT::SetAltInstance(), PAGE_INFO::SetHeightMils(), PAGE_INFO::SetType(), and PAGE_INFO::SetWidthMils().

Referenced by EnableWksFileNamePicker(), initDialog(), OnComment1TextUpdated(), OnComment2TextUpdated(), OnComment3TextUpdated(), OnComment4TextUpdated(), OnCompanyTextUpdated(), OnDateTextUpdated(), OnPageOrientationChoice(), OnPaperSizeChoice(), OnRevisionTextUpdated(), OnTitleTextUpdated(), OnUserPageSizeXTextUpdated(), OnUserPageSizeYTextUpdated(), and OnWksFileSelection().

619 {
620  int lyWidth, lyHeight;
621 
622  wxSize clamped_layout_size( Clamp( MIN_PAGE_SIZE, m_layout_size.x, MAX_PAGE_SIZE ),
624 
625  double lyRatio = clamped_layout_size.x < clamped_layout_size.y ?
626  (double) clamped_layout_size.y / clamped_layout_size.x :
627  (double) clamped_layout_size.x / clamped_layout_size.y;
628 
629  if( clamped_layout_size.x < clamped_layout_size.y )
630  {
631  lyHeight = MAX_PAGE_EXAMPLE_SIZE;
632  lyWidth = KiROUND( (double) lyHeight / lyRatio );
633  }
634  else
635  {
636  lyWidth = MAX_PAGE_EXAMPLE_SIZE;
637  lyHeight = KiROUND( (double) lyWidth / lyRatio );
638  }
639 
640  if( m_page_bitmap )
641  {
642  m_PageLayoutExampleBitmap->SetBitmap( wxNullBitmap );
643  delete m_page_bitmap;
644  }
645 
646  m_page_bitmap = new wxBitmap( lyWidth + 1, lyHeight + 1 );
647 
648  if( m_page_bitmap->IsOk() )
649  {
650  // Calculate layout preview scale.
651  int appScale = m_screen->MilsToIuScalar();
652 
653  double scaleW = (double) lyWidth / clamped_layout_size.x / appScale;
654  double scaleH = (double) lyHeight / clamped_layout_size.y / appScale;
655 
656  // Prepare DC.
657  wxSize example_size( lyWidth + 1, lyHeight + 1 );
658  wxMemoryDC memDC;
659  memDC.SelectObject( *m_page_bitmap );
660  memDC.SetClippingRegion( wxPoint( 0, 0 ), example_size );
661  memDC.Clear();
662  memDC.SetUserScale( scaleW, scaleH );
663 
664  // Get logical page size and margins.
665  PAGE_INFO pageDUMMY;
666 
667  // Get page type
668  int idx = m_paperSizeComboBox->GetSelection();
669 
670  if( idx < 0 )
671  idx = 0;
672 
673  wxString pageFmtName = m_pageFmt[idx].BeforeFirst( ' ' );
674  bool portrait = clamped_layout_size.x < clamped_layout_size.y;
675  pageDUMMY.SetType( pageFmtName, portrait );
676  if( m_customFmt )
677  {
678  pageDUMMY.SetWidthMils( clamped_layout_size.x );
679  pageDUMMY.SetHeightMils( clamped_layout_size.y );
680  }
681 
682  // Draw layout preview.
683  wxString emptyString;
684  GRResetPenAndBrush( &memDC );
685 
687  DrawPageLayout( &memDC, NULL, pageDUMMY,
688  emptyString, emptyString,
690  m_screen->m_ScreenNumber, 1, appScale, DARKGRAY, RED );
691 
692  memDC.SelectObject( wxNullBitmap );
695 
696  // Refresh the dialog.
697  Layout();
698  Refresh();
699  }
700 }
void GRResetPenAndBrush(wxDC *DC)
Definition: gr_basic.cpp:218
int m_ScreenNumber
Definition: base_screen.h:216
#define MAX_PAGE_EXAMPLE_SIZE
const T & Clamp(const T &lower, const T &value, const T &upper)
Function Clamp limits value within the range lower <= value <= upper.
Definition: macros.h:127
static int KiROUND(double v)
KiROUND rounds a floating point number to an int using "round halfway cases away from zero"...
Definition: common.h:107
TITLE_BLOCK m_tb
true if the page selection is custom
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:117
wxSize m_layout_size
Temporary bitmap for the page layout example.
wxBitmap * m_page_bitmap
the page layuout filename was changed
void Refresh()
Update the board display after modifying it bu a python script (note: it is automatically called by a...
Class PAGE_INFO describes the page size and margins of a paper page on which to eventually print or p...
Definition: page_info.h:49
#define MAX_PAGE_SIZE
Definition: page_info.h:223
Definition: colors.h:60
virtual int MilsToIuScalar()
Function MilsToIuScalar returns the scalar required to convert mils to internal units.
Definition: base_screen.h:245
void SetHeightMils(int aHeightInMils)
Definition: page_info.cpp:253
void DrawPageLayout(wxDC *aDC, EDA_RECT *aClipBox, const PAGE_INFO &aPageInfo, const wxString &aFullSheetName, const wxString &aFileName, TITLE_BLOCK &aTitleBlock, int aSheetCount, int aSheetNumber, int aPenWidth, double aScalar, COLOR4D aColor, COLOR4D aAltColor, const wxString &aSheetLayer)
Function DrawPageLayout is a core function to draw the page layout with the frame and the basic inscr...
Definition: worksheet.cpp:48
WORKSHEET_LAYOUT * m_pagelayout
Temporary title block (basic inscriptions).
void SetWidthMils(int aWidthInMils)
Definition: page_info.cpp:239
bool m_customFmt
Temporary page info.
int m_NumberOfScreens
Definition: base_screen.h:217
#define MIN_PAGE_SIZE
Min and max page sizes for clamping.
Definition: page_info.h:222
static void SetAltInstance(WORKSHEET_LAYOUT *aLayout=NULL)
static function: Set an alternate instance of WORKSHEET_LAYOUT mainly used in page setting dialog ...
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 132 of file dialog_shim.cpp.

Referenced by DIALOG_CHOOSE_COMPONENT::DIALOG_CHOOSE_COMPONENT(), DIALOG_EDIT_COMPONENTS_LIBID::DIALOG_EDIT_COMPONENTS_LIBID(), DIALOG_SHIM::IsQuasiModal(), and DIALOG_LAYERS_SETUP::OnInitDialog().

133 {
134  wxSize sz( 0, y );
135  return ConvertDialogToPixels( sz ).y;
136 }

Member Data Documentation

wxButton* DIALOG_PAGES_SETTINGS_BASE::m_ApplyDate
protectedinherited
wxButton* DIALOG_PAGES_SETTINGS_BASE::m_buttonBrowse
protectedinherited
wxCheckBox* DIALOG_PAGES_SETTINGS_BASE::m_Comment1Export
protectedinherited
wxCheckBox* DIALOG_PAGES_SETTINGS_BASE::m_Comment2Export
protectedinherited
wxCheckBox* DIALOG_PAGES_SETTINGS_BASE::m_Comment3Export
protectedinherited
wxCheckBox* DIALOG_PAGES_SETTINGS_BASE::m_Comment4Export
protectedinherited
wxCheckBox* DIALOG_PAGES_SETTINGS_BASE::m_CompanyExport
protectedinherited
bool DIALOG_PAGES_SETTINGS::m_customFmt
private

Temporary page info.

Definition at line 47 of file dialog_page_settings.h.

Referenced by DIALOG_PAGES_SETTINGS(), initDialog(), OnPaperSizeChoice(), and UpdatePageLayoutExample().

wxCheckBox* DIALOG_PAGES_SETTINGS_BASE::m_DateExport
protectedinherited
bool DIALOG_SHIM::m_fixupsRun
protectedinherited

Definition at line 149 of file dialog_shim.h.

Referenced by DIALOG_SHIM::OnPaint().

std::string DIALOG_SHIM::m_hash_key
protectedinherited
wxSize DIALOG_PAGES_SETTINGS::m_layout_size
private

Temporary bitmap for the page layout example.

Definition at line 45 of file dialog_page_settings.h.

Referenced by GetCustomSizeMilsFromDialog(), GetPageLayoutInfoFromDialog(), SavePageSettings(), and UpdatePageLayoutExample().

bool DIALOG_PAGES_SETTINGS::m_localPrjConfigChanged
private
wxBitmap* DIALOG_PAGES_SETTINGS::m_page_bitmap
private

the page layuout filename was changed

Definition at line 44 of file dialog_page_settings.h.

Referenced by DIALOG_PAGES_SETTINGS(), UpdatePageLayoutExample(), and ~DIALOG_PAGES_SETTINGS().

wxArrayString DIALOG_PAGES_SETTINGS::m_pageFmt
private
PAGE_INFO DIALOG_PAGES_SETTINGS::m_pageInfo
private

Logical page layout size.

Definition at line 46 of file dialog_page_settings.h.

Referenced by initDialog(), and SavePageSettings().

WORKSHEET_LAYOUT* DIALOG_PAGES_SETTINGS::m_pagelayout
private

Temporary title block (basic inscriptions).

Definition at line 49 of file dialog_page_settings.h.

Referenced by DIALOG_PAGES_SETTINGS(), OnWksFileSelection(), UpdatePageLayoutExample(), and ~DIALOG_PAGES_SETTINGS().

wxStaticBitmap* DIALOG_PAGES_SETTINGS_BASE::m_PageLayoutExampleBitmap
protectedinherited
EDA_DRAW_FRAME* DIALOG_PAGES_SETTINGS::m_parent
private
wxDatePickerCtrl* DIALOG_PAGES_SETTINGS_BASE::m_PickDate
protectedinherited
wxString DIALOG_PAGES_SETTINGS::m_projectPath
private
EVENT_LOOP* DIALOG_SHIM::m_qmodal_loop
protectedinherited

Definition at line 154 of file dialog_shim.h.

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

WDO_ENABLE_DISABLE* DIALOG_SHIM::m_qmodal_parent_disabler
protectedinherited
bool DIALOG_SHIM::m_qmodal_showing
protectedinherited
wxCheckBox* DIALOG_PAGES_SETTINGS_BASE::m_RevisionExport
protectedinherited
BASE_SCREEN* DIALOG_PAGES_SETTINGS::m_screen
private
wxStdDialogButtonSizer* DIALOG_PAGES_SETTINGS_BASE::m_sdbSizer
protectedinherited
wxButton* DIALOG_PAGES_SETTINGS_BASE::m_sdbSizerCancel
protectedinherited
wxButton* DIALOG_PAGES_SETTINGS_BASE::m_sdbSizerOK
protectedinherited
wxStaticLine* DIALOG_PAGES_SETTINGS_BASE::m_staticline1
protectedinherited
wxStaticLine* DIALOG_PAGES_SETTINGS_BASE::m_staticline2
protectedinherited
wxStaticLine* DIALOG_PAGES_SETTINGS_BASE::m_staticline3
protectedinherited
wxStaticText* DIALOG_PAGES_SETTINGS_BASE::m_staticText13
protectedinherited
wxStaticText* DIALOG_PAGES_SETTINGS_BASE::m_staticTextComment1
protectedinherited
wxStaticText* DIALOG_PAGES_SETTINGS_BASE::m_staticTextComment2
protectedinherited
wxStaticText* DIALOG_PAGES_SETTINGS_BASE::m_staticTextComment3
protectedinherited
wxStaticText* DIALOG_PAGES_SETTINGS_BASE::m_staticTextComment4
protectedinherited
wxStaticText* DIALOG_PAGES_SETTINGS_BASE::m_staticTextCustSize
protectedinherited
wxStaticText* DIALOG_PAGES_SETTINGS_BASE::m_staticTextDate
protectedinherited
wxStaticText* DIALOG_PAGES_SETTINGS_BASE::m_staticTextfilename
protectedinherited
wxStaticText* DIALOG_PAGES_SETTINGS_BASE::m_staticTextHeight
protectedinherited
wxStaticText* DIALOG_PAGES_SETTINGS_BASE::m_staticTextOrient
protectedinherited
wxStaticText* DIALOG_PAGES_SETTINGS_BASE::m_staticTextPaper
protectedinherited
wxStaticText* DIALOG_PAGES_SETTINGS_BASE::m_staticTextPreview
protectedinherited
wxStaticText* DIALOG_PAGES_SETTINGS_BASE::m_staticTextRev
protectedinherited
wxStaticText* DIALOG_PAGES_SETTINGS_BASE::m_staticTextSize
protectedinherited
wxStaticText* DIALOG_PAGES_SETTINGS_BASE::m_staticTexttbprm
protectedinherited
wxStaticText* DIALOG_PAGES_SETTINGS_BASE::m_staticTextTitle
protectedinherited
wxStaticText* DIALOG_PAGES_SETTINGS_BASE::m_staticTextWidth
protectedinherited
wxTextCtrl* DIALOG_PAGES_SETTINGS_BASE::m_TextComment1
protectedinherited
wxTextCtrl* DIALOG_PAGES_SETTINGS_BASE::m_TextComment2
protectedinherited
wxTextCtrl* DIALOG_PAGES_SETTINGS_BASE::m_TextComment3
protectedinherited
wxTextCtrl* DIALOG_PAGES_SETTINGS_BASE::m_TextComment4
protectedinherited
wxTextCtrl* DIALOG_PAGES_SETTINGS_BASE::m_TextCompany
protectedinherited
wxTextCtrl* DIALOG_PAGES_SETTINGS_BASE::m_textCtrlFilePicker
protectedinherited
wxTextCtrl* DIALOG_PAGES_SETTINGS_BASE::m_TextRevision
protectedinherited
wxStaticText* DIALOG_PAGES_SETTINGS_BASE::m_TextSheetCount
protectedinherited
wxStaticText* DIALOG_PAGES_SETTINGS_BASE::m_TextSheetNumber
protectedinherited
wxTextCtrl* DIALOG_PAGES_SETTINGS_BASE::m_TextTitle
protectedinherited
wxCheckBox* DIALOG_PAGES_SETTINGS_BASE::m_TitleExport
protectedinherited

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