61 EVT_CLOSE( DISPLAY_FOOTPRINTS_FRAME::OnCloseWindow )
69 wxDefaultPosition, wxDefaultSize,
77 SetBoard(
new BOARD() );
82 SetScreen(
new PCB_SCREEN( GetPageSizeIU() ) );
86 GetGalDisplayOptions(),
88 SetCanvas( gal_drawPanel );
94 LoadSettings( config() );
97 auto displ_opts = GetDisplayOptions();
98 displ_opts.m_DisplayPadIsol =
false;
102 SetDisplayOptions( displ_opts );
107 gal_drawPanel->GetViewControls(), config(), this );
110 gal_drawPanel->SetEventDispatcher( m_toolDispatcher );
113 m_toolManager->RegisterTool(
new ZOOM_TOOL );
119 m_toolManager->InitTools();
124 m_toolManager->InvokeTool(
"cvpcb.FootprintViewerInteractiveSelection" );
128 ReCreateOptToolbar();
130 m_auimgr.SetManagedWindow(
this );
133 m_auimgr.AddPane( m_mainToolBar,
EDA_PANE().HToolbar().Name(
"MainToolbar" )
135 m_auimgr.AddPane( m_optionsToolBar,
EDA_PANE().VToolbar().Name(
"OptToolbar" )
136 .
Left().Layer( 3 ) );
137 m_auimgr.AddPane( GetCanvas(),
EDA_PANE().Canvas().Name(
"DrawFrame" )
139 m_auimgr.AddPane( m_messagePanel,
EDA_PANE().Messages().Name(
"MsgPanel" )
140 .Bottom().Layer( 6 ) );
142 FinishAUIInitialization();
144 auto& galOpts = GetGalDisplayOptions();
145 galOpts.m_axesEnabled =
true;
149 setupUnits( config() );
173 GetCanvas()->SetEvtHandlerEnabled(
false );
189 #define CHECK( x ) ACTION_CONDITIONS().Check( x ) 322 auto cfg = dynamic_cast<CVPCB_SETTINGS*>( aCfg );
350 wxCHECK( cfg,
nullptr );
358 wxCHECK( cfg,
nullptr );
375 if( fpid.
Parse( aFootprintName ) >= 0 )
390 if( !fpTable->HasLibrary( libNickname ) )
399 if( !fpTable->FootprintExists( libNickname, fpName ) )
408 const FOOTPRINT* fp = fpTable->GetEnumeratedFootprint( libNickname, fpName );
411 footprint = static_cast<FOOTPRINT*>( fp->
Duplicate() );
443 if( footprintName.IsEmpty() )
454 if( !footprintName.IsEmpty() )
458 footprint =
GetFootprint( footprintName, infoReporter );
469 SetStatusText( wxEmptyString, 0 );
516 return Pgm().GetSettingsManager().GetColorSettings( settings->m_ColorTheme );
518 return Pgm().GetSettingsManager().GetColorSettings();
539 wxCHECK( cfg,
false );
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
static TOOL_ACTION show3DViewer
const UTF8 & GetLibItemName() const
const BITMAP_OPAQUE icon_cvpcb_xpm[1]
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
FOOTPRINT_LIST * m_FootprintsList
static wxString FROM_UTF8(const char *cstring)
Convert a UTF8 encoded C string to a wxString for all wxWidgets build modes.
static TOOL_ACTION zoomInCenter
virtual APP_SETTINGS_BASE * config() const
Returns the settings object used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME.
This file is part of the common library.
SELECTION_CONDITION FullscreenCursor()
Create a functor testing if the cursor is full screen in a frame.
ACTION_TOOLBAR * m_optionsToolBar
virtual void SetScreen(BASE_SCREEN *aScreen)
static TOOL_ACTION zoomTool
virtual void Update3DView(bool aReloadRequest, const wxString *aTitle=nullptr)
Update the 3D view, if the viewer is opened by this frame.
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
SELECTION_CONDITION TextFillDisplay()
Create a functor that tests if the frame fills text items.
double m_FootprintViewerZoom
SELECTION_CONDITION CurrentTool(const TOOL_ACTION &aTool)
Create a functor testing if the specified tool is the current active tool in the frame.
static constexpr GAL_TYPE GAL_FALLBACK
virtual void setupUIConditions()
Setup the UI conditions for the various actions and their controls in this frame.
static TOOL_ACTION zoomFitScreen
static TOOL_ACTION millimetersUnits
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
void UpdateZoomSelectBox()
Rebuild the grid combobox to respond to any changes in the GUI (units, user grid changes,...
void SetDisplayOptions(const PCB_DISPLAY_OPTIONS &aOptions)
ACTION_TOOLBAR * m_mainToolBar
Manage TOOL_ACTION objects.
A pure virtual class used to derive REPORTER objects from.
A logical library item identifier and consists of various portions much like a URI.
void LoadSettings(APP_SETTINGS_BASE *aCfg) override
Load common frame parameters from a configuration file.
static TOOL_ACTION zoomFootprintAutomatically
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
const PCB_DISPLAY_OPTIONS & GetDisplayOptions() const
Display options control the way tracks, vias, outlines and other things are shown (for instance solid...
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)=0
Report a string with a given severity.
wxChoice * m_gridSelectBox
SELECTION_CONDITION PadFillDisplay()
Create a functor that tests if the frame fills the pads.
virtual void SetParent(EDA_ITEM *aParent)
static TOOL_ACTION zoomOutCenter
This file contains miscellaneous commonly used macros and functions.
const char * c_str() const
MAGNETIC_SETTINGS m_FootprintViewerMagneticSettings
const LIB_ID & GetFPID() const
void UpdateGridSelectBox()
Rebuild the grid combobox to respond to any changes in the GUI (units, user grid changes,...
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
static TOOL_ACTION measureTool
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT) override
Adds an item to the container.
Stores the common settings that are saved and loaded for each window / frame.
void Dismiss() override
Dismisses the infobar and updates the containing layout and AUI manager (if one is provided).
static TOOL_ACTION centerContents
FOOTPRINT * GetFirstFootprint() const
Gets the first footprint on the board or nullptr.
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
SELECTION_CONDITION GridVisible()
Create a functor testing if the grid is visible in a frame.
virtual const wxString What() const
A composite of Problem() and Where()
SELECTION_CONDITION Units(EDA_UNITS aUnit)
Create a functor that tests if the frame has the specified units.
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
void DisplayBoard(BOARD *aBoard)
Add all items from the current board to the VIEW, so they can be displayed by GAL.
void Clear()
Remove all items from the view.
static TOOL_ACTION toggleGrid
static TOOL_ACTION showPadNumbers
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
static TOOL_ACTION inchesUnits
wxChoice * m_zoomSelectBox
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
static TOOL_ACTION togglePolarCoords
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.
bool m_FootprintViewerAutoZoom
WINDOW_SETTINGS m_FootprintViewer
#define KICAD_DEFAULT_DRAWFRAME_STYLE
void Finalize()
Update the infobar with the reported text.
Gather all the actions that are shared by tools.
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
Specialization of the wxAuiPaneInfo class for KiCad panels.
void SetConditions(const TOOL_ACTION &aAction, const ACTION_CONDITIONS &aConditions)
Set the conditions the UI elements for activating a specific tool action should use for determining t...
static TOOL_ACTION milsUnits
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...
void UpdateColors()
Update the color settings in the painter and GAL.
COMPONENT is used to store components and all of their related information found in a netlist.
void SaveSettings(APP_SETTINGS_BASE *aCfg) override
Save common frame parameters to a configuration data file.
SELECTION_CONDITION PadNumbersDisplay()
Create a functor that tests if the pad numbers are displayed.
virtual FP_LIB_TABLE * PcbFootprintLibs(KIWAY &aKiway)
Return the table of footprint libraries.
static TOOL_ACTION padDisplayMode
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
static TOOL_ACTION graphicsOutlines
Display footprint graphics as outlines.
wxString GetSelectedFootprint()
int Parse(const UTF8 &aId, bool aFix=false)
Parse LIB_ID with the information from aId.
virtual void UpdateStatusBar() override
Update the status bar information.
void OnSelectGrid(wxCommandEvent &event)
Command event handler for selecting grid sizes.
SELECTION_CONDITION GraphicsFillDisplay()
Create a functor that tests if the frame fills graphics items.
Information pertinent to a Pcbnew printed circuit board.
static TOOL_ACTION zoomRedraw
COMPONENT * GetSelectedComponent()
Get the selected component from the component listbox.
A base class for most all the KiCad significant classes used in schematics and boards.
PCB_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
std::vector< MSG_PANEL_ITEM > MSG_PANEL_ITEMS
PCB_DISPLAY_OPTIONS m_FootprintViewerDisplayOptions
static constexpr int KICAD_AUI_TB_STYLE
< Default style flags used for wxAUI toolbars.
bool Destroy() override
Our version of Destroy() which is virtual from wxWidgets.
Color settings are a bit different than most of the settings objects in that there can be more than o...
void DeleteAllFootprints()
Removes all footprints from the deque and frees the memory associated with them.
wxString GetUniStringLibId() const
static TOOL_ACTION toggleCursorStyle
GERBVIEW_FRAME::OnZipFileHistory GERBVIEW_FRAME::OnSelectDisplayMode EVT_CHOICE(ID_GBR_AUX_TOOLBAR_PCB_APERATTRIBUTES_CHOICE, GERBVIEW_FRAME::OnSelectHighlightChoice) EVT_UPDATE_UI(ID_TOOLBARH_GERBVIEW_SELECT_ACTIVE_LAYER
Abstract interface for BOARD_ITEMs capable of storing other items inside.
Message panel definition file.
Group generic conditions for PCB editor states.
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
A wrapper for reporting to a WX_INFOBAR UI element.
void StopDrawing()
Prevent the GAL canvas from further drawing until it is recreated or StartDrawing() is called.
void SetBoardUse(BOARD_USE aUse)
Set what the board is going to be used for.
static TOOL_ACTION selectionTool
The CvPcb application main window.
virtual void OnSelectZoom(wxCommandEvent &event)
Set the zoom factor when selected by the zoom list box in the main tool bar.
static TOOL_ACTION textOutlines
Display texts as lines.
A color representation with 4 components: red, green, blue, alpha.