Implement dropdown and popup events for wxComboBox on Qt

Closes https://github.com/wxWidgets/wxWidgets/pull/1005
This commit is contained in:
oneeyeman1
2018-11-01 04:30:41 -04:00
committed by Vadim Zeitlin
parent a1adc2efa4
commit 1c06a62830

View File

@@ -20,6 +20,8 @@ class wxQtComboBox : public wxQtEventSignalHandler< QComboBox, wxComboBox >
{
public:
wxQtComboBox( wxWindow *parent, wxComboBox *handler );
virtual void showPopup() wxOVERRIDE;
virtual void hidePopup() wxOVERRIDE;
private:
void activated(int index);
@@ -36,6 +38,20 @@ wxQtComboBox::wxQtComboBox( wxWindow *parent, wxComboBox *handler )
this, &wxQtComboBox::editTextChanged);
}
void wxQtComboBox::showPopup()
{
wxCommandEvent event( wxEVT_COMBOBOX_DROPDOWN, GetHandler()->GetId() );
EmitEvent( event );
QComboBox::showPopup();
}
void wxQtComboBox::hidePopup()
{
wxCommandEvent event( wxEVT_COMBOBOX_CLOSEUP, GetHandler()->GetId() );
EmitEvent( event );
QComboBox::hidePopup();
}
void wxQtComboBox::activated(int WXUNUSED(index))
{
wxComboBox *handler = GetHandler();