KiCad PCB EDA Suite
dialog_eeschema_options.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) 2009 Wayne Stambaugh <stambaughw@verizon.net>
5  * Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
31 #ifndef __dialog_eeschema_options__
32 #define __dialog_eeschema_options__
33 
35 #include <template_fieldnames.h>
36 
38 class WIDGET_HOTKEY_LIST;
39 class SCH_EDIT_FRAME;
40 
42 {
43 private:
44  static int m_lastPageSelected;
45 protected:
49 
52 
62  void OnAddButtonClick( wxCommandEvent& event ) override;
63 
73  void OnDeleteButtonClick( wxCommandEvent& event ) override;
74 
79  bool TransferDataToWindow() override;
80 
85  bool TransferDataFromWindow() override;
86 
87 public:
94 
95  virtual SCH_EDIT_FRAME* GetParent();
96 
101  int GetUnitsSelection( void ) { return m_choiceUnits->GetSelection(); }
102 
112  void SetUnits( const wxArrayString& aUnits, int aSelect = 0 );
113 
118  int GetGridSelection( void ) { return m_choiceGridSize->GetSelection(); }
119 
127  void SetGridSizes( const GRIDS& aGridSizes, int aGridId );
128 
133  int GetBusWidth( void ) { return m_spinBusWidth->GetValue(); }
134 
141  void SetBusWidth( int aWidth ) { m_spinBusWidth->SetValue( aWidth ); }
142 
148  void SetLineWidth( int aWidth ) { m_spinLineWidth->SetValue( aWidth ); }
149 
154  int GetLineWidth( void ) { return m_spinLineWidth->GetValue(); }
155 
161  void SetTextSize( int text_size ) { m_spinTextSize->SetValue( text_size ); }
162 
167  int GetTextSize( void ) { return m_spinTextSize->GetValue(); }
168 
174  void SetRepeatHorizontal( int displacement )
175  {
176  m_spinRepeatHorizontal->SetValue( displacement );
177  }
178 
183  int GetRepeatHorizontal( void ) { return m_spinRepeatHorizontal->GetValue(); }
184 
190  void SetRepeatVertical( int displacement ) { m_spinRepeatVertical->SetValue( displacement ); }
191 
196  int GetRepeatVertical( void ) { return m_spinRepeatVertical->GetValue(); }
197 
203  void SetRepeatLabel( int increment ) { m_spinRepeatLabel->SetValue( increment ); }
204 
209  int GetRepeatLabel( void ) { return m_spinRepeatLabel->GetValue(); }
210 
216  void SetAutoSaveInterval( int aInterval ) { m_spinAutoSaveInterval->SetValue( aInterval ); }
217 
222  int GetAutoSaveInterval() const { return m_spinAutoSaveInterval->GetValue(); }
223 
230  void SetRefIdSeparator( wxChar aSep, wxChar aFirstId);
231 
238  void GetRefIdSeparator( int& aSep, int& aFirstId);
239 
245  void SetShowGrid( bool show ) { m_checkShowGrid->SetValue( show ); }
246 
251  bool GetShowGrid( void ) { return m_checkShowGrid->GetValue(); }
252 
258  void SetShowHiddenPins( bool show ) { m_checkShowHiddenPins->SetValue( show ); }
259 
264  bool GetShowHiddenPins( void ) { return m_checkShowHiddenPins->GetValue(); }
265 
271  void SetEnableZoomNoCenter( bool enable )
272  {
273  m_checkEnableZoomCenter->SetValue( !enable );
274  }
275 
281  {
282  return !m_checkEnableZoomCenter->GetValue();
283  }
284 
291  void SetEnableMousewheelPan( bool enable ) { m_checkEnableMousewheelPan->SetValue( enable ); }
292 
297  bool GetEnableMousewheelPan( void ) { return m_checkEnableMousewheelPan->GetValue(); }
298 
305  void SetEnableAutoPan( bool enable ) { m_checkAutoPan->SetValue( enable ); }
306 
311  bool GetEnableAutoPan( void ) { return m_checkAutoPan->GetValue(); }
312 
319  void SetEnableHVBusOrientation( bool enable ) { m_checkHVOrientation->SetValue( enable ); }
320 
325  bool GetEnableHVBusOrientation( void ) { return m_checkHVOrientation->GetValue(); }
326 
331  void SetShowPageLimits( bool show ) { m_checkPageLimits->SetValue( show ); }
332 
337  bool GetShowPageLimits( void ) { return m_checkPageLimits->GetValue(); }
338 
343  void SetAutoplaceFields( bool enable ) { m_checkAutoplaceFields->SetValue( enable ); }
344 
349  bool GetAutoplaceFields() { return m_checkAutoplaceFields->GetValue(); }
350 
355  void SetAutoplaceJustify( bool enable ) { m_checkAutoplaceJustify->SetValue( enable ); }
356 
361  bool GetAutoplaceJustify() { return m_checkAutoplaceJustify->GetValue(); }
362 
367  void SetAutoplaceAlign( bool enable ) { m_checkAutoplaceAlign->SetValue( enable ); }
368 
373  bool GetAutoplaceAlign() { return m_checkAutoplaceAlign->GetValue(); }
374 
381  void SetTemplateFields( const TEMPLATE_FIELDNAMES& aFields );
382 
389 };
390 
391 #endif // __dialog_eeschema_options__
void SetEnableMousewheelPan(bool enable)
Function SetEnableMousewheelPan Sets the MousewheelPan setting in the dialog.
int GetRepeatVertical(void)
Function GetRepeatVertical Returns the current RepeatVertical displacement value from the dialog...
bool TransferDataToWindow() override
Function TransferDataToWindow Transfer data into the GUI.
int GetRepeatHorizontal(void)
Function GetRepeatHorizontal Returns the current RepeatHorizontal displacement value from the dialog...
bool GetEnableMousewheelPan(void)
Function GetEnableMousewheelPan Return the MousewheelPan setting from the dialog. ...
bool TransferDataFromWindow() override
Function TransferDataFromWindow Transfer data out of the GUI.
virtual SCH_EDIT_FRAME * GetParent()
void SetTemplateFields(const TEMPLATE_FIELDNAMES &aFields)
Function SetTemplateFields Set the template field data in the dialog.
void SetEnableHVBusOrientation(bool enable)
Function SetEnableHVBusOrientation Set the HVBusOrientation setting in the dialog.
void SetUnits(const wxArrayString &aUnits, int aSelect=0)
Function SetUnits Set the unit options.
void SetRepeatLabel(int increment)
Function SetRepeatLabel Sets the current RepeatLabel increment value in the dialog.
int GetUnitsSelection(void)
Function GetUnitsSelection Returns the currently selected grid size in the dialog.
DIALOG_EESCHEMA_OPTIONS(SCH_EDIT_FRAME *parent)
Public constructor.
Schematic editor (Eeschema) main window.
Definition: schframe.h:117
bool GetShowHiddenPins(void)
Function GetShowHiddenPins Returns the current ShowHiddenPins value from the dialog.
std::vector< GRID_TYPE > GRIDS
void GetRefIdSeparator(int &aSep, int &aFirstId)
Function GetRefIdSeparator Returns the current RefIdSeparator value from the dialog.
void SetEnableAutoPan(bool enable)
Function SetEnableAutoPan Sets the AutoPan setting in the dialog.
void OnDeleteButtonClick(wxCommandEvent &event) override
Function OnDeleteButtonClick Process the wxWidgets event produced when the user presses the Delete bu...
int GetLineWidth(void)
Function GetLineWidth Returns the current LineWidth value from the dialog.
void SetEnableZoomNoCenter(bool enable)
Function SetEnableZoomNoCenter Sets the current ZoomNoCenter value in the dialog. ...
WIDGET_HOTKEY_LIST * m_hotkeyListCtrl
void SetAutoSaveInterval(int aInterval)
Function SetAutoSaveInterval Sets the current AutoSaveInterval value in the dialog.
int GetRepeatLabel(void)
Function GetRepeatLabel Returns the current RepeatLabel increment value from the dialog.
bool GetAutoplaceAlign()
Function Return the current AutoplaceAlign setting from the dialog.
std::vector< TEMPLATE_FIELDNAME > TEMPLATE_FIELDNAMES
int GetGridSelection(void)
Function GetGridSelection Returns the curent grid size selected in the dialog.
TEMPLATE_FIELDNAMES templateFields
The template fieldnames for this dialog.
bool GetShowGrid(void)
Function GetShowGrid Returns the current ShowGrid value from the dialog.
bool GetEnableHVBusOrientation(void)
Function GetEnableHVBusOrientation Get the HVBusOrientation setting from the dialog.
void SetShowGrid(bool show)
Function SetShowGrid Sets the current ShowGrid value in the dialog.
bool GetAutoplaceFields()
Function Return the current AutoplaceFields setting from the dialog.
void OnAddButtonClick(wxCommandEvent &event) override
Function OnAddButtonClick Process the wxWidgets event produced when the user presses the Add buton fo...
void SetAutoplaceFields(bool enable)
Function Set the AutoplaceFields setting in the dialog.
int GetBusWidth(void)
Function GetBusWidth Get the current bus width setting from the dialog.
bool GetShowPageLimits(void)
Function Return the current ShowPageLimits setting from the dialog.
void SetShowHiddenPins(bool show)
Function SetShowHiddenPins Sets the current ShowHiddenPins value in the dialog.
void SetShowPageLimits(bool show)
Function Set the ShowPageLimits setting in the dialog.
void SetBusWidth(int aWidth)
Function SetBusWidth Sets the bus width setting in the dialog.
TEMPLATE_FIELDNAMES GetTemplateFields(void)
Function GetTemplateFields Get the dialog's template field data.
void SetRepeatHorizontal(int displacement)
Function SetRepeatHorizontal Sets the current RepeatHorizontal displacement value in the dialog...
Class DIALOG_EESCHEMA_OPTIONS_BASE.
bool GetEnableZoomNoCenter(void)
Function GetEnableZoomNoCenter Returns the current ZoomNoCenter value from the dialog.
static int m_lastPageSelected
the active notebook page when closing this dialog strored to keep selection during a session ...
void SetAutoplaceJustify(bool enable)
Function Set the AutoplaceJustify setting in the dialog.
int GetTextSize(void)
Function GetTextSize Returns the current default TextSize value from the dialog.
void SetAutoplaceAlign(bool enable)
Function Set the AutoplaceAlign setting in the dialog.
void SetRefIdSeparator(wxChar aSep, wxChar aFirstId)
Function SetRefIdSeparator Sets the current RefIdSeparator value in the dialog.
void SetTextSize(int text_size)
Function SetTextSize Sets the current default TextSize value in the dialog.
int GetAutoSaveInterval() const
Function GetAutoSaveInterval Returns the current AutoSaveInterval value from the dialog.
void SetLineWidth(int aWidth)
Function SetLineWidth Sets the current LineWidth value in the dialog.
void SetGridSizes(const GRIDS &aGridSizes, int aGridId)
Function SetGridSizes Sets the available grid size choices aGridSizes and selectd the current option ...
bool GetAutoplaceJustify()
Function Return the current AutoplaceJustify setting from the dialog.
WIDGET_EESCHEMA_COLOR_CONFIG * m_colorConfigCtrl
void SetRepeatVertical(int displacement)
Function SetRepeatVertical Sets the current RepeatVertical displacement value in the dialog...
bool GetEnableAutoPan(void)
Function GetEnableAutoPan Return the AutoPan setting from the dialog.