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 
36  ~SCH_DRAW_PANEL();
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 
70  BASE_SCREEN* GetScreen() override;
71  virtual EDA_DRAW_FRAME* GetParent() const override;
72 
73  virtual void CallMouseCapture( wxDC* aDC, const wxPoint& aPosition, bool aErase ) override;
74  virtual void CallEndMouseCapture( wxDC* aDC ) override;
75  virtual void EndMouseCapture( int aId = -1, int aCursorId = -1,
76  const wxString& aTitle = wxEmptyString,
77  bool aCallEndFunc = true ) override;
78 
79  virtual void CrossHairOff( wxDC* DC=nullptr ) override;
80 
81  // Show the cross hair.
82  virtual void CrossHairOn( wxDC* DC=nullptr ) override;
83 
84  virtual void MoveCursorToCrossHair() override;
85 
86  KIGFX::SCH_VIEW* GetView() const { return view(); }
87 
89  void Refresh( bool aEraseBackground = true, const wxRect* aRect = NULL ) override;
90 
91 
92 protected:
93 
94  virtual void onPaint( wxPaintEvent& WXUNUSED( aEvent ) ) override;
95 
96  KIGFX::SCH_VIEW* view() const;
97 
99  void setDefaultLayerOrder();
100 
102  void setDefaultLayerDeps();
103 
104  wxWindow* m_parent;
105 
106  DECLARE_EVENT_TABLE()
107 };
108 
109 #endif
wxWindow * m_parent
Class CAIRO_GAL is the cairo implementation of the graphics abstraction layer.
Definition: class_module.h:58
Schematic editor (Eeschema) main window.
The base class for create windows for drawing purpose.
Definition: draw_frame.h:78
void Refresh()
Update the board display after modifying it by a python script (note: it is automatically called by a...
Class BASE_SCREEN handles how to draw a screen (a board, a schematic ...)
Definition: base_screen.h:76
Define a library symbol object.
virtual wxWindow * GetWindow() override
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
Class COLORS_DESIGN_SETTINGS is a list of color settings for designs in Pcbnew.
Class SELECTION_AREA.
Basic classes for most KiCad items.