Пример #1
0
// Begin 'context help mode'
bool wxContextHelp::BeginContextHelp(wxWindow* win)
{
    if (!win)
        win = wxTheApp->GetTopWindow();
    if (!win)
        return false;

    wxCursor cursor(wxCURSOR_QUESTION_ARROW);
    wxCursor oldCursor = win->GetCursor();
    win->SetCursor(cursor);

#ifdef __WXMAC__
    wxSetCursor(cursor);
#endif

    m_status = false;

#ifdef __WXMOTIF__
    wxPushOrPopEventHandlers(this, win, true);
#else
    win->PushEventHandler(new wxContextHelpEvtHandler(this));
#endif

    win->CaptureMouse();

    EventLoop();

    win->ReleaseMouse();

#ifdef __WXMOTIF__
    wxPushOrPopEventHandlers(this, win, false);
#else
    win->PopEventHandler(true);
#endif

    win->SetCursor(oldCursor);

#ifdef __WXMAC__
    wxSetCursor(wxNullCursor);
#endif

    if (m_status)
    {
        wxPoint pt;
        wxWindow* winAtPtr = wxFindWindowAtPointer(pt);

#if 0
        if (winAtPtr)
        {
            printf("Picked %s (%d)\n", winAtPtr->GetName().c_str(),
                   winAtPtr->GetId());
        }
#endif

        if (winAtPtr)
            DispatchEvent(winAtPtr, pt);
    }

    return true;
}
Пример #2
0
wxWindow * bmx_wxfindwindowatpointer(int * x, int * y) {
	wxPoint p;
	wxWindow * win = wxFindWindowAtPointer(p);
	*x = p.x;
	*y = p.y;
	return win;
}
Пример #3
0
/////////////////////
// Mouse wheel moved
void AegisubApp::OnMouseWheel(wxMouseEvent &event) {
	wxPoint pt;
	wxWindow *target = wxFindWindowAtPointer(pt);
	if (target == frame->audioBox->audioDisplay || target == frame->SubsBox) {
		target->AddPendingEvent(event);
	}
	else event.Skip();
}