本文整理汇总了C++中TEXTE_MODULE::ClearFlags方法的典型用法代码示例。如果您正苦于以下问题:C++ TEXTE_MODULE::ClearFlags方法的具体用法?C++ TEXTE_MODULE::ClearFlags怎么用?C++ TEXTE_MODULE::ClearFlags使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TEXTE_MODULE
的用法示例。
在下文中一共展示了TEXTE_MODULE::ClearFlags方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AbortMoveTextModule
/**
* Abort text move in progress.
*
* If a text is selected, its initial coordinates are regenerated.
*/
static void AbortMoveTextModule( EDA_DRAW_PANEL* Panel, wxDC* DC )
{
BASE_SCREEN* screen = Panel->GetScreen();
TEXTE_MODULE* Text = static_cast<TEXTE_MODULE*>( screen->GetCurItem() );
MODULE* Module;
Panel->SetMouseCapture( NULL, NULL );
if( Text == NULL )
return;
Module = static_cast<MODULE*>( Text->GetParent() );
Text->DrawUmbilical( Panel, DC, GR_XOR, -MoveVector );
Text->Draw( Panel, DC, GR_XOR, MoveVector );
// If the text was moved (the move does not change internal data)
// it could be rotated while moving. So set old value for orientation
if( Text->IsMoving() )
Text->SetTextAngle( TextInitialOrientation );
// Redraw the text
Panel->RefreshDrawingRect( Text->GetBoundingBox() );
// leave it at (0,0) so we can use it Rotate when not moving.
MoveVector.x = MoveVector.y = 0;
Text->ClearFlags();
Module->ClearFlags();
screen->SetCurItem( NULL );
}
示例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 );
if( LSET::AllTechMask().test( GetActiveLayer() ) ) // i.e. a possible layer for a text
text->SetLayer( GetActiveLayer() );
InstallTextOptionsFrame( text, NULL );
if( text->GetText().IsEmpty() )
{
delete text;
return NULL;
}
// Add the new text object to the beginning of the footprint draw list.
if( aModule )
aModule->GraphicalItemsList().PushFront( text );
text->ClearFlags();
if( aDC )
text->Draw( m_canvas, aDC, GR_OR );
SetMsgPanel( text );
return text;
}
示例3: 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;
}
示例4: placeTextModule
int DRAWING_TOOL::placeTextModule()
{
TEXTE_MODULE* text = new TEXTE_MODULE( NULL );
const BOARD_DESIGN_SETTINGS& dsnSettings = m_frame->GetDesignSettings();
assert( m_editModules );
// Add a VIEW_GROUP that serves as a preview for the new item
KIGFX::VIEW_GROUP preview( m_view );
m_view->Add( &preview );
m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true );
m_controls->ShowCursor( true );
m_controls->SetSnapping( true );
// do not capture or auto-pan until we start placing some text
Activate();
m_frame->SetToolID( ID_MODEDIT_TEXT_TOOL, wxCURSOR_PENCIL, _( "Add text" ) );
bool placing = false;
// Main loop: keep receiving events
while( OPT_TOOL_EVENT evt = Wait() )
{
VECTOR2I cursorPos = m_controls->GetCursorPosition();
if( evt->IsCancel() || evt->IsActivate() )
{
preview.Clear();
preview.ViewUpdate();
m_controls->SetAutoPan( false );
m_controls->CaptureCursor( false );
m_controls->ShowCursor( true );
if( !placing || evt->IsActivate() )
{
delete text;
break;
}
else
{
placing = false; // start from the beginning
}
}
else if( text && evt->Category() == TC_COMMAND )
{
if( evt->IsAction( &COMMON_ACTIONS::rotate ) )
{
text->Rotate( text->GetPosition(), m_frame->GetRotationAngle() );
preview.ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY );
}
else if( evt->IsAction( &COMMON_ACTIONS::flip ) )
{
text->Flip( text->GetPosition() );
preview.ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY );
}
}
else if( evt->IsClick( BUT_LEFT ) )
{
if( !placing )
{
text->SetSize( dsnSettings.m_ModuleTextSize );
text->SetThickness( dsnSettings.m_ModuleTextWidth );
text->SetTextPosition( wxPoint( cursorPos.x, cursorPos.y ) );
DialogEditModuleText textDialog( m_frame, text, NULL );
placing = textDialog.ShowModal() && ( text->GetText().Length() > 0 );
if( !placing )
continue;
m_controls->CaptureCursor( true );
m_controls->SetAutoPan( true );
m_controls->ShowCursor( false );
text->SetParent( m_board->m_Modules ); // it has to set after the settings dialog
// otherwise the dialog stores it in undo buffer
preview.Add( text );
}
else
{
assert( text->GetText().Length() > 0 );
assert( text->GetSize().x > 0 && text->GetSize().y > 0 );
text->SetLocalCoord();
text->ClearFlags();
// Module has to be saved before any modification is made
m_frame->SaveCopyInUndoList( m_board->m_Modules, UR_MODEDIT );
m_board->m_Modules->SetLastEditTime();
m_board->m_Modules->GraphicalItems().PushFront( text );
m_view->Add( text );
text->ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY );
m_frame->OnModify();
preview.Remove( text );
m_controls->CaptureCursor( false );
m_controls->SetAutoPan( false );
//.........这里部分代码省略.........