From: Vadim Zeitlin Date: Wed, 7 Dec 2011 23:41:14 +0000 (+0000) Subject: Work around impossibility to use wxCombobox in wxGrid in wxOSX. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/cf82560a388abc8433f6ab34b12ef8e11aa1a7f4 Work around impossibility to use wxCombobox in wxGrid in wxOSX. Open the combobox when the editor is initially shown, this somehow ensures that the combobox selection is taken into account when it is closed while without this the selection is simply completely ignored. This is just a hack but at least it allows to use wxGridCellChoiceEditor under wxOSX which was previously impossible at all. Closes #12644. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69950 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/generic/grideditors.cpp b/src/generic/grideditors.cpp index d3113c6867..835ca10e71 100644 --- a/src/generic/grideditors.cpp +++ b/src/generic/grideditors.cpp @@ -1445,6 +1445,14 @@ void wxGridCellChoiceEditor::BeginEdit(int row, int col, wxGrid* grid) Combo()->SetFocus(); +#ifdef __WXOSX_COCOA__ + // This is a work around for the combobox being simply dismissed when a + // choice is made in it under OS X. The bug is almost certainly due to a + // problem in focus events generation logic but it's not obvious to fix and + // for now this at least allows to use wxGrid. + Combo()->Popup(); +#endif + if (evtHandler) { // When dropping down the menu, a kill focus event