mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2024-11-24 00:34:47 +00:00
16de0a666c
ADDED: Horizontal/vertical zoom for simulator plots, via mouse wheel, toolbar buttons, menu commands, and hotkeys. ADDED: Simulator preferences panel, populated with mouse wheel and trackpad settings that control pan and zoom of simulator plots. ADDED: Zoom In/Out Horizontally/Vertically commands that can be bound to hotkeys. CHANGED: Simulator plot scroll wheel gestures are no longer hard-coded and can now be configured via the new Simulator preferences panel. Fixes https://gitlab.com/kicad/code/kicad/-/issues/16597 Other unreported bugs that were fixed: - Fixed wierd, jumpy simulator plot view limiting behavior. - Fixed Zoom In Center and Zoom Out Center commands not preserving the simulator plot center point. - Fixed simulator plot nudging when exported as PNGs. - Fixed rectangular selection zoom being able to exceed simulator plot view limits. Notes: - Provided new SIM_PREFERENCES struct to be used for future simulator preferences set via the simulator preferences dialog. - Bundled pre-existing EESCHEMA_SETTINGS::SIMULATOR settings into EESCHEMA_SETTINGS::SIMULATOR::VIEW. - Replaced mpWindow::EnableMouseWheelPan with more general SetMouseWheelActions. - Refactored and tidied up wxMathPlot's mpWindow code involved with fitting, zooming, and panning. - Consolidated long lists of duplicated member variable initializers to a new mpWindow private delegated constructor. - Provided provisional Zoom In/Out Horizontally/Vertically toolbar icons that need improvement by a graphics designer. - Provided gitignore entries for the Qt Creator IDE
50 lines
1.6 KiB
C++
50 lines
1.6 KiB
C++
/*
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
*
|
|
* Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
|
|
*
|
|
* This program is free software: you can redistribute it and/or modify it
|
|
* under the terms of the GNU General Public License as published by the
|
|
* Free Software Foundation, either version 3 of the License, or (at your
|
|
* option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful, but
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License along
|
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#ifndef KICAD_PANEL_SIMULATOR_PREFERENCES_H
|
|
#define KICAD_PANEL_SIMULATOR_PREFERENCES_H
|
|
|
|
#include "panel_simulator_preferences_base.h"
|
|
#include <sim/sim_preferences.h>
|
|
|
|
|
|
class PANEL_SIMULATOR_PREFERENCES : public PANEL_SIMULATOR_PREFERENCES_BASE
|
|
{
|
|
public:
|
|
PANEL_SIMULATOR_PREFERENCES( wxWindow* aParent );
|
|
~PANEL_SIMULATOR_PREFERENCES();
|
|
void ResetPanel() override;
|
|
|
|
protected:
|
|
bool TransferDataFromWindow() override;
|
|
bool TransferDataToWindow() override;
|
|
void onMouseDefaults( wxCommandEvent& ) override;
|
|
void onTrackpadDefaults( wxCommandEvent& ) override;
|
|
|
|
private:
|
|
static SIM_MOUSE_WHEEL_ACTION horizontalScrollSelectionToAction( int aSelection );
|
|
|
|
static int actionToHorizontalScrollSelection( SIM_MOUSE_WHEEL_ACTION anAction );
|
|
|
|
void applyMouseScrollActionsToPanel( const SIM_MOUSE_WHEEL_ACTION_SET& anActionSet );
|
|
};
|
|
|
|
|
|
#endif
|