Page 1 of 1

Hook request: OnPatient_Click (FormOpenDental)

Posted: Thu Mar 03, 2011 10:55 am
by wjstarck
Hello-

I need a hook after line 1886 in the method OnPatient_Click() on FormOpenDental like so:

Code: Select all

		private void OnPatient_Click() {
			FormPatientSelect formPS=new FormPatientSelect();
			formPS.ShowDialog();
			if(formPS.DialogResult==DialogResult.OK) {
				CurPatNum=formPS.SelectedPatNum;
				Patient pat=Patients.GetPat(CurPatNum);
				RefreshCurrentModule();
				FillPatientButton(CurPatNum,pat.GetNameLF(),pat.Email!="",pat.ChartNumber,pat.SiteNum);

>>>>>>>>>>  Plugins.HookAddCode(this, "FormOpenDental.OnPatient_Click");   <<<<<<<<<<<

			}
		}
Thanks.

Re: Hook request: OnPatient_Click (FormOpenDental)

Posted: Fri Mar 04, 2011 6:12 pm
by jordansparks
Michael will add that.

Re: Hook request: OnPatient_Click (FormOpenDental)

Posted: Sat Mar 05, 2011 7:51 am
by wjstarck
Thanks, Jordan.

I realized I also need a hook after line 3142 on ContrAppt:

Code: Select all

private void ContrApptSheet2_MouseLeave(object sender,EventArgs e) {
InfoBubbleDraw(new Point(-1,-1));
timerInfoBubble.Enabled=false;//redundant?
Cursor=Cursors.Default;
Plugins.HookAddCode(this, "ContrApptSheet2_MouseLeave_end");		
}
I had tried to place the hook at the bottom of the OnPatientSelected method on ContrAppt, but this creates a second instance of the appointment stuck to the cursor as if I was trying to move the appointment. But it works fine if I place it here.

Thanks.

Re: Hook request: OnPatient_Click (FormOpenDental)

Posted: Thu Mar 10, 2011 11:54 am
by michael
The code

Code: Select all

Plugins.HookAddCode(this,"FormOpenDental.OnPatient_Click_end"); 
and

Code: Select all

Plugins.HookAddCode(this, "ContrAppt.ContrApptSheet2_MouseLeave_end");
was added to the corresponding classes/methods. Note this differs slightly from your request, specifically adding "_end" to the first one and "ContrAppt." to the second one to follow our existing pattern. Will be released with 7.8.4 (beta).

Re: Hook request: OnPatient_Click (FormOpenDental)

Posted: Thu Mar 10, 2011 2:14 pm
by wjstarck
Thanks for adding those Michael.

I must have hexed you. On line 3136 of ContrAppt it says (version 7.8, haven't checked 7.7 or head )

Code: Select all

Plugins.HookAddCode(this,"ContrApptSheet2_MouseLeave_end");  
But it should read

Code: Select all

Plugins.HookAddCode(this,"ContrAppt.ContrApptSheet2_MouseLeave_end");  
Sorry about that :oops:

Re: Hook request: OnPatient_Click (FormOpenDental)

Posted: Mon Mar 14, 2011 7:43 am
by michael
Thanks. Changing that now.