Author Topic: What's in wxCommandEvent?  (Read 5383 times)

Offline DrewBoo

  • Multiple posting newcomer
  • *
  • Posts: 110
What's in wxCommandEvent?
« 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?

Offline DrewBoo

  • Multiple posting newcomer
  • *
  • Posts: 110
Re: What's in wxCommandEvent?
« Reply #1 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?

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: What's in wxCommandEvent?
« Reply #2 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.
Be patient!
This bug will be fixed soon...