In eeschema, when inserting a component into the schematic using the
Library Browser tool, you have to select it in the components listbox and then press the "Insert component into schematic" button to close the window and return to the schematic. The attached patch enables the selection and insertion of a component in schematic by double clicking on it in the Library Browser component listbox. As the double clicking should have effect only if the Library Browser was launched to load a component in schematic, the patch checks for NULL the m_Semaphore variable, used two distinguish the mode in which the Library Browser is running (modal, used when inserting a component in schematic, or non-modal).
This commit is contained in:
parent
275f02adc3
commit
c971460467
|
@ -74,6 +74,7 @@ BEGIN_EVENT_TABLE( LIB_VIEW_FRAME, EDA_DRAW_FRAME )
|
||||||
/* listbox events */
|
/* listbox events */
|
||||||
EVT_LISTBOX( ID_LIBVIEW_LIB_LIST, LIB_VIEW_FRAME::ClickOnLibList )
|
EVT_LISTBOX( ID_LIBVIEW_LIB_LIST, LIB_VIEW_FRAME::ClickOnLibList )
|
||||||
EVT_LISTBOX( ID_LIBVIEW_CMP_LIST, LIB_VIEW_FRAME::ClickOnCmpList )
|
EVT_LISTBOX( ID_LIBVIEW_CMP_LIST, LIB_VIEW_FRAME::ClickOnCmpList )
|
||||||
|
EVT_LISTBOX_DCLICK( ID_LIBVIEW_CMP_LIST, LIB_VIEW_FRAME::DClickOnCmpList )
|
||||||
|
|
||||||
EVT_MENU( ID_SET_RELATIVE_OFFSET, LIB_VIEW_FRAME::OnSetRelativeOffset )
|
EVT_MENU( ID_SET_RELATIVE_OFFSET, LIB_VIEW_FRAME::OnSetRelativeOffset )
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
@ -497,6 +498,13 @@ void LIB_VIEW_FRAME::ClickOnCmpList( wxCommandEvent& event )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LIB_VIEW_FRAME::DClickOnCmpList( wxCommandEvent& event )
|
||||||
|
{
|
||||||
|
if( m_Semaphore )
|
||||||
|
{
|
||||||
|
ExportToSchematicLibraryPart ( event );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void LIB_VIEW_FRAME::ExportToSchematicLibraryPart( wxCommandEvent& event )
|
void LIB_VIEW_FRAME::ExportToSchematicLibraryPart( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
|
|
|
@ -166,6 +166,7 @@ private:
|
||||||
void ExportToSchematicLibraryPart( wxCommandEvent& event );
|
void ExportToSchematicLibraryPart( wxCommandEvent& event );
|
||||||
void ViewOneLibraryContent( CMP_LIBRARY* Lib, int Flag );
|
void ViewOneLibraryContent( CMP_LIBRARY* Lib, int Flag );
|
||||||
bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
|
bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
|
||||||
|
void DClickOnCmpList( wxCommandEvent& event );
|
||||||
|
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue