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-2013 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 
28 
29 #define MAX_PAGE_EXAMPLE_SIZE 200
30 
36 {
37 private:
40  wxString m_projectPath; // the curr project path
41  wxArrayString m_pageFmt;
44  wxBitmap* m_page_bitmap;
45  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
51 
52 public:
55 
56  const wxString GetWksFileName()
57  {
58  return m_textCtrlFilePicker->GetValue();
59  }
60 
61  void SetWksFileName(const wxString& aFilename )
62  {
63  m_textCtrlFilePicker->SetValue( aFilename );
64  }
65 
66  void EnableWksFileNamePicker( bool aEnable )
67  {
68  m_textCtrlFilePicker->Enable( aEnable );
69  m_buttonBrowse->Enable( aEnable );
70  }
71 
72 private:
73  void initDialog(); // Initialisation of member variables
74 
75  // event handler for button OK
76  void OnOkClick( wxCommandEvent& event ) override;
77 
78  // event handlers for page size choice
79  void OnPaperSizeChoice( wxCommandEvent& event ) override;
80  void OnUserPageSizeXTextUpdated( wxCommandEvent& event ) override;
81  void OnUserPageSizeYTextUpdated( wxCommandEvent& event ) override;
82  void OnPageOrientationChoice( wxCommandEvent& event ) override;
83 
84  // event handler for texts in title block
85  void OnRevisionTextUpdated( wxCommandEvent& event ) override;
86  void OnDateTextUpdated( wxCommandEvent& event ) override;
87  void OnTitleTextUpdated( wxCommandEvent& event ) override;
88  void OnCompanyTextUpdated( wxCommandEvent& event ) override;
89  void OnComment1TextUpdated( wxCommandEvent& event ) override;
90  void OnComment2TextUpdated( wxCommandEvent& event ) override;
91  void OnComment3TextUpdated( wxCommandEvent& event ) override;
92  void OnComment4TextUpdated( wxCommandEvent& event ) override;
93 
94  // Handle button click for setting the date from the picker
95  void OnDateApplyClick( wxCommandEvent& event ) override;
96 
97  // .kicad_wks file description selection
98  void OnWksFileSelection( wxCommandEvent& event ) override;
99 
100  // Save in the current title block the new page settings
101  // return true if changes are made, or false if not
102  bool SavePageSettings();
103 
104  void SetCurrentPageSizeSelection( const wxString& aPaperSize );
105 
106  // Update page layout example
108 
109  // Get page layout info from selected dialog items
111 
112  // Get custom page size in mils from dialog
114 
118 };
119 
120 #endif // _DIALOG_PAGES_SETTINGS_H_
void OnDateApplyClick(wxCommandEvent &event) override
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)
Class EDA_DRAW_FRAME is the base class for create windows for drawing purpose.
Definition: draw_frame.h:54
Class TITLE_BLOCK holds the information shown in the lower right corner of a plot, printout, or editing view.
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...
Class BASE_SCREEN handles how to draw a screen (a board, a schematic ...)
void OnDateTextUpdated(wxCommandEvent &event) override
void SetCurrentPageSizeSelection(const wxString &aPaperSize)
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
Logical page layout size.
void OnComment4TextUpdated(wxCommandEvent &event) override
void OnUserPageSizeYTextUpdated(wxCommandEvent &event) override
WORKSHEET_LAYOUT * m_pagelayout
Temporary title block (basic inscriptions).
DIALOG_PAGES_SETTINGS(EDA_DRAW_FRAME *parent)
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