fixes for several fatal problems when using wxComboCtrl as popup (patch 1539124)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40589 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-08-13 01:22:37 +00:00
parent da557e0945
commit c667b518d1

View File

@@ -191,7 +191,7 @@ void wxComboFrameEventHandler::OnIdle( wxIdleEvent& event )
{ {
wxWindow* winFocused = ::wxWindow::FindFocus(); wxWindow* winFocused = ::wxWindow::FindFocus();
wxWindow* popup = m_combo->GetPopupControl(); wxWindow* popup = m_combo->GetPopupControl()->GetControl();
wxWindow* winpopup = m_combo->GetPopupWindow(); wxWindow* winpopup = m_combo->GetPopupWindow();
if ( if (
@@ -1342,6 +1342,15 @@ bool wxComboCtrlBase::PreprocessMouseEvent( wxMouseEvent& event,
wxLongLong t = ::wxGetLocalTimeMillis(); wxLongLong t = ::wxGetLocalTimeMillis();
int evtType = event.GetEventType(); int evtType = event.GetEventType();
#if !USE_TRANSIENT_POPUP
if ( m_isPopupShown &&
( evtType == wxEVT_LEFT_DOWN || evtType == wxEVT_RIGHT_DOWN ) )
{
HidePopup();
return true;
}
#endif
// //
// Generate our own double-clicks // Generate our own double-clicks
// (to allow on-focus dc-event on double-clicks instead of triple-clicks) // (to allow on-focus dc-event on double-clicks instead of triple-clicks)
@@ -1541,13 +1550,13 @@ void wxComboCtrlBase::CreatePopup()
// Destroy popup window and the child control // Destroy popup window and the child control
void wxComboCtrlBase::DestroyPopup() void wxComboCtrlBase::DestroyPopup()
{ {
HidePopup();
if ( m_popup ) if ( m_popup )
m_popup->RemoveEventHandler(m_popupExtraHandler); m_popup->RemoveEventHandler(m_popupExtraHandler);
delete m_popupExtraHandler; delete m_popupExtraHandler;
HidePopup();
delete m_popupInterface; delete m_popupInterface;
if ( m_winPopup ) if ( m_winPopup )