All: Fix an usually unwanted behavior in kicad: When closing a dialog (mainly ERC, DRC and recently a component selection by the library viewer on a double click) the mouse release left button event (which is seen by the parent after closing the dialog, becuse it is actually made in the parent) generate an unwanted command (item selection, component place ...)
This event can be now skipped if needed by calling EDA_DRAW_FRAME::SkipNextLeftButtonReleaseEvent() from the dialog. Very minor other fixes
This commit is contained in:
@@ -209,6 +209,20 @@ void EDA_DRAW_FRAME::OnMenuOpen( wxMenuEvent& event )
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
/* function SkipNextLeftButtonReleaseEvent
|
||||
* after calling this function, if the left mouse button
|
||||
* is down, the next left mouse button release event will be ignored.
|
||||
* It is is usefull for instance when closing a dialog on a mouse click,
|
||||
* to skip the next mouse left button release event
|
||||
* by the parent window, because the mouse button
|
||||
* clicked on the dialog is often released in the parent frame,
|
||||
* and therefore creates a left button released mouse event
|
||||
* which can be unwanted in some cases
|
||||
*/
|
||||
void EDA_DRAW_FRAME::SkipNextLeftButtonReleaseEvent()
|
||||
{
|
||||
m_canvas->SetIgnoreLeftButtonReleaseEvent( true );
|
||||
}
|
||||
|
||||
void EDA_DRAW_FRAME::OnToggleGridState( wxCommandEvent& aEvent )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user