Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: DrewBoo on March 11, 2008, 09:34:56 pm

Title: What's in wxCommandEvent?
Post by: DrewBoo on March 11, 2008, 09:34:56 pm
The wxCommandEvent objects that the CB SDK passes to menu handlers seem pretty opaque to me.

I'm creating handlers for new menu items when the user right-clicks on things like the Project Manager or Open Files List.  Is there any data hidden in the wxCommandEvent object to report what specifically was right-clicked?  E.g., the file or folder or project?
Title: Re: What's in wxCommandEvent?
Post by: DrewBoo on March 11, 2008, 11:21:31 pm
Maybe this question should be rephrased.

I'm working on a plugin that implements BuildModuleMenu( const ModuleType type, wxMenu* menu, const FileTreeData* data )

When type is mtProjectManager, meaning that the user is right-clicking something in the Project manager, how can my handler know specifically what was clicked?
Title: Re: What's in wxCommandEvent?
Post by: mandrav on March 12, 2008, 09:28:59 am
When type is mtProjectManager, meaning that the user is right-clicking something in the Project manager, how can my handler know specifically what was clicked?

If you want to know the tree item's id, you can access the tree through project manager and get its selected item.
But the FileTreeData object contains much more info regarding the clicked item. See top of cbproject.h to see what info it contains.