dialog_eeschema_options.h 4.9 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
/*
 * This program source code file is part of KiCad, a free EDA CAD application.
 *
 * Copyright (C) 2009 Wayne Stambaugh <stambaughw@verizon.net>
 * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
 *
 * 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
 */
24 25

/**
26 27
 * @file dialog_eeschema_options.h
 *
28 29 30
 * Subclass of DIALOG_EESCHEMA_OPTIONS_BASE, which is generated by wxFormBuilder.
 */

31 32 33
#ifndef __dialog_eeschema_options__
#define __dialog_eeschema_options__

34
#include <dialog_eeschema_options_base.h>
35 36 37 38

class DIALOG_EESCHEMA_OPTIONS : public DIALOG_EESCHEMA_OPTIONS_BASE
{
public:
39
    DIALOG_EESCHEMA_OPTIONS( wxWindow* parent );
40 41 42 43

    void SetUnits( const wxArrayString& units, int select = 0 );
    int GetUnitsSelection( void ) { return m_choiceUnits->GetSelection(); }

44
    void SetGridSelection( int select ) { m_choiceGridSize->SetSelection( select ); }
45
    int GetGridSelection( void ) { return m_choiceGridSize->GetSelection(); }
46
    void SetGridSizes( const GRIDS& grid_sizes, int grid_id );
47

48
    void SetBusWidth( int aWidth )
49
    {
50
        m_spinBusWidth->SetValue( aWidth );
51 52
    }

53
    int GetBusWidth( void )
54
    {
55
        return m_spinBusWidth->GetValue();
56
    }
57 58 59 60 61

    void SetLineWidth( int aWidth ) { m_spinLineWidth->SetValue( aWidth ); }
    int GetLineWidth( void ) { return m_spinLineWidth->GetValue(); }

    void SetTextSize( int text_size ) { m_spinTextSize->SetValue( text_size ); }
62 63 64 65 66 67
    int GetTextSize( void ) { return m_spinTextSize->GetValue(); }

    void SetRepeatHorizontal( int displacement )
    {
        m_spinRepeatHorizontal->SetValue( displacement );
    }
68 69
    int GetRepeatHorizontal( void ) { return m_spinRepeatHorizontal->GetValue(); }
    void SetRepeatVertical( int displacement ) { m_spinRepeatVertical->SetValue( displacement ); }
70 71

    int GetRepeatVertical( void ) { return m_spinRepeatVertical->GetValue(); }
72
    void SetRepeatLabel( int increment ) { m_spinRepeatLabel->SetValue( increment ); }
73 74
    int GetRepeatLabel( void ) { return m_spinRepeatLabel->GetValue(); }

75 76 77
    void SetAutoSaveInterval( int aInterval ) { m_spinAutoSaveInterval->SetValue( aInterval ); }
    int GetAutoSaveInterval() const { return m_spinAutoSaveInterval->GetValue(); }

78 79 80
    void SetShowGrid( bool show ) { m_checkShowGrid->SetValue( show ); }
    bool GetShowGrid( void ) { return m_checkShowGrid->GetValue(); }

81 82
    void SetShowHiddenPins( bool show ) { m_checkShowHiddenPins->SetValue( show ); }
    bool GetShowHiddenPins( void ) { return m_checkShowHiddenPins->GetValue(); }
83

84 85 86 87 88 89 90 91 92
    void SetEnableZoomNoCenter( bool enable )
    {
        m_checkEnableZoomNoCenter->SetValue( enable );
    }

    bool GetEnableZoomNoCenter( void )
    {
        return m_checkEnableZoomNoCenter->GetValue();
    }
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
    void SetEnableMiddleButtonPan( bool enable )
    {
        m_checkEnableMiddleButtonPan->SetValue( enable );
        m_checkMiddleButtonPanLimited->Enable( enable );
    }

    bool GetEnableMiddleButtonPan( void )
    {
        return m_checkEnableMiddleButtonPan->GetValue();
    }
    void SetMiddleButtonPanLimited( bool enable )
    {
        m_checkMiddleButtonPanLimited->SetValue( enable );
    }
    bool GetMiddleButtonPanLimited( void )
    {
109
        return m_checkMiddleButtonPanLimited->GetValue();
110 111
    }

112
    void SetEnableAutoPan( bool enable ) { m_checkAutoPan->SetValue( enable ); }
113 114
    bool GetEnableAutoPan( void ) { return m_checkAutoPan->GetValue(); }

115 116
    void SetEnableHVBusOrientation( bool enable ) { m_checkHVOrientation->SetValue( enable ); }
    bool GetEnableHVBusOrientation( void ) { return m_checkHVOrientation->GetValue(); }
117

118 119
    void SetShowPageLimits( bool show ) { m_checkPageLimits->SetValue( show ); }
    bool GetShowPageLimits( void ) { return m_checkPageLimits->GetValue(); }
120 121

    /** Set the field \a aNdx textctrl to \a aName */
122
    void SetFieldName( int aNdx, wxString aName );
123 124 125

    /** Get the field \a aNdx name from the fields textctrl */
    wxString GetFieldName( int aNdx );
126 127 128 129 130 131

private:
    void OnMiddleBtnPanEnbl( wxCommandEvent& event )
    {
        m_checkMiddleButtonPanLimited->Enable( GetEnableMiddleButtonPan() );
    }
132 133 134
};

#endif // __dialog_eeschema_options__