本文整理汇总了C++中TEXTE_MODULE::SetTextSize方法的典型用法代码示例。如果您正苦于以下问题:C++ TEXTE_MODULE::SetTextSize方法的具体用法?C++ TEXTE_MODULE::SetTextSize怎么用?C++ TEXTE_MODULE::SetTextSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TEXTE_MODULE
的用法示例。
在下文中一共展示了TEXTE_MODULE::SetTextSize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ResetTextSize
void PCB_BASE_FRAME::ResetTextSize( BOARD_ITEM* aItem, wxDC* aDC )
{
wxSize newSize;
int newThickness;
if( aItem->Type() == PCB_TEXT_T )
{
newSize = GetDesignSettings().m_PcbTextSize;
newThickness = GetDesignSettings().m_PcbTextWidth;
TEXTE_PCB* text = static_cast<TEXTE_PCB*>( aItem );
// Exit if there's nothing to do
if( text->GetTextSize() == newSize && text->GetThickness() == newThickness )
return;
SaveCopyInUndoList( text, UR_CHANGED );
text->SetTextSize( newSize );
text->SetThickness( newThickness );
}
else if( aItem->Type() == PCB_MODULE_TEXT_T )
{
newSize = GetDesignSettings().m_ModuleTextSize;
newThickness = GetDesignSettings().m_ModuleTextWidth;
TEXTE_MODULE* text = static_cast<TEXTE_MODULE*>( aItem );
// Exit if there's nothing to do
if( text->GetTextSize() == newSize && text->GetThickness() == newThickness )
return;
SaveCopyInUndoList( text->GetParent(), UR_CHANGED );
text->SetTextSize( newSize );
text->SetThickness( newThickness );
}
else
return;
if( aDC )
m_canvas->Refresh();
OnModify();
}
示例2: CreateTextModule
/* Add a new graphical text to the active module (footprint)
* Note there always are 2 mandatory texts: reference and value.
* New texts have the member TEXTE_MODULE.GetType() set to TEXT_is_DIVERS
*/
TEXTE_MODULE* FOOTPRINT_EDIT_FRAME::CreateTextModule( MODULE* aModule, wxDC* aDC )
{
TEXTE_MODULE* text = new TEXTE_MODULE( aModule );
text->SetFlags( IS_NEW );
GetDesignSettings().m_ModuleTextWidth = Clamp_Text_PenSize( GetDesignSettings().m_ModuleTextWidth,
std::min( GetDesignSettings().m_ModuleTextSize.x, GetDesignSettings().m_ModuleTextSize.y ), true );
text->SetTextSize( GetDesignSettings().m_ModuleTextSize );
text->SetThickness( GetDesignSettings().m_ModuleTextWidth );
text->SetPosition( GetCrossHairPosition() );
if( LSET::AllTechMask().test( GetActiveLayer() ) ) // i.e. a possible layer for a text
text->SetLayer( GetActiveLayer() );
InstallTextModOptionsFrame( text, NULL );
m_canvas->MoveCursorToCrossHair();
if( text->GetText().IsEmpty() )
{
delete text;
return NULL;
}
// Add the new text object to the beginning of the footprint draw list.
if( aModule )
aModule->GraphicalItems().PushFront( text );
text->ClearFlags();
if( aDC )
text->Draw( m_canvas, aDC, GR_OR );
SetMsgPanel( text );
return text;
}
示例3: ResetModuleTextSizes
void PCB_BASE_FRAME::ResetModuleTextSizes( const wxString & aFilter, bool aRef,
bool aValue, bool aOthers )
{
BOARD_COMMIT commit( this );
int modTextWidth = GetDesignSettings().m_ModuleTextWidth;
const wxSize& modTextSize = GetDesignSettings().m_ModuleTextSize;
bool modified = false;
// Change fields of footprints with fpid matching the filter
for( MODULE* module = GetBoard()->m_Modules; module; module = module->Next() )
{
if( !aFilter.IsEmpty() )
{
if( ! WildCompareString( aFilter, FROM_UTF8( module->GetFPID().Format().c_str() ),
false ) )
continue;
}
if( aRef )
{
TEXTE_MODULE* item = &module->Reference();
if( item->GetTextSize() != GetDesignSettings().m_ModuleTextSize ||
item->GetThickness() != GetDesignSettings().m_ModuleTextWidth )
{
commit.Modify( item );
item->SetThickness( modTextWidth );
item->SetTextSize( modTextSize );
modified = true;
}
}
if( aValue )
{
TEXTE_MODULE* item = &module->Value();
if( item->GetTextSize() != GetDesignSettings().m_ModuleTextSize ||
item->GetThickness() != GetDesignSettings().m_ModuleTextWidth )
{
commit.Modify( item );
item->SetThickness( modTextWidth );
item->SetTextSize( modTextSize );
modified = true;
}
}
if( aOthers )
{
// Go through all other module text fields
for( BOARD_ITEM* boardItem = module->GraphicalItemsList(); boardItem; boardItem = boardItem->Next() )
{
if( boardItem->Type() == PCB_MODULE_TEXT_T )
{
TEXTE_MODULE* item = static_cast<TEXTE_MODULE*>( boardItem );
if( item->GetTextSize() != GetDesignSettings().m_ModuleTextSize
|| item->GetThickness() != GetDesignSettings().m_ModuleTextWidth )
{
commit.Modify( item );
item->SetThickness( modTextWidth );
item->SetTextSize( modTextSize );
modified = true;
}
}
}
}
}
if( modified )
{
commit.Push( "Reset module text size" );
GetCanvas()->Refresh();
}
}