本文整理汇总了C++中BOARD_ITEM::IsDragging方法的典型用法代码示例。如果您正苦于以下问题:C++ BOARD_ITEM::IsDragging方法的具体用法?C++ BOARD_ITEM::IsDragging怎么用?C++ BOARD_ITEM::IsDragging使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BOARD_ITEM
的用法示例。
在下文中一共展示了BOARD_ITEM::IsDragging方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnHotkeyPlaceItem
bool PCB_EDIT_FRAME::OnHotkeyPlaceItem( wxDC* aDC )
{
BOARD_ITEM* item = GetCurItem();
bool no_tool = GetToolId() == ID_NO_TOOL_SELECTED;
bool itemCurrentlyEdited = item && item->GetFlags();
m_canvas->SetAutoPanRequest( false );
if( itemCurrentlyEdited )
{
m_canvas->SetIgnoreMouseEvents( true );
m_canvas->CrossHairOff( aDC );
switch( item->Type() )
{
case PCB_TRACE_T:
case PCB_VIA_T:
if( item->IsDragging() )
PlaceDraggedOrMovedTrackSegment( static_cast<TRACK*>( item ), aDC );
break;
case PCB_TEXT_T:
Place_Texte_Pcb( static_cast<TEXTE_PCB*>( item ), aDC );
break;
case PCB_MODULE_TEXT_T:
PlaceTexteModule( static_cast<TEXTE_MODULE*>( item ), aDC );
break;
case PCB_PAD_T:
PlacePad( static_cast<D_PAD*>( item ), aDC );
break;
case PCB_MODULE_T:
PlaceModule( static_cast<MODULE*>( item ), aDC );
break;
case PCB_TARGET_T:
PlaceTarget( static_cast<PCB_TARGET*>( item ), aDC );
break;
case PCB_LINE_T:
if( no_tool ) // when no tools: existing item moving.
Place_DrawItem( static_cast<DRAWSEGMENT*>( item ), aDC );
break;
default:
break;
}
m_canvas->SetIgnoreMouseEvents( false );
m_canvas->CrossHairOn( aDC );
return true;
}
return false;
}
示例2: OnLeftClick
/* Handle the left button mouse click, when a tool is active
*/
void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
{
BOARD_ITEM* DrawStruct = GetCurItem();
bool exit = false;
bool no_tool = GetToolId() == ID_NO_TOOL_SELECTED;
if( no_tool || ( DrawStruct && DrawStruct->GetFlags() ) )
{
m_canvas->SetAutoPanRequest( false );
if( DrawStruct && DrawStruct->GetFlags() ) // Command in progress
{
m_canvas->SetIgnoreMouseEvents( true );
m_canvas->CrossHairOff( aDC );
switch( DrawStruct->Type() )
{
case PCB_ZONE_AREA_T:
if( DrawStruct->IsNew() )
{
m_canvas->SetAutoPanRequest( true );
Begin_Zone( aDC );
}
else
{
End_Move_Zone_Corner_Or_Outlines( aDC, (ZONE_CONTAINER*) DrawStruct );
}
exit = true;
break;
case PCB_TRACE_T:
case PCB_VIA_T:
if( DrawStruct->IsDragging() )
{
PlaceDraggedOrMovedTrackSegment( (TRACK*) DrawStruct, aDC );
exit = true;
}
break;
case PCB_TEXT_T:
Place_Texte_Pcb( (TEXTE_PCB*) DrawStruct, aDC );
exit = true;
break;
case PCB_MODULE_TEXT_T:
PlaceTexteModule( (TEXTE_MODULE*) DrawStruct, aDC );
exit = true;
break;
case PCB_PAD_T:
PlacePad( (D_PAD*) DrawStruct, aDC );
exit = true;
break;
case PCB_MODULE_T:
PlaceModule( (MODULE*) DrawStruct, aDC );
exit = true;
break;
case PCB_TARGET_T:
PlaceTarget( (PCB_TARGET*) DrawStruct, aDC );
exit = true;
break;
case PCB_LINE_T:
if( no_tool ) // when no tools: existing item moving.
{
Place_DrawItem( (DRAWSEGMENT*) DrawStruct, aDC );
exit = true;
}
break;
case PCB_DIMENSION_T:
if( ! DrawStruct->IsNew() )
{ // We are moving the text of an existing dimension. Place it
PlaceDimensionText( (DIMENSION*) DrawStruct, aDC );
exit = true;
}
break;
default:
DisplayError( this,
wxT( "PCB_EDIT_FRAME::OnLeftClick() err: DrawType %d m_Flags != 0" ),
DrawStruct->Type() );
exit = true;
break;
}
m_canvas->SetIgnoreMouseEvents( false );
m_canvas->CrossHairOn( aDC );
if( exit )
return;
}
else if( !wxGetKeyState( WXK_SHIFT ) && !wxGetKeyState( WXK_ALT )
//.........这里部分代码省略.........