KiCad PCB EDA Suite
dialog_page_settings.h
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) 1992-2018 Kicad Developers, see AUTHORS.txt for contributors.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, you may find one here:
18  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19  * or you may search the http://www.gnu.org website for the version 2 license,
20  * or you may write to the Free Software Foundation, Inc.,
21  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22  */
23 
24 #ifndef _DIALOG_PAGES_SETTINGS_H_
25 #define _DIALOG_PAGES_SETTINGS_H_
26 
27 #include <widgets/unit_binder.h>
29 
35 {
36 private:
39  wxString m_projectPath; // the curr project path
40  wxArrayString m_pageFmt;
43  wxBitmap* m_page_bitmap;
44  wxSize m_layout_size;
47  bool m_customFmt;
49  WORKSHEET_LAYOUT *m_pagelayout; // the alternate and temporary page layout shown by the dialog
50  // when the initial one is replaced by a new one
53 
54 public:
55  DIALOG_PAGES_SETTINGS( EDA_DRAW_FRAME* parent, wxSize aMaxUserSizeMils );
57 
58  const wxString GetWksFileName()
59  {
60  return m_textCtrlFilePicker->GetValue();
61  }
62 
63  void SetWksFileName(const wxString& aFilename )
64  {
65  m_textCtrlFilePicker->SetValue( aFilename );
66  }
67 
68  void EnableWksFileNamePicker( bool aEnable )
69  {
70  m_textCtrlFilePicker->Enable( aEnable );
71  m_buttonBrowse->Enable( aEnable );
72  }
73 
74 private:
75  void initDialog(); // Initialisation of member variables
76 
77  // event handler for button OK
78  void OnOkClick( wxCommandEvent& event ) override;
79 
80  // event handlers for page size choice
81  void OnPaperSizeChoice( wxCommandEvent& event ) override;
82  void OnUserPageSizeXTextUpdated( wxCommandEvent& event ) override;
83  void OnUserPageSizeYTextUpdated( wxCommandEvent& event ) override;
84  void OnPageOrientationChoice( wxCommandEvent& event ) override;
85 
86  // event handler for texts in title block
87  void OnRevisionTextUpdated( wxCommandEvent& event ) override;
88  void OnDateTextUpdated( wxCommandEvent& event ) override;
89  void OnTitleTextUpdated( wxCommandEvent& event ) override;
90  void OnCompanyTextUpdated( wxCommandEvent& event ) override;
91  void OnComment1TextUpdated( wxCommandEvent& event ) override;
92  void OnComment2TextUpdated( wxCommandEvent& event ) override;
93  void OnComment3TextUpdated( wxCommandEvent& event ) override;
94  void OnComment4TextUpdated( wxCommandEvent& event ) override;
95 
96  // Handle button click for setting the date from the picker
97  void OnDateApplyClick( wxCommandEvent& event ) override;
98 
99  // .kicad_wks file description selection
100  void OnWksFileSelection( wxCommandEvent& event ) override;
101 
102  // Save in the current title block the new page settings
103  // return true if changes are made, or false if not
104  bool SavePageSettings();
105 
106  void SetCurrentPageSizeSelection( const wxString& aPaperSize );
107 
108  // Update page layout example
110 
111  // Get page layout info from selected dialog items
113 
114  // Get custom page size in mils from dialog
116 
120 };
121 
122 #endif // _DIALOG_PAGES_SETTINGS_H_
void OnDateApplyClick(wxCommandEvent &event) override
wxSize m_maxPageSizeMils
Logical page layout size.
void OnPageOrientationChoice(wxCommandEvent &event) override
void OnComment3TextUpdated(wxCommandEvent &event) override
TITLE_BLOCK m_tb
true if the page selection is custom
void SetWksFileName(const wxString &aFilename)
void OnUserPageSizeXTextUpdated(wxCommandEvent &event) override
const wxString GetWksFileName()
bool m_initialized
list of page sizes (not translated)
The base class for create windows for drawing purpose.
Definition: draw_frame.h:78
Class TITLE_BLOCK holds the information shown in the lower right corner of a plot, printout, or editing view.
Definition: title_block.h:40
wxSize m_layout_size
Temporary bitmap for the page layout example.
wxBitmap * m_page_bitmap
the page layuout filename was changed
void OnComment1TextUpdated(wxCommandEvent &event) override
void EnableWksFileNamePicker(bool aEnable)
Class PAGE_INFO describes the page size and margins of a paper page on which to eventually print or p...
Definition: page_info.h:54
Class BASE_SCREEN handles how to draw a screen (a board, a schematic ...)
Definition: base_screen.h:76
void OnDateTextUpdated(wxCommandEvent &event) override
void SetCurrentPageSizeSelection(const wxString &aPaperSize)
DIALOG_PAGES_SETTINGS(EDA_DRAW_FRAME *parent, wxSize aMaxUserSizeMils)
WORKSHEET_LAYOUT handles the graphic items list to draw/plot the title block and other items (page re...
void OnWksFileSelection(wxCommandEvent &event) override
Class DIALOG_PAGES_SETTINGS_BASE.
void OnOkClick(wxCommandEvent &event) override
PAGE_INFO m_pageInfo
The max page size allowed by the caller frame.
void OnComment4TextUpdated(wxCommandEvent &event) override
void OnUserPageSizeYTextUpdated(wxCommandEvent &event) override
WORKSHEET_LAYOUT * m_pagelayout
Temporary title block (basic inscriptions).
bool m_customFmt
Temporary page info.
void OnComment2TextUpdated(wxCommandEvent &event) override
void OnPaperSizeChoice(wxCommandEvent &event) override
void OnTitleTextUpdated(wxCommandEvent &event) override
void OnCompanyTextUpdated(wxCommandEvent &event) override
void OnRevisionTextUpdated(wxCommandEvent &event) override