KiCad PCB EDA Suite
SCH_DRAW_PANEL Class Reference

#include <sch_draw_panel.h>

Inheritance diagram for SCH_DRAW_PANEL:
EDA_DRAW_PANEL EDA_DRAW_PANEL_GAL

Public Types

enum  GAL_TYPE {
  GAL_TYPE_UNKNOWN = -1, GAL_TYPE_NONE = 0, GAL_TYPE_OPENGL, GAL_TYPE_CAIRO,
  GAL_TYPE_LAST
}
 

Public Member Functions

 SCH_DRAW_PANEL (wxWindow *aParentWindow, wxWindowID aWindowId, const wxPoint &aPosition, const wxSize &aSize, KIGFX::GAL_DISPLAY_OPTIONS &aOptions, GAL_TYPE aGalType=GAL_TYPE_OPENGL)
 
 ~SCH_DRAW_PANEL ()
 
virtual wxWindow * GetWindow () override
 
void DisplayComponent (const LIB_PART *aComponent)
 
void DisplaySheet (const SCH_SCREEN *aScreen)
 
bool SwitchBackend (GAL_TYPE aGalType) override
 Function SwitchBackend Switches method of rendering graphics. More...
 
void OnKeyEvent (wxKeyEvent &event)
 
void OnCharHook (wxKeyEvent &event)
 
void SetEnableMousewheelPan (bool aEnable) override
 
void SetEnableZoomNoCenter (bool aEnable) override
 
void SetEnableAutoPan (bool aEnable) override
 
void SetAutoPanRequest (bool aEnable) override
 
BASE_SCREENGetScreen () override
 
virtual EDA_DRAW_FRAMEGetParent () const override
 
virtual void CrossHairOff (wxDC *DC=nullptr) override
 
virtual void CrossHairOn (wxDC *DC=nullptr) override
 
virtual void MoveCursorToCrossHair () override
 Function MoveCursorToCrossHair warps the cursor to the current cross hair position. More...
 
KIGFX::SCH_VIEWGetView () const
 
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 action plugins, after running the plugin, so call this function is usually not needed inside action plugins. More...
 
virtual void * GetDisplayOptions ()
 Function GetDisplayOptions A way to pass info to draw functions. More...
 
void * GetDisplayOptions ()
 Function GetDisplayOptions A way to pass info to draw functions. More...
 
virtual EDA_RECTGetClipBox ()
 
EDA_RECTGetClipBox ()
 
void SetClipBox (const EDA_RECT &aRect)
 
virtual void SetClipBox (wxDC &aDC, const wxRect *aRect=NULL)
 Function SetClipBox sets the clip box in drawing (logical) units from aRect in device units. More...
 
void SetClipBox (const EDA_RECT &aRect)
 
void SetClipBox (wxDC &aDC, const wxRect *aRect=NULL)
 Function SetClipBox sets the clip box in drawing (logical) units from aRect in device units. More...
 
bool GetAbortRequest () const
 
bool GetAbortRequest () const
 
void SetAbortRequest (bool aAbortRequest)
 
void SetAbortRequest (bool aAbortRequest)
 
bool GetEnableMousewheelPan () const
 
bool GetEnableMousewheelPan () const
 
bool GetEnableZoomNoCenter () const
 
bool GetEnableZoomNoCenter () const
 
bool GetEnableAutoPan () const
 
bool GetEnableAutoPan () const
 
void SetIgnoreMouseEvents (bool aIgnore)
 
void SetIgnoreMouseEvents (bool aIgnore)
 
void SetIgnoreLeftButtonReleaseEvent (bool aIgnore)
 
void SetIgnoreLeftButtonReleaseEvent (bool aIgnore)
 
void SetEnableBlockCommands (bool aEnable)
 
void SetEnableBlockCommands (bool aEnable)
 
bool GetPrintMirrored () const
 
bool GetPrintMirrored () const
 
void SetPrintMirrored (bool aMirror)
 
void SetPrintMirrored (bool aMirror)
 
void SetCanStartBlock (int aStartBlock)
 
void SetCanStartBlock (int aStartBlock)
 
virtual void DrawBackGround (wxDC *DC)
 Function DrawBackGround. More...
 
void DrawBackGround (wxDC *DC)
 Function DrawBackGround. More...
 
virtual void DrawGrid (wxDC *aDC)
 Function DrawGrid draws a grid to aDC. More...
 
void DrawGrid (wxDC *aDC)
 Function DrawGrid draws a grid to aDC. More...
 
virtual void DrawAuxiliaryAxis (wxDC *aDC, GR_DRAWMODE aDrawMode)
 Function DrawAuxiliaryAxis Draw the Auxiliary Axis, used in Pcbnew which as origin coordinates for gerber and excellon files. More...
 
void DrawAuxiliaryAxis (wxDC *aDC, GR_DRAWMODE aDrawMode)
 Function DrawAuxiliaryAxis Draw the Auxiliary Axis, used in Pcbnew which as origin coordinates for gerber and excellon files. More...
 
virtual void DrawGridAxis (wxDC *aDC, GR_DRAWMODE aDrawMode, const wxPoint &aGridOrigin)
 Function DrawGridAxis Draw on auxiliary axis, used in Pcbnew to show grid origin, when the grid origin is set by user, and is not (0,0) More...
 
void DrawGridAxis (wxDC *aDC, GR_DRAWMODE aDrawMode, const wxPoint &aGridOrigin)
 Function DrawGridAxis Draw on auxiliary axis, used in Pcbnew to show grid origin, when the grid origin is set by user, and is not (0,0) More...
 
virtual wxRect DeviceToLogical (const wxRect &aRect, wxDC &aDC)
 Function DeviceToLogical converts aRect from device to drawing (logical) coordinates. More...
 
wxRect DeviceToLogical (const wxRect &aRect, wxDC &aDC)
 Function DeviceToLogical converts aRect from device to drawing (logical) coordinates. More...
 
virtual void EraseScreen (wxDC *DC)
 Function OnMouseWheel handles mouse wheel events. More...
 
void EraseScreen (wxDC *DC)
 
virtual void SetZoom (double mode)
 
void SetZoom (double mode)
 
virtual double GetZoom ()
 
double GetZoom ()
 
virtual bool IsPointOnDisplay (const wxPoint &aPosition)
 Function IsPointOnDisplay. More...
 
bool IsPointOnDisplay (const wxPoint &aPosition)
 Function IsPointOnDisplay. More...
 
virtual void ReDraw (wxDC *aDC, bool aEraseBackground=true)
 
void ReDraw (wxDC *aDC, bool aEraseBackground=true)
 
virtual void RefreshDrawingRect (const EDA_RECT &aRect, bool aEraseBackground=true)
 Function RefreshDrawingRect redraws the contents of aRect in drawing units. More...
 
void RefreshDrawingRect (const EDA_RECT &aRect, bool aEraseBackground=true)
 Function RefreshDrawingRect redraws the contents of aRect in drawing units. More...
 
