本文整理汇总了C++中BASE_SCREEN::GetGrids方法的典型用法代码示例。如果您正苦于以下问题:C++ BASE_SCREEN::GetGrids方法的具体用法?C++ BASE_SCREEN::GetGrids怎么用?C++ BASE_SCREEN::GetGrids使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BASE_SCREEN
的用法示例。
在下文中一共展示了BASE_SCREEN::GetGrids方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetPresetGrid
void EDA_DRAW_FRAME::SetPresetGrid( int aIndex )
{
BASE_SCREEN * screen = GetScreen();
if( ! screen->GridExists( aIndex + ID_POPUP_GRID_LEVEL_1000 ) )
aIndex = screen->GetGrids()[0].m_CmdId;
// aIndex is a Command Id relative to ID_POPUP_GRID_LEVEL_1000 comand id code.
// we need an index in grid list (the cmd id in list is is screen->GetGrids()[0].m_CmdId):
int glistIdx = aIndex + ID_POPUP_GRID_LEVEL_1000 - screen->GetGrids()[0].m_CmdId;
if( m_gridSelectBox )
{
if( glistIdx < 0 || glistIdx >= (int) m_gridSelectBox->GetCount() )
{
wxASSERT_MSG( false, "Invalid grid index" );
return;
}
m_gridSelectBox->SetSelection( glistIdx );
}
// Be sure m_LastGridSizeId is up to date.
m_LastGridSizeId = aIndex;
GetScreen()->SetGrid( aIndex + ID_POPUP_GRID_LEVEL_1000 );
// Put cursor on new grid
SetCrossHairPosition( RefPos( true ) );
}