45using namespace std::placeholders;
99 if( is_last_fp_from_brd )
142 wxASSERT( aFootprint );
158 wxCHECK( aFootprint, );
162 if( aTreeItem.IsOk() )
179 wxDataViewItem treeItem =
m_adapter->FindItem( oldFPID );
189 switch( aItem->
Type() )
229 ZONE* zone =
static_cast<ZONE*
>( aItem );
230 bool success =
false;
233 zoneSettings << *static_cast<ZONE*>( aItem );
252 commit.
Push(
_(
"Edit Zone" ) );
268 wxFAIL_MSG( wxT(
"FOOTPRINT_EDIT_FRAME::OnEditItemRequest: unsupported item type " )
302 if(
GetBoard()->GetFirstFootprint() )
315 const std::string& payload = mail.
GetPayload();
320 if( !payload.empty() )
322 wxFileName fpFileName( payload );
323 wxString libNickname;
331 msg.Printf(
_(
"The current configuration does not include a library named '%s'.\n"
332 "Use Manage Footprint Libraries to edit the configuration." ),
333 fpFileName.GetPath() );
341 if( !libTable->
HasLibrary( libNickname,
true ) )
343 msg.Printf(
_(
"The library '%s' is not enabled in the current configuration.\n"
344 "Use Manage Footprint Libraries to edit the configuration." ),
350 LIB_ID fpId( libNickname, fpFileName.GetName() );
355 wxCommandEvent event( SYMBOL_SELECTED );
@ NORMAL
Inactive layers are shown normally (no high-contrast mode)
void SetContentModified(bool aModified=true)
virtual void Push(const wxString &aMessage=wxT("A commit"), int aCommitFlags=0) override
Revert the commit by restoring the modified items state.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
FOOTPRINT * GetFirstFootprint() const
Get the first footprint on the board or nullptr.
COLOR4D GetColor(int aLayer) const
COMMIT & Modify(EDA_ITEM *aItem)
Create an undo entry for an item that has been already modified.
void ReCreateMenuBar()
Recreates the menu bar.
virtual void Zoom_Automatique(bool aWarpPointer)
Redraw the screen with best zoom level and the best centering that shows all the page or the board.
KIGFX::VIEW_CONTROLS * GetViewControls() const
Return a pointer to the #VIEW_CONTROLS instance used in the panel.
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...
KICAD_T Type() const
Returns the type of object.
void ClearFlags(EDA_ITEM_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
virtual wxString GetClass() const =0
Return the class name.
virtual void SetText(const wxString &aText)
void SetType(TEXT_TYPE aType)
A color representation with 4 components: red, green, blue, alpha.
virtual void SetCrossHairCursorPosition(const VECTOR2D &aPosition, bool aWarpView=true)=0
Move the graphic crosshair cursor to the requested position expressed in world coordinates.
Carry a payload from one KIWAY_PLAYER to another within a PROJECT.
std::string & GetPayload()
Return the payload, which can be any text but it typically self identifying s-expression.
MAIL_T Command()
Returns the MAIL_T associated with this mail.
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
int GetLayerSelection() const
A logical library item identifier and consists of various portions much like a URI.
const UTF8 & GetLibItemName() const
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Hold a record identifying a library accessed by the appropriate plug in object in the LIB_TABLE.
const wxString & GetNickName() const
bool HasLibrary(const wxString &aNickname, bool aCheckEnabled=false) const
Test for the existence of aNickname in the library table.
const LIB_TABLE_ROW * FindRowByURI(const wxString &aURI)
void RefreshLibTree()
Refreshes the tree (mainly to update highlighting and asterisking)
void CenterLibId(const LIB_ID &aLibId)
Ensure that an item is visible (preferably centered).
void SelectLibId(const LIB_ID &aLibId)
Select an item in the tree widget.
void ExpandLibId(const LIB_ID &aLibId)
Expand and item i the tree widget.
static TOOL_ACTION layerChanged
static TOOL_ACTION groupProperties
int ShowTextBoxPropertiesDialog(BOARD_ITEM *aText)
void ShowGraphicItemPropertiesDialog(BOARD_ITEM *aItem)
APPEARANCE_CONTROLS * m_appearancePanel
void ShowBitmapPropertiesDialog(BOARD_ITEM *aBitmap)
Set the angle used for rotate operations.
void ShowTextPropertiesDialog(BOARD_ITEM *aText)
void ShowPadPropertiesDialog(PAD *aPad)
const PCB_DISPLAY_OPTIONS & GetDisplayOptions() const
Display options control the way tracks, vias, outlines and other things are shown (for instance solid...
FOOTPRINT * LoadFootprint(const LIB_ID &aFootprintId)
Attempt to load aFootprintId from the footprint library table.
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
PCB_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
virtual void SetActiveLayer(PCB_LAYER_ID aLayer)
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 SetHighContrastLayer(int aLayer) override
SetHighContrastLayer(), with some extra smarts for PCB.
virtual FP_LIB_TABLE * PcbFootprintLibs(KIWAY &aKiway)
Return the table of footprint libraries.
ZONE_SETTINGS handles zones parameters.
void ExportSetting(ZONE &aTarget, bool aFullExport=true) const
Function ExportSetting copy settings to a given zone.
Handle a list of polygons defining a copper zone.
bool GetIsRuleArea() const
Accessors to parameters used in Rule Area zones:
bool IsOnCopperLayer() const override
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
This file is part of the common library.
int InvokeCopperZonesEditor(PCB_BASE_FRAME *aCaller, ZONE_SETTINGS *aSettings, CONVERT_SETTINGS *aConvertSettings)
Function InvokeCopperZonesEditor invokes up a modal dialog window for copper zone editing.
int InvokeNonCopperZonesEditor(PCB_BASE_FRAME *aParent, ZONE_SETTINGS *aSettings, CONVERT_SETTINGS *aConvertSettings)
Function InvokeNonCopperZonesEditor invokes up a modal dialog window for non-copper zone editing.
int InvokeRuleAreaEditor(PCB_BASE_FRAME *aCaller, ZONE_SETTINGS *aZoneSettings, CONVERT_SETTINGS *aConvertSettings)
Function InvokeRuleAreaEditor invokes up a modal dialog window for copper zone editing.
PCB_LAYER_ID
A quick note on layer IDs:
PCB_LAYER_ID ToLAYER_ID(int aLayer)
@ PCB_FP_DIM_ALIGNED_T
class PCB_DIM_ALIGNED, a linear dimension (graphic item)
@ PCB_FP_SHAPE_T
class FP_SHAPE, a footprint edge
@ PCB_FP_TEXTBOX_T
class FP_TEXTBOX, wrapped text in a footprint
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs
@ PCB_FP_DIM_CENTER_T
class PCB_DIM_CENTER, a center point marking (graphic item)
@ PCB_MARKER_T
class PCB_MARKER, a marker used to show something
@ PCB_FP_DIM_ORTHOGONAL_T
class PCB_DIM_ORTHOGONAL, a linear dimension constrained to x/y
@ PCB_FP_DIM_LEADER_T
class PCB_DIM_LEADER, a leader dimension (graphic item)
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
@ PCB_FP_ZONE_T
class ZONE, managed by a footprint
@ PCB_BITMAP_T
class PCB_BITMAP, bitmap on a layer
@ PCB_FP_DIM_RADIAL_T
class PCB_DIM_RADIAL, a radius or diameter dimension
@ PCB_PAD_T
class PAD, a pad in a footprint
@ PCB_FP_TEXT_T
class FP_TEXT, text in a footprint
VECTOR2< double > VECTOR2D