Got wxHelpContext working, plus wxFindWindowAtPointer, wxGetMousePosition,

wxFindWindowAtPoint.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8282 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2000-09-07 13:22:42 +00:00
parent b85cfb6fd4
commit 59a12e9034
9 changed files with 123 additions and 100 deletions

View File

@@ -78,7 +78,10 @@ bool wxContextHelp::BeginContextHelp(wxWindow* win)
wxCursor cursor(wxCURSOR_QUESTION_ARROW);
wxCursor oldCursor = win->GetCursor();
win->SetCursor(cursor);
wxSetCursor(cursor);
#ifdef __WXMSW__
// wxSetCursor(cursor);
#endif
win->PushEventHandler(new wxContextHelpEvtHandler(this));
@@ -133,7 +136,7 @@ bool wxContextHelpEvtHandler::ProcessEvent(wxEvent& event)
{
case wxEVT_LEFT_DOWN:
{
wxMouseEvent& mouseEvent = (wxMouseEvent&) event;
//wxMouseEvent& mouseEvent = (wxMouseEvent&) event;
m_contextHelp->SetStatus(TRUE);
m_contextHelp->EndContextHelp();
return TRUE;

View File

@@ -667,6 +667,47 @@ wxFindMenuItemId (wxFrame * frame, const wxString& menuString, const wxString& i
return menuBar->FindMenuItem (menuString, itemString);
}
// Try to find the deepest child that contains 'pt'
wxWindow* wxFindWindowAtPoint(wxWindow* win, const wxPoint& pt)
{
wxNode* node = win->GetChildren().First();
while (node)
{
wxWindow* child = (wxWindow*) node->Data();
wxWindow* foundWin = wxFindWindowAtPoint(child, pt);
if (foundWin)
return foundWin;
node = node->Next();
}
wxPoint pos = win->GetPosition();
wxSize sz = win->GetSize();
if (win->GetParent())
{
pos = win->GetParent()->ClientToScreen(pos);
}
wxRect rect(pos, sz);
if (rect.Inside(pt))
return win;
else
return NULL;
}
wxWindow* wxFindWindowAtPoint(const wxPoint& pt)
{
wxNode* node = wxTopLevelWindows.First();
while (node)
{
wxWindow* win = (wxWindow*) node->Data();
wxWindow* found = wxFindWindowAtPoint(win, pt);
if (found)
return found;
node = node->Next();
}
return NULL;
}
#endif // wxUSE_GUI
/*