KiCad PCB EDA Suite
sch_base_frame.h
Go to the documentation of this file.
1 #ifndef SCH_BASE_FRAME_H_
2 #define SCH_BASE_FRAME_H_
3 /*
4  * This program source code file is part of KiCad, a free EDA CAD application.
5  *
6  * Copyright (C) 2015 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
7  * Copyright (C) 2015-2017 KiCad Developers, see AUTHORS.txt for contributors.
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; either version 2
12  * of the License, or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, you may find one here:
21  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
22  * or you may search the http://www.gnu.org website for the version 2 license,
23  * or you may write to the Free Software Foundation, Inc.,
24  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
25  */
26 
27 #include <draw_frame.h>
28 #include <class_sch_screen.h>
29 
30 class PAGE_INFO;
31 class TITLE_BLOCK;
32 class LIB_VIEW_FRAME;
33 class LIB_EDIT_FRAME;
34 class LIB_ALIAS;
35 class PART_LIB;
36 class SCHLIB_FILTER;
37 
49 {
50 protected:
52  int m_repeatDeltaLabel;
54 
56 
57 public:
58  SCH_BASE_FRAME( KIWAY* aKiway, wxWindow* aParent,
59  FRAME_T aWindowType,
60  const wxString& aTitle,
61  const wxPoint& aPosition, const wxSize& aSize,
62  long aStyle, const wxString & aFrameName );
63 
64  virtual ~SCH_BASE_FRAME();
65 
66  SCH_SCREEN* GetScreen() const override;
67 
72  const wxPoint GetRepeatStep() const { return m_repeatStep; }
73 
79  void SetRepeatStep( const wxPoint& aStep) { m_repeatStep = aStep; }
80 
85  int GetRepeatDeltaLabel() const { return m_repeatDeltaLabel; }
86 
92  void SetRepeatDeltaLabel( int aDelta ) { m_repeatDeltaLabel = aDelta; }
93 
94 
101  const wxString GetZoomLevelIndicator() const override;
102 
103  void SetPageSettings( const PAGE_INFO& aPageSettings ) override;
104  const PAGE_INFO& GetPageSettings () const override;
105  const wxSize GetPageSizeIU() const override;
106 
107  const wxPoint& GetAuxOrigin() const override;
108  void SetAuxOrigin( const wxPoint& aPosition ) override;
109 
110  const wxPoint& GetGridOrigin() const override
111  {
112  static wxPoint zero;
113  return zero;
114  }
115  void SetGridOrigin( const wxPoint& aPoint ) override {}
116 
117  // Virtual from EDA_DRAW_FRAME
118  // the background color of the draw canvas:
119  COLOR4D GetDrawBgColor() const override;
120  void SetDrawBgColor( COLOR4D aColor) override;
121 
122  const TITLE_BLOCK& GetTitleBlock() const override;
123  void SetTitleBlock( const TITLE_BLOCK& aTitleBlock ) override;
124 
125  void UpdateStatusBar() override;
126 
127 
129  {
130  wxString Name;
131  int Unit;
132  int Convert;
133 
134  std::vector<std::pair<int, wxString>> Fields;
135 
137  Name(""),
138  Unit(1),
139  Convert(1)
140  {}
141  };
142 
143  typedef std::vector<COMPONENT_SELECTION> HISTORY_LIST;
144 
169  const SCHLIB_FILTER* aFilter,
170  std::vector<COMPONENT_SELECTION>& aHistoryList,
171  bool aUseLibBrowser,
172  int aUnit,
173  int aConvert,
174  const wxString& aHighlight = wxEmptyString,
175  bool aAllowFields = true );
176 
177  void OnEditSymbolLibTable( wxCommandEvent& aEvent );
178 
179 protected:
180 
194  const SCHLIB_FILTER* aFilter,
195  LIB_ALIAS* aPreselectedAlias,
196  int aUnit, int aConvert );
197 
204  void OnOpenLibraryViewer( wxCommandEvent& event );
205 
219  bool DisplayListComponentsInLib( PART_LIB* aLibrary, wxString& aBuffer,
220  wxString& aPreviousChoice );
221 
230 
242  bool SelectPartNameToLoad( PART_LIB* aLibrary, wxString& aBufName );
243 };
244 
245 #endif // SCH_BASE_FRAME_H_
int m_repeatDeltaLabel
the increment value of labels like bus members when they are repeated
bool DisplayListComponentsInLib(PART_LIB *aLibrary, wxString &aBuffer, wxString &aPreviousChoice)
Function DisplayComponentsNamesInLib Select a component from the list of components in a library...
Definition: selpart.cpp:113
Part library alias object definition.
SCH_BASE_FRAME(KIWAY *aKiway, wxWindow *aParent, FRAME_T aWindowType, const wxString &aTitle, const wxPoint &aPosition, const wxSize &aSize, long aStyle, const wxString &aFrameName)
void OnEditSymbolLibTable(wxCommandEvent &aEvent)
void OnOpenLibraryViewer(wxCommandEvent &event)
Function OnOpenLibraryViewer Open the library viewer only to browse library contents.
void SetRepeatDeltaLabel(int aDelta)
Sets the repeat delta label value for repeat command.
FRAME_T
Enum FRAME_T is the set of EDA_BASE_FRAME derivatives, typically stored in EDA_BASE_FRAME::m_Ident.
Definition: frame_type.h:34
const wxPoint GetRepeatStep() const
SCH_SCREEN * GetScreen() const override
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
wxPoint m_repeatStep
the increment value of the position of an item when it is repeated
const wxPoint & GetGridOrigin() const override
Function GetGridOrigin returns the absolute coordinates of the origin of the snap grid...
std::vector< COMPONENT_SELECTION > HISTORY_LIST
const wxPoint & GetAuxOrigin() const override
Function GetAuxOrigin returns the origin of the axis used for plotting and various exports...
int GetRepeatDeltaLabel() const
Class EDA_DRAW_FRAME is the base class for create windows for drawing purpose.
Definition: draw_frame.h:53
Class TITLE_BLOCK holds the information shown in the lower right corner of a plot, printout, or editing view.
const wxString GetZoomLevelIndicator() const override
Function GetZoomLevelIndicator returns a human readable value which can be displayed as zoom level in...
Component library viewer main window.
Definition: viewlib_frame.h:49
const wxSize GetPageSizeIU() const override
Function GetPageSizeIU works off of GetPageSettings() to return the size of the paper page in the int...
COMPONENT_SELECTION SelectComponentFromLibBrowser(const SCHLIB_FILTER *aFilter, LIB_ALIAS *aPreselectedAlias, int aUnit, int aConvert)
Function SelectComponentFromLibBrowser Calls the library viewer to select component to import into sc...
Definition: getpart.cpp:54
void SetAuxOrigin(const wxPoint &aPosition) override
void SetTitleBlock(const TITLE_BLOCK &aTitleBlock) override
Definitions for the Eeschema program SCH_SCREEN class.
Class PAGE_INFO describes the page size and margins of a paper page on which to eventually print or p...
virtual ~SCH_BASE_FRAME()
Class KIWAY is a minimalistic software bus for communications between various DLLs/DSOs (DSOs) within...
Definition: kiway.h:257
PART_LIB * SelectLibraryFromList()
Function SelectLibraryFromList displays a list of current loaded libraries, and allows the user to se...
Definition: selpart.cpp:58
COLOR4D GetDrawBgColor() const override
void SetPageSettings(const PAGE_INFO &aPageSettings) override
std::vector< std::pair< int, wxString > > Fields
const PAGE_INFO & GetPageSettings() const override
void SetGridOrigin(const wxPoint &aPoint) override
void UpdateStatusBar() override
Function UpdateStatusBar updates the status bar information.
bool SelectPartNameToLoad(PART_LIB *aLibrary, wxString &aBufName)
Function SelectPartNameToLoad Select a part name from the list of components (parts) found in a libra...
Definition: selpart.cpp:152
The component library editor main window.
Definition: libeditframe.h:51
const TITLE_BLOCK & GetTitleBlock() const override
void SetDrawBgColor(COLOR4D aColor) override
void SetRepeatStep(const wxPoint &aStep)
Sets the repeat step value for repeat command.
COMPONENT_SELECTION SelectComponentFromLibrary(const SCHLIB_FILTER *aFilter, std::vector< COMPONENT_SELECTION > &aHistoryList, bool aUseLibBrowser, int aUnit, int aConvert, const wxString &aHighlight=wxEmptyString, bool aAllowFields=true)
Function SelectComponentFromLib Calls the library viewer to select component to import into schematic...
Definition: getpart.cpp:94
Class SCH_BASE_FRAME is a shim class between EDA_DRAW_FRAME and several derived classes: LIB_EDIT_FRA...
Class PART_LIB is used to load, save, search, and otherwise manipulate part library files...
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39