// Find an item given the MS Windows id
wxWindow *wxWindow::FindItem(long id) const
{
+ wxControl *item = wxDynamicCast(this, wxControl);
+ if ( item )
+ {
+ // i it we or one of our "internal" children?
+ if ( item->GetId() == id ||
+ (item->GetSubcontrols().Index(id) != wxNOT_FOUND) )
+ {
+ return item;
+ }
+ }
+
wxWindowList::Node *current = GetChildren().GetFirst();
while (current)
{
if ( wnd )
return wnd;
- if ( childWin->IsKindOf(CLASSINFO(wxControl)) )
- {
- wxControl *item = (wxControl *)childWin;
- if ( item->GetId() == id )
- return item;
- else
- {
- // In case it's a 'virtual' control (e.g. radiobox)
- if ( item->GetSubcontrols().Member((wxObject *)id) )
- return item;
- }
- }
-
current = current->GetNext();
}
break;
case WM_MOUSEMOVE:
+ {
+ short x = LOWORD(lParam);
+ short y = HIWORD(lParam);
+
+ processed = HandleMouseMove(x, y, wParam);
+ }
+ break;
+
case WM_LBUTTONDOWN:
case WM_LBUTTONUP:
case WM_LBUTTONDBLCLK:
return popupMenu->MSWCommand(cmd, id);
}
- wxWindow *win = FindItem(id);
+ // must cast to a signed type before comparing with other ids!
+ wxWindow *win = FindItem((signed short)id);
if ( !win )
{
win = wxFindWinFromHandle(control);