Popup Menu for wxComboBox
Posted: Tue Jun 19, 2007 6:45 pm
Hello I want to Popup menu when right mouse button is clicked on ComboBox.
This is my code:
Creating controls and Connecting to mouse event.
Poping up menu.
When I right click combo applicatoion crashes.
Is it posible to make popup manu for combo box?
If so then could You give me any pointers how to do it correctly?
This is my code:
Creating controls and Connecting to mouse event.
Code: Select all
ComboControl = new wxComboBox(MainPanel, ID_COMBOCONTROL, wxT(""), wxPoint(10,20), wxSize(200,21), arrayStringFor_ComboControl, wxCB_READONLY, wxDefaultValidator, wxT("ComboControl"));
ComboMenu = new wxMenu(wxT(""));ComboMenu->Append(ID_MNU_RENAME_1010, wxT("Rename"), wxT(""), wxITEM_NORMAL);
ComboMenu->Append(ID_MNU_DELETE_1009, wxT("Delete"), wxT(""), wxITEM_NORMAL);
ComboControl->Connect(wxID_ANY ,wxEVT_RIGHT_UP,wxMouseEventHandler( MercPoolDialog::ComboRightUp ) );
Code: Select all
void MercPoolDialog::ComboRightUp( wxMouseEvent& event ){
ComboControl->PopupMenu( ComboMenu );
event.Skip();
}
Is it posible to make popup manu for combo box?
If so then could You give me any pointers how to do it correctly?