本文整理汇总了C++中BOARD_ITEM::SetBrightened方法的典型用法代码示例。如果您正苦于以下问题:C++ BOARD_ITEM::SetBrightened方法的具体用法?C++ BOARD_ITEM::SetBrightened怎么用?C++ BOARD_ITEM::SetBrightened使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BOARD_ITEM
的用法示例。
在下文中一共展示了BOARD_ITEM::SetBrightened方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: disambiguationMenu
BOARD_ITEM* SELECTION_TOOL::disambiguationMenu( GENERAL_COLLECTOR* aCollector )
{
BOARD_ITEM* current = NULL;
boost::shared_ptr<BRIGHT_BOX> brightBox;
CONTEXT_MENU menu;
int limit = std::min( 10, aCollector->GetCount() );
for( int i = 0; i < limit; ++i )
{
wxString text;
BOARD_ITEM* item = ( *aCollector )[i];
text = item->GetSelectMenuText();
menu.Add( text, i + 1 );
}
menu.SetTitle( _( "Clarify selection" ) );
SetContextMenu( &menu, CMENU_NOW );
while( OPT_TOOL_EVENT evt = Wait() )
{
if( evt->Action() == TA_CONTEXT_MENU_UPDATE )
{
if( current )
current->ClearBrightened();
int id = *evt->GetCommandId();
// User has pointed an item, so show it in a different way
if( id > 0 && id <= limit )
{
current = ( *aCollector )[id - 1];
current->SetBrightened();
}
else
{
current = NULL;
}
}
else if( evt->Action() == TA_CONTEXT_MENU_CHOICE )
{
boost::optional<int> id = evt->GetCommandId();
// User has selected an item, so this one will be returned
if( id && ( *id > 0 ) )
current = ( *aCollector )[*id - 1];
break;
}
// Draw a mark to show which item is available to be selected
if( current && current->IsBrightened() )
{
brightBox.reset( new BRIGHT_BOX( current ) );
getView()->Add( brightBox.get() );
// BRIGHT_BOX is removed from view on destruction
}
}
return current;
}