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 SetContentModified( bool aModified = true ) { m_flagModified = aModified; }
60  bool IsContentModified() const { return m_flagModified; }
61 
67  virtual wxString GetClass() const override
68  {
69  return wxT( "BASE_SCREEN" );
70  }
71 
72  int GetPageCount() const { return m_pageCount; }
73  void SetPageCount( int aPageCount );
74 
75  int GetVirtualPageNumber() const { return m_virtualPageNumber; }
76  void SetVirtualPageNumber( int aPageNumber ) { m_virtualPageNumber = aPageNumber; }
77 
78  const wxString& GetPageNumber() const;
79  void SetPageNumber( const wxString& aPageNumber ) { m_pageNumber = aPageNumber; }
80 
81 #if defined(DEBUG)
82  void Show( int nestLevel, std::ostream& os ) const override;
83 #endif
84 
85  static wxString m_DrawingSheetFileName;
86 
88  wxPoint m_DrawOrg;
89 
91 
93  wxPoint m_StartVisu;
94 
96  bool m_Center;
97 
101 
102 protected:
112 
120 
129  wxString m_pageNumber;
130 
131 private:
133 };
134 
135 #endif // BASE_SCREEN_H
bool m_flagModified
Indicates current drawing has been modified.
Definition: base_screen.h:132
bool IsContentModified() const
Definition: base_screen.h:60
void SetPageNumber(const wxString &aPageNumber)
Definition: base_screen.h:79
void SetVirtualPageNumber(int aPageNumber)
Definition: base_screen.h:76
virtual wxString GetClass() const override
Return the class name.
Definition: base_screen.h:67
int GetVirtualPageNumber() const
Definition: base_screen.h:75
int GetPageCount() const
Definition: base_screen.h:72
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:71
void InitDataPoints(const wxSize &aPageSizeInternalUnits)
Definition: base_screen.cpp:46
wxPoint m_StartVisu
Coordinates in drawing units of the current view position (upper left corner of device)
Definition: base_screen.h:93
wxString m_pageNumber
A user defined string page number used for printing and plotting.
Definition: base_screen.h:129
bool m_Center
Center on screen.
Definition: base_screen.h:96
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:111
~BASE_SCREEN() override
Definition: base_screen.h:55
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
void SetContentModified(bool aModified=true)
Definition: base_screen.h:59
static wxString m_DrawingSheetFileName
the name of the drawing sheet file, or empty to use the default drawing sheet
Definition: base_screen.h:85
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:88
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:100
VECTOR2D m_ScrollCenter
Current scroll center point in logical units.
Definition: base_screen.h:100
void SetPageCount(int aPageCount)
Definition: base_screen.cpp:63
VECTOR2D m_LocalOrigin
Relative Screen cursor coordinate (on grid) in user units.
Definition: base_screen.h:90
int m_virtualPageNumber
An integer based page number used for printing a range of pages.
Definition: base_screen.h:119