26#include <wx/checkbox.h>
28#include <wx/radiobox.h>
29#include <wx/spinctrl.h>
30#include <wx/stattext.h>
31#include <wx/statbox.h>
32#include <wx/statline.h>
71 wxPanel( aParent, wxID_ANY ),
79 wxBoxSizer* sLeftSizer =
new wxBoxSizer( wxVERTICAL );
80 m_mainSizer->Add( sLeftSizer, 1, wxRIGHT | wxBOTTOM | wxEXPAND, 5 );
87 wxString engineChoices[] = {
_(
"Accelerated graphics" ),
_(
"Fallback graphics" ) };
89 wxDefaultPosition, wxDefaultSize,
90 sizeof( engineChoices ) /
sizeof( wxString ),
91 engineChoices, 1, wxRA_SPECIFY_COLS );
92 m_renderingEngine->SetItemToolTip( 0,
_(
"Hardware-accelerated graphics (recommended)" ) );
93 m_renderingEngine->SetItemToolTip( 1,
_(
"Software graphics (for computers which do not "
94 "support KiCad's hardware acceleration "
97 sLeftSizer->Add(
m_renderingEngine, 0, wxTOP | wxBOTTOM | wxRIGHT | wxEXPAND, 5 );
105 wxStaticText* gridLabel =
new wxStaticText(
this, wxID_ANY,
_(
"Grid Options" ) );
106 sLeftSizer->Add( gridLabel, 0, wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 13 );
108 wxStaticLine* staticline1 =
new wxStaticLine(
this, wxID_ANY, wxDefaultPosition,
109 wxDefaultSize, wxLI_HORIZONTAL );
110 sLeftSizer->Add( staticline1, 0, wxEXPAND|wxBOTTOM, 5 );
112 wxBoxSizer* sGridSettings =
new wxBoxSizer( wxVERTICAL );
114 wxString m_gridStyleChoices[] = {
120 int m_gridStyleNChoices =
sizeof( m_gridStyleChoices ) /
sizeof( wxString );
121 m_gridStyle =
new wxRadioBox(
this, wxID_ANY,
_(
"Grid Style" ), wxDefaultPosition,
122 wxDefaultSize, m_gridStyleNChoices, m_gridStyleChoices, 1,
124 sGridSettings->Add(
m_gridStyle, 0, wxALL | wxEXPAND, 5 );
126 wxFlexGridSizer* sGridSettingsGrid;
127 sGridSettingsGrid =
new wxFlexGridSizer( 0, 3, 0, 0 );
128 sGridSettingsGrid->AddGrowableCol( 1 );
129 sGridSettingsGrid->SetFlexibleDirection( wxBOTH );
130 sGridSettingsGrid->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
132 l_gridLineWidth =
new wxStaticText(
this, wxID_ANY,
_(
"Grid thickness:" ) );
134 sGridSettingsGrid->Add(
l_gridLineWidth, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT | wxTOP, 5 );
140 sGridSettingsGrid->Add(
m_gridLineWidth, 0, wxALIGN_CENTER_VERTICAL | wxEXPAND | wxTOP, 5 );
144 sGridSettingsGrid->Add(
l_gridLineWidthUnits, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT | wxLEFT | wxTOP, 5 );
148 sGridSettingsGrid->Add(
l_gridMinSpacing, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT | wxTOP, 5 );
154 sGridSettingsGrid->Add(
m_gridMinSpacing, 0, wxALIGN_CENTER_VERTICAL | wxEXPAND | wxTOP, 5 );
158 sGridSettingsGrid->Add(
l_gridMinSpacingUnits, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT | wxLEFT | wxTOP, 5 );
162 sGridSettingsGrid->Add(
l_gridSnapOptions, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT | wxTOP, 5 );
164 wxString gridSnapChoices[] = {
_(
"Always" ),
_(
"When grid shown" ),
_(
"Never" ) };
165 int gridSnapNChoices =
sizeof( gridSnapChoices ) /
sizeof( wxString );
166 m_gridSnapOptions =
new wxChoice(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
167 gridSnapNChoices, gridSnapChoices );
170 wxALIGN_CENTER_VERTICAL | wxEXPAND | wxTOP | wxBOTTOM, 5 );
176 wxALIGN_CENTER_VERTICAL | wxALL | wxRESERVE_SPACE_EVEN_IF_HIDDEN,
180 sGridSettings->Add( sGridSettingsGrid, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND, 5 );
182 sLeftSizer->Add( sGridSettings, 0, wxEXPAND|wxLEFT, 5 );
189 sLeftSizer->Add( 0, 15, 0, wxEXPAND, 5 );
191 wxStaticText* gridLabel =
new wxStaticText(
this, wxID_ANY,
_(
"Cursor Options" ) );
192 sLeftSizer->Add( gridLabel, 0, wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 13 );
194 wxStaticLine* staticline2 =
new wxStaticLine(
this, wxID_ANY, wxDefaultPosition,
195 wxDefaultSize, wxLI_HORIZONTAL );
196 sLeftSizer->Add( staticline2, 0, wxEXPAND|wxBOTTOM, 5 );
198 wxBoxSizer* sCursorSettings =
new wxBoxSizer( wxVERTICAL );
199 sLeftSizer->Add( sCursorSettings, 0, wxEXPAND|wxLEFT, 5 );
201 wxString m_CursorShapeChoices[] = {
202 _(
"Small crosshair" ),
203 _(
"Full window crosshair" )
206 int m_CursorShapeNChoices =
sizeof( m_CursorShapeChoices ) /
sizeof( wxString );
207 m_cursorShape =
new wxRadioBox(
this, wxID_ANY,
_(
"Cursor Shape" ), wxDefaultPosition,
208 wxDefaultSize, m_CursorShapeNChoices, m_CursorShapeChoices,
209 1, wxRA_SPECIFY_COLS );
212 m_cursorShape->SetToolTip(
_(
"Cursor shape for drawing, placement and movement tools" ) );
213 sCursorSettings->Add(
m_cursorShape, 0, wxALL | wxEXPAND, 5 );
268 m_cfg = aAppSettings;
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
@ GAL_TYPE_OPENGL
OpenGL implementation.
@ GAL_TYPE_CAIRO
Cairo implementation.
bool ResetPanel(APP_SETTINGS_BASE *aAppSettings)
wxSpinCtrlDouble * m_gridMinSpacing
wxCheckBox * m_forceCursorDisplay
wxStaticText * l_gridMinSpacing
wxRadioBox * m_cursorShape
wxStaticText * l_gridMinSpacingUnits
bool TransferDataToWindow() override
Load the panel controls from the given opt.
wxRadioBox * m_renderingEngine
wxChoice * m_gridSnapOptions
wxStaticText * l_gridLineWidthUnits
bool TransferDataFromWindow() override
Read the options set in the UI into the given options object.
wxStaticText * l_gridLineWidth
wxStaticText * l_gridSnapSpace
wxStaticText * l_gridSnapOptions
wxSpinCtrlDouble * m_gridLineWidth
GAL_OPTIONS_PANEL(wxWindow *aParent, APP_SETTINGS_BASE *aAppSettings)
APP_SETTINGS_BASE * m_cfg
static const double gridMinSpacingMin
static const UTIL::CFG_MAP< KIGFX::GRID_STYLE > gridStyleSelectMap
TODO: These are duplicated in gal_display_options - Unify!
static const UTIL::CFG_MAP< KIGFX::GRID_SNAPPING > gridSnapConfigVals
static const double gridThicknessStep
static const double gridMinSpacingMax
static const double gridMinSpacingStep
static const double gridThicknessMax
static const double gridThicknessMin
@ SMALL_CROSS
Use small cross instead of dots for the grid.
@ DOTS
Use dots for the grid.
@ LINES
Use lines for the grid.
std::vector< std::pair< T, long > > CFG_MAP
A config value table is a list of native values (usually enums) to a different set of values,...