KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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) 2020-2023 KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef _DIALOG_PAGES_SETTINGS_H_
21#define _DIALOG_PAGES_SETTINGS_H_
22
23#include <page_info.h>
24#include <title_block.h>
25#include <widgets/unit_binder.h>
28
29class DS_DATA_MODEL;
30class EDA_DRAW_FRAME;
31class BASE_SCREEN;
32class EMBEDDED_FILES;
34
40{
41public:
42 DIALOG_PAGES_SETTINGS( EDA_DRAW_FRAME* aParent, EMBEDDED_FILES* aEmbeddedFiles,
43 double aIuPerMils, const VECTOR2D& aMaxUserSizeMils );
44 virtual ~DIALOG_PAGES_SETTINGS();
45
46 const wxString GetWksFileName()
47 {
48 return m_textCtrlFilePicker->GetValue();
49 }
50
51 void SetWksFileName(const wxString& aFilename )
52 {
53 m_textCtrlFilePicker->SetValue( aFilename );
54 }
55
56 void EnableWksFileNamePicker( bool aEnable )
57 {
58 m_textCtrlFilePicker->Enable( aEnable );
59 m_browseButton->Enable( aEnable );
60 }
61
62private:
63 virtual void onTransferDataToWindow() {}
64
65 virtual bool onSavePageSettings()
66 {
67 // default just return true savepagesettings to succeed
68 return true;
69 }
70
71 virtual bool TransferDataToWindow() override;
72 virtual bool TransferDataFromWindow() override;
73
74 // event handlers for page size choice
75 void OnPaperSizeChoice( wxCommandEvent& event ) override;
76 void OnUserPageSizeXTextUpdated( wxCommandEvent& event ) override;
77 void OnUserPageSizeYTextUpdated( wxCommandEvent& event ) override;
78 void OnPageOrientationChoice( wxCommandEvent& event ) override;
79
80 // event handler for texts in title block
81 void OnRevisionTextUpdated( wxCommandEvent& event ) override;
82 void OnDateTextUpdated( wxCommandEvent& event ) override;
83 void OnTitleTextUpdated( wxCommandEvent& event ) override;
84 void OnCompanyTextUpdated( wxCommandEvent& event ) override;
85 void OnComment1TextUpdated( wxCommandEvent& event ) override;
86 void OnComment2TextUpdated( wxCommandEvent& event ) override;
87 void OnComment3TextUpdated( wxCommandEvent& event ) override;
88 void OnComment4TextUpdated( wxCommandEvent& event ) override;
89 void OnComment5TextUpdated( wxCommandEvent& event ) override;
90 void OnComment6TextUpdated( wxCommandEvent& event ) override;
91 void OnComment7TextUpdated( wxCommandEvent& event ) override;
92 void OnComment8TextUpdated( wxCommandEvent& event ) override;
93 void OnComment9TextUpdated( wxCommandEvent& event ) override;
94
95 // Handle button click for setting the date from the picker
96 void OnDateApplyClick( wxCommandEvent& event ) override;
97
98 // .kicad_wks file description selection
99 void OnWksFileSelection( wxCommandEvent& event ) override;
100
101 // Save in the current title block the new page settings
102 // return true if changes are made, or false if not
103 bool SavePageSettings();
104
105 void SetCurrentPageSizeSelection( const wxString& aPaperSize );
106
107 // Update drawing sheet example
109
110 // Get page layout info from selected dialog items
112
113 // Get custom page size in mils from dialog
115
119
120protected:
123 wxString m_projectPath; // the curr project path
124 wxArrayString m_pageFmt;
127 wxBitmap* m_pageBitmap;
133 DS_DATA_MODEL* m_drawingSheet; // the alternate and temporary drawing sheet shown by the
134 // dialog when the initial one is replaced by a new one
136 EMBEDDED_FILES* m_embeddedFiles; // the embedded files reference from the parent
138
139private:
142};
143
144#endif // _DIALOG_PAGES_SETTINGS_H_
Handles how to draw a screen (a board, a schematic ...)
Definition: base_screen.h:41
Class DIALOG_PAGES_SETTINGS_BASE.
void EnableWksFileNamePicker(bool aEnable)
bool m_initialized
list of page sizes (not translated)
void SetCurrentPageSizeSelection(const wxString &aPaperSize)
void OnComment4TextUpdated(wxCommandEvent &event) override
void OnPageOrientationChoice(wxCommandEvent &event) override
void OnUserPageSizeYTextUpdated(wxCommandEvent &event) override
PAGE_INFO m_pageInfo
The max page size allowed by the caller frame.
FILENAME_RESOLVER * m_filenameResolver
DS_DATA_MODEL * m_drawingSheet
Temporary title block (basic inscriptions).
void OnRevisionTextUpdated(wxCommandEvent &event) override
const wxString GetWksFileName()
void OnComment6TextUpdated(wxCommandEvent &event) override
void OnDateApplyClick(wxCommandEvent &event) override
TITLE_BLOCK m_tb
true if the page selection is custom
void OnDateTextUpdated(wxCommandEvent &event) override
VECTOR2D m_layout_size
Temporary bitmap for the drawing sheet example.
void OnComment3TextUpdated(wxCommandEvent &event) override
void OnCompanyTextUpdated(wxCommandEvent &event) override
void OnUserPageSizeXTextUpdated(wxCommandEvent &event) override
void OnComment7TextUpdated(wxCommandEvent &event) override
EMBEDDED_FILES * m_embeddedFiles
void OnPaperSizeChoice(wxCommandEvent &event) override
virtual bool onSavePageSettings()
virtual void onTransferDataToWindow()
void OnComment5TextUpdated(wxCommandEvent &event) override
void OnComment9TextUpdated(wxCommandEvent &event) override
void OnComment1TextUpdated(wxCommandEvent &event) override
void OnComment8TextUpdated(wxCommandEvent &event) override
void OnWksFileSelection(wxCommandEvent &event) override
VECTOR2D m_maxPageSizeMils
Logical drawing sheet size.
virtual bool TransferDataToWindow() override
virtual bool TransferDataFromWindow() override
void SetWksFileName(const wxString &aFilename)
bool m_customFmt
Temporary page info.
void OnComment2TextUpdated(wxCommandEvent &event) override
wxBitmap * m_pageBitmap
the page layuout filename was changed
void OnTitleTextUpdated(wxCommandEvent &event) override
Handle the graphic items list to draw/plot the frame and title block.
Definition: ds_data_model.h:39
The base class for create windows for drawing purpose.
Provide an extensible class to resolve 3D model paths.
Describe the page size and margins of a paper page on which to eventually print or plot.
Definition: page_info.h:59
bool Enable(bool aEnable=true) override
Hold the information shown in the lower right corner of a plot, printout, or editing view.
Definition: title_block.h:41