I want to pass the wxTreeItemData through the event handler so whatever the user decides the treedata is readily accessible to handle. I have been able to accomplish this using a custom Userdata through Menu.Connect and having a dispatcher function call a map of functions but it seemed rather hacky and would prefer to use Bind.
Currently my setup is something like this. Looking for recommendations as I am rather stumped :S
Code: Select all
void MainWindow::OnTreeItemRightClick(wxTreeEvent& event)
{
auto temp_selected = m_tree_view->GetItemData(event.GetItem());
BaseData* tree_data = static_cast<BaseData*>(temp_selected);
wxMenu menu;
tree_data->AppendPopUpMenu(menu);
PopupMenu(&menu);
event.Skip();
}
Code: Select all
void MainWindow::OnUpdateDialog(wxCommandEvent& event)
{
auto tree_data = (BaseData*)tree_panel_->GetItemData(event.GetItem());
if(tree_data ->OpenDialog())
{
wxLogDebug("Opened the Dialog");
//tree_panel_->SetItemText(tree_data ->GetId(), selected_data->get_property());
}
}