2018-08-03 12:18:26 +00:00
|
|
|
#ifndef __SCH_DRAW_PANEL_H
|
|
|
|
#define __SCH_DRAW_PANEL_H
|
|
|
|
|
|
|
|
#include <class_draw_panel_gal.h>
|
|
|
|
#include <base_struct.h>
|
|
|
|
#include <gr_basic.h>
|
|
|
|
#include <eda_rect.h>
|
|
|
|
|
2019-01-21 18:42:06 +00:00
|
|
|
#include <legacy_gal/class_drawpanel.h>
|
2018-08-03 12:18:26 +00:00
|
|
|
|
|
|
|
|
2018-08-28 13:27:13 +00:00
|
|
|
namespace KIGFX
|
|
|
|
{
|
2018-08-03 12:18:26 +00:00
|
|
|
class SCH_VIEW;
|
2018-08-28 13:27:13 +00:00
|
|
|
namespace PREVIEW
|
|
|
|
{
|
2018-08-03 12:18:26 +00:00
|
|
|
class SELECTION_AREA;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
class SCH_SHEET;
|
|
|
|
class LIB_PART;
|
|
|
|
class BASE_SCREEN;
|
|
|
|
class SCH_SCREEN;
|
|
|
|
class COLORS_DESIGN_SETTINGS;
|
|
|
|
class SCH_EDIT_FRAME;
|
|
|
|
|
2018-08-28 13:27:13 +00:00
|
|
|
|
2018-08-03 12:18:26 +00:00
|
|
|
class SCH_DRAW_PANEL : public EDA_DRAW_PANEL, public EDA_DRAW_PANEL_GAL
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SCH_DRAW_PANEL( wxWindow* aParentWindow, wxWindowID aWindowId, const wxPoint& aPosition,
|
2018-08-28 13:27:13 +00:00
|
|
|
const wxSize& aSize, KIGFX::GAL_DISPLAY_OPTIONS& aOptions,
|
|
|
|
GAL_TYPE aGalType = GAL_TYPE_OPENGL );
|
2018-08-03 12:18:26 +00:00
|
|
|
|
|
|
|
~SCH_DRAW_PANEL();
|
|
|
|
|
2018-08-28 13:27:13 +00:00
|
|
|
virtual wxWindow* GetWindow() override { return this; }
|
2018-08-03 12:18:26 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function DisplayBoard FIXME
|
|
|
|
* adds all items from the current board to the VIEW, so they can be displayed by GAL.
|
|
|
|
* @param aBoard is the PCB to be loaded.
|
|
|
|
*/
|
|
|
|
void DisplayComponent( const LIB_PART *aComponent );
|
|
|
|
void DisplaySheet( const SCH_SCREEN *aScreen );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function UseColorScheme
|
|
|
|
* Applies layer color settings.
|
|
|
|
* @param aSettings are the new settings.
|
|
|
|
*/
|
|
|
|
void UseColorScheme( const COLORS_DESIGN_SETTINGS* aSettings );
|
|
|
|
|
|
|
|
///> @copydoc EDA_DRAW_PANEL_GAL::OnShow()
|
|
|
|
void OnShow() override;
|
|
|
|
|
|
|
|
bool SwitchBackend( GAL_TYPE aGalType ) override;
|
|
|
|
void OnMouseEvent( wxMouseEvent& event );
|
|
|
|
bool OnRightClick( wxMouseEvent& event );
|
|
|
|
void OnKeyEvent( wxKeyEvent& event );
|
|
|
|
void OnCharHook( wxKeyEvent& event );
|
2018-09-08 20:57:56 +00:00
|
|
|
void OnTimer( wxTimerEvent& event );
|
2018-08-03 12:18:26 +00:00
|
|
|
|
2018-09-08 16:44:51 +00:00
|
|
|
void SetEnableMousewheelPan( bool aEnable ) override;
|
|
|
|
void SetEnableZoomNoCenter( bool aEnable ) override;
|
|
|
|
void SetEnableAutoPan( bool aEnable ) override;
|
2018-12-11 16:49:28 +00:00
|
|
|
void SetAutoPanRequest( bool aEnable ) override;
|
2018-09-08 16:44:51 +00:00
|
|
|
|
2018-08-03 12:18:26 +00:00
|
|
|
BASE_SCREEN* GetScreen() override;
|
|
|
|
virtual EDA_DRAW_FRAME* GetParent() const override;
|
|
|
|
|
|
|
|
virtual void CallMouseCapture( wxDC* aDC, const wxPoint& aPosition, bool aErase ) override;
|
|
|
|
virtual void CallEndMouseCapture( wxDC* aDC ) override;
|
|
|
|
virtual void EndMouseCapture( int aId = -1, int aCursorId = -1,
|
|
|
|
const wxString& aTitle = wxEmptyString,
|
|
|
|
bool aCallEndFunc = true ) override;
|
|
|
|
|
|
|
|
virtual void CrossHairOff( wxDC* DC=nullptr ) override;
|
|
|
|
|
|
|
|
// Show the cross hair.
|
|
|
|
virtual void CrossHairOn( wxDC* DC=nullptr ) override;
|
|
|
|
|
2018-09-05 14:48:05 +00:00
|
|
|
virtual void MoveCursorToCrossHair() override;
|
|
|
|
|
2018-08-03 12:18:26 +00:00
|
|
|
KIGFX::SCH_VIEW* GetView() const { return view(); }
|
|
|
|
|
|
|
|
/// @copydoc wxWindow::Refresh()
|
|
|
|
void Refresh( bool aEraseBackground = true, const wxRect* aRect = NULL ) override;
|
|
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
virtual void onPaint( wxPaintEvent& WXUNUSED( aEvent ) ) override;
|
|
|
|
|
|
|
|
KIGFX::SCH_VIEW* view() const;
|
|
|
|
|
|
|
|
///> Reassigns layer order to the initial settings.
|
|
|
|
void setDefaultLayerOrder();
|
|
|
|
|
|
|
|
///> Sets rendering targets & dependencies for layers.
|
|
|
|
void setDefaultLayerDeps();
|
|
|
|
|
|
|
|
wxWindow* m_parent;
|
2018-09-08 20:57:56 +00:00
|
|
|
|
|
|
|
DECLARE_EVENT_TABLE()
|
2018-08-03 12:18:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|