KiCad PCB EDA Suite
Loading...
Searching...
No Matches
panel_spacemouse.cpp
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 The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
21#include <pgm_base.h>
23
25 PANEL_SPACEMOUSE_BASE( aParent )
26{
27#ifdef __WXMAC__
28 wxSizerItem* sizerItem = m_gbSizer->FindItemAtPosition( wxGBPosition( 0, 0 ) );
29 sizerItem->SetBorder( 6 );
30 sizerItem->SetFlag( wxBOTTOM );
31
32 sizerItem = m_gbSizer->FindItemAtPosition( wxGBPosition( 3, 0 ) );
33 sizerItem->SetBorder( 6 );
34 sizerItem->SetFlag( wxBOTTOM );
35#endif
36}
37
39{
40 const COMMON_SETTINGS* cfg = Pgm().GetCommonSettings();
41
43
44 return true;
45}
46
48{
50
51 cfg->m_SpaceMouse.rotate_speed = m_rotationSpeed->GetValue();
52 cfg->m_SpaceMouse.pan_speed = m_autoPanSpeed->GetValue();
54 cfg->m_SpaceMouse.reverse_pan_y = m_reverseY->GetValue();
55 cfg->m_SpaceMouse.reverse_pan_x = m_reverseX->GetValue();
56 cfg->m_SpaceMouse.reverse_zoom = m_reverseZ->GetValue();
57
58 return true;
59}
60
62{
63 COMMON_SETTINGS defaultSettings;
64
65 defaultSettings.ResetToDefaults();
66
67 applySettingsToPanel( defaultSettings );
68}
69
71{
72 m_rotationSpeed->SetValue( aSettings.m_SpaceMouse.rotate_speed );
73 m_autoPanSpeed->SetValue( aSettings.m_SpaceMouse.pan_speed );
74 m_checkEnablePanH->SetValue( aSettings.m_SpaceMouse.reverse_rotate );
75 m_reverseY->SetValue( aSettings.m_SpaceMouse.reverse_pan_y );
76 m_reverseX->SetValue( aSettings.m_SpaceMouse.reverse_pan_x );
77 m_reverseZ->SetValue( aSettings.m_SpaceMouse.reverse_zoom );
78}
SPACEMOUSE m_SpaceMouse
void ResetToDefaults()
Resets all parameters to default values.
PANEL_SPACEMOUSE_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
bool TransferDataToWindow() override
PANEL_SPACEMOUSE(wxWindow *aParent)
void ResetPanel() override
Reset the contents of this panel.
bool TransferDataFromWindow() override
void applySettingsToPanel(const COMMON_SETTINGS &aSettings)
virtual COMMON_SETTINGS * GetCommonSettings() const
Definition pgm_base.cpp:576
PGM_BASE & Pgm()
The global program "get" accessor.
Definition pgm_base.cpp:913
see class PGM_BASE