New Hook Request for Cameras!

This forum is for programmers who have questions about the source code.
Post Reply
User avatar
Justin Shafer
Posts: 596
Joined: Sat Jul 28, 2007 7:34 pm
Location: Fort Worth, TX.

New Hook Request for Cameras!

Post by Justin Shafer » Thu Jan 05, 2017 2:41 am

ContrImages.cs

Around line: 2000 I would like to over ride Import to File but still use the Open File Dialog, I just want to automatically process the files selected:

private void ToolBarImport_Click() {
+if (Plugins.HookMethod(this, "ContrImages.ToolBarImport_Click", PatCur))
+{
+ FillDocList(true);
+ return;
+}

Around line:1692 I would like to over ride the Scan Photo Button to use the DirectShow\IOC Snapshot plugin
private void ToolBarScan_Click(string scanType) {
+if (scanType == "photo")
+ {
+ if (Plugins.HookMethod(this, "ContrImages.ToolBarScan_Click", PatCur))
+ {
+ FillDocList(true);
+ return;
+ }
+ }

Can you guys add that? I probably wouldn't need it except for.. FillDocList doesn't seem doable from my plugin dll file.. So.. this works? Thanks! All FillDocList does is refresh the list of documents\images in the Images Module.

Image

When you close the window, the images are automatically assigned to the Photo Category without prompts. And no I didn't hard code the category number. :) I also made the filenames random in the database and the files etc. I went off of the TigerView.cs file and the sample as a reference. Neat!

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

Re: New Hook Request for Cameras!

Post by allends » Thu Jan 05, 2017 5:26 pm

Do you need these hooks if I make the FillDocList public?
Also does the Scan Click hook need to return right there or can it be a hook add method?
Allen
Open Dental Software
http://www.opendental.com

User avatar
Justin Shafer
Posts: 596
Joined: Sat Jul 28, 2007 7:34 pm
Location: Fort Worth, TX.

Re: New Hook Request for Cameras!

Post by Justin Shafer » Fri Jan 06, 2017 4:56 am

If you made the FillDoc public then I don't think I would need a hook on Scanclick at all... I can just rely on the toolbar button because FillDoc would work!

At least.. I think. :D I made it public just from OpenDental.. and I couldn't see it in my list of classes.. I dunno.

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

Re: New Hook Request for Cameras!

Post by allends » Tue Jan 17, 2017 10:39 am

I added this hook

Code: Select all


			if(Plugins.HookMethod(this,"ContrImages.ToolBarImport_Click_Start",PatCur)) {
				FillDocList(true);
				return;
			}
to the import button click and made the FillDocList public.

Both of those will be available in 16.4.15 when it is released.
Allen
Open Dental Software
http://www.opendental.com

User avatar
Justin Shafer
Posts: 596
Joined: Sat Jul 28, 2007 7:34 pm
Location: Fort Worth, TX.

Re: New Hook Request for Cameras!

Post by Justin Shafer » Sat Feb 11, 2017 7:21 am

NEAT! THANKS!!! :) Edit my other post later.

Post Reply