本文整理汇总了C++中LIB_ITEM::SetWidth方法的典型用法代码示例。如果您正苦于以下问题:C++ LIB_ITEM::SetWidth方法的具体用法?C++ LIB_ITEM::SetWidth怎么用?C++ LIB_ITEM::SetWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LIB_ITEM
的用法示例。
在下文中一共展示了LIB_ITEM::SetWidth方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateGraphicItem
LIB_ITEM* LIB_EDIT_FRAME::CreateGraphicItem( LIB_PART* LibEntry, wxDC* DC )
{
LIB_ITEM* item = GetDrawItem();
m_canvas->SetMouseCapture( SymbolDisplayDraw, AbortSymbolTraceOn );
wxPoint drawPos = GetCrossHairPosition( true );
// no temp copy -> the current version of symbol will be used for Undo
// This is normal when adding new items to the current symbol
ClearTempCopyComponent();
switch( GetToolId() )
{
case ID_LIBEDIT_BODY_ARC_BUTT:
item = new LIB_ARC( LibEntry );
break;
case ID_LIBEDIT_BODY_CIRCLE_BUTT:
item = new LIB_CIRCLE( LibEntry );
break;
case ID_LIBEDIT_BODY_RECT_BUTT:
item = new LIB_RECTANGLE( LibEntry );
break;
case ID_LIBEDIT_BODY_LINE_BUTT:
item = new LIB_POLYLINE( LibEntry );
break;
case ID_LIBEDIT_BODY_TEXT_BUTT:
{
LIB_TEXT* text = new LIB_TEXT( LibEntry );
text->SetTextSize( wxSize( m_textSize, m_textSize ) );
text->SetTextAngle( m_current_text_angle );
// Enter the graphic text info
m_canvas->SetIgnoreMouseEvents( true );
EditSymbolText( NULL, text );
m_canvas->SetIgnoreMouseEvents( false );
m_canvas->MoveCursorToCrossHair();
if( text->GetText().IsEmpty() )
{
delete text;
item = NULL;
}
else
{
item = text;
}
}
break;
default:
DisplayError( this, wxT( "LIB_EDIT_FRAME::CreateGraphicItem() error" ) );
return NULL;
}
if( item )
{
item->BeginEdit( IS_NEW, drawPos );
// Don't set line parameters for text objects.
if( item->Type() != LIB_TEXT_T )
{
item->SetWidth( m_drawLineWidth );
item->SetFillMode( m_drawFillStyle );
}
if( m_drawSpecificUnit )
item->SetUnit( m_unit );
if( m_drawSpecificConvert )
item->SetConvert( m_convert );
// Draw initial symbol:
m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );
}
else
{
m_canvas->EndMouseCapture();
return NULL;
}
m_canvas->MoveCursorToCrossHair();
m_canvas->SetIgnoreMouseEvents( false );
SetDrawItem( item );
return item;
}