2011-10-15 13:25:57 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2009 Wayne Stambaugh <stambaughw@verizon.net>
|
2016-01-16 01:55:50 +00:00
|
|
|
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
|
2011-10-15 13:25:57 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
2010-01-27 16:35:15 +00:00
|
|
|
|
|
|
|
/**
|
2011-10-15 13:25:57 +00:00
|
|
|
* @file dialog_eeschema_options.h
|
|
|
|
*
|
2010-01-27 16:35:15 +00:00
|
|
|
* Subclass of DIALOG_EESCHEMA_OPTIONS_BASE, which is generated by wxFormBuilder.
|
|
|
|
*/
|
|
|
|
|
2011-10-15 13:25:57 +00:00
|
|
|
#ifndef __dialog_eeschema_options__
|
|
|
|
#define __dialog_eeschema_options__
|
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <dialog_eeschema_options_base.h>
|
2014-03-07 17:52:43 +00:00
|
|
|
#include <template_fieldnames.h>
|
2010-01-27 16:35:15 +00:00
|
|
|
|
2016-01-16 23:51:38 +00:00
|
|
|
class WIDGET_EESCHEMA_COLOR_CONFIG;
|
2016-01-16 01:56:57 +00:00
|
|
|
class WIDGET_HOTKEY_LIST;
|
2016-01-16 01:56:00 +00:00
|
|
|
class SCH_EDIT_FRAME;
|
2016-01-16 01:55:50 +00:00
|
|
|
|
2010-01-27 16:35:15 +00:00
|
|
|
class DIALOG_EESCHEMA_OPTIONS : public DIALOG_EESCHEMA_OPTIONS_BASE
|
|
|
|
{
|
2014-03-07 17:52:43 +00:00
|
|
|
protected:
|
2016-01-16 23:51:38 +00:00
|
|
|
WIDGET_HOTKEY_LIST* m_hotkeyListCtrl;
|
|
|
|
WIDGET_EESCHEMA_COLOR_CONFIG* m_colorConfigCtrl;
|
2016-01-16 01:55:50 +00:00
|
|
|
|
2014-09-30 19:55:18 +00:00
|
|
|
/** @brief The template fieldnames for this dialog */
|
2014-03-07 17:52:43 +00:00
|
|
|
TEMPLATE_FIELDNAMES templateFields;
|
2014-09-30 19:55:18 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function OnAddButtonClick
|
|
|
|
* Process the wxWidgets @a event produced when the user presses the Add buton for the
|
|
|
|
* template fieldnames control
|
|
|
|
*
|
|
|
|
* @param event The wxWidgets produced event information
|
|
|
|
*
|
|
|
|
* Adds a new template fieldname (with default values) to the template fieldnames data
|
|
|
|
*/
|
2016-09-24 18:53:15 +00:00
|
|
|
void OnAddButtonClick( wxCommandEvent& event ) override;
|
2014-09-30 19:55:18 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function OnDeleteButtonClick
|
|
|
|
* Process the wxWidgets @a event produced when the user presses the Delete button for the
|
|
|
|
* template fieldnames control
|
|
|
|
*
|
|
|
|
* @param event The wxWidgets produced event information
|
|
|
|
*
|
|
|
|
* Deletes the selected template fieldname from the template fieldnames data
|
|
|
|
*/
|
2016-09-24 18:53:15 +00:00
|
|
|
void OnDeleteButtonClick( wxCommandEvent& event ) override;
|
2014-10-14 20:14:18 +00:00
|
|
|
|
|
|
|
/**
|
2015-12-31 15:12:09 +00:00
|
|
|
* Function TransferDataToWindow
|
|
|
|
* Transfer data into the GUI.
|
2014-09-30 19:55:18 +00:00
|
|
|
*/
|
2016-09-24 18:53:15 +00:00
|
|
|
bool TransferDataToWindow() override;
|
2014-09-30 19:55:18 +00:00
|
|
|
|
|
|
|
/**
|
2015-12-31 15:12:09 +00:00
|
|
|
* Function TransferDataFromWindow
|
|
|
|
* Transfer data out of the GUI.
|
2014-09-30 19:55:18 +00:00
|
|
|
*/
|
2016-09-24 18:53:15 +00:00
|
|
|
bool TransferDataFromWindow() override;
|
2014-09-30 19:55:18 +00:00
|
|
|
|
2010-01-27 16:35:15 +00:00
|
|
|
public:
|
2014-10-14 20:14:18 +00:00
|
|
|
/**
|
|
|
|
* Public constructor
|
|
|
|
*
|
|
|
|
* @param parent The dialog's parent
|
|
|
|
*/
|
2016-01-16 01:56:00 +00:00
|
|
|
DIALOG_EESCHEMA_OPTIONS( SCH_EDIT_FRAME* parent );
|
|
|
|
|
|
|
|
virtual SCH_EDIT_FRAME* GetParent();
|
2010-01-27 16:35:15 +00:00
|
|
|
|
2014-09-30 19:55:18 +00:00
|
|
|
/**
|
|
|
|
* Function GetUnitsSelection
|
|
|
|
* Returns the currently selected grid size in the dialog
|
|
|
|
*/
|
2010-01-27 16:35:15 +00:00
|
|
|
int GetUnitsSelection( void ) { return m_choiceUnits->GetSelection(); }
|
|
|
|
|
2014-09-30 19:55:18 +00:00
|
|
|
/**
|
|
|
|
* Function SetUnits
|
|
|
|
* Set the unit options
|
|
|
|
*
|
|
|
|
* @param units The array of strings representing the unit options
|
|
|
|
* @param select The unit to select from the unit options
|
|
|
|
*
|
|
|
|
* Appends the @a units options to the list of unit options and selects the @a aSelect option
|
|
|
|
*/
|
|
|
|
void SetUnits( const wxArrayString& units, int aSelect = 0 );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function GetGridSelection
|
|
|
|
* Returns the curent grid size selected in the dialog
|
|
|
|
*/
|
2010-01-27 16:35:15 +00:00
|
|
|
int GetGridSelection( void ) { return m_choiceGridSize->GetSelection(); }
|
|
|
|
|
2014-09-30 19:55:18 +00:00
|
|
|
/**
|
|
|
|
* Function SetGridSizes
|
|
|
|
* Sets the available grid size choices @a aGridSizes and selectd the current option @a aGridId
|
|
|
|
*
|
|
|
|
* @param aGridSizes The grid sizes that are able to be chosen from
|
|
|
|
* @param aGridId The grid size to select from the grid size options
|
|
|
|
*/
|
|
|
|
void SetGridSizes( const GRIDS& aGridSizes, int aGridId );
|
2010-01-27 16:35:15 +00:00
|
|
|
|
2014-09-30 19:55:18 +00:00
|
|
|
/**
|
|
|
|
* Function GetBusWidth
|
|
|
|
* Get the current bus width setting from the dialog
|
|
|
|
*/
|
|
|
|
int GetBusWidth( void ) { return m_spinBusWidth->GetValue(); }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function SetBusWidth
|
|
|
|
* Sets the bus width setting in the dialog
|
|
|
|
*
|
|
|
|
* @param aWidth The bus width to set the dialog edit spinbox with
|
|
|
|
*/
|
|
|
|
void SetBusWidth( int aWidth ) { m_spinBusWidth->SetValue( aWidth ); }
|
2012-05-24 06:51:52 +00:00
|
|
|
|
2014-10-14 20:14:18 +00:00
|
|
|
/**
|
|
|
|
* Function SetLineWidth
|
|
|
|
* Sets the current LineWidth value in the dialog
|
|
|
|
* @param aWidth The line width to set in the dialog
|
|
|
|
*/
|
2012-05-24 06:51:52 +00:00
|
|
|
void SetLineWidth( int aWidth ) { m_spinLineWidth->SetValue( aWidth ); }
|
2014-10-14 20:14:18 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function GetLineWidth
|
|
|
|
* Returns the current LineWidth value from the dialog
|
|
|
|
*/
|
2012-05-24 06:51:52 +00:00
|
|
|
int GetLineWidth( void ) { return m_spinLineWidth->GetValue(); }
|
|
|
|
|
2014-10-14 20:14:18 +00:00
|
|
|
/**
|
|
|
|
* Function SetTextSize
|
|
|
|
* Sets the current default TextSize value in the dialog
|
|
|
|
* @param text_size The text size to set in the dialog
|
|
|
|
*/
|
2012-05-24 06:51:52 +00:00
|
|
|
void SetTextSize( int text_size ) { m_spinTextSize->SetValue( text_size ); }
|
2014-10-14 20:14:18 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function GetTextSize
|
|
|
|
* Returns the current default TextSize value from the dialog
|
|
|
|
*/
|
2010-01-27 16:35:15 +00:00
|
|
|
int GetTextSize( void ) { return m_spinTextSize->GetValue(); }
|
|
|
|
|
2014-10-14 20:14:18 +00:00
|
|
|
/**
|
|
|
|
* Function SetRepeatHorizontal
|
|
|
|
* Sets the current RepeatHorizontal displacement value in the dialog
|
|
|
|
* @param displacement The displacement to set in the dialog
|
|
|
|
*/
|
2010-01-27 16:35:15 +00:00
|
|
|
void SetRepeatHorizontal( int displacement )
|
|
|
|
{
|
|
|
|
m_spinRepeatHorizontal->SetValue( displacement );
|
|
|
|
}
|
2014-10-14 20:14:18 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function GetRepeatHorizontal
|
|
|
|
* Returns the current RepeatHorizontal displacement value from the dialog
|
|
|
|
*/
|
2012-05-24 06:51:52 +00:00
|
|
|
int GetRepeatHorizontal( void ) { return m_spinRepeatHorizontal->GetValue(); }
|
2014-10-14 20:14:18 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function SetRepeatVertical
|
|
|
|
* Sets the current RepeatVertical displacement value in the dialog
|
|
|
|
* @param displacement The displacement to set in the dialog
|
|
|
|
*/
|
2012-05-24 06:51:52 +00:00
|
|
|
void SetRepeatVertical( int displacement ) { m_spinRepeatVertical->SetValue( displacement ); }
|
2010-01-27 16:35:15 +00:00
|
|
|
|
2014-10-14 20:14:18 +00:00
|
|
|
/**
|
|
|
|
* Function GetRepeatVertical
|
|
|
|
* Returns the current RepeatVertical displacement value from the dialog
|
|
|
|
*/
|
2010-01-27 16:35:15 +00:00
|
|
|
int GetRepeatVertical( void ) { return m_spinRepeatVertical->GetValue(); }
|
2014-10-14 20:14:18 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function SetRepeatLabel
|
|
|
|
* Sets the current RepeatLabel increment value in the dialog
|
|
|
|
* @param increment The increment to set in the dialog
|
|
|
|
*/
|
2012-05-24 06:51:52 +00:00
|
|
|
void SetRepeatLabel( int increment ) { m_spinRepeatLabel->SetValue( increment ); }
|
2014-10-14 20:14:18 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function GetRepeatLabel
|
|
|
|
* Returns the current RepeatLabel increment value from the dialog
|
|
|
|
*/
|
2010-01-27 16:35:15 +00:00
|
|
|
int GetRepeatLabel( void ) { return m_spinRepeatLabel->GetValue(); }
|
|
|
|
|
2014-10-14 20:14:18 +00:00
|
|
|
/**
|
|
|
|
* Function SetAutoSaveInterval
|
|
|
|
* Sets the current AutoSaveInterval value in the dialog
|
|
|
|
* @param aInterval The interval to set in the dialog
|
|
|
|
*/
|
2011-10-15 13:25:57 +00:00
|
|
|
void SetAutoSaveInterval( int aInterval ) { m_spinAutoSaveInterval->SetValue( aInterval ); }
|
2014-10-14 20:14:18 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function GetAutoSaveInterval
|
|
|
|
* Returns the current AutoSaveInterval value from the dialog
|
|
|
|
*/
|
2011-10-15 13:25:57 +00:00
|
|
|
int GetAutoSaveInterval() const { return m_spinAutoSaveInterval->GetValue(); }
|
|
|
|
|
2014-10-14 20:14:18 +00:00
|
|
|
/**
|
|
|
|
* Function SetRefIdSeparator
|
|
|
|
* Sets the current RefIdSeparator value in the dialog
|
|
|
|
* @param aSep The seperator to use between the reference and the part ID
|
|
|
|
* @param aFirstId The first part ID, currently either 'A' or '1'
|
|
|
|
*/
|
2013-05-22 08:45:25 +00:00
|
|
|
void SetRefIdSeparator( wxChar aSep, wxChar aFirstId);
|
2014-10-14 20:14:18 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function GetRefIdSeparator
|
|
|
|
* Returns the current RefIdSeparator value from the dialog
|
|
|
|
* @param aSep The OUTPUT seperator value
|
|
|
|
* @param aFirstId The OUTPUT reference first ID
|
|
|
|
*/
|
2013-07-19 18:27:22 +00:00
|
|
|
void GetRefIdSeparator( int& aSep, int& aFirstId);
|
2013-05-22 08:45:25 +00:00
|
|
|
|
2014-10-14 20:14:18 +00:00
|
|
|
/**
|
|
|
|
* Function SetShowGrid
|
|
|
|
* Sets the current ShowGrid value in the dialog
|
|
|
|
* @param show The ShowGrid value to set in the dialog
|
|
|
|
*/
|
2010-01-27 16:35:15 +00:00
|
|
|
void SetShowGrid( bool show ) { m_checkShowGrid->SetValue( show ); }
|
2014-10-14 20:14:18 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function GetShowGrid
|
|
|
|
* Returns the current ShowGrid value from the dialog
|
|
|
|
*/
|
2010-01-27 16:35:15 +00:00
|
|
|
bool GetShowGrid( void ) { return m_checkShowGrid->GetValue(); }
|
|
|
|
|
2014-10-14 20:14:18 +00:00
|
|
|
/**
|
|
|
|
* Function SetShowHiddenPins
|
|
|
|
* Sets the current ShowHiddenPins value in the dialog
|
|
|
|
* @param show The ShowHiddenPins value to set in the dialog
|
|
|
|
*/
|
2012-05-24 06:51:52 +00:00
|
|
|
void SetShowHiddenPins( bool show ) { m_checkShowHiddenPins->SetValue( show ); }
|
2014-10-14 20:14:18 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function GetShowHiddenPins
|
|
|
|
* Returns the current ShowHiddenPins value from the dialog
|
|
|
|
*/
|
2012-05-24 06:51:52 +00:00
|
|
|
bool GetShowHiddenPins( void ) { return m_checkShowHiddenPins->GetValue(); }
|
2010-01-27 16:35:15 +00:00
|
|
|
|
2014-10-14 20:14:18 +00:00
|
|
|
/**
|
|
|
|
* Function SetEnableZoomNoCenter
|
|
|
|
* Sets the current ZoomNoCenter value in the dialog
|
|
|
|
* @param enable The ZoomNoCenter value to set in the dialog
|
|
|
|
*/
|
2013-02-02 19:10:48 +00:00
|
|
|
void SetEnableZoomNoCenter( bool enable )
|
|
|
|
{
|
2015-08-06 18:40:22 +00:00
|
|
|
m_checkEnableZoomCenter->SetValue( !enable );
|
2013-02-02 19:10:48 +00:00
|
|
|
}
|
|
|
|
|
2014-10-14 20:14:18 +00:00
|
|
|
/**
|
|
|
|
* Function GetEnableZoomNoCenter
|
|
|
|
* Returns the current ZoomNoCenter value from the dialog
|
|
|
|
*/
|
2013-02-02 19:10:48 +00:00
|
|
|
bool GetEnableZoomNoCenter( void )
|
|
|
|
{
|
2015-08-06 18:40:22 +00:00
|
|
|
return !m_checkEnableZoomCenter->GetValue();
|
2013-02-02 19:10:48 +00:00
|
|
|
}
|
2014-10-14 20:14:18 +00:00
|
|
|
|
2016-02-24 19:53:02 +00:00
|
|
|
/**
|
|
|
|
* Function SetEnableMousewheelPan
|
|
|
|
* Sets the MousewheelPan setting in the dialog
|
|
|
|
*
|
|
|
|
* @param enable The boolean value to set the AutoPan value in the dialog
|
|
|
|
*/
|
|
|
|
void SetEnableMousewheelPan( bool enable ) { m_checkEnableMousewheelPan->SetValue( enable ); }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function GetEnableMousewheelPan
|
|
|
|
* Return the MousewheelPan setting from the dialog
|
|
|
|
*/
|
|
|
|
bool GetEnableMousewheelPan( void ) { return m_checkEnableMousewheelPan->GetValue(); }
|
|
|
|
|
2014-10-14 20:14:18 +00:00
|
|
|
/**
|
|
|
|
* Function SetEnableAutoPan
|
|
|
|
* Sets the AutoPan setting in the dialog
|
|
|
|
*
|
|
|
|
* @param enable The boolean value to set the AutoPan value in the dialog
|
|
|
|
*/
|
2012-05-24 06:51:52 +00:00
|
|
|
void SetEnableAutoPan( bool enable ) { m_checkAutoPan->SetValue( enable ); }
|
2014-10-14 20:14:18 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function GetEnableAutoPan
|
|
|
|
* Return the AutoPan setting from the dialog
|
|
|
|
*/
|
2010-01-27 16:35:15 +00:00
|
|
|
bool GetEnableAutoPan( void ) { return m_checkAutoPan->GetValue(); }
|
|
|
|
|
2014-10-14 20:14:18 +00:00
|
|
|
/**
|
|
|
|
* Function SetEnableHVBusOrientation
|
|
|
|
* Set the HVBusOrientation setting in the dialog
|
|
|
|
*
|
|
|
|
* @param enable The boolean value to set the HVBusOrientation value in the dialog
|
|
|
|
*/
|
2012-05-24 06:51:52 +00:00
|
|
|
void SetEnableHVBusOrientation( bool enable ) { m_checkHVOrientation->SetValue( enable ); }
|
2014-10-14 20:14:18 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function GetEnableHVBusOrientation
|
|
|
|
* Get the HVBusOrientation setting from the dialog
|
|
|
|
*/
|
2012-05-24 06:51:52 +00:00
|
|
|
bool GetEnableHVBusOrientation( void ) { return m_checkHVOrientation->GetValue(); }
|
2010-06-17 16:30:10 +00:00
|
|
|
|
2014-10-14 20:14:18 +00:00
|
|
|
/**
|
|
|
|
* Function
|
|
|
|
* Set the ShowPageLimits setting in the dialog
|
|
|
|
*/
|
2012-05-24 06:51:52 +00:00
|
|
|
void SetShowPageLimits( bool show ) { m_checkPageLimits->SetValue( show ); }
|
2014-10-14 20:14:18 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function
|
|
|
|
* Return the current ShowPageLimits setting from the dialog
|
|
|
|
*/
|
2012-05-24 06:51:52 +00:00
|
|
|
bool GetShowPageLimits( void ) { return m_checkPageLimits->GetValue(); }
|
2010-06-17 16:30:10 +00:00
|
|
|
|
2015-12-13 16:56:47 +00:00
|
|
|
/**
|
|
|
|
* Function
|
|
|
|
* Set the AutoplaceFields setting in the dialog
|
|
|
|
*/
|
|
|
|
void SetAutoplaceFields( bool enable ) { m_checkAutoplaceFields->SetValue( enable ); }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function
|
|
|
|
* Return the current AutoplaceFields setting from the dialog
|
|
|
|
*/
|
|
|
|
bool GetAutoplaceFields() { return m_checkAutoplaceFields->GetValue(); }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function
|
|
|
|
* Set the AutoplaceJustify setting in the dialog
|
|
|
|
*/
|
|
|
|
void SetAutoplaceJustify( bool enable ) { m_checkAutoplaceJustify->SetValue( enable ); }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function
|
|
|
|
* Return the current AutoplaceJustify setting from the dialog
|
|
|
|
*/
|
|
|
|
bool GetAutoplaceJustify() { return m_checkAutoplaceJustify->GetValue(); }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function
|
|
|
|
* Set the AutoplaceAlign setting in the dialog
|
|
|
|
*/
|
|
|
|
void SetAutoplaceAlign( bool enable ) { m_checkAutoplaceAlign->SetValue( enable ); }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function
|
|
|
|
* Return the current AutoplaceAlign setting from the dialog
|
|
|
|
*/
|
|
|
|
bool GetAutoplaceAlign() { return m_checkAutoplaceAlign->GetValue(); }
|
|
|
|
|
2014-10-14 20:14:18 +00:00
|
|
|
/**
|
|
|
|
* Function SetTemplateFields
|
|
|
|
* Set the template field data in the dialog
|
|
|
|
*
|
|
|
|
* @param aFields The template fieldnames that the dialog should start with before any editing
|
|
|
|
*/
|
2014-03-07 17:52:43 +00:00
|
|
|
void SetTemplateFields( const TEMPLATE_FIELDNAMES& aFields );
|
2010-06-17 16:30:10 +00:00
|
|
|
|
2014-10-14 20:14:18 +00:00
|
|
|
/**
|
|
|
|
* Function GetTemplateFields
|
|
|
|
* Get the dialog's template field data
|
|
|
|
*
|
|
|
|
*/
|
2014-09-16 19:34:52 +00:00
|
|
|
TEMPLATE_FIELDNAMES GetTemplateFields( void );
|
2010-01-27 16:35:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __dialog_eeschema_options__
|