Hook request - ContrChart.pd2_PrintPage()

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

Hook request - ContrChart.pd2_PrintPage()

Post by wjstarck » Wed Nov 26, 2014 8:44 pm

Hi-

Could I have the following hook in the middle of pd2_PrintPage method on ContrChart (should be after about line 9270):

yPos+=(int)g.MeasureString(text,headingFont).Height;
text = PatCur.GetNameFL();//name
if(g.MeasureString(text,subHeadingFont).Width>700) {
//extremely long name
text=PatCur.GetNameFirst()[0]+". "+PatCur.LName;//example: J. Sparks
}

Code: Select all

            //this hook changes the printed header on the top of printed progress notes
            string[] headerText = {text};
            Plugins.HookAddCode(this,"ContrChart.pd2_PrintPage_middle",PatCur,e,g,headerText);
            text = headerText[0];
            //end hook
g.DrawString(text,subHeadingFont,Brushes.Black,400-g.MeasureString(text,subHeadingFont).Width/2,yPos);
text="Page "+(pagesPrinted+1);

g.DrawString(text,subHeadingFont,Brushes.Black,800-g.MeasureString(text,subHeadingFont).Width,yPos);
yPos+=30;

If I could have it in OD 14.3 and later that would be super :D

Thanks,
Cheers,

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

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

Re: Hook request - ContrChart.pd2_PrintPage()

Post by wjstarck » Thu Dec 11, 2014 1:21 pm

Any idea when you'll be able to get to this one?

:o
Cheers,

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

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

Re: Hook request - ContrChart.pd2_PrintPage()

Post by allends » Thu Dec 11, 2014 1:26 pm

Sorry, I meant to comment on this before.

I have added this to version 14.3.24 (sans comment code) and it will be available when it is released.
Allen
Open Dental Software
http://www.opendental.com

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

Re: Hook request - ContrChart.pd2_PrintPage()

Post by wjstarck » Thu Dec 11, 2014 2:16 pm

Awesome thanks
Cheers,

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

Post Reply