本文整理汇总了C++中PCB_EDIT_FRAME::GetScreen方法的典型用法代码示例。如果您正苦于以下问题:C++ PCB_EDIT_FRAME::GetScreen方法的具体用法?C++ PCB_EDIT_FRAME::GetScreen怎么用?C++ PCB_EDIT_FRAME::GetScreen使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PCB_EDIT_FRAME
的用法示例。
在下文中一共展示了PCB_EDIT_FRAME::GetScreen方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Show_Zone_Corner_Or_Outline_While_Move_Mouse
/// Redraws the zone outline when moving a corner according to the cursor position
void Show_Zone_Corner_Or_Outline_While_Move_Mouse( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
const wxPoint& aPosition, bool aErase )
{
PCB_EDIT_FRAME* pcbframe = (PCB_EDIT_FRAME*) aPanel->GetParent();
ZONE_CONTAINER* zone = (ZONE_CONTAINER*) pcbframe->GetCurItem();
if( aErase ) // Undraw edge in old position
{
zone->Draw( aPanel, aDC, GR_XOR );
}
wxPoint pos = pcbframe->GetScreen()->GetCrossHairPosition();
if( zone->IsMoving() )
{
wxPoint offset;
offset = pos - s_CursorLastPosition;
zone->Move( offset );
s_CursorLastPosition = pos;
}
else if( zone->IsDragging() )
{
wxPoint offset;
offset = pos - s_CursorLastPosition;
zone->MoveEdge( offset );
s_CursorLastPosition = pos;
}
else
{
zone->m_Poly->MoveCorner( zone->m_CornerSelection, pos.x, pos.y );
}
zone->Draw( aPanel, aDC, GR_XOR );
}
示例2: Show_New_Edge_While_Move_Mouse
/* Redraws the zone outlines when moving mouse
*/
static void Show_New_Edge_While_Move_Mouse( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
const wxPoint& aPosition, bool aErase )
{
PCB_EDIT_FRAME* pcbframe = (PCB_EDIT_FRAME*) aPanel->GetParent();
wxPoint c_pos = pcbframe->GetScreen()->GetCrossHairPosition();
ZONE_CONTAINER* zone = pcbframe->GetBoard()->m_CurrentZoneContour;
if( !zone )
return;
int icorner = zone->GetNumCorners() - 1;
if( icorner < 1 )
return; // We must have 2 (or more) corners
if( aErase ) // Undraw edge in old position
{
zone->DrawWhileCreateOutline( aPanel, aDC );
}
// Redraw the current edge in its new position
if( pcbframe->GetZoneSettings().m_Zone_45_Only )
{
// calculate the new position as allowed
wxPoint StartPoint = zone->GetCornerPosition( icorner - 1 );
CalculateSegmentEndPoint( c_pos, StartPoint.x, StartPoint.y, &c_pos.x, &c_pos.y );
}
zone->SetCornerPosition( icorner, c_pos );
zone->DrawWhileCreateOutline( aPanel, aDC );
}
示例3: Process_Special_Functions
//.........这里部分代码省略.........
break;
case ID_OPEN_MODULE_VIEWER:
{
FOOTPRINT_VIEWER_FRAME * viewer = FOOTPRINT_VIEWER_FRAME::GetActiveFootprintViewer();
if( viewer == NULL )
{
viewer = new FOOTPRINT_VIEWER_FRAME( this, NULL );
viewer->Show( true );
viewer->Zoom_Automatique( false );
}
else
{
if( viewer->IsIconized() )
viewer->Iconize( false );
viewer->Raise();
// Raising the window does not set the focus on Linux. This should work on
// any platform.
if( wxWindow::FindFocus() != viewer )
viewer->SetFocus();
}
}
break;
case ID_MODEDIT_DELETE_PART:
DeleteModuleFromCurrentLibrary();
break;
case ID_MODEDIT_NEW_MODULE:
{
Clear_Pcb( true );
GetScreen()->ClearUndoRedoList();
SetCurItem( NULL );
GetScreen()->SetCrossHairPosition( wxPoint( 0, 0 ) );
MODULE* module = Create_1_Module( wxEmptyString );
if( module ) // i.e. if create module command not aborted
{
// Initialize data relative to nets and netclasses (for a new
// module the defaults are used)
// This is mandatory to handle and draw pads
GetBoard()->BuildListOfNets();
redraw = true;
module->SetPosition( wxPoint( 0, 0 ) );
if( GetBoard()->m_Modules )
GetBoard()->m_Modules->ClearFlags();
Zoom_Automatique( false );
}
}
break;
case ID_MODEDIT_NEW_MODULE_FROM_WIZARD:
{
Clear_Pcb( true );
GetScreen()->ClearUndoRedoList();
SetCurItem( NULL );
GetScreen()->SetCrossHairPosition( wxPoint( 0, 0 ) );
wxSemaphore semaphore( 0, 1 );
FOOTPRINT_WIZARD_FRAME *wizard = new FOOTPRINT_WIZARD_FRAME( this, &semaphore,
KICAD_DEFAULT_DRAWFRAME_STYLE | wxFRAME_FLOAT_ON_PARENT );