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;
32
38{
39public:
40 DIALOG_PAGES_SETTINGS( EDA_DRAW_FRAME* aParent, double aIuPerMils,
41 const VECTOR2D& aMaxUserSizeMils );
42 virtual ~DIALOG_PAGES_SETTINGS();
43
44 const wxString GetWksFileName()
45 {
46 return m_textCtrlFilePicker->GetValue();
47 }
48
49 void SetWksFileName(const wxString& aFilename )
50 {
51 m_textCtrlFilePicker->SetValue( aFilename );
52 }
53
54 void EnableWksFileNamePicker( bool aEnable )
55 {
56 m_textCtrlFilePicker->Enable( aEnable );
57 m_browseButton->Enable( aEnable );
58 }
59
60private:
61 virtual void onTransferDataToWindow() {}
62
63 virtual bool onSavePageSettings()
64 {
65 // default just return true savepagesettings to succeed
66 return true;
67 }
68
69 virtual bool TransferDataToWindow() override;
70 virtual bool TransferDataFromWindow() override;
71
72 // event handlers for page size choice
73 void OnPaperSizeChoice( wxCommandEvent& event ) override;
74 void OnUserPageSizeXTextUpdated( wxCommandEvent& event ) override;
75 void OnUserPageSizeYTextUpdated( wxCommandEvent& event ) override;
76 void OnPageOrientationChoice( wxCommandEvent& event ) override;
77
78 // event handler for texts in title block
79 void OnRevisionTextUpdated( wxCommandEvent& event ) override;
80 void OnDateTextUpdated( wxCommandEvent& event ) override;
81 void OnTitleTextUpdated( wxCommandEvent& event ) override;
82 void OnCompanyTextUpdated( wxCommandEvent& event ) override;
83 void OnComment1TextUpdated( wxCommandEvent& event ) override;
84 void OnComment2TextUpdated( wxCommandEvent& event ) override;
85 void OnComment3TextUpdated( wxCommandEvent& event ) override;
86 void OnComment4TextUpdated( wxCommandEvent& event ) override;
87 void OnComment5TextUpdated( wxCommandEvent& event ) override;
88 void OnComment6TextUpdated( wxCommandEvent& event ) override;
89 void OnComment7TextUpdated( wxCommandEvent& event ) override;
90 void OnComment8TextUpdated( wxCommandEvent& event ) override;
91 void OnComment9TextUpdated( wxCommandEvent& event ) override;
92
93 // Handle button click for setting the date from the picker
94 void OnDateApplyClick( wxCommandEvent& event ) override;
95
96 // .kicad_wks file description selection
97 void OnWksFileSelection( wxCommandEvent& event ) override;
98
99 // Save in the current title block the new page settings
100 // return true if changes are made, or false if not
101 bool SavePageSettings();
102
103 void SetCurrentPageSizeSelection( const wxString& aPaperSize );
104
105 // Update drawing sheet example
107
108 // Get page layout info from selected dialog items
110
111 // Get custom page size in mils from dialog
113
117
118protected:
121 wxString m_projectPath; // the curr project path
122 wxArrayString m_pageFmt;
125 wxBitmap* m_pageBitmap;
131 DS_DATA_MODEL* m_drawingSheet; // the alternate and temporary drawing sheet shown by the
132 // dialog when the initial one is replaced by a new one
134
135private:
138};
139
140#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.
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
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.
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