m_toplevEvtHandler = (wxEvtHandler*) NULL;
#endif
+ m_mainCtrlWnd = this;
+
m_heightPopup = -1;
m_widthMinPopup = -1;
m_anchorSide = 0;
m_ignoreEvtText = 0;
m_text = new wxTextCtrl(this, wxID_ANY, m_valueString,
- wxDefaultPosition, wxDefaultSize,
+ wxDefaultPosition, wxSize(10,-1),
style, validator);
-
- // This is required for some platforms (GTK+ atleast)
- m_text->SetSizeHints(2,4);
}
}
void wxComboCtrlBase::OnThemeChange()
{
- SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
+ SetOwnBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
}
wxComboCtrlBase::~wxComboCtrlBase()
}
#endif
-void wxComboCtrlBase::DrawButton( wxDC& dc, const wxRect& rect, bool paintBg )
+void wxComboCtrlBase::DrawButton( wxDC& dc, const wxRect& rect, int paintBg )
{
int drawState = m_btnState;
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;
}
{
if ( event.GetEventType() == wxEVT_SET_FOCUS )
{
- if ( m_text && m_text != ::wxWindow::FindFocus() )
- m_text->SetFocus();
+#ifndef __WXMAC__
+ wxWindow* tc = GetTextCtrl();
+ if ( tc && tc != DoFindFocus() )
+ tc->SetFocus();
+#endif
}
Refresh();
popup = m_popup;
}
+ winPopup->Enable();
+
wxASSERT( !m_popup || m_popup == popup ); // Consistency check.
wxSize adjustedSize = m_popupInterface->GetAdjustedSize(widthPopup,
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 );
}
if ( IsPopupWindowState(Hidden) )
return;
- // NB: Focus setting is really funny, atleast on wxMSW. First of all,
- // we need to have SetFocus at the end. Otherwise wxTextCtrl may
- // freeze until focus goes somewhere else. Second, wxTreeCtrl as
- // popup, when dismissing, "steals" focus back to itself unless
- // SetFocus is called also here, exactly before m_popupWinState
- // is set to false. Which is truly weird since SetFocus is just
- // wxWindowMSW method and does not call event handler or anything like
- // that (ie. does not care about m_popupWinState).
-
- SetFocus();
-
- // This should preferably be set before focus.
+ // This must be set before focus - otherwise there will be recursive
+ // OnPopupDismisses.
m_popupWinState = Hidden;
+ //SetFocus();
+ m_winPopup->Disable();
+
// Inform popup control itself
m_popupInterface->OnDismiss();