]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/combocmn.cpp
matrix and path to ref counting
[wxWidgets.git] / src / common / combocmn.cpp
index 6139dfc17908e8f96e6994adf00dd156a7c3b14f..7e53044b3e0c46116a80f336c0c35f21b0711570 100644 (file)
@@ -732,6 +732,8 @@ void wxComboCtrlBase::Init()
     m_toplevEvtHandler = (wxEvtHandler*) NULL;
 #endif
 
+    m_mainCtrlWnd = this;
+
     m_heightPopup = -1;
     m_widthMinPopup = -1;
     m_anchorSide = 0;
@@ -1537,11 +1539,15 @@ void wxComboCtrlBase::OnKeyEvent(wxKeyEvent& event)
         if ( keycode == WXK_TAB )
         {
             wxNavigationKeyEvent evt;
+
+            wxWindow* mainCtrl = GetMainWindowOfCompositeControl();
+
             evt.SetFlags(wxNavigationKeyEvent::FromTab|
                          (!event.ShiftDown() ? wxNavigationKeyEvent::IsForward
                                              : wxNavigationKeyEvent::IsBackward));
-            evt.SetEventObject(this);
-            GetParent()->GetEventHandler()->AddPendingEvent(evt);
+            evt.SetEventObject(mainCtrl);
+            evt.SetCurrentFocus(mainCtrl);
+            mainCtrl->GetParent()->GetEventHandler()->AddPendingEvent(evt);
             return;
         }
 
@@ -1574,8 +1580,10 @@ void wxComboCtrlBase::OnFocusEvent( wxFocusEvent& event )
 {
     if ( event.GetEventType() == wxEVT_SET_FOCUS )
     {
+#ifndef __WXMAC__
         if ( m_text && m_text != ::wxWindow::FindFocus() )
             m_text->SetFocus();
+#endif
     }
 
     Refresh();
@@ -1870,7 +1878,8 @@ void wxComboCtrlBase::ShowPopup()
     wxRect popupWinRect( popupX, popupY, szp.x, szp.y );
 
     m_popup = popup;
-    if ( AnimateShow( popupWinRect, showFlags ) )
+    if ( (m_iFlags & wxCC_IFLAG_DISABLE_POPUP_ANIM) ||
+         AnimateShow( popupWinRect, showFlags ) )
     {
         DoShowPopup( popupWinRect, showFlags );
     }