本文整理汇总了C++中PCB_SCREEN::GetGridSize方法的典型用法代码示例。如果您正苦于以下问题:C++ PCB_SCREEN::GetGridSize方法的具体用法?C++ PCB_SCREEN::GetGridSize怎么用?C++ PCB_SCREEN::GetGridSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PCB_SCREEN
的用法示例。
在下文中一共展示了PCB_SCREEN::GetGridSize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetGrid
VECTOR2I GRID_HELPER::GetGrid() const
{
PCB_SCREEN* screen = m_frame->GetScreen();
const wxRealPoint& size = screen->GetGridSize();
return VECTOR2I( KiROUND( size.x ), KiROUND( size.y ) );
}
示例2: GeneralControl
void FOOTPRINT_WIZARD_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aHotKey )
{
wxRealPoint gridSize;
wxPoint oldpos;
PCB_SCREEN* screen = GetScreen();
wxPoint pos = aPosition;
wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
cmd.SetEventObject( this );
pos = GetNearestGridPosition( pos );
oldpos = GetCrossHairPosition();
gridSize = screen->GetGridSize();
switch( aHotKey )
{
case WXK_F1:
cmd.SetId( ID_POPUP_ZOOM_IN );
GetEventHandler()->ProcessEvent( cmd );
break;
case WXK_F2:
cmd.SetId( ID_POPUP_ZOOM_OUT );
GetEventHandler()->ProcessEvent( cmd );
break;
case WXK_F3:
cmd.SetId( ID_ZOOM_REDRAW );
GetEventHandler()->ProcessEvent( cmd );
break;
case WXK_F4:
cmd.SetId( ID_POPUP_ZOOM_CENTER );
GetEventHandler()->ProcessEvent( cmd );
break;
case WXK_HOME:
cmd.SetId( ID_ZOOM_PAGE );
GetEventHandler()->ProcessEvent( cmd );
break;
case ' ':
screen->m_O_Curseur = GetCrossHairPosition();
break;
case WXK_NUMPAD8: // cursor moved up
case WXK_UP:
pos.y -= KiROUND( gridSize.y );
m_canvas->MoveCursor( pos );
break;
case WXK_NUMPAD2: // cursor moved down
case WXK_DOWN:
pos.y += KiROUND( gridSize.y );
m_canvas->MoveCursor( pos );
break;
case WXK_NUMPAD4: // cursor moved left
case WXK_LEFT:
pos.x -= KiROUND( gridSize.x );
m_canvas->MoveCursor( pos );
break;
case WXK_NUMPAD6: // cursor moved right
case WXK_RIGHT:
pos.x += KiROUND( gridSize.x );
m_canvas->MoveCursor( pos );
break;
}
SetCrossHairPosition( pos );
if( oldpos != GetCrossHairPosition() )
{
pos = GetCrossHairPosition();
SetCrossHairPosition( oldpos );
m_canvas->CrossHairOff( aDC );
SetCrossHairPosition( pos );
m_canvas->CrossHairOn( aDC );
if( m_canvas->IsMouseCaptured() )
{
m_canvas->CallMouseCapture( aDC, aPosition, 0 );
}
}
UpdateStatusBar(); // Display new cursor coordinates
}