Loading eeschema/protos.h +30 −9 Original line number Original line Diff line number Diff line Loading @@ -282,21 +282,42 @@ void InstallPineditFrame(WinEDA_LibeditFrame * parent, wxDC * DC, const wxPoint /* SELPART.CPP */ /* SELPART.CPP */ /**************/ /**************/ /** * Function DisplayComponentsNamesInLib * Routine de selection d'un composant en librairie, par affichage de la * liste des composants de cette librairie * Si Library == NULL, selection de librairie demandee * sinon recherche uniquement dans library * Retourne * 1 si composant selectionne * 0 si commande annulee */ int DisplayComponentsNamesInLib(WinEDA_DrawFrame * frame, int DisplayComponentsNamesInLib(WinEDA_DrawFrame * frame, LibraryStruct *Library, wxString & Buffer, wxString & OldName); LibraryStruct *Library, wxString & Buffer, wxString & OldName); /** * Function SelectLibraryFromList * displays a list of current loaded libraries, and allows the user to select a library * This list is sorted, with the library cache always at end of the list */ LibraryStruct * SelectLibraryFromList(WinEDA_DrawFrame * frame); LibraryStruct * SelectLibraryFromList(WinEDA_DrawFrame * frame); /* Routine pour selectionner une librairie a partir d'une liste */ /** * Function GetNameOfPartToLoad * Routine de selection du nom d'un composant en librairie pour chargement, * dans la librairie Library. * Si Library == NULL, il y aura demande de selection d'une librairie * Retourne * 1 si composant selectionne * 0 si commande annulee * place le nom du composant a charger, selectionne a partir d'une liste dans * BufName */ int GetNameOfPartToLoad(WinEDA_DrawFrame * frame, LibraryStruct * Lib, int GetNameOfPartToLoad(WinEDA_DrawFrame * frame, LibraryStruct * Lib, wxString & BufName); wxString & BufName); /* Routine de selection du nom d'un composant en librairie pour chargement, dans la librairie Library. Si Library == NULL, il y aura demande de selection d'une librairie Retourne 1 si composant selectionne 0 si commande annulee place le nom du composant a charger, selectionne a partir d'une liste dans BufName */ /**************/ /**************/ /* LIBARCH.CPP */ /* LIBARCH.CPP */ Loading eeschema/selpart.cpp +93 −105 Original line number Original line Diff line number Diff line Loading @@ -24,10 +24,6 @@ /***************************************************************/ /***************************************************************/ LibraryStruct* SelectLibraryFromList( WinEDA_DrawFrame* frame ) LibraryStruct* SelectLibraryFromList( WinEDA_DrawFrame* frame ) /***************************************************************/ /***************************************************************/ /** Function SelectLibraryFromList * Displays a list of current loaded libraries, and allows the user to select a library * This list is sorted, with the library cache always at end of the list */ { { int ii, NumOfLibs = NumOfLibraries(); int ii, NumOfLibs = NumOfLibraries(); LibraryStruct* Lib = NULL; LibraryStruct* Lib = NULL; Loading @@ -37,7 +33,7 @@ wxString LibName; if( NumOfLibs == 0 ) if( NumOfLibs == 0 ) { { DisplayError( frame, _( "No libraries are loaded" ) ); DisplayError( frame, _( "No libraries are loaded" ) ); return(NULL) ; return NULL; } } WinEDAListBox ListBox( frame, _( "Select Lib" ), WinEDAListBox ListBox( frame, _( "Select Lib" ), Loading Loading @@ -72,7 +68,7 @@ wxString LibName; Lib = FindLibrary( libNamesList[ii] ); Lib = FindLibrary( libNamesList[ii] ); } } return(Lib); return Lib; } } Loading @@ -80,14 +76,6 @@ wxString LibName; int DisplayComponentsNamesInLib( WinEDA_DrawFrame* frame, int DisplayComponentsNamesInLib( WinEDA_DrawFrame* frame, LibraryStruct* Library, wxString& Buffer, wxString& OldName ) LibraryStruct* Library, wxString& Buffer, wxString& OldName ) /******************************************************************************************/ /******************************************************************************************/ /* Routine de selection d'un composant en librairie, par affichage de la liste des composants de cette librairie Si Library == NULL, selection de librairie demandee sinon recherche uniquement dans library Retourne 1 si composant selectionne 0 si commande annulee */ { { int ii; int ii; wxString msg; wxString msg; Loading @@ -95,8 +83,11 @@ EDA_LibComponentStruct *LibEntry; WinEDAListBox* ListBox; WinEDAListBox* ListBox; const wxChar** ListNames; const wxChar** ListNames; if(Library == NULL) Library = SelectLibraryFromList(frame); if( Library == NULL ) if(Library == NULL) return(0); Library = SelectLibraryFromList( frame ); if( Library == NULL ) return 0; PQCompFunc( (PQCompFuncType) LibraryEntryCompare ); PQCompFunc( (PQCompFuncType) LibraryEntryCompare ); LibEntry = (EDA_LibComponentStruct*) PQFirst( &Library->m_Entries, FALSE ); LibEntry = (EDA_LibComponentStruct*) PQFirst( &Library->m_Entries, FALSE ); Loading @@ -107,6 +98,7 @@ const wxChar ** ListNames; ii++; ii++; LibEntry = (EDA_LibComponentStruct*) PQNext( Library->m_Entries, LibEntry, NULL ); LibEntry = (EDA_LibComponentStruct*) PQNext( Library->m_Entries, LibEntry, NULL ); } } ListNames = (const wxChar**) MyZMalloc( (ii + 1) * sizeof(wxChar*) ); ListNames = (const wxChar**) MyZMalloc( (ii + 1) * sizeof(wxChar*) ); msg.Printf( _( "Select component (%d items)" ), ii ); msg.Printf( _( "Select component (%d items)" ), ii ); Loading @@ -124,37 +116,33 @@ const wxChar ** ListNames; ListBox = new WinEDAListBox( frame, msg, ListBox = new WinEDAListBox( frame, msg, ListNames, OldName, DisplayCmpDoc, ListNames, OldName, DisplayCmpDoc, wxColour( 255, 255, 255 ) ); // Component background listbox color wxColour( 255, 255, 255 ) ); // Component background listbox color ListBox->MoveMouseToOrigin(); ListBox->MoveMouseToOrigin(); ii = ListBox->ShowModal(); ListBox->Destroy(); ii = ListBox->ShowModal(); ListBox->Destroy(); if ( ii >= 0 ) Buffer = ListNames[ii]; if( ii >= 0 ) Buffer = ListNames[ii]; free( ListNames ); free( ListNames ); if ( ii < 0 ) return 0; if( ii < 0 ) return 0; return 1; return 1; } } /************************************************************/ /************************************************************/ int GetNameOfPartToLoad( WinEDA_DrawFrame* frame, int GetNameOfPartToLoad( WinEDA_DrawFrame* frame, LibraryStruct* Library, wxString& BufName ) LibraryStruct* Library, wxString& BufName ) /************************************************************/ /************************************************************/ /* Routine de selection du nom d'un composant en librairie pour chargement, dans la librairie Library. Si Library == NULL, il y aura demande de selection d'une librairie Retourne 1 si composant selectionne 0 si commande annulee place le nom du composant a charger, selectionne a partir d'une liste dans BufName */ { { int ii; int ii; static wxString OldCmpName; static wxString OldCmpName; ii = DisplayComponentsNamesInLib( frame, Library, BufName, OldCmpName ); ii = DisplayComponentsNamesInLib( frame, Library, BufName, OldCmpName ); if( ii <= 0 ) return 0; if( ii <= 0 ) return 0; OldCmpName = BufName; OldCmpName = BufName; return( 1 ); return 1; } } Loading
eeschema/protos.h +30 −9 Original line number Original line Diff line number Diff line Loading @@ -282,21 +282,42 @@ void InstallPineditFrame(WinEDA_LibeditFrame * parent, wxDC * DC, const wxPoint /* SELPART.CPP */ /* SELPART.CPP */ /**************/ /**************/ /** * Function DisplayComponentsNamesInLib * Routine de selection d'un composant en librairie, par affichage de la * liste des composants de cette librairie * Si Library == NULL, selection de librairie demandee * sinon recherche uniquement dans library * Retourne * 1 si composant selectionne * 0 si commande annulee */ int DisplayComponentsNamesInLib(WinEDA_DrawFrame * frame, int DisplayComponentsNamesInLib(WinEDA_DrawFrame * frame, LibraryStruct *Library, wxString & Buffer, wxString & OldName); LibraryStruct *Library, wxString & Buffer, wxString & OldName); /** * Function SelectLibraryFromList * displays a list of current loaded libraries, and allows the user to select a library * This list is sorted, with the library cache always at end of the list */ LibraryStruct * SelectLibraryFromList(WinEDA_DrawFrame * frame); LibraryStruct * SelectLibraryFromList(WinEDA_DrawFrame * frame); /* Routine pour selectionner une librairie a partir d'une liste */ /** * Function GetNameOfPartToLoad * Routine de selection du nom d'un composant en librairie pour chargement, * dans la librairie Library. * Si Library == NULL, il y aura demande de selection d'une librairie * Retourne * 1 si composant selectionne * 0 si commande annulee * place le nom du composant a charger, selectionne a partir d'une liste dans * BufName */ int GetNameOfPartToLoad(WinEDA_DrawFrame * frame, LibraryStruct * Lib, int GetNameOfPartToLoad(WinEDA_DrawFrame * frame, LibraryStruct * Lib, wxString & BufName); wxString & BufName); /* Routine de selection du nom d'un composant en librairie pour chargement, dans la librairie Library. Si Library == NULL, il y aura demande de selection d'une librairie Retourne 1 si composant selectionne 0 si commande annulee place le nom du composant a charger, selectionne a partir d'une liste dans BufName */ /**************/ /**************/ /* LIBARCH.CPP */ /* LIBARCH.CPP */ Loading
eeschema/selpart.cpp +93 −105 Original line number Original line Diff line number Diff line Loading @@ -24,10 +24,6 @@ /***************************************************************/ /***************************************************************/ LibraryStruct* SelectLibraryFromList( WinEDA_DrawFrame* frame ) LibraryStruct* SelectLibraryFromList( WinEDA_DrawFrame* frame ) /***************************************************************/ /***************************************************************/ /** Function SelectLibraryFromList * Displays a list of current loaded libraries, and allows the user to select a library * This list is sorted, with the library cache always at end of the list */ { { int ii, NumOfLibs = NumOfLibraries(); int ii, NumOfLibs = NumOfLibraries(); LibraryStruct* Lib = NULL; LibraryStruct* Lib = NULL; Loading @@ -37,7 +33,7 @@ wxString LibName; if( NumOfLibs == 0 ) if( NumOfLibs == 0 ) { { DisplayError( frame, _( "No libraries are loaded" ) ); DisplayError( frame, _( "No libraries are loaded" ) ); return(NULL) ; return NULL; } } WinEDAListBox ListBox( frame, _( "Select Lib" ), WinEDAListBox ListBox( frame, _( "Select Lib" ), Loading Loading @@ -72,7 +68,7 @@ wxString LibName; Lib = FindLibrary( libNamesList[ii] ); Lib = FindLibrary( libNamesList[ii] ); } } return(Lib); return Lib; } } Loading @@ -80,14 +76,6 @@ wxString LibName; int DisplayComponentsNamesInLib( WinEDA_DrawFrame* frame, int DisplayComponentsNamesInLib( WinEDA_DrawFrame* frame, LibraryStruct* Library, wxString& Buffer, wxString& OldName ) LibraryStruct* Library, wxString& Buffer, wxString& OldName ) /******************************************************************************************/ /******************************************************************************************/ /* Routine de selection d'un composant en librairie, par affichage de la liste des composants de cette librairie Si Library == NULL, selection de librairie demandee sinon recherche uniquement dans library Retourne 1 si composant selectionne 0 si commande annulee */ { { int ii; int ii; wxString msg; wxString msg; Loading @@ -95,8 +83,11 @@ EDA_LibComponentStruct *LibEntry; WinEDAListBox* ListBox; WinEDAListBox* ListBox; const wxChar** ListNames; const wxChar** ListNames; if(Library == NULL) Library = SelectLibraryFromList(frame); if( Library == NULL ) if(Library == NULL) return(0); Library = SelectLibraryFromList( frame ); if( Library == NULL ) return 0; PQCompFunc( (PQCompFuncType) LibraryEntryCompare ); PQCompFunc( (PQCompFuncType) LibraryEntryCompare ); LibEntry = (EDA_LibComponentStruct*) PQFirst( &Library->m_Entries, FALSE ); LibEntry = (EDA_LibComponentStruct*) PQFirst( &Library->m_Entries, FALSE ); Loading @@ -107,6 +98,7 @@ const wxChar ** ListNames; ii++; ii++; LibEntry = (EDA_LibComponentStruct*) PQNext( Library->m_Entries, LibEntry, NULL ); LibEntry = (EDA_LibComponentStruct*) PQNext( Library->m_Entries, LibEntry, NULL ); } } ListNames = (const wxChar**) MyZMalloc( (ii + 1) * sizeof(wxChar*) ); ListNames = (const wxChar**) MyZMalloc( (ii + 1) * sizeof(wxChar*) ); msg.Printf( _( "Select component (%d items)" ), ii ); msg.Printf( _( "Select component (%d items)" ), ii ); Loading @@ -124,37 +116,33 @@ const wxChar ** ListNames; ListBox = new WinEDAListBox( frame, msg, ListBox = new WinEDAListBox( frame, msg, ListNames, OldName, DisplayCmpDoc, ListNames, OldName, DisplayCmpDoc, wxColour( 255, 255, 255 ) ); // Component background listbox color wxColour( 255, 255, 255 ) ); // Component background listbox color ListBox->MoveMouseToOrigin(); ListBox->MoveMouseToOrigin(); ii = ListBox->ShowModal(); ListBox->Destroy(); ii = ListBox->ShowModal(); ListBox->Destroy(); if ( ii >= 0 ) Buffer = ListNames[ii]; if( ii >= 0 ) Buffer = ListNames[ii]; free( ListNames ); free( ListNames ); if ( ii < 0 ) return 0; if( ii < 0 ) return 0; return 1; return 1; } } /************************************************************/ /************************************************************/ int GetNameOfPartToLoad( WinEDA_DrawFrame* frame, int GetNameOfPartToLoad( WinEDA_DrawFrame* frame, LibraryStruct* Library, wxString& BufName ) LibraryStruct* Library, wxString& BufName ) /************************************************************/ /************************************************************/ /* Routine de selection du nom d'un composant en librairie pour chargement, dans la librairie Library. Si Library == NULL, il y aura demande de selection d'une librairie Retourne 1 si composant selectionne 0 si commande annulee place le nom du composant a charger, selectionne a partir d'une liste dans BufName */ { { int ii; int ii; static wxString OldCmpName; static wxString OldCmpName; ii = DisplayComponentsNamesInLib( frame, Library, BufName, OldCmpName ); ii = DisplayComponentsNamesInLib( frame, Library, BufName, OldCmpName ); if( ii <= 0 ) return 0; if( ii <= 0 ) return 0; OldCmpName = BufName; OldCmpName = BufName; return( 1 ); return 1; } }