本文整理汇总了C++中DRAWSEGMENT::ViewUpdate方法的典型用法代码示例。如果您正苦于以下问题:C++ DRAWSEGMENT::ViewUpdate方法的具体用法?C++ DRAWSEGMENT::ViewUpdate怎么用?C++ DRAWSEGMENT::ViewUpdate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DRAWSEGMENT
的用法示例。
在下文中一共展示了DRAWSEGMENT::ViewUpdate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drawSegment
//.........这里部分代码省略.........
if( aShape == S_SEGMENT )
line45 = *aGraphic; // used only for direction 45 mode with lines
preview.Add( aGraphic );
m_controls->SetAutoPan( true );
m_controls->CaptureCursor( true );
started = true;
}
}
else
{
if( aGraphic->GetEnd() == aGraphic->GetStart() ||
( evt->IsDblClick( BUT_LEFT ) && aShape == S_SEGMENT ) )
// User has clicked twice in the same spot
{ // a clear sign that the current drawing is finished
if( direction45 )
{
// Now we have to add the helper line as well
if( m_editModules )
{
EDGE_MODULE* l = new EDGE_MODULE( m_board->m_Modules );
// Copy coordinates, layer, etc.
*static_cast<DRAWSEGMENT*>( l ) = line45;
l->SetEnd( aGraphic->GetStart() );
l->SetLocalCoord();
m_frame->SaveCopyInUndoList( m_board->m_Modules, UR_MODEDIT );
m_board->m_Modules->SetLastEditTime();
m_board->m_Modules->GraphicalItems().PushFront( l );
m_view->Add( l );
l->ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY );
}
else
{
DRAWSEGMENT* l = static_cast<DRAWSEGMENT*>( line45.Clone() );
l->SetEnd( aGraphic->GetStart() );
m_frame->SaveCopyInUndoList( l, UR_NEW );
m_board->Add( l );
m_view->Add( l );
l->ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY );
}
m_frame->OnModify();
}
delete aGraphic;
aGraphic = NULL;
}
else
{
assert( aGraphic->GetLength() > 0 );
assert( aGraphic->GetWidth() > 0 );
m_view->Add( aGraphic );
aGraphic->ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY );
}
preview.Clear();
break;
}
}