KiCad PCB EDA Suite
base_screen.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) 2015 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
5  * Copyright (C) 2011 Wayne Stambaugh <stambaughw@gmail.com>
6  * Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, you may find one here:
20  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21  * or you may search the http://www.gnu.org website for the version 2 license,
22  * or you may write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24  */
25 
31 #ifndef BASE_SCREEN_H
32 #define BASE_SCREEN_H
33 
34 #include <eda_item.h>
35 
36 
40 class BASE_SCREEN : public EDA_ITEM
41 {
42 public:
43  BASE_SCREEN( EDA_ITEM* aParent, KICAD_T aType = SCREEN_T );
44 
45  BASE_SCREEN( const wxSize& aPageSizeIU, KICAD_T aType = SCREEN_T ) :
46  BASE_SCREEN( nullptr, aType )
47  {
48  InitDataPoints( aPageSizeIU );
49  }
50 
52  BASE_SCREEN( nullptr, aType )
53  {}
54 
55  ~BASE_SCREEN() override { }
56 
57  void InitDataPoints( const wxSize& aPageSizeInternalUnits );
58 
59  void SetModify() { m_flagModified = true; }
60  void ClrModify() { m_flagModified = false; }
61  void SetSave() { m_flagSave = true; }
62  void ClrSave() { m_flagSave = false; }
63  bool IsModify() const { return m_flagModified; }
64  bool IsSave() const { return m_flagSave; }
65 
71  virtual wxString GetClass() const override
72  {
73  return wxT( "BASE_SCREEN" );
74  }
75 
76  int GetPageCount() const { return m_pageCount; }
77  void SetPageCount( int aPageCount );
78 
79  int GetVirtualPageNumber() const { return m_virtualPageNumber; }
80  void SetVirtualPageNumber( int aPageNumber ) { m_virtualPageNumber = aPageNumber; }
81 
82  const wxString& GetPageNumber() const;
83  void SetPageNumber( const wxString& aPageNumber ) { m_pageNumber = aPageNumber; }
84 
85 #if defined(DEBUG)
86  void Show( int nestLevel, std::ostream& os ) const override;
87 #endif
88 
89  static wxString m_PageLayoutDescrFileName;
90 
92  wxPoint m_DrawOrg;
93 
95 
97  wxPoint m_StartVisu;
98 
100  bool m_Center;
101 
105 
106 protected:
116 
124 
133  wxString m_pageNumber;
134 
135 private:
137  bool m_flagSave;
138 
145 };
146 
147 #endif // BASE_SCREEN_H
bool m_flagModified
Indicates current drawing has been modified.
Definition: base_screen.h:136
void SetPageNumber(const wxString &aPageNumber)
Definition: base_screen.h:83
void SetVirtualPageNumber(int aPageNumber)
Definition: base_screen.h:80
void SetSave()
Definition: base_screen.h:61
virtual wxString GetClass() const override
Return the class name.
Definition: base_screen.h:71
wxPoint m_crossHairPosition
The cross hair position in logical (drawing) units.
Definition: base_screen.h:144
int GetVirtualPageNumber() const
Definition: base_screen.h:79
int GetPageCount() const
Definition: base_screen.h:76
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:77
not really an item, used to identify a screen
Definition: typeinfo.h:85
const wxString & GetPageNumber() const
Definition: base_screen.cpp:78
static wxString m_PageLayoutDescrFileName
the name of the page layout descr file, or emty to used the default pagelayout
Definition: base_screen.h:89
void InitDataPoints(const wxSize &aPageSizeInternalUnits)
Definition: base_screen.cpp:47
wxPoint m_StartVisu
Coordinates in drawing units of the current view position (upper left corner of device)
Definition: base_screen.h:97
wxString m_pageNumber
A user defined string page number used for printing and plotting.
Definition: base_screen.h:133
bool m_Center
Center on screen.
Definition: base_screen.h:100
Handles how to draw a screen (a board, a schematic ...)
Definition: base_screen.h:40
int m_pageCount
The number of BASE_SCREEN objects in this design.
Definition: base_screen.h:115
~BASE_SCREEN() override
Definition: base_screen.h:55
bool IsModify() const
Definition: base_screen.h:63
BASE_SCREEN(const wxSize &aPageSizeIU, KICAD_T aType=SCREEN_T)
Definition: base_screen.h:45
BASE_SCREEN(EDA_ITEM *aParent, KICAD_T aType=SCREEN_T)
Definition: base_screen.cpp:35
bool IsSave() const
Definition: base_screen.h:64
BASE_SCREEN(KICAD_T aType=SCREEN_T)
Definition: base_screen.h:51
wxPoint m_DrawOrg
offsets for drawing the circuit on the screen
Definition: base_screen.h:92
void ClrModify()
Definition: base_screen.h:60
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:149
VECTOR2D m_ScrollCenter
Current scroll center point in logical units.
Definition: base_screen.h:104
void SetModify()
Definition: base_screen.h:59
void SetPageCount(int aPageCount)
Definition: base_screen.cpp:70
void ClrSave()
Definition: base_screen.h:62
bool m_flagSave
Indicates automatic file save.
Definition: base_screen.h:137
VECTOR2D m_LocalOrigin
Relative Screen cursor coordinate (on grid) in user units.
Definition: base_screen.h:94
int m_virtualPageNumber
An integer based page number used for printing a range of pages.
Definition: base_screen.h:123