const wxValidator &validator = wxDefaultValidator,
const wxString& name = wxTreeCtrlNameStr)
{
+ Init();
Create(parent, id, pos, size, style, validator, name);
}
// Returns menu item id or -1 if none.
WXDLLEXPORT int wxFindMenuItemId(wxFrame *frame, const wxString& menuString, const wxString& itemString);
+// Find the wxWindow at the given point. wxGenericFindWindowAtPoint
+// is always present but may be less reliable than a native version.
+WXDLLEXPORT wxWindow* wxGenericFindWindowAtPoint(const wxPoint& pt);
WXDLLEXPORT wxWindow* wxFindWindowAtPoint(const wxPoint& pt);
// ----------------------------------------------------------------------------
#if !defined(__WXMSW__)
static char * csquery_xpm[] = {
"12 11 2 1",
-" c None",
-". c Black",
+" c None",
+". c #000000",
" ",
" .... ",
" .. .. ",
void wxContextHelpButton::OnContextHelp(wxCommandEvent& event)
{
- wxContextHelp contextHelp;
+ wxContextHelp contextHelp(GetParent());
}
#endif // wxUSE_HELP
return NULL;
}
-wxWindow* wxFindWindowAtPoint(const wxPoint& pt)
+wxWindow* wxGenericFindWindowAtPoint(const wxPoint& pt)
{
- wxNode* node = wxTopLevelWindows.First();
+ // Go backwards through the list since windows
+ // on top are likely to have been appended most
+ // recently.
+ wxNode* node = wxTopLevelWindows.Last();
while (node)
{
wxWindow* win = (wxWindow*) node->Data();
wxWindow* found = wxFindWindowAtPoint(win, pt);
if (found)
return found;
- node = node->Next();
+ node = node->Previous();
}
return NULL;
}
const wxValidator &validator,
const wxString& name )
{
- Init();
-
wxScrolledWindow::Create( parent, id, pos, size, style|wxHSCROLL|wxVSCROLL, name );
#if wxUSE_VALIDATORS
return wxGTK;
}
+wxWindow* wxFindWindowAtPoint(const wxPoint& pt)
+{
+ return wxGenericFindWindowAtPoint(pt);
+}
+
+
// ----------------------------------------------------------------------------
// subprocess routines
// ----------------------------------------------------------------------------
int x, y;
GdkWindow* windowAtPtr = gdk_window_at_pointer(& x, & y);
+ if (!windowAtPtr)
+ return wxPoint(-999, -999);
Display *display = GDK_WINDOW_XDISPLAY(windowAtPtr);
Window rootWindow = RootWindowOfScreen (DefaultScreenOfDisplay(display));
return wxGTK;
}
+wxWindow* wxFindWindowAtPoint(const wxPoint& pt)
+{
+ return wxGenericFindWindowAtPoint(pt);
+}
+
+
// ----------------------------------------------------------------------------
// subprocess routines
// ----------------------------------------------------------------------------
int x, y;
GdkWindow* windowAtPtr = gdk_window_at_pointer(& x, & y);
+ if (!windowAtPtr)
+ return wxPoint(-999, -999);
Display *display = GDK_WINDOW_XDISPLAY(windowAtPtr);
Window rootWindow = RootWindowOfScreen (DefaultScreenOfDisplay(display));
#endif
}
+wxWindow* wxFindWindowAtPoint(const wxPoint& pt)
+{
+ return wxGenericFindWindowAtPoint(pt);
+}
// Get the current mouse position.
wxPoint wxGetMousePosition()
{
- wxFAIL_MSG(_("Not implemented"));
- return wxPoint;
+ int x, y;
+ wxGetMousePosition(& x, & y);
+ return wxPoint(x, y);
}
#endif
}
+wxWindow* wxFindWindowAtPoint(const wxPoint& pt)
+{
+ return wxGenericFindWindowAtPoint(pt);
+}
// Get the current mouse position.
wxPoint wxGetMousePosition()
{
- wxFAIL_MSG(_("Not implemented"));
- return wxPoint;
+ int x, y;
+ wxGetMousePosition(& x, & y);
+ return wxPoint(x, y);
}
return gs_displayName;
}
+wxWindow* wxFindWindowAtPoint(const wxPoint& pt)
+{
+ return wxGenericFindWindowAtPoint(pt);
+}
+
// ----------------------------------------------------------------------------
// accelerators
// ----------------------------------------------------------------------------
// position.
wxWindow* wxFindWindowAtPointer(wxPoint& pt)
{
- pt = wxGetMousePosition();
- wxWindow* found = wxFindWindowAtPoint(pt);
- return found;
+ return wxFindWindowAtPoint(wxGetMousePosition());
}
// Get the current mouse position.
// position.
wxWindow* wxFindWindowAtPointer(wxPoint& pt)
{
- // Use current message to find last mouse position
- extern MSG s_currentMsg;
- HWND hWndHit = ::WindowFromPoint(s_currentMsg.pt);
+ return wxFindWindowAtPoint(wxGetMousePosition());
+}
+
+wxWindow* wxFindWindowAtPoint(const wxPoint& pt)
+{
+ POINT pt2;
+ pt2.x = pt.x;
+ pt2.y = pt.y;
+ HWND hWndHit = ::WindowFromPoint(pt2);
wxWindow* win = wxFindWinFromHandle((WXHWND) hWndHit) ;
HWND hWnd = hWndHit;