本文整理汇总了C++中wxNavigationKeyEvent::IsFromTab方法的典型用法代码示例。如果您正苦于以下问题:C++ wxNavigationKeyEvent::IsFromTab方法的具体用法?C++ wxNavigationKeyEvent::IsFromTab怎么用?C++ wxNavigationKeyEvent::IsFromTab使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxNavigationKeyEvent
的用法示例。
在下文中一共展示了wxNavigationKeyEvent::IsFromTab方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleOnNavigationKey
//.........这里部分代码省略.........
// we should start from the first/last control and not from the one which
// had focus the last time if we're propagating the event downwards because
// for our parent we look like a single control
if ( goingDown )
{
// just to be sure it's not used (normally this is not necessary, but
// doesn't hurt neither)
m_winLastFocused = NULL;
// start from first or last depending on where we're going
node = forward ? children.GetFirst() : children.GetLast();
}
else // going up
{
// try to find the child which has the focus currently
// the event emitter might have done this for us
wxWindow *winFocus = event.GetCurrentFocus();
// but if not, we might know where the focus was ourselves
if (!winFocus)
winFocus = m_winLastFocused;
// if still no luck, do it the hard way
if (!winFocus)
winFocus = wxWindow::FindFocus();
if ( winFocus )
{
#if defined(__WXMSW__) && wxUSE_RADIOBTN
// If we are in a radio button group, start from the first item in the
// group
if ( event.IsFromTab() && wxIsKindOf(winFocus, wxRadioButton ) )
winFocus = wxGetFirstButtonInGroup((wxRadioButton*)winFocus);
#endif // __WXMSW__
// ok, we found the focus - now is it our child?
start_node = children.Find( winFocus );
}
if ( !start_node && m_winLastFocused )
{
// window which has focus isn't our child, fall back to the one
// which had the focus the last time
start_node = children.Find( m_winLastFocused );
}
// if we still didn't find anything, we should start with the first one
if ( !start_node )
{
start_node = children.GetFirst();
}
// and the first child which we can try setting focus to is the next or
// the previous one
node = forward ? start_node->GetNext() : start_node->GetPrevious();
}
// we want to cycle over all elements passing by NULL
for ( ;; )
{
// don't go into infinite loop
if ( start_node && node && node == start_node )
break;
// Have we come to the last or first item on the panel?