Example #1
0
/*
 * Routine to select and view library Part (NEW, NEXT or PREVIOUS)
 */
void LIB_VIEW_FRAME::SelectAndViewLibraryPart( int option )
{
    CMP_LIBRARY* Lib;

    if( m_libraryName.IsEmpty() )
        SelectCurrentLibrary();
    if( m_libraryName.IsEmpty() )
        return;

    Lib = CMP_LIBRARY::FindLibrary( m_libraryName );

    if( Lib == NULL )
        return;

    if( ( m_entryName.IsEmpty() ) || ( option == NEW_PART ) )
    {
        ViewOneLibraryContent( Lib, NEW_PART );
        return;
    }

    LIB_ALIAS* LibEntry = Lib->FindEntry( m_entryName );

    if( LibEntry == NULL )
        return;

    if( option == NEXT_PART )
        ViewOneLibraryContent( Lib, NEXT_PART );

    if( option == PREVIOUS_PART )
        ViewOneLibraryContent( Lib, PREVIOUS_PART );
}
Example #2
0
void WinEDA_ViewlibFrame::SelectAndViewLibraryPart(int option)
/**************************************************************/
/* Routine to select and view library Part  (NEW, NEXT or PREVIOUS) */
{
LibraryStruct * Lib;

	if(g_CurrentViewLibraryName.IsEmpty() ) SelectCurrentLibrary();
	if(g_CurrentViewLibraryName.IsEmpty() ) return;

	Lib = FindLibrary(g_CurrentViewLibraryName.GetData());
	if ( Lib == NULL ) return;

	if ( (g_CurrentViewComponentName.IsEmpty()) || ( option == NEW_PART ) )
		{
		ViewOneLibraryContent(Lib, NEW_PART);
		return;
		}

	EDA_LibComponentStruct * LibEntry = FindLibPart(g_CurrentViewComponentName.GetData(),
								 g_CurrentViewLibraryName.GetData(), FIND_ALIAS);

	if ( LibEntry == NULL ) return;

	if (option == NEXT_PART )
		ViewOneLibraryContent(Lib, NEXT_PART);

	if (option == PREVIOUS_PART )
		ViewOneLibraryContent(Lib, PREVIOUS_PART);

}