39 #include <wx/stattext.h> 43 std::unique_ptr<KIGFX::GAL_DISPLAY_OPTIONS> aOpts,
45 PCB_DRAW_PANEL_GAL( aParent, -1, wxPoint( 0, 0 ), wxSize( 200, 200 ), *aOpts, aGalType ),
47 m_displayOptions(
std::
move( aOpts ) ),
48 m_currentFootprint( nullptr )
51 ShowScrollbars( wxSHOW_SB_NEVER, wxSHOW_SB_NEVER );
52 EnableScrolling(
false,
false );
78 auto settings = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( painter->
GetSettings() );
80 return settings->GetBackgroundColor();
87 auto settings = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( painter->
GetSettings() );
89 return settings->GetCursorColor();
111 auto settings = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( painter->
GetSettings() );
162 return static_cast<wxWindow*>(
this );
180 std::unique_ptr<KIGFX::GAL_DISPLAY_OPTIONS> gal_opts;
182 gal_opts = std::make_unique<KIGFX::GAL_DISPLAY_OPTIONS>();
183 gal_opts->ReadConfig( *
Pgm().GetCommonSettings(), cfg->
m_Window, aParent );
188 panel->UpdateColors();
192 panel->GetGAL()->SetGridVisibility( gridCfg.
show );
195 int gridIdx = std::max( 0, std::min( gridCfg.
last_size_idx, (
int) gridCfg.
sizes.size() - 1 ) );
197 panel->GetGAL()->SetGridSize(
VECTOR2D( gridSize, gridSize ) );
A mix in class which holds the location of a wxWindow's KIWAY.
const UTF8 & GetLibItemName() const
void SetViewport(const BOX2D &aViewport)
Set the visible area of the VIEW.
A logical library item identifier and consists of various portions much like a URI.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
std::vector< double > zoom_factors
virtual void Remove(VIEW_ITEM *aItem) override
Remove a VIEW_ITEM from the view.
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
Contains all the knowledge about how to draw graphical object onto any particular output device.
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const override
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
std::vector< wxString > sizes
VECTOR2< double > VECTOR2D
long long int ValueFromString(EDA_UNITS aUnits, const wxString &aTextValue, EDA_DATA_TYPE aType)
Function ValueFromString converts aTextValue in aUnits to internal units used by the application.
void Clear()
Remove all items from the view.
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
Inactive layers are shown normally (no high-contrast mode)
void SetStealsFocus(bool aStealsFocus)
Set whether focus is taken on certain events (mouseover, keys, etc).
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Modify the position and size of the rectangle in order to contain aRect.
void SyncLayersVisibility(const BOARD *aBoard)
Update "visibility" property of each layer of a given BOARD.
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
void StartDrawing()
Begin drawing if it was stopped previously.
void UpdateColors()
Update the color settings in the painter and GAL.
const FOOTPRINT * GetEnumeratedFootprint(const wxString &aNickname, const wxString &aFootprintName)
A version of FootprintLoad() for use after FootprintEnumerate() for more efficient cache management.
virtual FP_LIB_TABLE * PcbFootprintLibs(KIWAY &aKiway)
Return the table of footprint libraries.
virtual void SetScale(double aScale, VECTOR2D aAnchor={ 0, 0 })
Set the scaling factor, zooming around a given anchor point.
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
void SetVisible(VIEW_ITEM *aItem, bool aIsVisible=true)
Set the item visibility.
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1) override
Add a VIEW_ITEM to the view.
const Vec & GetSize() const
const Vec & GetOrigin() const
virtual const std::vector< wxString > DefaultGridSizeList() const
By default, this returns the list of grids available in PcbNew-based applications.
Common grid settings, available to every frame.
A color representation with 4 components: red, green, blue, alpha.