Hook Request
Hook Request
_____________________________________________________________________
object[] parameters = {retVal};
if (Plugins.HookMethod(null, "OpenDental.PatientL.GetMainTitleMidInsert", parameters))
{
retVal = (string)parameters[0];
}
_____________________________________________________________________
need this placed right after line 79 in OpenDental.PatientL please.
*********************************************************************************************************************
Second Hook
_____________________________________________________________________
Plugins.HookAddCode(this, "FormSplash.FormSplash_Load_end");
_____________________________________________________________________
obviously placed after line 29 of FormSplash.FormSplash_Load.
Thanks!
object[] parameters = {retVal};
if (Plugins.HookMethod(null, "OpenDental.PatientL.GetMainTitleMidInsert", parameters))
{
retVal = (string)parameters[0];
}
_____________________________________________________________________
need this placed right after line 79 in OpenDental.PatientL please.
*********************************************************************************************************************
Second Hook
_____________________________________________________________________
Plugins.HookAddCode(this, "FormSplash.FormSplash_Load_end");
_____________________________________________________________________
obviously placed after line 29 of FormSplash.FormSplash_Load.
Thanks!
Re: Hook Request
I've created a task in our system so that this Hook Request doesn't get missed. It might take us a little longer than usual to add this hook due to our programming resources being stretched pretty thin atm. Should be added by next week I'd imagine.
The best thing about a boolean is even if you are wrong, you are only off by a bit.
Jason Salmon
Open Dental Software
http://www.opendental.com
Jason Salmon
Open Dental Software
http://www.opendental.com
Re: Hook Request
I just figured out that the last request may not work? It compiles, but then it seems the number of plugins is still null for the program. I assume this is because it has not yet loaded the plugin info? Initially I was thinking I just had something improperly passed...
Would be nice to be able to use an embedded image in my plugin rather than have to copy and keep track of a *.jpg and a *.dll for a plugin to modify the splash screen.
Would be nice to be able to use an embedded image in my plugin rather than have to copy and keep track of a *.jpg and a *.dll for a plugin to modify the splash screen.
Re: Hook Request
So, unless you can make it work, I don't think my second request above will work. I see that plugins don't load until later and that is because the database is not yet connected, and all of that is supposed to run while the splash screen is showing, so I guess the *.jpg method you have implemented is the best workaround. If there is some other way to load an embedded image that I am not thinking of, let me know.
If you can still get the other hook entered, I would appreciate it. Thanks
If you can still get the other hook entered, I would appreciate it. Thanks
Re: Hook Request
The original splash is just an embedded resource. The *.jpg method is the only way I'm aware of changing it other than going through a big headache of manipulating the resource.
I've got a programmer with the other hook on his TODO list.
I've got a programmer with the other hook on his TODO list.
The best thing about a boolean is even if you are wrong, you are only off by a bit.
Jason Salmon
Open Dental Software
http://www.opendental.com
Jason Salmon
Open Dental Software
http://www.opendental.com
Re: Hook Request
I actually have a modification I figured out that will allow me to hook the splash after the database is found. Currently the program reloads the splash screen after the database connection is established, so in that second time around, I can hook into it and then achieve the desired effect for my plugin. I will post that code shortly.
Re: Hook Request
This is Jordan. We are trying to add it, but it doesn't follow any of the patterns on our hooks page. Notice how HookMethods always replace an entire method, so they contain a "return". But you seem to have more of a HookAddCode. The pattern needs to look more like the example:
It also needs to be tested by you before we add it. We don't want to add it, only to have to revise it again later.
Code: Select all
object[] parameters={myInt,myStr};
Plugins.HookAddCode(this,"FormClaim.GetClaims_beginning", parameters);
myInt=(int)parameters[0];
myStr=(string)parameters[1];
Re: Hook Request
Sorry, I didn't realize I left it as a "AddMethod" and not "addcode" after my testing. Yes, it was tested and works fine, but I revised it below to follow the patterns since I had combined examples by mistake. I just want to add a string(plugin name) to the retVal so it shows in the title bar. If you have a better way of doing it, then by all means replace it or give me an idea of what you think would be better. This works great and is simpler:
added at line 80 of OpenDental.PatientL
for the splash screen, I will continue to work on it...
Code: Select all
object[] parameters = {retVal};
Plugins.HookAddCode(null, "OpenDental.PatientL.GetMainTitleMidInsert", parameters);
retVal = (string)parameters[0];
for the splash screen, I will continue to work on it...
Re: Hook Request
***************************
For the splash screen this modification will make it work on the second showing after the database info is loaded. The user gets the normal splash initially and then my plugin additions will popup. Not what I initially hoped for, but works pretty well actually since a plugin is an add-on anyway and visually represents that to the user.
to line 30 of OpenDental.FormSplash.cs
The to make it work, the Plugins need to loaded just a bit earlier. If you move
in FormOpenDental.FormOpenDental_load from line 1662 (before loading the splash screen for the second time) up to 1627, it works great.
All is tested and working.
For the splash screen this modification will make it work on the second showing after the database info is loaded. The user gets the normal splash initially and then my plugin additions will popup. Not what I initially hoped for, but works pretty well actually since a plugin is an add-on anyway and visually represents that to the user.
Code: Select all
If (Plugins.PluginsAreLoaded) Plugins.HookAddCode(this, "FormSplash.FormSplash_Load_end");
The to make it work, the Plugins need to loaded just a bit earlier. If you move
Code: Select all
Plugins.LoadAllPlugins(this);
All is tested and working.
Re: Hook Request
I will work on adding this today.
Re: Hook Request
Thanks.
I have another request. In order to add a setup menu item for my plugin, I need menuItemSettings to be made public rather than private.
change line 66 in FormOpenDental.cs
FROM
***************
private System.Windows.Forms.MenuItem menuItemSettings;
***************
TO
***************
public System.Windows.Forms.MenuItem menuItemSettings;
***************
The hook is already present for me to use, just need this protection level changed. Thanks!
I have another request. In order to add a setup menu item for my plugin, I need menuItemSettings to be made public rather than private.
change line 66 in FormOpenDental.cs
FROM
***************
private System.Windows.Forms.MenuItem menuItemSettings;
***************
TO
***************
public System.Windows.Forms.MenuItem menuItemSettings;
***************
The hook is already present for me to use, just need this protection level changed. Thanks!
Re: Hook Request
Any idea when these recent hooks from a few of us developers will be processed? Thanks.
Re: Hook Request
David-drtech wrote:Thanks.
I have another request. In order to add a setup menu item for my plugin, I need menuItemSettings to be made public rather than private.
change line 66 in FormOpenDental.cs
FROM
***************
private System.Windows.Forms.MenuItem menuItemSettings;
***************
TO
***************
public System.Windows.Forms.MenuItem menuItemSettings;
***************
The hook is already present for me to use, just need this protection level changed. Thanks!
Sorry to butt in , but do you just want to add a custom menuItem somewhere? PM me, you can do that without OD staff having to change the access modifier for that control
Cheers,
Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA
Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA
Re: Hook Request
For this change could you give me the code around it so I can get this in the correct place. Currently if I place it on the line it will not compile.drtech wrote:***************************
The to make it work, the Plugins need to loaded just a bit earlier. If you movein FormOpenDental.FormOpenDental_load from line 1662 (before loading the splash screen for the second time) up to 1627, it works great.Code: Select all
Plugins.LoadAllPlugins(this);
All is tested and working.
Re: Hook Request
if(!formChooseDb.TryToConnect()) {
formChooseDb.ShowDialog();
if(formChooseDb.DialogResult==DialogResult.Cancel) {
Application.Exit();
return;
}
}
}
else {
formChooseDb.ShowDialog();
if(formChooseDb.DialogResult==DialogResult.Cancel) {
Application.Exit();
return;
}
}
Cursor=Cursors.WaitCursor;
Plugins.LoadAllPlugins(this);//moved again for splash screen plugins-->moved up from right after optimizing tooth chart graphics. New position might cause problems.
Splash = new FormSplash();
if(CommandLineArgs.Length==0) {
Splash.Show();
}
if(!PrefsStartup()){//looks for the AtoZ folder here, but would like to eventually move that down to after login
Cursor=Cursors.Default;
Splash.Dispose();
Application.Exit();
return;
}
__________________________________________________________________________________---
this is the new position and compiles and runs fine if you place it here. Thanks, David.
formChooseDb.ShowDialog();
if(formChooseDb.DialogResult==DialogResult.Cancel) {
Application.Exit();
return;
}
}
}
else {
formChooseDb.ShowDialog();
if(formChooseDb.DialogResult==DialogResult.Cancel) {
Application.Exit();
return;
}
}
Cursor=Cursors.WaitCursor;
Plugins.LoadAllPlugins(this);//moved again for splash screen plugins-->moved up from right after optimizing tooth chart graphics. New position might cause problems.
Splash = new FormSplash();
if(CommandLineArgs.Length==0) {
Splash.Show();
}
if(!PrefsStartup()){//looks for the AtoZ folder here, but would like to eventually move that down to after login
Cursor=Cursors.Default;
Splash.Dispose();
Application.Exit();
return;
}
__________________________________________________________________________________---
this is the new position and compiles and runs fine if you place it here. Thanks, David.
Re: Hook Request
DrTech,
Were you able to access the private control through our public Controls property?
http://www.opendental.com/manual/plugins.html
1. To access the private controls on an existing form from outside the form, look through the public Controls property as shown in the posted example.
Changing the privacy setting on a control to public is generally not good practice, but you should still be able to access it this way.
Were you able to access the private control through our public Controls property?
http://www.opendental.com/manual/plugins.html
1. To access the private controls on an existing form from outside the form, look through the public Controls property as shown in the posted example.
Changing the privacy setting on a control to public is generally not good practice, but you should still be able to access it this way.
Re: Hook Request
Due to moving Plugins.LoadAllPlugins I am not going to backport this to the beta, but it will exist in the head.drtech wrote:***************************
For the splash screen this modification will make it work on the second showing after the database info is loaded. The user gets the normal splash initially and then my plugin additions will popup. Not what I initially hoped for, but works pretty well actually since a plugin is an add-on anyway and visually represents that to the user.to line 30 of OpenDental.FormSplash.csCode: Select all
If (Plugins.PluginsAreLoaded) Plugins.HookAddCode(this, "FormSplash.FormSplash_Load_end");
The to make it work, the Plugins need to loaded just a bit earlier. If you movein FormOpenDental.FormOpenDental_load from line 1662 (before loading the splash screen for the second time) up to 1627, it works great.Code: Select all
Plugins.LoadAllPlugins(this);
All is tested and working.
Re: Hook Request
This has been backported to the beta.drtech wrote:Sorry, I didn't realize I left it as a "AddMethod" and not "addcode" after my testing. Yes, it was tested and works fine, but I revised it below to follow the patterns since I had combined examples by mistake. I just want to add a string(plugin name) to the retVal so it shows in the title bar. If you have a better way of doing it, then by all means replace it or give me an idea of what you think would be better. This works great and is simpler:
added at line 80 of OpenDental.PatientLCode: Select all
object[] parameters = {retVal}; Plugins.HookAddCode(null, "OpenDental.PatientL.GetMainTitleMidInsert", parameters); retVal = (string)parameters[0];
for the splash screen, I will continue to work on it...
Re: Hook Request
Thanks for the other additions
Here is what I am doing, but this only works if the menu itself is public. I can't use "menuItemSettings.MenuItems.Add" or seem to add a menu item using the standard "Controls.Add"
wjstarck sent me an alternate method of adding a menu item, but I have not yet have time to try it out.....
No, I have added other controls to the forms and manipulated lots of other controls, but I can't seem to access menus through the "Controls" property.DrTech,
Were you able to access the private control through our public Controls property?
http://www.opendental.com/manual/plugins.html
1. To access the private controls on an existing form from outside the form, look through the public Controls property as shown in the posted example.
Changing the privacy setting on a control to public is generally not good practice, but you should still be able to access it this way.
Here is what I am doing, but this only works if the menu itself is public. I can't use "menuItemSettings.MenuItems.Add" or seem to add a menu item using the standard "Controls.Add"
Code: Select all
public static void OpenDental_Load_end(OpenDental.FormOpenDental sender)
{
formModuleSetupP = new FormModuleSetupP();
MenuItem mnu = new MenuItem();
mnu.Text = "Plugin Customized Setup";
mnu.Name = "PluginSetup";
mnu.Index = 0;
mnu.Click += formModuleSetupP.aGoldPluginOptionsToolStripMenuItem1_Click;
sender.menuItemSettings.MenuItems.Add(0, mnu);
}