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