KiCad PCB EDA Suite
common/legacy_gal/block.cpp File Reference
#include <fctsys.h>
#include <gr_basic.h>
#include <draw_frame.h>
#include <common.h>
#include <macros.h>
#include <base_struct.h>
#include <base_screen.h>
#include <class_drawpanel.h>
#include <confirm.h>
#include <block_commande.h>

Go to the source code of this file.


void AbortBlockCurrentCommand (EDA_DRAW_PANEL *aPanel, wxDC *aDC)
 Function AbortBlockCurrentCommand cancels the current block operation. More...

Function Documentation

◆ AbortBlockCurrentCommand()

void AbortBlockCurrentCommand ( EDA_DRAW_PANEL aPanel,
wxDC *  aDC 

Function AbortBlockCurrentCommand cancels the current block operation.

Definition at line 179 of file common/legacy_gal/block.cpp.

180 {
181  BASE_SCREEN* screen = aPanel->GetScreen();
183  if( aPanel->IsMouseCaptured() )
184  {
185  aPanel->SetMouseCapture( NULL, NULL );
186  screen->SetCurItem( NULL );
187  }
190  aPanel->GetParent()->HandleBlockEnd( aDC );
192  aPanel->GetParent()->DisplayToolMsg( wxEmptyString );
194  // ugly, but temporary
195  auto gal_panel = dynamic_cast<EDA_DRAW_PANEL_GAL*>( aPanel );
197  if( gal_panel )
198  gal_panel->SetDefaultCursor();
199 }
virtual BASE_SCREEN * GetScreen()=0
void SetCurItem(EDA_ITEM *aItem)
Function SetCurItem sets the currently selected object, m_CurrentItem.
Definition: base_screen.h:231
Block description for block commands.
Definition: base_screen.h:214
virtual EDA_DRAW_FRAME * GetParent() const =0
Class BASE_SCREEN handles how to draw a screen (a board, a schematic ...)
Definition: base_screen.h:76
virtual void SetMouseCapture(MOUSE_CAPTURE_CALLBACK aMouseCaptureCallback, END_MOUSE_CAPTURE_CALLBACK aEndMouseCaptureCallback)
Function SetMouseCapture sets the mouse capture and end mouse capture callbacks to aMouseCaptureCallb...
virtual bool HandleBlockEnd(wxDC *DC)
Handle the "end" of a block command, i.e.
void DisplayToolMsg(const wxString &msg)
void SetCommand(BLOCK_COMMAND_T aCommand)

Referenced by LIB_EDIT_FRAME::HandleBlockEnd(), SCH_EDIT_FRAME::HandleBlockEnd(), and BLOCK_SELECTOR::InitData().