本文整理汇总了C++中Panel::GetChild方法的典型用法代码示例。如果您正苦于以下问题:C++ Panel::GetChild方法的具体用法?C++ Panel::GetChild怎么用?C++ Panel::GetChild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Panel
的用法示例。
在下文中一共展示了Panel::GetChild方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnChangeChild
void BuildModeDialog::OnChangeChild( int direction )
{
Assert( direction == 1 || direction == -1 );
if ( !m_pBuildGroup )
return;
Panel *current = m_pCurrentPanel;
Panel *context = m_pBuildGroup->GetContextPanel();
if ( !current || current == context )
{
current = NULL;
if ( context->GetChildCount() > 0 )
{
current = context->GetChild( 0 );
}
}
else
{
int i;
// Move in direction requested
int children = context->GetChildCount();
for ( i = 0; i < children; ++i )
{
Panel *child = context->GetChild( i );
if ( child == current )
{
break;
}
}
if ( i < children )
{
for ( int offset = 1; offset < children; ++offset )
{
int test = ( i + ( direction * offset ) ) % children;
if ( test < 0 )
test += children;
if ( test == i )
continue;
Panel *check = context->GetChild( test );
BuildModeDialog *bm = dynamic_cast< BuildModeDialog * >( check );
if ( bm )
continue;
current = check;
break;
}
}
}
if ( !current )
{
return;
}
SetActiveControl( current );
}
示例2: if
//-----------------------------------------------------------------------------
// Purpose: Find the correct radio button to move to.
// Input : direction - the direction we are moving, up or down.
//-----------------------------------------------------------------------------
RadioButton *RadioButton::FindBestRadioButton(int direction)
{
RadioButton *bestRadio = NULL;
int highestRadio = 0;
Panel *pr = GetParent();
if (pr)
{
// find the radio button to go to next
for (int i = 0; i < pr->GetChildCount(); i++)
{
RadioButton *child = dynamic_cast<RadioButton *>(pr->GetChild(i));
if (child && child->GetRadioTabPosition() == _oldTabPosition)
{
if (child->GetSubTabPosition() == _subTabPosition + direction)
{
bestRadio = child;
break;
}
if ( (child->GetSubTabPosition() == 0) && (direction == DOWN) )
{
bestRadio = child;
continue;
}
else if ( (child->GetSubTabPosition() > highestRadio) && (direction == UP) )
{
bestRadio = child;
highestRadio = bestRadio->GetSubTabPosition();
continue;
}
if (!bestRadio)
{
bestRadio = child;
}
}
}
if (bestRadio)
{
bestRadio->RequestFocus();
}
InvalidateLayout();
Repaint();
}
return bestRadio;
}
示例3: GetChild
const GuiObjectPtr Panel::GetChild( Unsigned32 u32Idx ) const
{
Panel* pThis = const_cast< Panel* >( this );
return pThis->GetChild( u32Idx );
}