Commit 4fd912c3 authored by jean-pierre charras's avatar jean-pierre charras

Minor fixes and enhancement

parent 93ac159e
...@@ -15,10 +15,10 @@ wxSize DIALOG_LIB_EDIT_PIN::s_LastSize; ...@@ -15,10 +15,10 @@ wxSize DIALOG_LIB_EDIT_PIN::s_LastSize;
DIALOG_LIB_EDIT_PIN::DIALOG_LIB_EDIT_PIN( wxWindow* parent, LIB_PIN* aPin ) : DIALOG_LIB_EDIT_PIN::DIALOG_LIB_EDIT_PIN( wxWindow* parent, LIB_PIN* aPin ) :
DIALOG_LIB_EDIT_PIN_BASE( parent ) DIALOG_LIB_EDIT_PIN_BASE( parent )
{ {
// Creates a dummy pin to show on a panel, insside this dialog: // Creates a dummy pin to show on a panel, inside this dialog:
m_dummyPin = new LIB_PIN( *aPin ); m_dummyPin = new LIB_PIN( *aPin );
// m_dummyPin changes do not proparagte to other pins of the current lib component, // m_dummyPin changes do not propagate to other pins of the current lib component,
// so set parent to null and clear flags // so set parent to null and clear flags
m_dummyPin->SetParent( NULL ); m_dummyPin->SetParent( NULL );
m_dummyPin->ClearFlags(); m_dummyPin->ClearFlags();
......
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Sep 8 2010) // C++ code generated with wxFormBuilder (version Nov 17 2010)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
......
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Sep 8 2010) // C++ code generated with wxFormBuilder (version Nov 17 2010)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
...@@ -55,7 +55,7 @@ class DIALOG_PLOT_SCHEMATIC_PS_BASE : public wxDialog ...@@ -55,7 +55,7 @@ class DIALOG_PLOT_SCHEMATIC_PS_BASE : public wxDialog
public: public:
DIALOG_PLOT_SCHEMATIC_PS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Plot Postsript"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 387,365 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); DIALOG_PLOT_SCHEMATIC_PS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Plot PostScript"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 387,365 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_PLOT_SCHEMATIC_PS_BASE(); ~DIALOG_PLOT_SCHEMATIC_PS_BASE();
}; };
......
...@@ -3,13 +3,11 @@ ...@@ -3,13 +3,11 @@
/**********************************************/ /**********************************************/
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h"
#include "common.h" #include "common.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "confirm.h" #include "confirm.h"
#include "eda_doc.h" #include "eda_doc.h"
#include "kicad_string.h" #include "kicad_string.h"
#include "gestfich.h"
#include "dialog_get_component.h" #include "dialog_get_component.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
...@@ -17,7 +15,6 @@ ...@@ -17,7 +15,6 @@
#include "wxPcbStruct.h" #include "wxPcbStruct.h"
#include "module_editor_frame.h" #include "module_editor_frame.h"
#include "dialog_helpers.h" #include "dialog_helpers.h"
#include "richio.h"
#include "filter_reader.h" #include "filter_reader.h"
#include "footprint_info.h" #include "footprint_info.h"
...@@ -86,7 +83,7 @@ MODULE* PCB_BASE_FRAME::Load_Module_From_Library( const wxString& library, wxDC* ...@@ -86,7 +83,7 @@ MODULE* PCB_BASE_FRAME::Load_Module_From_Library( const wxString& library, wxDC*
wxString ModuleName, keys; wxString ModuleName, keys;
static wxArrayString HistoryList; static wxArrayString HistoryList;
static wxString lastCommponentName; static wxString lastCommponentName;
bool AllowWildSeach = TRUE; bool AllowWildSeach = true;
/* Ask for a component name or key words */ /* Ask for a component name or key words */
DIALOG_GET_COMPONENT dlg( this, GetComponentDialogPosition(), HistoryList, DIALOG_GET_COMPONENT dlg( this, GetComponentDialogPosition(), HistoryList,
...@@ -147,7 +144,7 @@ MODULE* PCB_BASE_FRAME::Load_Module_From_Library( const wxString& library, wxDC* ...@@ -147,7 +144,7 @@ MODULE* PCB_BASE_FRAME::Load_Module_From_Library( const wxString& library, wxDC*
return NULL; /* Cancel command. */ return NULL; /* Cancel command. */
} }
else else
module = Get_Librairie_Module( library, ModuleName, TRUE ); module = Get_Librairie_Module( library, ModuleName, true );
} }
GetScreen()->SetCrossHairPosition( curspos ); GetScreen()->SetCrossHairPosition( curspos );
...@@ -197,7 +194,7 @@ MODULE* PCB_BASE_FRAME::Get_Librairie_Module( const wxString& aLibraryFullFilena ...@@ -197,7 +194,7 @@ MODULE* PCB_BASE_FRAME::Get_Librairie_Module( const wxString& aLibraryFullFilena
const wxString& aModuleName, const wxString& aModuleName,
bool aDisplayMessageError ) bool aDisplayMessageError )
{ {
int Found = 0; int found = 0;
wxFileName fn; wxFileName fn;
char* Line; char* Line;
wxString Name; wxString Name;
...@@ -261,8 +258,8 @@ MODULE* PCB_BASE_FRAME::Get_Librairie_Module( const wxString& aLibraryFullFilena ...@@ -261,8 +258,8 @@ MODULE* PCB_BASE_FRAME::Get_Librairie_Module( const wxString& aLibraryFullFilena
} }
/* Reading the list of modules in the library. */ /* Reading the list of modules in the library. */
Found = 0; found = 0;
while( !Found && reader.ReadLine() ) while( !found && reader.ReadLine() )
{ {
Line = reader.Line(); Line = reader.Line();
if( strnicmp( Line, "$MODULE", 6 ) == 0 ) if( strnicmp( Line, "$MODULE", 6 ) == 0 )
...@@ -278,15 +275,15 @@ MODULE* PCB_BASE_FRAME::Get_Librairie_Module( const wxString& aLibraryFullFilena ...@@ -278,15 +275,15 @@ MODULE* PCB_BASE_FRAME::Get_Librairie_Module( const wxString& aLibraryFullFilena
msg = FROM_UTF8( Line ); msg = FROM_UTF8( Line );
if( msg.CmpNoCase( aModuleName ) == 0 ) if( msg.CmpNoCase( aModuleName ) == 0 )
{ {
Found = 1; found = 1;
break; /* Found! */ break; /* found! */
} }
} }
} }
} }
/* Read library. */ /* Read library. */
while( Found && reader.ReadLine() ) while( found && reader.ReadLine() )
{ {
Line = reader.Line(); Line = reader.Line();
if( Line[0] != '$' ) if( Line[0] != '$' )
...@@ -365,8 +362,8 @@ wxString PCB_BASE_FRAME::Select_1_Module_From_List( EDA_DRAW_FRAME* aWindow, ...@@ -365,8 +362,8 @@ wxString PCB_BASE_FRAME::Select_1_Module_From_List( EDA_DRAW_FRAME* aWindow,
MList.ReadFootprintFiles( libnames_list ); MList.ReadFootprintFiles( libnames_list );
wxArrayString footprint_names_list; wxArrayString footprint_names_list;
/* Create list of modules if search by keyword. */
if( !aKeyWord.IsEmpty() ) if( !aKeyWord.IsEmpty() ) // Create a list of modules found by keyword.
{ {
for( unsigned ii = 0; ii < MList.GetCount(); ii++ ) for( unsigned ii = 0; ii < MList.GetCount(); ii++ )
{ {
...@@ -374,7 +371,16 @@ wxString PCB_BASE_FRAME::Select_1_Module_From_List( EDA_DRAW_FRAME* aWindow, ...@@ -374,7 +371,16 @@ wxString PCB_BASE_FRAME::Select_1_Module_From_List( EDA_DRAW_FRAME* aWindow,
footprint_names_list.Add( MList.GetItem(ii).m_Module ); footprint_names_list.Add( MList.GetItem(ii).m_Module );
} }
} }
else else if( !aMask.IsEmpty() ) // Create a list of modules found by pattern
{
for( unsigned ii = 0; ii < MList.GetCount(); ii++ )
{
wxString& candidate = MList.GetItem(ii).m_Module;
if( WildCompareString( aMask, candidate, false ) )
footprint_names_list.Add( candidate );
}
}
else // Create the full list of modules
for( unsigned ii = 0; ii < MList.GetCount(); ii++ ) for( unsigned ii = 0; ii < MList.GetCount(); ii++ )
footprint_names_list.Add( MList.GetItem(ii).m_Module ); footprint_names_list.Add( MList.GetItem(ii).m_Module );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment