Hi,
I was developing a plugin and since one week, the part that gets the selected item on the "Project Manager" is not working anymore.
I have a pretty much standard code, as in other places in C::B and other plugins, i.e.:
void cbTree::OnContextMenu( wxCommandEvent& /*event*/ )
{
wxTreeCtrl* tree = Manager::Get()->GetProjectManager()->GetTree();
if ( !tree )
return;
wxTreeItemId selItem = tree->GetSelection();
if ( !selItem.IsOk() )
return;
const FileTreeData* ftData = static_cast<FileTreeData*>( tree->GetItemData( selItem ) );
if ( !ftData )
return;
if (ftData->GetKind() != FileTreeData::ftdkFile)
return;
ProjectFile* pFile = ftData->GetProjectFile();
if ( !pFile )
return;
// Do something with the pFile here //
return;
}
After adding some verbosity to the code and debugging, I figured out that
wxTreeItemId selItem = tree->GetSelection();
is returning a NULL pointer.
Any idea what has changed in the last week or so that could break this...
Btw, I checked the code completion plugin, and the part where is does a "Reparse this Project" (
void NativeParser::ReparseSelectedProject()) is also not working for the same reason...
Attached is a simple project to reproduce the problem.
[attachment deleted by admin]