KiCad PCB EDA Suite
dialog_exchange_footprints.cpp File Reference
#include <fctsys.h>
#include <kicad_string.h>
#include <class_drawpanel.h>
#include <pcb_edit_frame.h>
#include <macros.h>
#include <board_commit.h>
#include <bitmaps.h>
#include <class_board.h>
#include <class_module.h>
#include <project.h>
#include <wx_html_report_panel.h>
#include <kiway.h>
#include <dialog_exchange_footprints.h>

Go to the source code of this file.


#define ID_MATCH_FP_ALL   4200
#define ID_MATCH_FP_SELECTED   4201
#define ID_MATCH_FP_REF   4202
#define ID_MATCH_FP_VAL   4203
#define ID_MATCH_FP_ID   4204


void processTextItem (const TEXTE_MODULE &aSrc, TEXTE_MODULE &aDest, bool resetText, bool resetTextLayers, bool resetTextEffects)
TEXTE_MODULEgetMatchingTextItem (TEXTE_MODULE *aRefItem, MODULE *aModule)


int g_matchModeForUpdate = ID_MATCH_FP_ALL
int g_matchModeForUpdateSelected = ID_MATCH_FP_SELECTED
int g_matchModeForExchange = ID_MATCH_FP_REF
int g_matchModeForExchangeSelected = ID_MATCH_FP_SELECTED

Macro Definition Documentation

Function Documentation

TEXTE_MODULE* getMatchingTextItem ( TEXTE_MODULE aRefItem,
MODULE aModule 

Definition at line 393 of file dialog_exchange_footprints.cpp.

References dyn_cast(), DLIST< T >::GetFirst(), EDA_TEXT::GetText(), MODULE::GraphicalItemsList(), and BOARD_ITEM::Next().

Referenced by PCB_EDIT_FRAME::Exchange_Module().

394 {
395  for( auto iItem = aModule->GraphicalItemsList().GetFirst(); iItem; iItem = iItem->Next() )
396  {
397  TEXTE_MODULE* candidate = dyn_cast<TEXTE_MODULE*>( iItem );
399  if( candidate && candidate->GetText() == aRefItem->GetText() )
400  return candidate;
401  }
403  return nullptr;
404 }
Casted dyn_cast(From aObject)
Function dyn_cast()
Definition: typeinfo.h:61
BOARD_ITEM * Next() const
const wxString & GetText() const
Function GetText returns the string associated with the text object.
Definition: eda_text.h:143
T * GetFirst() const
Function GetFirst returns the first T* in the list without removing it, or NULL if the list is empty...
Definition: dlist.h:163
DLIST< BOARD_ITEM > & GraphicalItemsList()
Definition: class_module.h:165
void processTextItem ( const TEXTE_MODULE aSrc,
bool  resetText,
bool  resetTextLayers,
bool  resetTextEffects 

Definition at line 376 of file dialog_exchange_footprints.cpp.

References BOARD_ITEM::GetLayer(), EDA_TEXT::GetText(), EDA_TEXT::IsVisible(), TEXTE_MODULE::SetEffects(), BOARD_ITEM::SetLayer(), EDA_TEXT::SetText(), and EDA_TEXT::SetVisible().

Referenced by PCB_EDIT_FRAME::Exchange_Module().

378 {
379  if( !resetText )
380  aDest.SetText( aSrc.GetText() );
382  if( !resetTextLayers )
383  {
384  aDest.SetLayer( aSrc.GetLayer() );
385  aDest.SetVisible( aSrc.IsVisible() );
386  }
388  if( !resetTextEffects )
389  aDest.SetEffects( aSrc );
390 }
virtual void SetLayer(PCB_LAYER_ID aLayer)
Function SetLayer sets the layer this item is on.
virtual PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
void SetVisible(bool aVisible)
Definition: eda_text.h:188
const wxString & GetText() const
Function GetText returns the string associated with the text object.
Definition: eda_text.h:143
bool IsVisible() const
Definition: eda_text.h:189
void SetEffects(const TEXTE_MODULE &aSrc)
Function SetEffects sets the text effects from another instance.
virtual void SetText(const wxString &aText)
Definition: eda_text.h:154

Variable Documentation

int g_matchModeForExchange = ID_MATCH_FP_REF
int g_matchModeForExchangeSelected = ID_MATCH_FP_SELECTED
int g_matchModeForUpdate = ID_MATCH_FP_ALL
int g_matchModeForUpdateSelected = ID_MATCH_FP_SELECTED