本文整理汇总了C++中TEXTE_MODULE::GetType方法的典型用法代码示例。如果您正苦于以下问题:C++ TEXTE_MODULE::GetType方法的具体用法?C++ TEXTE_MODULE::GetType怎么用?C++ TEXTE_MODULE::GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TEXTE_MODULE
的用法示例。
在下文中一共展示了TEXTE_MODULE::GetType方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RemoveStruct
void FOOTPRINT_EDIT_FRAME::RemoveStruct( EDA_ITEM* Item )
{
if( Item == NULL )
return;
switch( Item->Type() )
{
case PCB_PAD_T:
DeletePad( (D_PAD*) Item, false );
break;
case PCB_MODULE_TEXT_T:
{
TEXTE_MODULE* text = (TEXTE_MODULE*) Item;
if( text->GetType() == TEXT_is_REFERENCE )
{
DisplayError( this, _( "Text is REFERENCE!" ) );
break;
}
if( text->GetType() == TEXT_is_VALUE )
{
DisplayError( this, _( "Text is VALUE!" ) );
break;
}
DeleteTextModule( text );
}
break;
case PCB_MODULE_EDGE_T:
Delete_Edge_Module( (EDGE_MODULE*) Item );
m_canvas->Refresh();
break;
case PCB_MODULE_T:
break;
default:
{
wxString Line;
Line.Printf( wxT( " Remove: draw item type %d unknown." ), Item->Type() );
DisplayError( this, Line );
}
break;
}
}
示例2: RemoveStruct
void FOOTPRINT_EDIT_FRAME::RemoveStruct( EDA_ITEM* Item )
{
if( Item == NULL )
return;
switch( Item->Type() )
{
case PCB_PAD_T:
DeletePad( (D_PAD*) Item, false );
break;
case PCB_MODULE_TEXT_T:
{
TEXTE_MODULE* text = static_cast<TEXTE_MODULE*>( Item );
switch( text->GetType() )
{
case TEXTE_MODULE::TEXT_is_REFERENCE:
DisplayError( this, _( "Cannot delete REFERENCE!" ) );
break;
case TEXTE_MODULE::TEXT_is_VALUE:
DisplayError( this, _( "Cannot delete VALUE!" ) );
break;
case TEXTE_MODULE::TEXT_is_DIVERS:
DeleteTextModule( text );
}
}
break;
case PCB_MODULE_EDGE_T:
Delete_Edge_Module( (EDGE_MODULE*) Item );
m_canvas->Refresh();
break;
case PCB_MODULE_T:
break;
default:
{
wxString Line;
Line.Printf( wxT( " RemoveStruct: item type %d unknown." ), Item->Type() );
wxMessageBox( Line );
}
break;
}
}
示例3: remove
void EDIT_TOOL::remove( BOARD_ITEM* aItem )
{
BOARD* board = getModel<BOARD>();
switch( aItem->Type() )
{
case PCB_MODULE_T:
{
MODULE* module = static_cast<MODULE*>( aItem );
module->ClearFlags();
module->RunOnChildren( boost::bind( &KIGFX::VIEW::Remove, getView(), _1 ) );
// Module itself is deleted after the switch scope is finished
// list of pads is rebuild by BOARD::BuildListOfNets()
// Clear flags to indicate, that the ratsnest, list of nets & pads are not valid anymore
board->m_Status_Pcb = 0;
}
break;
// Default removal procedure
case PCB_MODULE_TEXT_T:
{
TEXTE_MODULE* text = static_cast<TEXTE_MODULE*>( aItem );
switch( text->GetType() )
{
case TEXTE_MODULE::TEXT_is_REFERENCE:
DisplayError( getEditFrame<PCB_BASE_FRAME>(), _( "Cannot delete component reference." ) );
return;
case TEXTE_MODULE::TEXT_is_VALUE:
DisplayError( getEditFrame<PCB_BASE_FRAME>(), _( "Cannot delete component value." ) );
return;
case TEXTE_MODULE::TEXT_is_DIVERS: // suppress warnings
break;
}
if( m_editModules )
{
MODULE* module = static_cast<MODULE*>( aItem->GetParent() );
module->SetLastEditTime();
board->m_Status_Pcb = 0; // it is done in the legacy view
aItem->DeleteStructure();
}
return;
}
case PCB_PAD_T:
case PCB_MODULE_EDGE_T:
{
MODULE* module = static_cast<MODULE*>( aItem->GetParent() );
module->SetLastEditTime();
board->m_Status_Pcb = 0; // it is done in the legacy view
if( !m_editModules )
{
getView()->Remove( aItem );
board->Remove( aItem );
}
aItem->DeleteStructure();
return;
}
case PCB_LINE_T: // a segment not on copper layers
case PCB_TEXT_T: // a text on a layer
case PCB_TRACE_T: // a track segment (segment on a copper layer)
case PCB_VIA_T: // a via (like track segment on a copper layer)
case PCB_DIMENSION_T: // a dimension (graphic item)
case PCB_TARGET_T: // a target (graphic item)
case PCB_MARKER_T: // a marker used to show something
case PCB_ZONE_T: // SEG_ZONE items are now deprecated
case PCB_ZONE_AREA_T:
break;
default: // other types do not need to (or should not) be handled
assert( false );
return;
}
getView()->Remove( aItem );
board->Remove( aItem );
}
示例4: initDlg
void DialogEditModuleText::initDlg( )
{
SetFocus();
wxString msg;
if( m_module )
{
wxString format = m_ModuleInfoText->GetLabel();
msg.Printf( format,
GetChars( m_module->GetReference() ),
GetChars( m_module->GetValue() ),
m_module->GetOrientation() / 10.0 );
}
else
{
msg.Empty();
}
m_ModuleInfoText->SetLabel( msg );
switch( m_currentText->GetType() )
{
case TEXTE_MODULE::TEXT_is_VALUE:
m_TextDataTitle->SetLabel( _( "Value:" ) );
break;
case TEXTE_MODULE::TEXT_is_DIVERS:
m_TextDataTitle->SetLabel( _( "Text:" ) );
break;
default:
m_TextDataTitle->SetLabel( _( "Reference:" ) );
break;
}
m_Name->SetValue( m_currentText->GetText() );
m_Style->SetSelection( m_currentText->IsItalic() ? 1 : 0 );
AddUnitSymbol( *m_SizeXTitle );
PutValueInLocalUnits( *m_TxtSizeCtrlX, m_currentText->GetSize().x );
AddUnitSymbol( *m_SizeYTitle );
PutValueInLocalUnits( *m_TxtSizeCtrlY, m_currentText->GetSize().y );
AddUnitSymbol( *m_PosXTitle );
PutValueInLocalUnits( *m_TxtPosCtrlX, m_currentText->GetPos0().x );
AddUnitSymbol( *m_PosYTitle );
PutValueInLocalUnits( *m_TxtPosCtrlY, m_currentText->GetPos0().y );
AddUnitSymbol( *m_WidthTitle );
PutValueInLocalUnits( *m_TxtWidthCtlr, m_currentText->GetThickness() );
double text_orient = m_currentText->GetOrientation();
NORMALIZE_ANGLE_90( text_orient );
if( (text_orient != 0) )
m_Orient->SetSelection( 1 );
if( !m_currentText->IsVisible() )
m_Show->SetSelection( 1 );;
}
示例5: Push
//.........这里部分代码省略.........
// modules inside modules are not supported yet
wxASSERT( boardItem->Type() != PCB_MODULE_T );
boardItem->SetParent( board->m_Modules.GetFirst() );
if( !( changeFlags & CHT_DONE ) )
board->m_Modules->Add( boardItem );
}
view->Add( boardItem );
break;
}
case CHT_REMOVE:
{
if( !m_editModules && aCreateUndoEntry )
undoList.PushItem( ITEM_PICKER( boardItem, UR_DELETED ) );
switch( boardItem->Type() )
{
// Module items
case PCB_PAD_T:
case PCB_MODULE_EDGE_T:
case PCB_MODULE_TEXT_T:
// This level can only handle module items when editing modules
if( !m_editModules )
break;
if( boardItem->Type() == PCB_MODULE_TEXT_T )
{
TEXTE_MODULE* text = static_cast<TEXTE_MODULE*>( boardItem );
// don't allow deletion of Reference or Value
if( text->GetType() != TEXTE_MODULE::TEXT_is_DIVERS )
break;
}
view->Remove( boardItem );
if( !( changeFlags & CHT_DONE ) )
{
MODULE* module = static_cast<MODULE*>( boardItem->GetParent() );
wxASSERT( module && module->Type() == PCB_MODULE_T );
module->Delete( boardItem );
}
board->m_Status_Pcb = 0; // it is done in the legacy view (ratsnest perhaps?)
break;
// Board items
case PCB_LINE_T: // a segment not on copper layers
case PCB_TEXT_T: // a text on a layer
case PCB_TRACE_T: // a track segment (segment on a copper layer)
case PCB_VIA_T: // a via (like track segment on a copper layer)
case PCB_DIMENSION_T: // a dimension (graphic item)
case PCB_TARGET_T: // a target (graphic item)
case PCB_MARKER_T: // a marker used to show something
case PCB_ZONE_AREA_T:
itemsToDeselect.push_back( boardItem );
view->Remove( boardItem );
if( !( changeFlags & CHT_DONE ) )
board->Remove( boardItem );
示例6: Push
//.........这里部分代码省略.........
if( !( changeFlags & CHT_DONE ) )
board->m_Modules->Add( boardItem );
}
view->Add( boardItem );
break;
}
case CHT_REMOVE:
{
if( !m_editModules )
{
undoList.PushItem( ITEM_PICKER( boardItem, UR_DELETED ) );
}
switch( boardItem->Type() )
{
// Module items
case PCB_PAD_T:
case PCB_MODULE_EDGE_T:
case PCB_MODULE_TEXT_T:
{
// Do not allow footprint text removal when not editing a module
if( !m_editModules )
break;
bool remove = true;
if( boardItem->Type() == PCB_MODULE_TEXT_T )
{
TEXTE_MODULE* text = static_cast<TEXTE_MODULE*>( boardItem );
switch( text->GetType() )
{
case TEXTE_MODULE::TEXT_is_REFERENCE:
//DisplayError( frame, _( "Cannot delete component reference." ) );
remove = false;
break;
case TEXTE_MODULE::TEXT_is_VALUE:
//DisplayError( frame, _( "Cannot delete component value." ) );
remove = false;
break;
case TEXTE_MODULE::TEXT_is_DIVERS: // suppress warnings
break;
default:
assert( false );
break;
}
}
if( remove )
{
view->Remove( boardItem );
if( !( changeFlags & CHT_DONE ) )
{
MODULE* module = static_cast<MODULE*>( boardItem->GetParent() );
assert( module && module->Type() == PCB_MODULE_T );
module->Delete( boardItem );
}
board->m_Status_Pcb = 0; // it is done in the legacy view (ratsnest perhaps?)