beautify, move function comments to header for Doxygen

This commit is contained in:
dickelbeck 2009-08-23 14:21:41 +00:00
parent 08d98df73e
commit 856b7c790f
2 changed files with 118 additions and 109 deletions

View File

@ -282,21 +282,42 @@ void InstallPineditFrame(WinEDA_LibeditFrame * parent, wxDC * DC, const wxPoint
/* 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,
LibraryStruct *Library, wxString & Buffer, wxString & OldName);
LibraryStruct * SelectLibraryFromList(WinEDA_DrawFrame * frame);
/* Routine pour selectionner une librairie a partir d'une liste */
/**
* 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);
/**
* 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,
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 */

View File

@ -24,10 +24,6 @@
/***************************************************************/
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();
LibraryStruct* Lib = NULL;
@ -37,7 +33,7 @@ wxString LibName;
if( NumOfLibs == 0 )
{
DisplayError( frame, _( "No libraries are loaded" ) );
return(NULL) ;
return NULL;
}
WinEDAListBox ListBox( frame, _( "Select Lib" ),
@ -72,7 +68,7 @@ wxString LibName;
Lib = FindLibrary( libNamesList[ii] );
}
return(Lib);
return Lib;
}
@ -80,14 +76,6 @@ wxString LibName;
int DisplayComponentsNamesInLib( WinEDA_DrawFrame* frame,
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;
wxString msg;
@ -95,8 +83,11 @@ EDA_LibComponentStruct *LibEntry;
WinEDAListBox* ListBox;
const wxChar** ListNames;
if(Library == NULL) Library = SelectLibraryFromList(frame);
if(Library == NULL) return(0);
if( Library == NULL )
Library = SelectLibraryFromList( frame );
if( Library == NULL )
return 0;
PQCompFunc( (PQCompFuncType) LibraryEntryCompare );
LibEntry = (EDA_LibComponentStruct*) PQFirst( &Library->m_Entries, FALSE );
@ -107,6 +98,7 @@ const wxChar ** ListNames;
ii++;
LibEntry = (EDA_LibComponentStruct*) PQNext( Library->m_Entries, LibEntry, NULL );
}
ListNames = (const wxChar**) MyZMalloc( (ii + 1) * sizeof(wxChar*) );
msg.Printf( _( "Select component (%d items)" ), ii );
@ -124,37 +116,33 @@ const wxChar ** ListNames;
ListBox = new WinEDAListBox( frame, msg,
ListNames, OldName, DisplayCmpDoc,
wxColour( 255, 255, 255 ) ); // Component background listbox color
ListBox->MoveMouseToOrigin();
ii = ListBox->ShowModal(); ListBox->Destroy();
if ( ii >= 0 ) Buffer = ListNames[ii];
if( ii >= 0 )
Buffer = ListNames[ii];
free( ListNames );
if ( ii < 0 ) return 0;
if( ii < 0 )
return 0;
return 1;
}
/************************************************************/
int GetNameOfPartToLoad( WinEDA_DrawFrame* frame,
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;
static wxString OldCmpName;
ii = DisplayComponentsNamesInLib( frame, Library, BufName, OldCmpName );
if( ii <= 0 ) return 0;
if( ii <= 0 )
return 0;
OldCmpName = BufName;
return( 1 );
return 1;
}