In my wx application, I have wxITEM_DROPDOWN tool in which I am adding menu-items dynamically as follows,
Code: Select all
m_tooBar = new wxToolBar(m_titlePanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTB_NODIVIDER|wxTB_HORZ_TEXT);
m_tooBar->AddTool(wxID_LOAD, wxT("Load"), wxMEMORY_PNG(ICON_LOAD),
wxMEMORY_PNG(ICON_LOAD), wxITEM_DROPDOWN,
wxEmptyString, wxEmptyString, NULL);
xMenu *loadMenu = new wxMenu;
for(size_t iter = 0; iter < gloadMenuList.size(); ++ iter)
loadMenu->Append(wxID_ANY, gloadMenuList[iter]);
m_tooBar->SetDropdownMenu(wxID_LOAD, loadMenu);
m_tooBar->Realize();
On click, I get event but unable to figure out which menu-item is clicked. The menu-item label is unique so I want to know it to process further.
Please suggest.
Thanks,
R.