40 #define ID_MATCH_FP_ALL 4200 41 #define ID_MATCH_FP_SELECTED 4201 42 #define ID_MATCH_FP_REF 4202 43 #define ID_MATCH_FP_VAL 4203 44 #define ID_MATCH_FP_ID 4204 62 bool updateMode,
bool selectedMode ) :
66 m_currentFootprint( aFootprint ),
67 m_updateMode( updateMode )
71 SetTitle(
_(
"Change Footprints" ) );
72 m_matchAll->SetLabel(
_(
"Change all footprints on board" ) );
83 #if 0 // translator hint 84 wxString x =
_(
"Update/reset strings: there are two cases these descriptions need to cover: " 85 "the user made overrides to a footprint on the PCB and wants to remove them, " 86 "or the user made changes to the library footprint and wants to propagate " 87 "them back to the PCB." );
129 wxCommandEvent event;
130 event.SetEventObject(
this );
197 return aFootprint->
GetFPID() == specifiedID;
213 default:
return nullptr;
222 wxRadioButton* rb_butt_list[] =
235 for(
int ii = 0; rb_butt_list[ii]; ++ii )
237 bool state = rb_butt_list[ii] == rb_button;
239 if( rb_butt_list[ii]->GetValue() != state )
240 rb_butt_list[ii]->SetValue( state );
249 if( event.GetEventObject() == this )
260 if( event.GetEventObject() == this )
271 if( event.GetEventObject() == this )
282 if( event.GetEventObject() == this )
293 if( event.GetEventObject() == this )
371 msg.Printf(
_(
"Update footprint %s from '%s' to '%s'" ),
378 msg.Printf(
_(
"Change footprint %s from '%s' to '%s'" ),
388 msg <<
": " <<
_(
"*** footprint not found ***" );
411 bool resetText,
bool resetTextLayers,
bool resetTextEffects )
416 if( !resetTextLayers )
422 if( !resetTextEffects )
434 std::vector<FP_TEXT*> candidates;
438 FP_TEXT* candidate = dyn_cast<FP_TEXT*>( item );
441 candidates.push_back( candidate );
444 if( candidates.size() == 0 )
447 if( candidates.size() == 1 )
448 return candidates[0];
451 std::vector<FP_TEXT*> candidatesOnSameLayer;
453 for(
FP_TEXT* candidate : candidates )
455 if( candidate->GetLayer() == aRefItem->
GetLayer() )
456 candidatesOnSameLayer.push_back( candidate );
459 if( candidatesOnSameLayer.size() == 1 )
460 return candidatesOnSameLayer[0];
463 std::vector<FP_TEXT*> candidatesAtSamePos;
465 for(
FP_TEXT* candidate : candidatesOnSameLayer.size() ? candidatesOnSameLayer : candidates )
467 if( candidate->GetPos0() == aRefItem->
GetPos0() )
468 candidatesAtSamePos.push_back( candidate );
471 if( candidatesAtSamePos.size() > 0 )
472 return candidatesAtSamePos[0];
473 else if( candidatesOnSameLayer.size() > 0 )
474 return candidatesOnSameLayer[0];
476 return candidates[0];
482 bool resetTextLayers,
bool resetTextEffects,
483 bool resetFabricationAttrs,
bool reset3DModels )
526 resetTextLayers, resetTextEffects );
533 resetTextLayers, resetTextEffects );
538 FP_TEXT* srcItem = dyn_cast<FP_TEXT*>( item );
545 processTextItem( *srcItem, *destItem,
false, resetTextLayers, resetTextEffects );
546 else if( !deleteExtraTexts )
551 if( !resetFabricationAttrs )
563 aCommit.
Remove( aExisting );
572 wxString newname =
m_newID->GetValue();
virtual bool ShowModal(wxString *aResult=nullptr, wxWindow *aResultantFocusWindow=nullptr)
Show this wxFrame as if it were a modal dialog, with all other instantiated wxFrames disabled until t...
PCB_GROUP * GetParentGroup() const
bool AddItem(BOARD_ITEM *aItem)
Add item to group.
void SetLazyUpdate(bool aLazyUpdate)
Forces updating the HTML page, after the report is built in lazy mode If aSort = true,...
A wxFrame capable of the OpenProjectFiles function, meaning it can load a portion of a KiCad project.
const UTF8 & GetLibItemName() const
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
static wxString FROM_UTF8(const char *cstring)
Convert a UTF8 encoded C string to a wxString for all wxWidgets build modes.
void Compile_Ratsnest(bool aDisplayStatus)
Create the entire board ratsnest.
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
COMMIT & Add(EDA_ITEM *aItem)
Notify observers that aItem has been added.
A set of BOARD_ITEMs (i.e., without duplicates).
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
void Flush(bool aSort=false)
Set the visible severity filter.
void SetVisible(bool aVisible)
bool GetLocalRatsnestVisible() const
static LIB_PART * dummy()
Used to draw a dummy shape when a LIB_PART is not found in library.
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
void SetLocalRatsnestVisible(bool aVisible)
A logical library item identifier and consists of various portions much like a URI.
bool IsValid() const
Check if this LID_ID is valid.
PCBNEW_SETTINGS * m_settings
void SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
virtual void SetParent(EDA_ITEM *aParent)
void PlaceFootprint(FOOTPRINT *aFootprint, bool aRecreateRatsnest=true)
Places aFootprint at the current cursor position and updates footprint coordinates with the new posit...
const char * c_str() const
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
void ExchangeFootprint(FOOTPRINT *aExisting, FOOTPRINT *aNew, BOARD_COMMIT &aCommit, bool deleteExtraTexts=true, bool resetTextLayers=true, bool resetTextEffects=true, bool resetFabricationAttrs=true, bool reset3DModels=true)
Replace aExisting footprint by aNew footprint using the Existing footprint settings (position,...
virtual void SetText(const wxString &aText)
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
bool WildCompareString(const wxString &pattern, const wxString &string_to_tst, bool case_sensitive)
Compare a string against wild card (* and ?) pattern using the usual rules.
FOOTPRINTS & Footprints()
FOOTPRINT * LoadFootprint(const LIB_ID &aFootprintId)
Attempt to load aFootprintId from the footprint library table.
bool RemoveItem(BOARD_ITEM *aItem)
Remove item from group.
COMMIT & Remove(EDA_ITEM *aItem)
Notify observers that aItem has been removed.
const BITMAP_OPAQUE small_library_xpm[1]
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 Report(const wxString &aText, SEVERITY aSeverity, REPORTER::LOCATION aLocation=REPORTER::LOC_BODY)
Reports the string.
void SetEffects(const FP_TEXT &aSrc)
Set the text effects from another instance.
const wxPoint & GetPos0() const
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
int Parse(const UTF8 &aId, bool aFix=false)
Parse LIB_ID with the information from aId.
void Clear()
return the number of messages matching the given severity mask.
The main frame for Pcbnew.
virtual void Push(const wxString &aMessage=wxT("A commit"), bool aCreateUndoEntry=true, bool aSetDirtyBit=true) override
Revert the commit by restoring the modified items state.
bool Destroy() override
Our version of Destroy() which is virtual from wxWidgets.
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
void SetFileName(const wxString &aReportFileName)
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
static const int UNCONNECTED
Constant that forces initialization of a netinfo item to the NETINFO_ITEM ORPHANED (typically -1) whe...
const wxString & GetPinFunction() const
virtual const wxString & GetText() const
Return the string associated with the text object.