Add common property initialisation to sch_draw_panel.

This commit is contained in:
Jeff Young 2018-08-28 14:27:13 +01:00
parent a3563851b2
commit 8b4f01b6b7
2 changed files with 24 additions and 19 deletions

View File

@ -37,23 +37,24 @@
#include <functional> #include <functional>
#include <sch_sheet.h> #include <sch_sheet.h>
#include <pgm_base.h>
using namespace std::placeholders; using namespace std::placeholders;
SCH_DRAW_PANEL::SCH_DRAW_PANEL( wxWindow* aParentWindow, wxWindowID aWindowId, SCH_DRAW_PANEL::SCH_DRAW_PANEL( wxWindow* aParentWindow, wxWindowID aWindowId,
const wxPoint& aPosition, const wxSize& aSize, const wxPoint& aPosition, const wxSize& aSize,
KIGFX::GAL_DISPLAY_OPTIONS& aOptions, GAL_TYPE aGalType ) : KIGFX::GAL_DISPLAY_OPTIONS& aOptions, GAL_TYPE aGalType ) :
EDA_DRAW_PANEL_GAL( aParentWindow, aWindowId, aPosition, aSize, aOptions, GAL_TYPE_OPENGL ), EDA_DRAW_PANEL_GAL( aParentWindow, aWindowId, aPosition, aSize, aOptions, aGalType ),
m_parent( aParentWindow ) m_parent( aParentWindow )
{ {
#ifdef __WXMAC__ #ifdef __WXMAC__
m_defaultCursor = m_currentCursor = wxCURSOR_CROSS; m_defaultCursor = m_currentCursor = wxCURSOR_CROSS;
m_showCrossHair = false; m_showCrossHair = false;
#else #else
m_defaultCursor = m_currentCursor = wxCURSOR_ARROW; m_defaultCursor = m_currentCursor = wxCURSOR_ARROW;
m_showCrossHair = true; m_showCrossHair = true;
#endif #endif
m_view = new KIGFX::SCH_VIEW( true ); m_view = new KIGFX::SCH_VIEW( true );
m_view->SetGAL( m_gal ); m_view->SetGAL( m_gal );
@ -91,11 +92,12 @@ m_parent( aParentWindow )
Connect( wxEVT_CHAR, wxKeyEventHandler( SCH_DRAW_PANEL::OnKeyEvent ), NULL, this ); Connect( wxEVT_CHAR, wxKeyEventHandler( SCH_DRAW_PANEL::OnKeyEvent ), NULL, this );
Connect( wxEVT_CHAR_HOOK, wxKeyEventHandler( SCH_DRAW_PANEL::OnCharHook ), NULL, this ); Connect( wxEVT_CHAR_HOOK, wxKeyEventHandler( SCH_DRAW_PANEL::OnCharHook ), NULL, this );
Pgm().CommonSettings()->Read( ENBL_MOUSEWHEEL_PAN_KEY, &m_enableMousewheelPan, false );
Pgm().CommonSettings()->Read( ENBL_ZOOM_NO_CENTER_KEY, &m_enableZoomNoCenter, false );
Pgm().CommonSettings()->Read( ENBL_AUTO_PAN_KEY, &m_enableAutoPan, true );
m_canStartBlock = -1; // Command block can start if >= 0 m_canStartBlock = -1; // Command block can start if >= 0
m_abortRequest = false; m_abortRequest = false;
m_enableMousewheelPan = false;
m_enableZoomNoCenter = false;
m_enableAutoPan = true;
m_ignoreMouseEvents = false; m_ignoreMouseEvents = false;
// Be sure a mouse release button event will be ignored when creating the canvas // Be sure a mouse release button event will be ignored when creating the canvas
// if the mouse click was not made inside the canvas (can happen sometimes, when // if the mouse click was not made inside the canvas (can happen sometimes, when

View File

@ -9,9 +9,11 @@
#include <class_drawpanel.h> #include <class_drawpanel.h>
namespace KIGFX { namespace KIGFX
{
class SCH_VIEW; class SCH_VIEW;
namespace PREVIEW { namespace PREVIEW
{
class SELECTION_AREA; class SELECTION_AREA;
}; };
}; };
@ -23,16 +25,17 @@ class SCH_SCREEN;
class COLORS_DESIGN_SETTINGS; class COLORS_DESIGN_SETTINGS;
class SCH_EDIT_FRAME; class SCH_EDIT_FRAME;
class SCH_DRAW_PANEL : public EDA_DRAW_PANEL, public EDA_DRAW_PANEL_GAL class SCH_DRAW_PANEL : public EDA_DRAW_PANEL, public EDA_DRAW_PANEL_GAL
{ {
public: public:
SCH_DRAW_PANEL( wxWindow* aParentWindow, wxWindowID aWindowId, const wxPoint& aPosition, SCH_DRAW_PANEL( wxWindow* aParentWindow, wxWindowID aWindowId, const wxPoint& aPosition,
const wxSize& aSize, KIGFX::GAL_DISPLAY_OPTIONS& aOptions, const wxSize& aSize, KIGFX::GAL_DISPLAY_OPTIONS& aOptions,
GAL_TYPE aGalType = GAL_TYPE_OPENGL ); GAL_TYPE aGalType = GAL_TYPE_OPENGL );
~SCH_DRAW_PANEL(); ~SCH_DRAW_PANEL();
virtual wxWindow* GetWindow() override { return this; }; virtual wxWindow* GetWindow() override { return this; }
/** /**
* Function DisplayBoard FIXME * Function DisplayBoard FIXME