Fix MSW issue with Exchange Footprints dialog, step 2

This commit is contained in:
jean-pierre charras 2018-02-06 10:54:11 +01:00
parent 7c48fad737
commit 8d0932dd58
4 changed files with 43 additions and 42 deletions

View File

@ -4,7 +4,7 @@
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2013 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -48,15 +48,15 @@
static bool RecreateCmpFile( BOARD * aBrd, const wxString& aFullCmpFileName );
#define wxID_MATCH_FP_ALL 4200
#define wxID_MATCH_FP_REF 4201
#define wxID_MATCH_FP_VAL 4202
#define wxID_MATCH_FP_ID 4203
#define ID_MATCH_FP_ALL 4200
#define ID_MATCH_FP_REF 4201
#define ID_MATCH_FP_VAL 4202
#define ID_MATCH_FP_ID 4203
int DIALOG_EXCHANGE_MODULE::m_matchModeForUpdate = wxID_MATCH_FP_ALL;
int DIALOG_EXCHANGE_MODULE::m_matchModeForExchange = wxID_MATCH_FP_REF;
int DIALOG_EXCHANGE_MODULE::m_matchModeForUpdateSelected = wxID_MATCH_FP_REF;
int DIALOG_EXCHANGE_MODULE::m_matchModeForExchangeSelected = wxID_MATCH_FP_REF;
int DIALOG_EXCHANGE_MODULE::m_matchModeForUpdate = ID_MATCH_FP_ALL;
int DIALOG_EXCHANGE_MODULE::m_matchModeForExchange = ID_MATCH_FP_REF;
int DIALOG_EXCHANGE_MODULE::m_matchModeForUpdateSelected = ID_MATCH_FP_REF;
int DIALOG_EXCHANGE_MODULE::m_matchModeForExchangeSelected = ID_MATCH_FP_REF;
DIALOG_EXCHANGE_MODULE::DIALOG_EXCHANGE_MODULE( PCB_EDIT_FRAME* parent, MODULE* Module,
@ -153,19 +153,19 @@ void DIALOG_EXCHANGE_MODULE::init( bool updateMode )
wxCommandEvent event;
switch( getMatchMode() )
{
case wxID_MATCH_FP_ALL:
case ID_MATCH_FP_ALL:
if( m_currentModule )
OnMatchRefClicked( event );
else
OnMatchAllClicked( event );
break;
case wxID_MATCH_FP_REF:
case ID_MATCH_FP_REF:
OnMatchRefClicked( event );
break;
case wxID_MATCH_FP_VAL:
case ID_MATCH_FP_VAL:
OnMatchValueClicked( event );
break;
case wxID_MATCH_FP_ID:
case ID_MATCH_FP_ID:
OnMatchIDClicked( event );
}
}
@ -203,13 +203,13 @@ bool DIALOG_EXCHANGE_MODULE::isMatch( MODULE* aModule )
{
switch( getMatchMode() )
{
case wxID_MATCH_FP_ALL:
case ID_MATCH_FP_ALL:
return true;
case wxID_MATCH_FP_REF:
case ID_MATCH_FP_REF:
// currentModule case goes through changeCurrentFootprint, so we only have
// to handle specifiedRef case
return aModule->GetReference() == m_specifiedRef->GetValue();
case wxID_MATCH_FP_VAL:
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 )
@ -217,7 +217,7 @@ bool DIALOG_EXCHANGE_MODULE::isMatch( MODULE* aModule )
&& aModule->GetFPID() == m_currentModule->GetFPID();
else
return aModule->GetValue() == m_specifiedValue->GetValue();
case wxID_MATCH_FP_ID:
case ID_MATCH_FP_ID:
return aModule->GetFPID() == m_specifiedID->GetValue();
}
return false; // just to quiet compiler warnings....
@ -228,13 +228,13 @@ wxRadioButton* DIALOG_EXCHANGE_MODULE::getRadioButtonForMode()
{
switch( getMatchMode() )
{
case wxID_MATCH_FP_ALL:
case ID_MATCH_FP_ALL:
return( m_matchAll );
case wxID_MATCH_FP_REF:
case ID_MATCH_FP_REF:
return( m_matchCurrentRef->IsShown() ? m_matchCurrentRef : m_matchSpecifiedRef );
case wxID_MATCH_FP_VAL:
case ID_MATCH_FP_VAL:
return( m_matchCurrentValue->IsShown() ? m_matchCurrentValue : m_matchSpecifiedValue );
case wxID_MATCH_FP_ID:
case ID_MATCH_FP_ID:
return( m_matchSpecifiedID );
default:
return nullptr;
@ -257,13 +257,13 @@ void DIALOG_EXCHANGE_MODULE::updateMatchModeRadioButtons( wxUpdateUIEvent& )
void DIALOG_EXCHANGE_MODULE::OnMatchAllClicked( wxCommandEvent& event )
{
setMatchMode( wxID_MATCH_FP_ALL );
setMatchMode( ID_MATCH_FP_ALL );
m_matchAll->SetFocus();
}
void DIALOG_EXCHANGE_MODULE::OnMatchRefClicked( wxCommandEvent& event )
{
setMatchMode( wxID_MATCH_FP_REF );
setMatchMode( ID_MATCH_FP_REF );
if( m_specifiedRef->IsShown() && event.GetEventObject() != m_specifiedRef )
m_specifiedRef->SetFocus();
@ -272,7 +272,7 @@ void DIALOG_EXCHANGE_MODULE::OnMatchRefClicked( wxCommandEvent& event )
void DIALOG_EXCHANGE_MODULE::OnMatchValueClicked( wxCommandEvent& event )
{
setMatchMode( wxID_MATCH_FP_VAL );
setMatchMode( ID_MATCH_FP_VAL );
if( m_specifiedValue->IsShown() && event.GetEventObject() != m_specifiedValue )
m_specifiedValue->SetFocus();
@ -281,7 +281,7 @@ void DIALOG_EXCHANGE_MODULE::OnMatchValueClicked( wxCommandEvent& event )
void DIALOG_EXCHANGE_MODULE::OnMatchIDClicked( wxCommandEvent& event )
{
setMatchMode( wxID_MATCH_FP_ID );
setMatchMode( ID_MATCH_FP_ID );
if( m_specifiedID->IsShown() && event.GetEventObject() != m_specifiedID )
m_specifiedID->SetFocus();
@ -295,7 +295,7 @@ void DIALOG_EXCHANGE_MODULE::OnOkClick( wxCommandEvent& event )
m_MessageWindow->Clear();
m_MessageWindow->Flush();
if( getMatchMode() == wxID_MATCH_FP_REF && m_currentModule )
if( getMatchMode() == ID_MATCH_FP_REF && m_currentModule )
result = changeCurrentFootprint();
else
result = changeSameFootprints();

View File

@ -1,8 +1,8 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Dec 30 2017)
// C++ code generated with wxFormBuilder (version Aug 4 2017)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "wx_html_report_panel.h"
@ -21,18 +21,18 @@ DIALOG_EXCHANGE_MODULE_BASE::DIALOG_EXCHANGE_MODULE_BASE( wxWindow* parent, wxWi
m_upperSizer->SetFlexibleDirection( wxBOTH );
m_upperSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_matchAll = new wxRadioButton( this, wxID_ANY, _("%s all footprints on board"), wxDefaultPosition, wxDefaultSize, 0 );
m_matchAll = new wxRadioButton( this, wxID_ANY, _("%s all footprints on board"), wxDefaultPosition, wxDefaultSize, wxRB_SINGLE );
m_matchAll->SetValue( true );
m_matchAll->SetMinSize( wxSize( -1,26 ) );
m_upperSizer->Add( m_matchAll, wxGBPosition( 0, 0 ), wxGBSpan( 1, 2 ), wxLEFT|wxRIGHT|wxEXPAND, 5 );
m_matchCurrentRef = new wxRadioButton( this, wxID_ANY, _("%s current footprint (%s)"), wxDefaultPosition, wxDefaultSize, 0 );
m_matchCurrentRef = new wxRadioButton( this, wxID_ANY, _("%s current footprint (%s)"), wxDefaultPosition, wxDefaultSize, wxRB_SINGLE );
m_matchCurrentRef->SetMinSize( wxSize( -1,26 ) );
m_upperSizer->Add( m_matchCurrentRef, wxGBPosition( 1, 0 ), wxGBSpan( 1, 2 ), wxLEFT|wxRIGHT|wxEXPAND, 5 );
m_matchSpecifiedRef = new wxRadioButton( this, wxID_ANY, _("%s footprint with reference:"), wxDefaultPosition, wxDefaultSize, 0 );
m_matchSpecifiedRef = new wxRadioButton( this, wxID_ANY, _("%s footprint with reference:"), wxDefaultPosition, wxDefaultSize, wxRB_SINGLE );
m_matchSpecifiedRef->SetMinSize( wxSize( -1,26 ) );
m_upperSizer->Add( m_matchSpecifiedRef, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALL|wxEXPAND, 5 );
@ -40,12 +40,12 @@ DIALOG_EXCHANGE_MODULE_BASE::DIALOG_EXCHANGE_MODULE_BASE( wxWindow* parent, wxWi
m_specifiedRef = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_upperSizer->Add( m_specifiedRef, wxGBPosition( 2, 1 ), wxGBSpan( 1, 1 ), wxBOTTOM|wxRIGHT|wxTOP|wxEXPAND, 5 );
m_matchCurrentValue = new wxRadioButton( this, wxID_ANY, _("%s footprints with matching value (%s)"), wxDefaultPosition, wxDefaultSize, 0 );
m_matchCurrentValue = new wxRadioButton( this, wxID_ANY, _("%s footprints with matching value (%s)"), wxDefaultPosition, wxDefaultSize, wxRB_SINGLE );
m_matchCurrentValue->SetMinSize( wxSize( -1,26 ) );
m_upperSizer->Add( m_matchCurrentValue, wxGBPosition( 3, 0 ), wxGBSpan( 1, 2 ), wxLEFT|wxRIGHT|wxEXPAND, 5 );
m_matchSpecifiedValue = new wxRadioButton( this, wxID_ANY, _("%s footprints with value:"), wxDefaultPosition, wxDefaultSize, 0 );
m_matchSpecifiedValue = new wxRadioButton( this, wxID_ANY, _("%s footprints with value:"), wxDefaultPosition, wxDefaultSize, wxRB_SINGLE );
m_matchSpecifiedValue->SetMinSize( wxSize( -1,26 ) );
m_upperSizer->Add( m_matchSpecifiedValue, wxGBPosition( 4, 0 ), wxGBSpan( 1, 1 ), wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 );
@ -53,7 +53,7 @@ DIALOG_EXCHANGE_MODULE_BASE::DIALOG_EXCHANGE_MODULE_BASE( wxWindow* parent, wxWi
m_specifiedValue = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_upperSizer->Add( m_specifiedValue, wxGBPosition( 4, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxEXPAND|wxRIGHT, 5 );
m_matchSpecifiedID = new wxRadioButton( this, wxID_ANY, _("%s footprints with identifier:"), wxDefaultPosition, wxDefaultSize, 0 );
m_matchSpecifiedID = new wxRadioButton( this, wxID_ANY, _("%s footprints with identifier:"), wxDefaultPosition, wxDefaultSize, wxRB_SINGLE );
m_upperSizer->Add( m_matchSpecifiedID, wxGBPosition( 5, 0 ), wxGBSpan( 1, 2 ), wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 5 );
wxFlexGridSizer* fgSizer1;

View File

@ -161,7 +161,7 @@
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="style">wxRB_SINGLE</property>
<property name="subclass">; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
@ -252,7 +252,7 @@
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="style">wxRB_SINGLE</property>
<property name="subclass">; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
@ -343,7 +343,7 @@
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="style">wxRB_SINGLE</property>
<property name="subclass">; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
@ -528,7 +528,7 @@
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="style">wxRB_SINGLE</property>
<property name="subclass">; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
@ -619,7 +619,7 @@
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="style">wxRB_SINGLE</property>
<property name="subclass">; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
@ -804,7 +804,7 @@
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="style">wxRB_SINGLE</property>
<property name="subclass">; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>

View File

@ -1,8 +1,8 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Dec 30 2017)
// C++ code generated with wxFormBuilder (version Aug 4 2017)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __DIALOG_EXCHANGE_MODULES_BASE_H__
@ -11,6 +11,7 @@
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
class DIALOG_SHIM;
class WX_HTML_REPORT_PANEL;
#include "dialog_shim.h"