Simplify exchange footprints dialog and support wildcards.
This commit is contained in:
parent
0585382986
commit
3dcd52021a
|
@ -25,6 +25,7 @@
|
|||
*/
|
||||
|
||||
#include <fctsys.h>
|
||||
#include <kicad_string.h>
|
||||
#include <class_drawpanel.h>
|
||||
#include <pcb_edit_frame.h>
|
||||
#include <macros.h>
|
||||
|
@ -44,10 +45,9 @@
|
|||
#define ID_MATCH_FP_VAL 4202
|
||||
#define ID_MATCH_FP_ID 4203
|
||||
|
||||
int DIALOG_EXCHANGE_FOOTPRINTS::m_matchModeForUpdate = ID_MATCH_FP_ALL;
|
||||
int DIALOG_EXCHANGE_FOOTPRINTS::m_matchModeForExchange = ID_MATCH_FP_REF;
|
||||
int DIALOG_EXCHANGE_FOOTPRINTS::m_matchModeForUpdateSelected = ID_MATCH_FP_REF;
|
||||
int DIALOG_EXCHANGE_FOOTPRINTS::m_matchModeForExchangeSelected = ID_MATCH_FP_REF;
|
||||
|
||||
int g_matchModeForUpdate = ID_MATCH_FP_ALL;
|
||||
int g_matchModeForExchange = ID_MATCH_FP_REF;
|
||||
|
||||
|
||||
DIALOG_EXCHANGE_FOOTPRINTS::DIALOG_EXCHANGE_FOOTPRINTS( PCB_EDIT_FRAME* aParent, MODULE* aModule,
|
||||
|
@ -85,39 +85,25 @@ DIALOG_EXCHANGE_FOOTPRINTS::DIALOG_EXCHANGE_FOOTPRINTS( PCB_EDIT_FRAME* aParent,
|
|||
m_newIDBrowseButton->SetBitmap( KiBitmap( small_library_xpm ) );
|
||||
}
|
||||
|
||||
label.Printf( m_matchSpecifiedRef->GetLabel(), verb );
|
||||
m_matchSpecifiedRef->SetLabel( label );
|
||||
|
||||
// Use ChangeValue() instead of SetValue() so we don't generate events.
|
||||
if( m_currentModule )
|
||||
{
|
||||
m_upperSizer->FindItem( m_matchSpecifiedRef )->Show( false );
|
||||
m_upperSizer->FindItem( m_specifiedRef )->Show( false );
|
||||
m_specifiedRef->ChangeValue( m_currentModule->GetReference() );
|
||||
|
||||
label.Printf( m_matchCurrentRef->GetLabel(), verb, m_currentModule->GetReference() );
|
||||
m_matchCurrentRef->SetLabel( label );
|
||||
label.Printf( m_matchSpecifiedValue->GetLabel(), verb );
|
||||
m_matchSpecifiedValue->SetLabel( label );
|
||||
|
||||
m_upperSizer->FindItem( m_matchSpecifiedValue )->Show( false );
|
||||
m_upperSizer->FindItem( m_specifiedValue )->Show( false );
|
||||
|
||||
label.Printf( m_matchCurrentValue->GetLabel(), verb, m_currentModule->GetValue() );
|
||||
m_matchCurrentValue->SetLabel( label );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_upperSizer->FindItem( m_matchCurrentRef )->Show( false );
|
||||
|
||||
label.Printf( m_matchSpecifiedRef->GetLabel(), verb );
|
||||
m_matchSpecifiedRef->SetLabel( label );
|
||||
|
||||
m_upperSizer->FindItem( m_matchCurrentValue )->Show( false );
|
||||
|
||||
label.Printf( m_matchSpecifiedValue->GetLabel(), verb );
|
||||
m_matchSpecifiedValue->SetLabel( label );
|
||||
}
|
||||
if( m_currentModule )
|
||||
m_specifiedValue->ChangeValue( m_currentModule->GetValue() );
|
||||
|
||||
label.Printf( m_matchSpecifiedID->GetLabel(), verb );
|
||||
m_matchSpecifiedID->SetLabel( label );
|
||||
|
||||
// Use ChangeValue() instead of SetValue() so we don't generate events.
|
||||
if( m_currentModule )
|
||||
m_specifiedID->ChangeValue( FROM_UTF8( m_currentModule->GetFPID().Format().c_str() ) );
|
||||
|
||||
m_specifiedIDBrowseButton->SetBitmap( KiBitmap( small_library_xpm ) );
|
||||
|
||||
m_upperSizer->SetEmptyCellSize( wxSize( 0, 0 ) );
|
||||
|
@ -125,22 +111,13 @@ DIALOG_EXCHANGE_FOOTPRINTS::DIALOG_EXCHANGE_FOOTPRINTS( PCB_EDIT_FRAME* aParent,
|
|||
|
||||
// initialize match-mode
|
||||
wxCommandEvent event;
|
||||
switch( getMatchMode() )
|
||||
switch( m_updateMode ? g_matchModeForUpdate : g_matchModeForExchange )
|
||||
{
|
||||
case ID_MATCH_FP_ALL:
|
||||
if( m_currentModule )
|
||||
OnMatchRefClicked( event );
|
||||
else
|
||||
OnMatchAllClicked( event );
|
||||
break;
|
||||
case ID_MATCH_FP_REF:
|
||||
OnMatchRefClicked( event );
|
||||
break;
|
||||
case ID_MATCH_FP_VAL:
|
||||
OnMatchValueClicked( event );
|
||||
break;
|
||||
case ID_MATCH_FP_ID:
|
||||
OnMatchIDClicked( event );
|
||||
case ID_MATCH_FP_ALL: OnMatchAllClicked( event ); break;
|
||||
case ID_MATCH_FP_REF: OnMatchRefClicked( event ); break;
|
||||
case ID_MATCH_FP_VAL: OnMatchValueClicked( event ); break;
|
||||
case ID_MATCH_FP_ID: OnMatchIDClicked( event ); break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
// DIALOG_SHIM needs a unique hash_key because classname is not sufficient
|
||||
|
@ -158,31 +135,12 @@ DIALOG_EXCHANGE_FOOTPRINTS::DIALOG_EXCHANGE_FOOTPRINTS( PCB_EDIT_FRAME* aParent,
|
|||
}
|
||||
|
||||
|
||||
int DIALOG_EXCHANGE_FOOTPRINTS::getMatchMode()
|
||||
{
|
||||
if( m_updateMode )
|
||||
return( m_currentModule ? m_matchModeForUpdateSelected : m_matchModeForUpdate );
|
||||
else
|
||||
return( m_currentModule ? m_matchModeForExchangeSelected : m_matchModeForExchange );
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_EXCHANGE_FOOTPRINTS::setMatchMode( int aMatchMode )
|
||||
{
|
||||
if( m_updateMode )
|
||||
{
|
||||
if( m_currentModule )
|
||||
m_matchModeForUpdateSelected = aMatchMode;
|
||||
else
|
||||
m_matchModeForUpdate = aMatchMode;
|
||||
}
|
||||
g_matchModeForUpdate = aMatchMode;
|
||||
else
|
||||
{
|
||||
if( m_currentModule )
|
||||
m_matchModeForExchangeSelected = aMatchMode;
|
||||
else
|
||||
m_matchModeForExchange = aMatchMode;
|
||||
}
|
||||
g_matchModeForExchange = aMatchMode;
|
||||
}
|
||||
|
||||
|
||||
|
@ -190,43 +148,32 @@ bool DIALOG_EXCHANGE_FOOTPRINTS::isMatch( MODULE* aModule )
|
|||
{
|
||||
LIB_ID specifiedID;
|
||||
|
||||
switch( getMatchMode() )
|
||||
switch( m_updateMode ? g_matchModeForUpdate : g_matchModeForExchange )
|
||||
{
|
||||
case ID_MATCH_FP_ALL:
|
||||
return true;
|
||||
case ID_MATCH_FP_REF:
|
||||
// currentModule case goes through processCurrentModule, so we only have
|
||||
// to handle specifiedRef case
|
||||
return aModule->GetReference() == m_specifiedRef->GetValue();
|
||||
return WildCompareString( m_specifiedRef->GetValue(), aModule->GetReference(), false );
|
||||
case ID_MATCH_FP_VAL:
|
||||
// currentValue must also check FPID so we don't get accidental matches that
|
||||
// the user didn't intend
|
||||
if( m_currentModule )
|
||||
return aModule->GetValue() == m_currentModule->GetValue() && aModule->GetFPID() == m_currentModule->GetFPID();
|
||||
else
|
||||
return aModule->GetValue() == m_specifiedValue->GetValue();
|
||||
return WildCompareString( m_specifiedValue->GetValue(), aModule->GetValue(), false );
|
||||
case ID_MATCH_FP_ID:
|
||||
specifiedID.Parse( m_specifiedID->GetValue(), LIB_ID::ID_PCB );
|
||||
return aModule->GetFPID() == specifiedID;
|
||||
default:
|
||||
return false; // just to quiet compiler warnings....
|
||||
}
|
||||
return false; // just to quiet compiler warnings....
|
||||
}
|
||||
|
||||
|
||||
wxRadioButton* DIALOG_EXCHANGE_FOOTPRINTS::getRadioButtonForMode()
|
||||
{
|
||||
switch( getMatchMode() )
|
||||
switch( m_updateMode ? g_matchModeForUpdate : g_matchModeForExchange )
|
||||
{
|
||||
case ID_MATCH_FP_ALL:
|
||||
return( m_matchAll );
|
||||
case ID_MATCH_FP_REF:
|
||||
return( m_matchCurrentRef->IsShown() ? m_matchCurrentRef : m_matchSpecifiedRef );
|
||||
case ID_MATCH_FP_VAL:
|
||||
return( m_matchCurrentValue->IsShown() ? m_matchCurrentValue : m_matchSpecifiedValue );
|
||||
case ID_MATCH_FP_ID:
|
||||
return( m_matchSpecifiedID );
|
||||
default:
|
||||
return nullptr;
|
||||
case ID_MATCH_FP_ALL: return m_matchAll;
|
||||
case ID_MATCH_FP_REF: return m_matchSpecifiedRef;
|
||||
case ID_MATCH_FP_VAL: return m_matchSpecifiedValue;
|
||||
case ID_MATCH_FP_ID: return m_matchSpecifiedID;
|
||||
default: return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -237,10 +184,9 @@ void DIALOG_EXCHANGE_FOOTPRINTS::updateMatchModeRadioButtons( wxUpdateUIEvent& )
|
|||
|
||||
wxRadioButton* rb_butt_list[] =
|
||||
{
|
||||
m_matchCurrentRef, m_matchSpecifiedRef,
|
||||
m_matchCurrentValue, m_matchCurrentValue,
|
||||
m_matchSpecifiedValue, m_matchSpecifiedValue,
|
||||
m_matchSpecifiedID, m_matchSpecifiedID,
|
||||
m_matchSpecifiedRef,
|
||||
m_matchSpecifiedValue,
|
||||
m_matchSpecifiedID,
|
||||
nullptr // end of list
|
||||
};
|
||||
|
||||
|
@ -268,7 +214,7 @@ void DIALOG_EXCHANGE_FOOTPRINTS::OnMatchRefClicked( wxCommandEvent& event )
|
|||
{
|
||||
setMatchMode( ID_MATCH_FP_REF );
|
||||
|
||||
if( m_specifiedRef->IsShown() && event.GetEventObject() != m_specifiedRef )
|
||||
if( event.GetEventObject() != m_specifiedRef )
|
||||
m_specifiedRef->SetFocus();
|
||||
}
|
||||
|
||||
|
@ -277,7 +223,7 @@ void DIALOG_EXCHANGE_FOOTPRINTS::OnMatchValueClicked( wxCommandEvent& event )
|
|||
{
|
||||
setMatchMode( ID_MATCH_FP_VAL );
|
||||
|
||||
if( m_specifiedValue->IsShown() && event.GetEventObject() != m_specifiedValue )
|
||||
if( event.GetEventObject() != m_specifiedValue )
|
||||
m_specifiedValue->SetFocus();
|
||||
}
|
||||
|
||||
|
@ -286,25 +232,19 @@ void DIALOG_EXCHANGE_FOOTPRINTS::OnMatchIDClicked( wxCommandEvent& event )
|
|||
{
|
||||
setMatchMode( ID_MATCH_FP_ID );
|
||||
|
||||
if( m_specifiedID->IsShown() && event.GetEventObject() != m_specifiedID )
|
||||
if( event.GetEventObject() != m_specifiedID )
|
||||
m_specifiedID->SetFocus();
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_EXCHANGE_FOOTPRINTS::OnApplyClicked( wxCommandEvent& event )
|
||||
{
|
||||
bool result = false;
|
||||
wxBusyCursor dummy;
|
||||
|
||||
m_MessageWindow->Clear();
|
||||
m_MessageWindow->Flush( true );
|
||||
|
||||
if( getMatchMode() == ID_MATCH_FP_REF && m_currentModule )
|
||||
result = processCurrentModule();
|
||||
else
|
||||
result = processMatchingModules();
|
||||
|
||||
if( result )
|
||||
if( processMatchingModules() )
|
||||
{
|
||||
if( m_parent->GetBoard()->IsElementVisible( LAYER_RATSNEST ) )
|
||||
m_parent->Compile_Ratsnest( NULL, true );
|
||||
|
@ -316,26 +256,6 @@ void DIALOG_EXCHANGE_FOOTPRINTS::OnApplyClicked( wxCommandEvent& event )
|
|||
}
|
||||
|
||||
|
||||
bool DIALOG_EXCHANGE_FOOTPRINTS::processCurrentModule()
|
||||
{
|
||||
LIB_ID newFPID;
|
||||
|
||||
if( m_updateMode )
|
||||
newFPID = m_currentModule->GetFPID();
|
||||
else
|
||||
{
|
||||
wxString newFPIDStr = m_newID->GetValue();
|
||||
|
||||
if( newFPIDStr.IsEmpty() )
|
||||
return false;
|
||||
|
||||
newFPID.Parse( newFPIDStr, LIB_ID::ID_PCB, true );
|
||||
}
|
||||
|
||||
return processModule( m_currentModule, newFPID );
|
||||
}
|
||||
|
||||
|
||||
bool DIALOG_EXCHANGE_FOOTPRINTS::processMatchingModules()
|
||||
{
|
||||
MODULE* Module;
|
||||
|
@ -447,6 +367,7 @@ TEXTE_MODULE* getMatchingTextItem( TEXTE_MODULE* aRefItem, MODULE* aModule )
|
|||
for( auto iItem = aModule->GraphicalItemsList().GetFirst(); iItem; iItem = iItem->Next() )
|
||||
{
|
||||
TEXTE_MODULE* candidate = dyn_cast<TEXTE_MODULE*>( iItem );
|
||||
|
||||
if( candidate && candidate->GetText() == aRefItem->GetText() )
|
||||
return candidate;
|
||||
}
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
|
||||
class PCB_EDIT_FRAME;
|
||||
class MODULE;
|
||||
class LIB_ID;
|
||||
|
||||
class DIALOG_EXCHANGE_FOOTPRINTS : public DIALOG_EXCHANGE_FOOTPRINTS_BASE
|
||||
{
|
||||
|
@ -39,10 +40,6 @@ private:
|
|||
PCB_EDIT_FRAME* m_parent;
|
||||
MODULE* m_currentModule;
|
||||
bool m_updateMode;
|
||||
static int m_matchModeForUpdate; // remember last match-mode
|
||||
static int m_matchModeForExchange; // remember last match-mode
|
||||
static int m_matchModeForUpdateSelected; // remember last match-mode
|
||||
static int m_matchModeForExchangeSelected; // remember last match-mode
|
||||
|
||||
public:
|
||||
DIALOG_EXCHANGE_FOOTPRINTS( PCB_EDIT_FRAME* aParent, MODULE* aModule, bool updateMode );
|
||||
|
@ -56,13 +53,11 @@ private:
|
|||
void OnApplyClicked( wxCommandEvent& event ) override;
|
||||
void ViewAndSelectFootprint( wxCommandEvent& event ) override;
|
||||
|
||||
int getMatchMode();
|
||||
void setMatchMode( int aMatchMode );
|
||||
|
||||
wxRadioButton* getRadioButtonForMode();
|
||||
|
||||
bool isMatch( MODULE* );
|
||||
bool processCurrentModule();
|
||||
bool processMatchingModules();
|
||||
bool processModule( MODULE* aModule, const LIB_ID& aNewFPID );
|
||||
};
|
||||
|
|
|
@ -24,26 +24,22 @@ DIALOG_EXCHANGE_FOOTPRINTS_BASE::DIALOG_EXCHANGE_FOOTPRINTS_BASE( wxWindow* pare
|
|||
m_matchAll = new wxRadioButton( this, wxID_ANY, _("%s all footprints on board"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_upperSizer->Add( m_matchAll, wxGBPosition( 0, 0 ), wxGBSpan( 1, 2 ), wxEXPAND|wxALL, 5 );
|
||||
|
||||
m_matchCurrentRef = new wxRadioButton( this, wxID_ANY, _("%s current footprint (%s)"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_upperSizer->Add( m_matchCurrentRef, wxGBPosition( 1, 0 ), wxGBSpan( 1, 2 ), wxEXPAND|wxALL, 5 );
|
||||
|
||||
m_matchSpecifiedRef = new wxRadioButton( this, wxID_ANY, _("%s footprint with reference:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_upperSizer->Add( m_matchSpecifiedRef, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALL|wxEXPAND, 5 );
|
||||
m_matchSpecifiedRef = new wxRadioButton( this, wxID_ANY, _("%s footprint matching reference:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_upperSizer->Add( m_matchSpecifiedRef, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALL|wxEXPAND, 5 );
|
||||
|
||||
m_specifiedRef = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
|
||||
m_upperSizer->Add( m_specifiedRef, wxGBPosition( 2, 1 ), wxGBSpan( 1, 1 ), wxBOTTOM|wxRIGHT|wxTOP|wxEXPAND, 5 );
|
||||
m_specifiedRef->SetMinSize( wxSize( 200,-1 ) );
|
||||
|
||||
m_matchCurrentValue = new wxRadioButton( this, wxID_ANY, _("%s footprints with matching value (%s)"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_upperSizer->Add( m_matchCurrentValue, wxGBPosition( 3, 0 ), wxGBSpan( 1, 2 ), wxEXPAND|wxALL, 5 );
|
||||
m_upperSizer->Add( m_specifiedRef, wxGBPosition( 1, 1 ), wxGBSpan( 1, 1 ), wxBOTTOM|wxRIGHT|wxTOP|wxEXPAND, 5 );
|
||||
|
||||
m_matchSpecifiedValue = new wxRadioButton( this, wxID_ANY, _("%s footprints with value:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_upperSizer->Add( m_matchSpecifiedValue, wxGBPosition( 4, 0 ), wxGBSpan( 1, 1 ), wxEXPAND|wxALL, 5 );
|
||||
m_matchSpecifiedValue = new wxRadioButton( this, wxID_ANY, _("%s footprints matching value:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_upperSizer->Add( m_matchSpecifiedValue, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxEXPAND|wxALL, 5 );
|
||||
|
||||
m_specifiedValue = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
|
||||
m_upperSizer->Add( m_specifiedValue, wxGBPosition( 4, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 5 );
|
||||
m_upperSizer->Add( m_specifiedValue, wxGBPosition( 2, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 5 );
|
||||
|
||||
m_matchSpecifiedID = new wxRadioButton( this, wxID_ANY, _("%s footprints with identifier:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_upperSizer->Add( m_matchSpecifiedID, wxGBPosition( 5, 0 ), wxGBSpan( 1, 2 ), wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 5 );
|
||||
m_upperSizer->Add( m_matchSpecifiedID, wxGBPosition( 3, 0 ), wxGBSpan( 1, 2 ), wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 5 );
|
||||
|
||||
|
||||
m_upperSizer->AddGrowableCol( 1 );
|
||||
|
@ -134,11 +130,9 @@ DIALOG_EXCHANGE_FOOTPRINTS_BASE::DIALOG_EXCHANGE_FOOTPRINTS_BASE( wxWindow* pare
|
|||
// Connect Events
|
||||
this->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_EXCHANGE_FOOTPRINTS_BASE::updateMatchModeRadioButtons ) );
|
||||
m_matchAll->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_EXCHANGE_FOOTPRINTS_BASE::OnMatchAllClicked ), NULL, this );
|
||||
m_matchCurrentRef->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_EXCHANGE_FOOTPRINTS_BASE::OnMatchRefClicked ), NULL, this );
|
||||
m_matchSpecifiedRef->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_EXCHANGE_FOOTPRINTS_BASE::OnMatchRefClicked ), NULL, this );
|
||||
m_specifiedRef->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_EXCHANGE_FOOTPRINTS_BASE::OnMatchRefClicked ), NULL, this );
|
||||
m_specifiedRef->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_EXCHANGE_FOOTPRINTS_BASE::OnMatchRefClicked ), NULL, this );
|
||||
m_matchCurrentValue->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_EXCHANGE_FOOTPRINTS_BASE::OnMatchValueClicked ), NULL, this );
|
||||
m_matchSpecifiedValue->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_EXCHANGE_FOOTPRINTS_BASE::OnMatchValueClicked ), NULL, this );
|
||||
m_specifiedValue->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_EXCHANGE_FOOTPRINTS_BASE::OnMatchValueClicked ), NULL, this );
|
||||
m_specifiedValue->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_EXCHANGE_FOOTPRINTS_BASE::OnMatchValueClicked ), NULL, this );
|
||||
|
@ -155,11 +149,9 @@ DIALOG_EXCHANGE_FOOTPRINTS_BASE::~DIALOG_EXCHANGE_FOOTPRINTS_BASE()
|
|||
// Disconnect Events
|
||||
this->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_EXCHANGE_FOOTPRINTS_BASE::updateMatchModeRadioButtons ) );
|
||||
m_matchAll->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_EXCHANGE_FOOTPRINTS_BASE::OnMatchAllClicked ), NULL, this );
|
||||
m_matchCurrentRef->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_EXCHANGE_FOOTPRINTS_BASE::OnMatchRefClicked ), NULL, this );
|
||||
m_matchSpecifiedRef->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_EXCHANGE_FOOTPRINTS_BASE::OnMatchRefClicked ), NULL, this );
|
||||
m_specifiedRef->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_EXCHANGE_FOOTPRINTS_BASE::OnMatchRefClicked ), NULL, this );
|
||||
m_specifiedRef->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_EXCHANGE_FOOTPRINTS_BASE::OnMatchRefClicked ), NULL, this );
|
||||
m_matchCurrentValue->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_EXCHANGE_FOOTPRINTS_BASE::OnMatchValueClicked ), NULL, this );
|
||||
m_matchSpecifiedValue->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_EXCHANGE_FOOTPRINTS_BASE::OnMatchValueClicked ), NULL, this );
|
||||
m_specifiedValue->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_EXCHANGE_FOOTPRINTS_BASE::OnMatchValueClicked ), NULL, this );
|
||||
m_specifiedValue->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_EXCHANGE_FOOTPRINTS_BASE::OnMatchValueClicked ), NULL, this );
|
||||
|
|
|
@ -201,9 +201,9 @@
|
|||
</object>
|
||||
<object class="gbsizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="colspan">2</property>
|
||||
<property name="colspan">1</property>
|
||||
<property name="column">0</property>
|
||||
<property name="flag">wxEXPAND|wxALL</property>
|
||||
<property name="flag">wxALL|wxEXPAND</property>
|
||||
<property name="row">1</property>
|
||||
<property name="rowspan">1</property>
|
||||
<object class="wxRadioButton" expanded="0">
|
||||
|
@ -234,98 +234,7 @@
|
|||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">%s current footprint (%s)</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size">-1,-1</property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_matchCurrentRef</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; </property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="value">0</property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRadioButton">OnMatchRefClicked</event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="gbsizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="colspan">1</property>
|
||||
<property name="column">0</property>
|
||||
<property name="flag">wxALL|wxEXPAND</property>
|
||||
<property name="row">2</property>
|
||||
<property name="rowspan">1</property>
|
||||
<object class="wxRadioButton" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">%s footprint with reference:</property>
|
||||
<property name="label">%s footprint matching reference:</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
|
@ -386,7 +295,7 @@
|
|||
<property name="colspan">1</property>
|
||||
<property name="column">1</property>
|
||||
<property name="flag">wxBOTTOM|wxRIGHT|wxTOP|wxEXPAND</property>
|
||||
<property name="row">2</property>
|
||||
<property name="row">1</property>
|
||||
<property name="rowspan">1</property>
|
||||
<object class="wxTextCtrl" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
|
@ -422,7 +331,7 @@
|
|||
<property name="maxlength"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size">-1,-1</property>
|
||||
<property name="minimum_size">200,-1</property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_specifiedRef</property>
|
||||
<property name="pane_border">1</property>
|
||||
|
@ -475,103 +384,12 @@
|
|||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="gbsizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="colspan">2</property>
|
||||
<property name="column">0</property>
|
||||
<property name="flag">wxEXPAND|wxALL</property>
|
||||
<property name="row">3</property>
|
||||
<property name="rowspan">1</property>
|
||||
<object class="wxRadioButton" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">%s footprints with matching value (%s)</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size">-1,-1</property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_matchCurrentValue</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass">; </property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="value">0</property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRadioButton">OnMatchValueClicked</event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="gbsizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="colspan">1</property>
|
||||
<property name="column">0</property>
|
||||
<property name="flag">wxEXPAND|wxALL</property>
|
||||
<property name="row">4</property>
|
||||
<property name="row">2</property>
|
||||
<property name="rowspan">1</property>
|
||||
<object class="wxRadioButton" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
|
@ -601,7 +419,7 @@
|
|||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">%s footprints with value:</property>
|
||||
<property name="label">%s footprints matching value:</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
|
@ -662,7 +480,7 @@
|
|||
<property name="colspan">1</property>
|
||||
<property name="column">1</property>
|
||||
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT</property>
|
||||
<property name="row">4</property>
|
||||
<property name="row">2</property>
|
||||
<property name="rowspan">1</property>
|
||||
<object class="wxTextCtrl" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
|
@ -756,7 +574,7 @@
|
|||
<property name="colspan">2</property>
|
||||
<property name="column">0</property>
|
||||
<property name="flag">wxLEFT|wxRIGHT|wxTOP|wxEXPAND</property>
|
||||
<property name="row">5</property>
|
||||
<property name="row">3</property>
|
||||
<property name="rowspan">1</property>
|
||||
<object class="wxRadioButton" expanded="0">
|
||||
<property name="BottomDockable">1</property>
|
||||
|
|
|
@ -49,10 +49,8 @@ class DIALOG_EXCHANGE_FOOTPRINTS_BASE : public DIALOG_SHIM
|
|||
wxBoxSizer* m_mainSizer;
|
||||
wxGridBagSizer* m_upperSizer;
|
||||
wxRadioButton* m_matchAll;
|
||||
wxRadioButton* m_matchCurrentRef;
|
||||
wxRadioButton* m_matchSpecifiedRef;
|
||||
wxTextCtrl* m_specifiedRef;
|
||||
wxRadioButton* m_matchCurrentValue;
|
||||
wxRadioButton* m_matchSpecifiedValue;
|
||||
wxTextCtrl* m_specifiedValue;
|
||||
wxRadioButton* m_matchSpecifiedID;
|
||||
|
|
|
@ -286,9 +286,7 @@ void DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem( BOARD_COMMIT& aCommit, BOA
|
|||
|
||||
if( module )
|
||||
{
|
||||
wxString fpID = module->GetFPID().GetUniStringLibId();
|
||||
|
||||
if( !WildCompareString( m_footprintFilter->GetValue(), fpID, false ) )
|
||||
if( !WildCompareString( m_footprintFilter->GetValue(), module->GetReference(), false ) )
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1216,11 +1216,11 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
break;
|
||||
|
||||
case ID_MENU_PCB_UPDATE_FOOTPRINTS:
|
||||
InstallExchangeModuleFrame( (MODULE*) nullptr, true );
|
||||
InstallExchangeModuleFrame( (MODULE*) GetCurItem(), true );
|
||||
break;
|
||||
|
||||
case ID_MENU_PCB_EXCHANGE_FOOTPRINTS:
|
||||
InstallExchangeModuleFrame( (MODULE*) nullptr, false );
|
||||
InstallExchangeModuleFrame( (MODULE*) GetCurItem(), false );
|
||||
break;
|
||||
|
||||
case ID_MENU_PCB_SWAP_LAYERS:
|
||||
|
|
Loading…
Reference in New Issue