+
+void MyFrame::OnFromPoint(wxCommandEvent& WXUNUSED(event))
+{
+ SetStatusText(_T("Press the mouse anywhere..."));
+
+ CaptureMouse();
+}
+
+void MyFrame::OnLeftClick(wxMouseEvent& event)
+{
+ if ( HasCapture() )
+ {
+ // mouse events are in client coords, wxDisplay works in screen ones
+ const wxPoint ptScreen = ClientToScreen(event.GetPosition());
+ int dpy = wxDisplay::GetFromPoint(ptScreen);
+ if ( dpy == wxNOT_FOUND )
+ {
+ wxLogError(_T("Mouse clicked outside of display!!"));
+ }
+
+ wxLogStatus(this, _T("Mouse clicked in display %d (at (%d, %d))"),
+ dpy, ptScreen.x, ptScreen.y);
+
+ ReleaseMouse();
+ }
+}
+