You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
2.1 KiB

  1. #ifndef __SCH_DRAW_PANEL_H
  2. #define __SCH_DRAW_PANEL_H
  3. #include <class_draw_panel_gal.h>
  4. #include <base_struct.h>
  5. #include <gr_basic.h>
  6. #include <eda_rect.h>
  7. #include <legacy_gal/class_drawpanel.h>
  8. namespace KIGFX
  9. {
  10. class SCH_VIEW;
  11. namespace PREVIEW
  12. {
  13. class SELECTION_AREA;
  14. };
  15. };
  16. class SCH_SHEET;
  17. class LIB_PART;
  18. class BASE_SCREEN;
  19. class SCH_SCREEN;
  20. class COLORS_DESIGN_SETTINGS;
  21. class SCH_EDIT_FRAME;
  22. class SCH_DRAW_PANEL : public EDA_DRAW_PANEL, public EDA_DRAW_PANEL_GAL
  23. {
  24. public:
  25. SCH_DRAW_PANEL( wxWindow* aParentWindow, wxWindowID aWindowId, const wxPoint& aPosition,
  26. const wxSize& aSize, KIGFX::GAL_DISPLAY_OPTIONS& aOptions,
  27. GAL_TYPE aGalType = GAL_TYPE_OPENGL );
  28. ~SCH_DRAW_PANEL();
  29. virtual wxWindow* GetWindow() override { return this; }
  30. void DisplayComponent( const LIB_PART *aComponent );
  31. void DisplaySheet( const SCH_SCREEN *aScreen );
  32. bool SwitchBackend( GAL_TYPE aGalType ) override;
  33. void OnKeyEvent( wxKeyEvent& event );
  34. void OnCharHook( wxKeyEvent& event );
  35. void SetEnableMousewheelPan( bool aEnable ) override;
  36. void SetEnableZoomNoCenter( bool aEnable ) override;
  37. void SetEnableAutoPan( bool aEnable ) override;
  38. void SetAutoPanRequest( bool aEnable ) override;
  39. BASE_SCREEN* GetScreen() override;
  40. virtual EDA_DRAW_FRAME* GetParent() const override;
  41. virtual void CrossHairOff( wxDC* DC=nullptr ) override;
  42. // Show the cross hair.
  43. virtual void CrossHairOn( wxDC* DC=nullptr ) override;
  44. virtual void MoveCursorToCrossHair() override;
  45. KIGFX::SCH_VIEW* GetView() const { return view(); }
  46. /// @copydoc wxWindow::Refresh()
  47. void Refresh( bool aEraseBackground = true, const wxRect* aRect = NULL ) override;
  48. protected:
  49. virtual void onPaint( wxPaintEvent& WXUNUSED( aEvent ) ) override;
  50. KIGFX::SCH_VIEW* view() const;
  51. wxWindow* m_parent;
  52. void setDefaultLayerOrder(); ///> Reassigns layer order to the initial settings.
  53. void setDefaultLayerDeps(); ///> Sets rendering targets & dependencies for layers.
  54. DECLARE_EVENT_TABLE()
  55. };
  56. #endif