Hook Request - OpenDentBusiness.UI.ApptSingleDrawing_DrawEnt

This forum is for programmers who have questions about the source code.
Post Reply
User avatar
FernandoJB
Posts: 6
Joined: Fri Aug 20, 2010 9:39 am
Location: Framingham, MA
Contact:

Hook Request - OpenDentBusiness.UI.ApptSingleDrawing_DrawEnt

Post by FernandoJB » Fri Feb 21, 2014 3:16 pm

Hi, can you add a hook in OpenDentBusiness\UI\ApptSingleDrawing.cs on method "DrawEntireAppt" at line 124 ( aprox )

Code: Select all

			#region UR
			drawLoc=new Point((int)totalWidth-1,0);//in the UR area, we refer to the upper right corner of each element.
			elementI=0;
			while(drawLoc.Y<totalHeight && elementI<apptRows.Count) {
				if(apptRows[elementI].ElementAlignment!=ApptViewAlignment.UR) {
					elementI++;
					continue;
				}
				drawLoc=DrawElement(g,elementI,drawLoc,apptViewCur.StackBehavUR,ApptViewAlignment.UR,backBrush,dataRoww,apptRows,tableApptFields,tablePatFields,totalWidth,totalHeight,fontSize,isPrinting);
				elementI++;
			}

            // HOOK HERE             

            Plugins.HookAddCode(null, "OpenDentBusiness.UI.ApptSingleDrawing_DrawEntireAppt", new object[] {dataRoww, g, drawLoc });

            // END HOOK
            #endregion
Plugins.HookAddCode(null, "OpenDentBusiness.UI.ApptSingleDrawing_DrawEntireAppt", new object[] {dataRoww, g, drawLoc });



Thanks !

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

Re: Hook Request - OpenDentBusiness.UI.ApptSingleDrawing_Dra

Post by allends » Mon Feb 24, 2014 9:04 am

Hi,
Firstly, what is your main goal with this hook? I ask because we have never put a hook inside the business layer of Open Dental and it is something we are trying avoid unless necessary.
Allen
Open Dental Software
http://www.opendental.com

User avatar
FernandoJB
Posts: 6
Joined: Fri Aug 20, 2010 9:39 am
Location: Framingham, MA
Contact:

Re: Hook Request - OpenDentBusiness.UI.ApptSingleDrawing_Dra

Post by FernandoJB » Mon Feb 24, 2014 12:30 pm

Hi , we intend to modify / add stuff to the Appointment control, and as they are being painted, we need to hook to the graphics Context and get the last "Point(x,y)" for location

if i get a hook for the control it will only have an image and we might end painting on top of it, hiding data.

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

Re: Hook Request - OpenDentBusiness.UI.ApptSingleDrawing_Dra

Post by allends » Wed Feb 26, 2014 9:29 am

Code: Select all

#region UR
			drawLoc=new Point((int)totalWidth-1,0);//in the UR area, we refer to the upper right corner of each element.
			elementI=0;
			while(drawLoc.Y<totalHeight && elementI<apptRows.Count) {
				if(apptRows[elementI].ElementAlignment!=ApptViewAlignment.UR) {
					elementI++;
					continue;
				}
				drawLoc=DrawElement(g,elementI,drawLoc,apptViewCur.StackBehavUR,ApptViewAlignment.UR,backBrush,dataRoww,apptRows,tableApptFields,tablePatFields,totalWidth,totalHeight,fontSize,isPrinting);
				elementI++;
			}
			Plugins.HookAddCode(null,"OpenDentBusiness.UI.ApptSingleDrawing.DrawEntireAppt_UR",dataRoww,g,drawLoc);
			#endregion
This plugin hook will be available in the 14.1.8.
I update the name to better adhere to our patterns and changed the params to be easier to read.
You don't need to pass in a object[] of params, you just need to pass in each parameter on its own and it will be accessible.
Hope that helps! :)
Plugins.HookAddCode(null,"OpenDentBusiness.UI.ApptSingleDrawing.DrawEntireAppt_UR",dataRoww,g,drawLoc);
Allen
Open Dental Software
http://www.opendental.com

Post Reply