Commit 6b8bc98d authored by charras's avatar charras

fixed in libedit: import symbol not working.

parent 52631fc5
...@@ -528,7 +528,7 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -528,7 +528,7 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event )
case ID_LIBEDIT_IMPORT_BODY_BUTT: case ID_LIBEDIT_IMPORT_BODY_BUTT:
SetToolID( id, wxCURSOR_ARROW, _( "Import" ) ); SetToolID( id, wxCURSOR_ARROW, _( "Import" ) );
LoadOneSymbol( &dc ); LoadOneSymbol( );
SetToolID( 0, wxCURSOR_ARROW, wxEmptyString ); SetToolID( 0, wxCURSOR_ARROW, wxEmptyString );
break; break;
......
...@@ -28,12 +28,13 @@ static bool CompareSymbols( LibEDA_BaseStruct* DEntryRef, ...@@ -28,12 +28,13 @@ static bool CompareSymbols( LibEDA_BaseStruct* DEntryRef,
/* Variables locales */ /* Variables locales */
/***************************************************/ /***********************************************/
void WinEDA_LibeditFrame::LoadOneSymbol( wxDC* DC ) void WinEDA_LibeditFrame::LoadOneSymbol( void )
/***************************************************/ /***********************************************/
/* Read a component shape file and add data (graphic items) to the current /* Read a component shape file (a symbol file *.sym )and add data (graphic items) to the current
* component. * component.
* a symbol file *.sym has the same format as a library, and contains only one symbol
*/ */
{ {
int NumOfParts; int NumOfParts;
...@@ -44,11 +45,12 @@ void WinEDA_LibeditFrame::LoadOneSymbol( wxDC* DC ) ...@@ -44,11 +45,12 @@ void WinEDA_LibeditFrame::LoadOneSymbol( wxDC* DC )
FILE* ImportFile; FILE* ImportFile;
wxString msg; wxString msg;
if( CurrentDrawItem )
return;
if( CurrentLibEntry == NULL ) if( CurrentLibEntry == NULL )
return; return;
if( CurrentDrawItem && CurrentDrawItem->m_Flags ) // a command is in progress
return;
DrawPanel->m_IgnoreMouseEvents = TRUE; DrawPanel->m_IgnoreMouseEvents = TRUE;
mask = wxT( "*" ) + g_SymbolExtBuffer; mask = wxT( "*" ) + g_SymbolExtBuffer;
...@@ -116,13 +118,21 @@ void WinEDA_LibeditFrame::LoadOneSymbol( wxDC* DC ) ...@@ -116,13 +118,21 @@ void WinEDA_LibeditFrame::LoadOneSymbol( wxDC* DC )
DrawEntry = DrawEntry->Next(); DrawEntry = DrawEntry->Next();
} }
// Remove duplicated drawings:
SuppressDuplicateDrawItem( CurrentLibEntry ); SuppressDuplicateDrawItem( CurrentLibEntry );
// crear flags
DrawEntry = CurrentLibEntry->m_Drawings;
while( DrawEntry )
{
DrawEntry->m_Flags = 0;
DrawEntry->m_Selected = 0;
DrawEntry = DrawEntry->Next();
}
GetScreen()->SetModify(); GetScreen()->SetModify();
// Move (and place ) the new draw items: DrawPanel->Refresh();
HandleBlockBegin( DC, -1, GetScreen()->m_Curseur );
HandleBlockEnd( DC );
RedrawActiveWindow( DC, TRUE );
} }
PQFreeFunc( Entries, ( void( * ) ( void* ) )FreeLibraryEntry ); PQFreeFunc( Entries, ( void( * ) ( void* ) )FreeLibraryEntry );
......
...@@ -446,7 +446,7 @@ private: ...@@ -446,7 +446,7 @@ private:
void GraphicItemBeginDraw( wxDC* DC ); void GraphicItemBeginDraw( wxDC* DC );
void StartMoveDrawSymbol( wxDC* DC ); void StartMoveDrawSymbol( wxDC* DC );
void EndDrawGraphicItem( wxDC* DC ); void EndDrawGraphicItem( wxDC* DC );
void LoadOneSymbol( wxDC* DC ); void LoadOneSymbol( );
void SaveOneSymbol(); void SaveOneSymbol();
void EditGraphicSymbol( wxDC* DC, LibEDA_BaseStruct* DrawItem ); void EditGraphicSymbol( wxDC* DC, LibEDA_BaseStruct* DrawItem );
void EditSymbolText( wxDC* DC, LibEDA_BaseStruct* DrawItem ); void EditSymbolText( wxDC* DC, LibEDA_BaseStruct* DrawItem );
......
No preview for this file type
This diff is collapsed.
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