Page layout editor: fix incorrect management of block operation in context (popup) menu.
This commit is contained in:
parent
f1cf95b8dd
commit
17f6d09935
|
@ -907,9 +907,13 @@ void SCH_EDIT_FRAME::doUpdatePcb( const wxString& aUpdateOptions )
|
|||
|
||||
exporter.Format( &formatter, GNL_ALL );
|
||||
|
||||
// Copy the netlist in a static string, to have a long life time
|
||||
// and giving to Pcbnew the time to analyze this netlist:
|
||||
static std::string netlist_string;
|
||||
netlist_string = wxString::Format("%s\n%s", aUpdateOptions, formatter.GetString() ).ToStdString();
|
||||
|
||||
// Now, send the "kicad" (s-expr) netlist to Pcbnew
|
||||
Kiway().ExpressMail( FRAME_PCB, MAIL_SCH_PCB_UPDATE,
|
||||
wxString::Format("%s\n%s", aUpdateOptions, formatter.GetString() ).ToStdString(), this );
|
||||
Kiway().ExpressMail( FRAME_PCB, MAIL_SCH_PCB_UPDATE, netlist_string, this );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -99,6 +99,7 @@ BEGIN_EVENT_TABLE( PL_EDITOR_FRAME, EDA_DRAW_FRAME )
|
|||
// the ID_NO_TOOL_SELECTED id TOOL does not existing currently, but the right click
|
||||
// popup menu can generate this event.
|
||||
EVT_TOOL( ID_NO_TOOL_SELECTED, PL_EDITOR_FRAME::Process_Special_Functions )
|
||||
EVT_TOOL( ID_POPUP_CANCEL_CURRENT_COMMAND, PL_EDITOR_FRAME::Process_Special_Functions )
|
||||
|
||||
EVT_MENU_RANGE( ID_POPUP_START_RANGE, ID_POPUP_END_RANGE,
|
||||
PL_EDITOR_FRAME::Process_Special_Functions )
|
||||
|
@ -155,6 +156,15 @@ void PL_EDITOR_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
break;
|
||||
|
||||
case ID_POPUP_CANCEL_CURRENT_COMMAND:
|
||||
if( m_canvas->IsMouseCaptured() )
|
||||
{
|
||||
m_canvas->EndMouseCapture();
|
||||
SetToolID( GetToolId(), m_canvas->GetCurrentCursor(), wxEmptyString );
|
||||
}
|
||||
else
|
||||
{
|
||||
SetNoToolSelected();
|
||||
}
|
||||
break;
|
||||
|
||||
case ID_POPUP_DESIGN_TREE_ITEM_DELETE:
|
||||
|
|
|
@ -61,8 +61,18 @@ void AddNewItemsCommand( wxMenu* aMainMenu )
|
|||
bool PL_EDITOR_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* aPopMenu )
|
||||
{
|
||||
bool busy = GetScreen()->GetCurItem() != NULL;
|
||||
bool blockActive = GetScreen()->IsBlockActive();
|
||||
wxString msg;
|
||||
|
||||
if( blockActive )
|
||||
{
|
||||
|
||||
AddMenuItem( aPopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND, _( "Cancel Block" ),
|
||||
KiBitmap( cancel_xpm ) );
|
||||
aPopMenu->AppendSeparator();
|
||||
return true;
|
||||
}
|
||||
|
||||
// If the tool ID_ZOOM_SELECTION is currently in use, add a
|
||||
if( GetToolId() == ID_ZOOM_SELECTION && !busy )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue