26 #ifndef PANELGAL_WXSTRUCT_H 27 #define PANELGAL_WXSTRUCT_H 29 #include <wx/window.h> 45 class WX_VIEW_CONTROLS;
48 class GAL_DISPLAY_OPTIONS;
63 EDA_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWindowId,
const wxPoint& aPosition,
108 virtual void Refresh(
bool aEraseBackground =
true,
const wxRect* aRect = NULL )
override;
198 void OnEvent( wxEvent& aEvent );
201 virtual void onPaint( wxPaintEvent& WXUNUSED( aEvent ) );
202 void onSize( wxSizeEvent& aEvent );
203 void onEnter( wxEvent& aEvent );
bool m_pendingRefresh
Last timestamp when the panel was refreshed.
wxTimer m_refreshTimer
Is there a redraw event requested?
KIGFX::GAL * m_gal
Interface for drawing objects on a 2D-surface.
virtual void SetHighContrastLayer(int aLayer)
Function SetHighContrastLayer Takes care of display settings for the given layer to be displayed in h...
void ForceRefresh()
Function ForceRefresh() Forces a redraw.
KIGFX::VIEW_CONTROLS * GetViewControls() const
Function GetViewControls() Returns a pointer to the VIEW_CONTROLS instance used in the panel.
KIGFX::WX_VIEW_CONTROLS * m_viewControls
Control for VIEW (moving, zooming, etc.)
GAL_TYPE m_backend
Currently used GAL.
Class CAIRO_GAL is the cairo implementation of the graphics abstraction layer.
void OnEvent(wxEvent &aEvent)
Used to forward events to the canvas from popups, etc.
Class WX_VIEW_CONTROLS is a specific implementation of class VIEW_CONTROLS for wxWidgets library.
void SetCurrentCursor(wxStockCursor aStockCursorID)
Function SetCurrentCursor Set the current cursor shape for this panel.
virtual bool SwitchBackend(GAL_TYPE aGalType)
Function SwitchBackend Switches method of rendering graphics.
virtual void GetMsgPanelInfo(EDA_UNITS_T aUnits, std::vector< MSG_PANEL_ITEM > &aList)
KIGFX::GAL_DISPLAY_OPTIONS & m_options
virtual void OnShow()
Function OnShow() Called when the window is shown for the first time.
void onLostFocus(wxFocusEvent &aEvent)
Sentinel, do not use as a parameter.
void onShowTimer(wxTimerEvent &aEvent)
The base class for create windows for drawing purpose.
not specified: a GAL engine must be set by the client
void onRefreshTimer(wxTimerEvent &aEvent)
bool m_drawing
Timer to prevent too-frequent refreshing.
wxWindow * m_parent
Current mouse cursor shape id.
virtual void onPaint(wxPaintEvent &WXUNUSED(aEvent))
GAL not used (the legacy wxDC engine is used)
static const int MinRefreshPeriod
60 FPS.
std::unique_ptr< KIGFX::PAINTER > m_painter
Contains information about how to draw items using GAL.
double GetLegacyZoom() const
Function GetLegacyZoom() Returns current view scale converted to zoom value used by the legacy canvas...
virtual void SetTopLayer(int aLayer)
Function SetTopLayer Moves the selected layer to the top, so it is displayed above all others.
void SetStealsFocus(bool aStealsFocus)
Set whether focus is taken on certain events (mouseover, keys, etc).
Class VIEW_CONTROLS is an interface for classes handling user events controlling the view behaviour (...
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)
KIGFX::GAL * GetGAL() const
Function GetGAL() Returns a pointer to the GAL instance used in the panel.
bool m_lostFocus
Flag to indicate that focus should be regained on the next mouse event.
virtual KIGFX::VIEW * GetView() const
Function GetView() Returns a pointer to the VIEW instance used in the panel.
virtual void SetFocus() override
void onSetCursor(wxSetCursorEvent &event)
EDA_DRAW_FRAME * m_edaFrame
Pointer to the parent window.
void onSize(wxSizeEvent &aEvent)
void StartDrawing()
Function StartDrawing() Begins drawing if it was stopped previously.
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.
wxTimer m_onShowTimer
Timer used to execute OnShow() when the window finally appears on the screen.
KIGFX::VIEW * m_view
Stores view settings (scale, center, etc.) and items to be drawn.
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
void SetEventDispatcher(TOOL_DISPATCHER *aEventDispatcher)
Function SetEventDispatcher() Sets a dispatcher that processes events and forwards them to tools.
EDA_DRAW_FRAME * GetParentEDAFrame() const
Function GetParentEDAFrame() Returns parent EDA_DRAW_FRAME, if available or NULL otherwise.
bool m_drawingEnabled
Flag that determines if VIEW may use GAL for redrawing the screen.
wxLongLong m_lastRefresh
Parent EDA_DRAW_FRAME (if available)
GAL_TYPE GetBackend() const
Function GetBackend Returns the type of backend currently used by GAL canvas.
void onEnter(wxEvent &aEvent)
bool m_stealsFocus
Flag to indicate whether the panel should take focus at certain times (when moused over,...
Message panel definition file.
virtual BOX2I GetDefaultViewBBox() const
Returns the bounding box of the view that should be used if model is not valid For example,...
void StopDrawing()
Function StopDrawing() Prevents the GAL canvas from further drawing till it is recreated or StartDraw...
Class GAL is the abstract interface for drawing on a 2D-surface.