KiCad PCB EDA Suite
sch_draw_panel.h
Go to the documentation of this file.
1 #ifndef __SCH_DRAW_PANEL_H
2 #define __SCH_DRAW_PANEL_H
3 
4 #include <class_draw_panel_gal.h>
5 #include <base_struct.h>
6 #include <gr_basic.h>
7 #include <eda_rect.h>
8 
9 #include <class_drawpanel.h>
10 
11 
12 namespace KIGFX
13 {
14  class SCH_VIEW;
15  namespace PREVIEW
16  {
17  class SELECTION_AREA;
18  };
19 };
20 
21 class SCH_SHEET;
22 class LIB_PART;
23 class BASE_SCREEN;
24 class SCH_SCREEN;
26 class SCH_EDIT_FRAME;
27 
28 
30 {
31 public:
32  SCH_DRAW_PANEL( wxWindow* aParentWindow, wxWindowID aWindowId, const wxPoint& aPosition,
33  const wxSize& aSize, KIGFX::GAL_DISPLAY_OPTIONS& aOptions,
34  GAL_TYPE aGalType = GAL_TYPE_OPENGL );
35 
37 
38  virtual wxWindow* GetWindow() override { return this; }
39 
45  void DisplayComponent( const LIB_PART *aComponent );
46  void DisplaySheet( const SCH_SHEET *aSheet );
47  void DisplaySheet( const SCH_SCREEN *aScreen );
48 
54  void UseColorScheme( const COLORS_DESIGN_SETTINGS* aSettings );
55 
57  void OnShow() override;
58 
59  bool SwitchBackend( GAL_TYPE aGalType ) override;
60  void OnMouseEvent( wxMouseEvent& event );
61  bool OnRightClick( wxMouseEvent& event );
62  void OnKeyEvent( wxKeyEvent& event );
63  void OnCharHook( wxKeyEvent& event );
64  void OnTimer( wxTimerEvent& event );
65 
66  void SetEnableMousewheelPan( bool aEnable ) override;
67  void SetEnableZoomNoCenter( bool aEnable ) override;
68  void SetEnableAutoPan( bool aEnable ) override;
69  void SetAutoPanRequest( bool aEnable ) override;
70 
71  BASE_SCREEN* GetScreen() override;
72  virtual EDA_DRAW_FRAME* GetParent() const override;
73 
74  virtual void CallMouseCapture( wxDC* aDC, const wxPoint& aPosition, bool aErase ) override;
75  virtual void CallEndMouseCapture( wxDC* aDC ) override;
76  virtual void EndMouseCapture( int aId = -1, int aCursorId = -1,
77  const wxString& aTitle = wxEmptyString,
78  bool aCallEndFunc = true ) override;
79 
80  virtual void CrossHairOff( wxDC* DC=nullptr ) override;
81 
82  // Show the cross hair.
83  virtual void CrossHairOn( wxDC* DC=nullptr ) override;
84 
85  virtual void MoveCursorToCrossHair() override;
86 
87  KIGFX::SCH_VIEW* GetView() const { return view(); }
88 
90  void Refresh( bool aEraseBackground = true, const wxRect* aRect = NULL ) override;
91 
92 
93 protected:
94 
95  virtual void onPaint( wxPaintEvent& WXUNUSED( aEvent ) ) override;
96 
97  KIGFX::SCH_VIEW* view() const;
98 
100  void setDefaultLayerOrder();
101 
103  void setDefaultLayerDeps();
104 
105  wxWindow* m_parent;
106 
107  DECLARE_EVENT_TABLE()
108 };
109 
110 #endif
wxWindow * m_parent
bool OnRightClick(wxMouseEvent &event)
Class CAIRO_GAL is the cairo implementation of the graphics abstraction layer.
Definition: class_module.h:57
virtual EDA_DRAW_FRAME * GetParent() const override
void OnShow() override
>
virtual void MoveCursorToCrossHair() override
Function MoveCursorToCrossHair warps the cursor to the current cross hair position.
virtual void EndMouseCapture(int aId=-1, int aCursorId=-1, const wxString &aTitle=wxEmptyString, bool aCallEndFunc=true) override
Function EndMouseCapture ends mouse a capture.
Schematic editor (Eeschema) main window.
void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
The base class for create windows for drawing purpose.
Definition: draw_frame.h:81
virtual void CallEndMouseCapture(wxDC *aDC) override
Function CallEndMouseCapture calls the end mouse capture callback.
void OnMouseEvent(wxMouseEvent &event)
void UseColorScheme(const COLORS_DESIGN_SETTINGS *aSettings)
Function UseColorScheme Applies layer color settings.
virtual void CallMouseCapture(wxDC *aDC, const wxPoint &aPosition, bool aErase) override
Function CallMouseCapture calls the mouse capture callback.
virtual void CrossHairOff(wxDC *DC=nullptr) override
void OnKeyEvent(wxKeyEvent &event)
Class BASE_SCREEN handles how to draw a screen (a board, a schematic ...)
Definition: base_screen.h:76
void SetEnableAutoPan(bool aEnable) override
KIGFX::SCH_VIEW * view() const
virtual void onPaint(wxPaintEvent &WXUNUSED(aEvent)) override
Define a library symbol object.
virtual wxWindow * GetWindow() override
virtual void CrossHairOn(wxDC *DC=nullptr) override
void setDefaultLayerDeps()
Sets rendering targets & dependencies for layers.
bool SwitchBackend(GAL_TYPE aGalType) override
Function SwitchBackend Switches method of rendering graphics.
void SetAutoPanRequest(bool aEnable) override
SCH_DRAW_PANEL(wxWindow *aParentWindow, wxWindowID aWindowId, const wxPoint &aPosition, const wxSize &aSize, KIGFX::GAL_DISPLAY_OPTIONS &aOptions, GAL_TYPE aGalType=GAL_TYPE_OPENGL)
KIGFX::SCH_VIEW * GetView() const
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:209
void SetEnableZoomNoCenter(bool aEnable) override
void DisplaySheet(const SCH_SHEET *aSheet)
void OnTimer(wxTimerEvent &event)
void OnCharHook(wxKeyEvent &event)
Class COLORS_DESIGN_SETTINGS is a list of color settings for designs in Pcbnew.
BASE_SCREEN * GetScreen() override
Class SELECTION_AREA.
Basic classes for most KiCad items.
void DisplayComponent(const LIB_PART *aComponent)
Function DisplayBoard FIXME adds all items from the current board to the VIEW, so they can be display...
void setDefaultLayerOrder()
Reassigns layer order to the initial settings.
void SetEnableMousewheelPan(bool aEnable) override