Thanks!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).
HookAddCode request - end of LayoutToolbar's in MainModules
HookAddCode request - end of LayoutToolbar's in MainModules
A little bit of explanation is at viewtopic.php?f=3&t=2881
Al
Help! I've OD'ed on OD!
Help! I've OD'ed on OD!

Re: HookAddCode request - end of LayoutToolbar's in MainModules
Just wanted to clarify a bit, so this doesn't look like a dupe request...
I noticed that 7.2 has a hook like the following in each of the main modules, and another respective one in ModuleUnselected:
The comment implies that this hook is already there to achieve what I'm asking for. While still useful (I requested them
), these hooks serve a different purpose.
I actually tried sticking a hook in that spot myself in 7.0, but found that it hadn't worked for adding toolbar buttons, because LayoutToolbar is called from other places than ModuleSelected (don't remember the details - signal received? updated module data? going to another module and returning?), so the button I added would disappear when adding it that way.
The end of LayoutToolbar was the only place I tried it where it would persist.
Thanks!
I noticed that 7.2 has a hook like the following in each of the main modules, and another respective one in ModuleUnselected:
Code: Select all
Plugins.HookAddCode(this,"ContrChart.ModuleSelected_end",patNum);//Hook added to allow adding buttons to the toolbar.

I actually tried sticking a hook in that spot myself in 7.0, but found that it hadn't worked for adding toolbar buttons, because LayoutToolbar is called from other places than ModuleSelected (don't remember the details - signal received? updated module data? going to another module and returning?), so the button I added would disappear when adding it that way.
The end of LayoutToolbar was the only place I tried it where it would persist.
Thanks!
Al
Help! I've OD'ed on OD!
Help! I've OD'ed on OD!

Re: HookAddCode request - end of LayoutToolbar's in MainModules
LayoutToolBar_end hooks added to the main modules (except Staff which does not have the LayoutTooldBar function) in version 7.2.39.
Re: HookAddCode request - end of LayoutToolbar's in MainModules
Small change was made. Instead of passing PatCur.PatNum, PatCur was passed to avoid a null pointer exception. Again, this hook will be released with 7.2.39.
Re: HookAddCode request - end of LayoutToolbar's in MainModules
Thanks Michael.
Great point. Even better.
FYI though - I just looked at head, and noticed that you only made this change to LayoutToolbars, although your concern probably also applies to the ModuleSelected, and ModuleUnselected too. Actually, ModuleUnselected isn't passing anything.
Anyway, I just wanted to give you a heads up, since you probably intended to make the change to its sister hooks too
.
Best,
Great point. Even better.
FYI though - I just looked at head, and noticed that you only made this change to LayoutToolbars, although your concern probably also applies to the ModuleSelected, and ModuleUnselected too. Actually, ModuleUnselected isn't passing anything.
Anyway, I just wanted to give you a heads up, since you probably intended to make the change to its sister hooks too

Best,
Al
Help! I've OD'ed on OD!
Help! I've OD'ed on OD!

- jordansparks
- Site Admin
- Posts: 5770
- Joined: Sun Jun 17, 2007 3:59 pm
- Location: Salem, Oregon
- Contact:
Re: HookAddCode request - end of LayoutToolbar's in MainModules
But patNum is an available variable, and it's impossible for it to be null because it's a value type. As for ModuleUnselected, patNum is irrelevant.
Jordan Sparks, DMD
http://www.opendental.com
http://www.opendental.com
Re: HookAddCode request - end of LayoutToolbar's in MainModules
Ah. Indeed. Didn't notice it was a passed-in variable, and not PatCur.PatNum.But patNum is an available variable, and it's impossible for it to be null because it's a value type.
Well... I'm not using that parameter yet (in fact, I'm not using it for ModuleSelected yet...). I just figured that if one were to use it in ModuleSelected, one might also need it passed to ModuleUnselected under some odd circumstances for cleanup. I see now that it's not even passed to ModuleUnselected in the first place, though, and sending PatCur would just be weird and inconsistent - so... nevermindAs for ModuleUnselected, patNum is irrelevant.

Best,
Al
Help! I've OD'ed on OD!
Help! I've OD'ed on OD!
