当前位置: 首页>>代码示例>>C++>>正文


C++ wxNavigationKeyEvent::SetEventObject方法代码示例

本文整理汇总了C++中wxNavigationKeyEvent::SetEventObject方法的典型用法代码示例。如果您正苦于以下问题:C++ wxNavigationKeyEvent::SetEventObject方法的具体用法?C++ wxNavigationKeyEvent::SetEventObject怎么用?C++ wxNavigationKeyEvent::SetEventObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在wxNavigationKeyEvent的用法示例。


在下文中一共展示了wxNavigationKeyEvent::SetEventObject方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnKeyboardNavigation

void CQuickconnectBar::OnKeyboardNavigation(wxNavigationKeyEvent& event)
{
	if (event.GetDirection() && event.GetEventObject() == XRCCTRL(*this, "ID_QUICKCONNECT_DROPDOWN", wxButton))
	{
		event.SetEventObject(this);
		GetParent()->ProcessEvent(event);
	}
	else if (!event.GetDirection() && event.GetEventObject() == XRCCTRL(*this, "ID_QUICKCONNECT_HOST", wxTextCtrl))
	{
		event.SetEventObject(this);
		GetParent()->ProcessEvent(event);
	}
	else
		event.Skip();
}
开发者ID:idgaf,项目名称:FileZilla3,代码行数:15,代码来源:quickconnectbar.cpp

示例2: OnNavigationKey

void wxNotebook::OnNavigationKey(wxNavigationKeyEvent& event)
{
    if ( event.IsWindowChange() )
    {
        // change pages
        AdvanceSelection( event.GetDirection() );
    }
    else
    {
        // we get this event in 2 cases
        //
        // a) one of our pages might have generated it because the user TABbed
        // out from it in which case we should propagate the event upwards and
        // our parent will take care of setting the focus to prev/next sibling
        //
        // or
        //
        // b) the parent panel wants to give the focus to us so that we
        // forward it to our selected page. We can't deal with this in
        // OnSetFocus() because we don't know which direction the focus came
        // from in this case and so can't choose between setting the focus to
        // first or last panel child
        wxWindow *parent = GetParent();

        // the cast is here to fix a GCC ICE
        if ( ((wxWindow*)event.GetEventObject()) == parent )
        {
            // no, it doesn't come from child, case (b): forward to a page
            if ( m_selection != wxNOT_FOUND )
            {
                // so that the page knows that the event comes from it's parent
                // and is being propagated downwards
                event.SetEventObject( this );

                wxWindow *page = m_pages[m_selection];
                if ( !page->HandleWindowEvent( event ) )
                {
                    page->SetFocus();
                }
                //else: page manages focus inside it itself
            }
            else
            {
                // we have no pages - still have to give focus to _something_
                SetFocus();
            }
        }
        else
        {
            // it comes from our child, case (a), pass to the parent
            if ( parent )
            {
                event.SetCurrentFocus( this );
                parent->HandleWindowEvent( event );
            }
        }
    }
}
开发者ID:cwalther,项目名称:wxWidgets,代码行数:58,代码来源:notebook_osx.cpp

示例3: OnNavigationKey

	void OnNavigationKey(wxNavigationKeyEvent& event)
	{
		wxWindow* parent = GetParent();
		event.SetEventObject(parent);
		parent->ProcessEvent(event);
	}
开发者ID:idgaf,项目名称:FileZilla3,代码行数:6,代码来源:StatusView.cpp

示例4: HandleOnNavigationKey

