Browse Source
GAL_OPTIONS_PANEL: replace 2 wxSpinCtrlDouble to try to fix a locale issue.
GAL_OPTIONS_PANEL: replace 2 wxSpinCtrlDouble to try to fix a locale issue.
Sometimes the grid thickness setting does not work, depending on some locale setting. Core developers are not able to reproduce this issue related to a double conversion. So these wxSpinCtrlDouble are replaced by a wxSpinCtrl (using ints) and a wxChoice.newinvert
6 changed files with 1342 additions and 170 deletions
-
1common/CMakeLists.txt
-
180common/widgets/gal_options_panel.cpp
-
122common/widgets/gal_options_panel_base.cpp
-
1118common/widgets/gal_options_panel_base.fbp
-
62common/widgets/gal_options_panel_base.h
-
29include/widgets/gal_options_panel.h
@ -0,0 +1,122 @@ |
|||
///////////////////////////////////////////////////////////////////////////
|
|||
// C++ code generated with wxFormBuilder (version 3.10.0-39-g3487c3cb)
|
|||
// http://www.wxformbuilder.org/
|
|||
//
|
|||
// PLEASE DO *NOT* EDIT THIS FILE!
|
|||
///////////////////////////////////////////////////////////////////////////
|
|||
|
|||
#include "gal_options_panel_base.h"
|
|||
|
|||
///////////////////////////////////////////////////////////////////////////
|
|||
|
|||
GAL_OPTIONS_PANEL_BASE::GAL_OPTIONS_PANEL_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name ) |
|||
{ |
|||
wxBoxSizer* mainSizer; |
|||
mainSizer = new wxBoxSizer( wxVERTICAL ); |
|||
|
|||
wxBoxSizer* sLeftSizer; |
|||
sLeftSizer = new wxBoxSizer( wxVERTICAL ); |
|||
|
|||
wxString m_renderingEngineChoices[] = { _("Accelerated graphics"), _("Fallback graphics") }; |
|||
int m_renderingEngineNChoices = sizeof( m_renderingEngineChoices ) / sizeof( wxString ); |
|||
m_renderingEngine = new wxRadioBox( this, wxID_ANY, _("Rendering Engine"), wxDefaultPosition, wxDefaultSize, m_renderingEngineNChoices, m_renderingEngineChoices, 1, wxRA_SPECIFY_COLS ); |
|||
m_renderingEngine->SetSelection( 0 ); |
|||
sLeftSizer->Add( m_renderingEngine, 0, wxALL, 5 ); |
|||
|
|||
|
|||
mainSizer->Add( sLeftSizer, 0, wxEXPAND, 5 ); |
|||
|
|||
m_staticText1 = new wxStaticText( this, wxID_ANY, _("Grid Options"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_staticText1->Wrap( -1 ); |
|||
mainSizer->Add( m_staticText1, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); |
|||
mainSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 ); |
|||
|
|||
wxString m_gridStyleChoices[] = { _("Dots"), _("Lines"), _("Small crosses") }; |
|||
int m_gridStyleNChoices = sizeof( m_gridStyleChoices ) / sizeof( wxString ); |
|||
m_gridStyle = new wxRadioBox( this, wxID_ANY, _("Grid Style"), wxDefaultPosition, wxDefaultSize, m_gridStyleNChoices, m_gridStyleChoices, 1, wxRA_SPECIFY_COLS ); |
|||
m_gridStyle->SetSelection( 0 ); |
|||
mainSizer->Add( m_gridStyle, 0, wxALL, 5 ); |
|||
|
|||
wxFlexGridSizer* fgGridSettingsGrid; |
|||
fgGridSettingsGrid = new wxFlexGridSizer( 0, 3, 0, 0 ); |
|||
fgGridSettingsGrid->AddGrowableCol( 1 ); |
|||
fgGridSettingsGrid->SetFlexibleDirection( wxBOTH ); |
|||
fgGridSettingsGrid->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); |
|||
|
|||
l_gridLineWidth = new wxStaticText( this, wxID_ANY, _("Grid thickness:"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
l_gridLineWidth->Wrap( -1 ); |
|||
fgGridSettingsGrid->Add( l_gridLineWidth, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); |
|||
|
|||
wxArrayString m_gridLineWidthChoices; |
|||
m_gridLineWidth = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_gridLineWidthChoices, 0 ); |
|||
m_gridLineWidth->SetSelection( 0 ); |
|||
fgGridSettingsGrid->Add( m_gridLineWidth, 0, wxALL|wxEXPAND, 5 ); |
|||
|
|||
l_gridLineWidthUnits = new wxStaticText( this, wxID_ANY, _("px"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
l_gridLineWidthUnits->Wrap( -1 ); |
|||
fgGridSettingsGrid->Add( l_gridLineWidthUnits, 0, wxALL, 5 ); |
|||
|
|||
l_gridMinSpacing = new wxStaticText( this, wxID_ANY, _("Min grid spacing:"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
l_gridMinSpacing->Wrap( -1 ); |
|||
fgGridSettingsGrid->Add( l_gridMinSpacing, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); |
|||
|
|||
m_gridMinSpacing = new wxSpinCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 5, 200, 10 ); |
|||
fgGridSettingsGrid->Add( m_gridMinSpacing, 0, wxALL|wxEXPAND, 5 ); |
|||
|
|||
l_gridMinSpacingUnits = new wxStaticText( this, wxID_ANY, _("px"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
l_gridMinSpacingUnits->Wrap( -1 ); |
|||
fgGridSettingsGrid->Add( l_gridMinSpacingUnits, 0, wxALL, 5 ); |
|||
|
|||
l_gridSnapOptions = new wxStaticText( this, wxID_ANY, _("Snap to grid:"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
l_gridSnapOptions->Wrap( -1 ); |
|||
fgGridSettingsGrid->Add( l_gridSnapOptions, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); |
|||
|
|||
wxString m_gridSnapOptionsChoices[] = { _("Always"), _("When grid shown"), _("Never") }; |
|||
int m_gridSnapOptionsNChoices = sizeof( m_gridSnapOptionsChoices ) / sizeof( wxString ); |
|||
m_gridSnapOptions = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_gridSnapOptionsNChoices, m_gridSnapOptionsChoices, 0 ); |
|||
m_gridSnapOptions->SetSelection( 0 ); |
|||
fgGridSettingsGrid->Add( m_gridSnapOptions, 0, wxALL|wxEXPAND, 5 ); |
|||
|
|||
|
|||
fgGridSettingsGrid->Add( 0, 0, 1, wxEXPAND, 5 ); |
|||
|
|||
|
|||
mainSizer->Add( fgGridSettingsGrid, 0, wxEXPAND, 5 ); |
|||
|
|||
|
|||
mainSizer->Add( 0, 15, 0, 0, 5 ); |
|||
|
|||
m_stGridLabel = new wxStaticText( this, wxID_ANY, _("Cursor Options"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
m_stGridLabel->Wrap( -1 ); |
|||
mainSizer->Add( m_stGridLabel, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); |
|||
|
|||
m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); |
|||
mainSizer->Add( m_staticline2, 0, wxEXPAND | wxALL, 5 ); |
|||
|
|||
wxBoxSizer* sCursorSettings; |
|||
sCursorSettings = new wxBoxSizer( wxVERTICAL ); |
|||
|
|||
wxString m_cursorShapeChoices[] = { _("Small crosshair"), _("Full window crosshair") }; |
|||
int m_cursorShapeNChoices = sizeof( m_cursorShapeChoices ) / sizeof( wxString ); |
|||
m_cursorShape = new wxRadioBox( this, wxID_ANY, _("Cursor Shape"), wxDefaultPosition, wxDefaultSize, m_cursorShapeNChoices, m_cursorShapeChoices, 1, wxRA_SPECIFY_COLS ); |
|||
m_cursorShape->SetSelection( 0 ); |
|||
m_cursorShape->SetToolTip( _("Cursor shape for drawing, placement and movement tools") ); |
|||
|
|||
sCursorSettings->Add( m_cursorShape, 0, wxALL, 5 ); |
|||
|
|||
m_forceCursorDisplay = new wxCheckBox( this, wxID_ANY, _("Always show crosshairs"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
sCursorSettings->Add( m_forceCursorDisplay, 0, wxALL, 5 ); |
|||
|
|||
|
|||
mainSizer->Add( sCursorSettings, 1, wxEXPAND, 5 ); |
|||
|
|||
|
|||
this->SetSizer( mainSizer ); |
|||
this->Layout(); |
|||
} |
|||
|
|||
GAL_OPTIONS_PANEL_BASE::~GAL_OPTIONS_PANEL_BASE() |
|||
{ |
|||
} |
|||
1118
common/widgets/gal_options_panel_base.fbp
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,62 @@ |
|||
/////////////////////////////////////////////////////////////////////////// |
|||
// C++ code generated with wxFormBuilder (version 3.10.0-39-g3487c3cb) |
|||
// http://www.wxformbuilder.org/ |
|||
// |
|||
// PLEASE DO *NOT* EDIT THIS FILE! |
|||
/////////////////////////////////////////////////////////////////////////// |
|||
|
|||
#pragma once |
|||
|
|||
#include <wx/artprov.h> |
|||
#include <wx/xrc/xmlres.h> |
|||
#include <wx/intl.h> |
|||
#include <wx/string.h> |
|||
#include <wx/radiobox.h> |
|||
#include <wx/gdicmn.h> |
|||
#include <wx/font.h> |
|||
#include <wx/colour.h> |
|||
#include <wx/settings.h> |
|||
#include <wx/sizer.h> |
|||
#include <wx/stattext.h> |
|||
#include <wx/statline.h> |
|||
#include <wx/choice.h> |
|||
#include <wx/spinctrl.h> |
|||
#include <wx/checkbox.h> |
|||
#include <wx/panel.h> |
|||
|
|||
/////////////////////////////////////////////////////////////////////////// |
|||
|
|||
|
|||
/////////////////////////////////////////////////////////////////////////////// |
|||
/// Class GAL_OPTIONS_PANEL_BASE |
|||
/////////////////////////////////////////////////////////////////////////////// |
|||
class GAL_OPTIONS_PANEL_BASE : public wxPanel |
|||
{ |
|||
private: |
|||
|
|||
protected: |
|||
wxRadioBox* m_renderingEngine; |
|||
wxStaticText* m_staticText1; |
|||
wxStaticLine* m_staticline1; |
|||
wxRadioBox* m_gridStyle; |
|||
wxStaticText* l_gridLineWidth; |
|||
wxChoice* m_gridLineWidth; |
|||
wxStaticText* l_gridLineWidthUnits; |
|||
wxStaticText* l_gridMinSpacing; |
|||
wxSpinCtrl* m_gridMinSpacing; |
|||
wxStaticText* l_gridMinSpacingUnits; |
|||
wxStaticText* l_gridSnapOptions; |
|||
wxChoice* m_gridSnapOptions; |
|||
wxStaticText* m_stGridLabel; |
|||
wxStaticLine* m_staticline2; |
|||
wxRadioBox* m_cursorShape; |
|||
wxCheckBox* m_forceCursorDisplay; |
|||
|
|||
public: |
|||
|
|||
GAL_OPTIONS_PANEL_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 387,523 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); |
|||
|
|||
~GAL_OPTIONS_PANEL_BASE(); |
|||
|
|||
}; |
|||
|
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue