Fixes to NET_SELECTOR event loop for non-OSX platforms.
Don't assume events are always Pending(). Other platforms handle idle events differently.
This commit is contained in:
parent
37f7faf433
commit
3cc6e0cf02
|
@ -96,43 +96,43 @@ public:
|
|||
wxGUIEventLoop eventLoop;
|
||||
wxEventLoopActivator activate( &eventLoop );
|
||||
|
||||
while ( eventLoop.Pending() )
|
||||
while( !m_cancelled && !m_selected )
|
||||
{
|
||||
wxPoint screenPos = wxGetMousePosition();
|
||||
|
||||
if( m_netListBox->GetScreenRect().Contains( screenPos ) )
|
||||
if( eventLoop.Pending() )
|
||||
{
|
||||
if( HasCapture() )
|
||||
ReleaseMouse();
|
||||
wxPoint screenPos = wxGetMousePosition();
|
||||
|
||||
if( m_netListBox->GetScreenRect().Contains( screenPos ) )
|
||||
{
|
||||
if( HasCapture() )
|
||||
ReleaseMouse();
|
||||
|
||||
#ifdef __WXOSX_MAC__
|
||||
m_netListBox->OSXForceFocus();
|
||||
m_netListBox->OSXForceFocus();
|
||||
#else
|
||||
m_netListBox->SetFocus();
|
||||
m_netListBox->SetFocus();
|
||||
#endif
|
||||
|
||||
wxPoint relativePos = m_netListBox->ScreenToClient( screenPos );
|
||||
int item = m_netListBox->HitTest( relativePos );
|
||||
wxPoint relativePos = m_netListBox->ScreenToClient( screenPos );
|
||||
int item = m_netListBox->HitTest( relativePos );
|
||||
|
||||
if( item >= 0 )
|
||||
m_netListBox->SetSelection( item );
|
||||
if( item >= 0 )
|
||||
m_netListBox->SetSelection( item );
|
||||
}
|
||||
else if( m_filterCtrl->GetScreenRect().Contains( screenPos ) )
|
||||
{
|
||||
if( HasCapture() )
|
||||
ReleaseMouse();
|
||||
|
||||
m_filterCtrl->SetFocus();
|
||||
}
|
||||
else if( !HasCapture() )
|
||||
{
|
||||
CaptureMouse();
|
||||
}
|
||||
|
||||
eventLoop.Dispatch();
|
||||
}
|
||||
else if( m_filterCtrl->GetScreenRect().Contains( screenPos ) )
|
||||
{
|
||||
if( HasCapture() )
|
||||
ReleaseMouse();
|
||||
|
||||
m_filterCtrl->SetFocus();
|
||||
}
|
||||
else if( !HasCapture() )
|
||||
{
|
||||
CaptureMouse();
|
||||
}
|
||||
|
||||
eventLoop.Dispatch();
|
||||
|
||||
if( m_cancelled || m_selected )
|
||||
break;
|
||||
|
||||
wxSafeYield( m_parent );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue