-void wxPopupTransientWindow::OnLeave(wxMouseEvent& /*event*/)
-{
- CaptureMouse();
-}
-
-void wxPopupTransientWindow::OnLeftDown(wxMouseEvent& event)
-{
- if (m_handlerPopup && m_child && m_child != this)
- {
- m_child->GetEventHandler()->ProcessEvent(event);
- }
-}
-
-
-
-// If the child is the same size as the popup window then handle the event,
-// otherwise assume that there is enough of the popup showing that it will get
-// it's own Enter/Leave events. A more reliable way to detect this situation
-// would be appreciated...
-
-void wxPopupTransientWindow::OnChildEnter(wxMouseEvent& event)
-{
- if (m_child)
- {
- wxSize cs = m_child->GetSize();
- wxSize ps = GetClientSize();
-
- if ((cs.x * cs.y) >= (ps.x * ps.y))
- OnEnter(event);
+ if ( rect.Contains(pos) )
+ {
+ if ( m_child->HasCapture() )
+ {
+ m_child->ReleaseMouse();
+ }
+ }
+ else
+ {
+ if ( !m_child->HasCapture() )
+ {
+ m_child->CaptureMouse();
+ }
+ }