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.

Functions

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

Function Documentation

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.

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

180 {
181  BASE_SCREEN* screen = aPanel->GetScreen();
182 
183  if( aPanel->IsMouseCaptured() ) // Erase current drawing on screen
184  {
185  aPanel->SetMouseCapture( NULL, NULL );
186  screen->SetCurItem( NULL );
187 
188  // Delete the picked wrapper if this is a picked list.
189  screen->m_BlockLocate.ClearItemsList();
190  }
191 
194  aPanel->GetParent()->HandleBlockEnd( aDC );
195 
197  aPanel->GetParent()->DisplayToolMsg( wxEmptyString );
198 
199  // ugly, but temporary
200  auto gal_panel = dynamic_cast<EDA_DRAW_PANEL_GAL*>( aPanel );
201 
202  if( gal_panel )
203  gal_panel->SetDefaultCursor();
204 }
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_SELECTOR m_BlockLocate
Block description for block commands.
Definition: base_screen.h:214
void ClearItemsList()
Function ClearItemsList clear only the list of EDA_ITEM pointers, it does NOT delete the EDA_ITEM obj...
virtual EDA_DRAW_FRAME * GetParent() const =0
void SetState(BLOCK_STATE_T aState)
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)
virtual void SetDefaultCursor()
void SetCommand(BLOCK_COMMAND_T aCommand)