Plugin access to forms
Posted: Fri Nov 16, 2018 4:21 pm
My company is wanting to upgrade to Open Dental 18.2 from 17.3 and we have several plugins that I have been testing to make sure they will work with the new version. I am seeing that version 17.3 of the forms in the Open Dental project inherited from ODForm, which in turn inherited from the standard System.Windows.Forms.Form. This enabled us to add a button to a form from a hook that fired off at the end of the form load.
So if the hook looks some thing like this:
Then we can do something like this:
formPatientEdit was the instance of the form sent to the hook as the sender input parameter. I just cast it as a FormPatientEdit. And once the control has been added to the form, clicking on it will call the method "btnGreatAndWondrous_Click" which is in the plugin code.
Now that I've downloaded 18.2, the plugin is failing on the line "formPatientEdit.Controls.Add(myButton);" because "Controls" is not a property of the form object anymore. The OpenDental project forms still inherit from ODForms, but now ODForms inherits from ODFormsAbs<Signalod> implements ISignalProcessor. When I reference formPatientEdit, the only methods available me are:
Is this something that isn't possible anymore or is there a new way of doing it that I just have not been able to find?
Thanks,
Dirk
So if the hook looks some thing like this:
Code: Select all
Plugins.HookAddCode(this,"FormPatientEdit.Load_end",PatCur);Code: Select all
OpenDental.UI.Button myButton = new OpenDental.UI.Button();
myButton.Name = "btnGreatAndWondrous";
myButton.Text = "Great and Wondrous Button";
myButton.Location = new System.Drawing.Point(8, 665);
myButton.Size = new System.Drawing.Size(115, 26);
myButton.Click += btnGreatAndWondrous_Click;
formPatientEdit.Controls.Add(myButton);
Now that I've downloaded 18.2, the plugin is failing on the line "formPatientEdit.Controls.Add(myButton);" because "Controls" is not a property of the form object anymore. The OpenDental project forms still inherit from ODForms, but now ODForms inherits from ODFormsAbs<Signalod> implements ISignalProcessor. When I reference formPatientEdit, the only methods available me are:
- - Equals
- GetHashCode
- GetType
- OnProcessObjects
- OnProcessSignals
- ShowHelp
- ToString
Is this something that isn't possible anymore or is there a new way of doing it that I just have not been able to find?
Thanks,
Dirk