Page 1 of 1

Hook for sub-contextual menu

Posted: Mon Sep 23, 2013 10:36 pm
by wjstarck
Hi-

I want to add a sub-contextual menu for the time being like the one I proposed here:

viewtopic.php?f=1&t=4678&p=19845&hilit=menu#p19845

Where in ContrChart should the hook go?

Re: Hook for sub-contextual menu

Posted: Tue Sep 24, 2013 11:53 am
by wjstarck
OK, nvm looks like it goes here:

Code: Select all

private void gridProg_MouseUp(object sender,MouseEventArgs e) {
			
			if(e.Button==MouseButtons.Right) {
				if(PrefC.GetBool(PrefName.EasyHideHospitals)){
					menuItemPrintDay.Visible=false;
				}
				else{
					menuItemPrintDay.Visible=true;
				}
				Plugins.HookAddCode(this,"ContrChart.gridProg_MouseUp_end");  <-----------
				menuProgRight.Show(gridProg,new Point(e.X,e.Y));
			}
		}
So, can you insert that hook after line 1844 on ContrChart?

Thanks

Re: Hook for sub-contextual menu

Posted: Tue Sep 24, 2013 2:49 pm
by allends
Have you tested this to make sure it works?

Re: Hook for sub-contextual menu

Posted: Tue Sep 24, 2013 9:38 pm
by wjstarck
Right.

I was focused on the menus which works fine, but I've still got to pass in the selected procedures. I'll give you an updated hook request once I've got that working.

Thanks.

Re: Hook for sub-contextual menu

Posted: Fri Sep 27, 2013 9:51 pm
by wjstarck
Sorry about that.

The hook should look like this on ContrChart:

Code: Select all

private void gridProg_MouseUp(object sender,MouseEventArgs e) {
			if(e.Button==MouseButtons.Right) {
				if(PrefC.GetBool(PrefName.EasyHideHospitals)){
					menuItemPrintDay.Visible=false;
				}
				else{
					menuItemPrintDay.Visible=true;
				}
          Plugins.HookAddCode(this,"ContrChart.gridProg_MouseUp_end",menuProgRight,gridProg,PatCur); <-------
	       menuProgRight.Show(gridProg,new Point(e.X,e.Y));
          }
   }
If I could get that added to 13.2 and the head that would be great.

Re: Hook for sub-contextual menu

Posted: Wed Oct 02, 2013 2:28 pm
by allends
This hook has been added.

Re: Hook for sub-contextual menu

Posted: Wed Oct 02, 2013 2:33 pm
by wjstarck
Thanks Allen

Re: Hook for sub-contextual menu

Posted: Fri Oct 04, 2013 9:20 am
by wjstarck
Here is the result with the hook:

Image

Thanks guys (and gals)

Re: Hook for sub-contextual menu

Posted: Fri Oct 04, 2013 7:47 pm
by drtech
That looks great