本文整理汇总了C++中TEXTE_MODULE::SetText方法的典型用法代码示例。如果您正苦于以下问题:C++ TEXTE_MODULE::SetText方法的具体用法?C++ TEXTE_MODULE::SetText怎么用?C++ TEXTE_MODULE::SetText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TEXTE_MODULE
的用法示例。
在下文中一共展示了TEXTE_MODULE::SetText方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnOkClick
void DialogEditModuleText::OnOkClick( wxCommandEvent& event )
{
wxString msg;
if ( m_module)
m_parent->SaveCopyInUndoList( m_module, UR_CHANGED );
#ifndef USE_WX_OVERLAY
if( m_dc ) //Erase old text on screen
{
m_currentText->Draw( m_parent->GetCanvas(), m_dc, GR_XOR,
(m_currentText->IsMoving()) ? MoveVector : wxPoint( 0, 0 ) );
}
#endif
m_currentText->SetText( m_Name->GetValue() );
m_currentText->SetItalic( m_Style->GetSelection() == 1 );
wxPoint tmp;
msg = m_TxtPosCtrlX->GetValue();
tmp.x = ValueFromString( g_UserUnit, msg );
msg = m_TxtPosCtrlY->GetValue();
tmp.y = ValueFromString( g_UserUnit, msg );
m_currentText->SetPos0( tmp );
wxSize textSize( wxSize( ValueFromString( g_UserUnit, m_TxtSizeCtrlX->GetValue() ),
ValueFromString( g_UserUnit, m_TxtSizeCtrlY->GetValue() ) ) );
// Test for a reasonnable size:
if( textSize.x < TEXTS_MIN_SIZE )
textSize.x = TEXTS_MIN_SIZE;
if( textSize.y < TEXTS_MIN_SIZE )
textSize.y = TEXTS_MIN_SIZE;
m_currentText->SetSize( textSize ),
msg = m_TxtWidthCtlr->GetValue();
int width = ValueFromString( g_UserUnit, msg );
// Test for a reasonnable width:
if( width <= 1 )
width = 1;
int maxthickness = Clamp_Text_PenSize(width, m_currentText->GetSize() );
if( width > maxthickness )
{
DisplayError( NULL,
_( "The text thickness is too large for the text size. It will be clamped" ) );
width = maxthickness;
}
m_currentText->SetThickness( width );
m_currentText->SetVisible( m_Show->GetSelection() == 0 );
int text_orient = (m_Orient->GetSelection() == 0) ? 0 : 900;
m_currentText->SetOrientation( text_orient );
m_currentText->SetDrawCoord();
#ifndef USE_WX_OVERLAY
if( m_dc ) // Display new text
{
m_currentText->Draw( m_parent->GetCanvas(), m_dc, GR_XOR,
(m_currentText->IsMoving()) ? MoveVector : wxPoint( 0, 0 ) );
}
#else
m_parent->Refresh();
#endif
m_parent->OnModify();
if( m_module )
m_module->SetLastEditTime();
EndModal(1);
}
示例2: Process_Special_Functions
//.........这里部分代码省略.........
wxString libPath = CreateNewLibrary();
if( libPath.size() )
SaveCurrentModule( &libPath );
}
break;
case ID_MODEDIT_SHEET_SET:
break;
case ID_MODEDIT_LOAD_MODULE:
wxLogDebug( wxT( "Loading module from library " ) + getLibPath() );
if( ! Clear_Pcb( true ) )
break;
SetCrossHairPosition( wxPoint( 0, 0 ) );
LoadModuleFromLibrary( GetCurrentLib(), Prj().PcbFootprintLibs(), true );
if( GetBoard() && GetBoard()->m_Modules )
{
GetBoard()->m_Modules->ClearFlags();
// if either m_Reference or m_Value are gone, reinstall them -
// otherwise you cannot see what you are doing on board
TEXTE_MODULE* ref = &GetBoard()->m_Modules->Reference();
TEXTE_MODULE* val = &GetBoard()->m_Modules->Value();
if( val && ref )
{
ref->SetType( TEXTE_MODULE::TEXT_is_REFERENCE ); // just in case ...
if( ref->GetLength() == 0 )
ref->SetText( wxT( "Ref**" ) );
val->SetType( TEXTE_MODULE::TEXT_is_VALUE ); // just in case ...
if( val->GetLength() == 0 )
val->SetText( wxT( "Val**" ) );
}
}
Zoom_Automatique( false );
{
EDA_3D_VIEWER* draw3DFrame = Get3DViewerFrame();
if( draw3DFrame )
draw3DFrame->NewDisplay();
}
GetScreen()->ClrModify();
updateView();
m_canvas->Refresh();
break;
case ID_MODEDIT_PAD_SETTINGS:
InstallPadOptionsFrame( NULL );
break;
case ID_MODEDIT_CHECK:
// Currently: not implemented
break;
示例3: PlaceDXF
//.........这里部分代码省略.........
{
preview.FreeItems();
break;
}
}
else if ( evt->IsClick( BUT_RIGHT ) )
{
showContextMenu();
}
else if( evt->IsClick( BUT_LEFT ) )
{
// Place the drawing
BOARD_ITEM_CONTAINER* parent = m_frame->GetModel();
for( auto item : preview )
{
if( m_editModules )
{
// Modules use different types for the same things,
// so we need to convert imported items to appropriate classes.
BOARD_ITEM* converted = NULL;
switch( item->Type() )
{
case PCB_TEXT_T:
{
TEXTE_PCB* text = static_cast<TEXTE_PCB*>( item );
TEXTE_MODULE* textMod = new TEXTE_MODULE( (MODULE*) parent );
// Assignment operator also copies the item PCB_TEXT_T type,
// so it cannot be added to a module which handles PCB_MODULE_TEXT_T
textMod->SetPosition( text->GetPosition() );
textMod->SetText( text->GetText() );
textMod->SetSize( text->GetSize() );
textMod->SetThickness( text->GetThickness() );
textMod->SetOrientation( text->GetOrientation() );
textMod->SetTextPosition( text->GetTextPosition() );
textMod->SetSize( text->GetSize() );
textMod->SetMirrored( text->IsMirrored() );
textMod->SetAttributes( text->GetAttributes() );
textMod->SetItalic( text->IsItalic() );
textMod->SetBold( text->IsBold() );
textMod->SetHorizJustify( text->GetHorizJustify() );
textMod->SetVertJustify( text->GetVertJustify() );
textMod->SetMultilineAllowed( text->IsMultilineAllowed() );
converted = textMod;
break;
}
case PCB_LINE_T:
{
DRAWSEGMENT* seg = static_cast<DRAWSEGMENT*>( item );
EDGE_MODULE* modSeg = new EDGE_MODULE( (MODULE*) parent );
// Assignment operator also copies the item PCB_LINE_T type,
// so it cannot be added to a module which handles PCB_MODULE_EDGE_T
modSeg->SetWidth( seg->GetWidth() );
modSeg->SetStart( seg->GetStart() );
modSeg->SetEnd( seg->GetEnd() );
modSeg->SetAngle( seg->GetAngle() );
modSeg->SetShape( seg->GetShape() );
modSeg->SetType( seg->GetType() );
modSeg->SetBezControl1( seg->GetBezControl1() );
modSeg->SetBezControl2( seg->GetBezControl2() );
modSeg->SetBezierPoints( seg->GetBezierPoints() );