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


#define ID_MATCH_FP_ALL   4200

Definition at line 43 of file dialog_exchange_footprints.cpp.


#define ID_MATCH_FP_ID   4204

Definition at line 47 of file dialog_exchange_footprints.cpp.


#define ID_MATCH_FP_REF   4202

Definition at line 45 of file dialog_exchange_footprints.cpp.


#define ID_MATCH_FP_SELECTED   4201

Definition at line 44 of file dialog_exchange_footprints.cpp.


#define ID_MATCH_FP_VAL   4203

Definition at line 46 of file dialog_exchange_footprints.cpp.

Function Documentation

◆ getMatchingTextItem()

TEXTE_MODULE* getMatchingTextItem ( TEXTE_MODULE aRefItem,
MODULE aModule 

Definition at line 393 of file dialog_exchange_footprints.cpp.

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 }
virtual const wxString GetText() const
Function GetText returns the string associated with the text object.
Definition: eda_text.h:147
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
BOARD_ITEM * Next() const
DLIST< BOARD_ITEM > & GraphicalItemsList()
Definition: class_module.h:165

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

Referenced by PCB_EDIT_FRAME::Exchange_Module().

◆ processTextItem()

void processTextItem ( const TEXTE_MODULE aSrc,
bool  resetText,
bool  resetTextLayers,
bool  resetTextEffects 

Definition at line 376 of file dialog_exchange_footprints.cpp.

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.
bool IsVisible() const
Definition: eda_text.h:193
void SetVisible(bool aVisible)
Definition: eda_text.h:192
virtual const wxString GetText() const
Function GetText returns the string associated with the text object.
Definition: eda_text.h:147
virtual void SetText(const wxString &aText)
Definition: eda_text.cpp:64
void SetEffects(const TEXTE_MODULE &aSrc)
Function SetEffects sets the text effects from another instance.
virtual PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.

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().

Variable Documentation

◆ g_matchModeForExchange

int g_matchModeForExchange = ID_MATCH_FP_REF

◆ g_matchModeForExchangeSelected

int g_matchModeForExchangeSelected = ID_MATCH_FP_SELECTED

◆ g_matchModeForUpdate

int g_matchModeForUpdate = ID_MATCH_FP_ALL

◆ g_matchModeForUpdateSelected

int g_matchModeForUpdateSelected = ID_MATCH_FP_SELECTED