Adding Menu Item to Setup Menu

This forum is for programmers who have questions about the source code.
Post Reply
User avatar
drtech
Posts: 1649
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Adding Menu Item to Setup Menu

Post by drtech » Wed Jul 31, 2013 8:05 am

Can someone give me some instruction on the proper way to add a menu item with click event to the Setup Menu of OD with a plugin? All I want is to launch my setup window from an item on the setup menu, but I can't seem to figure out how to add a menu item dynamically with it's own click event. I have added many controls to other forms with my plugin using the example code in the sample project, but I am not very familiar with menus and can't seem to figure it out.

Help anyone?
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

User avatar
jsalmon
Posts: 1555
Joined: Tue Nov 30, 2010 12:33 pm
Contact:

Re: Adding Menu Item to Setup Menu

Post by jsalmon » Wed Jul 31, 2013 9:33 am

It's been a very long time since I've done plugins so I don't remember quite what you have access to but if I wanted to dynamically add to Setup I would do the following:

Code: Select all

menuItemSettings.MenuItems.Add("Click Me",new System.EventHandler(this.menuItemClickMe_OnClick));
My guess is that you would do this in the Plugins.HookAddCode(this,"FormOpenDental.Load_end"); call. This is assuming you have access to menuItemSettings (which is the Setup menu item)

Hope that helps.
The best thing about a boolean is even if you are wrong, you are only off by a bit.

Jason Salmon
Open Dental Software
http://www.opendental.com

Post Reply