Author Topic: Adding/removing menu items [resolved]  (Read 6470 times)

Offline stardust

  • Multiple posting newcomer
  • *
  • Posts: 55
    • http://www.hightec-rt.com
Adding/removing menu items [resolved]
« on: February 27, 2007, 10:20:43 am »
Hi,

how can I add/remove menu items in the main menu bar when attaching/detaching a plugin?

Can you give me some grep patterns that will lead me to respective places in the c:b sources that do this, too? I.e. Class/method/event names.

Is there anything special to consider beside doing the menu changes and notifying the AUI?

Thanks
« Last Edit: March 01, 2007, 03:22:24 pm by stardust »
Own SVN builds (quite new) • SuSE Linux 10.0 • Linux kernel 2.6.13-15-default
gcc 4.0.2 (20050901)
wxGTK-2.6.1.0-4 • KDE 3.4.2b • gtk2 2.8.3-4

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5520
Re: Adding/removing menu items
« Reply #1 on: February 27, 2007, 12:18:37 pm »
take a look at some old tutorial I wrote :
http://wiki.codeblocks.org/index.php?title=Creating_a_Plug-in_which_modifies_CB%27s_Menus


It is outdated but still might be of help though ...

Offline stardust

  • Multiple posting newcomer
  • *
  • Posts: 55
    • http://www.hightec-rt.com
Re: Adding/removing menu items
« Reply #2 on: February 27, 2007, 04:42:26 pm »
Thanks,

I missed the project wizard's checkboxes :oops:


http://wiki.codeblocks.org/index.php?title=Creating_a_Plug-in_which_modifies_CB%27s_Menus#Adjusting_the_.22Edit.22_menu

States
Code
int pos = menuBar->FindItem(_("Edit"));

but I had to use
Code
int pos = menuBar->FindMenu(_("Edit"));

I guess this is a misstake in the wiki. I did not change the wiki because I am a c::b greenhorn and not 100% sure about that ;-)


Own SVN builds (quite new) • SuSE Linux 10.0 • Linux kernel 2.6.13-15-default
gcc 4.0.2 (20050901)
wxGTK-2.6.1.0-4 • KDE 3.4.2b • gtk2 2.8.3-4