virtual wxPoint GetScreenCenterLogicalPosition ()
 Update the board display after modifying it by a python script (note: it is automatically called by action plugins, after running the plugin, so call this function is usually not needed inside action plugins. More...
 
wxPoint GetScreenCenterLogicalPosition ()
 Function GetScreenCenterLogicalPosition. More...
 
virtual wxPoint ToDeviceXY (const wxPoint &pos)
 Function ToDeviceXY transforms logical to device coordinates. More...
 
wxPoint ToDeviceXY (const wxPoint &pos)
 Function ToDeviceXY transforms logical to device coordinates. More...
 
virtual wxPoint ToLogicalXY (const wxPoint &pos)
 Function ToLogicalXY transforms device to logical coordinates. More...
 
wxPoint ToLogicalXY (const wxPoint &pos)
 Function ToLogicalXY transforms device to logical coordinates. More...
 
virtual void MoveCursor (const wxPoint &aPosition)
 Function MoveCursor moves the mouse pointer to aPosition in logical (drawing) units. More...
 
void MoveCursor (const wxPoint &aPosition)
 Function MoveCursor moves the mouse pointer to aPosition in logical (drawing) units. More...
 
virtual void DrawCrossHair (wxDC *aDC=nullptr, COLOR4D aColor=COLOR4D::WHITE)
 Function DrawCrossHair draws the user cross hair. More...
 
void DrawCrossHair (wxDC *aDC, COLOR4D aColor=COLOR4D::WHITE)
 Function DrawCrossHair draws the user cross hair. More...
 
virtual void SetMouseCapture (MOUSE_CAPTURE_CALLBACK aMouseCaptureCallback, END_MOUSE_CAPTURE_CALLBACK aEndMouseCaptureCallback)
 Function SetMouseCapture sets the mouse capture and end mouse capture callbacks to aMouseCaptureCallback and aEndMouseCaptureCallback respectively. More...
 
void SetMouseCapture (MOUSE_CAPTURE_CALLBACK aMouseCaptureCallback, END_MOUSE_CAPTURE_CALLBACK aEndMouseCaptureCallback)
 Function SetMouseCapture sets the mouse capture and end mouse capture callbacks to aMouseCaptureCallback and aEndMouseCaptureCallback respectively. More...
 
virtual void SetMouseCaptureCallback (MOUSE_CAPTURE_CALLBACK aMouseCaptureCallback)
 
void SetMouseCaptureCallback (MOUSE_CAPTURE_CALLBACK aMouseCaptureCallback)
 
virtual void EndMouseCapture (int aId=-1, int aCursorId=-1, const wxString &aTitle=wxEmptyString, bool aCallEndFunc=true)
 Function EndMouseCapture ends mouse a capture. More...
 
void EndMouseCapture (int aId=-1, int aCursorId=-1, const wxString &aTitle=wxEmptyString, bool aCallEndFunc=true)
 Function EndMouseCapture ends mouse a capture. More...
 
bool IsMouseCaptured () const
 
bool IsMouseCaptured () const
 
virtual void CallMouseCapture (wxDC *aDC, const wxPoint &aPosition, bool aErase)
 Function CallMouseCapture calls the mouse capture callback. More...
 
void CallMouseCapture (wxDC *aDC, const wxPoint &aPosition, bool aErase)
 Function CallMouseCapture calls the mouse capture callback. More...
 
virtual void CallEndMouseCapture (wxDC *aDC)
 Function CallEndMouseCapture calls the end mouse capture callback. More...
 
void CallEndMouseCapture (wxDC *aDC)
 Function CallEndMouseCapture calls the end mouse capture callback. More...
 
void OnPaint (wxPaintEvent &event)
 
void OnEraseBackground (wxEraseEvent &event)
 
void OnActivate (wxActivateEvent &event)
 Function OnActivate handles window activation events. More...
 
void OnTimer (wxTimerEvent &event)
 Function OnTimer handle timer events. More...
 
virtual void DoPrepareDC (wxDC &aDC) override
 Function DoPrepareDC sets up the device context aDC for drawing. More...
 
void OnMouseWheel (wxMouseEvent &event)
 Function OnMouseWheel handles mouse wheel events. More...
 
void OnMouseEvent (wxMouseEvent &event)
 
void OnMouseEntering (wxMouseEvent &aEvent)
 
void OnMouseLeaving (wxMouseEvent &event)
 
void OnPan (wxCommandEvent &event)
 
void OnScrollWin (wxCommandEvent &event)
 
void OnScroll (wxScrollWinEvent &event)
 
void SetGrid (const wxRealPoint &size)
 
wxRealPoint GetGrid ()
 
bool OnRightClick (wxMouseEvent &event)
 Function OnRightClick builds and displays a context menu on a right mouse button click. More...
 
void SetCurrentCursor (int aCursor)
 Function SetCurrentCursor Set the current cursor shape for drawpanel. More...
 
int GetDefaultCursor () const
 Function GetDefaultCursor. More...
 
int GetCurrentCursor () const
 Function GetCurrentCursor. More...
 
virtual void SetFocus () override
 
GAL_TYPE GetBackend () const
 Function GetBackend Returns the type of backend currently used by GAL canvas. More...
 
KIGFX::GALGetGAL () const
 Function GetGAL() Returns a pointer to the GAL instance used in the panel. More...
 
KIGFX::VIEW_CONTROLSGetViewControls () const
 Function GetViewControls() Returns a pointer to the VIEW_CONTROLS instance used in the panel. More...
 
void ForceRefresh ()
 Function ForceRefresh() Forces a redraw. More...
 
void SetEventDispatcher (TOOL_DISPATCHER *aEventDispatcher)
 Function SetEventDispatcher() Sets a dispatcher that processes events and forwards them to tools. More...
 
void StartDrawing ()
 Function StartDrawing() Begins drawing if it was stopped previously. More...
 
void StopDrawing ()
 Function StopDrawing() Prevents the GAL canvas from further drawing till it is recreated or StartDrawing() is called. More...
 
virtual void SetHighContrastLayer (int aLayer)
 Function SetHighContrastLayer Takes care of display settings for the given layer to be displayed in high contrast mode. More...
 
virtual void SetTopLayer (int aLayer)
 Function SetTopLayer Moves the selected layer to the top, so it is displayed above all others. More...
 
virtual void GetMsgPanelInfo (EDA_UNITS_T aUnits, std::vector< MSG_PANEL_ITEM > &aList)
 
double GetLegacyZoom () const
 Function GetLegacyZoom() Returns current view scale converted to zoom value used by the legacy canvas. More...
 
EDA_DRAW_FRAMEGetParentEDAFrame () const
 Function GetParentEDAFrame() Returns parent EDA_DRAW_FRAME, if available or NULL otherwise. More...
 
virtual void OnShow ()
 Function OnShow() Called when the window is shown for the first time. More...
 
void SetStealsFocus (bool aStealsFocus)
 Set whether focus is taken on certain events (mouseover, keys, etc). More...
 
bool GetStealsFocus () const
 Get whether focus is taken on certain events (see SetStealsFocus()). More...
 
virtual void SetDefaultCursor ()
 
virtual void SetCurrentCursor (int aCursor)
 Function SetCurrentCursor Set the current cursor shape for this panel. More...
 
virtual int GetDefaultCursor () const
 Function GetDefaultCursor. More...
 
int GetCurrentCursor () const
 Function GetCurrentCursor. More...
 
virtual BOX2I GetDefaultViewBBox () const
 Returns the bounding box of the view that should be used if model is not valid For example, the worksheet bounding box for an empty PCB. More...
 
void OnEvent (wxEvent &aEvent)
 Used to forward events to the canvas from popups, etc. More...
 

Protected Member Functions

virtual void onPaint (wxPaintEvent &WXUNUSED(aEvent)) override
 
KIGFX::SCH_VIEWview () const
 
void setDefaultLayerOrder ()
 
void setDefaultLayerDeps ()
 

Reassigns layer order to the initial settings.

More...
 
void onSize (wxSizeEvent &aEvent)
 
void onEnter (wxEvent &aEvent)
 
void onLostFocus (wxFocusEvent &aEvent)
 
void onRefreshTimer (wxTimerEvent &aEvent)
 
void onShowTimer (wxTimerEvent &aEvent)
 

Protected Attributes

wxWindow * m_parent
 
bool m_showCrossHair
 Indicate if cross hair is to be shown. More...
 
int m_cursorLevel
 Index for cursor redraw in XOR mode. More...
 
int m_scrollIncrementX
 X axis scroll increment in pixels per unit. More...
 
int m_scrollIncrementY
 Y axis scroll increment in pixels per unit. More...
 
wxPoint m_CursorStartPos
 Used for testing the cursor movement. More...
 
wxPoint m_PanStartCenter
 Initial scroll center position when pan started. More...
 
wxPoint m_PanStartEventPosition
 Initial position of mouse event when pan started. More...
 
EDA_RECT m_ClipBox
 The drawing area used to redraw the screen which is usually the visible area of the drawing in internal units. More...
 
bool m_abortRequest
 Flag used to abort long commands. More...
 
bool m_enableZoomNoCenter
 True to enable zooming around the crosshair instead of the center. More...
 
bool m_enableMousewheelPan
 True to enable mousewheel panning by default. More...
 
bool m_enableAutoPan
 True to enable automatic panning. More...
 
bool m_ignoreMouseEvents
 Ignore mouse events when true. More...
 
bool m_ignoreNextLeftButtonRelease
 Ignore the next mouse left button release when true. More...
 
bool m_enableBlockCommands
 True enables block commands. More...
 
int m_minDragEventCount
 Count the drag events. More...
 
bool m_PrintIsMirrored
 True when drawing in mirror mode. More...
 
MOUSE_CAPTURE_CALLBACK m_mouseCaptureCallback
 Mouse capture move callback function. More...
 
END_MOUSE_CAPTURE_CALLBACK m_endMouseCaptureCallback
 Abort mouse capture callback function. More...
 
int m_canStartBlock
 useful to avoid false start block in certain cases (like switch from a sheet to another sheet >= 0 (or >= n) if a block can start More...
 
int m_doubleClickInterval
 
int m_currentCursor
 Current mouse cursor shape id. More...
 
int m_defaultCursor
 The default mouse cursor shape id. More...
 
EDA_DRAW_FRAMEm_edaFrame
 Parent EDA_DRAW_FRAME (if available) More...
 
wxLongLong m_lastRefresh
 Last timestamp when the panel was refreshed. More...
 
bool m_pendingRefresh
 Is there a redraw event requested? More...
 
bool m_drawing
 True if GAL is currently redrawing the view. More...
 
bool m_drawingEnabled
 Flag that determines if VIEW may use GAL for redrawing the screen. More...
 
wxTimer m_refreshTimer
 Timer responsible for preventing too frequent refresh. More...
 
wxTimer m_onShowTimer
 Timer used to execute OnShow() when the window finally appears on the screen. More...
 
KIGFX::GALm_gal
 Interface for drawing objects on a 2D-surface. More...
 
KIGFX::VIEWm_view
 Stores view settings (scale, center, etc.) and items to be drawn. More...
 
std::unique_ptr< KIGFX::PAINTERm_painter
 Contains information about how to draw items using GAL. More...
 
KIGFX::WX_VIEW_CONTROLSm_viewControls
 Control for VIEW (moving, zooming, etc.) More...
 
GAL_TYPE m_backend
 Currently used GAL. More...
 
KIGFX::GAL_DISPLAY_OPTIONSm_options
 
TOOL_DISPATCHERm_eventDispatcher
 Processes and forwards events to tools. More...
 
bool m_lostFocus
 Flag to indicate that focus should be regained on the next mouse event. More...
 
bool m_stealsFocus
 Flag to indicate whether the panel should take focus at certain times (when moused over, and on various mouse/key events) More...
 

Static Protected Attributes

static const int MinRefreshPeriod = 17
 60 FPS. More...
 

Detailed Description

Definition at line 29 of file sch_draw_panel.h.

Member Enumeration Documentation

◆ GAL_TYPE

Enumerator
GAL_TYPE_UNKNOWN 

not specified: a GAL engine must be set by the client

GAL_TYPE_NONE 

GAL not used (the legacy wxDC engine is used)

GAL_TYPE_OPENGL 

OpenGL implementation.

GAL_TYPE_CAIRO 

Cairo implementation.

GAL_TYPE_LAST 

Sentinel, do not use as a parameter.

Definition at line 60 of file class_draw_panel_gal.h.

60  {
61  GAL_TYPE_UNKNOWN = -1,
62  GAL_TYPE_NONE = 0,
66  };
Sentinel, do not use as a parameter.
not specified: a GAL engine must be set by the client
GAL not used (the legacy wxDC engine is used)

Constructor & Destructor Documentation

◆ SCH_DRAW_PANEL()

SCH_DRAW_PANEL::SCH_DRAW_PANEL ( wxWindow *  aParentWindow,
wxWindowID  aWindowId,
const wxPoint &  aPosition,
const wxSize &  aSize,
KIGFX::GAL_DISPLAY_OPTIONS aOptions,
GAL_TYPE  aGalType = GAL_TYPE_OPENGL 
)

Definition at line 54 of file sch_draw_panel.cpp.

56  :
57  EDA_DRAW_PANEL_GAL( aParentWindow, aWindowId, aPosition, aSize, aOptions, aGalType ),
58  m_parent( aParentWindow )
59 {
60  m_defaultCursor = m_currentCursor = wxCURSOR_ARROW;
61  m_showCrossHair = true;
62  m_view = new KIGFX::SCH_VIEW( true, dynamic_cast<SCH_BASE_FRAME*>( aParentWindow ) );
63  m_view->SetGAL( m_gal );
64 
66 
67  m_painter.reset( new KIGFX::SCH_PAINTER( m_gal ) );
68 
69  m_view->SetPainter( m_painter.get() );
70  m_view->SetScaleLimits( 50.0, 0.05 ); // This fixes the zoom in and zoom out limits
71  m_view->SetMirror( false, false );
72 
73  // Early initialization of the canvas background color,
74  // before any OnPaint event is fired for the canvas using a wrong bg color
75  auto settings = m_painter->GetSettings();
76  m_gal->SetClearColor( settings->GetBackgroundColor() );
77 
80 
82 
83  // View controls is the first in the event handler chain, so the Tool Framework operates
84  // on updated viewport data.
86 
87  Connect( wxEVT_CHAR, wxKeyEventHandler( SCH_DRAW_PANEL::OnKeyEvent ), NULL, this );
88  Connect( wxEVT_CHAR_HOOK, wxKeyEventHandler( SCH_DRAW_PANEL::OnCharHook ), NULL, this );
89 
93 
94  m_abortRequest = false;
95  m_ignoreMouseEvents = false;
96  // Be sure a mouse release button event will be ignored when creating the canvas
97  // if the mouse click was not made inside the canvas (can happen sometimes, when
98  // launching a editor from a double click made in another frame)
100 
101  m_mouseCaptureCallback = NULL;
103 
104  m_enableBlockCommands = false;
106 
107  m_cursorLevel = 0;
108  m_PrintIsMirrored = false;
109 
110  m_doubleClickInterval = 250;
111 
112  m_viewControls->SetSnapping( true );
113 
114  SetEvtHandlerEnabled( true );
115  SetFocus();
116  Show( true );
117  Raise();
118  StartDrawing();
119 }
wxWindow * m_parent
void SetScaleLimits(double aMaximum, double aMinimum)
Function SetScaleLimits() Sets minimum and maximum values for scale.
Definition: view.h:309
KIGFX::GAL * m_gal
Interface for drawing objects on a 2D-surface.
bool m_abortRequest
Flag used to abort long commands.
void SetClearColor(const COLOR4D &aColor)
KIGFX::WX_VIEW_CONTROLS * m_viewControls
Control for VIEW (moving, zooming, etc.)
bool m_enableZoomNoCenter
True to enable zooming around the crosshair instead of the center.
Class WX_VIEW_CONTROLS is a specific implementation of class VIEW_CONTROLS for wxWidgets library.
constexpr double SCH_WORLD_UNIT
Definition: sch_view.h:42
bool m_PrintIsMirrored
True when drawing in mirror mode.
END_MOUSE_CAPTURE_CALLBACK m_endMouseCaptureCallback
Abort mouse capture callback function.
virtual void SetSnapping(bool aEnabled)
Function SetSnapping() Enables/disables snapping cursor to grid.
int m_currentCursor
Current mouse cursor shape id.
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:66
void UpdateAllLayersOrder()
Function UpdateLayerOrder() Does everything that is needed to apply the rendering order of layers.
Definition: view.cpp:926
void SetMirror(bool aMirrorX, bool aMirrorY)
Function SetMirror() Controls the mirroring of the VIEW.
Definition: view.cpp:565
bool m_enableBlockCommands
True enables block commands.
int m_defaultCursor
The default mouse cursor shape id.
#define ENBL_ZOOM_NO_CENTER_KEY
Definition: pgm_base.h:49
MOUSE_CAPTURE_CALLBACK m_mouseCaptureCallback
Mouse capture move callback function.
#define ENBL_AUTO_PAN_KEY
Definition: pgm_base.h:52
void OnKeyEvent(wxKeyEvent &event)
std::unique_ptr< KIGFX::PAINTER > m_painter
Contains information about how to draw items using GAL.
Class SCH_PAINTER Contains methods for drawing schematic-specific items.
Definition: sch_painter.h:116
bool m_ignoreMouseEvents
Ignore mouse events when true.
KIGFX::SCH_VIEW * view() const
#define ENBL_MOUSEWHEEL_PAN_KEY
Definition: pgm_base.h:50
EDA_DRAW_PANEL_GAL(wxWindow *aParentWindow, wxWindowID aWindowId, const wxPoint &aPosition, const wxSize &aSize, KIGFX::GAL_DISPLAY_OPTIONS &aOptions, GAL_TYPE aGalType=GAL_TYPE_OPENGL)
virtual void SetFocus() override
void setDefaultLayerDeps()
Reassigns layer order to the initial settings.
VTBL_ENTRY wxConfigBase * CommonSettings() const
Definition: pgm_base.h:190
void StartDrawing()
Function StartDrawing() Begins drawing if it was stopped previously.
void SetWorldUnitLength(double aWorldUnitLength)
Set the unit length.
bool m_ignoreNextLeftButtonRelease
Ignore the next mouse left button release when true.
bool m_showCrossHair
Indicate if cross hair is to be shown.
KIGFX::VIEW * m_view
Stores view settings (scale, center, etc.) and items to be drawn.
bool m_enableMousewheelPan
True to enable mousewheel panning by default.
void OnCharHook(wxKeyEvent &event)
int m_minDragEventCount
Count the drag events.
void SetPainter(PAINTER *aPainter)
Function SetPainter() Sets the painter object used by the view for drawing VIEW_ITEMS.
Definition: view.h:189
bool m_enableAutoPan
True to enable automatic panning.
void SetGAL(GAL *aGal)
Function SetGAL() Assigns a rendering device for the VIEW.
Definition: view.cpp:519
void setDefaultLayerOrder()
int m_cursorLevel
Index for cursor redraw in XOR mode.

References PGM_BASE::CommonSettings(), ENBL_AUTO_PAN_KEY, ENBL_MOUSEWHEEL_PAN_KEY, ENBL_ZOOM_NO_CENTER_KEY, OnCharHook(), OnKeyEvent(), Pgm(), and SCH_WORLD_UNIT.

◆ ~SCH_DRAW_PANEL()

SCH_DRAW_PANEL::~SCH_DRAW_PANEL ( )

Definition at line 122 of file sch_draw_panel.cpp.

123 {
124 }

Member Function Documentation

◆ CallEndMouseCapture() [1/2]

void EDA_DRAW_PANEL::CallEndMouseCapture ( wxDC *  aDC)
inlinevirtualinherited

Function CallEndMouseCapture calls the end mouse capture callback.

Parameters
aDCA point to a wxDC object to perform any drawing upon.

Definition at line 374 of file legacy_gal/class_drawpanel.h.

374 { printf("EDA_DRAW_PANEL:Unimplemented23\n"); wxASSERT(false); };;

Referenced by PCB_EDIT_FRAME::OnPlaceOrRouteFootprints(), and PCB_EDIT_FRAME::Process_Special_Functions().

◆ CallEndMouseCapture() [2/2]

void EDA_DRAW_PANEL::CallEndMouseCapture ( wxDC *  aDC)
inherited

Function CallEndMouseCapture calls the end mouse capture callback.

Parameters
aDCA point to a wxDC object to perform any drawing upon.

◆ CallMouseCapture() [1/2]

void EDA_DRAW_PANEL::CallMouseCapture ( wxDC *  aDC,
const wxPoint &  aPosition,
bool  aErase 
)
inlinevirtualinherited

Function CallMouseCapture calls the mouse capture callback.

Parameters
aDCA point to a wxDC object to perform any drawing upon.
aPositionA referecnce to a wxPoint object containing the current cursor position.
aEraseTrue indicates the item being drawn should be erase before drawing it a aPosition.

Definition at line 366 of file legacy_gal/class_drawpanel.h.

366 { printf("EDA_DRAW_PANEL:Unimplemented22\n"); wxASSERT(false); };;

Referenced by Abort_EditEdge(), AbortBlockCurrentCommand(), PCB_EDIT_FRAME::Begin_Route(), PCB_EDIT_FRAME::Begin_Self(), PCB_EDIT_FRAME::Begin_Zone(), PCB_EDIT_FRAME::BeginMoveDimensionText(), PCB_EDIT_FRAME::Delete_LastCreatedCorner(), PCB_EDIT_FRAME::Delete_Segment(), Exit_Self(), LIB_EDIT_FRAME::GeneralControl(), SCH_BASE_FRAME::HandleBlockBegin(), PL_EDITOR_FRAME::HandleBlockEnd(), FOOTPRINT_EDIT_FRAME::HandleBlockEnd(), GERBVIEW_FRAME::HandleBlockEnd(), PCB_EDIT_FRAME::HandleBlockEnd(), PL_EDITOR_FRAME::HandleBlockPlace(), GERBVIEW_FRAME::HandleBlockPlace(), PCB_EDIT_FRAME::HandleBlockPlace(), PCB_EDIT_FRAME::OnHotKey(), PCB_EDIT_FRAME::Other_Layer_Route(), PCB_EDIT_FRAME::Process_Special_Functions(), PL_EDITOR_FRAME::RedrawActiveWindow(), FOOTPRINT_EDIT_FRAME::RedrawActiveWindow(), GERBVIEW_FRAME::RedrawActiveWindow(), SCH_EDIT_FRAME::RedrawActiveWindow(), LIB_EDIT_FRAME::RedrawActiveWindow(), PCB_EDIT_FRAME::RedrawActiveWindow(), PCB_EDIT_FRAME::Start_Move_DrawItem(), FOOTPRINT_EDIT_FRAME::Start_Move_EdgeMod(), PCB_EDIT_FRAME::StartMoveModule(), PCB_EDIT_FRAME::StartMoveOneNodeOrSegment(), PCB_BASE_FRAME::StartMoveTexteModule(), and PCB_EDIT_FRAME::StartMoveTextePcb().

◆ CallMouseCapture() [2/2]

void EDA_DRAW_PANEL::CallMouseCapture ( wxDC *  aDC,
const wxPoint &  aPosition,
bool  aErase 
)
inherited

Function CallMouseCapture calls the mouse capture callback.

Parameters
aDCA point to a wxDC object to perform any drawing upon.
aPositionA referecnce to a wxPoint object containing the current cursor position.
aEraseTrue indicates the item being drawn should be erase before drawing it a aPosition.

◆ CrossHairOff()

void SCH_DRAW_PANEL::CrossHairOff ( wxDC *  DC = nullptr)
overridevirtual

Reimplemented from EDA_DRAW_PANEL.

Definition at line 249 of file sch_draw_panel.cpp.

250 {
251  m_viewControls->ShowCursor( false );
252 }
virtual void ShowCursor(bool aEnabled)
Function ShowCursor() Enables or disables display of cursor.
KIGFX::WX_VIEW_CONTROLS * m_viewControls
Control for VIEW (moving, zooming, etc.)

◆ CrossHairOn()

void SCH_DRAW_PANEL::CrossHairOn ( wxDC *  DC = nullptr)
overridevirtual

Reimplemented from EDA_DRAW_PANEL.

Definition at line 255 of file sch_draw_panel.cpp.

256 {
257  m_viewControls->ShowCursor( true );
258 }
virtual void ShowCursor(bool aEnabled)
Function ShowCursor() Enables or disables display of cursor.
KIGFX::WX_VIEW_CONTROLS * m_viewControls
Control for VIEW (moving, zooming, etc.)

◆ DeviceToLogical() [1/2]

virtual wxRect EDA_DRAW_PANEL::DeviceToLogical ( const wxRect &  aRect,
wxDC &  aDC 
)
inlinevirtualinherited

Function DeviceToLogical converts aRect from device to drawing (logical) coordinates.

aRect must be in scrolled device units.

Parameters
aRectThe rectangle to convert.
aDCThe device context used for the conversion.
Returns
A rectangle converted to drawing units.

Definition at line 204 of file legacy_gal/class_drawpanel.h.

204 { printf("EDA_DRAW_PANEL:Unimplemented5\n");wxASSERT(false); return wxRect(); };

◆ DeviceToLogical() [2/2]

wxRect EDA_DRAW_PANEL::DeviceToLogical ( const wxRect &  aRect,
wxDC &  aDC 
)
inherited

Function DeviceToLogical converts aRect from device to drawing (logical) coordinates.

aRect must be in scrolled device units.

Parameters
aRectThe rectangle to convert.
aDCThe device context used for the conversion.
Returns
A rectangle converted to drawing units.

◆ DisplayComponent()

void SCH_DRAW_PANEL::DisplayComponent ( const LIB_PART aComponent)

Definition at line 127 of file sch_draw_panel.cpp.

128 {
129  view()->Clear();
130  view()->DisplayComponent( const_cast<LIB_PART*>(aComponent) );
131 
132 }
void DisplayComponent(LIB_PART *aPart)
Definition: sch_view.cpp:116
void Clear()
Function Clear() Removes all items from the view.
Definition: view.cpp:1110
KIGFX::SCH_VIEW * view() const

Referenced by LIB_EDIT_FRAME::RebuildView().

◆ DisplaySheet()

void SCH_DRAW_PANEL::DisplaySheet ( const SCH_SCREEN aScreen)

Definition at line 135 of file sch_draw_panel.cpp.

136 {
137  view()->Clear();
138 
139  if( aScreen )
140  view()->DisplaySheet( const_cast<SCH_SCREEN*>( aScreen ) );
141 }
void DisplaySheet(SCH_SHEET *aSheet)
Definition: sch_view.cpp:110
void Clear()
Function Clear() Removes all items from the view.
Definition: view.cpp:1110
KIGFX::SCH_VIEW * view() const

◆ DoPrepareDC()

void EDA_DRAW_PANEL::DoPrepareDC ( wxDC &  aDC)
overridevirtualinherited

Function DoPrepareDC sets up the device context aDC for drawing.

This overrides wxScrolledWindow::DoPrepareDC() for setting up the the device context used for drawing. The scale factor and drawing logical offset are set and the base method is called to set the DC device origin (scroll bar position). This connects everything together to achieve the appropriate coordinate manipulation using wxDC LogicalToDeviceXXX and DeviceToLogixalXXX methods. This gets called automatically for a paint event. If you do any drawing outside the paint event, you must call DoPrepareDC manually.

Parameters
aDCThe device context to prepare.

Definition at line 576 of file eda_draw_panel.cpp.

577 {
578  wxScrolledWindow::DoPrepareDC( dc );
579 
580  if( GetScreen() != NULL )
581  {
582  double scale = GetScreen()->GetScalingFactor();
583  dc.SetUserScale( scale, scale );
584 
585  wxPoint pt = GetScreen()->m_DrawOrg;
586  dc.SetLogicalOrigin( pt.x, pt.y );
587  }
588 
589  SetClipBox( dc ); // Reset the clip box to the entire screen.
590  GRResetPenAndBrush( &dc );
591  dc.SetBackgroundMode( wxTRANSPARENT );
592 }
virtual BASE_SCREEN * GetScreen()=0
void GRResetPenAndBrush(wxDC *DC)
Definition: gr_basic.cpp:123
void SetClipBox(const EDA_RECT &aRect)
const int scale
double GetScalingFactor() const
Function GetScalingFactor returns the inverse of the current scale used to draw items on screen.
Definition: base_screen.cpp:95
wxPoint m_DrawOrg
offsets for drawing the circuit on the screen
Definition: base_screen.h:183

References BASE_SCREEN::GetScalingFactor(), EDA_DRAW_PANEL::GetScreen(), GRResetPenAndBrush(), BASE_SCREEN::m_DrawOrg, scale, and EDA_DRAW_PANEL::SetClipBox().

Referenced by GBR_LAYOUT::Draw().

◆ DrawAuxiliaryAxis() [1/2]

void EDA_DRAW_PANEL::DrawAuxiliaryAxis ( wxDC *  aDC,
GR_DRAWMODE  aDrawMode 
)
inlinevirtualinherited

Function DrawAuxiliaryAxis Draw the Auxiliary Axis, used in Pcbnew which as origin coordinates for gerber and excellon files.

Parameters
aDC= current Device Context
aDrawMode= draw mode (GR_COPY, GR_OR ..)

Definition at line 182 of file legacy_gal/class_drawpanel.h.

182 { printf("EDA_DRAW_PANEL:Unimplemented2\n");};

◆ DrawAuxiliaryAxis() [2/2]

void EDA_DRAW_PANEL::DrawAuxiliaryAxis ( wxDC *  aDC,
GR_DRAWMODE  aDrawMode 
)
inherited

Function DrawAuxiliaryAxis Draw the Auxiliary Axis, used in Pcbnew which as origin coordinates for gerber and excellon files.

Parameters
aDC= current Device Context
aDrawMode= draw mode (GR_COPY, GR_OR ..)

◆ DrawBackGround() [1/2]

void EDA_DRAW_PANEL::DrawBackGround ( wxDC *  DC)
inlinevirtualinherited

Function DrawBackGround.

Parameters
DC= current Device Context Draws (if allowed) : the grid X and Y axis X and Y auxiliary axis

Definition at line 163 of file legacy_gal/class_drawpanel.h.

163 { printf("EDA_DRAW_PANEL:Unimplemented1\n"); };

Referenced by PL_EDITOR_FRAME::RedrawActiveWindow(), FOOTPRINT_EDIT_FRAME::RedrawActiveWindow(), FOOTPRINT_VIEWER_FRAME::RedrawActiveWindow(), FOOTPRINT_WIZARD_FRAME::RedrawActiveWindow(), GERBVIEW_FRAME::RedrawActiveWindow(), LIB_EDIT_FRAME::RedrawActiveWindow(), and PCB_EDIT_FRAME::RedrawActiveWindow().

◆ DrawBackGround() [2/2]

void EDA_DRAW_PANEL::DrawBackGround ( wxDC *  DC)
inherited

Function DrawBackGround.

Parameters
DC= current Device Context Draws (if allowed) : the grid X and Y axis X and Y auxiliary axis

◆ DrawCrossHair() [1/2]

void EDA_DRAW_PANEL::DrawCrossHair ( wxDC *  aDC = nullptr,
COLOR4D  aColor = COLOR4D::WHITE 
)
inlinevirtualinherited

Function DrawCrossHair draws the user cross hair.

The user cross hair is not the mouse cursor although they may be at the same screen position. The mouse cursor is still render by the OS. This is a drawn cross hair that is used to snap to grid when grid snapping is enabled. This is as an indicator to where the next user action will take place.

Parameters
aDC- the device context to draw the cursor
aColor- the color to draw the cursor

Definition at line 311 of file legacy_gal/class_drawpanel.h.

311 { printf("EDA_DRAW_PANEL:Unimplemented18\n"); };;

Referenced by PL_EDITOR_FRAME::RedrawActiveWindow(), FOOTPRINT_EDIT_FRAME::RedrawActiveWindow(), FOOTPRINT_VIEWER_FRAME::RedrawActiveWindow(), FOOTPRINT_WIZARD_FRAME::RedrawActiveWindow(), GERBVIEW_FRAME::RedrawActiveWindow(), LIB_EDIT_FRAME::RedrawActiveWindow(), and PCB_EDIT_FRAME::RedrawActiveWindow().

◆ DrawCrossHair() [2/2]

void EDA_DRAW_PANEL::DrawCrossHair ( wxDC *  aDC,
COLOR4D  aColor = COLOR4D::WHITE 
)
inherited

Function DrawCrossHair draws the user cross hair.

The user cross hair is not the mouse cursor although they may be at the same screen position. The mouse cursor is still render by the OS. This is a drawn cross hair that is used to snap to grid when grid snapping is enabled. This is as an indicator to where the next user action will take place.

Parameters
aDC- the device context to draw the cursor
aColor- the color to draw the cursor

◆ DrawGrid() [1/2]

void EDA_DRAW_PANEL::DrawGrid ( wxDC *  aDC)
inlinevirtualinherited

Function DrawGrid draws a grid to aDC.

See also
m_ClipBox to determine the damaged area of the drawing to draw the grid.
EDA_DRAW_FRAME::IsGridVisible() to determine if grid is shown.
EDA_DRAW_FRAME::GetGridColor() for the color of the grid.
Parameters
aDCThe device context to draw the grid.

Definition at line 173 of file legacy_gal/class_drawpanel.h.

173 { printf("EDA_DRAW_PANEL:Unimplemented2\n"); };

◆ DrawGrid() [2/2]

void EDA_DRAW_PANEL::DrawGrid ( wxDC *  aDC)
inherited

Function DrawGrid draws a grid to aDC.

See also
m_ClipBox to determine the damaged area of the drawing to draw the grid.
EDA_DRAW_FRAME::IsGridVisible() to determine if grid is shown.
EDA_DRAW_FRAME::GetGridColor() for the color of the grid.
Parameters
aDCThe device context to draw the grid.

◆ DrawGridAxis() [1/2]

void EDA_DRAW_PANEL::DrawGridAxis ( wxDC *  aDC,
GR_DRAWMODE  aDrawMode,
const wxPoint &  aGridOrigin 
)
inlinevirtualinherited

Function DrawGridAxis Draw on auxiliary axis, used in Pcbnew to show grid origin, when the grid origin is set by user, and is not (0,0)

Parameters
aDC= current Device Context
aDrawMode= draw mode (GR_COPY, GR_OR ..)
aGridOrigin= the absolute coordinate of grid origin for snap.

Definition at line 192 of file legacy_gal/class_drawpanel.h.

192 { printf("EDA_DRAW_PANEL:Unimplemented4\n"); };

◆ DrawGridAxis() [2/2]

void EDA_DRAW_PANEL::DrawGridAxis ( wxDC *  aDC,
GR_DRAWMODE  aDrawMode,
const wxPoint &  aGridOrigin 
)
inherited

Function DrawGridAxis Draw on auxiliary axis, used in Pcbnew to show grid origin, when the grid origin is set by user, and is not (0,0)

Parameters
aDC= current Device Context
aDrawMode= draw mode (GR_COPY, GR_OR ..)
aGridOrigin= the absolute coordinate of grid origin for snap.

◆ EndMouseCapture() [1/2]

void EDA_DRAW_PANEL::EndMouseCapture ( int  aId = -1,
int  aCursorId = -1,
const wxString &  aTitle = wxEmptyString,
bool  aCallEndFunc = true 
)
inlinevirtualinherited

Function EndMouseCapture ends mouse a capture.

Check to see if the cursor is being managed for block or editing commands and release it.

Parameters
aIdThe command ID to restore or -1 to keep the current command ID.
aCursorIdThe wxWidgets stock cursor ID to set the cursor to or -1 to keep the current cursor.
aTitleThe tool message to display in the status bar or wxEmptyString to clear the message.
aCallEndFuncCall the abort mouse capture callback if true.

Definition at line 350 of file legacy_gal/class_drawpanel.h.

352  { printf("EDA_DRAW_PANEL:Unimplemented21\n"); wxASSERT(false); };;

Referenced by PCB_EDIT_FRAME::Files_io_from_id(), PL_EDITOR_FRAME::HandleBlockEnd(), FOOTPRINT_EDIT_FRAME::HandleBlockEnd(), GERBVIEW_FRAME::HandleBlockEnd(), PCB_EDIT_FRAME::HandleBlockEnd(), PL_EDITOR_FRAME::HandleBlockPlace(), FOOTPRINT_EDIT_FRAME::HandleBlockPlace(), GERBVIEW_FRAME::HandleBlockPlace(), PCB_EDIT_FRAME::HandleBlockPlace(), PL_EDITOR_FRAME::OnFileHistory(), PCB_EDIT_FRAME::OnFileHistory(), EDA_DRAW_PANEL::OnKeyEvent(), PCB_EDIT_FRAME::OnPlaceOrRouteFootprints(), PCB_EDIT_FRAME::OnSelectTool(), PCB_EDIT_FRAME::Process_Special_Functions(), and PCB_EDIT_FRAME::ProcessMuWaveFunctions().

◆ EndMouseCapture() [2/2]

void EDA_DRAW_PANEL::EndMouseCapture ( int  aId = -1,
int  aCursorId = -1,
const wxString &  aTitle = wxEmptyString,
bool  aCallEndFunc = true 
)
inherited

Function EndMouseCapture ends mouse a capture.

Check to see if the cursor is being managed for block or editing commands and release it.

Parameters
aIdThe command ID to restore or -1 to keep the current command ID.
aCursorIdThe wxWidgets stock cursor ID to set the cursor to or -1 to keep the current cursor.
aTitleThe tool message to display in the status bar or wxEmptyString to clear the message.
aCallEndFuncCall the abort mouse capture callback if true.

◆ EraseScreen() [1/2]

void EDA_DRAW_PANEL::EraseScreen ( wxDC *  DC)
inlinevirtualinherited

Function OnMouseWheel handles mouse wheel events.

The mouse wheel is used to provide support for zooming and panning. This is accomplished by converting mouse wheel events in pseudo menu command events and sending them to the appropriate parent window event handler.

Definition at line 218 of file legacy_gal/class_drawpanel.h.

218 { printf("EDA_DRAW_PANEL:Unimplemented6\n"); };;

Referenced by DrawPageOnClipboard(), and PL_EDITOR_FRAME::RedrawActiveWindow().

◆ EraseScreen() [2/2]

void EDA_DRAW_PANEL::EraseScreen ( wxDC *  DC)
inherited

◆ ForceRefresh()

◆ GetAbortRequest() [1/2]

bool EDA_DRAW_PANEL::GetAbortRequest ( ) const
inlineinherited

◆ GetAbortRequest() [2/2]

bool EDA_DRAW_PANEL::GetAbortRequest ( ) const
inlineinherited

Definition at line 143 of file legacy_wx/class_drawpanel.h.

143 { return m_abortRequest; }
bool m_abortRequest
Flag used to abort long commands.

References EDA_DRAW_PANEL::m_abortRequest.

◆ GetBackend()

GAL_TYPE EDA_DRAW_PANEL_GAL::GetBackend ( ) const
inlineinherited

◆ GetClipBox() [1/2]

virtual EDA_RECT* EDA_DRAW_PANEL::GetClipBox ( )
inlinevirtualinherited

Definition at line 122 of file legacy_gal/class_drawpanel.h.

122 { return &m_ClipBox; }
EDA_RECT m_ClipBox
The drawing area used to redraw the screen which is usually the visible area of the drawing in intern...

References EDA_DRAW_PANEL::m_ClipBox.

Referenced by Autoroute_One_Track(), DisplayRoutingMatrix(), SCH_JUNCTION::Draw(), SCH_NO_CONNECT::Draw(), TEXTE_PCB::Draw(), PCB_TARGET::Draw(), SCH_BUS_ENTRY_BASE::Draw(), ZONE_CONTAINER::Draw(), GBR_LAYOUT::Draw(), EDGE_MODULE::Draw(), SCH_LINE::Draw(), SCH_TEXT::Draw(), SCH_FIELD::Draw(), TEXTE_MODULE::Draw(), TRACK::Draw(), DIMENSION::Draw(), DRAWSEGMENT::Draw(), GERBER_DRAW_ITEM::Draw(), SCH_GLOBALLABEL::Draw(), SCH_HIERLABEL::Draw(), MODULE::Draw(), VIA::Draw(), SCH_SHEET::Draw(), D_PAD::Draw(), MODULE::DrawAncre(), ZONE_CONTAINER::DrawFilledArea(), PCB_BASE_FRAME::DrawGeneralRatsnest(), LIB_CIRCLE::drawGraphic(), LIB_POLYLINE::drawGraphic(), LIB_RECTANGLE::drawGraphic(), LIB_BEZIER::drawGraphic(), LIB_TEXT::drawGraphic(), LIB_ARC::drawGraphic(), LIB_FIELD::drawGraphic(), GBR_LAYOUT::DrawItemsDCodeID(), PLEDITOR_PRINTOUT::DrawPage(), DrawPageOnClipboard(), LIB_PIN::DrawPinElectricalTypeName(), LIB_PIN::DrawPinSymbol(), LIB_PIN::DrawPinTexts(), D_PAD::DrawShape(), TRACK::DrawShortNetname(), TEXTE_MODULE::DrawUmbilical(), ZONE_CONTAINER::DrawWhileCreateOutline(), EDA_DRAW_FRAME::DrawWorkSheet(), ShowBoundingBoxMicroWaveInductor(), ShowNewTrackWhenMovingCursor(), PCB_BASE_FRAME::TraceAirWiresToTargets(), and PCB_BASE_FRAME::TraceModuleRatsNest().

◆ GetClipBox() [2/2]

EDA_RECT* EDA_DRAW_PANEL::GetClipBox ( )
inlineinherited

Definition at line 139 of file legacy_wx/class_drawpanel.h.

139 { return &m_ClipBox; }
EDA_RECT m_ClipBox
The drawing area used to redraw the screen which is usually the visible area of the drawing in intern...

References EDA_DRAW_PANEL::m_ClipBox.

◆ GetCurrentCursor() [1/2]

int EDA_DRAW_PANEL_GAL::GetCurrentCursor ( ) const
inlineinherited

Function GetCurrentCursor.

Returns
the current cursor shape, depending on the current selected tool

Definition at line 225 of file class_draw_panel_gal.h.

225 { return m_currentCursor; }
int m_currentCursor
Current mouse cursor shape id.

References EDA_DRAW_PANEL_GAL::m_currentCursor.

◆ GetCurrentCursor() [2/2]

int EDA_DRAW_PANEL::GetCurrentCursor ( ) const
inlineinherited

◆ GetDefaultCursor() [1/2]

virtual int EDA_DRAW_PANEL_GAL::GetDefaultCursor ( ) const
inlinevirtualinherited

Function GetDefaultCursor.

Returns
the default cursor shape

Definition at line 219 of file class_draw_panel_gal.h.

219 { return m_defaultCursor; }
int m_defaultCursor
The default mouse cursor shape id.

References EDA_DRAW_PANEL_GAL::m_defaultCursor.

Referenced by EDA_DRAW_FRAME::SetNoToolSelected().

◆ GetDefaultCursor() [2/2]

int EDA_DRAW_PANEL::GetDefaultCursor ( ) const
inlineinherited

◆ GetDefaultViewBBox()

virtual BOX2I EDA_DRAW_PANEL_GAL::GetDefaultViewBBox ( ) const
inlinevirtualinherited

Returns the bounding box of the view that should be used if model is not valid For example, the worksheet bounding box for an empty PCB.

Returns
the default bounding box for the panel

Reimplemented in PCB_DRAW_PANEL_GAL, and GERBVIEW_DRAW_PANEL_GAL.

Definition at line 233 of file class_draw_panel_gal.h.

234  {
235  return BOX2I();
236  }
BOX2< VECTOR2I > BOX2I
Definition: box2.h:520

Referenced by COMMON_TOOLS::CenterContents(), SCH_BASE_FRAME::Zoom_Automatique(), and COMMON_TOOLS::ZoomFitScreen().

◆ GetDisplayOptions() [1/2]

void * EDA_DRAW_PANEL::GetDisplayOptions ( )
inlinevirtualinherited

Function GetDisplayOptions A way to pass info to draw functions.

this is just an accessor to the GetDisplayOptions() parent frame function.

Definition at line 114 of file legacy_gal/class_drawpanel.h.

114 { printf("EDA_DRAW_PANEL:Unimplemented\n"); wxASSERT(false); return nullptr; };

Referenced by TEXTE_PCB::Draw(), PCB_TARGET::Draw(), ZONE_CONTAINER::Draw(), EDGE_MODULE::Draw(), TEXTE_MODULE::Draw(), TRACK::Draw(), DIMENSION::Draw(), DRAWSEGMENT::Draw(), ZONE_CONTAINER::DrawFilledArea(), drawMovingBlock(), MODULE::DrawOutlinesWhenMoving(), DrawSegment(), TRACK::DrawShortNetname(), ZONE_CONTAINER::DrawWhileCreateOutline(), Show_MoveNode(), and Trace_Pads_Only().

◆ GetDisplayOptions() [2/2]

void* EDA_DRAW_PANEL::GetDisplayOptions ( )
inherited

Function GetDisplayOptions A way to pass info to draw functions.

this is just an accessor to the GetDisplayOptions() parent frame function.

◆ GetEnableAutoPan() [1/2]

bool EDA_DRAW_PANEL::GetEnableAutoPan ( ) const
inlineinherited

Definition at line 138 of file legacy_gal/class_drawpanel.h.

138 { return m_enableAutoPan; }
bool m_enableAutoPan
True to enable automatic panning.

References EDA_DRAW_PANEL::m_enableAutoPan.

Referenced by EDA_DRAW_FRAME::PushPreferences(), and EDA_DRAW_FRAME::UseGalCanvas().

◆ GetEnableAutoPan() [2/2]

bool EDA_DRAW_PANEL::GetEnableAutoPan ( ) const
inlineinherited

Definition at line 155 of file legacy_wx/class_drawpanel.h.

155 { return m_enableAutoPan; }
bool m_enableAutoPan
True to enable automatic panning.

References EDA_DRAW_PANEL::m_enableAutoPan.

◆ GetEnableMousewheelPan() [1/2]

bool EDA_DRAW_PANEL::GetEnableMousewheelPan ( ) const
inlineinherited

Definition at line 130 of file legacy_gal/class_drawpanel.h.

130 { return m_enableMousewheelPan; }
bool m_enableMousewheelPan
True to enable mousewheel panning by default.

References EDA_DRAW_PANEL::m_enableMousewheelPan.

Referenced by DIALOG_PAD_PROPERTIES::prepareCanvas(), and EDA_DRAW_FRAME::UseGalCanvas().

◆ GetEnableMousewheelPan() [2/2]

bool EDA_DRAW_PANEL::GetEnableMousewheelPan ( ) const
inlineinherited

Definition at line 147 of file legacy_wx/class_drawpanel.h.

147 { return m_enableMousewheelPan; }
bool m_enableMousewheelPan
True to enable mousewheel panning by default.

References EDA_DRAW_PANEL::m_enableMousewheelPan.

◆ GetEnableZoomNoCenter() [1/2]

bool EDA_DRAW_PANEL::GetEnableZoomNoCenter ( ) const
inlineinherited

Definition at line 134 of file legacy_gal/class_drawpanel.h.

134 { return m_enableZoomNoCenter; }
bool m_enableZoomNoCenter
True to enable zooming around the crosshair instead of the center.

References EDA_DRAW_PANEL::m_enableZoomNoCenter.

Referenced by EDA_DRAW_FRAME::PushPreferences(), and EDA_DRAW_FRAME::UseGalCanvas().

◆ GetEnableZoomNoCenter() [2/2]

bool EDA_DRAW_PANEL::GetEnableZoomNoCenter ( ) const
inlineinherited

Definition at line 151 of file legacy_wx/class_drawpanel.h.

151 { return m_enableZoomNoCenter; }
bool m_enableZoomNoCenter
True to enable zooming around the crosshair instead of the center.

References EDA_DRAW_PANEL::m_enableZoomNoCenter.

◆ GetGAL()

◆ GetGrid()

wxRealPoint EDA_DRAW_PANEL::GetGrid ( )
inherited

Definition at line 277 of file eda_draw_panel.cpp.

278 {
279  return GetScreen()->GetGridSize();
280 }
virtual BASE_SCREEN * GetScreen()=0
const wxRealPoint & GetGridSize() const
Return the grid size of the currently selected grid.
Definition: base_screen.h:410

References BASE_SCREEN::GetGridSize(), and EDA_DRAW_PANEL::GetScreen().

◆ GetLegacyZoom()

double EDA_DRAW_PANEL_GAL::GetLegacyZoom ( ) const
inherited

Function GetLegacyZoom() Returns current view scale converted to zoom value used by the legacy canvas.

Definition at line 356 of file draw_panel_gal.cpp.

357 {
359 }
KIGFX::GAL * m_gal
Interface for drawing objects on a 2D-surface.
double GetZoomLevelCoeff() const
Return the coefficient to convert internal display scale factor to zoom level.
Definition: draw_frame.h:475
double GetZoomFactor() const
Get the zoom factor.
EDA_DRAW_FRAME * m_edaFrame
Parent EDA_DRAW_FRAME (if available)

References KIGFX::GAL::GetZoomFactor(), EDA_DRAW_FRAME::GetZoomLevelCoeff(), EDA_DRAW_PANEL_GAL::m_edaFrame, and EDA_DRAW_PANEL_GAL::m_gal.

Referenced by COMMON_TOOLS::doZoomInOut(), EDA_DRAW_PANEL_GAL::onPaint(), GERBVIEW_FRAME::OnUpdateSelectZoom(), and PCB_BASE_FRAME::OnUpdateSelectZoom().

◆ GetMsgPanelInfo()

virtual void EDA_DRAW_PANEL_GAL::GetMsgPanelInfo ( EDA_UNITS_T  aUnits,
std::vector< MSG_PANEL_ITEM > &  aList 
)
inlinevirtualinherited

Reimplemented in PCB_DRAW_PANEL_GAL, and GERBVIEW_DRAW_PANEL_GAL.

Definition at line 164 of file class_draw_panel_gal.h.

165  {
166  wxASSERT( false );
167  }

Referenced by PCB_BASE_FRAME::UpdateMsgPanel().

◆ GetParent()

EDA_DRAW_FRAME * SCH_DRAW_PANEL::GetParent ( ) const
overridevirtual

Implements EDA_DRAW_PANEL.

Definition at line 243 of file sch_draw_panel.cpp.

244 {
245  return static_cast<EDA_DRAW_FRAME*>(m_parent); // static_cast<SCH_EDIT_FRAME*> (m_parent);
246 }
wxWindow * m_parent

◆ GetParentEDAFrame()

EDA_DRAW_FRAME* EDA_DRAW_PANEL_GAL::GetParentEDAFrame ( ) const
inlineinherited

Function GetParentEDAFrame() Returns parent EDA_DRAW_FRAME, if available or NULL otherwise.

Definition at line 179 of file class_draw_panel_gal.h.

180  {
181  return m_edaFrame;
182  }
EDA_DRAW_FRAME * m_edaFrame
Parent EDA_DRAW_FRAME (if available)

References EDA_DRAW_PANEL_GAL::m_edaFrame.

Referenced by GERBVIEW_DRAW_PANEL_GAL::GERBVIEW_DRAW_PANEL_GAL(), EDA_DRAW_PANEL_GAL::onPaint(), and PCB_DRAW_PANEL_GAL::PCB_DRAW_PANEL_GAL().

◆ GetPrintMirrored() [1/2]

bool EDA_DRAW_PANEL::GetPrintMirrored ( ) const
inlineinherited

Definition at line 150 of file legacy_gal/class_drawpanel.h.

150 { return m_PrintIsMirrored; }
bool m_PrintIsMirrored
True when drawing in mirror mode.

References EDA_DRAW_PANEL::m_PrintIsMirrored.

Referenced by EDGE_MODULE::Draw(), and DRAWSEGMENT::Draw().

◆ GetPrintMirrored() [2/2]

bool EDA_DRAW_PANEL::GetPrintMirrored ( ) const
inlineinherited

Definition at line 167 of file legacy_wx/class_drawpanel.h.

167 { return m_PrintIsMirrored; }
bool m_PrintIsMirrored
True when drawing in mirror mode.

References EDA_DRAW_PANEL::m_PrintIsMirrored.

◆ GetScreen()

BASE_SCREEN * SCH_DRAW_PANEL::GetScreen ( )
overridevirtual

Implements EDA_DRAW_PANEL.

Definition at line 238 of file sch_draw_panel.cpp.

239 {
240  return GetParent()->GetScreen();
241 }
virtual EDA_DRAW_FRAME * GetParent() const override
virtual BASE_SCREEN * GetScreen() const
Return a pointer to a BASE_SCREEN or one of its derivatives.
Definition: draw_frame.h:408

◆ GetScreenCenterLogicalPosition() [1/2]

wxPoint EDA_DRAW_PANEL::GetScreenCenterLogicalPosition ( )
inlinevirtualinherited

Update the board display after modifying it by a python script (note: it is automatically called by action plugins, after running the plugin, so call this function is usually not needed inside action plugins.

Could be deprecated because modifying a board (especially deleting items) outside a action plugin can crash Pcbnew. Function GetScreenCenterLogicalPosition

Returns
The current screen center position in logical (drawing) units.

Definition at line 271 of file legacy_gal/class_drawpanel.h.

271 { return wxPoint(0, 0); };;

Referenced by EDA_DRAW_FRAME::UseGalCanvas().

◆ GetScreenCenterLogicalPosition() [2/2]

wxPoint EDA_DRAW_PANEL::GetScreenCenterLogicalPosition ( )
inherited

Function GetScreenCenterLogicalPosition.

Returns
The current screen center position in logical (drawing) units.

◆ GetStealsFocus()

bool EDA_DRAW_PANEL_GAL::GetStealsFocus ( ) const
inlineinherited

Get whether focus is taken on certain events (see SetStealsFocus()).

Definition at line 203 of file class_draw_panel_gal.h.

204  {
205  return m_stealsFocus;
206  }
bool m_stealsFocus
Flag to indicate whether the panel should take focus at certain times (when moused over,...

References EDA_DRAW_PANEL_GAL::m_stealsFocus.

◆ GetView()

◆ GetViewControls()

KIGFX::VIEW_CONTROLS* EDA_DRAW_PANEL_GAL::GetViewControls ( ) const
inlineinherited

Function GetViewControls() Returns a pointer to the VIEW_CONTROLS instance used in the panel.

Returns
The instance of VIEW_CONTROLS.

Definition at line 116 of file class_draw_panel_gal.h.

117  {
119  }
KIGFX::WX_VIEW_CONTROLS * m_viewControls
Control for VIEW (moving, zooming, etc.)
Class VIEW_CONTROLS is an interface for classes handling user events controlling the view behaviour (...

References EDA_DRAW_PANEL_GAL::m_viewControls.

Referenced by SCH_BASE_FRAME::CenterScreen(), EVT_GRID_CMD_CELL_CHANGED(), EDA_DRAW_FRAME::FocusOnLocation(), LIB_EDIT_FRAME::GeneralControl(), EDA_DRAW_FRAME::GetCrossHairPosition(), DIALOG_PAD_PROPERTIES::prepareCanvas(), SCH_BASE_FRAME::RedrawScreen(), PCB_BASE_EDIT_FRAME::SetBoard(), EDA_DRAW_FRAME::SetCrossHairPosition(), FOOTPRINT_EDIT_FRAME::setupTools(), and EDA_DRAW_FRAME::UseGalCanvas().

◆ GetWindow()

virtual wxWindow* SCH_DRAW_PANEL::GetWindow ( )
inlineoverridevirtual

Implements EDA_DRAW_PANEL.

Definition at line 38 of file sch_draw_panel.h.

38 { return this; }

◆ GetZoom() [1/2]

double EDA_DRAW_PANEL::GetZoom ( )
inlinevirtualinherited

Definition at line 221 of file legacy_gal/class_drawpanel.h.

221 { return 1.0; };;

Referenced by EDA_DRAW_FRAME::UseGalCanvas().

◆ GetZoom() [2/2]

double EDA_DRAW_PANEL::GetZoom ( )
inherited

◆ IsMouseCaptured() [1/2]

◆ IsMouseCaptured() [2/2]

bool EDA_DRAW_PANEL::IsMouseCaptured ( ) const
inlineinherited

Definition at line 430 of file legacy_wx/class_drawpanel.h.

430 { return m_mouseCaptureCallback != NULL; }
MOUSE_CAPTURE_CALLBACK m_mouseCaptureCallback
Mouse capture move callback function.

References EDA_DRAW_PANEL::m_mouseCaptureCallback.

◆ IsPointOnDisplay() [1/2]

bool EDA_DRAW_PANEL::IsPointOnDisplay ( const wxPoint &  aPosition)
inlinevirtualinherited

Function IsPointOnDisplay.

Parameters
aPositionThe position to test in logical (drawing) units.
Returns
true if aPosition is visible on the screen. false if aPosition is not visible on the screen.

Definition at line 233 of file legacy_gal/class_drawpanel.h.

233 { printf("EDA_DRAW_PANEL:Unimplemented9\n"); return false; };;

Referenced by PL_EDITOR_FRAME::MoveItem().

◆ IsPointOnDisplay() [2/2]

bool EDA_DRAW_PANEL::IsPointOnDisplay ( const wxPoint &  aPosition)
inherited

Function IsPointOnDisplay.

Parameters
aPositionThe position to test in logical (drawing) units.
Returns
true if aPosition is visible on the screen. false if aPosition is not visible on the screen.

◆ MoveCursor() [1/2]

void EDA_DRAW_PANEL::MoveCursor ( const wxPoint &  aPosition)
inlinevirtualinherited

Function MoveCursor moves the mouse pointer to aPosition in logical (drawing) units.

Parameters
aPositionThe position in logical units to move the cursor.

Definition at line 296 of file legacy_gal/class_drawpanel.h.

296 { printf("EDA_DRAW_PANEL:Unimplemented17\n"); };;

Referenced by EDA_DRAW_FRAME::GeneralControlKeyMovement().

◆ MoveCursor() [2/2]

void EDA_DRAW_PANEL::MoveCursor ( const wxPoint &  aPosition)
inherited

Function MoveCursor moves the mouse pointer to aPosition in logical (drawing) units.

Parameters
aPositionThe position in logical units to move the cursor.

◆ MoveCursorToCrossHair()

void SCH_DRAW_PANEL::MoveCursorToCrossHair ( )
overridevirtual

Function MoveCursorToCrossHair warps the cursor to the current cross hair position.

Reimplemented from EDA_DRAW_PANEL.

Definition at line 261 of file sch_draw_panel.cpp.

262 {
263  GetViewControls()->WarpCursor( GetParent()->GetCrossHairPosition(), true );
264 }
KIGFX::VIEW_CONTROLS * GetViewControls() const
Function GetViewControls() Returns a pointer to the VIEW_CONTROLS instance used in the panel.
virtual EDA_DRAW_FRAME * GetParent() const override
virtual void WarpCursor(const VECTOR2D &aPosition, bool aWorldCoordinates=false, bool aWarpView=false)=0
Function WarpCursor() If enabled (.

Referenced by SCH_DRAWING_TOOLS::AddJunction(), SCH_DRAWING_TOOLS::doPlaceComponent(), LIB_DRAWING_TOOLS::doTwoClickPlace(), SCH_DRAWING_TOOLS::doTwoClickPlace(), SCH_DRAWING_TOOLS::PlaceImage(), LIB_PIN_TOOL::PlacePin(), SCH_EDIT_FRAME::SelectUnit(), SCH_WIRE_BUS_TOOL::StartBus(), SCH_WIRE_BUS_TOOL::StartLine(), SCH_WIRE_BUS_TOOL::StartWire(), and DIALOG_LABEL_EDITOR::TransferDataFromWindow().

◆ OnActivate()

void EDA_DRAW_PANEL::OnActivate ( wxActivateEvent &  event)
inherited

Function OnActivate handles window activation events.

The member m_canStartBlock is initialize to avoid a block start command on activation (because a left mouse button can be pressed and no block command wanted. This happens when enter on a hierarchy sheet on double click.

Definition at line 396 of file eda_draw_panel.cpp.

397 {
398  m_canStartBlock = -1; // Block Command can't start
399  event.Skip();
400 }
int m_canStartBlock
useful to avoid false start block in certain cases (like switch from a sheet to another sheet >= 0 (o...

References EDA_DRAW_PANEL::m_canStartBlock.

◆ OnCharHook()

void SCH_DRAW_PANEL::OnCharHook ( wxKeyEvent &  event)

Definition at line 273 of file sch_draw_panel.cpp.

274 {
275  event.Skip();
276 }

Referenced by SCH_DRAW_PANEL().

◆ onEnter()

void EDA_DRAW_PANEL_GAL::onEnter ( wxEvent &  aEvent)
protectedinherited

Definition at line 461 of file draw_panel_gal.cpp.

462 {
463  // Getting focus is necessary in order to receive key events properly
464  if( m_stealsFocus )
465  SetFocus();
466 
467  aEvent.Skip();
468 }
virtual void SetFocus() override
bool m_stealsFocus
Flag to indicate whether the panel should take focus at certain times (when moused over,...

References EDA_DRAW_PANEL_GAL::m_stealsFocus, and EDA_DRAW_PANEL_GAL::SetFocus().

Referenced by EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL().

◆ OnEraseBackground()

void EDA_DRAW_PANEL::OnEraseBackground ( wxEraseEvent &  event)
inlineinherited

Definition at line 211 of file legacy_wx/class_drawpanel.h.

211 { }

◆ OnEvent()

void EDA_DRAW_PANEL_GAL::OnEvent ( wxEvent &  aEvent)
inherited

Used to forward events to the canvas from popups, etc.

Definition at line 447 of file draw_panel_gal.cpp.

448 {
449  if( m_lostFocus && m_stealsFocus )
450  SetFocus();
451 
452  if( !m_eventDispatcher )
453  aEvent.Skip();
454  else
456 
457  Refresh();
458 }
virtual void DispatchWxEvent(wxEvent &aEvent)
Function DispatchWxEvent() Processes wxEvents (mostly UI events), translates them to TOOL_EVENTs,...
bool m_lostFocus
Flag to indicate that focus should be regained on the next mouse event.
virtual void SetFocus() override
virtual 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...
TOOL_DISPATCHER * m_eventDispatcher
Processes and forwards events to tools.
bool m_stealsFocus
Flag to indicate whether the panel should take focus at certain times (when moused over,...

References TOOL_DISPATCHER::DispatchWxEvent(), EDA_DRAW_PANEL_GAL::m_eventDispatcher, EDA_DRAW_PANEL_GAL::m_lostFocus, EDA_DRAW_PANEL_GAL::m_stealsFocus, EDA_DRAW_PANEL_GAL::Refresh(), and EDA_DRAW_PANEL_GAL::SetFocus().

Referenced by EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL(), and STATUS_POPUP::onCharHook().

◆ OnKeyEvent()

void SCH_DRAW_PANEL::OnKeyEvent ( wxKeyEvent &  event)

Definition at line 279 of file sch_draw_panel.cpp.

280 {
281  int localkey = event.GetKeyCode();
282  bool keyWasHandled = false;
283 
284  if( localkey == WXK_ESCAPE )
285  {
286  m_abortRequest = true;
287 
289 
290  if( EE_CONDITIONS::Idle( selTool->GetSelection() ) )
292  else
294 
295  keyWasHandled = true; // The key is captured: the key event will be not skipped
296  }
297 
298  /* Normalize keys code to easily handle keys from Ctrl+A to Ctrl+Z
299  * They have an ascii code from 1 to 27 remapped
300  * to GR_KB_CTRL + 'A' to GR_KB_CTRL + 'Z'
301  */
302  if( event.ControlDown() && localkey >= WXK_CONTROL_A && localkey <= WXK_CONTROL_Z )
303  localkey += 'A' - 1;
304 
305  /* Disallow shift for keys that have two keycodes on them (e.g. number and
306  * punctuation keys) leaving only the "letter keys" of A-Z.
307  * Then, you can have, e.g. Ctrl-5 and Ctrl-% (GB layout)
308  * and Ctrl-( and Ctrl-5 (FR layout).
309  * Otherwise, you'd have to have to say Ctrl-Shift-5 on a FR layout
310  */
311  bool keyIsLetter = ( localkey >= 'A' && localkey <= 'Z' ) ||
312  ( localkey >= 'a' && localkey <= 'z' );
313 
314  if( event.ShiftDown() && ( keyIsLetter || localkey > 256 ) )
315  localkey |= GR_KB_SHIFT;
316 
317  if( event.ControlDown() )
318  localkey |= GR_KB_CTRL;
319 
320  if( event.AltDown() )
321  localkey |= GR_KB_ALT;
322 
323 
324  // Some key commands use the current mouse position: refresh it.
325  //pos = wxGetMousePosition() - GetScreenPosition();
326 
327  // Compute the cursor position in drawing units. Also known as logical units to wxDC.
328  //pos = wxPoint( DC.DeviceToLogicalX( pos.x ), DC.DeviceToLogicalY( pos.y ) );
329 
330  auto p = GetViewControls()->GetCursorPosition( false );
331 
332  wxPoint pos ((int)p.x, (int)p.y);
333 
334  GetParent()->SetMousePosition( pos );
335 
336  // a Key event has to be skipped only if it is not handled:
337  if( !GetParent()->GeneralControl( nullptr, pos, localkey ) && !keyWasHandled )
338  event.Skip();
339 }
SELECTION & GetSelection()
Function GetSelection()
#define GR_KB_ALT
bool m_abortRequest
Flag used to abort long commands.
KIGFX::VIEW_CONTROLS * GetViewControls() const
Function GetViewControls() Returns a pointer to the VIEW_CONTROLS instance used in the panel.
virtual EDA_DRAW_FRAME * GetParent() const override
static TOOL_ACTION cancelInteractive
Definition: actions.h:45
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:125
#define GR_KB_CTRL
static SELECTION_CONDITION Idle
TOOL_MANAGER * GetToolManager() const override
Return the tool manager instance, if any.
Definition: draw_frame.h:937
static TOOL_ACTION selectionActivate
Activation of the selection tool.
Definition: ee_actions.h:47
#define GR_KB_SHIFT
void SetMousePosition(const wxPoint &aPosition)
VECTOR2D GetCursorPosition() const
Returns the current cursor position in world coordinates.

References ACTIONS::cancelInteractive, EE_SELECTION_TOOL::GetSelection(), GR_KB_ALT, GR_KB_CTRL, GR_KB_SHIFT, EE_CONDITIONS::Idle, and EE_ACTIONS::selectionActivate.

Referenced by SCH_DRAW_PANEL().

◆ onLostFocus()

void EDA_DRAW_PANEL_GAL::onLostFocus ( wxFocusEvent &  aEvent)
protectedinherited

Definition at line 471 of file draw_panel_gal.cpp.

472 {
473  m_lostFocus = true;
474 
475  aEvent.Skip();
476 }
bool m_lostFocus
Flag to indicate that focus should be regained on the next mouse event.

References EDA_DRAW_PANEL_GAL::m_lostFocus.

Referenced by EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL().

◆ OnMouseEntering()

void EDA_DRAW_PANEL::OnMouseEntering ( wxMouseEvent &  aEvent)
inherited

Definition at line 909 of file eda_draw_panel.cpp.

910 {
911  // This is an ugly hack that fixes some cross hair display bugs when the mouse leaves the
912  // canvas area during middle button mouse panning.
913  if( m_cursorLevel != 0 )
914  m_cursorLevel = 0;
915 
916  aEvent.Skip();
917 }
int m_cursorLevel
Index for cursor redraw in XOR mode.

References EDA_DRAW_PANEL::m_cursorLevel.

◆ OnMouseEvent()

void EDA_DRAW_PANEL::OnMouseEvent ( wxMouseEvent &  event)
inherited

Definition at line 1080 of file eda_draw_panel.cpp.

1081 {
1082  int localbutt = 0;
1083  BASE_SCREEN* screen = GetScreen();
1084 
1085  if( !screen )
1086  return;
1087 
1088  /* Adjust value to filter mouse displacement before consider the drag
1089  * mouse is really a drag command, not just a movement while click
1090  */
1091 #define MIN_DRAG_COUNT_FOR_START_BLOCK_COMMAND 5
1092 
1093  if( event.Leaving() )
1094  m_canStartBlock = -1;
1095 
1096  if( !IsMouseCaptured() ) // No mouse capture in progress.
1097  SetAutoPanRequest( false );
1098 
1099  if( GetParent()->IsActive() )
1100  SetFocus();
1101  else
1102  return;
1103 
1104  if( !event.IsButton() && !event.Moving() && !event.Dragging() )
1105  return;
1106 
1107  if( event.RightDown() )
1108  {
1109  OnRightClick( event );
1110  return;
1111  }
1112 
1113  if( m_ignoreMouseEvents )
1114  return;
1115 
1116  if( event.LeftDown() )
1117  localbutt = GR_M_LEFT_DOWN;
1118 
1119  if( event.ButtonDClick( 1 ) )
1120  localbutt = GR_M_LEFT_DOWN | GR_M_DCLICK;
1121 
1122  if( event.MiddleDown() )
1123  localbutt = GR_M_MIDDLE_DOWN;
1124 
1125  INSTALL_UNBUFFERED_DC( DC, this );
1126  DC.SetBackground( *wxBLACK_BRUSH );
1127 
1128  // Compute the cursor position in drawing (logical) units.
1129  GetParent()->SetMousePosition( event.GetLogicalPosition( DC ) );
1130 
1131  int kbstat = 0;
1132 
1133  if( event.ShiftDown() )
1134  kbstat |= GR_KB_SHIFT;
1135 
1136  if( event.ControlDown() )
1137  kbstat |= GR_KB_CTRL;
1138 
1139  if( event.AltDown() )
1140  kbstat |= GR_KB_ALT;
1141 
1142  // Calling Double Click and Click functions :
1143  if( localbutt == (int) ( GR_M_LEFT_DOWN | GR_M_DCLICK ) )
1144  {
1145  if( m_ClickTimer )
1146  {
1147  m_ClickTimer->Stop();
1148  wxDELETE( m_ClickTimer );
1149  }
1150  GetParent()->OnLeftDClick( &DC, GetParent()->RefPos( true ) );
1151 
1152  // inhibit a response to the mouse left button release,
1153  // because we have a double click, and we do not want a new
1154  // OnLeftClick command at end of this Double Click
1156  }
1157  else if( event.LeftUp() )
1158  {
1159  // A block command is in progress: a left up is the end of block
1160  // or this is the end of a double click, already seen
1161  // Note also m_ignoreNextLeftButtonRelease can be set by
1162  // the call to OnLeftClick(), so do not change it after calling OnLeftClick
1163  bool ignoreEvt = m_ignoreNextLeftButtonRelease;
1165 
1166  if( screen->m_BlockLocate.GetState() == STATE_NO_BLOCK && !ignoreEvt )
1167  {
1168  EDA_ITEM* item = screen->GetCurItem();
1169  m_CursorClickPos = GetParent()->RefPos( true );
1170 
1171  // If we have an item already selected, or we are using a tool,
1172  // we won't use the disambiguation menu so process the click immediately
1173  if( ( item && item->GetEditFlags() ) || GetParent()->GetToolId() != ID_NO_TOOL_SELECTED )
1175  else
1176  {
1177  wxDELETE( m_ClickTimer );
1178  m_ClickTimer = new wxTimer(this, ID_MOUSE_DOUBLECLICK);
1179  m_ClickTimer->StartOnce( m_doubleClickInterval );
1180  }
1181  }
1182 
1183  }
1184  else if( !event.LeftIsDown() )
1185  {
1186  /* be sure there is a response to a left button release command
1187  * even when a LeftUp event is not seen. This happens when a
1188  * double click opens a dialog box, and the release mouse button
1189  * is made when the dialog box is opened.
1190  */
1192  }
1193 
1194  if( event.ButtonDown( wxMOUSE_BTN_MIDDLE ) )
1195  {
1197  m_PanStartEventPosition = event.GetPosition();
1198 
1199  INSTALL_UNBUFFERED_DC( dc, this );
1200  CrossHairOff( &dc );
1201  SetCursor( wxCURSOR_SIZING );
1202  }
1203 
1204  if( event.ButtonUp( wxMOUSE_BTN_MIDDLE ) )
1205  {
1206  INSTALL_UNBUFFERED_DC( dc, this );
1207  CrossHairOn( &dc );
1208  SetCursor( (wxStockCursor) m_currentCursor );
1209  }
1210 
1211  if( event.MiddleIsDown() )
1212  {
1213  wxPoint currentPosition = event.GetPosition();
1214 
1215  double scale = GetParent()->GetScreen()->GetScalingFactor();
1216  int x = m_PanStartCenter.x +
1217  KiROUND( (double) ( m_PanStartEventPosition.x - currentPosition.x ) / scale );
1218  int y = m_PanStartCenter.y +
1219  KiROUND( (double) ( m_PanStartEventPosition.y - currentPosition.y ) / scale );
1220 
1221  GetParent()->RedrawScreen( wxPoint( x, y ), false );
1222  }
1223 
1224  // Calling the general function on mouse changes (and pseudo key commands)
1225  GetParent()->GeneralControl( &DC, event.GetLogicalPosition( DC ), 0 );
1226 
1227  /*******************************/
1228  /* Control of block commands : */
1229  /*******************************/
1230 
1231  // Command block can't start if mouse is dragging a new panel
1232  static EDA_DRAW_PANEL* lastPanel;
1233  if( lastPanel != this )
1234  {
1235  m_minDragEventCount = 0;
1236  m_canStartBlock = -1;
1237  }
1238 
1239  /* A new command block can start after a release buttons
1240  * and if the drag is enough
1241  * This is to avoid a false start block when a dialog box is dismissed,
1242  * or when changing panels in hierarchy navigation
1243  * or when clicking while and moving mouse
1244  */
1245  if( !event.LeftIsDown() && !event.MiddleIsDown() )
1246  {
1247  m_minDragEventCount = 0;
1248  m_canStartBlock = 0;
1249 
1250  /* Remember the last cursor position when a drag mouse starts
1251  * this is the last position ** before ** clicking a button
1252  * this is useful to start a block command from the point where the
1253  * mouse was clicked first
1254  * (a filter creates a delay for the real block command start, and
1255  * we must remember this point)
1256  */
1258  }
1259 
1260  if( m_enableBlockCommands && !(localbutt & GR_M_DCLICK) )
1261  {
1262  if( !screen->IsBlockActive() )
1263  {
1265  }
1266 
1267  if( event.LeftDown() )
1268  {
1269  if( screen->m_BlockLocate.GetState() == STATE_BLOCK_MOVE )
1270  {
1271  SetAutoPanRequest( false );
1272  GetParent()->HandleBlockPlace( &DC );
1274  }
1275  }
1276  else if( ( m_canStartBlock >= 0 ) && event.LeftIsDown() && !IsMouseCaptured() )
1277  {
1278  // Mouse is dragging: if no block in progress, start a block command.
1279  if( screen->m_BlockLocate.GetState() == STATE_NO_BLOCK )
1280  {
1281  // Start a block command
1282  int cmd_type = kbstat;
1283 
1284  // A block command is started if the drag is enough. A small
1285  // drag is ignored (it is certainly a little mouse move when
1286  // clicking) not really a drag mouse
1289  else
1290  {
1291  auto cmd = (GetParent()->GetToolId() == ID_ZOOM_SELECTION) ? BLOCK_ZOOM : 0;
1292 
1293  if( !GetParent()->HandleBlockBegin( &DC, cmd_type, m_CursorStartPos, cmd ) )
1294  {
1295  // should not occur: error
1297  wxT( "EDA_DRAW_PANEL::OnMouseEvent() Block Error" ) );
1298  }
1299  else
1300  {
1301  SetAutoPanRequest( true );
1302  SetCursor( wxCURSOR_SIZING );
1303  }
1304  }
1305  }
1306  }
1307 
1308  if( event.ButtonUp( wxMOUSE_BTN_LEFT ) )
1309  {
1310  /* Release the mouse button: end of block.
1311  * The command can finish (DELETE) or have a next command (MOVE,
1312  * COPY). However the block command is canceled if the block
1313  * size is small because a block command filtering is already
1314  * made, this case happens, but only when the on grid cursor has
1315  * not moved.
1316  */
1317  #define BLOCK_MINSIZE_LIMIT 1
1318  bool BlockIsSmall =
1320  && ( std::abs( screen->m_BlockLocate.GetHeight() ) < BLOCK_MINSIZE_LIMIT );
1321 
1322  if( (screen->m_BlockLocate.GetState() != STATE_NO_BLOCK) && BlockIsSmall )
1323  {
1325  {
1326  m_endMouseCaptureCallback( this, &DC );
1327  SetAutoPanRequest( false );
1328  }
1329 
1330  SetCursor( (wxStockCursor) m_currentCursor );
1331  }
1332  else if( screen->m_BlockLocate.GetState() == STATE_BLOCK_END )
1333  {
1334  SetAutoPanRequest( false );
1335  GetParent()->HandleBlockEnd( &DC );
1336  SetCursor( (wxStockCursor) m_currentCursor );
1337  if( screen->m_BlockLocate.GetState() == STATE_BLOCK_MOVE )
1338  {
1339  SetAutoPanRequest( true );
1340  SetCursor( wxCURSOR_HAND );
1341  }
1342  }
1343  }
1344  }
1345 
1346  // End of block command on a double click
1347  // To avoid an unwanted block move command if the mouse is moved while double clicking
1348  if( localbutt == (int) ( GR_M_LEFT_DOWN | GR_M_DCLICK ) )
1349  {
1350  if( !screen->IsBlockActive() && IsMouseCaptured() )
1351  {
1352  m_endMouseCaptureCallback( this, &DC );
1353  }
1354  }
1355 
1356  lastPanel = this;
1357 
1358 #ifdef __WXGTK3__
1359  // Screen has to be updated on every operation, otherwise the cursor leaves a trail (when xor
1360  // operation is changed to copy) or is not updated at all.
1361  Refresh();
1362 #endif
1363 }
virtual BASE_SCREEN * GetScreen()=0
#define GR_KB_ALT
#define GR_M_DCLICK
Definition: gr_basic.h:77
int m_canStartBlock
useful to avoid false start block in certain cases (like switch from a sheet to another sheet >= 0 (o...
BLOCK_STATE_T GetState() const
BLOCK_SELECTOR m_BlockLocate
Block description for block commands.
Definition: base_screen.h:214
#define GR_M_MIDDLE_DOWN
Definition: gr_basic.h:76
bool IsBlockActive() const
Definition: base_screen.h:499
static int KiROUND(double v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: common.h:118
virtual void HandleBlockPlace(wxDC *DC)
Called after HandleBlockEnd, when a block command needs to be executed after the block is moved to it...
int GetWidth() const
Definition: eda_rect.h:117
END_MOUSE_CAPTURE_CALLBACK m_endMouseCaptureCallback
Abort mouse capture callback function.
#define GR_KB_CTRL
EDA_ITEM * GetCurItem() const
Definition: base_screen.h:233
void SetOrigin(const wxPoint &pos)
Definition: eda_rect.h:124
wxPoint m_PanStartEventPosition
Initial position of mouse event when pan started.
virtual void SetAutoPanRequest(bool aEnable)=0
bool m_enableBlockCommands
True enables block commands.
#define abs(a)
Definition: auxiliary.h:84
virtual EDA_DRAW_FRAME * GetParent() const =0
virtual bool HandleBlockBegin(wxDC *aDC, EDA_KEY aKey, const wxPoint &aPosition, int aExplicitCommand=0)
Initialize a block command.
const wxPoint & GetScrollCenterPosition() const
STATUS_FLAGS GetEditFlags() const
Definition: base_struct.h:263
virtual void CrossHairOn(wxDC *DC=nullptr)
Class BASE_SCREEN handles how to draw a screen (a board, a schematic ...)
Definition: base_screen.h:76
bool m_ignoreMouseEvents
Ignore mouse events when true.
virtual void CrossHairOff(wxDC *DC=nullptr)
#define GR_KB_SHIFT
bool m_ignoreNextLeftButtonRelease
Ignore the next mouse left button release when true.
int GetHeight() const
Definition: eda_rect.h:118
virtual bool HandleBlockEnd(wxDC *DC)
Handle the "end" of a block command, i.e.
wxPoint m_PanStartCenter
Initial scroll center position when pan started.
virtual void RedrawScreen(const wxPoint &aCenterPoint, bool aWarpPointer)
Redraw the entire screen area by updating the scroll bars and mouse pointer in order to have aCenterP...
#define GR_M_LEFT_DOWN
Definition: gr_basic.h:74
wxPoint m_CursorClickPos
Used for maintaining click position.
const int scale
void DisplayToolMsg(const wxString &msg)
void SetMousePosition(const wxPoint &aPosition)
#define MIN_DRAG_COUNT_FOR_START_BLOCK_COMMAND
#define INSTALL_UNBUFFERED_DC(name, parent)
double GetScalingFactor() const
Function GetScalingFactor returns the inverse of the current scale used to draw items on screen.
Definition: base_screen.cpp:95
int m_currentCursor
Current mouse cursor shape id.
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:157
wxPoint RefPos(bool useMouse) const
Return the reference position, coming from either the mouse position or the cursor position.
bool OnRightClick(wxMouseEvent &event)
Function OnRightClick builds and displays a context menu on a right mouse button click.
int m_minDragEventCount
Count the drag events.
wxPoint m_CursorStartPos
Used for testing the cursor movement.
virtual bool GeneralControl(wxDC *aDC, const wxPoint &aPosition, EDA_KEY aHotKey=0)
Perform application specific control using aDC at aPosition in logical units.
Definition: draw_frame.h:635
virtual void OnLeftClick(wxDC *DC, const wxPoint &MousePos)
Definition: draw_frame.h:749
virtual void Refresh(bool eraseBackground=true, const wxRect *rect=NULL)
#define BLOCK_MINSIZE_LIMIT
virtual BASE_SCREEN * GetScreen() const
Return a pointer to a BASE_SCREEN or one of its derivatives.
Definition: draw_frame.h:408
int GetToolId() const
Definition: draw_frame.h:524
wxPoint GetCrossHairPosition(bool aInvertY=false) const
Return the current cross hair position in logical (drawing) coordinates.
virtual void OnLeftDClick(wxDC *DC, const wxPoint &MousePos)
Definition: draw_frame.h:750

References abs, BLOCK_MINSIZE_LIMIT, BLOCK_ZOOM, EDA_DRAW_PANEL::CrossHairOff(), EDA_DRAW_PANEL::CrossHairOn(), EDA_DRAW_FRAME::DisplayToolMsg(), EDA_DRAW_FRAME::GeneralControl(), EDA_DRAW_FRAME::GetCrossHairPosition(), BASE_SCREEN::GetCurItem(), EDA_ITEM::GetEditFlags(), EDA_RECT::GetHeight(), EDA_DRAW_PANEL::GetParent(), BASE_SCREEN::GetScalingFactor(), EDA_DRAW_PANEL::GetScreen(), EDA_DRAW_FRAME::GetScreen(), EDA_DRAW_FRAME::GetScrollCenterPosition(), BLOCK_SELECTOR::GetState(), EDA_DRAW_FRAME::GetToolId(), EDA_RECT::GetWidth(), GR_KB_ALT, GR_KB_CTRL, GR_KB_SHIFT, GR_M_DCLICK, GR_M_LEFT_DOWN, GR_M_MIDDLE_DOWN, EDA_DRAW_FRAME::HandleBlockBegin(), EDA_DRAW_FRAME::HandleBlockEnd(), EDA_DRAW_FRAME::HandleBlockPlace(), ID_MOUSE_DOUBLECLICK, ID_NO_TOOL_SELECTED, ID_ZOOM_SELECTION, INSTALL_UNBUFFERED_DC, BASE_SCREEN::IsBlockActive(), EDA_DRAW_PANEL::IsMouseCaptured(), KiROUND(), BASE_SCREEN::m_BlockLocate, EDA_DRAW_PANEL::m_canStartBlock, EDA_DRAW_PANEL::m_ClickTimer, EDA_DRAW_PANEL::m_currentCursor, EDA_DRAW_PANEL::m_CursorClickPos, EDA_DRAW_PANEL::m_CursorStartPos, EDA_DRAW_PANEL::m_doubleClickInterval, EDA_DRAW_PANEL::m_enableBlockCommands, EDA_DRAW_PANEL::m_endMouseCaptureCallback, EDA_DRAW_PANEL::m_ignoreMouseEvents, EDA_DRAW_PANEL::m_ignoreNextLeftButtonRelease, EDA_DRAW_PANEL::m_minDragEventCount, EDA_DRAW_PANEL::m_PanStartCenter, EDA_DRAW_PANEL::m_PanStartEventPosition, MIN_DRAG_COUNT_FOR_START_BLOCK_COMMAND, EDA_DRAW_FRAME::OnLeftClick(), EDA_DRAW_FRAME::OnLeftDClick(), EDA_DRAW_PANEL::OnRightClick(), EDA_DRAW_FRAME::RedrawScreen(), EDA_DRAW_FRAME::RefPos(), EDA_DRAW_PANEL::Refresh(), scale, EDA_DRAW_PANEL::SetAutoPanRequest(), EDA_DRAW_FRAME::SetMousePosition(), EDA_RECT::SetOrigin(), STATE_BLOCK_END, STATE_BLOCK_MOVE, and STATE_NO_BLOCK.

◆ OnMouseLeaving()

void EDA_DRAW_PANEL::OnMouseLeaving ( wxMouseEvent &  event)
inherited

Definition at line 920 of file eda_draw_panel.cpp.

921 {
922  if( m_mouseCaptureCallback == NULL ) // No command in progress.
923  SetAutoPanRequest( false );
924 
926  return;
927 
928  // Auto pan when mouse has left the client window
929  // Ensure the cross_hair position is updated,
930  // because it will be used to center the screen.
931  // We use a position inside the client window
932  wxRect area( wxPoint( 0, 0 ), GetClientSize() );
933  wxPoint cross_hair_pos = event.GetPosition();
934 
935  // Certain window managers (e.g. awesome wm) incorrectly trigger "on leave" event,
936  // therefore test if the cursor has really left the panel area
937  if( !area.Contains( cross_hair_pos ) )
938  {
939  INSTALL_UNBUFFERED_DC( dc, this );
940  cross_hair_pos.x = dc.DeviceToLogicalX( cross_hair_pos.x );
941  cross_hair_pos.y = dc.DeviceToLogicalY( cross_hair_pos.y );
942 
943  GetParent()->SetCrossHairPosition( cross_hair_pos );
944 
945  wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED, ID_POPUP_ZOOM_CENTER );
946  cmd.SetEventObject( this );
947  GetEventHandler()->ProcessEvent( cmd );
948  }
949 
950  event.Skip();
951 }
bool m_requestAutoPan
true to request an auto pan. Valid only when m_enableAutoPan = true.
virtual void SetAutoPanRequest(bool aEnable)=0
MOUSE_CAPTURE_CALLBACK m_mouseCaptureCallback
Mouse capture move callback function.
virtual EDA_DRAW_FRAME * GetParent() const =0
bool m_ignoreMouseEvents
Ignore mouse events when true.
#define INSTALL_UNBUFFERED_DC(name, parent)
bool m_enableAutoPan
True to enable automatic panning.
void SetCrossHairPosition(const wxPoint &aPosition, bool aSnapToGrid=true)
Set the screen cross hair position to aPosition in logical (drawing) units.

References EDA_DRAW_PANEL::GetParent(), ID_POPUP_ZOOM_CENTER, INSTALL_UNBUFFERED_DC, EDA_DRAW_PANEL::m_enableAutoPan, EDA_DRAW_PANEL::m_ignoreMouseEvents, EDA_DRAW_PANEL::m_mouseCaptureCallback, EDA_DRAW_PANEL::m_requestAutoPan, EDA_DRAW_PANEL::SetAutoPanRequest(), and EDA_DRAW_FRAME::SetCrossHairPosition().

◆ OnMouseWheel()

void EDA_DRAW_PANEL::OnMouseWheel ( wxMouseEvent &  event)
inherited

Function OnMouseWheel handles mouse wheel events.

The mouse wheel is used to provide support for zooming and panning. This is accomplished by converting mouse wheel events in pseudo menu command events and sending them to the appropriate parent window event handler.

Definition at line 954 of file eda_draw_panel.cpp.

955 {
956  if( m_ignoreMouseEvents )
957  return;
958 
959  wxRect rect = wxRect( wxPoint( 0, 0 ), GetClientSize() );
960 
961  // Ignore scroll events if the cursor is outside the drawing area.
962  if( event.GetWheelRotation() == 0 || !GetParent()->IsEnabled()
963  || !rect.Contains( event.GetPosition() ) )
964  {
965  wxLogTrace( kicadTraceCoords,
966  wxT( "OnMouseWheel() position(%d, %d) rectangle(%d, %d, %d, %d)" ),
967  event.GetPosition().x, event.GetPosition().y,
968  rect.x, rect.y, rect.width, rect.height );
969  event.Skip();
970  return;
971  }
972 
973  INSTALL_UNBUFFERED_DC( dc, this );
974  GetParent()->SetCrossHairPosition( event.GetLogicalPosition( dc ) );
975 
976  wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
977  cmd.SetEventObject( this );
978 
979  bool offCenterReq = event.ControlDown() && event.ShiftDown();
980  offCenterReq = offCenterReq || m_enableZoomNoCenter;
981 
982  int axis = event.GetWheelAxis();
983  int wheelRotation = event.GetWheelRotation();
984 
986  {
987  // MousewheelPAN + Ctrl = zooming
988  if( event.ControlDown() && !event.ShiftDown() )
989  {
990  if( wheelRotation > 0 )
991  cmd.SetId( ID_POPUP_ZOOM_IN );
992  else if( wheelRotation < 0)
993  cmd.SetId( ID_POPUP_ZOOM_OUT );
994  }
995  // MousewheelPAN + Shift = horizontal scrolling
996  // Without modifiers MousewheelPAN - just pan
997  else
998  {
999  if( event.ShiftDown() && !event.ControlDown() )
1000  axis = wxMOUSE_WHEEL_HORIZONTAL;
1001 
1002  wxPoint newStart = GetViewStart();
1003  wxPoint center = GetParent()->GetScrollCenterPosition();
1004  double scale = GetParent()->GetScreen()->GetScalingFactor();
1005 
1006  if( axis == wxMOUSE_WHEEL_HORIZONTAL )
1007  {
1008  newStart.x += wheelRotation;
1009  center.x += KiROUND( (double) wheelRotation / scale );
1010  }
1011  else
1012  {
1013  newStart.y -= wheelRotation;
1014  center.y -= KiROUND( (double) wheelRotation / scale );
1015  }
1016  Scroll( newStart );
1017 
1018  GetParent()->SetScrollCenterPosition( center );
1019  GetParent()->SetCrossHairPosition( center, true );
1020  GetParent()->RedrawScreen( center, false );
1021  }
1022  }
1023  else if( wheelRotation > 0 )
1024  {
1025  if( event.ShiftDown() && !event.ControlDown() )
1026  cmd.SetId( ID_PAN_UP );
1027  else if( event.ControlDown() && !event.ShiftDown() )
1028  cmd.SetId( ID_PAN_LEFT );
1029  else if( offCenterReq )
1030  cmd.SetId( ID_OFFCENTER_ZOOM_IN );
1031  else
1032  cmd.SetId( ID_POPUP_ZOOM_IN );
1033  }
1034  else if( wheelRotation < 0 )
1035  {
1036  if( event.ShiftDown() && !event.ControlDown() )
1037  cmd.SetId( ID_PAN_DOWN );
1038  else if( event.ControlDown() && !event.ShiftDown() )
1039  cmd.SetId( ID_PAN_RIGHT );
1040  else if( offCenterReq )
1041  cmd.SetId( ID_OFFCENTER_ZOOM_OUT );
1042  else
1043  cmd.SetId( ID_POPUP_ZOOM_OUT );
1044  }
1045 
1046  if( cmd.GetId() )
1047  GetEventHandler()->ProcessEvent( cmd );
1048  event.Skip();
1049 }
static int KiROUND(double v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: common.h:118
bool m_enableZoomNoCenter
True to enable zooming around the crosshair instead of the center.
void SetScrollCenterPosition(const wxPoint &aPoint)
virtual EDA_DRAW_FRAME * GetParent() const =0
const wxPoint & GetScrollCenterPosition() const
bool m_ignoreMouseEvents
Ignore mouse events when true.
virtual void RedrawScreen(const wxPoint &aCenterPoint, bool aWarpPointer)
Redraw the entire screen area by updating the scroll bars and mouse pointer in order to have aCenterP...
const int scale
bool m_enableMousewheelPan
True to enable mousewheel panning by default.
#define INSTALL_UNBUFFERED_DC(name, parent)
double GetScalingFactor() const
Function GetScalingFactor returns the inverse of the current scale used to draw items on screen.
Definition: base_screen.cpp:95
Definition: id.h:249
void SetCrossHairPosition(const wxPoint &aPosition, bool aSnapToGrid=true)
Set the screen cross hair position to aPosition in logical (drawing) units.
const wxChar *const kicadTraceCoords
Flag to enable draw panel coordinate debug tracing.
virtual BASE_SCREEN * GetScreen() const
Return a pointer to a BASE_SCREEN or one of its derivatives.
Definition: draw_frame.h:408

References EDA_DRAW_PANEL::GetParent(), BASE_SCREEN::GetScalingFactor(), EDA_DRAW_FRAME::GetScreen(), EDA_DRAW_FRAME::GetScrollCenterPosition(), ID_OFFCENTER_ZOOM_IN, ID_OFFCENTER_ZOOM_OUT, ID_PAN_DOWN, ID_PAN_LEFT, ID_PAN_RIGHT, ID_PAN_UP, ID_POPUP_ZOOM_IN, ID_POPUP_ZOOM_OUT, INSTALL_UNBUFFERED_DC, kicadTraceCoords, KiROUND(), EDA_DRAW_PANEL::m_enableMousewheelPan, EDA_DRAW_PANEL::m_enableZoomNoCenter, EDA_DRAW_PANEL::m_ignoreMouseEvents, EDA_DRAW_FRAME::RedrawScreen(), scale, EDA_DRAW_FRAME::SetCrossHairPosition(), and EDA_DRAW_FRAME::SetScrollCenterPosition().

◆ onPaint()

void SCH_DRAW_PANEL::onPaint ( wxPaintEvent &  WXUNUSEDaEvent)
overrideprotectedvirtual

Reimplemented from EDA_DRAW_PANEL_GAL.

Definition at line 342 of file sch_draw_panel.cpp.

343 {
344  if( !m_gal->IsInitialized() || !m_gal->IsVisible() )
345  // The first wxPaintEvent can be fired at startup before the GAL engine is fully initialized
346  // (depending on platforms). Do nothing in this case
347  return;
348 
349  if( m_painter )
350  static_cast<KIGFX::SCH_PAINTER*>(m_painter.get())->GetSettings()->ImportLegacyColors( nullptr );
351 
352  EDA_DRAW_PANEL_GAL::onPaint( aEvent );
353 }
KIGFX::GAL * m_gal
Interface for drawing objects on a 2D-surface.
virtual void onPaint(wxPaintEvent &WXUNUSED(aEvent))
std::unique_ptr< KIGFX::PAINTER > m_painter
Contains information about how to draw items using GAL.
virtual bool IsVisible() const
Returns true if the GAL canvas is visible on the screen.
virtual bool IsInitialized() const
Returns the initalization status for the canvas.

References EDA_DRAW_PANEL_GAL::onPaint().

◆ OnPaint()

void EDA_DRAW_PANEL::OnPaint ( wxPaintEvent &  event)
inherited

Definition at line 595 of file eda_draw_panel.cpp.

596 {
597  if( GetScreen() == NULL )
598  {
599  event.Skip();
600  return;
601  }
602 
603  INSTALL_PAINTDC( paintDC, this );
604 
605  wxRect region = GetUpdateRegion().GetBox();
606  SetClipBox( paintDC, &region );
607  ReDraw( &paintDC, true );
608 }
virtual BASE_SCREEN * GetScreen()=0
#define INSTALL_PAINTDC(name, parent)
void SetClipBox(const EDA_RECT &aRect)
virtual void ReDraw(wxDC *aDC, bool aEraseBackground=true)

References EDA_DRAW_PANEL::GetScreen(), INSTALL_PAINTDC, EDA_DRAW_PANEL::ReDraw(), and EDA_DRAW_PANEL::SetClipBox().

◆ OnPan()

void EDA_DRAW_PANEL::OnPan ( wxCommandEvent &  event)
inherited

Definition at line 1440 of file eda_draw_panel.cpp.

1441 {
1442  int x, y;
1443  int ppux, ppuy;
1444  int unitsX, unitsY;
1445  int maxX, maxY;
1446  int tmpX, tmpY;
1447 
1448  GetViewStart( &x, &y );
1449  GetScrollPixelsPerUnit( &ppux, &ppuy );
1450  GetVirtualSize( &unitsX, &unitsY );
1451  tmpX = x;
1452  tmpY = y;
1453  maxX = unitsX;
1454  maxY = unitsY;
1455  unitsX /= ppux;
1456  unitsY /= ppuy;
1457 
1458  wxLogTrace( kicadTraceCoords,
1459  wxT( "Scroll center position before pan: (%d, %d)" ), tmpX, tmpY );
1460 
1461  switch( event.GetId() )
1462  {
1463  case ID_PAN_UP:
1464  y -= m_scrollIncrementY;
1465  break;
1466 
1467  case ID_PAN_DOWN:
1468  y += m_scrollIncrementY;
1469  break;
1470 
1471  case ID_PAN_LEFT:
1472  x -= m_scrollIncrementX;
1473  break;
1474 
1475  case ID_PAN_RIGHT:
1476  x += m_scrollIncrementX;
1477  break;
1478 
1479  default:
1480  wxLogDebug( wxT( "Unknown ID %d in EDA_DRAW_PANEL::OnPan()." ), event.GetId() );
1481  }
1482 
1483  bool updateCenterScrollPos = true;
1484 
1485  if( x < 0 )
1486  {
1487  x = 0;
1488  updateCenterScrollPos = false;
1489  }
1490 
1491  if( y < 0 )
1492  {
1493  y = 0;
1494  updateCenterScrollPos = false;
1495  }
1496 
1497  if( x > maxX )
1498  {
1499  x = maxX;
1500  updateCenterScrollPos = false;
1501  }
1502 
1503  if( y > maxY )
1504  {
1505  y = maxY;
1506  updateCenterScrollPos = false;
1507  }
1508 
1509  // Don't update the scroll position beyond the scroll limits.
1510  if( updateCenterScrollPos )
1511  {
1512  double scale = GetParent()->GetScreen()->GetScalingFactor();
1513 
1514  wxPoint center = GetParent()->GetScrollCenterPosition();
1515  center.x += KiROUND( (double) ( x - tmpX ) / scale );
1516  center.y += KiROUND( (double) ( y - tmpY ) / scale );
1517  GetParent()->SetScrollCenterPosition( center );
1518 
1519  wxLogTrace( kicadTraceCoords,
1520  wxT( "Scroll center position after pan: (%d, %d)" ), center.x, center.y );
1521  }
1522 
1523  Scroll( x/ppux, y/ppuy );
1524 }
static int KiROUND(double v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: common.h:118
int m_scrollIncrementX
X axis scroll increment in pixels per unit.
void SetScrollCenterPosition(const wxPoint &aPoint)
virtual EDA_DRAW_FRAME * GetParent() const =0
const wxPoint & GetScrollCenterPosition() const
const int scale
double GetScalingFactor() const
Function GetScalingFactor returns the inverse of the current scale used to draw items on screen.
Definition: base_screen.cpp:95
Definition: id.h:249
const wxChar *const kicadTraceCoords
Flag to enable draw panel coordinate debug tracing.
virtual BASE_SCREEN * GetScreen() const
Return a pointer to a BASE_SCREEN or one of its derivatives.
Definition: draw_frame.h:408
int m_scrollIncrementY
Y axis scroll increment in pixels per unit.

References EDA_DRAW_PANEL::GetParent(), BASE_SCREEN::GetScalingFactor(), EDA_DRAW_FRAME::GetScreen(), EDA_DRAW_FRAME::GetScrollCenterPosition(), ID_PAN_DOWN, ID_PAN_LEFT, ID_PAN_RIGHT, ID_PAN_UP, kicadTraceCoords, KiROUND(), EDA_DRAW_PANEL::m_scrollIncrementX, EDA_DRAW_PANEL::m_scrollIncrementY, scale, and EDA_DRAW_FRAME::SetScrollCenterPosition().

◆ onRefreshTimer()

void EDA_DRAW_PANEL_GAL::onRefreshTimer ( wxTimerEvent &  aEvent)
protectedinherited

Definition at line 479 of file draw_panel_gal.cpp.

480 {
481  if( !m_drawingEnabled )
482  {
483  if( m_gal && m_gal->IsInitialized() )
484  {
485  m_drawing = false;
486  m_pendingRefresh = true;
487  Connect( wxEVT_PAINT, wxPaintEventHandler( EDA_DRAW_PANEL_GAL::onPaint ), NULL, this );
488  m_drawingEnabled = true;
489  }
490  else
491  {
492  // Try again soon
493  m_refreshTimer.StartOnce( 100 );
494  return;
495  }
496  }
497 
498  wxPaintEvent redrawEvent;
499  wxPostEvent( this, redrawEvent );
500 }
bool m_pendingRefresh
Is there a redraw event requested?
wxTimer m_refreshTimer
Timer responsible for preventing too frequent refresh.
KIGFX::GAL * m_gal
Interface for drawing objects on a 2D-surface.
bool m_drawing
True if GAL is currently redrawing the view.
virtual void onPaint(wxPaintEvent &WXUNUSED(aEvent))
bool m_drawingEnabled
Flag that determines if VIEW may use GAL for redrawing the screen.
virtual bool IsInitialized() const
Returns the initalization status for the canvas.

References KIGFX::GAL::IsInitialized(), EDA_DRAW_PANEL_GAL::m_drawing, EDA_DRAW_PANEL_GAL::m_drawingEnabled, EDA_DRAW_PANEL_GAL::m_gal, EDA_DRAW_PANEL_GAL::m_pendingRefresh, EDA_DRAW_PANEL_GAL::m_refreshTimer, and EDA_DRAW_PANEL_GAL::onPaint().

Referenced by EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL().

◆ OnRightClick()

bool EDA_DRAW_PANEL::OnRightClick ( wxMouseEvent &  event)
inherited

Function OnRightClick builds and displays a context menu on a right mouse button click.

Returns
true if the context menu is shown, or false

Definition at line 882 of file eda_draw_panel.cpp.

883 {
884  wxPoint pos;
885  wxMenu MasterMenu;
886 
887  INSTALL_UNBUFFERED_DC( dc, this );
888 
889  pos = event.GetLogicalPosition( dc );
890 
891  if( !GetParent()->OnRightClick( pos, &MasterMenu ) )
892  return false;
893 
894  GetParent()->AddMenuZoomAndGrid( &MasterMenu );
895 
896  pos = event.GetPosition();
897  m_ignoreMouseEvents = true;
898  PopupMenu( &MasterMenu, pos );
899 
900  // The ZoomAndGrid menu is only invoked over empty space so there's no point in warping
901  // the cursor back to the crosshair, and it's very annoying if one clicked out of the menu.
902 
903  m_ignoreMouseEvents = false;
904 
905  return true;
906 }
virtual EDA_DRAW_FRAME * GetParent() const =0
bool m_ignoreMouseEvents
Ignore mouse events when true.
#define INSTALL_UNBUFFERED_DC(name, parent)
bool OnRightClick(wxMouseEvent &event)
Function OnRightClick builds and displays a context menu on a right mouse button click.
virtual void AddMenuZoomAndGrid(wxMenu *aMasterMenu)
Add standard zoom commands and submenu zoom and grid selection to a popup menu uses zoom hotkeys info...

References EDA_DRAW_FRAME::AddMenuZoomAndGrid(), EDA_DRAW_PANEL::GetParent(), INSTALL_UNBUFFERED_DC, and EDA_DRAW_PANEL::m_ignoreMouseEvents.

Referenced by EDA_DRAW_PANEL::OnMouseEvent().

◆ OnScroll()

void EDA_DRAW_PANEL::OnScroll ( wxScrollWinEvent &  event)
inherited

Definition at line 411 of file eda_draw_panel.cpp.

412 {
413  int id = event.GetEventType();
414  int x, y;
415  int ppux, ppuy;
416  int csizeX, csizeY;
417  int unitsX, unitsY;
418 
419  GetViewStart( &x, &y );
420  GetScrollPixelsPerUnit( &ppux, &ppuy );
421  GetClientSize( &csizeX, &csizeY );
422  GetVirtualSize( &unitsX, &unitsY );
423 
424  int tmpX = x;
425  int tmpY = y;
426 
427  csizeX /= ppux;
428  csizeY /= ppuy;
429 
430  unitsX /= ppux;
431  unitsY /= ppuy;
432 
433  int dir = event.GetOrientation(); // wxHORIZONTAL or wxVERTICAL
434 
435  // On windows and on wxWidgets >= 2.9.5 and < 3.1,
436  // there is a bug in mousewheel event which always generates 2 scroll events
437  // (should be the case only for the default mousewheel event)
438  // with id = wxEVT_SCROLLWIN_LINEUP or wxEVT_SCROLLWIN_LINEDOWN
439  // so we skip these events.
440  // Note they are here just in case, because they are not actually used
441  // in Kicad
442 #if wxCHECK_VERSION( 3, 1, 0 ) || !wxCHECK_VERSION( 2, 9, 5 ) || ( !defined (__WINDOWS__) && !defined (__WXMAC__) )
443  int maxX = unitsX - csizeX;
444  int maxY = unitsY - csizeY;
445 
446  if( id == wxEVT_SCROLLWIN_LINEUP )
447  {
448  if( dir == wxHORIZONTAL )
449  {
450  x -= m_scrollIncrementX;
451 
452  if( x < 0 )
453  x = 0;
454  }
455  else
456  {
457  y -= m_scrollIncrementY;
458 
459  if( y < 0 )
460  y = 0;
461  }
462  }
463  else if( id == wxEVT_SCROLLWIN_LINEDOWN )
464  {
465  if( dir == wxHORIZONTAL )
466  {
467  x += m_scrollIncrementX;
468  if( x > maxX )
469  x = maxX;
470  }
471  else
472  {
473  y += m_scrollIncrementY;
474 
475  if( y > maxY )
476  y = maxY;
477  }
478  }
479  else
480 #endif
481  if( id == wxEVT_SCROLLWIN_THUMBTRACK )
482  {
483  if( dir == wxHORIZONTAL )
484  x = event.GetPosition();
485  else
486  y = event.GetPosition();
487  }
488  else
489  {
490  event.Skip();
491  return;
492  }
493 
494  wxLogTrace( kicadTraceCoords,
495  wxT( "Setting scroll bars ppuX=%d, ppuY=%d, unitsX=%d, unitsY=%d, posX=%d, posY=%d" ),
496  ppux, ppuy, unitsX, unitsY, x, y );
497 
498  double scale = GetParent()->GetScreen()->GetScalingFactor();
499 
500  wxPoint center = GetParent()->GetScrollCenterPosition();
501  center.x += KiROUND( (double) ( x - tmpX ) / scale );
502  center.y += KiROUND( (double) ( y - tmpY ) / scale );
503  GetParent()->SetScrollCenterPosition( center );
504 
505  Scroll( x, y );
506  event.Skip();
507 }
static int KiROUND(double v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: common.h:118
int m_scrollIncrementX
X axis scroll increment in pixels per unit.
void SetScrollCenterPosition(const wxPoint &aPoint)
virtual EDA_DRAW_FRAME * GetParent() const =0
const wxPoint & GetScrollCenterPosition() const
const int scale
double GetScalingFactor() const
Function GetScalingFactor returns the inverse of the current scale used to draw items on screen.
Definition: base_screen.cpp:95
const wxChar *const kicadTraceCoords
Flag to enable draw panel coordinate debug tracing.
virtual BASE_SCREEN * GetScreen() const
Return a pointer to a BASE_SCREEN or one of its derivatives.
Definition: draw_frame.h:408
int m_scrollIncrementY
Y axis scroll increment in pixels per unit.

References EDA_DRAW_PANEL::GetParent(), BASE_SCREEN::GetScalingFactor(), EDA_DRAW_FRAME::GetScreen(), EDA_DRAW_FRAME::GetScrollCenterPosition(), kicadTraceCoords, KiROUND(), EDA_DRAW_PANEL::m_scrollIncrementX, EDA_DRAW_PANEL::m_scrollIncrementY, scale, and EDA_DRAW_FRAME::SetScrollCenterPosition().

◆ OnScrollWin()

void EDA_DRAW_PANEL::OnScrollWin ( wxCommandEvent &  event)
inherited

◆ OnShow()

virtual void EDA_DRAW_PANEL_GAL::OnShow ( )
inlinevirtualinherited

Function OnShow() Called when the window is shown for the first time.

Reimplemented in PCB_DRAW_PANEL_GAL, SCH_PREVIEW_PANEL, and GERBVIEW_DRAW_PANEL_GAL.

Definition at line 188 of file class_draw_panel_gal.h.

188 {}

Referenced by EDA_DRAW_PANEL_GAL::onShowTimer().

◆ onShowTimer()

void EDA_DRAW_PANEL_GAL::onShowTimer ( wxTimerEvent &  aEvent)
protectedinherited

Definition at line 503 of file draw_panel_gal.cpp.

504 {
505  if( m_gal && m_gal->IsVisible() )
506  {
507  m_onShowTimer.Stop();
508  OnShow();
509  }
510 }
KIGFX::GAL * m_gal
Interface for drawing objects on a 2D-surface.
virtual void OnShow()
Function OnShow() Called when the window is shown for the first time.
wxTimer m_onShowTimer
Timer used to execute OnShow() when the window finally appears on the screen.
virtual bool IsVisible() const
Returns true if the GAL canvas is visible on the screen.

References KIGFX::GAL::IsVisible(), EDA_DRAW_PANEL_GAL::m_gal, EDA_DRAW_PANEL_GAL::m_onShowTimer, and EDA_DRAW_PANEL_GAL::OnShow().

Referenced by EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL().

◆ onSize()

void EDA_DRAW_PANEL_GAL::onSize ( wxSizeEvent &  aEvent)
protectedinherited

Definition at line 242 of file draw_panel_gal.cpp.

243 {
245  wxSize clientSize = GetClientSize();
246  m_gal->ResizeScreen( clientSize.x, clientSize.y );
247 
248  if( m_view )
249  {
252  }
253 }
KIGFX::GAL * m_gal
Interface for drawing objects on a 2D-surface.
Auxiliary rendering target (noncached)
Definition: definitions.h:49
void MarkTargetDirty(int aTarget)
Function MarkTargetDirty() Sets or clears target 'dirty' flag.
Definition: view.h:596
virtual void ResizeScreen(int aWidth, int aHeight)
Resizes the canvas.
Main rendering target (cached)
Definition: definitions.h:48
KIGFX::VIEW * m_view
Stores view settings (scale, center, etc.) and items to be drawn.

References EDA_DRAW_PANEL_GAL::m_gal, EDA_DRAW_PANEL_GAL::m_view, KIGFX::VIEW::MarkTargetDirty(), KIGFX::GAL::ResizeScreen(), KIGFX::TARGET_CACHED, and KIGFX::TARGET_NONCACHED.

Referenced by EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL().

◆ OnTimer()

void EDA_DRAW_PANEL::OnTimer ( wxTimerEvent &  event)
inherited

Function OnTimer handle timer events.

The class will start a timer when a mouse-up event is handled. If a double-click event is not handled inside of a specified interval, the timer event will fire, causing the single-click event to be handled. Otherwise, the system will process the double-click.

Definition at line 403 of file eda_draw_panel.cpp.

404 {
405  INSTALL_UNBUFFERED_DC( DC, this );
406  DC.SetBackground( *wxBLACK_BRUSH );
408 }
virtual EDA_DRAW_FRAME * GetParent() const =0
wxPoint m_CursorClickPos
Used for maintaining click position.
#define INSTALL_UNBUFFERED_DC(name, parent)
virtual void OnLeftClick(wxDC *DC, const wxPoint &MousePos)
Definition: draw_frame.h:749

References EDA_DRAW_PANEL::GetParent(), INSTALL_UNBUFFERED_DC, EDA_DRAW_PANEL::m_CursorClickPos, and EDA_DRAW_FRAME::OnLeftClick().

◆ ReDraw() [1/2]

void EDA_DRAW_PANEL::ReDraw ( wxDC *  aDC,
bool  aEraseBackground = true 
)
inlinevirtualinherited

Definition at line 253 of file legacy_gal/class_drawpanel.h.

253 { printf("EDA_DRAW_PANEL:Unimplemented11\n"); };;

Referenced by EDA_DRAW_PANEL::OnPaint().

◆ ReDraw() [2/2]

void EDA_DRAW_PANEL::ReDraw ( wxDC *  aDC,
bool  aEraseBackground = true 
)
inherited

◆ Refresh()

void SCH_DRAW_PANEL::Refresh ( bool  aEraseBackground = true,
const wxRect *  aRect = NULL 
)
overridevirtual

Update the board display after modifying it by a python script (note: it is automatically called by action plugins, after running the plugin, so call this function is usually not needed inside action plugins.

Could be deprecated because modifying a board (especially deleting items) outside a action plugin can crash Pcbnew.

Reimplemented from EDA_DRAW_PANEL_GAL.

Definition at line 267 of file sch_draw_panel.cpp.

268 {
269  EDA_DRAW_PANEL_GAL::Refresh( aEraseBackground, aRect );
270 }
virtual 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...

References EDA_DRAW_PANEL_GAL::Refresh().

Referenced by SCH_EDIT_FRAME::AddItemToScreenAndUndoList(), SCH_EDIT_FRAME::AnnotateComponents(), SCH_EDIT_FRAME::backAnnotateFootprints(), SCH_EDIT_TOOL::BreakWire(), SCH_EDIT_FRAME::DeleteAnnotation(), SCH_EDIT_TOOL::DoDelete(), EE_SELECTION_TOOL::doSelectionMenu(), SCH_EDIT_FRAME::EditComponent(), LIB_EDIT_TOOL::editFieldProperties(), LIB_EDIT_TOOL::editGraphicProperties(), LIB_EDIT_TOOL::editTextProperties(), SCH_EDIT_FRAME::ExecuteRemoteCommand(), SCH_EDIT_FRAME::FindComponentAndItem(), SCH_EDIT_FRAME::KiwayMailIn(), SCH_EDIT_FRAME::LoadCmpToFootprintLinkFile(), EE_POINT_EDITOR::Main(), DIALOG_MIGRATE_BUSES::onAcceptClicked(), DIALOG_EDIT_COMPONENTS_LIBID::onApplyButton(), DIALOG_ANNOTATE::OnApplyClick(), DIALOG_ERC::OnEraseDrcMarkersClick(), DIALOG_SYMBOL_REMAP::OnRemapSymbols(), DIALOG_FIELDS_EDITOR_GLOBAL::OnTableCellClick(), SCH_EDIT_TOOL::Properties(), LIB_EDIT_FRAME::RebuildView(), SCH_EDITOR_CONTROL::Redo(), DIALOG_ERC::RedrawDrawPanel(), SCH_BASE_FRAME::RedrawScreen(), SCH_BASE_FRAME::RefreshItem(), SCH_EDIT_FRAME::rescueProject(), DIALOG_EDIT_COMPONENTS_LIBID::revertChanges(), SCH_EDIT_FRAME::RollbackSchematicFromUndo(), LIB_VIEW_FRAME::SetUnitAndConvert(), LIB_CONTROL::ShowElectricalTypes(), DIALOG_ERC::TestErc(), SCH_EDITOR_CONTROL::ToggleHiddenPins(), PANEL_LIBEDIT_SETTINGS::TransferDataFromWindow(), PANEL_LIBEDIT_DISPLAY_OPTIONS::TransferDataFromWindow(), PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataFromWindow(), DIALOG_EDIT_LINE_STYLE::TransferDataFromWindow(), DIALOG_UPDATE_FIELDS::TransferDataFromWindow(), DIALOG_SCH_EDIT_SHEET_PIN::TransferDataFromWindow(), DIALOG_LABEL_EDITOR::TransferDataFromWindow(), SCH_EDITOR_CONTROL::Undo(), and DIALOG_FIELDS_EDITOR_GLOBAL::~DIALOG_FIELDS_EDITOR_GLOBAL().

◆ RefreshDrawingRect() [1/2]

void EDA_DRAW_PANEL::RefreshDrawingRect ( const EDA_RECT aRect,
bool  aEraseBackground = true 
)
inlinevirtualinherited

Function RefreshDrawingRect redraws the contents of aRect in drawing units.

aRect is converted to screen coordinates and wxWindow::RefreshRect() is called to repaint the region.

Parameters
aRectThe rectangle to repaint.
aEraseBackgroundErases the background if true.

Definition at line 262 of file legacy_gal/class_drawpanel.h.

262 { printf("EDA_DRAW_PANEL:Unimplemented12\n"); };;

Referenced by AbortMoveTextModule(), PCB_BASE_FRAME::AddPad(), PCB_EDIT_FRAME::Change_Side_Module(), PCB_EDIT_FRAME::Delete_net(), PCB_EDIT_FRAME::Delete_Segment(), PCB_EDIT_FRAME::Delete_Zone_Contour(), PCB_BASE_FRAME::DeletePad(), PCB_BASE_FRAME::DeleteTextModule(), PCB_BASE_FRAME::DoPushPadProperties(), PCB_BASE_FRAME::Import_Pad_Settings(), PCB_BASE_FRAME::PlaceTexteModule(), PCB_EDIT_FRAME::Remove_One_Track(), PCB_EDIT_FRAME::Remove_Zone_Corner(), PCB_BASE_FRAME::Rotate_Module(), PCB_EDIT_FRAME::StartMoveModule(), and DIALOG_PAD_PROPERTIES::TransferDataFromWindow().

◆ RefreshDrawingRect() [2/2]

void EDA_DRAW_PANEL::RefreshDrawingRect ( const EDA_RECT aRect,
bool  aEraseBackground = true 
)
inherited

Function RefreshDrawingRect redraws the contents of aRect in drawing units.

aRect is converted to screen coordinates and wxWindow::RefreshRect() is called to repaint the region.

Parameters
aRectThe rectangle to repaint.
aEraseBackgroundErases the background if true.

◆ SetAbortRequest() [1/2]

void EDA_DRAW_PANEL::SetAbortRequest ( bool  aAbortRequest)
inlineinherited

◆ SetAbortRequest() [2/2]

void EDA_DRAW_PANEL::SetAbortRequest ( bool  aAbortRequest)
inlineinherited

Definition at line 145 of file legacy_wx/class_drawpanel.h.

145 { m_abortRequest = aAbortRequest; }
bool m_abortRequest
Flag used to abort long commands.

References EDA_DRAW_PANEL::m_abortRequest.

◆ SetAutoPanRequest()

void SCH_DRAW_PANEL::SetAutoPanRequest ( bool  aEnable)
overridevirtual

Implements EDA_DRAW_PANEL.

Definition at line 194 of file sch_draw_panel.cpp.

195 {
196  wxCHECK( GetParent()->IsGalCanvasActive(), /*void*/ );
197  GetParent()->GetGalCanvas()->GetViewControls()->SetAutoPan( aEnable );
198 }
KIGFX::VIEW_CONTROLS * GetViewControls() const
Function GetViewControls() Returns a pointer to the VIEW_CONTROLS instance used in the panel.
virtual EDA_DRAW_FRAME * GetParent() const override
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:931
virtual void SetAutoPan(bool aEnabled)
Function SetAutoPan Turns on/off auto panning (this feature is used when there is a tool active (eg.

◆ SetCanStartBlock() [1/2]

void EDA_DRAW_PANEL::SetCanStartBlock ( int  aStartBlock)
inlineinherited

Definition at line 153 of file legacy_gal/class_drawpanel.h.

153 { m_canStartBlock = aStartBlock; }
int m_canStartBlock
useful to avoid false start block in certain cases (like switch from a sheet to another sheet >= 0 (o...

References EDA_DRAW_PANEL::m_canStartBlock.

Referenced by SCH_EDIT_FRAME::DisplayCurrentSheet(), GERBVIEW_FRAME::OnRightClick(), and PCB_EDIT_FRAME::OnRightClick().

◆ SetCanStartBlock() [2/2]

void EDA_DRAW_PANEL::SetCanStartBlock ( int  aStartBlock)
inlineinherited

Definition at line 170 of file legacy_wx/class_drawpanel.h.

170 { m_canStartBlock = aStartBlock; }
int m_canStartBlock
useful to avoid false start block in certain cases (like switch from a sheet to another sheet >= 0 (o...

References EDA_DRAW_PANEL::m_canStartBlock.

◆ SetClipBox() [1/4]

void EDA_DRAW_PANEL::SetClipBox ( const EDA_RECT aRect)
inlineinherited

Definition at line 124 of file legacy_gal/class_drawpanel.h.

124 { m_ClipBox = aRect; }
EDA_RECT m_ClipBox
The drawing area used to redraw the screen which is usually the visible area of the drawing in intern...

References EDA_DRAW_PANEL::m_ClipBox.

Referenced by EDA_DRAW_PANEL::DoPrepareDC(), GBR_LAYOUT::Draw(), PLEDITOR_PRINTOUT::DrawPage(), DrawPageOnClipboard(), and EDA_DRAW_PANEL::OnPaint().

◆ SetClipBox() [2/4]

void EDA_DRAW_PANEL::SetClipBox ( const EDA_RECT aRect)
inlineinherited

Definition at line 141 of file legacy_wx/class_drawpanel.h.

141 { m_ClipBox = aRect; }
EDA_RECT m_ClipBox
The drawing area used to redraw the screen which is usually the visible area of the drawing in intern...

References EDA_DRAW_PANEL::m_ClipBox.

◆ SetClipBox() [3/4]

void EDA_DRAW_PANEL::SetClipBox ( wxDC &  aDC,
const wxRect *  aRect = NULL 
)
inlinevirtualinherited

Function SetClipBox sets the clip box in drawing (logical) units from aRect in device units.

If aRect is NULL, then the entire visible area of the screen is used as the clip area. The clip box is used when drawing to determine which objects are not visible and do not need to be drawn. Note that this is not the same as setting the device context clipping with wxDC::SetClippingRegion(). This is the rectangle used by the drawing functions in gr_basic.cpp used to determine if the item to draw is off screen and therefore not drawn.

Parameters
aDCThe device context use for drawing with the correct scale and offsets already configured. See DoPrepareDC().
aRectThe clip rectangle in device units or NULL for the entire visible area of the screen.

Definition at line 251 of file legacy_gal/class_drawpanel.h.

251 { printf("EDA_DRAW_PANEL:Unimplemented10\n"); };;

◆ SetClipBox() [4/4]

void EDA_DRAW_PANEL::SetClipBox ( wxDC &  aDC,
const wxRect *  aRect = NULL 
)
inherited

Function SetClipBox sets the clip box in drawing (logical) units from aRect in device units.

If aRect is NULL, then the entire visible area of the screen is used as the clip area. The clip box is used when drawing to determine which objects are not visible and do not need to be drawn. Note that this is not the same as setting the device context clipping with wxDC::SetClippingRegion(). This is the rectangle used by the drawing functions in gr_basic.cpp used to determine if the item to draw is off screen and therefore not drawn.

Parameters
aDCThe device context use for drawing with the correct scale and offsets already configured. See DoPrepareDC().
aRectThe clip rectangle in device units or NULL for the entire visible area of the screen.

◆ SetCurrentCursor() [1/2]

void EDA_DRAW_PANEL_GAL::SetCurrentCursor ( int  aCursor)
virtualinherited

Function SetCurrentCursor Set the current cursor shape for this panel.

Definition at line 511 of file draw_panel_gal.cpp.

512 {
513  if ( aCursor > wxCURSOR_NONE && aCursor < wxCURSOR_MAX )
514  {
515  m_currentCursor = aCursor;
516  }
517  else
518  {
519  m_currentCursor = wxCURSOR_ARROW;
520  }
521 
522  SetCursor( (wxStockCursor) m_currentCursor );
523 }
int m_currentCursor
Current mouse cursor shape id.

References EDA_DRAW_PANEL_GAL::m_currentCursor.

Referenced by EDA_DRAW_PANEL_GAL::SetDefaultCursor(), and EDA_DRAW_FRAME::SetToolID().

◆ SetCurrentCursor() [2/2]

void EDA_DRAW_PANEL::SetCurrentCursor ( int  aCursor)
inlineinherited

Function SetCurrentCursor Set the current cursor shape for drawpanel.

Definition at line 456 of file legacy_wx/class_drawpanel.h.

457  {
458  m_currentCursor = aCursor;
459  SetCursor( (wxStockCursor) m_currentCursor );
460  }
int m_currentCursor
Current mouse cursor shape id.

References EDA_DRAW_PANEL::m_currentCursor.

◆ SetDefaultCursor()

void EDA_DRAW_PANEL_GAL::SetDefaultCursor ( )
virtualinherited

Definition at line 525 of file draw_panel_gal.cpp.

526 {
528 }
int m_defaultCursor
The default mouse cursor shape id.
virtual void SetCurrentCursor(int aCursor)
Function SetCurrentCursor Set the current cursor shape for this panel.

References EDA_DRAW_PANEL_GAL::m_defaultCursor, and EDA_DRAW_PANEL_GAL::SetCurrentCursor().

◆ setDefaultLayerDeps()

void SCH_DRAW_PANEL::setDefaultLayerDeps ( )
protected

Reassigns layer order to the initial settings.

Definition at line 210 of file sch_draw_panel.cpp.

211 {
212  // caching makes no sense for Cairo and other software renderers
214 
215  for( int i = 0; i < KIGFX::VIEW::VIEW_MAX_LAYERS; i++ )
216  m_view->SetLayerTarget( i, target );
217 
218  // Bitmaps are draw on a non cached GAL layer:
220 
221  // Some draw layers need specific settings
224 
227 
230 }
GAL_TYPE m_backend
Currently used GAL.
to handle and draw images bitmaps
static constexpr int VIEW_MAX_LAYERS
maximum number of layers that may be shown
Definition: view.h:712
Auxiliary rendering target (noncached)
Definition: definitions.h:49
void SetLayerTarget(int aLayer, RENDER_TARGET aTarget)
Function SetLayerTarget() Changes the rendering target for a particular layer.
Definition: view.h:445
void SetLayerDisplayOnly(int aLayer, bool aDisplayOnly=true)
Definition: view.h:433
Items that may change while the view stays the same (noncached)
Definition: definitions.h:50
Main rendering target (cached)
Definition: definitions.h:48
KIGFX::VIEW * m_view
Stores view settings (scale, center, etc.) and items to be drawn.
size_t i
Definition: json11.cpp:597
currently selected items overlay

References i, LAYER_DRAW_BITMAPS, LAYER_GP_OVERLAY, LAYER_SELECT_OVERLAY, LAYER_WORKSHEET, KIGFX::TARGET_CACHED, KIGFX::TARGET_NONCACHED, KIGFX::TARGET_OVERLAY, and KIGFX::VIEW::VIEW_MAX_LAYERS.

◆ setDefaultLayerOrder()

void SCH_DRAW_PANEL::setDefaultLayerOrder ( )
protected

Definition at line 144 of file sch_draw_panel.cpp.

145 {
146  for( LAYER_NUM i = 0; (unsigned) i < sizeof( SCH_LAYER_ORDER ) / sizeof( LAYER_NUM ); ++i )
147  {
148  LAYER_NUM layer = SCH_LAYER_ORDER[i];
149  wxASSERT( layer < KIGFX::VIEW::VIEW_MAX_LAYERS );
150 
151  m_view->SetLayerOrder( layer, i );
152  }
153 }
void SetLayerOrder(int aLayer, int aRenderingOrder)
Function SetLayerOrder() Sets rendering order of a particular layer.
Definition: view.cpp:663
static constexpr int VIEW_MAX_LAYERS
maximum number of layers that may be shown
Definition: view.h:712
static const LAYER_NUM SCH_LAYER_ORDER[]
Definition: sch_view.h:44
int LAYER_NUM
Type LAYER_NUM can be replaced with int and removed.
KIGFX::VIEW * m_view
Stores view settings (scale, center, etc.) and items to be drawn.
size_t i
Definition: json11.cpp:597

References i, SCH_LAYER_ORDER, and KIGFX::VIEW::VIEW_MAX_LAYERS.

◆ SetEnableAutoPan()

void SCH_DRAW_PANEL::SetEnableAutoPan ( bool  aEnable)
overridevirtual

Reimplemented from EDA_DRAW_PANEL.

Definition at line 185 of file sch_draw_panel.cpp.

186 {
188 
189  if( GetParent()->IsGalCanvasActive() )
191 }
KIGFX::VIEW_CONTROLS * GetViewControls() const
Function GetViewControls() Returns a pointer to the VIEW_CONTROLS instance used in the panel.
virtual EDA_DRAW_FRAME * GetParent() const override
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:931
virtual void EnableAutoPan(bool aEnabled)
Function EnableAutoPan Turns on/off auto panning (user setting to disable it entirely).
virtual void SetEnableAutoPan(bool aEnable)

References EDA_DRAW_PANEL::SetEnableAutoPan().

◆ SetEnableBlockCommands() [1/2]

void EDA_DRAW_PANEL::SetEnableBlockCommands ( bool  aEnable)
inlineinherited

Definition at line 148 of file legacy_gal/class_drawpanel.h.

148 { m_enableBlockCommands = aEnable; }
bool m_enableBlockCommands
True enables block commands.

References EDA_DRAW_PANEL::m_enableBlockCommands.

Referenced by GERBVIEW_FRAME::GERBVIEW_FRAME(), and PL_EDITOR_FRAME::PL_EDITOR_FRAME().

◆ SetEnableBlockCommands() [2/2]

void EDA_DRAW_PANEL::SetEnableBlockCommands ( bool  aEnable)
inlineinherited

Definition at line 165 of file legacy_wx/class_drawpanel.h.

165 { m_enableBlockCommands = aEnable; }
bool m_enableBlockCommands
True enables block commands.

References EDA_DRAW_PANEL::m_enableBlockCommands.

◆ SetEnableMousewheelPan()

void SCH_DRAW_PANEL::SetEnableMousewheelPan ( bool  aEnable)
overridevirtual

Reimplemented from EDA_DRAW_PANEL.

Definition at line 176 of file sch_draw_panel.cpp.

177 {
178  m_enableMousewheelPan = aEnable;
179 
180  if( GetParent()->IsGalCanvasActive() )
182 }
KIGFX::VIEW_CONTROLS * GetViewControls() const
Function GetViewControls() Returns a pointer to the VIEW_CONTROLS instance used in the panel.
virtual EDA_DRAW_FRAME * GetParent() const override
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:931
virtual void EnableMousewheelPan(bool aEnable)
Function EnableMousewheelPan() Enables or disables mousewheel panning.
bool m_enableMousewheelPan
True to enable mousewheel panning by default.

◆ SetEnableZoomNoCenter()

void SCH_DRAW_PANEL::SetEnableZoomNoCenter ( bool  aEnable)
overridevirtual

Reimplemented from EDA_DRAW_PANEL.

Definition at line 201 of file sch_draw_panel.cpp.

202 {
203  m_enableZoomNoCenter = aEnable;
204 
205  if( GetParent()->IsGalCanvasActive() )
207 }
KIGFX::VIEW_CONTROLS * GetViewControls() const
Function GetViewControls() Returns a pointer to the VIEW_CONTROLS instance used in the panel.
virtual EDA_DRAW_FRAME * GetParent() const override
bool m_enableZoomNoCenter
True to enable zooming around the crosshair instead of the center.
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:931
void EnableCursorWarping(bool aEnable)
Function EnableCursorWarping() Enables or disables warping the cursor.

◆ SetEventDispatcher()

void EDA_DRAW_PANEL_GAL::SetEventDispatcher ( TOOL_DISPATCHER aEventDispatcher)
inherited

Function SetEventDispatcher() Sets a dispatcher that processes events and forwards them to tools.

Parameters
aEventDispatcheris the object that will be used for dispatching events. DRAW_PANEL_GAL does not take over the ownership. Passing NULL disconnects all event handlers from the DRAW_PANEL_GAL and parent frame.

Definition at line 292 of file draw_panel_gal.cpp.

293 {
294  m_eventDispatcher = aEventDispatcher;
295  const wxEventType eventTypes[] = { wxEVT_TOOL };
296 
297  if( m_eventDispatcher )
298  {
299  for( wxEventType type : eventTypes )
300  {
301  m_parent->Connect( type, wxCommandEventHandler( TOOL_DISPATCHER::DispatchWxCommand ),
302  NULL, m_eventDispatcher );
303  }
304  }
305  else
306  {
307  for( wxEventType type : eventTypes )
308  {
309  // While loop is used to be sure that all event handlers are removed.
310  while( m_parent->Disconnect( type,
311  wxCommandEventHandler( TOOL_DISPATCHER::DispatchWxCommand ),
312  NULL, m_eventDispatcher ) );
313  }
314  }
315 }
wxWindow * m_parent
Pointer to the parent window.
TOOL_DISPATCHER * m_eventDispatcher
Processes and forwards events to tools.
virtual void DispatchWxCommand(wxCommandEvent &aEvent)
Function DispatchWxCommand() Processes wxCommands (mostly menu related events) and runs appropriate a...

References TOOL_DISPATCHER::DispatchWxCommand(), EDA_DRAW_PANEL_GAL::m_eventDispatcher, and EDA_DRAW_PANEL_GAL::m_parent.

Referenced by EVT_GRID_CMD_CELL_CHANGED(), FOOTPRINT_EDIT_FRAME::OnCloseWindow(), FOOTPRINT_EDIT_FRAME::setupTools(), LIB_VIEW_FRAME::setupTools(), LIB_EDIT_FRAME::setupTools(), SCH_EDIT_FRAME::setupTools(), PCB_BASE_FRAME::UseGalCanvas(), and GERBVIEW_FRAME::UseGalCanvas().

◆ SetFocus()

void EDA_DRAW_PANEL_GAL::SetFocus ( )
overridevirtualinherited

Definition at line 133 of file draw_panel_gal.cpp.

134 {
135 // Windows has a strange manner on bringing up and activating windows
136 // containing a GAL canvas just after moving the mouse cursor into its area.
137 // Feel free to uncomment or extend the following #ifdef if you experience
138 // similar problems on your platform.
139 #ifdef __WINDOWS__
140  if( !GetParent()->IsDescendant( wxWindow::FindFocus() ) )
141  return;
142 #endif
143 
144  wxScrolledCanvas::SetFocus();
145  m_lostFocus = false;
146 }
bool m_lostFocus
Flag to indicate that focus should be regained on the next mouse event.

References EDA_DRAW_PANEL_GAL::m_lostFocus.

Referenced by EDA_DRAW_PANEL_GAL::onEnter(), EDA_DRAW_PANEL_GAL::OnEvent(), SCH_PREVIEW_PANEL::SCH_PREVIEW_PANEL(), and GERBVIEW_FRAME::SetActiveLayer().

◆ SetGrid()

void EDA_DRAW_PANEL::SetGrid ( const wxRealPoint &  size)
inherited

◆ SetHighContrastLayer()

void EDA_DRAW_PANEL_GAL::SetHighContrastLayer ( int  aLayer)
virtualinherited

Function SetHighContrastLayer Takes care of display settings for the given layer to be displayed in high contrast mode.

Reimplemented in PCB_DRAW_PANEL_GAL, and GERBVIEW_DRAW_PANEL_GAL.

Definition at line 334 of file draw_panel_gal.cpp.

335 {
336  // Set display settings for high contrast mode
338 
339  SetTopLayer( aLayer );
340 
341  rSettings->ClearActiveLayers();
342  rSettings->SetActiveLayer( aLayer );
343 
345 }
Class RENDER_SETTINGS Contains all the knowledge about how graphical objects are drawn on any output ...
Definition: painter.h:56
PAINTER * GetPainter() const
Function GetPainter() Returns the painter object used by the view for drawing VIEW_ITEMS.
Definition: view.h:199
void SetActiveLayer(int aLayerId, bool aEnabled=true)
Function SetActiveLayer Sets the specified layer as active - it means that it can be drawn in a speci...
Definition: painter.h:76
void ClearActiveLayers()
Function ClearActiveLayers Clears the list of active layers.
Definition: painter.h:98
virtual void SetTopLayer(int aLayer)
Function SetTopLayer Moves the selected layer to the top, so it is displayed above all others.
virtual RENDER_SETTINGS * GetSettings()=0
Function GetSettings Returns pointer to current settings that are going to be used when drawing items...
KIGFX::VIEW * m_view
Stores view settings (scale, center, etc.) and items to be drawn.
void UpdateAllLayersColor()
Function UpdateAllLayersColor() Applies the new coloring scheme to all layers.
Definition: view.cpp:797

References KIGFX::RENDER_SETTINGS::ClearActiveLayers(), KIGFX::VIEW::GetPainter(), KIGFX::PAINTER::GetSettings(), EDA_DRAW_PANEL_GAL::m_view, KIGFX::RENDER_SETTINGS::SetActiveLayer(), EDA_DRAW_PANEL_GAL::SetTopLayer(), and KIGFX::VIEW::UpdateAllLayersColor().

Referenced by GERBVIEW_FRAME::SetActiveLayer().

◆ SetIgnoreLeftButtonReleaseEvent() [1/2]

void EDA_DRAW_PANEL::SetIgnoreLeftButtonReleaseEvent ( bool  aIgnore)
inlineinherited

Definition at line 146 of file legacy_gal/class_drawpanel.h.

146 { m_ignoreNextLeftButtonRelease = aIgnore; }
bool m_ignoreNextLeftButtonRelease
Ignore the next mouse left button release when true.

References EDA_DRAW_PANEL::m_ignoreNextLeftButtonRelease.

Referenced by EDA_DRAW_FRAME::SkipNextLeftButtonReleaseEvent().

◆ SetIgnoreLeftButtonReleaseEvent() [2/2]

void EDA_DRAW_PANEL::SetIgnoreLeftButtonReleaseEvent ( bool  aIgnore)
inlineinherited

Definition at line 163 of file legacy_wx/class_drawpanel.h.

163 { m_ignoreNextLeftButtonRelease = aIgnore; }
bool m_ignoreNextLeftButtonRelease
Ignore the next mouse left button release when true.

References EDA_DRAW_PANEL::m_ignoreNextLeftButtonRelease.

◆ SetIgnoreMouseEvents() [1/2]

◆ SetIgnoreMouseEvents() [2/2]

void EDA_DRAW_PANEL::SetIgnoreMouseEvents ( bool  aIgnore)
inlineinherited

Definition at line 161 of file legacy_wx/class_drawpanel.h.

161 { m_ignoreMouseEvents = aIgnore; }
bool m_ignoreMouseEvents
Ignore mouse events when true.

References EDA_DRAW_PANEL::m_ignoreMouseEvents.

◆ SetMouseCapture() [1/2]

virtual void EDA_DRAW_PANEL::SetMouseCapture ( MOUSE_CAPTURE_CALLBACK  aMouseCaptureCallback,
END_MOUSE_CAPTURE_CALLBACK  aEndMouseCaptureCallback 
)
inlinevirtualinherited

Function SetMouseCapture sets the mouse capture and end mouse capture callbacks to aMouseCaptureCallback and aEndMouseCaptureCallback respectively.

Definition at line 324 of file legacy_gal/class_drawpanel.h.

326  {
327  m_mouseCaptureCallback = aMouseCaptureCallback;
328  m_endMouseCaptureCallback = aEndMouseCaptureCallback;
329  }
END_MOUSE_CAPTURE_CALLBACK m_endMouseCaptureCallback
Abort mouse capture callback function.
MOUSE_CAPTURE_CALLBACK m_mouseCaptureCallback
Mouse capture move callback function.

References EDA_DRAW_PANEL::m_endMouseCaptureCallback, and EDA_DRAW_PANEL::m_mouseCaptureCallback.

Referenced by Abort_Edit_Pcb_Text(), Abort_EditEdge(), Abort_Move_ModuleOutline(), Abort_Move_Pad(), Abort_MoveOrCopyModule(), Abort_MoveTrack(), Abort_Zone_Create_Outline(), Abort_Zone_Move_Corner_Or_Outlines(), AbortBlockCurrentCommand(), AbortMoveAndEditTarget(), AbortMoveDimensionText(), abortMoveItem(), AbortMoveTextModule(), PCB_EDIT_FRAME::Begin_DrawSegment(), FOOTPRINT_EDIT_FRAME::Begin_Edge_Module(), PCB_EDIT_FRAME::Begin_Route(), PCB_EDIT_FRAME::Begin_Self(), PCB_EDIT_FRAME::Begin_Zone(), PCB_EDIT_FRAME::BeginMoveDimensionText(), PCB_EDIT_FRAME::BeginMoveTarget(), PCB_EDIT_FRAME::Delete_LastCreatedCorner(), PCB_EDIT_FRAME::Delete_Segment(), PCB_EDIT_FRAME::Delete_Texte_Pcb(), PCB_EDIT_FRAME::EditDimension(), PCB_EDIT_FRAME::End_Edge(), FOOTPRINT_EDIT_FRAME::End_Edge_Module(), PCB_EDIT_FRAME::End_Move_Zone_Corner_Or_Outlines(), PCB_EDIT_FRAME::End_Route(), PCB_EDIT_FRAME::End_Zone(), Exit_Self(), PL_EDITOR_FRAME::MoveItem(), SCH_FIELD::Place(), PCB_EDIT_FRAME::Place_DrawItem(), FOOTPRINT_EDIT_FRAME::Place_EdgeMod(), PCB_EDIT_FRAME::Place_Texte_Pcb(), PCB_EDIT_FRAME::PlaceDimensionText(), PCB_EDIT_FRAME::PlaceDraggedOrMovedTrackSegment(), PL_EDITOR_FRAME::PlaceItem(), PCB_BASE_FRAME::PlaceModule(), PCB_BASE_FRAME::PlacePad(), PCB_EDIT_FRAME::PlaceTarget(), PCB_BASE_FRAME::PlaceTexteModule(), PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope(), PCB_EDIT_FRAME::Start_Move_DrawItem(), FOOTPRINT_EDIT_FRAME::Start_Move_EdgeMod(), PCB_EDIT_FRAME::Start_Move_Zone_Corner(), PCB_EDIT_FRAME::Start_Move_Zone_Drag_Outline_Edge(), PCB_EDIT_FRAME::Start_Move_Zone_Outlines(), PCB_EDIT_FRAME::StartMoveModule(), PCB_EDIT_FRAME::StartMoveOneNodeOrSegment(), PCB_BASE_FRAME::StartMovePad(), PCB_BASE_FRAME::StartMoveTexteModule(), and PCB_EDIT_FRAME::StartMoveTextePcb().

◆ SetMouseCapture() [2/2]

void EDA_DRAW_PANEL::SetMouseCapture ( MOUSE_CAPTURE_CALLBACK  aMouseCaptureCallback,
END_MOUSE_CAPTURE_CALLBACK  aEndMouseCaptureCallback 
)
inlineinherited

Function SetMouseCapture sets the mouse capture and end mouse capture callbacks to aMouseCaptureCallback and aEndMouseCaptureCallback respectively.

Definition at line 400 of file legacy_wx/class_drawpanel.h.

402  {
403  m_mouseCaptureCallback = aMouseCaptureCallback;
404  m_endMouseCaptureCallback = aEndMouseCaptureCallback;
405  }
END_MOUSE_CAPTURE_CALLBACK m_endMouseCaptureCallback
Abort mouse capture callback function.
MOUSE_CAPTURE_CALLBACK m_mouseCaptureCallback
Mouse capture move callback function.

References EDA_DRAW_PANEL::m_endMouseCaptureCallback, and EDA_DRAW_PANEL::m_mouseCaptureCallback.

◆ SetMouseCaptureCallback() [1/2]

virtual void EDA_DRAW_PANEL::SetMouseCaptureCallback ( MOUSE_CAPTURE_CALLBACK  aMouseCaptureCallback)
inlinevirtualinherited

◆ SetMouseCaptureCallback() [2/2]

void EDA_DRAW_PANEL::SetMouseCaptureCallback ( MOUSE_CAPTURE_CALLBACK  aMouseCaptureCallback)
inlineinherited

Definition at line 408 of file legacy_wx/class_drawpanel.h.

409  {
410  m_mouseCaptureCallback = aMouseCaptureCallback;
411  }
MOUSE_CAPTURE_CALLBACK m_mouseCaptureCallback
Mouse capture move callback function.

References EDA_DRAW_PANEL::m_mouseCaptureCallback.

◆ SetPrintMirrored() [1/2]

void EDA_DRAW_PANEL::SetPrintMirrored ( bool  aMirror)
inlineinherited

Definition at line 151 of file legacy_gal/class_drawpanel.h.

151 { m_PrintIsMirrored = aMirror; }
bool m_PrintIsMirrored
True when drawing in mirror mode.

References EDA_DRAW_PANEL::m_PrintIsMirrored.

◆ SetPrintMirrored() [2/2]

void EDA_DRAW_PANEL::SetPrintMirrored ( bool  aMirror)
inlineinherited

Definition at line 168 of file legacy_wx/class_drawpanel.h.

168 { m_PrintIsMirrored = aMirror; }
bool m_PrintIsMirrored
True when drawing in mirror mode.

References EDA_DRAW_PANEL::m_PrintIsMirrored.

◆ SetStealsFocus()

void EDA_DRAW_PANEL_GAL::SetStealsFocus ( bool  aStealsFocus)
inlineinherited

Set whether focus is taken on certain events (mouseover, keys, etc).

This should be true (and is by default) for any primary canvas, but can be false to make well-behaved preview panes and the like.

Definition at line 195 of file class_draw_panel_gal.h.

196  {
197  m_stealsFocus = aStealsFocus;
198  }
bool m_stealsFocus
Flag to indicate whether the panel should take focus at certain times (when moused over,...

References EDA_DRAW_PANEL_GAL::m_stealsFocus.

Referenced by FOOTPRINT_PREVIEW_PANEL::FOOTPRINT_PREVIEW_PANEL(), DIALOG_PAD_PROPERTIES::prepareCanvas(), and SYMBOL_PREVIEW_WIDGET::SYMBOL_PREVIEW_WIDGET().

◆ SetTopLayer()

void EDA_DRAW_PANEL_GAL::SetTopLayer ( int  aLayer)
virtualinherited

Function SetTopLayer Moves the selected layer to the top, so it is displayed above all others.

Reimplemented in PCB_DRAW_PANEL_GAL, and GERBVIEW_DRAW_PANEL_GAL.

Definition at line 348 of file draw_panel_gal.cpp.

349 {
351  m_view->SetTopLayer( aLayer );
353 }
virtual void SetTopLayer(int aLayer, bool aEnabled=true)
Function SetTopLayer() Sets given layer to be displayed on the top or sets back the default order of ...
Definition: view.cpp:859
void UpdateAllLayersOrder()
Function UpdateLayerOrder() Does everything that is needed to apply the rendering order of layers.
Definition: view.cpp:926
void ClearTopLayers()
Function ClearTopLayers() Removes all layers from the on-the-top set (they are no longer displayed ov...
Definition: view.cpp:911
KIGFX::VIEW * m_view
Stores view settings (scale, center, etc.) and items to be drawn.

References KIGFX::VIEW::ClearTopLayers(), EDA_DRAW_PANEL_GAL::m_view, KIGFX::VIEW::SetTopLayer(), and KIGFX::VIEW::UpdateAllLayersOrder().

Referenced by EDA_DRAW_PANEL_GAL::SetHighContrastLayer().

◆ SetZoom() [1/2]

void EDA_DRAW_PANEL::SetZoom ( double  mode)
inlinevirtualinherited

Definition at line 220 of file legacy_gal/class_drawpanel.h.

220 { printf("EDA_DRAW_PANEL:Unimplemented7\n"); };;

◆ SetZoom() [2/2]

void EDA_DRAW_PANEL::SetZoom ( double  mode)
inherited

◆ StartDrawing()

void EDA_DRAW_PANEL_GAL::StartDrawing ( )
inherited

Function StartDrawing() Begins drawing if it was stopped previously.

Definition at line 318 of file draw_panel_gal.cpp.

319 {
320  // Start querying GAL if it is ready
321  m_refreshTimer.StartOnce( 100 );
322 }
wxTimer m_refreshTimer
Timer responsible for preventing too frequent refresh.

References EDA_DRAW_PANEL_GAL::m_refreshTimer.

Referenced by FOOTPRINT_PREVIEW_PANEL::FOOTPRINT_PREVIEW_PANEL(), DIALOG_PAD_PROPERTIES::prepareCanvas(), DIALOG_PAD_PROPERTIES::redraw(), SCH_PREVIEW_PANEL::SCH_PREVIEW_PANEL(), PCB_BASE_FRAME::UseGalCanvas(), and GERBVIEW_FRAME::UseGalCanvas().

◆ StopDrawing()

void EDA_DRAW_PANEL_GAL::StopDrawing ( )
inherited

Function StopDrawing() Prevents the GAL canvas from further drawing till it is recreated or StartDrawing() is called.

Definition at line 325 of file draw_panel_gal.cpp.

326 {
327  m_drawingEnabled = false;
328  Disconnect( wxEVT_PAINT, wxPaintEventHandler( EDA_DRAW_PANEL_GAL::onPaint ), NULL, this );
329  m_pendingRefresh = false;
330  m_refreshTimer.Stop();
331 }
bool m_pendingRefresh
Is there a redraw event requested?
wxTimer m_refreshTimer
Timer responsible for preventing too frequent refresh.
virtual void onPaint(wxPaintEvent &WXUNUSED(aEvent))
bool m_drawingEnabled
Flag that determines if VIEW may use GAL for redrawing the screen.

References EDA_DRAW_PANEL_GAL::m_drawingEnabled, EDA_DRAW_PANEL_GAL::m_pendingRefresh, EDA_DRAW_PANEL_GAL::m_refreshTimer, and EDA_DRAW_PANEL_GAL::onPaint().

Referenced by DIALOG_PAD_PROPERTIES::OnCancel(), LIB_VIEW_FRAME::OnCloseWindow(), FOOTPRINT_EDIT_FRAME::OnCloseWindow(), FOOTPRINT_VIEWER_FRAME::OnCloseWindow(), GERBVIEW_FRAME::OnCloseWindow(), DIALOG_PAD_PROPERTIES::redraw(), EDA_DRAW_PANEL_GAL::SwitchBackend(), GERBVIEW_FRAME::UseGalCanvas(), DISPLAY_FOOTPRINTS_FRAME::~DISPLAY_FOOTPRINTS_FRAME(), EDA_DRAW_PANEL_GAL::~EDA_DRAW_PANEL_GAL(), FOOTPRINT_VIEWER_FRAME::~FOOTPRINT_VIEWER_FRAME(), and FOOTPRINT_WIZARD_FRAME::~FOOTPRINT_WIZARD_FRAME().

◆ SwitchBackend()

bool SCH_DRAW_PANEL::SwitchBackend ( GAL_TYPE  aGalType)
overridevirtual

Function SwitchBackend Switches method of rendering graphics.

Parameters
aGalTypeis a type of rendering engine that you want to use.

Reimplemented from EDA_DRAW_PANEL_GAL.

Definition at line 156 of file sch_draw_panel.cpp.

157 {
158  VECTOR2D grid_size = m_gal->GetGridSize();
159  bool rv = EDA_DRAW_PANEL_GAL::SwitchBackend( aGalType );
162 
163  // Keep grid size and grid visibility:
164  m_gal->SetGridSize( grid_size );
165  SCH_BASE_FRAME* frame = dynamic_cast<SCH_BASE_FRAME*>( GetParent() );
166 
167  if( frame )
169 
170  Refresh();
171 
172  return rv;
173 }
KIGFX::GAL * m_gal
Interface for drawing objects on a 2D-surface.
virtual EDA_DRAW_FRAME * GetParent() const override
constexpr double SCH_WORLD_UNIT
Definition: sch_view.h:42
virtual bool SwitchBackend(GAL_TYPE aGalType)
Function SwitchBackend Switches method of rendering graphics.
virtual bool IsGridVisible() const
Definition: draw_frame.h:533
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...
void setDefaultLayerDeps()
Reassigns layer order to the initial settings.
void SetGridSize(const VECTOR2D &aGridSize)
Set the grid size.
void SetWorldUnitLength(double aWorldUnitLength)
Set the unit length.
const VECTOR2D & GetGridSize() const
Returns the grid size.
void SetGridVisibility(bool aVisibility)
Sets the visibility setting of the grid.
A shim class between EDA_DRAW_FRAME and several derived classes: LIB_EDIT_FRAME, LIB_VIEW_FRAME,...

References EDA_DRAW_FRAME::IsGridVisible(), Refresh(), SCH_WORLD_UNIT, and EDA_DRAW_PANEL_GAL::SwitchBackend().

◆ ToDeviceXY() [1/2]

wxPoint EDA_DRAW_PANEL::ToDeviceXY ( const wxPoint &  pos)
inlinevirtualinherited

Function ToDeviceXY transforms logical to device coordinates.

Definition at line 283 of file legacy_gal/class_drawpanel.h.

283 { printf("EDA_DRAW_PANEL:Unimplemented15\n"); return wxPoint(0, 0); };;

◆ ToDeviceXY() [2/2]

wxPoint EDA_DRAW_PANEL::ToDeviceXY ( const wxPoint &  pos)
inherited

Function ToDeviceXY transforms logical to device coordinates.

◆ ToLogicalXY() [1/2]

wxPoint EDA_DRAW_PANEL::ToLogicalXY ( const wxPoint &  pos)
inlinevirtualinherited

Function ToLogicalXY transforms device to logical coordinates.

Definition at line 289 of file legacy_gal/class_drawpanel.h.

289 { printf("EDA_DRAW_PANEL:Unimplemented16\n"); return wxPoint(0, 0); };;

◆ ToLogicalXY() [2/2]

wxPoint EDA_DRAW_PANEL::ToLogicalXY ( const wxPoint &  pos)
inherited

Function ToLogicalXY transforms device to logical coordinates.

◆ view()

KIGFX::SCH_VIEW * SCH_DRAW_PANEL::view ( ) const
protected

Definition at line 233 of file sch_draw_panel.cpp.

234 {
235  return static_cast<KIGFX::SCH_VIEW*>( m_view );
236 }
KIGFX::VIEW * m_view
Stores view settings (scale, center, etc.) and items to be drawn.

Referenced by GetView().

Member Data Documentation

◆ m_abortRequest

bool EDA_DRAW_PANEL::m_abortRequest
protectedinherited

◆ m_backend

◆ m_canStartBlock

int EDA_DRAW_PANEL::m_canStartBlock
protectedinherited

useful to avoid false start block in certain cases (like switch from a sheet to another sheet >= 0 (or >= n) if a block can start

Definition at line 81 of file legacy_gal/class_drawpanel.h.

Referenced by EDA_DRAW_PANEL::EDA_DRAW_PANEL(), EDA_DRAW_PANEL::OnActivate(), EDA_DRAW_PANEL::OnMouseEvent(), and EDA_DRAW_PANEL::SetCanStartBlock().

◆ m_ClipBox

EDA_RECT EDA_DRAW_PANEL::m_ClipBox
protectedinherited

The drawing area used to redraw the screen which is usually the visible area of the drawing in internal units.

Definition at line 40 of file legacy_gal/class_drawpanel.h.

Referenced by EDA_DRAW_PANEL::EDA_DRAW_PANEL(), EDA_DRAW_PANEL::GetClipBox(), and EDA_DRAW_PANEL::SetClipBox().

◆ m_currentCursor

int EDA_DRAW_PANEL_GAL::m_currentCursor
protectedinherited

◆ m_cursorLevel

int EDA_DRAW_PANEL::m_cursorLevel
protectedinherited

Index for cursor redraw in XOR mode.

Definition at line 30 of file legacy_gal/class_drawpanel.h.

Referenced by EDA_DRAW_PANEL::EDA_DRAW_PANEL(), and EDA_DRAW_PANEL::OnMouseEntering().

◆ m_CursorStartPos

wxPoint EDA_DRAW_PANEL::m_CursorStartPos
protectedinherited

Used for testing the cursor movement.

Definition at line 34 of file legacy_gal/class_drawpanel.h.

Referenced by EDA_DRAW_PANEL::OnMouseEvent().

◆ m_defaultCursor

int EDA_DRAW_PANEL_GAL::m_defaultCursor
protectedinherited

◆ m_doubleClickInterval

int EDA_DRAW_PANEL::m_doubleClickInterval
protectedinherited

◆ m_drawing

bool EDA_DRAW_PANEL_GAL::m_drawing
protectedinherited

◆ m_drawingEnabled

bool EDA_DRAW_PANEL_GAL::m_drawingEnabled
protectedinherited

Flag that determines if VIEW may use GAL for redrawing the screen.

Definition at line 274 of file class_draw_panel_gal.h.

Referenced by EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL(), EDA_DRAW_PANEL_GAL::onRefreshTimer(), and EDA_DRAW_PANEL_GAL::StopDrawing().

◆ m_edaFrame

EDA_DRAW_FRAME* EDA_DRAW_PANEL_GAL::m_edaFrame
protectedinherited

◆ m_enableAutoPan

bool EDA_DRAW_PANEL::m_enableAutoPan
protectedinherited

◆ m_enableBlockCommands

bool EDA_DRAW_PANEL::m_enableBlockCommands
protectedinherited

◆ m_enableMousewheelPan

bool EDA_DRAW_PANEL::m_enableMousewheelPan
protectedinherited

◆ m_enableZoomNoCenter

bool EDA_DRAW_PANEL::m_enableZoomNoCenter
protectedinherited

True to enable zooming around the crosshair instead of the center.

Definition at line 44 of file legacy_gal/class_drawpanel.h.

Referenced by EDA_DRAW_PANEL::EDA_DRAW_PANEL(), EDA_DRAW_PANEL::GetEnableZoomNoCenter(), EDA_DRAW_PANEL::OnMouseWheel(), and EDA_DRAW_PANEL::SetEnableZoomNoCenter().

◆ m_endMouseCaptureCallback

END_MOUSE_CAPTURE_CALLBACK EDA_DRAW_PANEL::m_endMouseCaptureCallback
protectedinherited

Abort mouse capture callback function.

Definition at line 76 of file legacy_gal/class_drawpanel.h.

Referenced by EDA_DRAW_PANEL::EDA_DRAW_PANEL(), EDA_DRAW_PANEL::OnMouseEvent(), and EDA_DRAW_PANEL::SetMouseCapture().

◆ m_eventDispatcher

TOOL_DISPATCHER* EDA_DRAW_PANEL_GAL::m_eventDispatcher
protectedinherited

Processes and forwards events to tools.

Definition at line 299 of file class_draw_panel_gal.h.

Referenced by EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL(), EDA_DRAW_PANEL_GAL::OnEvent(), and EDA_DRAW_PANEL_GAL::SetEventDispatcher().

◆ m_gal

◆ m_ignoreMouseEvents

bool EDA_DRAW_PANEL::m_ignoreMouseEvents
protectedinherited

◆ m_ignoreNextLeftButtonRelease

bool EDA_DRAW_PANEL::m_ignoreNextLeftButtonRelease
protectedinherited

Ignore the next mouse left button release when true.

Definition at line 56 of file legacy_gal/class_drawpanel.h.

Referenced by EDA_DRAW_PANEL::EDA_DRAW_PANEL(), EDA_DRAW_PANEL::OnMouseEvent(), and EDA_DRAW_PANEL::SetIgnoreLeftButtonReleaseEvent().

◆ m_lastRefresh

wxLongLong EDA_DRAW_PANEL_GAL::m_lastRefresh
protectedinherited

Last timestamp when the panel was refreshed.

Definition at line 265 of file class_draw_panel_gal.h.

Referenced by EDA_DRAW_PANEL_GAL::onPaint(), and EDA_DRAW_PANEL_GAL::Refresh().

◆ m_lostFocus

bool EDA_DRAW_PANEL_GAL::m_lostFocus
protectedinherited

Flag to indicate that focus should be regained on the next mouse event.

It is a workaround for cases when the panel loses keyboard focus, so it does not react to hotkeys anymore.

Definition at line 303 of file class_draw_panel_gal.h.

Referenced by EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL(), EDA_DRAW_PANEL_GAL::OnEvent(), EDA_DRAW_PANEL_GAL::onLostFocus(), and EDA_DRAW_PANEL_GAL::SetFocus().

◆ m_minDragEventCount

int EDA_DRAW_PANEL::m_minDragEventCount
protectedinherited

Count the drag events.

Used to filter mouse moves before starting a block command. A block command can be started only if MinDragEventCount > MIN_DRAG_COUNT_FOR_START_BLOCK_COMMAND in order to avoid spurious block commands.

Definition at line 66 of file legacy_gal/class_drawpanel.h.

Referenced by EDA_DRAW_PANEL::EDA_DRAW_PANEL(), and EDA_DRAW_PANEL::OnMouseEvent().

◆ m_mouseCaptureCallback

MOUSE_CAPTURE_CALLBACK EDA_DRAW_PANEL::m_mouseCaptureCallback
protectedinherited

◆ m_onShowTimer

wxTimer EDA_DRAW_PANEL_GAL::m_onShowTimer
protectedinherited

Timer used to execute OnShow() when the window finally appears on the screen.

Definition at line 280 of file class_draw_panel_gal.h.

Referenced by EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL(), and EDA_DRAW_PANEL_GAL::onShowTimer().

◆ m_options

KIGFX::GAL_DISPLAY_OPTIONS& EDA_DRAW_PANEL_GAL::m_options
protectedinherited

Definition at line 296 of file class_draw_panel_gal.h.

Referenced by EDA_DRAW_PANEL_GAL::SwitchBackend().

◆ m_painter

◆ m_PanStartCenter

wxPoint EDA_DRAW_PANEL::m_PanStartCenter
protectedinherited

Initial scroll center position when pan started.

Definition at line 35 of file legacy_gal/class_drawpanel.h.

Referenced by EDA_DRAW_PANEL::OnMouseEvent().

◆ m_PanStartEventPosition

wxPoint EDA_DRAW_PANEL::m_PanStartEventPosition
protectedinherited

Initial position of mouse event when pan started.

Definition at line 36 of file legacy_gal/class_drawpanel.h.

Referenced by EDA_DRAW_PANEL::OnMouseEvent().

◆ m_parent

wxWindow* SCH_DRAW_PANEL::m_parent
protected

Definition at line 72 of file sch_draw_panel.h.

◆ m_pendingRefresh

bool EDA_DRAW_PANEL_GAL::m_pendingRefresh
protectedinherited

◆ m_PrintIsMirrored

bool EDA_DRAW_PANEL::m_PrintIsMirrored
protectedinherited

True when drawing in mirror mode.

Used by the draw arc function, because arcs are oriented, and in mirror mode, orientations are reversed.

Definition at line 70 of file legacy_gal/class_drawpanel.h.

Referenced by EDA_DRAW_PANEL::EDA_DRAW_PANEL(), EDA_DRAW_PANEL::GetPrintMirrored(), and EDA_DRAW_PANEL::SetPrintMirrored().

◆ m_refreshTimer

wxTimer EDA_DRAW_PANEL_GAL::m_refreshTimer
protectedinherited

◆ m_scrollIncrementX

int EDA_DRAW_PANEL::m_scrollIncrementX
protectedinherited

X axis scroll increment in pixels per unit.

Definition at line 31 of file legacy_gal/class_drawpanel.h.

Referenced by EDA_DRAW_PANEL::EDA_DRAW_PANEL(), EDA_DRAW_PANEL::OnPan(), and EDA_DRAW_PANEL::OnScroll().

◆ m_scrollIncrementY

int EDA_DRAW_PANEL::m_scrollIncrementY
protectedinherited

Y axis scroll increment in pixels per unit.

Definition at line 32 of file legacy_gal/class_drawpanel.h.

Referenced by EDA_DRAW_PANEL::EDA_DRAW_PANEL(), EDA_DRAW_PANEL::OnPan(), and EDA_DRAW_PANEL::OnScroll().

◆ m_showCrossHair

bool EDA_DRAW_PANEL::m_showCrossHair
protectedinherited

Indicate if cross hair is to be shown.

Definition at line 29 of file legacy_gal/class_drawpanel.h.

Referenced by EDA_DRAW_PANEL::EDA_DRAW_PANEL().

◆ m_stealsFocus

bool EDA_DRAW_PANEL_GAL::m_stealsFocus
protectedinherited

Flag to indicate whether the panel should take focus at certain times (when moused over, and on various mouse/key events)

Definition at line 307 of file class_draw_panel_gal.h.

Referenced by EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL(), EDA_DRAW_PANEL_GAL::GetStealsFocus(), EDA_DRAW_PANEL_GAL::onEnter(), EDA_DRAW_PANEL_GAL::OnEvent(), and EDA_DRAW_PANEL_GAL::SetStealsFocus().

◆ m_view

◆ m_viewControls

◆ MinRefreshPeriod

const int EDA_DRAW_PANEL_GAL::MinRefreshPeriod = 17
staticprotectedinherited

60 FPS.

Definition at line 251 of file class_draw_panel_gal.h.

Referenced by EDA_DRAW_PANEL_GAL::Refresh().


The documentation for this class was generated from the following files: