Support 3 drag vs. select options, and unifiy with other drag prefs.

Fixes https://gitlab.com/kicad/code/kicad/issues/5493
This commit is contained in:
Jeff Young 2021-01-11 11:48:51 +00:00
parent 7134ff2da6
commit 6c648df4c6
17 changed files with 435 additions and 199 deletions

View File

@ -126,9 +126,8 @@ bool PANEL_COMMON_SETTINGS::TransferDataFromWindow()
commonSettings->m_Appearance.use_icons_in_menus = m_checkBoxIconsInMenus->GetValue();
commonSettings->m_Input.immediate_actions = !m_NonImmediateActions->GetValue();
commonSettings->m_Input.prefer_select_to_drag = m_PreferSelectToDrag->GetValue();
commonSettings->m_Input.warp_mouse_on_move = m_warpMouseOnMove->GetValue();
commonSettings->m_Input.immediate_actions = !m_NonImmediateActions->GetValue();
commonSettings->m_Input.warp_mouse_on_move = m_warpMouseOnMove->GetValue();
commonSettings->m_Backup.enabled = m_cbBackupEnabled->GetValue();
commonSettings->m_Backup.backup_on_autosave = m_cbBackupAutosave->GetValue();
@ -203,7 +202,6 @@ void PANEL_COMMON_SETTINGS::applySettingsToPanel( COMMON_SETTINGS& aSettings )
m_checkBoxIconsInMenus->SetValue( aSettings.m_Appearance.use_icons_in_menus );
m_PreferSelectToDrag->SetValue( aSettings.m_Input.prefer_select_to_drag );
m_warpMouseOnMove->SetValue( aSettings.m_Input.warp_mouse_on_move );
m_NonImmediateActions->SetValue( !aSettings.m_Input.immediate_actions );

View File

