#18205: Event/focus issues with wxComboCtrl/wxComboPopup in modal dialog
-----------------------+--------------------
Reporter: JeffYoung | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: GUI-all | Version: 3.0.3
Keywords: | Blocked By:
Blocking: | Patch: 0
-----------------------+--------------------
If you put a wxComboCtrl with a specialised wxComboPopup into a modal
dialog you will have focus issues with some controls in the popup (in my
case a wxTextCtrl).
You can also reproduce this by converting MyFrame in the "combo" sample
from a wxFrame to a wxDialog (and showing it with ShowModal()). Note that
the controls in the combo box dropdowns in the third row (List View and
Tree Ctrl) have focus issues.
FWIW, my code looks like this:
{{{
class NET_SELECTOR_COMBOPOPUP : public wxPanel, public wxComboPopup
{
public:
NET_SELECTOR_COMBOPOPUP() :
{ }
bool Create(wxWindow* aParent) override
{
wxPanel::Create( aParent );
wxBoxSizer* mainSizer;
mainSizer = new wxBoxSizer( wxVERTICAL );
m_filterCtrl = new wxTextCtrl( this, wxID_ANY );
m_filterCtrl->SetHint( _( "Filter" ) );
mainSizer->Add( m_filterCtrl, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 0
);
m_netListBox = new wxListBox( this, wxID_ANY, wxDefaultPosition,
wxDefaultSize, 0, 0,
wxLB_SINGLE|wxLB_NEEDED_SB );
mainSizer->Add( m_netListBox, 0, wxALL|wxEXPAND, 0 );
SetSizer( mainSizer );
Layout();
m_netListBox->Connect( wxEVT_LISTBOX_DCLICK,
wxCommandEventHandler( NET_SELECTOR_COMBOPOPUP::onDblClick ), NULL, this
);
m_filterCtrl->Connect( wxEVT_TEXT, wxCommandEventHandler(
NET_SELECTOR_COMBOPOPUP::onFilterEdit ), NULL, this );
return true;
}
...
}}}
See also the discussion here:
https://forums.wxwidgets.org/viewtopic.php?f=1&t=44997&p=186323#p186323
--
Ticket URL: <
https://trac.wxwidgets.org/ticket/18205>