本文整理汇总了C++中Icon::Select方法的典型用法代码示例。如果您正苦于以下问题:C++ Icon::Select方法的具体用法?C++ Icon::Select怎么用?C++ Icon::Select使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Icon
的用法示例。
在下文中一共展示了Icon::Select方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MouseDown
void BitmapView::MouseDown( BPoint cPosition )
{
MakeFocus( true );
Icon* pcIcon = FindIcon( cPosition );
if ( pcIcon != NULL )
{
if ( pcIcon->m_bSelected )
{
if ( m_nHitTime + 500000 >= system_time() )
{
if ( pcIcon->GetName() == "Root (List)" )
{
BWindow* pcWindow = new DirWindow( BRect( 200, 150, 600, 400 ), "/" );
pcWindow->Activate();
}
else if ( pcIcon->GetName() == "Root (Icon)" )
{
BWindow* pcWindow = new DirIconWindow( BRect( 20, 20, 359, 220 ), "/", g_pcBackDrop );
pcWindow->Activate();
}
else if ( pcIcon->GetName() == "Terminal" )
{
pid_t nPid = fork();
if ( nPid == 0 )
{
set_thread_priority( -1, 0 );
execlp( "cterm", "cterm", NULL );
exit( 1 );
}
}
else if ( pcIcon->GetName() == "Prefs" )
{
pid_t nPid = fork();
if ( nPid == 0 )
{
set_thread_priority( -1, 0 );
execlp( "guiprefs", "guiprefs", NULL );
exit( 1 );
}
}
else if ( pcIcon->GetName() == "Pulse" )
{
pid_t nPid = fork();
if ( nPid == 0 )
{
set_thread_priority( -1, 0 );
execlp( "pulse", "pulse", NULL );
exit( 1 );
}
}
else if ( pcIcon->GetName() == "Calculator" )
{
pid_t nPid = fork();
if ( nPid == 0 )
{
set_thread_priority( -1, 0 );
execlp( "calc", "calc", NULL );
exit( 1 );
}
}
else if ( pcIcon->GetName() == "Editor" )
{
pid_t nPid = fork();
if ( nPid == 0 )
{
set_thread_priority( -1, 0 );
execlp( "aedit", "aedit", NULL );
exit( 1 );
}
}
else if ( pcIcon->GetName() == "Guido" )
{
pid_t nPid = fork();
if ( nPid == 0 )
{
set_thread_priority( -1, 0 );
execlp( "guido", "guido", NULL );
exit( 1 );
}
}
}
else
{
m_bCanDrag = true;
}
m_nHitTime = system_time();
return;
}
}
for ( uint i = 0 ; i < m_cIcons.size() ; ++i )
{
m_cIcons[i]->Select( this, false );
}
if ( pcIcon != NULL )
{
m_bCanDrag = true;
//.........这里部分代码省略.........