Ticket #9862: 9862.patch

File 9862.patch, 1.4 KB (added by oneeyeman, 5 years ago)
  • samples/widgets/combobox.cpp

    diff -bru wxWidgets.orig/samples/widgets/combobox.cpp wxWidgets/samples/widgets/combobox.cpp
    old new  
    105105protected:
    106106    // event handlers
    107107    void OnButtonReset(wxCommandEvent& event);
     108    void OnSetFocus(wxFocusEvent &event);
     109    void OnKillFocus(wxFocusEvent &event);
    108110    void OnButtonPopup(wxCommandEvent&) { m_combobox->Popup(); }
    109111    void OnButtonDismiss(wxCommandEvent&) { m_combobox->Dismiss(); }
    110112    void OnButtonChange(wxCommandEvent& event);
     
    392394    Reset();
    393395
    394396    SetSizer(sizerTop);
     397    m_combobox->Bind( wxEVT_SET_FOCUS, &ComboboxWidgetsPage::OnSetFocus, this );
     398    m_combobox->Bind( wxEVT_KILL_FOCUS, &ComboboxWidgetsPage::OnKillFocus, this );
    395399}
    396400
    397401// ----------------------------------------------------------------------------
     
    555559    m_combobox->SetString(0, m_textSetFirst->GetValue());
    556560}
    557561
     562void ComboboxWidgetsPage::OnSetFocus(wxFocusEvent &event)
     563{
     564    wxLogWarning( "Set Focus" );
     565    event.Skip();
     566}
     567
     568void ComboboxWidgetsPage::OnKillFocus(wxFocusEvent &event)
     569{
     570     wxLogWarning( "Kill Focus" );
     571     event.Skip();
     572}
     573
    558574void ComboboxWidgetsPage::OnButtonAddMany(wxCommandEvent& WXUNUSED(event))
    559575{
    560576    // "many" means 1000 here