Hooks for custom plugins

This forum is for programmers who have questions about the source code.
Post Reply
stevemcmanus
Posts: 5
Joined: Mon Aug 10, 2015 8:38 am

Hooks for custom plugins

Post by stevemcmanus » Thu Aug 13, 2015 8:40 am

I have written some plugins for a client, and I am in need of the following Hooks to be added.

FormOpenDental.Load_end
FormPatientAddAll.butOK_Click_beginning
FormPatientEdit.butOk_Click_ending
FormPatientEdit.FormPatientEdit_Load_ending
FormPatientAddAll.FormPatientAddAll_Load_end
FormOpenDental.Load_end
FormOpenDental.Load_end
FormOpenDental.Load_end
FormReportsMore.FormReportsMore_Load_beginning
FormPatientEdit.butOK_Click_ending


Thank you.

allends
Posts: 235
Joined: Fri Aug 23, 2013 11:29 am

Re: Hooks for custom plugins

Post by allends » Thu Aug 13, 2015 2:00 pm

First, it is typical to include a snippet of code where you want the hook. That way I know exactly where you want it. Without that it could get placed in an incorrect location and that could interfere with your plug-in.

Second, based on your naming convention of these hooks you want them either at the start or end of each specified method, correct?

Third, FormOpenDental.Load_end is listed four times. Did you mean to ask for a different hook? FormPatientEdit.butOK_Click_ending is also listed twice.

Finally, FormOpenDental.Load_end and FormReportsMore_Load_beginning already exist.

I am not sure how to proceed with adding these hooks. A bit more information would be appreciated.
Allen
Open Dental Software
http://www.opendental.com

stevemcmanus
Posts: 5
Joined: Mon Aug 10, 2015 8:38 am

Re: Hooks for custom plugins

Post by stevemcmanus » Mon Aug 17, 2015 10:18 am

Sorry about that. Here is the code for the ones I need added.

OpenDental.FormPatientAddAll:
if(Plugins.HookMethod(this, "FormPatientAddAll.butOK_Click_beginning"))
{
return;
}

OpenDental.FormPatientAddAll:
Plugins.HookAddCode(this, "FormPatientAddAll.FormPatientAddAll_Load_end");

OpenDental.FormPatientEdit: Add prior to the DialogResult line
Plugins.HookAddCode(this, "FormPatientEdit.butOk_Click_ending", Convert.ToInt32(textPatNum.Text));

OpenDental.FormPatientEdit:
Plugins.HookAddCode(this, "FormPatientEdit.FormPatientEdit_Load_ending", Convert.ToInt32(textPatNum.Text));

Second, based on your naming convention of these hooks you want them either at the start or end of each specified method, correct? Yes.
Third, FormOpenDental.Load_end is listed four times. Did you mean to ask for a different hook? FormPatientEdit.butOK_Click_ending is also listed twice. Ignore the duplicates.

stevemcmanus
Posts: 5
Joined: Mon Aug 10, 2015 8:38 am

Re: Hooks for custom plugins

Post by stevemcmanus » Wed Oct 28, 2015 7:58 pm

Hey there!

I was wondering if this information that I posted back in August, was sufficient.

allends
Posts: 235
Joined: Fri Aug 23, 2013 11:29 am

Re: Hooks for custom plugins

Post by allends » Thu Oct 29, 2015 9:27 am

My apologies, I must have missed this when you responded.
I can get all of these into the next version of 15.3, but I have made a few changes shown in bold.
OpenDental.FormPatientAddAll:
if(Plugins.HookMethod(this, "FormPatientAddAll.butOK_Click_start"))
{
return;
}
OpenDental.FormPatientEdit: Add prior to the DialogResult line
Plugins.HookAddCode(this, "FormPatientEdit.butOK_Click_end",PatCur);
OpenDental.FormPatientEdit:
Plugins.HookAddCode(this, "FormPatientEdit.FormPatientEdit_Load_ending", Convert.ToInt32(textPatNum.Text));
The last one was not added because this hook already exists in this form.
Plugins.HookAddCode(this,"FormPatientEdit.Load_end",PatCur);
All of these should be available when 15.3.25 is released.
Allen
Open Dental Software
http://www.opendental.com

stevemcmanus
Posts: 5
Joined: Mon Aug 10, 2015 8:38 am

Re: Hooks for custom plugins

Post by stevemcmanus » Tue Nov 03, 2015 6:35 am

When is that release due out?

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

Re: Hooks for custom plugins

Post by jsalmon » Tue Nov 03, 2015 10:26 am

Today
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

stevemcmanus
Posts: 5
Joined: Mon Aug 10, 2015 8:38 am

Re: Hooks for custom plugins

Post by stevemcmanus » Wed Nov 18, 2015 9:16 am

jsalmon wrote:Today
Should this have been in the subversion source?

allends
Posts: 235
Joined: Fri Aug 23, 2013 11:29 am

Re: Hooks for custom plugins

Post by allends » Wed Nov 18, 2015 9:33 am

Yes, the commit shows on our bug tracker as:
Plugin Hooks, added hooks to a couple patient windows.
Allen
Open Dental Software
http://www.opendental.com

Post Reply