fixed minor problem in Eeschema library viewer

This commit is contained in:
charras 2009-10-18 11:41:05 +00:00
parent 15e0734525
commit e4467d4d9a
5 changed files with 1840 additions and 1839 deletions

View File

@ -26,7 +26,7 @@ void WinEDA_ViewlibFrame::ReCreateHToolbar()
if( m_HToolBar == NULL ) if( m_HToolBar == NULL )
{ {
m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR,
TRUE ); true );
SetToolBar( m_HToolBar ); SetToolBar( m_HToolBar );
// Set up toolbar // Set up toolbar
@ -86,7 +86,7 @@ void WinEDA_ViewlibFrame::ReCreateHToolbar()
m_HToolBar->AddTool( ID_LIBVIEW_VIEWDOC, wxEmptyString, m_HToolBar->AddTool( ID_LIBVIEW_VIEWDOC, wxEmptyString,
wxBitmap( datasheet_xpm ), wxBitmap( datasheet_xpm ),
_( "View component documents" ) ); _( "View component documents" ) );
m_HToolBar->EnableTool( ID_LIBVIEW_VIEWDOC, FALSE ); m_HToolBar->EnableTool( ID_LIBVIEW_VIEWDOC, false );
if( m_Semaphore ) // The lib browser is called from a "load component" command if( m_Semaphore ) // The lib browser is called from a "load component" command
{ {
@ -119,12 +119,23 @@ void WinEDA_ViewlibFrame::ReCreateHToolbar()
} }
// Must be AFTER Realize(): // Must be AFTER Realize():
if( asdeMorgan )
{
m_HToolBar->ToggleTool( ID_LIBVIEW_DE_MORGAN_NORMAL_BUTT, m_HToolBar->ToggleTool( ID_LIBVIEW_DE_MORGAN_NORMAL_BUTT,
(m_convert <= 1) ? TRUE : FALSE ); (m_convert <= 1) ? true : false );
m_HToolBar->ToggleTool( ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT, m_HToolBar->ToggleTool( ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT,
(m_convert >= 2) ? TRUE : FALSE ); (m_convert >= 2) ? true : false );
m_HToolBar->EnableTool( ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT, asdeMorgan ); m_HToolBar->EnableTool( ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT, true );
m_HToolBar->EnableTool( ID_LIBVIEW_DE_MORGAN_NORMAL_BUTT, asdeMorgan ); m_HToolBar->EnableTool( ID_LIBVIEW_DE_MORGAN_NORMAL_BUTT, true );
}
else
{
m_HToolBar->ToggleTool( ID_LIBVIEW_DE_MORGAN_NORMAL_BUTT, true );
m_HToolBar->ToggleTool( ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT, false );
m_HToolBar->EnableTool( ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT, false );
m_HToolBar->EnableTool( ID_LIBVIEW_DE_MORGAN_NORMAL_BUTT, false );
}
int jj = 1; int jj = 1;
if( component ) if( component )
@ -137,7 +148,7 @@ void WinEDA_ViewlibFrame::ReCreateHToolbar()
SelpartBox->Append( msg ); SelpartBox->Append( msg );
} }
SelpartBox->SetSelection( m_unit - 1 ); SelpartBox->SetSelection( (m_unit > 0 ) ? m_unit - 1 : 0 );
SelpartBox->Enable( component && component->HasConversion() ); SelpartBox->Enable( component && component->HasConversion() );
m_HToolBar->EnableTool( ID_LIBVIEW_VIEWDOC, m_HToolBar->EnableTool( ID_LIBVIEW_VIEWDOC,

View File

@ -458,8 +458,8 @@ void WinEDA_ViewlibFrame::ClickOnCmpList( wxCommandEvent& event )
{ {
m_entryName = name; m_entryName = name;
DisplayLibInfos(); DisplayLibInfos();
m_unit = 0; m_unit = 1;
m_convert = 0; m_convert = 1;
Zoom_Automatique( false ); Zoom_Automatique( false );
ReCreateHToolbar(); ReCreateHToolbar();
DrawPanel->Refresh(); DrawPanel->Refresh();

Binary file not shown.

File diff suppressed because it is too large Load Diff