KiCad PCB EDA Suite
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 <>
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
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  *
22  * or you may search the 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  */
27 #include <draw_frame.h>
28 #include <class_sch_screen.h>
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;
49 {
50 protected:
52  int m_repeatDeltaLabel;
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 );
64  SCH_SCREEN* GetScreen() const override;
70  const wxPoint GetRepeatStep() const { return m_repeatStep; }
77  void SetRepeatStep( const wxPoint& aStep) { m_repeatStep = aStep; }
83  int GetRepeatDeltaLabel() const { return m_repeatDeltaLabel; }
90  void SetRepeatDeltaLabel( int aDelta ) { m_repeatDeltaLabel = aDelta; }
99  const wxString GetZoomLevelIndicator() const override;
101  void SetPageSettings( const PAGE_INFO& aPageSettings ) override;
102  const PAGE_INFO& GetPageSettings () const override;
103  const wxSize GetPageSizeIU() const override;
105  const wxPoint& GetAuxOrigin() const override;
106  void SetAuxOrigin( const wxPoint& aPosition ) override;
108  const wxPoint& GetGridOrigin() const override
109  {
110  static wxPoint zero;
111  return zero;
112  }
113  void SetGridOrigin( const wxPoint& aPoint ) override {}
115  // Virtual from EDA_DRAW_FRAME
116  // the background color of the draw canvas:
117  COLOR4D GetDrawBgColor() const override;
118  void SetDrawBgColor( COLOR4D aColor) override;
120  const TITLE_BLOCK& GetTitleBlock() const override;
121  void SetTitleBlock( const TITLE_BLOCK& aTitleBlock ) override;
123  void UpdateStatusBar() override;
143  wxString SelectComponentFromLibrary( const SCHLIB_FILTER* aFilter,
144  wxArrayString& aHistoryList,
145  int& aHistoryLastUnit,
146  bool aUseLibBrowser,
147  int* aUnit,
148  int* aConvert,
149  const wxString& aHighlight = wxEmptyString );
151 protected:
167  wxString SelectComponentFromLibBrowser( const SCHLIB_FILTER* aFilter,
168  LIB_ALIAS* aPreselectedAlias,
169  int* aUnit, int* aConvert );
177  void OnOpenLibraryViewer( wxCommandEvent& event );
190  bool DisplayListComponentsInLib( PART_LIB* aLibrary, wxString& aBuffer,
191  wxString& aPreviousChoice );
213  bool SelectPartNameToLoad( PART_LIB* aLibrary, wxString& aBufName );
214 };
216 #endif // SCH_BASE_FRAME_H_
wxString 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:53
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 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.
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...
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...
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...
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
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.
wxString SelectComponentFromLibrary(const SCHLIB_FILTER *aFilter, wxArrayString &aHistoryList, int &aHistoryLastUnit, bool aUseLibBrowser, int *aUnit, int *aConvert, const wxString &aHighlight=wxEmptyString)
Function SelectComponentFromLib Calls the library viewer to select component to import into schematic...
Definition: getpart.cpp:99
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