@ -201,9 +201,6 @@ PANEL_COMMON_SETTINGS_BASE::PANEL_COMMON_SETTINGS_BASE( wxWindow* parent, wxWind
wxStaticBoxSizer* sbSizer4;
sbSizer4 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Editing") ), wxVERTICAL );
m_PreferSelectToDrag = new wxCheckBox( sbSizer4->GetStaticBox(), wxID_ANY, _("Prefer selection to dragging"), wxDefaultPosition, wxDefaultSize, 0 );
sbSizer4->Add( m_PreferSelectToDrag, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_warpMouseOnMove = new wxCheckBox( sbSizer4->GetStaticBox(), wxID_ANY, _("Warp mouse to origin of moved object"), wxDefaultPosition, wxDefaultSize, 0 );
sbSizer4->Add( m_warpMouseOnMove, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );

View File

@ -1916,70 +1916,6 @@
<property name="orient">wxVERTICAL</property>
<property name="parent">1</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Prefer selection to dragging</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_PreferSelectToDrag</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property>

View File

@ -67,7 +67,6 @@ class PANEL_COMMON_SETTINGS_BASE : public RESETTABLE_PANEL
wxSpinCtrlDouble* m_canvasScaleCtrl;
wxCheckBox* m_canvasScaleAuto;
wxCheckBox* m_checkBoxIconsInMenus;
wxCheckBox* m_PreferSelectToDrag;
wxCheckBox* m_warpMouseOnMove;
wxCheckBox* m_NonImmediateActions;
wxCheckBox* m_cbBackupEnabled;

View File

@ -81,23 +81,28 @@ bool PANEL_MOUSE_SETTINGS::TransferDataFromWindow()
if( !isScrollModSetValid( m_currentScrollMod ) )
return false;
int drag_middle = static_cast<int>( MOUSE_DRAG_ACTION::NONE );
int drag_right = static_cast<int>( MOUSE_DRAG_ACTION::NONE );
switch( m_choiceLeftButtonDrag->GetSelection() )
{
case 0: cfg->m_Input.drag_left = static_cast<int>( MOUSE_DRAG_ACTION::SELECT ); break;
case 1: cfg->m_Input.drag_left = static_cast<int>( MOUSE_DRAG_ACTION::DRAG_SELECTED ); break;
case 2: cfg->m_Input.drag_left = static_cast<int>( MOUSE_DRAG_ACTION::DRAG_ANY ); break;
default: break;
}
switch( m_choiceMiddleButtonDrag->GetSelection() )
{
case 0: drag_middle = static_cast<int>( MOUSE_DRAG_ACTION::PAN ); break;
case 1: drag_middle = static_cast<int>( MOUSE_DRAG_ACTION::ZOOM ); break;
case 2: break;
default: break;
case 0: cfg->m_Input.drag_middle = static_cast<int>( MOUSE_DRAG_ACTION::PAN ); break;
case 1: cfg->m_Input.drag_middle = static_cast<int>( MOUSE_DRAG_ACTION::ZOOM ); break;
case 2: cfg->m_Input.drag_middle = static_cast<int>( MOUSE_DRAG_ACTION::NONE ); break;
default: break;
}
switch( m_choiceRightButtonDrag->GetSelection() )
{
case 0: drag_right = static_cast<int>( MOUSE_DRAG_ACTION::PAN ); break;
case 1: drag_right = static_cast<int>( MOUSE_DRAG_ACTION::ZOOM ); break;
case 2: break;
default: break;
case 0: cfg->m_Input.drag_right = static_cast<int>( MOUSE_DRAG_ACTION::PAN ); break;
case 1: cfg->m_Input.drag_right = static_cast<int>( MOUSE_DRAG_ACTION::ZOOM ); break;
case 2: cfg->m_Input.drag_right = static_cast<int>( MOUSE_DRAG_ACTION::NONE ); break;
default: break;
}
cfg->m_Input.center_on_zoom = m_checkZoomCenter->GetValue();
@ -112,9 +117,6 @@ bool PANEL_MOUSE_SETTINGS::TransferDataFromWindow()
cfg->m_Input.scroll_modifier_pan_h = m_currentScrollMod.panh;
cfg->m_Input.scroll_modifier_pan_v = m_currentScrollMod.panv;
cfg->m_Input.drag_middle = drag_middle;
cfg->m_Input.drag_right = drag_right;
return true;
}
@ -141,6 +143,14 @@ void PANEL_MOUSE_SETTINGS::applySettingsToPanel( const COMMON_SETTINGS& aSetting
m_zoomSpeed->Enable( !aSettings.m_Input.zoom_speed_auto );
switch( static_cast<MOUSE_DRAG_ACTION>( aSettings.m_Input.drag_left ) )
{
case MOUSE_DRAG_ACTION::SELECT: m_choiceLeftButtonDrag->SetSelection( 0 ); break;
case MOUSE_DRAG_ACTION::DRAG_SELECTED: m_choiceLeftButtonDrag->SetSelection( 1 ); break;
case MOUSE_DRAG_ACTION::DRAG_ANY: m_choiceLeftButtonDrag->SetSelection( 2 ); break;
default: break;
}
auto set_mouse_buttons =
[]( const MOUSE_DRAG_ACTION& aVal, wxChoice* aChoice )
{

View File

@ -49,9 +49,9 @@ PANEL_MOUSE_SETTINGS_BASE::PANEL_MOUSE_SETTINGS_BASE( wxWindow* parent, wxWindow
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 ) );
m_zoomSpeed->SetMinSize( wxSize( 120,-1 ) );
m_zoomSizer->Add( m_zoomSpeed, 0, wxTOP|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 0 );
m_zoomSizer->Add( m_zoomSpeed, 1, wxTOP|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 0 );
m_checkAutoZoomSpeed = new wxCheckBox( sbSizer1->GetStaticBox(), wxID_ANY, _("Automatic"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkAutoZoomSpeed->SetValue(true);
@ -70,15 +70,17 @@ PANEL_MOUSE_SETTINGS_BASE::PANEL_MOUSE_SETTINGS_BASE( wxWindow* parent, wxWindow
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 ) );
m_autoPanSpeed->SetMinSize( wxSize( 120,-1 ) );
m_panSizer->Add( m_autoPanSpeed, 0, wxTOP|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 0 );
m_panSizer->Add( m_autoPanSpeed, 1, wxTOP|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 0 );
gbSizer1->Add( m_panSizer, wxGBPosition( 2, 2 ), wxGBSpan( 1, 1 ), wxEXPAND|wxTOP, 5 );
gbSizer1->AddGrowableCol( 0 );
gbSizer1->AddGrowableCol( 1 );
gbSizer1->AddGrowableCol( 2 );
sbSizer1->Add( gbSizer1, 1, wxEXPAND|wxRIGHT, 10 );
@ -86,33 +88,52 @@ PANEL_MOUSE_SETTINGS_BASE::PANEL_MOUSE_SETTINGS_BASE( wxWindow* parent, wxWindow
bSizer1->Add( sbSizer1, 0, wxALL|wxEXPAND, 10 );
wxStaticBoxSizer* sbSizer2;
sbSizer2 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Mouse Buttons") ), wxVERTICAL );
sbSizer2 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Drag Gestures") ), wxVERTICAL );
wxFlexGridSizer* fgSizer1;
fgSizer1 = new wxFlexGridSizer( 0, 2, 5, 5 );
fgSizer1->AddGrowableRow( 0 );
fgSizer1 = new wxFlexGridSizer( 0, 3, 5, 5 );
fgSizer1->AddGrowableCol( 2 );
fgSizer1->SetFlexibleDirection( wxHORIZONTAL );
fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_leftButtonDragLabel = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Left button drag:"), wxDefaultPosition, wxDefaultSize, 0 );
m_leftButtonDragLabel->Wrap( -1 );
fgSizer1->Add( m_leftButtonDragLabel, 0, wxBOTTOM|wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 );
wxString m_choiceLeftButtonDragChoices[] = { _("Draw selection rectangle"), _("Drag selected objects; otherwise draw selection rectangle"), _("Drag any object (selected or not)") };
int m_choiceLeftButtonDragNChoices = sizeof( m_choiceLeftButtonDragChoices ) / sizeof( wxString );
m_choiceLeftButtonDrag = new wxChoice( sbSizer2->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceLeftButtonDragNChoices, m_choiceLeftButtonDragChoices, 0 );
m_choiceLeftButtonDrag->SetSelection( 0 );
fgSizer1->Add( m_choiceLeftButtonDrag, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 );
m_staticText3 = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Middle button drag:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText3->Wrap( -1 );
fgSizer1->Add( m_staticText3, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
fgSizer1->Add( m_staticText3, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 );
wxString m_choiceMiddleButtonDragChoices[] = { _("Pan"), _("Zoom"), _("None") };
int m_choiceMiddleButtonDragNChoices = sizeof( m_choiceMiddleButtonDragChoices ) / sizeof( wxString );
m_choiceMiddleButtonDrag = new wxChoice( sbSizer2->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceMiddleButtonDragNChoices, m_choiceMiddleButtonDragChoices, 0 );
m_choiceMiddleButtonDrag->SetSelection( 0 );
fgSizer1->Add( m_choiceMiddleButtonDrag, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
fgSizer1->Add( m_choiceMiddleButtonDrag, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 );
m_staticText31 = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Right button drag:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText31->Wrap( -1 );
fgSizer1->Add( m_staticText31, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
fgSizer1->Add( m_staticText31, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 );
wxString m_choiceRightButtonDragChoices[] = { _("Pan"), _("Zoom"), _("None") };
int m_choiceRightButtonDragNChoices = sizeof( m_choiceRightButtonDragChoices ) / sizeof( wxString );
m_choiceRightButtonDrag = new wxChoice( sbSizer2->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceRightButtonDragNChoices, m_choiceRightButtonDragChoices, 0 );
m_choiceRightButtonDrag->SetSelection( 0 );
fgSizer1->Add( m_choiceRightButtonDrag, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
fgSizer1->Add( m_choiceRightButtonDrag, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 );
sbSizer2->Add( fgSizer1, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
@ -121,99 +142,116 @@ PANEL_MOUSE_SETTINGS_BASE::PANEL_MOUSE_SETTINGS_BASE( wxWindow* parent, wxWindow
bSizer1->Add( sbSizer2, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 10 );
wxStaticBoxSizer* sbSizer3;
sbSizer3 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Mouse Wheel and Touchpad Scrolling") ), wxVERTICAL );
sbSizer3 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Scroll Gestures") ), wxVERTICAL );
m_staticText21 = new wxStaticText( sbSizer3->GetStaticBox(), wxID_ANY, _("Behavior of vertical touchpad or scroll wheel movement:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText21 = new wxStaticText( sbSizer3->GetStaticBox(), wxID_ANY, _("Vertical touchpad or scroll wheel movement:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText21->Wrap( -1 );
sbSizer3->Add( m_staticText21, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
sbSizer3->Add( m_staticText21, 0, wxRIGHT|wxLEFT, 5 );
wxFlexGridSizer* fgSizer2;
fgSizer2 = new wxFlexGridSizer( 0, 5, 0, 5 );
fgSizer2->SetFlexibleDirection( wxHORIZONTAL );
fgSizer2 = new wxFlexGridSizer( 0, 5, 5, 0 );
fgSizer2->AddGrowableCol( 0 );
fgSizer2->SetFlexibleDirection( wxBOTH );
fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_staticText19 = new wxStaticText( sbSizer3->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_staticText19->Wrap( -1 );
fgSizer2->Add( m_staticText19, 0, wxALIGN_RIGHT|wxALL, 5 );
fgSizer2->Add( m_staticText19, 0, wxALIGN_RIGHT|wxTOP|wxRIGHT|wxLEFT, 5 );
m_staticText17 = new wxStaticText( sbSizer3->GetStaticBox(), wxID_ANY, _("No Modifiers"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText17 = new wxStaticText( sbSizer3->GetStaticBox(), wxID_ANY, _("--"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText17->Wrap( -1 );
fgSizer2->Add( m_staticText17, 0, wxALL, 5 );
fgSizer2->Add( m_staticText17, 0, wxTOP|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 );
m_lblCtrl = new wxStaticText( sbSizer3->GetStaticBox(), wxID_ANY, _("Ctrl"), wxDefaultPosition, wxDefaultSize, 0 );
m_lblCtrl->Wrap( -1 );
fgSizer2->Add( m_lblCtrl, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 );
fgSizer2->Add( m_lblCtrl, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 );
m_staticText8 = new wxStaticText( sbSizer3->GetStaticBox(), wxID_ANY, _("Shift"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText8->Wrap( -1 );
fgSizer2->Add( m_staticText8, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 );
fgSizer2->Add( m_staticText8, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 );
m_lblAlt = new wxStaticText( sbSizer3->GetStaticBox(), wxID_ANY, _("Alt"), wxDefaultPosition, wxDefaultSize, 0 );
m_lblAlt->Wrap( -1 );
fgSizer2->Add( m_lblAlt, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 );
fgSizer2->Add( m_lblAlt, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 );
m_staticText10 = new wxStaticText( sbSizer3->GetStaticBox(), wxID_ANY, _("Zoom:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText10->Wrap( -1 );
fgSizer2->Add( m_staticText10, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 );
fgSizer2->Add( m_staticText10, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxRIGHT, 5 );
m_rbZoomNone = new wxRadioButton( sbSizer3->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
fgSizer2->Add( m_rbZoomNone, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 );
fgSizer2->Add( m_rbZoomNone, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 );
m_rbZoomCtrl = new wxRadioButton( sbSizer3->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizer2->Add( m_rbZoomCtrl, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 );
fgSizer2->Add( m_rbZoomCtrl, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 );
m_rbZoomShift = new wxRadioButton( sbSizer3->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizer2->Add( m_rbZoomShift, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 );
fgSizer2->Add( m_rbZoomShift, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
m_rbZoomAlt = new wxRadioButton( sbSizer3->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizer2->Add( m_rbZoomAlt, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 );
fgSizer2->Add( m_rbZoomAlt, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
m_staticText11 = new wxStaticText( sbSizer3->GetStaticBox(), wxID_ANY, _("Pan up/down:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText11->Wrap( -1 );
fgSizer2->Add( m_staticText11, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 );
fgSizer2->Add( m_staticText11, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxRIGHT, 5 );
m_rbPanVNone = new wxRadioButton( sbSizer3->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
fgSizer2->Add( m_rbPanVNone, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 );
fgSizer2->Add( m_rbPanVNone, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 );
m_rbPanVCtrl = new wxRadioButton( sbSizer3->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizer2->Add( m_rbPanVCtrl, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 );
fgSizer2->Add( m_rbPanVCtrl, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 );
m_rbPanVShift = new wxRadioButton( sbSizer3->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizer2->Add( m_rbPanVShift, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 );
fgSizer2->Add( m_rbPanVShift, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
m_rbPanVAlt = new wxRadioButton( sbSizer3->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizer2->Add( m_rbPanVAlt, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 );
fgSizer2->Add( m_rbPanVAlt, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
m_staticText20 = new wxStaticText( sbSizer3->GetStaticBox(), wxID_ANY, _("Pan left/right:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText20->Wrap( -1 );
fgSizer2->Add( m_staticText20, 0, wxALIGN_RIGHT|wxALL, 5 );
fgSizer2->Add( m_staticText20, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_rbPanHNone = new wxRadioButton( sbSizer3->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
fgSizer2->Add( m_rbPanHNone, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 );
fgSizer2->Add( m_rbPanHNone, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 );
m_rbPanHCtrl = new wxRadioButton( sbSizer3->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizer2->Add( m_rbPanHCtrl, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 );
fgSizer2->Add( m_rbPanHCtrl, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 );
m_rbPanHShift = new wxRadioButton( sbSizer3->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizer2->Add( m_rbPanHShift, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 );
fgSizer2->Add( m_rbPanHShift, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
m_rbPanHAlt = new wxRadioButton( sbSizer3->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizer2->Add( m_rbPanHAlt, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 );
fgSizer2->Add( m_rbPanHAlt, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
sbSizer3->Add( fgSizer2, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 24 );
fgSizer2->Add( 0, 12, 1, wxEXPAND, 5 );
fgSizer2->Add( 42, 0, 1, wxEXPAND, 5 );
fgSizer2->Add( 42, 0, 1, wxEXPAND, 5 );
fgSizer2->Add( 42, 0, 1, wxEXPAND, 5 );
fgSizer2->Add( 42, 0, 1, wxEXPAND, 5 );
sbSizer3->Add( fgSizer2, 0, wxRIGHT|wxLEFT, 24 );
m_checkEnablePanH = new wxCheckBox( sbSizer3->GetStaticBox(), wxID_ANY, _("Pan left/right with horizontal movement"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkEnablePanH->SetToolTip( _("Pan the canvas left and right when scrolling left to right on the touchpad") );
sbSizer3->Add( m_checkEnablePanH, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
sbSizer3->Add( m_checkEnablePanH, 0, wxALL, 5 );
bSizer1->Add( sbSizer3, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 10 );
bSizer1->Add( sbSizer3, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 10 );
this->SetSizer( bSizer1 );
this->Layout();
bSizer1->Fit( this );
// Connect Events
m_rbZoomNone->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( PANEL_MOUSE_SETTINGS_BASE::OnScrollRadioButton ), NULL, this );

View File

@ -43,7 +43,7 @@
<property name="minimum_size"></property>
<property name="name">PANEL_MOUSE_SETTINGS_BASE</property>
<property name="pos"></property>
<property name="size">584,550</property>
<property name="size">-1,-1</property>
<property name="subclass">RESETTABLE_PANEL; widgets/resettable_panel.h; Not forward_declare</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
@ -73,7 +73,7 @@
<object class="wxGridBagSizer" expanded="1">
<property name="empty_cell_size"></property>
<property name="flexible_direction">wxBOTH</property>
<property name="growablecols">1</property>
<property name="growablecols">0,1,2</property>
<property name="growablerows"></property>
<property name="hgap">0</property>
<property name="minimum_size"></property>
@ -371,7 +371,7 @@
<object class="sizeritem" expanded="1">
<property name="border">0</property>
<property name="flag">wxTOP|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<property name="proportion">1</property>
<object class="wxSlider" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
@ -407,7 +407,7 @@
<property name="minValue">1</property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size">150,-1</property>
<property name="minimum_size">120,-1</property>
<property name="moveable">1</property>
<property name="name">m_zoomSpeed</property>
<property name="pane_border">1</property>
@ -575,7 +575,7 @@
<object class="sizeritem" expanded="1">
<property name="border">0</property>
<property name="flag">wxTOP|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<property name="proportion">1</property>
<object class="wxSlider" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
@ -611,7 +611,7 @@
<property name="minValue">1</property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size">150,-1</property>
<property name="minimum_size">120,-1</property>
<property name="moveable">1</property>
<property name="name">m_autoPanSpeed</property>
<property name="pane_border">1</property>
@ -649,7 +649,7 @@
<property name="proportion">0</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label">Mouse Buttons</property>
<property name="label">Drag Gestures</property>
<property name="minimum_size"></property>
<property name="name">sbSizer2</property>
<property name="orient">wxVERTICAL</property>
@ -660,10 +660,10 @@
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxFlexGridSizer" expanded="1">
<property name="cols">2</property>
<property name="cols">3</property>
<property name="flexible_direction">wxHORIZONTAL</property>
<property name="growablecols"></property>
<property name="growablerows">0</property>
<property name="growablecols">2</property>
<property name="growablerows"></property>
<property name="hgap">5</property>
<property name="minimum_size"></property>
<property name="name">fgSizer1</property>
@ -671,9 +671,144 @@
<property name="permission">none</property>
<property name="rows">0</property>
<property name="vgap">5</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Left button drag:</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_leftButtonDragLabel</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxChoice" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="choices">&quot;Draw selection rectangle&quot; &quot;Drag selected objects; otherwise draw selection rectangle&quot; &quot;Drag any object (selected or not)&quot;</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_choiceLeftButtonDrag</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="selection">0</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="spacer" expanded="1">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">0</property>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property>
@ -734,7 +869,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxChoice" expanded="1">
<property name="BottomDockable">1</property>
@ -796,9 +931,19 @@
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="spacer" expanded="1">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">0</property>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property>
@ -859,7 +1004,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxChoice" expanded="1">
<property name="BottomDockable">1</property>
@ -921,6 +1066,16 @@
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="spacer" expanded="1">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">0</property>
</object>
</object>
</object>
</object>
</object>
@ -928,10 +1083,10 @@
<object class="sizeritem" expanded="1">
<property name="border">10</property>
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">1</property>
<property name="proportion">0</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label">Mouse Wheel and Touchpad Scrolling</property>
<property name="label">Scroll Gestures</property>
<property name="minimum_size">-1,-1</property>
<property name="name">sbSizer3</property>
<property name="orient">wxVERTICAL</property>
@ -939,7 +1094,7 @@
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="flag">wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
@ -969,7 +1124,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Behavior of vertical touchpad or scroll wheel movement:</property>
<property name="label">Vertical touchpad or scroll wheel movement:</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
@ -1000,23 +1155,23 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">24</property>
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="flag">wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxFlexGridSizer" expanded="1">
<property name="cols">5</property>
<property name="flexible_direction">wxHORIZONTAL</property>
<property name="growablecols"></property>
<property name="flexible_direction">wxBOTH</property>
<property name="growablecols">0</property>
<property name="growablerows"></property>
<property name="hgap">5</property>
<property name="hgap">0</property>
<property name="minimum_size"></property>
<property name="name">fgSizer2</property>
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property>
<property name="permission">none</property>
<property name="rows">0</property>
<property name="vgap">0</property>
<property name="vgap">5</property>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_RIGHT|wxALL</property>
<property name="flag">wxALIGN_RIGHT|wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property>
@ -1077,7 +1232,7 @@
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="flag">wxTOP|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property>
@ -1107,14 +1262,14 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">No Modifiers</property>
<property name="label">--</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="minimum_size">-1,-1</property>
<property name="moveable">1</property>
<property name="name">m_staticText17</property>
<property name="pane_border">1</property>
@ -1138,7 +1293,7 @@
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxALL</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property>
@ -1199,7 +1354,7 @@
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxALL</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property>
@ -1260,7 +1415,7 @@
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxALL</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property>
@ -1321,7 +1476,7 @@
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property>
@ -1382,7 +1537,7 @@
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxALL</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL</property>
<property name="proportion">0</property>
<object class="wxRadioButton" expanded="0">
<property name="BottomDockable">1</property>
@ -1418,7 +1573,7 @@
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="minimum_size">-1,-1</property>
<property name="moveable">1</property>
<property name="name">m_rbZoomNone</property>
<property name="pane_border">1</property>
@ -1447,7 +1602,7 @@
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxALL</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxRadioButton" expanded="0">
<property name="BottomDockable">1</property>
@ -1512,7 +1667,7 @@
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxALL</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxRadioButton" expanded="0">
<property name="BottomDockable">1</property>
@ -1577,7 +1732,7 @@
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxALL</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxRadioButton" expanded="0">
<property name="BottomDockable">1</property>
@ -1642,7 +1797,7 @@
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property>
@ -1703,7 +1858,7 @@
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxALL</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxRadioButton" expanded="0">
<property name="BottomDockable">1</property>
@ -1768,7 +1923,7 @@
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxALL</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxRadioButton" expanded="0">
<property name="BottomDockable">1</property>
@ -1833,7 +1988,7 @@
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxALL</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxRadioButton" expanded="0">
<property name="BottomDockable">1</property>
@ -1898,7 +2053,7 @@
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxALL</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxRadioButton" expanded="0">
<property name="BottomDockable">1</property>
@ -1963,7 +2118,7 @@
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_RIGHT|wxALL</property>
<property name="flag">wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="0">
<property name="BottomDockable">1</property>
@ -2024,7 +2179,7 @@
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxALL</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxRadioButton" expanded="0">
<property name="BottomDockable">1</property>
@ -2089,7 +2244,7 @@
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxALL</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxRadioButton" expanded="0">
<property name="BottomDockable">1</property>
@ -2154,7 +2309,7 @@
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxALL</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxRadioButton" expanded="0">
<property name="BottomDockable">1</property>
@ -2219,7 +2374,7 @@
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxALL</property>
<property name="flag">wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxRadioButton" expanded="0">
<property name="BottomDockable">1</property>
@ -2282,11 +2437,61 @@
<event name="OnRadioButton">OnScrollRadioButton</event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="spacer" expanded="1">
<property name="height">12</property>
<property name="permission">protected</property>
<property name="width">0</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="spacer" expanded="1">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">42</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="spacer" expanded="1">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">42</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="spacer" expanded="1">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">42</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="spacer" expanded="1">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">42</property>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>

View File

@ -46,6 +46,8 @@ class PANEL_MOUSE_SETTINGS_BASE : public RESETTABLE_PANEL
wxBoxSizer* m_panSizer;
wxStaticText* m_staticText22;
wxSlider* m_autoPanSpeed;
wxStaticText* m_leftButtonDragLabel;
wxChoice* m_choiceLeftButtonDrag;
wxStaticText* m_staticText3;
wxChoice* m_choiceMiddleButtonDrag;
wxStaticText* m_staticText31;
@ -79,7 +81,7 @@ class PANEL_MOUSE_SETTINGS_BASE : public RESETTABLE_PANEL
public:
PANEL_MOUSE_SETTINGS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 584,550 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
PANEL_MOUSE_SETTINGS_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 );
~PANEL_MOUSE_SETTINGS_BASE();
};

View File

@ -40,7 +40,7 @@ const std::set<wxString> envVarBlacklist =
///! Update the schema version whenever a migration is required
const int commonSchemaVersion = 1;
const int commonSchemaVersion = 2;
COMMON_SETTINGS::COMMON_SETTINGS() :
JSON_SETTINGS( "kicad_common", SETTINGS_LOC::USER, commonSchemaVersion ),
@ -106,9 +106,6 @@ COMMON_SETTINGS::COMMON_SETTINGS() :
m_params.emplace_back( new PARAM<bool>( "input.immediate_actions",
&m_Input.immediate_actions, true ) );
m_params.emplace_back( new PARAM<bool>( "input.prefer_select_to_drag",
&m_Input.prefer_select_to_drag, false ) );
m_params.emplace_back( new PARAM<bool>( "input.warp_mouse_on_move",
&m_Input.warp_mouse_on_move, true ) );
@ -145,6 +142,11 @@ COMMON_SETTINGS::COMMON_SETTINGS() :
m_params.emplace_back( new PARAM<int>(
"input.scroll_modifier_pan_v", &m_Input.scroll_modifier_pan_v, WXK_SHIFT ) );
m_params.emplace_back( new PARAM<int>( "input.mouse_left", &m_Input.drag_left,
static_cast<int>( MOUSE_DRAG_ACTION::DRAG_SELECTED ),
static_cast<int>( MOUSE_DRAG_ACTION::DRAG_ANY ),
static_cast<int>( MOUSE_DRAG_ACTION::SELECT ) ) );
m_params.emplace_back( new PARAM<int>( "input.mouse_middle", &m_Input.drag_middle,
static_cast<int>( MOUSE_DRAG_ACTION::PAN ),
static_cast<int>( MOUSE_DRAG_ACTION::SELECT ),
@ -189,6 +191,7 @@ COMMON_SETTINGS::COMMON_SETTINGS() :
&m_Session.remember_open_files, false ) );
registerMigration( 0, 1, std::bind( &COMMON_SETTINGS::migrateSchema0to1, this ) );
registerMigration( 1, 2, std::bind( &COMMON_SETTINGS::migrateSchema1to2, this ) );
}
@ -235,6 +238,31 @@ bool COMMON_SETTINGS::migrateSchema0to1()
}
bool COMMON_SETTINGS::migrateSchema1to2()
{
nlohmann::json::json_pointer v1_pointer( "/input/prefer_select_to_drag"_json_pointer );
bool prefer_selection = false;
try
{
prefer_selection = at( v1_pointer );
at( nlohmann::json::json_pointer( "/input"_json_pointer ) ).erase( "prefer_select_to_drag" );
}
catch( ... )
{
wxLogTrace( traceSettings, "COMMON_SETTINGS::Migrate 1->2: prefer_select_to_drag not found" );
}
if( prefer_selection )
( *this )[nlohmann::json::json_pointer( "/input/mouse_left" )] = MOUSE_DRAG_ACTION::SELECT;
else
( *this )[nlohmann::json::json_pointer( "/input/mouse_left" )] = MOUSE_DRAG_ACTION::DRAG_ANY;
return true;
}
bool COMMON_SETTINGS::MigrateFromLegacy( wxConfigBase* aCfg )
{
bool ret = true;

View File

@ -35,7 +35,7 @@ TOOLS_HOLDER::TOOLS_HOLDER() :
m_actions( nullptr ),
m_toolDispatcher( nullptr ),
m_immediateActions( true ),
m_dragSelects( true ),
m_dragAction( KIGFX::MOUSE_DRAG_ACTION::SELECT ),
m_moveWarpsCursor( true )
{ }
@ -122,7 +122,7 @@ void TOOLS_HOLDER::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsCh
COMMON_SETTINGS* settings = Pgm().GetCommonSettings();
m_moveWarpsCursor = settings->m_Input.warp_mouse_on_move;
m_dragSelects = settings->m_Input.prefer_select_to_drag;
m_dragAction = static_cast<KIGFX::MOUSE_DRAG_ACTION>( settings->m_Input.drag_left );
m_immediateActions = settings->m_Input.immediate_actions;
}

View File

@ -145,6 +145,7 @@ void WX_VIEW_CONTROLS::LoadSettings()
m_settings.m_scrollModifierZoom = cfg->m_Input.scroll_modifier_zoom;
m_settings.m_scrollModifierPanH = cfg->m_Input.scroll_modifier_pan_h;
m_settings.m_scrollModifierPanV = cfg->m_Input.scroll_modifier_pan_v;
m_settings.m_dragLeft = static_cast<MOUSE_DRAG_ACTION>( cfg->m_Input.drag_left );
m_settings.m_dragMiddle = static_cast<MOUSE_DRAG_ACTION>( cfg->m_Input.drag_middle );
m_settings.m_dragRight = static_cast<MOUSE_DRAG_ACTION>( cfg->m_Input.drag_right );

View File

@ -325,6 +325,7 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
m_exclusive_or = true;
bool modifier_enabled = m_subtractive || m_additive || m_exclusive_or;
KIGFX::MOUSE_DRAG_ACTION drag_action = m_frame->GetDragAction();
// Is the user requesting that the selection list include all possible
// items without removing less likely selection candidates
@ -431,7 +432,11 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
if( SCH_EDIT_FRAME* schframe = dynamic_cast<SCH_EDIT_FRAME*>( m_frame ) )
schframe->FocusOnItem( nullptr );
if( modifier_enabled || ( m_selection.Empty() && m_frame->GetDragSelects() ) )
if( modifier_enabled || drag_action == KIGFX::MOUSE_DRAG_ACTION::SELECT )
{
selectMultiple();
}
else if( m_selection.Empty() && drag_action != KIGFX::MOUSE_DRAG_ACTION::DRAG_ANY )
{
selectMultiple();
}
@ -576,8 +581,10 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
{
m_nonModifiedCursor = KICURSOR::HAND;
}
else if( !m_selection.Empty() && !m_frame->GetDragSelects() && evt->HasPosition()
&& selectionContains( evt->Position() ) ) //move/drag option prediction
else if( !m_selection.Empty()
&& drag_action == KIGFX::MOUSE_DRAG_ACTION::DRAG_SELECTED
&& evt->HasPosition()
&& selectionContains( evt->Position() ) ) //move/drag option prediction
{
m_nonModifiedCursor = KICURSOR::MOVING;
}

View File

@ -58,7 +58,6 @@ public:
int auto_pan_acceleration;
bool center_on_zoom;
bool immediate_actions;
bool prefer_select_to_drag;
bool warp_mouse_on_move;
bool horizontal_pan;
@ -70,6 +69,7 @@ public:
int scroll_modifier_pan_h;
int scroll_modifier_pan_v;
int drag_left;
int drag_middle;
int drag_right;
};
@ -105,6 +105,7 @@ public:
private:
bool migrateSchema0to1();
bool migrateSchema1to2();
public:
APPEARANCE m_Appearance;

View File

@ -25,6 +25,7 @@
#define TOOL_HOLDER_H
#include <vector>
#include <view/view_controls.h>
#include <tool/action_manager.h>
#include <tool/selection.h>
#include <tool/tool_action.h>
@ -127,10 +128,10 @@ public:
bool GetDoImmediateActions() const { return m_immediateActions; }
/**
* Indicate that a drag should draw a selection rectangle, even when started over an
* item.
* Indicates whether a drag should draw a selection rectangle or drag selected (or unselected)
* objects.
*/
bool GetDragSelects() const { return m_dragSelects; }
KIGFX::MOUSE_DRAG_ACTION GetDragAction() const { return m_dragAction; }
/**
* Indicate that a move operation should warp the mouse pointer to the origin of the
@ -170,7 +171,8 @@ protected:
// the first invocation of a hotkey will just
// select the relevant tool rather than executing
// the tool's action.
bool m_dragSelects; // Prefer selection to dragging.
KIGFX::MOUSE_DRAG_ACTION m_dragAction; // DRAG_ANY/DRAG_SELECTED/SELECT.
bool m_moveWarpsCursor; // cursor is warped to move/drag origin
};

View File

@ -44,6 +44,8 @@ class VIEW;
///< Action to perform when the mouse is dragged
enum class MOUSE_DRAG_ACTION
{
DRAG_ANY,
DRAG_SELECTED,
SELECT,
ZOOM,
PAN,
@ -119,10 +121,8 @@ struct VC_SETTINGS
///< What modifier key to enable vertical with the (vertical) scroll wheel.
int m_scrollModifierPanV;
///< What drag action to perform when the middle button is pressed.
MOUSE_DRAG_ACTION m_dragLeft;
MOUSE_DRAG_ACTION m_dragMiddle;
///< What drag action to perform when the right button is pressed.
MOUSE_DRAG_ACTION m_dragRight;
///< Is last cursor motion event coming from keyboard arrow cursor motion action.

View File

@ -202,9 +202,14 @@ int PL_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
if( m_frame->ToolStackIsEmpty() )
{
if( !modifier_enabled && !m_selection.Empty() && !m_frame->GetDragSelects()
&& evt->HasPosition() && selectionContains( evt->Position() ) )
if( !modifier_enabled
&& !m_selection.Empty()
&& m_frame->GetDragAction() == KIGFX::MOUSE_DRAG_ACTION::DRAG_SELECTED
&& evt->HasPosition()
&& selectionContains( evt->Position() ) )
{
m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::MOVING );
}
else
{
if( m_additive )

View File

@ -208,8 +208,8 @@ int PCB_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
// Main loop: keep receiving events
while( TOOL_EVENT* evt = Wait() )
{
bool dragAlwaysSelects = getEditFrame<PCB_BASE_FRAME>()->GetDragSelects();
TRACK_DRAG_ACTION dragAction = getEditFrame<PCB_BASE_FRAME>()->Settings().m_TrackDragAction;
KIGFX::MOUSE_DRAG_ACTION dragAction = m_frame->GetDragAction();
TRACK_DRAG_ACTION trackDragAction = m_frame->Settings().m_TrackDragAction;
// on left click, a selection is made, depending on modifiers ALT, SHIFT, CTRL:
// Due to the fact ALT key modifier cannot be useed freely on Winows and Linux,
@ -340,7 +340,11 @@ int PCB_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
m_frame->FocusOnItem( nullptr );
m_toolMgr->ProcessEvent( EVENTS::InhibitSelectionEditing );
if( modifier_enabled || dragAlwaysSelects )
if( modifier_enabled || dragAction == KIGFX::MOUSE_DRAG_ACTION::SELECT )
{
selectMultiple();
}
else if( m_selection.Empty() && dragAction != KIGFX::MOUSE_DRAG_ACTION::DRAG_ANY )
{
selectMultiple();
}
@ -384,9 +388,9 @@ int PCB_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
// Yes -> run the move tool and wait till it finishes
TRACK* track = dynamic_cast<TRACK*>( m_selection.GetItem( 0 ) );
if( track && dragAction == TRACK_DRAG_ACTION::DRAG )
if( track && trackDragAction == TRACK_DRAG_ACTION::DRAG )
m_toolMgr->RunAction( PCB_ACTIONS::drag45Degree, true );
else if( track && dragAction == TRACK_DRAG_ACTION::DRAG_FREE_ANGLE )
else if( track && trackDragAction == TRACK_DRAG_ACTION::DRAG_FREE_ANGLE )
m_toolMgr->RunAction( PCB_ACTIONS::dragFreeAngle, true );
else
m_toolMgr->RunAction( PCB_ACTIONS::move, true );
@ -419,8 +423,11 @@ int PCB_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
if( m_frame->ToolStackIsEmpty() )
{
//move cursor prediction
if( !modifier_enabled && !dragAlwaysSelects && !m_selection.Empty()
&& evt->HasPosition() && selectionContains( evt->Position() ) )
if( !modifier_enabled
&& dragAction == KIGFX::MOUSE_DRAG_ACTION::DRAG_SELECTED
&& !m_selection.Empty()
&& evt->HasPosition()
&& selectionContains( evt->Position() ) )
{
m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::MOVING );
}