void MyFrame::OnButtonClicked(wxCommandEvent& event) { // Button was clicked // Do some processing... if (need_to_skip) { event.Skip(); // Allow event to be handled by next handler } }
void MyFrame::OnMenuItemSelected(wxCommandEvent& event) { int id = event.GetId(); switch (id) { case ID_MENU_ITEM_1: // Handle menu item 1 selection break; case ID_MENU_ITEM_2: // Handle menu item 2 selection break; default: event.Skip(); // Allow unhandled menu items to be passed on } }In this example, the handler for a menu item selection event is defined. If the selected menu item matches one of the known IDs, it is handled accordingly. If an unknown menu item is selected, the Skip() method is called to allow the event to be handled by the next handler in the chain, rather than stopping propagation. Package/Library: wxWidgets