Hook request: OnPatient_Click (FormOpenDental)

This forum is for programmers who have questions about the source code.
Post Reply
User avatar
wjstarck
Posts: 936
Joined: Tue Jul 31, 2007 7:18 am
Location: Keller, TX
Contact:

Hook request: OnPatient_Click (FormOpenDental)

Post by wjstarck » Thu Mar 03, 2011 10:55 am

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.
Cheers,

Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA

User avatar
jordansparks
Site Admin
Posts: 5744
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: Hook request: OnPatient_Click (FormOpenDental)

Post by jordansparks » Fri Mar 04, 2011 6:12 pm

Michael will add that.
Jordan Sparks, DMD
http://www.opendental.com

User avatar
wjstarck
Posts: 936
Joined: Tue Jul 31, 2007 7:18 am
Location: Keller, TX
Contact:

Re: Hook request: OnPatient_Click (FormOpenDental)

Post by wjstarck » Sat Mar 05, 2011 7:51 am

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.
Cheers,

Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA

michael
Posts: 38
Joined: Wed Aug 04, 2010 8:49 am

Re: Hook request: OnPatient_Click (FormOpenDental)

Post by michael » Thu Mar 10, 2011 11:54 am

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).

User avatar
wjstarck
Posts: 936
Joined: Tue Jul 31, 2007 7:18 am
Location: Keller, TX
Contact:

Re: Hook request: OnPatient_Click (FormOpenDental)

Post by wjstarck » Thu Mar 10, 2011 2:14 pm

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:
Cheers,

Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA

michael
Posts: 38
Joined: Wed Aug 04, 2010 8:49 am

Re: Hook request: OnPatient_Click (FormOpenDental)

Post by michael » Mon Mar 14, 2011 7:43 am

Thanks. Changing that now.

Post Reply