void wxControlContainer::HandleOnNavigationKey( wxNavigationKeyEvent& event )
{
    // for a TLW we shouldn't involve the parent window, it has nothing to do
    // with keyboard navigation inside this TLW
    wxWindow *parent = m_winParent->IsTopLevel() ? NULL
                                                 : m_winParent->GetParent();

    // the event is propagated downwards if the event emitter was our parent
    bool goingDown = event.GetEventObject() == parent;

    const wxWindowList& children = m_winParent->GetChildren();

    // if we have exactly one notebook-like child window (actually it could be
    // any window that returns true from its HasMultiplePages()), then
    // [Shift-]Ctrl-Tab and Ctrl-PageUp/Down keys should iterate over its pages
    // even if the focus is outside of the control because this is how the
    // standard MSW properties dialogs behave and we do it under other platforms
    // as well because it seems like a good idea -- but we can always put this
    // block inside "#ifdef __WXMSW__" if it's not suitable there
    if ( event.IsWindowChange() && !goingDown )
    {
        // check if we have a unique notebook-like child
        wxWindow *bookctrl = NULL;
        for ( wxWindowList::const_iterator i = children.begin(),
                                         end = children.end();
              i != end;
              ++i )
        {
            wxWindow * const window = *i;
            if ( window->HasMultiplePages() )
            {
                if ( bookctrl )
                {
                    // this is the second book-like control already so don't do
                    // anything as we don't know which one should have its page
                    // changed
                    bookctrl = NULL;
                    break;
                }

                bookctrl = window;
            }
        }

        if ( bookctrl )
        {
            // make sure that we don't bubble up the event again from the book
            // control resulting in infinite recursion
            wxNavigationKeyEvent eventCopy(event);
            eventCopy.SetEventObject(m_winParent);
            if ( bookctrl->GetEventHandler()->ProcessEvent(eventCopy) )
                return;
        }
    }

    // there is not much to do if we don't have children and we're not
    // interested in "notebook page change" events here
    if ( !children.GetCount() || event.IsWindowChange() )
    {
        // let the parent process it unless it already comes from our parent
        // of we don't have any
        if ( goingDown ||
             !parent || !parent->GetEventHandler()->ProcessEvent(event) )
        {
            event.Skip();
        }

        return;
    }

    // where are we going?
    const bool forward = event.GetDirection();

    // the node of the children list from which we should start looking for the
    // next acceptable child
    wxWindowList::compatibility_iterator node, start_node;

    // 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;

//.........这里部分代码省略.........
开发者ID:Anonymous2,项目名称:project64,代码行数:101,代码来源:containr.cpp

示例5: OnNavigationKey

void wxNotebook::OnNavigationKey(wxNavigationKeyEvent& event)
{
    if ( event.IsWindowChange() ) {
        // change pages
        AdvanceSelection(event.GetDirection());
    }
    else {
        // we get this event in 3 cases
        //
        // a) one of our pages might have generated it because the user TABbed
        // out from it in which case we should propagate the event upwards and
        // our parent will take care of setting the focus to prev/next sibling
        //
        // or
        //
        // b) the parent panel wants to give the focus to us so that we
        // forward it to our selected page. We can't deal with this in
        // OnSetFocus() because we don't know which direction the focus came
        // from in this case and so can't choose between setting the focus to
        // first or last panel child
        //
        // or
        //
        // c) we ourselves (see MSWTranslateMessage) generated the event
        //
        wxWindow * const parent = GetParent();

        // the wxObject* casts are required to avoid MinGW GCC 2.95.3 ICE
        const bool isFromParent = event.GetEventObject() == (wxObject*) parent;
        const bool isFromSelf = event.GetEventObject() == (wxObject*) this;
        const bool isForward = event.GetDirection();

        if ( isFromSelf && !isForward )
        {
            // focus is currently on notebook tab and should leave
            // it backwards (Shift-TAB)
            event.SetCurrentFocus(this);
            parent->HandleWindowEvent(event);
        }
        else if ( isFromParent || isFromSelf )
        {
            // no, it doesn't come from child, case (b) or (c): forward to a
            // page but only if entering notebook page (i.e. direction is
            // backwards (Shift-TAB) comething from out-of-notebook, or
            // direction is forward (TAB) from ourselves),
            if ( m_selection != wxNOT_FOUND &&
                    (!event.GetDirection() || isFromSelf) )
            {
                // so that the page knows that the event comes from it's parent
                // and is being propagated downwards
                event.SetEventObject(this);

                wxWindow *page = m_pages[m_selection];
                if ( !page->HandleWindowEvent(event) )
                {
                    page->SetFocus();
                }
                //else: page manages focus inside it itself
            }
            else // otherwise set the focus to the notebook itself
            {
                SetFocus();
            }
        }
        else
        {
            // it comes from our child, case (a), pass to the parent, but only
            // if the direction is forwards. Otherwise set the focus to the
            // notebook itself. The notebook is always the 'first' control of a
            // page.
            if ( !isForward )
            {
                SetFocus();
            }
            else if ( parent )
            {
                event.SetCurrentFocus(this);
                parent->HandleWindowEvent(event);
            }
        }
    }
}
开发者ID:chromylei,项目名称:third_party,代码行数:82,代码来源:notebook.cpp

示例6: OnNavigationKey

void CQueueViewBase::OnNavigationKey(wxNavigationKeyEvent& event)
{
	event.SetEventObject(m_pQueue);
	m_pQueue->ProcessEvent(event);
}
开发者ID:ErichKrause,项目名称:filezilla,代码行数:5,代码来源:queue.cpp

示例7: OnNavigationKey

void wxNotebook::OnNavigationKey (
  wxNavigationKeyEvent&             rEvent
)
{
    if (rEvent.IsWindowChange())
    {
        //
        // Change pages
        //
        AdvanceSelection(rEvent.GetDirection());
    }
    else
    {
        //
        // We get this event in 2 cases
        //
        // a) one of our pages might have generated it because the user TABbed
        // out from it in which case we should propagate the event upwards and
        // our parent will take care of setting the focus to prev/next sibling
        //
        // or
        //
        // b) the parent panel wants to give the focus to us so that we
        // forward it to our selected page. We can't deal with this in
        // OnSetFocus() because we don't know which direction the focus came
        // from in this case and so can't choose between setting the focus to
        // first or last panel child
        //
        wxWindow*                   pParent = GetParent();

        if (rEvent.GetEventObject() == pParent)
        {
            //
            // No, it doesn't come from child, case (b): forward to a page
            //
            if (m_nSelection != -1)
            {
                //
                // So that the page knows that the event comes from it's parent
                // and is being propagated downwards
                //
                rEvent.SetEventObject(this);

                wxWindow*           pPage = m_pages[m_nSelection];

                if (!pPage->GetEventHandler()->ProcessEvent(rEvent))
                {
                    pPage->SetFocus();
                }
                //else: page manages focus inside it itself
            }
            else
            {
                //
                // We have no pages - still have to give focus to _something_
                //
                SetFocus();
            }
        }
        else
        {
            //
            // It comes from our child, case (a), pass to the parent
            //
            if (pParent)
            {
                rEvent.SetCurrentFocus(this);
                pParent->GetEventHandler()->ProcessEvent(rEvent);
            }
        }
    }
} // end of wxNotebook::OnNavigationKey
开发者ID:hgwells,项目名称:tive,代码行数:72,代码来源:notebook.cpp


注:本文中的wxNavigationKeyEvent::SetEventObject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。