KiCad PCB EDA Suite
pl_editor_layout.cpp
Go to the documentation of this file.
1 
5 /*
6  * This program source code file is part of KiCad, a free EDA CAD application.
7  *
8  * Copyright (C) 2013 CERN
9  * @author Jean-Pierre Charras, jp.charras at wanadoo.fr
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, you may find one here:
23  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
24  * or you may search the http://www.gnu.org website for the version 2 license,
25  * or you may write to the Free Software Foundation, Inc.,
26  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
27  */
28 
29 #include <algorithm>
30 #include <climits>
31 
32 #include <eda_draw_frame.h>
33 #include <eda_item.h>
34 #include <eda_rect.h>
35 #include "pl_editor_layout.h"
36 
38 {
39  PAGE_INFO pageInfo( wxT( "A4" ) );
40  SetPageSettings( pageInfo );
41 }
42 
43 
45 {
46 }
47 
48 
50 {
51  EDA_RECT bbox;
52 
53  SetBoundingBox( bbox );
54  return bbox;
55 }
56 
57 
58 void PL_EDITOR_LAYOUT::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
59 {
60  DSIZE size = GetPageSettings().GetSizeIU();
61 
62  aList.emplace_back( _( "Page Width" ), MessageTextFromValue( aFrame->GetUserUnits(), size.x ) );
63 
64  aList.emplace_back(
65  _( "Page Height" ), MessageTextFromValue( aFrame->GetUserUnits(), size.y ) );
66 }
wxString MessageTextFromValue(EDA_UNITS aUnits, int aValue, bool aAddUnitLabel, EDA_DATA_TYPE aType)
Convert a value to a string using double notation.
Definition: base_units.cpp:104
EDA_RECT ComputeBoundingBox()
Calculate the bounding box containing all Gerber items.
The base class for create windows for drawing purpose.
PAGE_INFO & GetPageSettings()
Describe the page size and margins of a paper page on which to eventually print or plot.
Definition: page_info.h:53
#define _(s)
void SetBoundingBox(const EDA_RECT &aBox)
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList)
void SetPageSettings(const PAGE_INFO &aPageSettings)
Handle the component boundary box.
Definition: eda_rect.h:42
EDA_UNITS GetUserUnits() const
Return the user units currently in use.