本文整理汇总了C++中Control::Parent方法的典型用法代码示例。如果您正苦于以下问题:C++ Control::Parent方法的具体用法?C++ Control::Parent怎么用?C++ Control::Parent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Control
的用法示例。
在下文中一共展示了Control::Parent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ButtonClick
void SectionBar::ButtonClick( Button& sender, bool checked )
{
if ( m_section != nullptr && sender == Title_ToolButton )
{
if ( !m_handlers.IsNull() )
if ( m_handlers->onToggleSection != nullptr )
(m_handlers->onToggleSectionReceiver->*m_handlers->onToggleSection)( *this, *m_section, true );
bool visible = m_section->IsVisible();
Control* p = &m_section->Parent();
if ( !p->IsNull() )
{
while ( !p->Parent().IsNull() )
p = &p->Parent();
p->DisableUpdates();
}
if ( visible )
m_section->Hide();
else
m_section->Show();
// On OS X, forcing event processing here causes a lot of flickering.
// On X11 and Windows, it's just the opposite...
#ifndef __PCL_MACOSX
Module->ProcessEvents();
#endif
if ( !p->IsNull() )
{
bool fixedWidth = p->IsFixedWidth();
if ( !fixedWidth )
p->SetFixedWidth();
bool fixedHeight = p->IsFixedHeight();
if ( fixedHeight )
p->SetVariableHeight();
p->AdjustToContents();
Module->ProcessEvents();
if ( !fixedWidth )
p->SetVariableWidth();
if ( fixedHeight )
p->SetFixedHeight();
p->EnableUpdates();
}
if ( !m_handlers.IsNull() )
if ( m_handlers->onToggleSection != nullptr )
(m_handlers->onToggleSectionReceiver->*m_handlers->onToggleSection)( *this, *m_section, false );
}
else if ( !Title_CheckBox.IsNull() && sender == *Title_CheckBox )
{
if ( m_section != nullptr )
m_section->Enable( checked );
if ( !m_handlers.IsNull() )
if ( m_handlers->onCheck != nullptr )
(m_handlers->onCheckReceiver->*m_handlers->onCheck)( *this, checked );
}
}