63 EVT_CLOSE( DISPLAY_FOOTPRINTS_FRAME::OnCloseWindow )
71 wxDefaultPosition, wxDefaultSize,
73 m_currentComp(
nullptr )
80 SetBoard(
new BOARD() );
85 SetScreen(
new PCB_SCREEN( GetPageSizeIU() ) );
89 GetGalDisplayOptions(),
91 SetCanvas( gal_drawPanel );
102 gal_drawPanel->GetViewControls(),
config(),
this );
105 gal_drawPanel->SetEventDispatcher( m_toolDispatcher );
108 m_toolManager->RegisterTool(
new ZOOM_TOOL );
114 m_toolManager->InitTools();
119 m_toolManager->InvokeTool(
"cvpcb.FootprintViewerInteractiveSelection" );
123 ReCreateOptToolbar();
125 m_auimgr.SetManagedWindow(
this );
128 m_auimgr.AddPane( m_mainToolBar,
EDA_PANE().HToolbar().Name( wxS(
"MainToolbar" ) )
130 m_auimgr.AddPane( m_optionsToolBar,
EDA_PANE().VToolbar().Name( wxS(
"OptToolbar" ) )
131 .Left().Layer( 3 ) );
132 m_auimgr.AddPane( GetCanvas(),
EDA_PANE().Canvas().Name( wxS(
"DrawFrame" ) )
134 m_auimgr.AddPane( m_messagePanel,
EDA_PANE().Messages().Name( wxS(
"MsgPanel" ) )
135 .Bottom().Layer( 6 ) );
137 FinishAUIInitialization();
139 auto& galOpts = GetGalDisplayOptions();
140 galOpts.m_axesEnabled =
true;
156 toolOpt->SetState( wxAUI_BUTTON_STATE_CHECKED );
158 toolOpt->SetState( 0 );
170 UpdateToolbarControlSizes();
185 GetCanvas()->SetEvtHandlerEnabled(
false );
202#define CHECK( x ) ACTION_CONDITIONS().Check( x )
318 _(
"Automatic Zoom on footprint change" ),
404 if( fpid.
Parse( aFootprintName ) >= 0 )
406 aReporter.
Report( wxString::Format(
_(
"Footprint ID '%s' is not valid." ),
421 aReporter.
Report( wxString::Format(
_(
"Library '%s' is not in the footprint library table." ),
430 aReporter.
Report( wxString::Format(
_(
"Footprint '%s' not found." ), aFootprintName ),
456 aReporter.
Report( wxString::Format(
_(
"Footprint '%s' not found." ), aFootprintName ),
493 if( footprintName.IsEmpty() && comp )
505 if( !footprintName.IsEmpty() )
507 SetTitle( wxString::Format(
_(
"Footprint: %s" ), footprintName ) );
509 footprint =
GetFootprint( footprintName, infoReporter );
535 SetStatusText( wxString::Format(
_(
"Lib: %s" ), fpInfo->
GetLibNickname() ), 0 );
537 SetStatusText( wxEmptyString, 0 );
560 if( toolOpt->GetState() & wxAUI_BUTTON_STATE_CHECKED )
572 std::vector<MSG_PANEL_ITEM> items;
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
wxBitmap KiScaledBitmap(BITMAPS aBitmap, wxWindow *aWindow, int aHeight, bool aQuantized)
Construct a wxBitmap from a memory record, scaling it if device DPI demands it.
static TOOL_ACTION toggleGrid
static TOOL_ACTION zoomRedraw
static TOOL_ACTION millimetersUnits
static TOOL_ACTION show3DViewer
static TOOL_ACTION zoomOutCenter
static TOOL_ACTION togglePolarCoords
static TOOL_ACTION milsUnits
static TOOL_ACTION centerContents
static TOOL_ACTION inchesUnits
static TOOL_ACTION toggleCursorStyle
static TOOL_ACTION measureTool
static TOOL_ACTION selectionTool
static TOOL_ACTION zoomFitScreen
static TOOL_ACTION zoomTool
static TOOL_ACTION zoomInCenter
Manage TOOL_ACTION objects.
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...
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
int m_SolderMaskExpansion
Abstract interface for BOARD_ITEMs capable of storing other items inside.
Information pertinent to a Pcbnew printed circuit board.
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false) override
Removes an item from the container.
void SetBoardUse(BOARD_USE aUse)
Set what the board is going to be used for.
FOOTPRINT * GetFirstFootprint() const
Get the first footprint on the board or nullptr.
void DeleteAllFootprints()
Remove all footprints from the deque and free the memory associated with them.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Color settings are a bit different than most of the settings objects in that there can be more than o...
Used to store the component pin name to net name (and pin function) associations stored in a netlist.
const wxString & GetPinFunction() const
Store all of the related footprint information found in a netlist.
const COMPONENT_NET & GetNet(unsigned aIndex) const
const LIB_ID & GetFPID() const
Gather all the actions that are shared by tools.
The CvPcb application main window.
wxString GetSelectedFootprint()
FOOTPRINT_LIST * m_FootprintsList
COMPONENT * GetSelectedComponent()
Get the selected component from the component listbox.
MAGNETIC_SETTINGS m_FootprintViewerMagneticSettings
WINDOW_SETTINGS m_FootprintViewer
double m_FootprintViewerZoom
bool m_FootprintViewerAutoZoomOnSelect
PCB_DISPLAY_OPTIONS m_FootprintViewerDisplayOptions
virtual void setupUIConditions()
Setup the UI conditions for the various actions and their controls in this frame.
static constexpr int KICAD_AUI_TB_STYLE
< Default style flags used for wxAUI toolbars.
wxChoice * m_gridSelectBox
void OnSelectGrid(wxCommandEvent &event)
Command event handler for selecting grid sizes.
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
ACTION_TOOLBAR * m_optionsToolBar
void UpdateGridSelectBox()
Rebuild the grid combobox to respond to any changes in the GUI (units, user grid changes,...
void UpdateZoomSelectBox()
Rebuild the grid combobox to respond to any changes in the GUI (units, user grid changes,...
virtual void OnSelectZoom(wxCommandEvent &event)
Set the zoom factor when selected by the zoom list box in the main tool bar.
virtual void SetScreen(BASE_SCREEN *aScreen)
ACTION_TOOLBAR * m_mainToolBar
wxChoice * m_zoomSelectBox
static constexpr GAL_TYPE GAL_FALLBACK
void StopDrawing()
Prevent the GAL canvas from further drawing until it is recreated or StartDrawing() is called.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
A base class for most all the KiCad significant classes used in schematics and boards.
virtual void SetParent(EDA_ITEM *aParent)
Specialization of the wxAuiPaneInfo class for KiCad panels.
SELECTION_CONDITION CurrentTool(const TOOL_ACTION &aTool)
Create a functor testing if the specified tool is the current active tool in the frame.
SELECTION_CONDITION Units(EDA_UNITS aUnit)
Create a functor that tests if the frame has the specified units.
SELECTION_CONDITION GridVisible()
Create a functor testing if the grid is visible in a frame.
SELECTION_CONDITION FullscreenCursor()
Create a functor testing if the cursor is full screen in a frame.
const FOOTPRINT * GetEnumeratedFootprint(const wxString &aNickname, const wxString &aFootprintName)
A version of FootprintLoad() for use after FootprintEnumerate() for more efficient cache management.
bool FootprintExists(const wxString &aNickname, const wxString &aFootprintName)
Indicates whether or not the given footprint already exists in the given library.
A wrapper for reporting to a WX_INFOBAR UI element.
void Finalize()
Update the infobar with the reported text.
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
virtual const wxString What() const
A composite of Problem() and Where()
A color representation with 4 components: red, green, blue, alpha.
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...
void Clear()
Remove all items from the view.
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
A logical library item identifier and consists of various portions much like a URI.
int Parse(const UTF8 &aId, bool aFix=false)
Parse LIB_ID with the information from aId.
const UTF8 & GetLibItemName() const
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
bool HasLibrary(const wxString &aNickname, bool aCheckEnabled=false) const
Test for the existence of aNickname in the library table.
static TOOL_ACTION padDisplayMode
static TOOL_ACTION graphicsOutlines
Display footprint graphics as outlines.
static TOOL_ACTION textOutlines
Display texts as lines.
static TOOL_ACTION showPadNumbers
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
const PCB_DISPLAY_OPTIONS & GetDisplayOptions() const
Display options control the way tracks, vias, outlines and other things are shown (for instance solid...
void LoadSettings(APP_SETTINGS_BASE *aCfg) override
Load common frame parameters from a configuration file.
void setFPWatcher(FOOTPRINT *aFootprint)
Creates (or removes) a watcher on the specified footprint.
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
void SaveSettings(APP_SETTINGS_BASE *aCfg) override
Save common frame parameters to a configuration data file.
PCB_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
void SetDisplayOptions(const PCB_DISPLAY_OPTIONS &aOptions, bool aRefresh=true)
Updates the current display options from the given options struct.
virtual void Update3DView(bool aMarkDirty, bool aRefresh, const wxString *aTitle=nullptr)
Update the 3D view, if the viewer is opened by this frame.
virtual void UpdateStatusBar() override
Update the status bar information.
void UpdateColors()
Update the color settings in the painter and GAL.
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
void DisplayBoard(BOARD *aBoard, PROGRESS_REPORTER *aReporter=nullptr)
Add all items from the current board to the VIEW, so they can be displayed by GAL.
Group generic conditions for PCB editor states.
SELECTION_CONDITION PadFillDisplay()
Create a functor that tests if the frame fills the pads.
SELECTION_CONDITION GraphicsFillDisplay()
Create a functor that tests if the frame fills graphics items.
SELECTION_CONDITION PadNumbersDisplay()
Create a functor that tests if the pad numbers are displayed.
SELECTION_CONDITION TextFillDisplay()
Create a functor that tests if the frame fills text items.
virtual SETTINGS_MANAGER & GetSettingsManager() const
static FP_LIB_TABLE * PcbFootprintLibs(PROJECT *aProject)
Return the table of footprint libraries without Kiway.
A pure virtual class used to derive REPORTER objects from.
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)=0
Report a string with a given severity.
T * GetAppSettings()
Returns a handle to the a given settings by type If the settings have already been loaded,...
COLOR_SETTINGS * GetColorSettings(const wxString &aName="user")
Retrieves a color settings object that applications can read colors from.
const char * c_str() const
void Dismiss() override
Dismisses the infobar and updates the containing layout and AUI manager (if one is provided).
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
This file is part of the common library.
@ ID_CVPCB_FPVIEWER_AUTOZOOM_TOOL
#define KICAD_DEFAULT_DRAWFRAME_STYLE
This file contains miscellaneous commonly used macros and functions.
Message panel definition file.
PGM_BASE & Pgm()
The global Program "get" accessor.
wxString From_UTF8(const char *cstring)
Stores the common settings that are saved and loaded for each window / frame.
VECTOR2< int32_t > VECTOR2I