Hooks request

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:

Hooks request

Post by wjstarck » Thu Jul 29, 2010 7:08 am

In ClassesShared, after line 192, I want to insert the following:

Code: Select all

public static void GotoChart(long patNum){
OnModuleSelected(new ModuleEventArgs(DateTime.MinValue, new List<long>(), 0, 4, 0, patNum, 0));
}

public static void GotoManage(long patNum){
OnModuleSelected(new ModuleEventArgs(DateTime.MinValue, new List<long>(), 0, 6, 0, patNum, 0));
}
(You may decide to just add that snippet since it's similar to what's there and just provides methods for jumping to the Chart and Manage modules).

In ContrAppt, I want to add the following after line 1610:

Code: Select all

menuApt.MenuItems.Add(Lan.g(this, "   Family File"), new EventHandler(menuFamily_Click));
menuApt.MenuItems.Add(Lan.g(this, "   Chart"), new EventHandler(menuChart_Click));
menuApt.MenuItems.Add(Lan.g(this, "   Account"), new EventHandler(menuAccount_Click));
menuApt.MenuItems.Add(Lan.g(this, "   Treatment Plan"), new EventHandler(menuTreatmentPlan_Click));
menuApt.MenuItems.Add(Lan.g(this, "   Images"), new EventHandler(menuImages_Click));
menuApt.MenuItems.Add(Lan.g(this, "   Manage"), new EventHandler(menuManage_Click));
Finally, in ContrAppt, at the bottom, I want to add the following methods:

Code: Select all

private void menuFamily_Click(object sender, EventArgs e){
                        GotoModule.GotoFamily(PatCur.PatNum);
 }
private void menuAccount_Click(object sender, EventArgs e){
	GotoModule.GotoAccount(PatCur.PatNum);
}
private void menuTreatmentPlan_Click(object sender, EventArgs e){
	GotoModule.GotoTreatmentPlan(PatCur.PatNum);
}
private void menuImages_Click(object sender, EventArgs e){
	GotoModule.GotoImage(PatCur.PatNum, 0);
}		}

public void menuChart_Click(object sender, EventArgs e){
	GotoModule.GotoChart(PatCur.PatNum);
}
public void menuManage_Click(object sender, EventArgs e){
	GotoModule.GotoManage(PatCur.PatNum);
}
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: 5742
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: Hooks request

Post by jordansparks » Thu Jul 29, 2010 3:51 pm

I'm not sure without trying, but I think we can put an AddCode hook in the spot where you want more menu items added. And then I think you would put your click events in your own external class.
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: Hooks request

Post by wjstarck » Thu Aug 05, 2010 4:43 am

So I'll still need a hook for those methods at the bottom of ContrAppt, right?

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: 5742
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: Hooks request

Post by jordansparks » Fri Aug 06, 2010 7:16 am

Sorry, I don't understand the question. What methods? Are you talking about the click events? Those belong in your own class, like our example.
Jordan Sparks, DMD
http://www.opendental.com

alkhaef
Posts: 105
Joined: Fri Jul 02, 2010 10:37 am
Location: Los Angeles, CA

Re: Hooks request

Post by alkhaef » Mon Aug 30, 2010 3:24 pm

Dr. Sparks,

Sorry to jump in, but if I'm understanding correctly, I *almost* had the same request. I think he's referring to adding a HookAddcode (_end) to the end of ContrAppt.InitializeOnStartup (similar to the one in ContrAccount) as you mentioned, so he can add the menu items. Please feel free to correct me if I'm wrong, Dr. Starck.

I said *almost*, because I realized I'd like to request hooks at the end of the LayoutToolbar calls in the modules (just before the call to invalidate), because it would allow toolbar changes that don't get clobbered later (LayoutToolbar is often called from other places besides InitializeOnStartup - yes, I learned this the hard way :P).

Thanks,
Al
Help! I've OD'ed on OD! :)

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

Re: Hooks request

Post by wjstarck » Mon Aug 30, 2010 4:00 pm

Al-

What I was wanting to do was add context menu items that allowed you to jump to any module when right clicking on an appointment.

I honestly can't remember where those should go, it's been a while so I'd have to go back and look at the code.
Cheers,

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

Post Reply