Use a big hammer when beating wxWidgets over the head.

This commit is contained in:
Jeff Young 2020-05-28 22:16:23 +01:00
parent b06a454559
commit f4e7e201d8
4 changed files with 39 additions and 25 deletions

View File

@ -33,6 +33,20 @@ PANEL_MOUSE_SETTINGS::PANEL_MOUSE_SETTINGS( DIALOG_SHIM* aDialog, wxWindow* aPar
m_dialog( aDialog ),
m_currentScrollMod( {} )
{
#ifdef __WXOSX_MAC__
for( wxSizerItem* child : m_zoomSizer->GetChildren() )
{
if( child->GetWindow() == m_zoomSpeed )
child->SetBorder( 8 );
}
for( wxSizerItem* child : m_panSizer->GetChildren() )
{
if( child->GetWindow() == m_autoPanSpeed )
child->SetBorder( 8 );
}
#endif
m_checkAutoZoomSpeed->Bind( wxEVT_COMMAND_CHECKBOX_CLICKED,
[&]( wxCommandEvent& aEvt )
{

View File

@ -40,44 +40,42 @@ PANEL_MOUSE_SETTINGS_BASE::PANEL_MOUSE_SETTINGS_BASE( wxWindow* parent, wxWindow
gbSizer1->Add( m_checkZoomAcceleration, wxGBPosition( 1, 0 ), wxGBSpan( 1, 3 ), wxRIGHT|wxLEFT, 5 );
wxBoxSizer* bSizer2;
bSizer2 = new wxBoxSizer( wxHORIZONTAL );
m_zoomSizer = new wxBoxSizer( wxHORIZONTAL );
m_staticText1 = new wxStaticText( sbSizer1->GetStaticBox(), wxID_ANY, _("Zoom speed:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText1->Wrap( -1 );
bSizer2->Add( m_staticText1, 0, wxBOTTOM|wxRIGHT|wxLEFT, 6 );
m_zoomSizer->Add( m_staticText1, 0, wxRIGHT|wxLEFT, 8 );
m_zoomSpeed = new wxSlider( sbSizer1->GetStaticBox(), wxID_ANY, 5, 1, 10, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL );
m_zoomSpeed->Enable( false );
m_zoomSpeed->SetToolTip( _("How far to zoom in for each rotation of the mouse wheel") );
m_zoomSpeed->SetMinSize( wxSize( 150,-1 ) );
bSizer2->Add( m_zoomSpeed, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 4 );
m_zoomSizer->Add( m_zoomSpeed, 0, wxTOP|wxRIGHT|wxLEFT, 0 );
m_checkAutoZoomSpeed = new wxCheckBox( sbSizer1->GetStaticBox(), wxID_ANY, _("Automatic"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkAutoZoomSpeed->SetValue(true);
m_checkAutoZoomSpeed->SetToolTip( _("Pick the zoom speed automatically") );
bSizer2->Add( m_checkAutoZoomSpeed, 0, wxBOTTOM|wxRIGHT|wxLEFT, 6 );
m_zoomSizer->Add( m_checkAutoZoomSpeed, 0, wxRIGHT|wxLEFT, 10 );
gbSizer1->Add( bSizer2, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxEXPAND|wxTOP, 5 );
gbSizer1->Add( m_zoomSizer, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxEXPAND|wxTOP, 5 );
wxBoxSizer* bSizer3;
bSizer3 = new wxBoxSizer( wxHORIZONTAL );
m_panSizer = new wxBoxSizer( wxHORIZONTAL );
m_staticText22 = new wxStaticText( sbSizer1->GetStaticBox(), wxID_ANY, _("Auto pan speed:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText22->Wrap( -1 );
bSizer3->Add( m_staticText22, 0, wxBOTTOM|wxRIGHT|wxLEFT, 6 );
m_panSizer->Add( m_staticText22, 0, wxRIGHT|wxLEFT, 8 );
m_autoPanSpeed = new wxSlider( sbSizer1->GetStaticBox(), wxID_ANY, 5, 1, 10, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL );
m_autoPanSpeed->SetToolTip( _("How fast to pan when moving an object off the edge of the screen") );
m_autoPanSpeed->SetMinSize( wxSize( 150,-1 ) );
bSizer3->Add( m_autoPanSpeed, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 4 );
m_panSizer->Add( m_autoPanSpeed, 0, wxTOP|wxRIGHT|wxLEFT, 0 );
gbSizer1->Add( bSizer3, wxGBPosition( 2, 2 ), wxGBSpan( 1, 1 ), wxEXPAND|wxTOP, 5 );
gbSizer1->Add( m_panSizer, wxGBPosition( 2, 2 ), wxGBSpan( 1, 1 ), wxEXPAND|wxTOP, 5 );
gbSizer1->AddGrowableCol( 1 );

View File

@ -304,12 +304,12 @@
<property name="rowspan">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizer2</property>
<property name="name">m_zoomSizer</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<property name="permission">protected</property>
<object class="sizeritem" expanded="1">
<property name="border">6</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="border">8</property>
<property name="flag">wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property>
@ -369,8 +369,8 @@
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">4</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT</property>
<property name="border">0</property>
<property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxSlider" expanded="0">
<property name="BottomDockable">1</property>
@ -434,8 +434,8 @@
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">6</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="border">10</property>
<property name="flag">wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="0">
<property name="BottomDockable">1</property>
@ -508,12 +508,12 @@
<property name="rowspan">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizer3</property>
<property name="name">m_panSizer</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<property name="permission">protected</property>
<object class="sizeritem" expanded="1">
<property name="border">6</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="border">8</property>
<property name="flag">wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
@ -573,8 +573,8 @@
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">4</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT</property>
<property name="border">0</property>
<property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxSlider" expanded="1">
<property name="BottomDockable">1</property>

View File

@ -38,9 +38,11 @@ class PANEL_MOUSE_SETTINGS_BASE : public wxPanel
wxCheckBox* m_checkZoomCenter;
wxCheckBox* m_checkAutoPan;
wxCheckBox* m_checkZoomAcceleration;
wxBoxSizer* m_zoomSizer;
wxStaticText* m_staticText1;
wxSlider* m_zoomSpeed;
wxCheckBox* m_checkAutoZoomSpeed;
wxBoxSizer* m_panSizer;
wxStaticText* m_staticText22;
wxSlider* m_autoPanSpeed;
wxStaticText* m_staticText3;